@nocobase/cli-v1 2.1.0-alpha.33 → 2.1.0-alpha.35
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 +10 -0
- package/package.json +5 -5
- package/src/commands/pkg.js +2 -2
- package/src/commands/postinstall.js +2 -3
- package/src/util.js +33 -0
package/nocobase.conf.tpl
CHANGED
|
@@ -33,9 +33,19 @@ server {
|
|
|
33
33
|
gzip on;
|
|
34
34
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
|
35
35
|
|
|
36
|
+
location ~* ^{{publicPath}}storage/uploads/(.*\.(?:htm|html|svg|svgz|xhtml))$ {
|
|
37
|
+
alias {{cwd}}/storage/uploads/$1;
|
|
38
|
+
add_header Cache-Control "public";
|
|
39
|
+
add_header Content-Disposition "attachment" always;
|
|
40
|
+
add_header X-Content-Type-Options "nosniff" always;
|
|
41
|
+
access_log off;
|
|
42
|
+
autoindex off;
|
|
43
|
+
}
|
|
44
|
+
|
|
36
45
|
location {{publicPath}}storage/uploads/ {
|
|
37
46
|
alias {{cwd}}/storage/uploads/;
|
|
38
47
|
add_header Cache-Control "public";
|
|
48
|
+
add_header X-Content-Type-Options "nosniff" always;
|
|
39
49
|
access_log off;
|
|
40
50
|
autoindex off;
|
|
41
51
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/cli-v1",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.35",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"nocobase-v1": "./bin/index.js"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@nocobase/cli": "2.1.0-alpha.
|
|
11
|
+
"@nocobase/cli": "2.1.0-alpha.35",
|
|
12
12
|
"@nocobase/license-kit": "^0.3.8",
|
|
13
|
-
"@nocobase/utils": "2.1.0-alpha.
|
|
13
|
+
"@nocobase/utils": "2.1.0-alpha.35",
|
|
14
14
|
"@types/fs-extra": "^11.0.1",
|
|
15
15
|
"@umijs/utils": "3.5.20",
|
|
16
16
|
"chalk": "^4.1.1",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"tsx": "^4.19.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@nocobase/devtools": "2.1.0-alpha.
|
|
31
|
+
"@nocobase/devtools": "2.1.0-alpha.35"
|
|
32
32
|
},
|
|
33
33
|
"repository": {
|
|
34
34
|
"type": "git",
|
|
35
35
|
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
36
36
|
"directory": "packages/core/cli"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "313a9e19e84a99924c86f9855c2ae48943f450b0"
|
|
39
39
|
}
|
package/src/commands/pkg.js
CHANGED
|
@@ -13,7 +13,7 @@ const fs = require('fs-extra');
|
|
|
13
13
|
const zlib = require('zlib');
|
|
14
14
|
const tar = require('tar');
|
|
15
15
|
const path = require('path');
|
|
16
|
-
const {
|
|
16
|
+
const { syncPluginSymlinks, resolvePluginStoragePath } = require('@nocobase/utils/plugin-symlink');
|
|
17
17
|
const { getAccessKeyPair, showLicenseInfo, LicenseKeyError } = require('../license');
|
|
18
18
|
const { logger } = require('../logger');
|
|
19
19
|
|
|
@@ -313,7 +313,7 @@ module.exports = (cli) => {
|
|
|
313
313
|
const file = path.resolve(__dirname, '../../package.json');
|
|
314
314
|
const json = await fs.readJson(file);
|
|
315
315
|
await pm.download({ version: json.version });
|
|
316
|
-
await
|
|
316
|
+
await syncPluginSymlinks();
|
|
317
317
|
});
|
|
318
318
|
pkg.command('export-all').action(async () => {
|
|
319
319
|
logger.info('Todo...');
|
|
@@ -12,7 +12,7 @@ const { run, isDev, isPackageValid, generatePlaywrightPath, generatePlugins } =
|
|
|
12
12
|
const { dirname, resolve } = require('path');
|
|
13
13
|
const { existsSync, mkdirSync, readFileSync, appendFileSync } = require('fs');
|
|
14
14
|
const { readFile, writeFile } = require('fs').promises;
|
|
15
|
-
const {
|
|
15
|
+
const { syncPluginSymlinks } = require('@nocobase/utils/plugin-symlink');
|
|
16
16
|
|
|
17
17
|
function runPatchPackage() {
|
|
18
18
|
// run yarn patch-package
|
|
@@ -59,11 +59,10 @@ module.exports = (cli) => {
|
|
|
59
59
|
writeToExclude();
|
|
60
60
|
generatePlugins();
|
|
61
61
|
generatePlaywrightPath(true);
|
|
62
|
-
await
|
|
62
|
+
await syncPluginSymlinks();
|
|
63
63
|
if (!isDev()) {
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
|
-
await createDevPluginsSymlink();
|
|
67
66
|
const cwd = process.cwd();
|
|
68
67
|
if (!existsSync(resolve(cwd, '.env')) && existsSync(resolve(cwd, '.env.example'))) {
|
|
69
68
|
const content = await readFile(resolve(cwd, '.env.example'), 'utf-8');
|
package/src/util.js
CHANGED
|
@@ -227,6 +227,38 @@ exports.getVersion = async () => {
|
|
|
227
227
|
return versions[versions.length - 1];
|
|
228
228
|
};
|
|
229
229
|
|
|
230
|
+
function normalizeAppDevClientRsbuildConfig(appDevDir) {
|
|
231
|
+
const configPath = resolve(appDevDir, 'client/rsbuild.config.ts');
|
|
232
|
+
if (!existsSync(configPath)) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
const content = fs.readFileSync(configPath, 'utf-8');
|
|
236
|
+
const normalized = content.replace(
|
|
237
|
+
"require('../../devtools/package.json')",
|
|
238
|
+
"require('@nocobase/devtools/package.json')",
|
|
239
|
+
);
|
|
240
|
+
if (normalized !== content) {
|
|
241
|
+
fs.writeFileSync(configPath, normalized, 'utf-8');
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function normalizeAppDevClientV2Tsconfig(appDevDir) {
|
|
246
|
+
const tsconfigPath = resolve(appDevDir, 'client-v2/tsconfig.json');
|
|
247
|
+
if (!existsSync(tsconfigPath)) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
const tsconfig = JSON.parse(fs.readFileSync(tsconfigPath, 'utf-8'));
|
|
251
|
+
tsconfig.extends = '../../../tsconfig.json';
|
|
252
|
+
tsconfig.compilerOptions = tsconfig.compilerOptions || {};
|
|
253
|
+
tsconfig.compilerOptions.baseUrl = '../../../';
|
|
254
|
+
fs.writeFileSync(tsconfigPath, `${JSON.stringify(tsconfig, null, 2)}\n`, 'utf-8');
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function normalizeAppDevFiles(appDevDir) {
|
|
258
|
+
normalizeAppDevClientRsbuildConfig(appDevDir);
|
|
259
|
+
normalizeAppDevClientV2Tsconfig(appDevDir);
|
|
260
|
+
}
|
|
261
|
+
|
|
230
262
|
exports.generateAppDir = function generateAppDir() {
|
|
231
263
|
const appPkgPath = dirname(dirname(require.resolve('@nocobase/app/src/index.ts')));
|
|
232
264
|
const appDevDir = resolve(process.cwd(), './storage/.app-dev');
|
|
@@ -238,6 +270,7 @@ exports.generateAppDir = function generateAppDir() {
|
|
|
238
270
|
force: true,
|
|
239
271
|
});
|
|
240
272
|
}
|
|
273
|
+
normalizeAppDevFiles(appDevDir);
|
|
241
274
|
process.env.APP_PACKAGE_ROOT = appDevDir;
|
|
242
275
|
} else {
|
|
243
276
|
process.env.APP_PACKAGE_ROOT = appPkgPath;
|