@deveco-test/deveco-code 0.1.0-TD.27.1 → 0.1.0-TD.27.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.
Files changed (2) hide show
  1. package/package.json +5 -5
  2. package/postinstall.mjs +8 -6
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "scripts": {
7
7
  "postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
8
8
  },
9
- "version": "0.1.0-TD.27.1",
9
+ "version": "0.1.0-TD.27.2",
10
10
  "license": "MIT",
11
11
  "files": [
12
12
  "bin/**/*",
@@ -16,10 +16,10 @@
16
16
  "CHANGELOG.md"
17
17
  ],
18
18
  "optionalDependencies": {
19
- "@deveco-test/deveco-code-windows-x64-baseline": "0.1.0-TD.27.1",
20
- "@deveco-test/deveco-code-windows-x64": "0.1.0-TD.27.1",
21
- "@deveco-test/deveco-code-darwin-x64": "0.1.0-TD.27.1",
22
- "@deveco-test/deveco-code-darwin-arm64": "0.1.0-TD.27.1"
19
+ "@deveco-test/deveco-code-windows-x64-baseline": "0.1.0-TD.27.2",
20
+ "@deveco-test/deveco-code-windows-x64": "0.1.0-TD.27.2",
21
+ "@deveco-test/deveco-code-darwin-x64": "0.1.0-TD.27.2",
22
+ "@deveco-test/deveco-code-darwin-arm64": "0.1.0-TD.27.2"
23
23
  },
24
24
  "dependencies": {
25
25
  "@deveco/deveco-cli": "1.2.2"
package/postinstall.mjs CHANGED
@@ -28,7 +28,6 @@ const scope = packageJson.name && packageJson.name.includes("/") ? packageJson.n
28
28
  const base = `${scope}/deveco-code-${platform}-${arch}`
29
29
  const sourceBinary = platform === "windows" ? "deveco.exe" : "deveco"
30
30
  const targetBinary = path.join(__dirname, "bin", "deveco.exe")
31
- const devecoCliEntryMarker = path.join(__dirname, "vendor", ".deveco-cli-entry")
32
31
  const devecoCliPackageName = "@deveco/deveco-cli"
33
32
 
34
33
  function resolveLocalDevecoCliEntry() {
@@ -38,9 +37,10 @@ function resolveLocalDevecoCliEntry() {
38
37
  throw new Error(`Local dependency "${devecoCliPackageName}" has no CLI entry at ${entry}.`)
39
38
  }
40
39
 
41
- function writeDevecoCliEntryMarker() {
42
- fs.mkdirSync(path.dirname(devecoCliEntryMarker), { recursive: true })
43
- fs.writeFileSync(devecoCliEntryMarker, `${resolveLocalDevecoCliEntry()}\n`, "utf8")
40
+ function writeDevecoCliEntryMarker(installRoot) {
41
+ const marker = path.join(installRoot, "vendor", ".deveco-cli-entry")
42
+ fs.mkdirSync(path.dirname(marker), { recursive: true })
43
+ fs.writeFileSync(marker, `${resolveLocalDevecoCliEntry()}\n`, "utf8")
44
44
  }
45
45
 
46
46
  function supportsAvx2() {
@@ -244,12 +244,14 @@ function verifyBinary() {
244
244
  }
245
245
 
246
246
  function main() {
247
- writeDevecoCliEntryMarker()
247
+ writeDevecoCliEntryMarker(__dirname)
248
248
 
249
249
  for (const name of packageNames()) {
250
250
  try {
251
+ const packageDir = resolvePackageDir(name)
251
252
  copyBinary(resolveBinary(name), targetBinary)
252
- copyVendor(resolvePackageDir(name))
253
+ copyVendor(packageDir)
254
+ writeDevecoCliEntryMarker(packageDir)
253
255
  if (verifyBinary()) return
254
256
  } catch {
255
257
  if (installPackage(name) && verifyBinary()) return