@deveco-test/deveco-code 1.10.30 → 1.10.32

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/bin/deveco CHANGED
@@ -76,9 +76,34 @@ try {
76
76
  } catch {
77
77
  // dev mode or missing package.json
78
78
  }
79
+ // Mirrors script/postinstall.mjs isOhos(): OHOS PCs report linux/arm64 (or
80
+ // openharmony) but need the cross-built hmos artifact.
81
+ function isOhos() {
82
+ if (os.platform() === "openharmony") return true
83
+ if (os.platform() !== "linux") return false
84
+ let filePara = false
85
+ let fileRelease = false
86
+ try {
87
+ filePara = fs.existsSync("/system/etc/ohos.para")
88
+ fileRelease = fs.existsSync("/etc/ohos-release")
89
+ } catch {
90
+ // Ignore filesystem probes that are blocked by the host.
91
+ }
92
+ const rel = os.release().toLowerCase()
93
+ return (
94
+ Boolean(process.env.HOS_VERSION) ||
95
+ Boolean(process.env.OHOS_API_VERSION) ||
96
+ rel.includes("ohos") ||
97
+ rel.includes("hongmeng") ||
98
+ filePara ||
99
+ fileRelease
100
+ )
101
+ }
102
+
103
+ const ohos = isOhos()
79
104
  const scope = mainPkg.name && mainPkg.name.includes("/") ? mainPkg.name.split("/")[0] : "@deveco"
80
- const base = scope + "/deveco-code-" + platform + "-" + arch
81
- const binary = platform === "windows" ? "deveco.exe" : "deveco"
105
+ const base = scope + "/deveco-code-" + (ohos ? "hmos" : platform) + "-" + arch
106
+ const binary = ohos ? "hmos" : platform === "windows" ? "deveco.exe" : "deveco"
82
107
 
83
108
  function supportsAvx2() {
84
109
  if (arch !== "x64") return false
@@ -131,6 +156,7 @@ function supportsAvx2() {
131
156
  }
132
157
 
133
158
  const names = (() => {
159
+ if (ohos) return [base]
134
160
  const avx2 = supportsAvx2()
135
161
  const baseline = arch === "x64" && !avx2
136
162
 
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "scripts": {
7
7
  "postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
8
8
  },
9
- "version": "1.10.30",
9
+ "version": "1.10.32",
10
10
  "license": "MIT",
11
11
  "files": [
12
12
  "bin/**/*",
@@ -16,10 +16,11 @@
16
16
  "CHANGELOG.md"
17
17
  ],
18
18
  "optionalDependencies": {
19
- "@deveco-test/deveco-code-darwin-x64": "1.10.30",
20
- "@deveco-test/deveco-code-darwin-arm64": "1.10.30",
21
- "@deveco-test/deveco-code-windows-x64-baseline": "1.10.30",
22
- "@deveco-test/deveco-code-windows-x64": "1.10.30"
19
+ "@deveco-test/deveco-code-darwin-arm64": "1.10.32",
20
+ "@deveco-test/deveco-code-darwin-x64": "1.10.32",
21
+ "@deveco-test/deveco-code-windows-x64-baseline": "1.10.32",
22
+ "@deveco-test/deveco-code-windows-x64": "1.10.32",
23
+ "@deveco-test/deveco-code-hmos-arm64": "1.10.32"
23
24
  },
24
25
  "dependencies": {
25
26
  "@deveco/deveco-cli": "1.3.2"
package/postinstall.mjs CHANGED
@@ -30,8 +30,8 @@ const sourceBinary = platform === "windows" ? "deveco.exe" : "deveco"
30
30
  const targetBinary = path.join(__dirname, "bin", "deveco.exe")
31
31
  const devecoCliPackageName = "@deveco/deveco-cli"
32
32
 
33
- // Mirrors packages/tui isOhos(): OHOS PCs report linux/arm64 to npm but need
34
- // the cross-built hmos artifact instead of a generic linux platform package.
33
+ // Mirrors packages/tui isOhos(): OHOS PCs report openharmony (or linux) to
34
+ // npm but need the cross-built hmos artifact instead of a linux package.
35
35
  function isOhos() {
36
36
  if (os.platform() === "openharmony") return true
37
37
  if (os.platform() !== "linux") return false
@@ -231,7 +231,7 @@ function ensureVendorExecutables(vendorRoot) {
231
231
  }
232
232
 
233
233
  function installPackage(name) {
234
- // hmos artifacts stay out of optionalDependencies (no os/cpu tuple), so fall
234
+ // Prefer the version pinned in optionalDependencies (hmos included); fall
235
235
  // back to the release version shared by every package in this train.
236
236
  const version = packageJson.optionalDependencies?.[name] ?? packageJson.version
237
237