@caelis/caelis 0.33.0 → 0.35.0

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.
@@ -144,22 +144,50 @@ function normalizeVersion(value) {
144
144
  return String(value || '').trim().replace(/^v/i, '');
145
145
  }
146
146
 
147
- async function defaultRunInstall(plan, signalCoordinator) {
147
+ function npmInstallInvocation(
148
+ plan,
149
+ platform = process.platform,
150
+ env = process.env,
151
+ ) {
148
152
  const executable = plan.command[0];
149
153
  const args = plan.command.slice(1);
150
- if (process.platform === 'win32' && /\.(?:cmd|bat)$/i.test(executable)) {
154
+ if (platform === 'win32' && /\.(?:cmd|bat)$/i.test(executable)) {
151
155
  const commandLine = String(plan.command_line || '').trim();
152
156
  if (!commandLine) {
153
157
  throw new Error('missing Windows npm command line');
154
158
  }
155
- return runCapturedProcess(
156
- process.env.ComSpec || 'cmd.exe',
157
- ['/d', '/s', '/c', commandLine],
158
- { env: process.env },
159
- signalCoordinator,
160
- );
159
+ const utf8CommandLine =
160
+ `chcp 65001 >nul 2>&1 & ${commandLine}`;
161
+ return {
162
+ command: env.ComSpec || 'cmd.exe',
163
+ args: ['/d', '/s', '/c', utf8CommandLine],
164
+ options: {
165
+ env,
166
+ // Go has already encoded this as one cmd.exe command line. Node's
167
+ // normal Windows argv quoting would add backslashes before its
168
+ // embedded quotes, making cmd.exe look for a literal \"npm.cmd\".
169
+ // Switch cmd.exe to UTF-8 before invoking npm so native diagnostics
170
+ // use the same encoding as npm's Node process. Use "&" so a system
171
+ // without code page 65001 still attempts the prepared update command.
172
+ windowsVerbatimArguments: true,
173
+ },
174
+ };
161
175
  }
162
- return runCapturedProcess(executable, args, { env: process.env }, signalCoordinator);
176
+ return {
177
+ command: executable,
178
+ args,
179
+ options: { env },
180
+ };
181
+ }
182
+
183
+ async function defaultRunInstall(plan, signalCoordinator) {
184
+ const invocation = npmInstallInvocation(plan);
185
+ return runCapturedProcess(
186
+ invocation.command,
187
+ invocation.args,
188
+ invocation.options,
189
+ signalCoordinator,
190
+ );
163
191
  }
164
192
 
165
193
  async function defaultVerifyVersion(executable, signalCoordinator) {
@@ -343,6 +371,7 @@ module.exports = {
343
371
  handoffEnvironment,
344
372
  handoffOwnershipName,
345
373
  handoffPlanName,
374
+ npmInstallInvocation,
346
375
  normalizeVersion,
347
376
  removeOwnedLock,
348
377
  reserveHandoffDirectory,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caelis/caelis",
3
- "version": "0.33.0",
3
+ "version": "0.35.0",
4
4
  "description": "caelis CLI distributed via npm",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -37,12 +37,12 @@
37
37
  "publish-release": "node ./scripts/publish-release.mjs"
38
38
  },
39
39
  "optionalDependencies": {
40
- "@caelis/caelis-darwin-arm64": "0.33.0",
41
- "@caelis/caelis-darwin-x64": "0.33.0",
42
- "@caelis/caelis-linux-arm64": "0.33.0",
43
- "@caelis/caelis-linux-x64": "0.33.0",
44
- "@caelis/caelis-windows-arm64": "0.33.0",
45
- "@caelis/caelis-windows-x64": "0.33.0"
40
+ "@caelis/caelis-darwin-arm64": "0.35.0",
41
+ "@caelis/caelis-darwin-x64": "0.35.0",
42
+ "@caelis/caelis-linux-arm64": "0.35.0",
43
+ "@caelis/caelis-linux-x64": "0.35.0",
44
+ "@caelis/caelis-windows-arm64": "0.35.0",
45
+ "@caelis/caelis-windows-x64": "0.35.0"
46
46
  },
47
47
  "publishConfig": {
48
48
  "access": "public",