@nocobase/cli-v1 3.0.0-alpha.6 → 3.0.0-alpha.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/cli-v1",
3
- "version": "3.0.0-alpha.6",
3
+ "version": "3.0.0-alpha.8",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./src/index.js",
@@ -9,9 +9,9 @@
9
9
  "nocobase-v1": "./bin/index.js"
10
10
  },
11
11
  "dependencies": {
12
- "@nocobase/cli": "3.0.0-alpha.6",
12
+ "@nocobase/cli": "3.0.0-alpha.8",
13
13
  "@nocobase/license-kit": "^0.3.8",
14
- "@nocobase/utils": "3.0.0-alpha.6",
14
+ "@nocobase/utils": "3.0.0-alpha.8",
15
15
  "chalk": "^4.1.1",
16
16
  "commander": "^9.2.0",
17
17
  "deepmerge": "^4.3.1",
@@ -33,5 +33,5 @@
33
33
  "url": "git+https://github.com/nocobase/nocobase.git",
34
34
  "directory": "packages/core/cli"
35
35
  },
36
- "gitHead": "3508eabe683b9a47a28d0f3425098eb58873a9d7"
36
+ "gitHead": "ce017f3deb8b2414c6b13818042c4187270d1d8a"
37
37
  }
@@ -87,6 +87,20 @@ describe('cli-v1 buildIndexHtml', () => {
87
87
  fs.removeSync(appRoot);
88
88
  });
89
89
 
90
+ test('injects settings-default as a valid client entry mode', () => {
91
+ const appRoot = createAppPackageRoot();
92
+ process.argv = ['node', 'nocobase-v1', 'start'];
93
+ process.env.APP_PACKAGE_ROOT = appRoot;
94
+ process.env.APP_PUBLIC_PATH = '/';
95
+ process.env.APP_CLIENT_ENTRY_MODE = 'settings-default';
96
+
97
+ buildIndexHtml();
98
+
99
+ const html = fs.readFileSync(path.join(appRoot, 'dist/client/index.html'), 'utf-8');
100
+ expect(html).toContain("window['__nocobase_app_client_entry_mode__'] = 'settings-default';");
101
+ fs.removeSync(appRoot);
102
+ });
103
+
90
104
  test('refreshes cached tpl when new runtime placeholders are missing', () => {
91
105
  const appRoot = createAppPackageRoot();
92
106
  const tplPath = path.join(appRoot, 'dist/client/index.html.tpl');
@@ -67,6 +67,16 @@ describe('cli-v1 dev command', () => {
67
67
  });
68
68
  });
69
69
 
70
+ test('resolveDevRuntimeMode keeps all clients in settings-default', () => {
71
+ expect(resolveDevRuntimeMode({ appClientEntryMode: 'settings-default' })).toMatchObject({
72
+ useModernOnlyEntryMode: false,
73
+ shouldRunClient: true,
74
+ shouldRunClientV2: true,
75
+ shouldRunSettings: true,
76
+ shouldRunServer: true,
77
+ });
78
+ });
79
+
70
80
  test('resolveDevRuntimeMode preserves explicit client-v2-only flag behavior', () => {
71
81
  expect(resolveDevRuntimeMode({ clientV2Only: true, appClientEntryMode: 'legacy-default' })).toMatchObject({
72
82
  useModernOnlyEntryMode: false,
package/src/util.js CHANGED
@@ -433,7 +433,7 @@ const DEFAULT_MODERN_CLIENT_PREFIX = 'v';
433
433
  exports.DEFAULT_MODERN_CLIENT_PREFIX = DEFAULT_MODERN_CLIENT_PREFIX;
434
434
 
435
435
  const DEFAULT_APP_CLIENT_ENTRY_MODE = 'legacy-default';
436
- const APP_CLIENT_ENTRY_MODES = new Set(['legacy-default', 'modern-default', 'modern-only']);
436
+ const APP_CLIENT_ENTRY_MODES = new Set(['legacy-default', 'modern-default', 'modern-only', 'settings-default']);
437
437
 
438
438
  exports.DEFAULT_APP_CLIENT_ENTRY_MODE = DEFAULT_APP_CLIENT_ENTRY_MODE;
439
439