@yinsen/deveco-cli 1.3.1

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.
Files changed (29) hide show
  1. package/dist/cli.js +1347 -0
  2. package/dist/internal/telemetry-upload-background.js +9 -0
  3. package/package.json +56 -0
  4. package/src/resources/aclPermission/aclPermissionsInfo.json +311 -0
  5. package/templates/application/AppScope/app.json5 +10 -0
  6. package/templates/application/AppScope/resources/base/element/string.json +8 -0
  7. package/templates/application/AppScope/resources/base/media/layered_image.json +7 -0
  8. package/templates/application/build-profile.json5 +42 -0
  9. package/templates/application/code-linter.json5 +32 -0
  10. package/templates/application/entry/build-profile.json5 +33 -0
  11. package/templates/application/entry/gitignore.txt +6 -0
  12. package/templates/application/entry/hvigorfile.ts +7 -0
  13. package/templates/application/entry/obfuscation-rules.txt +20 -0
  14. package/templates/application/entry/oh-package.json5 +10 -0
  15. package/templates/application/entry/src/main/ets/entryability/EntryAbility.ets +63 -0
  16. package/templates/application/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +31 -0
  17. package/templates/application/entry/src/main/ets/pages/Index.ets +38 -0
  18. package/templates/application/entry/src/main/module.json5 +50 -0
  19. package/templates/application/entry/src/main/resources/base/element/color.json +8 -0
  20. package/templates/application/entry/src/main/resources/base/element/float.json +8 -0
  21. package/templates/application/entry/src/main/resources/base/element/string.json +16 -0
  22. package/templates/application/entry/src/main/resources/base/media/layered_image.json +7 -0
  23. package/templates/application/entry/src/main/resources/base/profile/backup_config.json +3 -0
  24. package/templates/application/entry/src/main/resources/base/profile/main_pages.json +5 -0
  25. package/templates/application/entry/src/main/resources/dark/element/color.json +8 -0
  26. package/templates/application/gitignore.txt +12 -0
  27. package/templates/application/hvigor/hvigor-config.json5 +23 -0
  28. package/templates/application/hvigorfile.ts +7 -0
  29. package/templates/application/oh-package.json5 +10 -0
@@ -0,0 +1,31 @@
1
+ /*
2
+ * Copyright (c) 2026 Huawei Device Co., Ltd.
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ *
7
+ * http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS,
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+
16
+ import { hilog } from '@kit.PerformanceAnalysisKit';
17
+ import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit';
18
+
19
+ const DOMAIN = 0x0000;
20
+
21
+ export default class EntryBackupAbility extends BackupExtensionAbility {
22
+ async onBackup() {
23
+ hilog.info(DOMAIN, 'testTag', 'onBackup ok');
24
+ await Promise.resolve();
25
+ }
26
+
27
+ async onRestore(bundleVersion: BundleVersion) {
28
+ hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion));
29
+ await Promise.resolve();
30
+ }
31
+ }
@@ -0,0 +1,38 @@
1
+ /*
2
+ * Copyright (c) 2026 Huawei Device Co., Ltd.
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ *
7
+ * http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS,
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+
16
+ @Entry
17
+ @Component
18
+ struct Index {
19
+ @State message: string = 'Hello World';
20
+
21
+ build() {
22
+ RelativeContainer() {
23
+ Text(this.message)
24
+ .id('HelloWorld')
25
+ .fontSize($r('app.float.page_text_font_size'))
26
+ .fontWeight(FontWeight.Bold)
27
+ .alignRules({
28
+ center: { anchor: '__container__', align: VerticalAlign.Center },
29
+ middle: { anchor: '__container__', align: HorizontalAlign.Center }
30
+ })
31
+ .onClick(() => {
32
+ this.message = 'Welcome';
33
+ })
34
+ }
35
+ .height('100%')
36
+ .width('100%')
37
+ }
38
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "module": {
3
+ "name": "entry",
4
+ "type": "entry",
5
+ "description": "$string:module_desc",
6
+ "mainElement": "EntryAbility",
7
+ "deviceTypes": [
8
+ "phone"
9
+ ],
10
+ "deliveryWithInstall": true,
11
+ "installationFree": false,
12
+ "pages": "$profile:main_pages",
13
+ "abilities": [
14
+ {
15
+ "name": "EntryAbility",
16
+ "srcEntry": "./ets/entryability/EntryAbility.ets",
17
+ "description": "$string:EntryAbility_desc",
18
+ "icon": "$media:layered_image",
19
+ "label": "$string:EntryAbility_label",
20
+ "startWindowIcon": "$media:startIcon",
21
+ "startWindowBackground": "$color:start_window_background",
22
+ "exported": true,
23
+ "skills": [
24
+ {
25
+ "entities": [
26
+ "entity.system.home"
27
+ ],
28
+ "actions": [
29
+ "ohos.want.action.home"
30
+ ]
31
+ }
32
+ ]
33
+ }
34
+ ],
35
+ "extensionAbilities": [
36
+ {
37
+ "name": "EntryBackupAbility",
38
+ "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets",
39
+ "type": "backup",
40
+ "exported": false,
41
+ "metadata": [
42
+ {
43
+ "name": "ohos.extension.backup",
44
+ "resource": "$profile:backup_config"
45
+ }
46
+ ],
47
+ }
48
+ ]
49
+ }
50
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "color": [
3
+ {
4
+ "name": "start_window_background",
5
+ "value": "#FFFFFF"
6
+ }
7
+ ]
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "float": [
3
+ {
4
+ "name": "page_text_font_size",
5
+ "value": "50fp"
6
+ }
7
+ ]
8
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "string": [
3
+ {
4
+ "name": "module_desc",
5
+ "value": "module description"
6
+ },
7
+ {
8
+ "name": "EntryAbility_desc",
9
+ "value": "description"
10
+ },
11
+ {
12
+ "name": "EntryAbility_label",
13
+ "value": "label"
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "layered-image":
3
+ {
4
+ "background" : "$media:background",
5
+ "foreground" : "$media:foreground"
6
+ }
7
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "allowToBackupRestore": true
3
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "color": [
3
+ {
4
+ "name": "start_window_background",
5
+ "value": "#000000"
6
+ }
7
+ ]
8
+ }
@@ -0,0 +1,12 @@
1
+ /node_modules
2
+ /oh_modules
3
+ /local.properties
4
+ /.idea
5
+ **/build
6
+ /.hvigor
7
+ .cxx
8
+ /.clangd
9
+ /.clang-format
10
+ /.clang-tidy
11
+ **/.test
12
+ /.appanalyzer
@@ -0,0 +1,23 @@
1
+ {
2
+ "modelVersion": "6.0.2",
3
+ "dependencies": {
4
+ },
5
+ "execution": {
6
+ // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | false ]. Default: "normal" */
7
+ // "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */
8
+ // "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */
9
+ // "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */
10
+ // "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */
11
+ // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */
12
+ },
13
+ "logging": {
14
+ // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */
15
+ },
16
+ "debugging": {
17
+ // "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */
18
+ },
19
+ "nodeOptions": {
20
+ // "maxOldSpaceSize": 8192 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process. Default: 8192*/
21
+ // "exposeGC": true /* Enable to trigger garbage collection explicitly. Default: true*/
22
+ }
23
+ }
@@ -0,0 +1,7 @@
1
+ // @ts-nocheck – Template file, only used when copied into a project directory
2
+ import { appTasks } from '@ohos/hvigor-ohos-plugin';
3
+
4
+ export default {
5
+ system: appTasks /* Built-in plugin of Hvigor. It cannot be modified. */,
6
+ plugins: [] /* Custom plugin to extend the functionality of Hvigor. */,
7
+ };
@@ -0,0 +1,10 @@
1
+ {
2
+ "modelVersion": "6.0.2",
3
+ "description": "Please describe the basic information.",
4
+ "dependencies": {
5
+ },
6
+ "devDependencies": {
7
+ "@ohos/hypium": "1.0.25",
8
+ "@ohos/hamock": "1.0.0"
9
+ }
10
+ }