@nocobase/cli-v1 2.2.29 → 2.2.30
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": "2.2.
|
|
3
|
+
"version": "2.2.30",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -9,10 +9,11 @@
|
|
|
9
9
|
"nocobase-v1": "./bin/index.js"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@nocobase/cli": "2.2.
|
|
12
|
+
"@nocobase/cli": "2.2.30",
|
|
13
13
|
"@nocobase/license-kit": "^0.3.8",
|
|
14
|
-
"@nocobase/utils": "2.2.
|
|
14
|
+
"@nocobase/utils": "2.2.30",
|
|
15
15
|
"chalk": "^4.1.1",
|
|
16
|
+
"chokidar": "3.6.0",
|
|
16
17
|
"commander": "^9.2.0",
|
|
17
18
|
"deepmerge": "^4.3.1",
|
|
18
19
|
"dotenv": "^16.0.0",
|
|
@@ -33,5 +34,5 @@
|
|
|
33
34
|
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
34
35
|
"directory": "packages/core/cli"
|
|
35
36
|
},
|
|
36
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "7042ebef45742005aa38cd78c366e3e7f4ffed52"
|
|
37
38
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
import { mkdtempSync, mkdirSync, rmSync } from 'node:fs';
|
|
11
|
+
import os from 'node:os';
|
|
12
|
+
import path from 'node:path';
|
|
13
|
+
import chokidar from 'chokidar';
|
|
14
|
+
import { describe, expect, test } from 'vitest';
|
|
15
|
+
import packageJson from '../../package.json';
|
|
16
|
+
|
|
17
|
+
describe('cli-v1 runtime dependencies', () => {
|
|
18
|
+
test('declares chokidar directly for production command initialization', () => {
|
|
19
|
+
expect(packageJson.dependencies.chokidar).toBe('3.6.0');
|
|
20
|
+
expect(packageJson.devDependencies).not.toHaveProperty('chokidar');
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test('keeps glob-based plugin directory watching compatible', async () => {
|
|
24
|
+
const directory = mkdtempSync(path.join(os.tmpdir(), 'nocobase-cli-watch-'));
|
|
25
|
+
const pluginDirectory = path.join(directory, 'plugins');
|
|
26
|
+
mkdirSync(pluginDirectory);
|
|
27
|
+
const watcher = chokidar.watch(`${pluginDirectory}/**/*`, { ignoreInitial: true });
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
await new Promise<void>((resolve, reject) => {
|
|
31
|
+
watcher.once('ready', resolve);
|
|
32
|
+
watcher.once('error', reject);
|
|
33
|
+
});
|
|
34
|
+
const added = new Promise<string>((resolve, reject) => {
|
|
35
|
+
watcher.once('addDir', resolve);
|
|
36
|
+
watcher.once('error', reject);
|
|
37
|
+
});
|
|
38
|
+
const addedDirectory = path.join(pluginDirectory, 'example-plugin');
|
|
39
|
+
mkdirSync(addedDirectory);
|
|
40
|
+
|
|
41
|
+
expect(path.resolve(await added)).toBe(addedDirectory);
|
|
42
|
+
} finally {
|
|
43
|
+
await watcher.close();
|
|
44
|
+
rmSync(directory, { recursive: true, force: true });
|
|
45
|
+
}
|
|
46
|
+
}, 10000);
|
|
47
|
+
});
|