@deveco-test/hmos-deveco-cli 0.3.0-TD.2-alpha2 → 0.3.0-TD.2
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/LICENSE +21 -21
- package/README.md +785 -785
- package/SKILL.md +172 -172
- package/dist/cli.js +3 -3
- package/index.zip +0 -0
- package/package.json +102 -102
- package/scripts/install-better-sqlite3.mjs +51 -51
- package/scripts/install-jieba-wasm.mjs +47 -47
- package/scripts/lib/better-sqlite3-vendor.mjs +128 -128
- package/scripts/lib/cli-data-dir.mjs +44 -44
- package/scripts/lib/doc-init-log-path.mjs +15 -15
- package/scripts/lib/jieba-wasm-vendor.mjs +102 -102
- package/scripts/postinstall.mjs +54 -54
- package/src/resources/aclPermission/aclPermissionsInfo.json +310 -310
- package/templates/application/AppScope/app.json5 +10 -10
- package/templates/application/AppScope/resources/base/element/string.json +8 -8
- package/templates/application/AppScope/resources/base/media/layered_image.json +6 -6
- package/templates/application/build-profile.json5 +41 -41
- package/templates/application/code-linter.json5 +31 -31
- package/templates/application/entry/build-profile.json5 +32 -32
- package/templates/application/entry/gitignore.txt +5 -5
- package/templates/application/entry/hvigorfile.ts +7 -7
- package/templates/application/entry/obfuscation-rules.txt +19 -19
- package/templates/application/entry/oh-package.json5 +10 -10
- package/templates/application/entry/src/main/ets/entryability/EntryAbility.ets +62 -62
- package/templates/application/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +30 -30
- package/templates/application/entry/src/main/ets/pages/Index.ets +37 -37
- package/templates/application/entry/src/main/module.json5 +49 -49
- package/templates/application/entry/src/main/resources/base/element/color.json +7 -7
- package/templates/application/entry/src/main/resources/base/element/float.json +8 -8
- package/templates/application/entry/src/main/resources/base/element/string.json +15 -15
- package/templates/application/entry/src/main/resources/base/media/layered_image.json +6 -6
- package/templates/application/entry/src/main/resources/base/profile/backup_config.json +2 -2
- package/templates/application/entry/src/main/resources/base/profile/main_pages.json +5 -5
- package/templates/application/entry/src/main/resources/dark/element/color.json +7 -7
- package/templates/application/gitignore.txt +11 -11
- package/templates/application/hvigor/hvigor-config.json5 +23 -23
- package/templates/application/hvigorfile.ts +7 -7
- package/templates/application/oh-package.json5 +10 -10
package/scripts/postinstall.mjs
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026 Huawei Device Co., Ltd.
|
|
3
|
-
* SPDX-License-Identifier: MIT
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { spawn } from 'child_process';
|
|
7
|
-
import { existsSync, mkdirSync } from 'fs';
|
|
8
|
-
import { dirname, join } from 'path';
|
|
9
|
-
import { fileURLToPath } from 'url';
|
|
10
|
-
import { ensureBetterSqlite3ForDocs } from './install-better-sqlite3.mjs';
|
|
11
|
-
import { ensureJiebaWasmForDocs } from './install-jieba-wasm.mjs';
|
|
12
|
-
import { getDocInitLogPath } from './lib/doc-init-log-path.mjs';
|
|
13
|
-
|
|
14
|
-
const root = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
15
|
-
const logPath = getDocInitLogPath();
|
|
16
|
-
mkdirSync(dirname(logPath), { recursive: true });
|
|
17
|
-
|
|
18
|
-
const nativeResult = await ensureBetterSqlite3ForDocs();
|
|
19
|
-
if (!nativeResult.ok && !nativeResult.skipped) {
|
|
20
|
-
console.warn(
|
|
21
|
-
`[deveco-cli] better-sqlite3 install via npm failed; docs search will use sqlite-wasm fallback.\n` +
|
|
22
|
-
`${nativeResult.error ?? ''}\n`
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const jiebaResult = await ensureJiebaWasmForDocs();
|
|
27
|
-
if (!jiebaResult.ok && !jiebaResult.skipped) {
|
|
28
|
-
console.warn(
|
|
29
|
-
`[deveco-cli] jieba wasm install via npm failed; docs search may fail on this machine.\n` +
|
|
30
|
-
`${jiebaResult.error ?? ''}\n`
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
const initScript = join(root, 'dist', 'internal', 'doc-init-background.js');
|
|
34
|
-
|
|
35
|
-
if (!existsSync(initScript)) {
|
|
36
|
-
process.exit(0);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const child = spawn(
|
|
40
|
-
process.execPath,
|
|
41
|
-
[initScript],
|
|
42
|
-
{
|
|
43
|
-
detached: true,
|
|
44
|
-
stdio: ['ignore', 'ignore', 'ignore'],
|
|
45
|
-
env: {
|
|
46
|
-
...process.env,
|
|
47
|
-
DEVECO_CLI_SKIP_VERSION_CHECK: '1',
|
|
48
|
-
DEVECO_CLI_POSTINSTALL: '1',
|
|
49
|
-
},
|
|
50
|
-
}
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
child.unref();
|
|
54
|
-
process.exit(0);
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026 Huawei Device Co., Ltd.
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { spawn } from 'child_process';
|
|
7
|
+
import { existsSync, mkdirSync } from 'fs';
|
|
8
|
+
import { dirname, join } from 'path';
|
|
9
|
+
import { fileURLToPath } from 'url';
|
|
10
|
+
import { ensureBetterSqlite3ForDocs } from './install-better-sqlite3.mjs';
|
|
11
|
+
import { ensureJiebaWasmForDocs } from './install-jieba-wasm.mjs';
|
|
12
|
+
import { getDocInitLogPath } from './lib/doc-init-log-path.mjs';
|
|
13
|
+
|
|
14
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
15
|
+
const logPath = getDocInitLogPath();
|
|
16
|
+
mkdirSync(dirname(logPath), { recursive: true });
|
|
17
|
+
|
|
18
|
+
const nativeResult = await ensureBetterSqlite3ForDocs();
|
|
19
|
+
if (!nativeResult.ok && !nativeResult.skipped) {
|
|
20
|
+
console.warn(
|
|
21
|
+
`[deveco-cli] better-sqlite3 install via npm failed; docs search will use sqlite-wasm fallback.\n` +
|
|
22
|
+
`${nativeResult.error ?? ''}\n`
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const jiebaResult = await ensureJiebaWasmForDocs();
|
|
27
|
+
if (!jiebaResult.ok && !jiebaResult.skipped) {
|
|
28
|
+
console.warn(
|
|
29
|
+
`[deveco-cli] jieba wasm install via npm failed; docs search may fail on this machine.\n` +
|
|
30
|
+
`${jiebaResult.error ?? ''}\n`
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
const initScript = join(root, 'dist', 'internal', 'doc-init-background.js');
|
|
34
|
+
|
|
35
|
+
if (!existsSync(initScript)) {
|
|
36
|
+
process.exit(0);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const child = spawn(
|
|
40
|
+
process.execPath,
|
|
41
|
+
[initScript],
|
|
42
|
+
{
|
|
43
|
+
detached: true,
|
|
44
|
+
stdio: ['ignore', 'ignore', 'ignore'],
|
|
45
|
+
env: {
|
|
46
|
+
...process.env,
|
|
47
|
+
DEVECO_CLI_SKIP_VERSION_CHECK: '1',
|
|
48
|
+
DEVECO_CLI_POSTINSTALL: '1',
|
|
49
|
+
},
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
child.unref();
|
|
54
|
+
process.exit(0);
|