@nocobase/cli 1.0.0-alpha.1 → 1.0.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/nocobase.conf.tpl +20 -13
- package/package.json +4 -4
- package/src/cli.js +9 -0
- package/src/commands/build.js +9 -0
- package/src/commands/clean.js +9 -0
- package/src/commands/create-nginx-conf.js +9 -0
- package/src/commands/create-plugin.js +9 -0
- package/src/commands/dev.js +9 -0
- package/src/commands/doc.js +9 -0
- package/src/commands/e2e.js +9 -7
- package/src/commands/global.js +9 -0
- package/src/commands/index.js +9 -0
- package/src/commands/p-test.js +11 -1
- package/src/commands/pm2.js +9 -0
- package/src/commands/postinstall.js +9 -0
- package/src/commands/start.js +9 -0
- package/src/commands/tar.js +9 -0
- package/src/commands/test-coverage.js +9 -0
- package/src/commands/test.js +9 -0
- package/src/commands/umi.js +9 -0
- package/src/commands/upgrade.js +9 -0
- package/src/index.js +9 -0
- package/src/plugin-generator.js +9 -0
- package/src/util.js +12 -0
- package/templates/plugin/src/client/client.d.ts +249 -0
package/nocobase.conf.tpl
CHANGED
|
@@ -30,6 +30,26 @@ server {
|
|
|
30
30
|
autoindex off;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
location {{publicPath}}static/plugins/ {
|
|
34
|
+
alias {{cwd}}/node_modules/;
|
|
35
|
+
expires 365d;
|
|
36
|
+
add_header Cache-Control "public";
|
|
37
|
+
access_log off;
|
|
38
|
+
autoindex off;
|
|
39
|
+
|
|
40
|
+
location ~ ^/static/plugins/@([^/]+)/([^/]+)/dist/client/(.*)$ {
|
|
41
|
+
allow all;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
location ~ ^/static/plugins/([^/]+)/dist/client/(.*)$ {
|
|
45
|
+
allow all;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
location ~ ^/static/plugins/(.*)$ {
|
|
49
|
+
deny all;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
33
53
|
location {{publicPath}} {
|
|
34
54
|
alias {{cwd}}/node_modules/@nocobase/app/dist/client/;
|
|
35
55
|
try_files $uri $uri/ /index.html;
|
|
@@ -58,19 +78,6 @@ server {
|
|
|
58
78
|
send_timeout 600;
|
|
59
79
|
}
|
|
60
80
|
|
|
61
|
-
location ^~ {{publicPath}}static/plugins/ {
|
|
62
|
-
proxy_pass http://127.0.0.1:{{apiPort}}{{publicPath}}static/plugins/;
|
|
63
|
-
proxy_http_version 1.1;
|
|
64
|
-
proxy_set_header Upgrade $http_upgrade;
|
|
65
|
-
proxy_set_header Connection 'upgrade';
|
|
66
|
-
proxy_set_header Host $host;
|
|
67
|
-
proxy_cache_bypass $http_upgrade;
|
|
68
|
-
proxy_connect_timeout 600;
|
|
69
|
-
proxy_send_timeout 600;
|
|
70
|
-
proxy_read_timeout 600;
|
|
71
|
-
send_timeout 600;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
81
|
location {{publicPath}}ws {
|
|
75
82
|
proxy_pass http://127.0.0.1:{{apiPort}}{{publicPath}}ws;
|
|
76
83
|
proxy_http_version 1.1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/cli",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.11",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"nocobase": "./bin/index.js"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@nocobase/app": "1.0.0-alpha.
|
|
11
|
+
"@nocobase/app": "1.0.0-alpha.11",
|
|
12
12
|
"@types/fs-extra": "^11.0.1",
|
|
13
13
|
"@umijs/utils": "3.5.20",
|
|
14
14
|
"chalk": "^4.1.1",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"tsx": "^4.6.2"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@nocobase/devtools": "1.0.0-alpha.
|
|
28
|
+
"@nocobase/devtools": "1.0.0-alpha.11"
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|
|
31
31
|
"type": "git",
|
|
32
32
|
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
33
33
|
"directory": "packages/core/cli"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "00ffb260456e5a22701fd16c87112a92708d9dc1"
|
|
36
36
|
}
|
package/src/cli.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
const { Command } = require('commander');
|
|
2
11
|
const commands = require('./commands');
|
|
3
12
|
|
package/src/commands/build.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
const { resolve } = require('path');
|
|
2
11
|
const { Command } = require('commander');
|
|
3
12
|
const { run, nodeCheck, isPackageValid, buildIndexHtml } = require('../util');
|
package/src/commands/clean.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
const chalk = require('chalk');
|
|
2
11
|
const { Command } = require('commander');
|
|
3
12
|
const { run, isDev } = require('../util');
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
const { resolve } = require('path');
|
|
2
11
|
const { Command } = require('commander');
|
|
3
12
|
const { readFileSync, writeFileSync } = require('fs');
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
const { resolve } = require('path');
|
|
2
11
|
const { Command } = require('commander');
|
|
3
12
|
const { PluginGenerator } = require('../plugin-generator');
|
package/src/commands/dev.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
const chalk = require('chalk');
|
|
2
11
|
const { Command } = require('commander');
|
|
3
12
|
const { runAppCommand, runInstall, run, postCheck, nodeCheck, promptForTs } = require('../util');
|
package/src/commands/doc.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
const { Command } = require('commander');
|
|
2
11
|
const { resolve, isAbsolute } = require('path');
|
|
3
12
|
const { run, isDev } = require('../util');
|
package/src/commands/e2e.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
const { Command } = require('commander');
|
|
2
11
|
const { run, isPortReachable } = require('../util');
|
|
3
12
|
const { execSync } = require('node:child_process');
|
|
@@ -139,9 +148,6 @@ const filterArgv = () => {
|
|
|
139
148
|
if (element.startsWith('--url=')) {
|
|
140
149
|
continue;
|
|
141
150
|
}
|
|
142
|
-
if (element === '--skip-reporter') {
|
|
143
|
-
continue;
|
|
144
|
-
}
|
|
145
151
|
if (element === '--build') {
|
|
146
152
|
continue;
|
|
147
153
|
}
|
|
@@ -169,7 +175,6 @@ module.exports = (cli) => {
|
|
|
169
175
|
.command('test')
|
|
170
176
|
.allowUnknownOption()
|
|
171
177
|
.option('--url [url]')
|
|
172
|
-
.option('--skip-reporter')
|
|
173
178
|
.option('--build')
|
|
174
179
|
.option('--production')
|
|
175
180
|
.action(async (options) => {
|
|
@@ -181,9 +186,6 @@ module.exports = (cli) => {
|
|
|
181
186
|
process.env.APP_ENV = 'production';
|
|
182
187
|
await run('yarn', ['build']);
|
|
183
188
|
}
|
|
184
|
-
if (options.skipReporter) {
|
|
185
|
-
process.env.PLAYWRIGHT_SKIP_REPORTER = true;
|
|
186
|
-
}
|
|
187
189
|
if (options.url) {
|
|
188
190
|
process.env.APP_BASE_URL = options.url.replace('localhost', '127.0.0.1');
|
|
189
191
|
} else {
|
package/src/commands/global.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
const { Command } = require('commander');
|
|
2
11
|
const { run, isDev, isProd, promptForTs } = require('../util');
|
|
3
12
|
|
package/src/commands/index.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
const { Command } = require('commander');
|
|
2
11
|
const { isPackageValid, generateAppDir } = require('../util');
|
|
3
12
|
|
package/src/commands/p-test.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
const execa = require('execa');
|
|
2
11
|
const { resolve } = require('path');
|
|
3
12
|
const pAll = require('p-all');
|
|
@@ -34,7 +43,7 @@ async function runApp(dir, index = 0) {
|
|
|
34
43
|
await client.query(`DROP DATABASE IF EXISTS "${database}"`);
|
|
35
44
|
await client.query(`CREATE DATABASE "${database}";`);
|
|
36
45
|
await client.end();
|
|
37
|
-
return execa('yarn', ['nocobase', 'e2e', 'test', dir
|
|
46
|
+
return execa('yarn', ['nocobase', 'e2e', 'test', dir], {
|
|
38
47
|
shell: true,
|
|
39
48
|
stdio: 'inherit',
|
|
40
49
|
env: {
|
|
@@ -49,6 +58,7 @@ async function runApp(dir, index = 0) {
|
|
|
49
58
|
SOCKET_PATH: `storage/e2e/gateway-e2e-${index}.sock`,
|
|
50
59
|
PM2_HOME: resolve(process.cwd(), `storage/e2e/.pm2-${index}`),
|
|
51
60
|
PLAYWRIGHT_AUTH_FILE: resolve(process.cwd(), `storage/playwright/.auth/admin-${index}.json`),
|
|
61
|
+
E2E_JOB_ID: index,
|
|
52
62
|
},
|
|
53
63
|
});
|
|
54
64
|
}
|
package/src/commands/pm2.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
const chalk = require('chalk');
|
|
2
11
|
const { Command } = require('commander');
|
|
3
12
|
const { run, isDev } = require('../util');
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
const { Command } = require('commander');
|
|
2
11
|
const { run, isDev, isPackageValid, generatePlaywrightPath } = require('../util');
|
|
3
12
|
const { resolve } = require('path');
|
package/src/commands/start.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
const { Command } = require('commander');
|
|
2
11
|
const { isDev, run, postCheck, runInstall, promptForTs } = require('../util');
|
|
3
12
|
const { existsSync, rmSync } = require('fs');
|
package/src/commands/tar.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
const { resolve } = require('path');
|
|
2
11
|
const { Command } = require('commander');
|
|
3
12
|
const { run, nodeCheck, isPackageValid } = require('../util');
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
const { run } = require('../util');
|
|
2
11
|
const fg = require('fast-glob');
|
|
3
12
|
|
package/src/commands/test.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
const { Command } = require('commander');
|
|
2
11
|
const { run } = require('../util');
|
|
3
12
|
const path = require('path');
|
package/src/commands/umi.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
const chalk = require('chalk');
|
|
2
11
|
const { Command } = require('commander');
|
|
3
12
|
const { run, isDev } = require('../util');
|
package/src/commands/upgrade.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
const chalk = require('chalk');
|
|
2
11
|
const { Command } = require('commander');
|
|
3
12
|
const { resolve } = require('path');
|
package/src/index.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
const util = require('./util');
|
|
2
11
|
|
|
3
12
|
module.exports = {
|
package/src/plugin-generator.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
const chalk = require('chalk');
|
|
2
11
|
const { existsSync } = require('fs');
|
|
3
12
|
const { join, resolve } = require('path');
|
package/src/util.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
const net = require('net');
|
|
2
11
|
const chalk = require('chalk');
|
|
3
12
|
const execa = require('execa');
|
|
@@ -219,6 +228,9 @@ exports.genTsConfigPaths = function genTsConfigPaths() {
|
|
|
219
228
|
paths[`${packageJsonName}/e2e`] = [`${relativePath}/src/e2e`];
|
|
220
229
|
paths[`${packageJsonName}/web`] = [`${relativePath}/src/web`];
|
|
221
230
|
}
|
|
231
|
+
if (packageJsonName === '@nocobase/client') {
|
|
232
|
+
paths[`${packageJsonName}/demo-utils`] = [`${relativePath}/src/demo-utils`];
|
|
233
|
+
}
|
|
222
234
|
if (packageJsonName === '@nocobase/plugin-workflow-test') {
|
|
223
235
|
paths[`${packageJsonName}/e2e`] = [`${relativePath}/src/e2e`];
|
|
224
236
|
}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// CSS modules
|
|
11
|
+
type CSSModuleClasses = { readonly [key: string]: string };
|
|
12
|
+
|
|
13
|
+
declare module '*.module.css' {
|
|
14
|
+
const classes: CSSModuleClasses;
|
|
15
|
+
export default classes;
|
|
16
|
+
}
|
|
17
|
+
declare module '*.module.scss' {
|
|
18
|
+
const classes: CSSModuleClasses;
|
|
19
|
+
export default classes;
|
|
20
|
+
}
|
|
21
|
+
declare module '*.module.sass' {
|
|
22
|
+
const classes: CSSModuleClasses;
|
|
23
|
+
export default classes;
|
|
24
|
+
}
|
|
25
|
+
declare module '*.module.less' {
|
|
26
|
+
const classes: CSSModuleClasses;
|
|
27
|
+
export default classes;
|
|
28
|
+
}
|
|
29
|
+
declare module '*.module.styl' {
|
|
30
|
+
const classes: CSSModuleClasses;
|
|
31
|
+
export default classes;
|
|
32
|
+
}
|
|
33
|
+
declare module '*.module.stylus' {
|
|
34
|
+
const classes: CSSModuleClasses;
|
|
35
|
+
export default classes;
|
|
36
|
+
}
|
|
37
|
+
declare module '*.module.pcss' {
|
|
38
|
+
const classes: CSSModuleClasses;
|
|
39
|
+
export default classes;
|
|
40
|
+
}
|
|
41
|
+
declare module '*.module.sss' {
|
|
42
|
+
const classes: CSSModuleClasses;
|
|
43
|
+
export default classes;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// CSS
|
|
47
|
+
declare module '*.css' { }
|
|
48
|
+
declare module '*.scss' { }
|
|
49
|
+
declare module '*.sass' { }
|
|
50
|
+
declare module '*.less' { }
|
|
51
|
+
declare module '*.styl' { }
|
|
52
|
+
declare module '*.stylus' { }
|
|
53
|
+
declare module '*.pcss' { }
|
|
54
|
+
declare module '*.sss' { }
|
|
55
|
+
|
|
56
|
+
// Built-in asset types
|
|
57
|
+
// see `src/node/constants.ts`
|
|
58
|
+
|
|
59
|
+
// images
|
|
60
|
+
declare module '*.apng' {
|
|
61
|
+
const src: string;
|
|
62
|
+
export default src;
|
|
63
|
+
}
|
|
64
|
+
declare module '*.png' {
|
|
65
|
+
const src: string;
|
|
66
|
+
export default src;
|
|
67
|
+
}
|
|
68
|
+
declare module '*.jpg' {
|
|
69
|
+
const src: string;
|
|
70
|
+
export default src;
|
|
71
|
+
}
|
|
72
|
+
declare module '*.jpeg' {
|
|
73
|
+
const src: string;
|
|
74
|
+
export default src;
|
|
75
|
+
}
|
|
76
|
+
declare module '*.jfif' {
|
|
77
|
+
const src: string;
|
|
78
|
+
export default src;
|
|
79
|
+
}
|
|
80
|
+
declare module '*.pjpeg' {
|
|
81
|
+
const src: string;
|
|
82
|
+
export default src;
|
|
83
|
+
}
|
|
84
|
+
declare module '*.pjp' {
|
|
85
|
+
const src: string;
|
|
86
|
+
export default src;
|
|
87
|
+
}
|
|
88
|
+
declare module '*.gif' {
|
|
89
|
+
const src: string;
|
|
90
|
+
export default src;
|
|
91
|
+
}
|
|
92
|
+
declare module '*.svg' {
|
|
93
|
+
const src: string;
|
|
94
|
+
export default src;
|
|
95
|
+
}
|
|
96
|
+
declare module '*.ico' {
|
|
97
|
+
const src: string;
|
|
98
|
+
export default src;
|
|
99
|
+
}
|
|
100
|
+
declare module '*.webp' {
|
|
101
|
+
const src: string;
|
|
102
|
+
export default src;
|
|
103
|
+
}
|
|
104
|
+
declare module '*.avif' {
|
|
105
|
+
const src: string;
|
|
106
|
+
export default src;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// media
|
|
110
|
+
declare module '*.mp4' {
|
|
111
|
+
const src: string;
|
|
112
|
+
export default src;
|
|
113
|
+
}
|
|
114
|
+
declare module '*.webm' {
|
|
115
|
+
const src: string;
|
|
116
|
+
export default src;
|
|
117
|
+
}
|
|
118
|
+
declare module '*.ogg' {
|
|
119
|
+
const src: string;
|
|
120
|
+
export default src;
|
|
121
|
+
}
|
|
122
|
+
declare module '*.mp3' {
|
|
123
|
+
const src: string;
|
|
124
|
+
export default src;
|
|
125
|
+
}
|
|
126
|
+
declare module '*.wav' {
|
|
127
|
+
const src: string;
|
|
128
|
+
export default src;
|
|
129
|
+
}
|
|
130
|
+
declare module '*.flac' {
|
|
131
|
+
const src: string;
|
|
132
|
+
export default src;
|
|
133
|
+
}
|
|
134
|
+
declare module '*.aac' {
|
|
135
|
+
const src: string;
|
|
136
|
+
export default src;
|
|
137
|
+
}
|
|
138
|
+
declare module '*.opus' {
|
|
139
|
+
const src: string;
|
|
140
|
+
export default src;
|
|
141
|
+
}
|
|
142
|
+
declare module '*.mov' {
|
|
143
|
+
const src: string;
|
|
144
|
+
export default src;
|
|
145
|
+
}
|
|
146
|
+
declare module '*.m4a' {
|
|
147
|
+
const src: string;
|
|
148
|
+
export default src;
|
|
149
|
+
}
|
|
150
|
+
declare module '*.vtt' {
|
|
151
|
+
const src: string;
|
|
152
|
+
export default src;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// fonts
|
|
156
|
+
declare module '*.woff' {
|
|
157
|
+
const src: string;
|
|
158
|
+
export default src;
|
|
159
|
+
}
|
|
160
|
+
declare module '*.woff2' {
|
|
161
|
+
const src: string;
|
|
162
|
+
export default src;
|
|
163
|
+
}
|
|
164
|
+
declare module '*.eot' {
|
|
165
|
+
const src: string;
|
|
166
|
+
export default src;
|
|
167
|
+
}
|
|
168
|
+
declare module '*.ttf' {
|
|
169
|
+
const src: string;
|
|
170
|
+
export default src;
|
|
171
|
+
}
|
|
172
|
+
declare module '*.otf' {
|
|
173
|
+
const src: string;
|
|
174
|
+
export default src;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// other
|
|
178
|
+
declare module '*.webmanifest' {
|
|
179
|
+
const src: string;
|
|
180
|
+
export default src;
|
|
181
|
+
}
|
|
182
|
+
declare module '*.pdf' {
|
|
183
|
+
const src: string;
|
|
184
|
+
export default src;
|
|
185
|
+
}
|
|
186
|
+
declare module '*.txt' {
|
|
187
|
+
const src: string;
|
|
188
|
+
export default src;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// wasm?init
|
|
192
|
+
declare module '*.wasm?init' {
|
|
193
|
+
const initWasm: (options?: WebAssembly.Imports) => Promise<WebAssembly.Instance>;
|
|
194
|
+
export default initWasm;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// web worker
|
|
198
|
+
declare module '*?worker' {
|
|
199
|
+
const workerConstructor: {
|
|
200
|
+
new(options?: { name?: string }): Worker;
|
|
201
|
+
};
|
|
202
|
+
export default workerConstructor;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
declare module '*?worker&inline' {
|
|
206
|
+
const workerConstructor: {
|
|
207
|
+
new(options?: { name?: string }): Worker;
|
|
208
|
+
};
|
|
209
|
+
export default workerConstructor;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
declare module '*?worker&url' {
|
|
213
|
+
const src: string;
|
|
214
|
+
export default src;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
declare module '*?sharedworker' {
|
|
218
|
+
const sharedWorkerConstructor: {
|
|
219
|
+
new(options?: { name?: string }): SharedWorker;
|
|
220
|
+
};
|
|
221
|
+
export default sharedWorkerConstructor;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
declare module '*?sharedworker&inline' {
|
|
225
|
+
const sharedWorkerConstructor: {
|
|
226
|
+
new(options?: { name?: string }): SharedWorker;
|
|
227
|
+
};
|
|
228
|
+
export default sharedWorkerConstructor;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
declare module '*?sharedworker&url' {
|
|
232
|
+
const src: string;
|
|
233
|
+
export default src;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
declare module '*?raw' {
|
|
237
|
+
const src: string;
|
|
238
|
+
export default src;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
declare module '*?url' {
|
|
242
|
+
const src: string;
|
|
243
|
+
export default src;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
declare module '*?inline' {
|
|
247
|
+
const src: string;
|
|
248
|
+
export default src;
|
|
249
|
+
}
|