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