@nocobase/cli 1.4.0-alpha → 1.4.0-alpha.0

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/bin/index.js CHANGED
@@ -11,6 +11,14 @@ if (require('semver').satisfies(process.version, '<16')) {
11
11
  process.exit(1);
12
12
  }
13
13
 
14
+ if (__dirname.includes(' ')) {
15
+ console.error(chalk.red(`[nocobase cli]: PathError: Invalid path "${process.cwd()}"`));
16
+ console.error(
17
+ chalk.red('[nocobase cli]: PathError: The path cannot contain spaces. Please modify the path and try again.'),
18
+ );
19
+ process.exit(1);
20
+ }
21
+
14
22
  // if (require('semver').satisfies(process.version, '>16') && !process.env.UNSET_NODE_OPTIONS) {
15
23
  // if (process.env.NODE_OPTIONS) {
16
24
  // let opts = process.env.NODE_OPTIONS;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/cli",
3
- "version": "1.4.0-alpha",
3
+ "version": "1.4.0-alpha.0",
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.4.0-alpha",
11
+ "@nocobase/app": "1.4.0-alpha.0",
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.19.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@nocobase/devtools": "1.4.0-alpha"
28
+ "@nocobase/devtools": "1.4.0-alpha.0"
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": "f097a2bddec152522b5645bd5d451f4c866d2060"
35
+ "gitHead": "8ffa7b54bbaf720c0c9857da4b19a99110dffc4b"
36
36
  }
@@ -38,16 +38,16 @@ module.exports = (cli) => {
38
38
  depth: 1, // 只监听第一层目录
39
39
  });
40
40
 
41
+ await fs.promises.mkdir(path.dirname(process.env.WATCH_FILE), { recursive: true });
42
+
41
43
  watcher
42
44
  .on('addDir', async (pathname) => {
43
45
  generatePlugins();
44
- const file = path.resolve(process.cwd(), 'storage/app.watch.ts');
45
- await fs.promises.writeFile(file, `export const watchId = '${uid()}';`, 'utf-8');
46
+ await fs.promises.writeFile(process.env.WATCH_FILE, `export const watchId = '${uid()}';`, 'utf-8');
46
47
  })
47
48
  .on('unlinkDir', async (pathname) => {
48
49
  generatePlugins();
49
- const file = path.resolve(process.cwd(), 'storage/app.watch.ts');
50
- await fs.promises.writeFile(file, `export const watchId = '${uid()}';`, 'utf-8');
50
+ await fs.promises.writeFile(process.env.WATCH_FILE, `export const watchId = '${uid()}';`, 'utf-8');
51
51
  });
52
52
 
53
53
  promptForTs();
package/src/util.js CHANGED
@@ -350,6 +350,7 @@ exports.initEnv = function initEnv() {
350
350
  LOGGER_BASE_PATH: 'storage/logs',
351
351
  APP_SERVER_BASE_URL: '',
352
352
  APP_PUBLIC_PATH: '/',
353
+ WATCH_FILE: resolve(process.cwd(), 'storage/app.watch.ts'),
353
354
  };
354
355
 
355
356
  if (