@nocobase/cli-v1 2.1.0-beta.30 → 2.1.0-beta.32

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 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-beta.30",
3
+ "version": "2.1.0-beta.32",
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-beta.30",
11
+ "@nocobase/cli": "2.1.0-beta.32",
12
12
  "@nocobase/license-kit": "^0.3.8",
13
- "@nocobase/utils": "2.1.0-beta.30",
13
+ "@nocobase/utils": "2.1.0-beta.32",
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-beta.30"
31
+ "@nocobase/devtools": "2.1.0-beta.32"
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": "1a493069cd0d8a4f403668bfe592879678c894b2"
38
+ "gitHead": "659c5efe992da7118d33c768bbd9e837a2c4716f"
39
39
  }
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;