diff --git a/CHANGELOG.md b/CHANGELOG.md index 682c8bb4c..c68087ff5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## [Unreleased] + +### Fixed +- Socket CLI starts on Node 18.20.8 by falling back when the runtime cannot parse Unicode-set regular expressions. + ## [1.16.0](https://github.com/SocketDev/socket-cli/releases/tag/v1.16.0) - 2026-11-19 ### Added diff --git a/package.json b/package.json index 68bc012db..4bf1c40b6 100644 --- a/package.json +++ b/package.json @@ -151,8 +151,8 @@ "@socketsecurity/config": "3.0.1", "@socketsecurity/registry": "1.1.17", "@socketsecurity/sdk": "4.0.3", - "@termless/vterm": "0.11.0", "@termless/core": "0.11.0", + "@termless/vterm": "0.11.0", "@termless/xtermjs": "0.11.0", "@types/blessed": "0.1.25", "@types/cmd-shim": "5.0.2", @@ -309,20 +309,21 @@ "yargs-parser": "$yargs-parser" }, "patchedDependencies": { - "graceful-fs@4.2.11": "patches/graceful-fs@4.2.11.patch", - "string_decoder@0.10.31": "patches/string_decoder@0.10.31.patch", - "meow@13.2.0": "patches/meow@13.2.0.patch", "@rollup/plugin-commonjs@28.0.6": "patches/@rollup__plugin-commonjs@28.0.6.patch", + "@socketsecurity/registry@1.1.17": "patches/@socketsecurity__registry@1.1.17.patch", + "@socketsecurity/sdk@4.0.3": "patches/@socketsecurity__sdk@4.0.3.patch", "ansi-term@0.0.2": "patches/ansi-term@0.0.2.patch", - "drawille-blessed-contrib@1.0.0": "patches/drawille-blessed-contrib@1.0.0.patch", - "drawille-canvas-blessed-contrib@0.1.3": "patches/drawille-canvas-blessed-contrib@0.1.3.patch", "blessed@0.1.81": "patches/blessed@0.1.81.patch", "blessed-contrib@4.11.0": "patches/blessed-contrib@4.11.0.patch", "brace-expansion@2.0.2": "patches/brace-expansion@2.0.2.patch", "bresenham@0.0.3": "patches/bresenham@0.0.3.patch", + "drawille-blessed-contrib@1.0.0": "patches/drawille-blessed-contrib@1.0.0.patch", + "drawille-canvas-blessed-contrib@0.1.3": "patches/drawille-canvas-blessed-contrib@0.1.3.patch", + "graceful-fs@4.2.11": "patches/graceful-fs@4.2.11.patch", "lodash@4.17.21": "patches/lodash@4.17.21.patch", + "meow@13.2.0": "patches/meow@13.2.0.patch", "rollup@4.50.1": "patches/rollup@4.50.1.patch", - "@socketsecurity/registry@1.1.17": "patches/@socketsecurity__registry@1.1.17.patch", + "string_decoder@0.10.31": "patches/string_decoder@0.10.31.patch", "tiny-updater@3.5.3": "patches/tiny-updater@3.5.3.patch" } }, diff --git a/patches/@socketsecurity__sdk@4.0.3.patch b/patches/@socketsecurity__sdk@4.0.3.patch new file mode 100644 index 000000000..d12375237 --- /dev/null +++ b/patches/@socketsecurity__sdk@4.0.3.patch @@ -0,0 +1,17 @@ +diff --git a/dist/index.js b/dist/index.js +index 560bf62014ca80557d244be75207c74dddbf488f..2fe84d14a83fd82464fac9d627a6ea06fc5262da 100644 +--- a/dist/index.js ++++ b/dist/index.js +@@ -19306,9 +19306,9 @@ var require_width = /* @__PURE__ */ __commonJSMin(((exports) => { + let leadingNonPrintingRegex; + let emojiRegex; + try { +- zeroWidthClusterRegex = /^(?:\p{Control}|\p{Default_Ignorable_Code_Point}|\p{Mark}|\p{Surrogate})+$/v; +- leadingNonPrintingRegex = /^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v; +- emojiRegex = /^\p{RGI_Emoji}$/v; ++ zeroWidthClusterRegex = new RegExp('^(?:\\p{Control}|\\p{Default_Ignorable_Code_Point}|\\p{Mark}|\\p{Surrogate})+$', 'v'); ++ leadingNonPrintingRegex = new RegExp('^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+', 'v'); ++ emojiRegex = new RegExp('^\\p{RGI_Emoji}$', 'v'); + } catch { + zeroWidthClusterRegex = /^(?:\p{Control}|\p{Default_Ignorable_Code_Point}|\p{Mark})+$/u; + leadingNonPrintingRegex = /^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}]+/u; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 27eab6942..ffe1db99a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -66,6 +66,9 @@ patchedDependencies: '@socketsecurity/registry@1.1.17': hash: 46f41d951e8ffbe5c0b41d6aa30a0281fe032e0bfd97d899a1f4766285bfb820 path: patches/@socketsecurity__registry@1.1.17.patch + '@socketsecurity/sdk@4.0.3': + hash: 4a12f35c50a3360c68a367609b2de41514cd790f12eda5197b3f8a778ac7e1e2 + path: patches/@socketsecurity__sdk@4.0.3.patch ansi-term@0.0.2: hash: 06bb5127b7689d6ab2ea833f9617b2c3fbe9fe0048ce1c6b59b81f7e25ccbccb path: patches/ansi-term@0.0.2.patch @@ -227,7 +230,7 @@ importers: version: 1.1.17(patch_hash=46f41d951e8ffbe5c0b41d6aa30a0281fe032e0bfd97d899a1f4766285bfb820) '@socketsecurity/sdk': specifier: 4.0.3 - version: 4.0.3 + version: 4.0.3(patch_hash=4a12f35c50a3360c68a367609b2de41514cd790f12eda5197b3f8a778ac7e1e2) '@termless/core': specifier: 0.11.0 version: 0.11.0(node-pty@1.2.0-beta.18) @@ -7422,7 +7425,7 @@ snapshots: '@socketsecurity/registry@1.1.17(patch_hash=46f41d951e8ffbe5c0b41d6aa30a0281fe032e0bfd97d899a1f4766285bfb820)': {} - '@socketsecurity/sdk@4.0.3': {} + '@socketsecurity/sdk@4.0.3(patch_hash=4a12f35c50a3360c68a367609b2de41514cd790f12eda5197b3f8a778ac7e1e2)': {} '@socketsecurity/socket-patch-android-arm64@2.0.0': optional: true diff --git a/scripts/refresh/snapshots.mts b/scripts/refresh/snapshots.mts index cf3485cf4..5e39c983d 100644 --- a/scripts/refresh/snapshots.mts +++ b/scripts/refresh/snapshots.mts @@ -8,9 +8,9 @@ import type { ScriptMeta } from '../lib/run-main.mts' import { runMain } from '../lib/run-main.mts' import type { SnapshotDependencyName } from './snapshots/dependencies.mts' import { + SNAPSHOT_DEPENDENCIES, assertSnapshotDependenciesCurrent, normalizeSnapshotDependencyName, - SNAPSHOT_DEPENDENCIES, } from './snapshots/dependencies.mts' const ROOT = path.resolve(import.meta.dirname, '../..') diff --git a/scripts/test/native.mts b/scripts/test/native.mts index 393dbb95c..3af3322f9 100644 --- a/scripts/test/native.mts +++ b/scripts/test/native.mts @@ -5,6 +5,7 @@ import { promises as fs } from 'node:fs' import os from 'node:os' import path from 'node:path' import process from 'node:process' +import { SEA_VERSION } from '../../src/sea/version.mts' import { isMainModule } from '../lib/is-main-module.mts' import type { ScriptMeta } from '../lib/run-main.mts' import { runMain } from '../lib/run-main.mts' @@ -25,7 +26,6 @@ const ROOT = path.resolve(import.meta.dirname, '../..') const PACKAGE_PATH = path.join(ROOT, 'package.json') type PackageMetadata = { name: string - version: string } const BUILD_DIR = path.join(ROOT, 'build/sea') const TRIPLE = `${process.platform === 'win32' ? 'win' : process.platform}-${process.arch}` @@ -72,10 +72,10 @@ async function verifyArtifact( const manifest = JSON.parse(manifestText) as NativeManifest if ( manifest.application?.name !== packageInfo.name || - manifest.application?.version !== packageInfo.version + manifest.application?.version !== SEA_VERSION ) { throw new Error( - `Native manifest is for ${manifest.application?.name}@${manifest.application?.version}; expected ${packageInfo.name}@${packageInfo.version}`, + `Native manifest is for ${manifest.application?.name}@${manifest.application?.version}; expected ${packageInfo.name}@${SEA_VERSION}`, ) } if (manifest.target?.triple !== TRIPLE) { @@ -229,7 +229,7 @@ async function main(): Promise { process.env['SOCKET_CLI_NATIVE_TEST_STAGE'] = stageDir process.env['SOCKET_CLI_NATIVE_TEST_CAPABILITIES'] = manifest.capabilities.available.join(',') - process.env['SOCKET_CLI_NATIVE_TEST_VERSION'] = packageInfo.version + process.env['SOCKET_CLI_NATIVE_TEST_VERSION'] = SEA_VERSION const nodeRuntime = manifest.payloads.find( payload => payload.id === 'node-runtime', ) @@ -292,7 +292,7 @@ async function main(): Promise { } if ( version.status !== 0 || - !version.stdout.trim().startsWith(packageInfo.version) + !version.stdout.trim().startsWith(SEA_VERSION) ) { throw new Error( `Native --version check failed (status ${version.status}): ${version.stdout}${version.stderr}`, diff --git a/test/release-workflow.test.mts b/test/release-workflow.test.mts index 4ef9672b5..7c947d1af 100644 --- a/test/release-workflow.test.mts +++ b/test/release-workflow.test.mts @@ -11,6 +11,9 @@ import path from 'node:path' import { describe, expect, it } from 'vitest' import { parse } from 'yaml' +import { npmDistTagForRelease } from '../scripts/release/validate-npm-policy.mts' +import { SEA_RELEASE_POLICY } from '../src/sea/version.mts' + interface ReleaseStep { if?: string env?: Record @@ -261,8 +264,10 @@ describe('v1 release workflow contract', () => { const manifest = JSON.parse( readFileSync(new URL('../package.json', import.meta.url), 'utf8'), - ) as { publishConfig?: { tag?: string }; version?: string } - expect(manifest.version).toMatch(/^2\.1\.0-rc\.\d+$/u) + ) as { publishConfig?: { tag?: string }; version: string } + expect(npmDistTagForRelease(manifest.version, SEA_RELEASE_POLICY)).toBe( + manifest.version.startsWith('1.') ? 'latest' : SEA_RELEASE_POLICY.distTag, + ) expect(manifest.publishConfig?.tag).toBe('rc-2.1.0') expect(workflow.on.workflow_dispatch.inputs['release-major']?.default).toBe( '1',