@lingxia/cli 0.0.9 → 0.1.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 (173) hide show
  1. package/bin/lingxia.js +207 -32
  2. package/dist/builder/commands/build.d.ts +1 -1
  3. package/dist/builder/commands/build.d.ts.map +1 -1
  4. package/dist/builder/commands/build.js +138 -103
  5. package/dist/builder/commands/build.js.map +1 -1
  6. package/dist/builder/core/builders/logic.d.ts +3 -3
  7. package/dist/builder/core/builders/logic.d.ts.map +1 -1
  8. package/dist/builder/core/builders/logic.js +55 -46
  9. package/dist/builder/core/builders/logic.js.map +1 -1
  10. package/dist/builder/core/builders/page-functions.d.ts.map +1 -1
  11. package/dist/builder/core/builders/page-functions.js +43 -35
  12. package/dist/builder/core/builders/page-functions.js.map +1 -1
  13. package/dist/builder/core/builders/page-path-injector.js +27 -27
  14. package/dist/builder/core/builders/page-path-injector.js.map +1 -1
  15. package/dist/builder/core/builders/page-types.d.ts +22 -0
  16. package/dist/builder/core/builders/page-types.d.ts.map +1 -0
  17. package/dist/builder/core/builders/page-types.js +374 -0
  18. package/dist/builder/core/builders/page-types.js.map +1 -0
  19. package/dist/builder/core/builders/page.d.ts +5 -4
  20. package/dist/builder/core/builders/page.d.ts.map +1 -1
  21. package/dist/builder/core/builders/page.js +54 -52
  22. package/dist/builder/core/builders/page.js.map +1 -1
  23. package/dist/builder/core/builders/view-validator.d.ts +9 -0
  24. package/dist/builder/core/builders/view-validator.d.ts.map +1 -0
  25. package/dist/builder/core/builders/view-validator.js +58 -0
  26. package/dist/builder/core/builders/view-validator.js.map +1 -0
  27. package/dist/builder/core/builders/view.d.ts +40 -3
  28. package/dist/builder/core/builders/view.d.ts.map +1 -1
  29. package/dist/builder/core/builders/view.js +406 -55
  30. package/dist/builder/core/builders/view.js.map +1 -1
  31. package/dist/builder/core/config/alias-config.d.ts +1 -1
  32. package/dist/builder/core/config/alias-config.d.ts.map +1 -1
  33. package/dist/builder/core/config/alias-config.js +8 -8
  34. package/dist/builder/core/config/alias-config.js.map +1 -1
  35. package/dist/builder/core/config/framework.d.ts +1 -1
  36. package/dist/builder/core/config/framework.d.ts.map +1 -1
  37. package/dist/builder/core/config/framework.js +14 -11
  38. package/dist/builder/core/config/framework.js.map +1 -1
  39. package/dist/builder/core/config/lxapp-config.d.ts +74 -0
  40. package/dist/builder/core/config/lxapp-config.d.ts.map +1 -0
  41. package/dist/builder/core/config/lxapp-config.js +195 -0
  42. package/dist/builder/core/config/lxapp-config.js.map +1 -0
  43. package/dist/builder/core/config/view-build-schema.d.ts +2 -2
  44. package/dist/builder/core/config/view-config.d.ts +3 -3
  45. package/dist/builder/core/config/view-config.d.ts.map +1 -1
  46. package/dist/builder/core/config/view-config.js +16 -16
  47. package/dist/builder/core/config/view-config.js.map +1 -1
  48. package/dist/builder/core/config.d.ts +1 -1
  49. package/dist/builder/core/config.js +11 -11
  50. package/dist/builder/core/constants/source-dirs.d.ts +1 -1
  51. package/dist/builder/core/constants/source-dirs.js +9 -9
  52. package/dist/builder/core/constants/source-dirs.js.map +1 -1
  53. package/dist/builder/core/constants/static-dirs.d.ts +1 -1
  54. package/dist/builder/core/constants/static-dirs.d.ts.map +1 -1
  55. package/dist/builder/core/constants/static-dirs.js +11 -11
  56. package/dist/builder/core/constants/static-dirs.js.map +1 -1
  57. package/dist/builder/core/frameworks/base.d.ts +1 -1
  58. package/dist/builder/core/frameworks/base.d.ts.map +1 -1
  59. package/dist/builder/core/frameworks/base.js +13 -11
  60. package/dist/builder/core/frameworks/base.js.map +1 -1
  61. package/dist/builder/core/frameworks/factory.d.ts +1 -1
  62. package/dist/builder/core/frameworks/factory.d.ts.map +1 -1
  63. package/dist/builder/core/frameworks/factory.js +9 -9
  64. package/dist/builder/core/frameworks/factory.js.map +1 -1
  65. package/dist/builder/core/frameworks/html.d.ts +2 -2
  66. package/dist/builder/core/frameworks/html.d.ts.map +1 -1
  67. package/dist/builder/core/frameworks/html.js +10 -10
  68. package/dist/builder/core/frameworks/html.js.map +1 -1
  69. package/dist/builder/core/frameworks/react.d.ts +3 -3
  70. package/dist/builder/core/frameworks/react.d.ts.map +1 -1
  71. package/dist/builder/core/frameworks/react.js +45 -43
  72. package/dist/builder/core/frameworks/react.js.map +1 -1
  73. package/dist/builder/core/frameworks/templates.d.ts +1 -1
  74. package/dist/builder/core/frameworks/templates.d.ts.map +1 -1
  75. package/dist/builder/core/frameworks/templates.js +1 -1
  76. package/dist/builder/core/frameworks/templates.js.map +1 -1
  77. package/dist/builder/core/frameworks/vue.d.ts +3 -3
  78. package/dist/builder/core/frameworks/vue.d.ts.map +1 -1
  79. package/dist/builder/core/frameworks/vue.js +48 -43
  80. package/dist/builder/core/frameworks/vue.js.map +1 -1
  81. package/dist/builder/core/registry.d.ts.map +1 -1
  82. package/dist/builder/core/registry.js +34 -25
  83. package/dist/builder/core/registry.js.map +1 -1
  84. package/dist/builder/core/template.d.ts +1 -1
  85. package/dist/builder/core/template.d.ts.map +1 -1
  86. package/dist/builder/core/template.js +19 -14
  87. package/dist/builder/core/template.js.map +1 -1
  88. package/dist/builder/core/templates/embedded.d.ts +3 -3
  89. package/dist/builder/core/templates/embedded.d.ts.map +1 -1
  90. package/dist/builder/core/templates/embedded.js +62 -31
  91. package/dist/builder/core/templates/embedded.js.map +1 -1
  92. package/dist/builder/core/type-generator.d.ts +17 -0
  93. package/dist/builder/core/type-generator.d.ts.map +1 -0
  94. package/dist/builder/core/type-generator.js +172 -0
  95. package/dist/builder/core/type-generator.js.map +1 -0
  96. package/dist/builder/core/utils/file.js +4 -4
  97. package/dist/builder/core/utils/incremental.d.ts +59 -0
  98. package/dist/builder/core/utils/incremental.d.ts.map +1 -0
  99. package/dist/builder/core/utils/incremental.js +177 -0
  100. package/dist/builder/core/utils/incremental.js.map +1 -0
  101. package/dist/builder/core/utils/page.d.ts +12 -2
  102. package/dist/builder/core/utils/page.d.ts.map +1 -1
  103. package/dist/builder/core/utils/page.js +63 -8
  104. package/dist/builder/core/utils/page.js.map +1 -1
  105. package/dist/builder/index.d.ts +1 -1
  106. package/dist/builder/index.js +1 -1
  107. package/dist/builder/types/index.d.ts +7 -6
  108. package/dist/builder/types/index.d.ts.map +1 -1
  109. package/dist/index.d.ts.map +1 -1
  110. package/dist/index.js +15 -16
  111. package/dist/index.js.map +1 -1
  112. package/package.json +8 -6
  113. package/templates/AppIcon.png +0 -0
  114. package/templates/android-native/app/src/main/java/MainActivity.kt +2 -2
  115. package/templates/android-native/app/src/main/res/values/strings.xml +1 -1
  116. package/templates/android-native/settings.gradle.kts +4 -0
  117. package/templates/harmony-native/AppScope/app.json5 +10 -0
  118. package/templates/harmony-native/AppScope/resources/base/element/string.json +8 -0
  119. package/templates/harmony-native/build-profile.json5 +41 -0
  120. package/templates/harmony-native/entry/build-profile.json5 +8 -0
  121. package/templates/harmony-native/entry/hvigorfile.ts +6 -0
  122. package/templates/harmony-native/entry/oh-package.json5 +11 -0
  123. package/templates/harmony-native/entry/src/main/ets/entryability/EntryAbility.ets +38 -0
  124. package/templates/harmony-native/entry/src/main/ets/pages/Index.ets +15 -0
  125. package/templates/harmony-native/entry/src/main/module.json5 +38 -0
  126. package/templates/harmony-native/entry/src/main/resources/base/element/color.json +8 -0
  127. package/templates/harmony-native/entry/src/main/resources/base/element/string.json +16 -0
  128. package/templates/harmony-native/entry/src/main/resources/base/profile/main_pages.json +5 -0
  129. package/templates/harmony-native/entry/src/main/resources/dark/element/color.json +8 -0
  130. package/templates/harmony-native/hvigor/hvigor-config.json5 +13 -0
  131. package/templates/harmony-native/hvigorfile.ts +6 -0
  132. package/templates/harmony-native/oh-package.json5 +10 -0
  133. package/templates/ios-native/App.entitlements +10 -0
  134. package/templates/ios-native/Info.plist +8 -0
  135. package/templates/ios-native/Package.swift +31 -0
  136. package/templates/ios-native/Sources/App.swift +44 -0
  137. package/templates/lxapp-create/html/global.d.ts +1 -0
  138. package/templates/lxapp-create/html/lxapp.config.ts +5 -0
  139. package/templates/lxapp-create/html/lxapp.json +8 -0
  140. package/templates/lxapp-create/html/lxapp.ts +8 -0
  141. package/templates/lxapp-create/html/package.json +20 -0
  142. package/templates/lxapp-create/html/pages/home/index.html +32 -0
  143. package/templates/lxapp-create/html/pages/home/index.json +3 -0
  144. package/templates/lxapp-create/html/pages/home/index.ts +14 -0
  145. package/templates/lxapp-create/html/tsconfig.json +13 -0
  146. package/templates/lxapp-create/html/view/home.ts +19 -0
  147. package/templates/lxapp-create/react/app.css +20 -0
  148. package/templates/lxapp-create/react/lxapp.config.ts +8 -0
  149. package/templates/lxapp-create/react/lxapp.json +1 -1
  150. package/templates/lxapp-create/react/package.json +2 -0
  151. package/templates/lxapp-create/react/pages/home/index.json +1 -1
  152. package/templates/lxapp-create/react/pages/home/index.ts +8 -3
  153. package/templates/lxapp-create/react/pages/home/index.tsx +113 -42
  154. package/templates/lxapp-create/react/tsconfig.json +5 -2
  155. package/templates/lxapp-create/vue/app.css +20 -0
  156. package/templates/lxapp-create/vue/lxapp.config.ts +8 -0
  157. package/templates/lxapp-create/vue/lxapp.json +1 -1
  158. package/templates/lxapp-create/vue/package.json +2 -0
  159. package/templates/lxapp-create/vue/pages/home/index.json +1 -1
  160. package/templates/lxapp-create/vue/pages/home/index.ts +8 -3
  161. package/templates/lxapp-create/vue/pages/home/index.vue +124 -37
  162. package/templates/lxapp-create/vue/tsconfig.json +5 -2
  163. package/templates/macos-native/Info.plist +40 -0
  164. package/templates/macos-native/Package.swift +30 -0
  165. package/templates/macos-native/Sources/main.swift +23 -0
  166. package/templates/rust-lib/Cargo.toml +16 -1
  167. package/templates/rust-lib/README.md +1 -1
  168. package/templates/rust-lib/src/lib.rs +39 -1
  169. package/vendor/lingxia +0 -0
  170. package/templates/lxapp-create/react/lxapp.config.json +0 -8
  171. package/templates/lxapp-create/react/public/.gitkeep +0 -0
  172. package/templates/lxapp-create/vue/lxapp.config.json +0 -8
  173. package/templates/lxapp-create/vue/public/.gitkeep +0 -0
@@ -1 +1 @@
1
- {"version":3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M,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACzC,CAAC;CACH;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;CACxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,wBAAsB,MAAM,CAAC,IAAI,WAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAiB/D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,wBAAsB,MAAM,CAAC,IAAI,WAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAsB/D"}
package/dist/index.js CHANGED
@@ -1,22 +1,21 @@
1
- import { Command } from 'commander';
2
- import { createRequire } from 'module';
3
- import { buildCommand } from './builder/index.js';
4
- import { fileURLToPath, pathToFileURL } from 'url';
5
- import path from 'path';
6
- const { version } = createRequire(import.meta.url)('../package.json');
1
+ import { Command } from "commander";
2
+ import { createRequire } from "module";
3
+ import { buildCommand } from "./builder/index.js";
4
+ import { fileURLToPath, pathToFileURL } from "url";
5
+ import path from "path";
6
+ const { version } = createRequire(import.meta.url)("../package.json");
7
7
  export async function runCLI(argv = process.argv) {
8
8
  const program = new Command();
9
9
  program
10
- .name('lingxia')
11
- .description('LingXia LxApp build tools')
12
- .version(version ?? '0.0.0');
10
+ .name("lingxia")
11
+ .description("LingXia LxApp build tools")
12
+ .version(version ?? "0.0.0");
13
13
  program
14
- .command('build')
15
- .description('Build LingXia project or plugin')
16
- .option('-d, --dev', 'Development build')
17
- .option('-p, --prod', 'Production build')
18
- .option('--plugin', 'Build as plugin package')
19
- .option('--target <target>', 'JS target (es5, es2015, es2020, esnext). Note: es5 requires @vitejs/plugin-legacy')
14
+ .command("build")
15
+ .description("Build LingXia project or plugin")
16
+ .option("--release", "Release build (debug is the default)")
17
+ .option("--target <target>", "JS target (es5, es2015, es2020, esnext). Note: es5 requires @vitejs/plugin-legacy")
18
+ .option("--framework <framework>", "Framework to use for pages without extension (react or vue). Auto-detected if not specified.")
20
19
  .action(buildCommand);
21
20
  await program.parseAsync(argv);
22
21
  }
@@ -25,7 +24,7 @@ const isMain = (() => {
25
24
  return false;
26
25
  const mainPath = path.resolve(process.argv[1]);
27
26
  const modulePath = fileURLToPath(import.meta.url);
28
- return mainPath === modulePath || pathToFileURL(mainPath).href === import.meta.url;
27
+ return (mainPath === modulePath || pathToFileURL(mainPath).href === import.meta.url);
29
28
  })();
30
29
  if (isMain) {
31
30
  runCLI().catch((err) => {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACnD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,EAAE,OAAO,EAAE,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,iBAAiB,CAAC,CAAC;AAEtE,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI;IAC9C,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAC9B,OAAO;SACJ,IAAI,CAAC,SAAS,CAAC;SACf,WAAW,CAAC,2BAA2B,CAAC;SACxC,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,CAAC;IAE/B,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,iCAAiC,CAAC;SAC9C,MAAM,CAAC,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,MAAM,EAAE,CAAC;IACX,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACrB,OAAO,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingxia/cli",
3
- "version": "0.0.9",
3
+ "version": "0.1.1",
4
4
  "private": false,
5
5
  "description": "LingXia CLI for scaffolding, building, and packaging mini-apps with LingXia templates and builders.",
6
6
  "type": "module",
@@ -20,6 +20,8 @@
20
20
  "dev": "tsc --watch",
21
21
  "clean": "rm -rf dist",
22
22
  "test": "vitest run",
23
+ "format": "prettier --write \"src/**/*.ts\"",
24
+ "format:check": "prettier --check \"src/**/*.ts\"",
23
25
  "postinstall": "node scripts/install.cjs",
24
26
  "prepack": "node scripts/sync-templates.cjs && node scripts/ensure-deps.cjs && npm run build"
25
27
  },
@@ -27,21 +29,21 @@
27
29
  "@babel/generator": "^7.28.5",
28
30
  "@babel/parser": "^7.28.5",
29
31
  "@vitejs/plugin-react": "^4.6.0",
30
- "@vitejs/plugin-vue": "^5.2.1",
32
+ "@vitejs/plugin-vue": "^6.0.3",
31
33
  "cheerio": "^1.1.2",
32
34
  "commander": "^14.0.1",
33
35
  "fast-glob": "^3.3.2",
34
36
  "typescript": "^5.0.0",
35
- "update-notifier": "^7.0.0",
36
37
  "vite": "^6.0.7"
37
38
  },
38
39
  "optionalDependencies": {
39
- "@lingxia/cli-darwin-arm64": "0.0.9",
40
- "@lingxia/cli-darwin-x64": "0.0.9",
41
- "@lingxia/cli-win32-x64": "0.0.9"
40
+ "@lingxia/cli-darwin-arm64": "0.1.1",
41
+ "@lingxia/cli-darwin-x64": "0.1.1",
42
+ "@lingxia/cli-win32-x64": "0.1.1"
42
43
  },
43
44
  "devDependencies": {
44
45
  "@types/node": "^20.19.7",
46
+ "prettier": "^3.8.1",
45
47
  "vitest": "^4.0.7"
46
48
  },
47
49
  "engines": {
Binary file
@@ -2,8 +2,8 @@ package {{PACKAGE_ID}}
2
2
 
3
3
  import android.os.Bundle
4
4
  import android.util.Log
5
- import com.lingxia.LxApp
6
- import com.lingxia.LxAppLaunchActivity
5
+ import com.lingxia.lxapp.LxApp
6
+ import com.lingxia.lxapp.LxAppLaunchActivity
7
7
 
8
8
  class MainActivity : LxAppLaunchActivity() {
9
9
  private val TAG = "MainActivity"
@@ -1,3 +1,3 @@
1
1
  <resources>
2
- <string name="app_name">{{PROJECT_NAME}}</string>
2
+ <string name="app_name">{{PRODUCT_NAME}}</string>
3
3
  </resources>
@@ -14,6 +14,10 @@ pluginManagement {
14
14
  dependencyResolutionManagement {
15
15
  repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
16
16
  repositories {
17
+ // LingXia SDK local Maven repository
18
+ maven {
19
+ url = uri("../{{PROJECT_NAME}}-lib/target/maven")
20
+ }
17
21
  google()
18
22
  mavenCentral()
19
23
  }
@@ -0,0 +1,10 @@
1
+ {
2
+ "app": {
3
+ "bundleName": "{{PACKAGE_ID}}",
4
+ "vendor": "example",
5
+ "versionCode": 1000000,
6
+ "versionName": "1.0.0",
7
+ "icon": "$media:layered_image",
8
+ "label": "$string:app_name"
9
+ }
10
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "string": [
3
+ {
4
+ "name": "app_name",
5
+ "value": "{{PRODUCT_NAME}}"
6
+ }
7
+ ]
8
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "app": {
3
+ "signingConfigs": [],
4
+ "products": [
5
+ {
6
+ "name": "default",
7
+ "targetSdkVersion": "6.0.1(21)",
8
+ "compatibleSdkVersion": "6.0.1(21)",
9
+ "runtimeOS": "HarmonyOS",
10
+ "buildOption": {
11
+ "strictMode": {
12
+ "caseSensitiveCheck": true,
13
+ "useNormalizedOHMUrl": true
14
+ }
15
+ }
16
+ }
17
+ ],
18
+ "buildModeSet": [
19
+ {
20
+ "name": "debug",
21
+ },
22
+ {
23
+ "name": "release"
24
+ }
25
+ ]
26
+ },
27
+ "modules": [
28
+ {
29
+ "name": "entry",
30
+ "srcPath": "./entry",
31
+ "targets": [
32
+ {
33
+ "name": "default",
34
+ "applyToProducts": [
35
+ "default"
36
+ ]
37
+ }
38
+ ]
39
+ }
40
+ ]
41
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "apiType": "stageMode",
3
+ "targets": [
4
+ {
5
+ "name": "default"
6
+ }
7
+ ]
8
+ }
@@ -0,0 +1,6 @@
1
+ import { hapTasks } from '@ohos/hvigor-ohos-plugin';
2
+
3
+ export default {
4
+ system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
5
+ plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
6
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "entry",
3
+ "version": "1.0.0",
4
+ "description": "Please describe the basic information.",
5
+ "main": "",
6
+ "author": "",
7
+ "license": "",
8
+ "dependencies": {
9
+ "lingxia": "file:../../target/ohpm/lingxia.har"
10
+ }
11
+ }
@@ -0,0 +1,38 @@
1
+ import { hilog } from '@kit.PerformanceAnalysisKit';
2
+ import { window } from '@kit.ArkUI';
3
+ import { LxApp, LingxiaBaseAbility } from 'lingxia';
4
+ import { lingxiaRegisterExtensions } from 'liblingxia.so';
5
+
6
+ const DOMAIN = 0x0000;
7
+
8
+ export default class EntryAbility extends LingxiaBaseAbility {
9
+ /**
10
+ * Register custom native extensions.
11
+ */
12
+ protected registerExtensions(): void {
13
+ lingxiaRegisterExtensions();
14
+ }
15
+
16
+ onWindowStageCreate(windowStage: window.WindowStage): void {
17
+ super.onWindowStageCreate(windowStage);
18
+ hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
19
+
20
+ // Initialize LxApp with context and windowStage
21
+ LxApp.initialize(this.context, windowStage);
22
+
23
+ // Enable WebView debugging
24
+ LxApp.enableWebViewDebugging();
25
+
26
+ windowStage.loadContent('pages/Index', (err) => {
27
+ if (err.code) {
28
+ hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err));
29
+ return;
30
+ }
31
+ hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.');
32
+ });
33
+ }
34
+
35
+ onWindowStageDestroy(): void {
36
+ hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
37
+ }
38
+ }
@@ -0,0 +1,15 @@
1
+ import { LxAppNavigation } from 'lingxia';
2
+
3
+ @Entry
4
+ @Component
5
+ struct Index {
6
+ aboutToAppear() { }
7
+
8
+ build() {
9
+ Column() {
10
+ LxAppNavigation()
11
+ }
12
+ .width('100%')
13
+ .height('100%')
14
+ }
15
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "module": {
3
+ "name": "entry",
4
+ "type": "entry",
5
+ "description": "$string:module_desc",
6
+ "mainElement": "EntryAbility",
7
+ "deviceTypes": [
8
+ "phone",
9
+ "tablet"
10
+ ],
11
+ "deliveryWithInstall": true,
12
+ "installationFree": false,
13
+ "pages": "$profile:main_pages",
14
+ "abilities": [
15
+ {
16
+ "name": "EntryAbility",
17
+ "srcEntry": "./ets/entryability/EntryAbility.ets",
18
+ "description": "$string:EntryAbility_desc",
19
+ "icon": "$media:layered_image",
20
+ "label": "$string:EntryAbility_label",
21
+ "startWindowIcon": "$media:startIcon",
22
+ "startWindowBackground": "$color:start_window_background",
23
+ "orientation": "portrait",
24
+ "exported": true,
25
+ "skills": [
26
+ {
27
+ "entities": [
28
+ "entity.system.home"
29
+ ],
30
+ "actions": [
31
+ "action.system.home"
32
+ ]
33
+ }
34
+ ]
35
+ }
36
+ ],
37
+ }
38
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "color": [
3
+ {
4
+ "name": "start_window_background",
5
+ "value": "#FFFFFF"
6
+ }
7
+ ]
8
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "string": [
3
+ {
4
+ "name": "module_desc",
5
+ "value": ""
6
+ },
7
+ {
8
+ "name": "EntryAbility_desc",
9
+ "value": ""
10
+ },
11
+ {
12
+ "name": "EntryAbility_label",
13
+ "value": "{{PRODUCT_NAME}}"
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "color": [
3
+ {
4
+ "name": "start_window_background",
5
+ "value": "#FFFFFF"
6
+ }
7
+ ]
8
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "modelVersion": "5.0.5",
3
+ "dependencies": {
4
+ },
5
+ "execution": {
6
+ },
7
+ "logging": {
8
+ },
9
+ "debugging": {
10
+ },
11
+ "nodeOptions": {
12
+ }
13
+ }
@@ -0,0 +1,6 @@
1
+ import { appTasks } from '@ohos/hvigor-ohos-plugin';
2
+
3
+ export default {
4
+ system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
5
+ plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
6
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "modelVersion": "5.0.5",
3
+ "description": "Please describe the basic information.",
4
+ "dependencies": {
5
+ },
6
+ "devDependencies": {
7
+ "@ohos/hypium": "1.0.21",
8
+ "@ohos/hamock": "1.0.0"
9
+ }
10
+ }
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>application-identifier</key>
6
+ <string>$(AppIdentifierPrefix){{PACKAGE_ID}}</string>
7
+ <key>get-task-allow</key>
8
+ <true/>
9
+ </dict>
10
+ </plist>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleIdentifier</key>
6
+ <string>{{PACKAGE_ID}}</string>
7
+ </dict>
8
+ </plist>
@@ -0,0 +1,31 @@
1
+ // swift-tools-version: 6.0
2
+
3
+ import PackageDescription
4
+
5
+ let package = Package(
6
+ name: "{{PROJECT_NAME}}",
7
+ platforms: [
8
+ .iOS(.v17)
9
+ ],
10
+ products: [
11
+ .library(
12
+ name: "{{SWIFT_TARGET_NAME}}",
13
+ targets: ["{{SWIFT_TARGET_NAME}}"]
14
+ ),
15
+ ],
16
+ dependencies: [
17
+ .package(name: "lingxia", path: "../target/spm/lingxia"),
18
+ ],
19
+ targets: [
20
+ .target(
21
+ name: "{{SWIFT_TARGET_NAME}}",
22
+ dependencies: [
23
+ .product(name: "lingxia", package: "lingxia"),
24
+ ],
25
+ path: "Sources",
26
+ resources: [
27
+ .copy("Resources")
28
+ ]
29
+ ),
30
+ ]
31
+ )
@@ -0,0 +1,44 @@
1
+ import SwiftUI
2
+ import lingxia
3
+
4
+ /// C function exported from lingxia-lib Rust crate
5
+ @_silgen_name("lingxia_register_extensions")
6
+ func lingxia_register_extensions()
7
+
8
+ public struct ContentView: View {
9
+ // Use a global flag instead of @State to avoid SwiftUI update cycle issues
10
+ private static var hasInitialized = false
11
+
12
+ public var body: some View {
13
+ Color.clear
14
+ .onAppear {
15
+ if !Self.hasInitialized {
16
+ Self.hasInitialized = true
17
+
18
+ // Register custom extensions before initialization
19
+ LxApp.registerExtensions = {
20
+ lingxia_register_extensions()
21
+ }
22
+
23
+ // Enable WebView debugging BEFORE LxApp.initialize()
24
+ LxApp.enableWebViewDebugging()
25
+
26
+ LxApp.initialize()
27
+ }
28
+ }
29
+ }
30
+ }
31
+
32
+ @main
33
+ public struct LxAppApp: App {
34
+ public init() { }
35
+
36
+ public var body: some Scene {
37
+ WindowGroup {
38
+ ContentView()
39
+ .onOpenURL { url in
40
+ LxApp.handleAppLink(url: url)
41
+ }
42
+ }
43
+ }
44
+ }
@@ -0,0 +1 @@
1
+ /// <reference types="@lingxia/types" />
@@ -0,0 +1,5 @@
1
+ export default {
2
+ staticDirs: ['public'],
3
+ sourceDirs: ['view'],
4
+ assetDir: 'assets'
5
+ };
@@ -0,0 +1,8 @@
1
+ {
2
+ "lxAppId": "__APP_ID__",
3
+ "lxAppName": "__APP_DISPLAY_NAME__",
4
+ "version": "0.0.1",
5
+ "pages": [
6
+ "pages/home/index.html"
7
+ ]
8
+ }
@@ -0,0 +1,8 @@
1
+ App({
2
+ onLaunch() {
3
+ console.log('LingXia app launched');
4
+ },
5
+ globalData: {
6
+ greeting: 'Hello from App global data'
7
+ }
8
+ });
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "__APP_PACKAGE_NAME__",
3
+ "version": "0.1.0",
4
+ "description": "A LingXia mini app powered by HTML",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "lingxia build --dev",
8
+ "build": "lingxia build --prod"
9
+ },
10
+ "keywords": ["lingxia", "miniapp", "html"],
11
+ "author": "",
12
+ "license": "MIT",
13
+ "lingxia": {
14
+ "framework": "html"
15
+ },
16
+ "devDependencies": {
17
+ "@lingxia/types": "^0.1.1",
18
+ "typescript": "^5.9.3"
19
+ }
20
+ }
@@ -0,0 +1,32 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Home</title>
7
+ <style>
8
+ * { margin: 0; padding: 0; box-sizing: border-box; }
9
+ body { font-family: system-ui, sans-serif; background: #f5f5f5; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
10
+ .card { width: 100%; max-width: 360px; padding: 32px; background: #fff; border-radius: 20px; box-shadow: 0 4px 24px rgba(0,0,0,0.08); text-align: center; }
11
+ h1 { font-size: 26px; color: #1d1d1f; margin-bottom: 6px; }
12
+ p { font-size: 15px; color: #86868b; }
13
+ .form { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }
14
+ input { height: 48px; padding: 0 16px; border: 1px solid #d2d2d7; border-radius: 12px; font-size: 16px; background: #fafafa; }
15
+ button { height: 48px; border: none; border-radius: 12px; background: #007aff; color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; }
16
+ button:disabled { background: #ccc; }
17
+ .greeting { margin-top: 24px; padding: 16px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; color: #166534; font-size: 15px; display: none; }
18
+ </style>
19
+ </head>
20
+ <body>
21
+ <div class="card">
22
+ <h1>Hello, LingXia</h1>
23
+ <p>Build once, run everywhere</p>
24
+ <div class="form">
25
+ <input id="name" placeholder="Enter your name" />
26
+ <button id="btn">Say Hello</button>
27
+ </div>
28
+ <div id="greeting" class="greeting"></div>
29
+ </div>
30
+ <script src="/view/home.js"></script>
31
+ </body>
32
+ </html>
@@ -0,0 +1,3 @@
1
+ {
2
+ "navigationStyle": "custom"
3
+ }
@@ -0,0 +1,14 @@
1
+ Page({
2
+ data: {
3
+ greeting: '',
4
+ greetCount: 0
5
+ },
6
+
7
+ greet(payload: { name: string }) {
8
+ const count = this.data.greetCount + 1;
9
+ this.setData({
10
+ greetCount: count,
11
+ greeting: `Hello, ${payload.name}! 👋 (#${count})`
12
+ });
13
+ }
14
+ });
@@ -0,0 +1,13 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "ESNext",
5
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
6
+ "strict": true,
7
+ "skipLibCheck": true,
8
+ "moduleResolution": "bundler",
9
+ "noEmit": true
10
+ },
11
+ "include": ["**/*.ts", ".lingxia/types/**/*.d.ts"],
12
+ "exclude": ["node_modules", "dist"]
13
+ }