@deveco-test/hmos-deveco-cli 0.3.2 → 0.3.4
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/THIRD-PARTY-LICENSES +2 -2
- package/dist/cli.js +58 -58
- package/index.zip +0 -0
- package/package.json +3 -2
- package/scripts/postinstall.mjs +24 -14
package/index.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deveco-test/hmos-deveco-cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "HarmonyOS application development command line tool",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
69
69
|
"@sqlite.org/sqlite-wasm": "^3.49.1-build4",
|
|
70
70
|
"adm-zip": "^0.5.17",
|
|
71
|
-
"axios": "1.
|
|
71
|
+
"axios": "1.19.0",
|
|
72
72
|
"colorette": "^2.0.20",
|
|
73
73
|
"commander": "^13.1.0",
|
|
74
74
|
"execa": "^9.6.1",
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
"ora": "^8.2.0",
|
|
81
81
|
"p-limit": "^5.0.0",
|
|
82
82
|
"proper-lockfile": "^4.1.2",
|
|
83
|
+
"proxy-from-env": "^2.1.0",
|
|
83
84
|
"regedit": "^5.1.4",
|
|
84
85
|
"remark-gfm": "^4.0.1",
|
|
85
86
|
"socket.io-client": "^4.7.5",
|
package/scripts/postinstall.mjs
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { spawn } from 'child_process';
|
|
7
|
-
import { existsSync, mkdirSync } from 'fs';
|
|
7
|
+
import { chmodSync, existsSync, mkdirSync } from 'fs';
|
|
8
|
+
import { platform } from 'os';
|
|
8
9
|
import { dirname, join } from 'path';
|
|
9
10
|
import { fileURLToPath } from 'url';
|
|
10
11
|
import { ensureBetterSqlite3ForDocs } from './install-better-sqlite3.mjs';
|
|
@@ -15,6 +16,19 @@ const root = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
|
15
16
|
const logPath = getDocInitLogPath();
|
|
16
17
|
mkdirSync(dirname(logPath), { recursive: true });
|
|
17
18
|
|
|
19
|
+
// On OpenHarmony's /storage/ overlayfs, npm's bin-link chmod may not persist,
|
|
20
|
+
// causing "zsh: permission denied" when running `devecocli`.
|
|
21
|
+
if (platform().toLowerCase().includes('openharmony')) {
|
|
22
|
+
const cliEntry = join(root, 'dist', 'cli.js');
|
|
23
|
+
if (existsSync(cliEntry)) {
|
|
24
|
+
try {
|
|
25
|
+
chmodSync(cliEntry, 0o755);
|
|
26
|
+
} catch {
|
|
27
|
+
/* filesystem does not support chmod */
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
18
32
|
const nativeResult = await ensureBetterSqlite3ForDocs();
|
|
19
33
|
if (!nativeResult.ok && !nativeResult.skipped) {
|
|
20
34
|
console.warn(
|
|
@@ -36,19 +50,15 @@ if (!existsSync(initScript)) {
|
|
|
36
50
|
process.exit(0);
|
|
37
51
|
}
|
|
38
52
|
|
|
39
|
-
const child = spawn(
|
|
40
|
-
|
|
41
|
-
[
|
|
42
|
-
{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
DEVECO_CLI_POSTINSTALL: '1',
|
|
49
|
-
},
|
|
50
|
-
}
|
|
51
|
-
);
|
|
53
|
+
const child = spawn(process.execPath, [initScript], {
|
|
54
|
+
detached: true,
|
|
55
|
+
stdio: ['ignore', 'ignore', 'ignore'],
|
|
56
|
+
env: {
|
|
57
|
+
...process.env,
|
|
58
|
+
DEVECO_CLI_SKIP_VERSION_CHECK: '1',
|
|
59
|
+
DEVECO_CLI_POSTINSTALL: '1',
|
|
60
|
+
},
|
|
61
|
+
});
|
|
52
62
|
|
|
53
63
|
child.unref();
|
|
54
64
|
process.exit(0);
|