@ship.zone/szci 7.1.4 → 7.1.5

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.
@@ -9,7 +9,7 @@ import { spawn } from 'child_process';
9
9
  import { fileURLToPath } from 'url';
10
10
  import { dirname, join } from 'path';
11
11
  import { existsSync } from 'fs';
12
- import { platform, arch } from 'os';
12
+ import { arch, platform } from 'os';
13
13
 
14
14
  const __filename = fileURLToPath(import.meta.url);
15
15
  const __dirname = dirname(__filename);
@@ -25,12 +25,12 @@ function getBinaryName() {
25
25
  const platformMap = {
26
26
  'darwin': 'macos',
27
27
  'linux': 'linux',
28
- 'win32': 'windows'
28
+ 'win32': 'windows',
29
29
  };
30
30
 
31
31
  const archMap = {
32
32
  'x64': 'x64',
33
- 'arm64': 'arm64'
33
+ 'arm64': 'arm64',
34
34
  };
35
35
 
36
36
  const mappedPlatform = platformMap[plat];
@@ -61,12 +61,10 @@ function executeBinary() {
61
61
 
62
62
  const denoSourcePath = join(__dirname, '..', 'mod.ts');
63
63
  const denoConfigPath = join(__dirname, '..', 'deno.json');
64
- const command = existsSync(binaryPath) ? binaryPath : 'deno';
65
- const args = existsSync(binaryPath)
66
- ? process.argv.slice(2)
67
- : ['run', '--allow-all', '--config', denoConfigPath, denoSourcePath, ...process.argv.slice(2)];
64
+ const binaryExists = existsSync(binaryPath);
65
+ const sourceFallbackExists = existsSync(denoSourcePath) && existsSync(denoConfigPath);
68
66
 
69
- if (!existsSync(binaryPath) && !existsSync(denoSourcePath)) {
67
+ if (!binaryExists && !sourceFallbackExists) {
70
68
  console.error(`Error: Binary not found at ${binaryPath}`);
71
69
  console.error(`Error: Deno source fallback not found at ${denoSourcePath}`);
72
70
  console.error('Try reinstalling the package:');
@@ -75,35 +73,76 @@ function executeBinary() {
75
73
  process.exit(1);
76
74
  }
77
75
 
78
- // Spawn the binary or the Deno source fallback with all arguments passed through.
79
- const child = spawn(command, args, {
80
- stdio: 'inherit',
81
- shell: false
82
- });
76
+ let activeChild;
77
+ const spawnCommand = (command, args, isStandaloneBinary) => {
78
+ const child = spawn(command, args, {
79
+ stdio: 'inherit',
80
+ shell: false,
81
+ });
82
+ activeChild = child;
83
83
 
84
- // Handle child process events
85
- child.on('error', (err) => {
86
- console.error(`Error executing szci: ${err.message}`);
87
- process.exit(1);
88
- });
84
+ child.on('error', (err) => {
85
+ console.error(`Error executing szci: ${err.message}`);
86
+ process.exit(1);
87
+ });
89
88
 
90
- child.on('exit', (code, signal) => {
91
- if (signal) {
92
- process.kill(process.pid, signal);
93
- } else {
94
- process.exit(code || 0);
95
- }
96
- });
89
+ child.on('exit', (code, signal) => {
90
+ if (
91
+ isStandaloneBinary &&
92
+ signal === 'SIGILL' &&
93
+ sourceFallbackExists
94
+ ) {
95
+ console.warn(
96
+ 'SZCI standalone binary exited with SIGILL; retrying with the packaged Deno source fallback.',
97
+ );
98
+ spawnCommand(
99
+ 'deno',
100
+ [
101
+ 'run',
102
+ '--allow-all',
103
+ '--config',
104
+ denoConfigPath,
105
+ denoSourcePath,
106
+ ...process.argv.slice(2),
107
+ ],
108
+ false,
109
+ );
110
+ return;
111
+ }
112
+ if (signal) {
113
+ process.kill(process.pid, signal);
114
+ } else {
115
+ process.exit(code || 0);
116
+ }
117
+ });
118
+ };
97
119
 
98
120
  // Forward signals to child process
99
121
  const signals = ['SIGINT', 'SIGTERM', 'SIGHUP'];
100
- signals.forEach(signal => {
122
+ signals.forEach((signal) => {
101
123
  process.on(signal, () => {
102
- if (!child.killed) {
103
- child.kill(signal);
124
+ if (activeChild && !activeChild.killed) {
125
+ activeChild.kill(signal);
104
126
  }
105
127
  });
106
128
  });
129
+
130
+ if (binaryExists) {
131
+ spawnCommand(binaryPath, process.argv.slice(2), true);
132
+ } else {
133
+ spawnCommand(
134
+ 'deno',
135
+ [
136
+ 'run',
137
+ '--allow-all',
138
+ '--config',
139
+ denoConfigPath,
140
+ denoSourcePath,
141
+ ...process.argv.slice(2),
142
+ ],
143
+ false,
144
+ );
145
+ }
107
146
  }
108
147
 
109
148
  // Execute
package/changelog.md CHANGED
@@ -1,7 +1,12 @@
1
1
  # Changelog
2
2
 
3
- ## Pending
3
+ ## 2026-07-28 - 7.1.5
4
4
 
5
+ ### Fixes
6
+
7
+ - retry the packaged Deno source when the standalone binary exits with `SIGILL`
8
+ - Keeps the normal standalone path on supported CPUs.
9
+ - Recovers ARM64 CI environments that reject an incompatible executable instruction.
5
10
 
6
11
  ## 2026-05-20 - 7.1.4
7
12
 
package/deno.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@ship.zone/szci",
3
- "version": "7.1.4",
3
+ "version": "7.1.5",
4
4
  "exports": "./mod.ts",
5
5
  "nodeModulesDir": "auto",
6
6
  "tasks": {
7
7
  "dev": "deno run --allow-all mod.ts",
8
8
  "compile": "deno task compile:all",
9
9
  "compile:all": "bash scripts/compile-all.sh",
10
- "test": "deno test --allow-all test/",
11
- "test:watch": "deno test --allow-all --watch test/",
10
+ "test": "deno test --allow-all test/*.ts",
11
+ "test:watch": "deno test --allow-all --watch test/*.ts",
12
12
  "check": "deno check mod.ts",
13
13
  "fmt": "deno fmt",
14
14
  "lint": "deno lint"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ship.zone/szci",
3
- "version": "7.1.4",
3
+ "version": "7.1.5",
4
4
  "description": "Serve Zone CI - A tool to streamline Node.js and Docker workflows within CI environments, particularly GitLab CI, providing various CI/CD utilities. Powered by Deno with standalone executables.",
5
5
  "keywords": [
6
6
  "Node.js",
package/readme.md CHANGED
@@ -52,6 +52,10 @@ curl -sSL https://code.foss.global/ship.zone/szci/raw/branch/main/install.sh | s
52
52
  npm install -g @ship.zone/szci
53
53
  ```
54
54
 
55
+ The normal pre-compiled path does not require a runtime. If a standalone executable terminates with
56
+ `SIGILL`, the npm wrapper automatically retries the packaged source and requires `deno` to be
57
+ available on `PATH`.
58
+
55
59
  ### From Source
56
60
 
57
61
  ```sh
@@ -128,7 +132,7 @@ szci node install 21 # Any specific version
128
132
  Uses NVM under the hood (auto-detected at `/usr/local/nvm/nvm.sh` or `~/.nvm/nvm.sh`). After installing, it:
129
133
  1. Sets the installed version as `nvm alias default`
130
134
  2. Upgrades npm to latest
131
- 3. Installs any global tools listed in `npmextra.json` → `npmGlobalTools`
135
+ 3. Installs any global tools listed in `.smartconfig.json` → `npmGlobalTools`
132
136
 
133
137
  ### `szci ssh` — SSH Key Deployment
134
138
 
@@ -148,7 +152,7 @@ Pushes all branches and tags to a GitHub mirror. Requires `SZCI_GIT_GITHUBTOKEN`
148
152
 
149
153
  ## ⚙️ Configuration
150
154
 
151
- ### `npmextra.json`
155
+ ### `.smartconfig.json`
152
156
 
153
157
  Place this in your project root to configure szci behavior:
154
158
 
@@ -371,7 +375,7 @@ deno task lint
371
375
 
372
376
  ## License and Legal Information
373
377
 
374
- This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [LICENSE](./LICENSE) file.
378
+ This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [license](./license) file.
375
379
 
376
380
  **Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
377
381
 
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@ship.zone/szci',
6
- version: '7.1.3',
6
+ version: '7.1.5',
7
7
  description: 'Serve Zone CI - A tool to streamline Node.js and Docker workflows within CI environments, particularly GitLab CI, providing various CI/CD utilities. Powered by Deno with standalone executables.'
8
8
  }
@@ -30,7 +30,7 @@ export class SzciNodeJsManager {
30
30
  } else {
31
31
  logger.log(
32
32
  'error',
33
- `>>szci node ...<< cli arguments invalid... Please read the documentation.`
33
+ `>>szci node ...<< cli arguments invalid... Please read the documentation.`,
34
34
  );
35
35
  Deno.exit(1);
36
36
  }
@@ -44,7 +44,7 @@ export class SzciConfig {
44
44
  this.szciQenv = new plugins.qenv.Qenv(
45
45
  paths.SzciProjectDir,
46
46
  paths.SzciProjectNogitDir,
47
- false
47
+ false,
48
48
  );
49
49
 
50
50
  this.configObject = {
@@ -54,7 +54,10 @@ export class SzciConfig {
54
54
  npmRegistryUrl: 'registry.npmjs.org',
55
55
  urlCloudly: await this.szciQenv.getEnvVarOnDemand('SZCI_URL_CLOUDLY'),
56
56
  };
57
- this.configObject = this.szciSmartconfig.dataFor<ISzciOptions>('@ship.zone/szci', this.configObject);
57
+ this.configObject = this.szciSmartconfig.dataFor<ISzciOptions>(
58
+ '@ship.zone/szci',
59
+ this.configObject,
60
+ );
58
61
  }
59
62
 
60
63
  public getConfig(): ISzciOptions {
@@ -36,10 +36,10 @@ export {
36
36
  projectinfo,
37
37
  qenv,
38
38
  smartanalytics,
39
- smartfile,
40
- smartgit,
41
39
  smartcli,
42
40
  smartconfig,
41
+ smartfile,
42
+ smartgit,
43
43
  smartlog,
44
44
  smartlogDestinationLocal,
45
45
  smartobject,
@@ -56,4 +56,3 @@ export {
56
56
  import * as tsclass from '@tsclass/tsclass';
57
57
 
58
58
  export { tsclass };
59
-