mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
workspace: add additional folder modules
This commit is contained in:
1 parent
9343182607
commit
eff22e1506
4 files changed
+13
-13
No files matched your search
@@ -46,6 +46,7 @@ packages/ui-default/public
|
||||
packages/ui-default/misc/.iconfont
|
||||
packages/ui-default/static/locale
|
||||
plugins/
|
||||
modules/
|
||||
|
||||
# Data files
|
||||
*.mmdb
|
||||
|
||||
+7
-10
@@ -56,27 +56,24 @@ const configFlat = (name) => ({
|
||||
exclude: ['public'],
|
||||
});
|
||||
|
||||
if (!fs.existsSync(path.resolve(process.cwd(), 'plugins'))) {
|
||||
fs.mkdirSync(path.resolve(process.cwd(), 'plugins'));
|
||||
for (const name of ['plugins', 'modules']) {
|
||||
if (!fs.existsSync(path.resolve(process.cwd(), name))) {
|
||||
fs.mkdirSync(path.resolve(process.cwd(), name));
|
||||
// Write an empty file to make eslint happy
|
||||
fs.writeFileSync(path.resolve(process.cwd(), 'plugins/eslint.ts'), '');
|
||||
fs.writeFileSync(path.resolve(process.cwd(), name, 'eslint.ts'), '');
|
||||
}
|
||||
}
|
||||
|
||||
const modules = [
|
||||
'packages/hydrooj',
|
||||
...fs.readdirSync(path.resolve(process.cwd(), 'packages')).map((i) => `packages/${i}`),
|
||||
...fs.readdirSync(path.resolve(process.cwd(), 'plugins')).map((i) => `plugins/${i}`),
|
||||
...['packages', 'plugins', 'modules'].flatMap((i) => fs.readdirSync(path.resolve(process.cwd(), i)).map((j) => `${i}/${j}`)),
|
||||
].filter((i) => !i.includes('/.') && !i.includes('ui-default')).filter((i) => fs.statSync(path.resolve(process.cwd(), i)).isDirectory());
|
||||
|
||||
const UIConfig = {
|
||||
exclude: [
|
||||
'packages/ui-default/public',
|
||||
],
|
||||
include: ['ts', 'tsx'].flatMap((i) => [
|
||||
`packages/ui-default/**/*.${i}`,
|
||||
`packages/**/public/**/*.${i}`,
|
||||
`plugins/**/public/**/*.${i}`,
|
||||
]),
|
||||
include: ['ts', 'tsx'].flatMap((ext) => [].map((name) => `${name}/**/public/**/*.${ext}`).concat(`packages/ui-default/**/*.${ext}`)),
|
||||
compilerOptions: {
|
||||
experimentalDecorators: true,
|
||||
esModuleInterop: true,
|
||||
|
||||
+4
-3
@@ -3,7 +3,8 @@
|
||||
"private": true,
|
||||
"workspaces": [
|
||||
"packages/*",
|
||||
"plugins/*"
|
||||
"plugins/*",
|
||||
"modules/*"
|
||||
],
|
||||
"main": "package.json",
|
||||
"scripts": {
|
||||
@@ -17,8 +18,8 @@
|
||||
"build:ui:production:webpack": "cross-env NODE_OPTIONS=--max_old_space_size=8192 node packages/ui-default/build --production",
|
||||
"test": "node test/entry.js",
|
||||
"benchmark": "cross-env BENCHMARK=true node test/entry.js",
|
||||
"lint": "eslint packages plugins --ext ts --fix",
|
||||
"lint:ci": "eslint packages plugins --ext ts",
|
||||
"lint": "eslint packages plugins modules --ext ts --fix",
|
||||
"lint:ci": "eslint packages plugins modules --ext ts",
|
||||
"lint:ui": "yarn workspace @hydrooj/ui-default lint --ext .js,.ts,.jsx,.tsx . --fix",
|
||||
"lint:ui:ci": "yarn workspace @hydrooj/ui-default lint --ext .js,.ts,.jsx,.tsx .",
|
||||
"debug": "node --trace-warnings --async-stack-traces --trace-deprecation packages/hydrooj/bin/hydrooj --debug --template",
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
packages:
|
||||
- packages/*
|
||||
- plugins/*
|
||||
- modules/*
|
||||
Reference in new issue
Block a user