Skip to content

Commit 7590d81

Browse files
authored
Merge branch 'main' into no-major-upgrades-show-affected-direct-dependencies
2 parents 17fe152 + f48d127 commit 7590d81

186 files changed

Lines changed: 14209 additions & 1404 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.config/babel.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module.exports = {
2121
version: '^7.27.1',
2222
},
2323
],
24-
path.join(babelPluginsPath, 'transform-set-proto-plugin.js'),
25-
path.join(babelPluginsPath, 'transform-url-parse-plugin.js'),
24+
path.join(babelPluginsPath, 'transform-set-proto-plugin.mjs'),
25+
path.join(babelPluginsPath, 'transform-url-parse-plugin.mjs'),
2626
],
2727
}

.config/rollup.base.config.mjs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ import { escapeRegExp } from '@socketsecurity/registry/lib/regexps'
1414
import { spawnSync } from '@socketsecurity/registry/lib/spawn'
1515
import { stripAnsi } from '@socketsecurity/registry/lib/strings'
1616

17-
import constants from '../scripts/constants.js'
18-
import socketModifyPlugin from '../scripts/rollup/socket-modify-plugin.js'
17+
import constants from '../scripts/constants.mjs'
18+
import socketModifyPlugin from '../scripts/rollup/socket-modify-plugin.mjs'
1919
import {
2020
getPackageName,
2121
isBuiltin,
2222
normalizeId,
23-
} from '../scripts/utils/packages.js'
23+
} from '../scripts/utils/packages.mjs'
2424

2525
const {
2626
INLINED_SOCKET_CLI_COANA_TECH_CLI_VERSION,
@@ -109,7 +109,7 @@ export default function baseConfig(extendConfig = {}) {
109109
? extendConfig.plugins.slice()
110110
: []
111111

112-
const extractedPlugins = { __proto__: null }
112+
const extractedPlugins = Object.create(null)
113113
if (extendPlugins.length) {
114114
for (const pluginName of [
115115
'babel',
@@ -138,6 +138,18 @@ export default function baseConfig(extendConfig = {}) {
138138
id,
139139
path.isAbsolute(id) ? nmPath.length + 1 : 0,
140140
)
141+
// Externalize anything from the external directory.
142+
if (id.includes('/external/') || id.startsWith('../external/')) {
143+
return true
144+
}
145+
// Externalize @socketsecurity/registry and all its internal paths.
146+
if (
147+
pkgName === '@socketsecurity/registry' ||
148+
id.includes('@socketsecurity/registry/external/') ||
149+
id.includes('/@socketsecurity+registry@')
150+
) {
151+
return true
152+
}
141153
return (
142154
id.endsWith('.d.cts') ||
143155
id.endsWith('.d.mts') ||

.config/rollup.dist.config.mjs

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ import { naturalCompare } from '@socketsecurity/registry/lib/sorts'
2323
import { spawn } from '@socketsecurity/registry/lib/spawn'
2424

2525
import baseConfig, { EXTERNAL_PACKAGES } from './rollup.base.config.mjs'
26-
import constants from '../scripts/constants.js'
27-
import socketModifyPlugin from '../scripts/rollup/socket-modify-plugin.js'
26+
import constants from '../scripts/constants.mjs'
27+
import socketModifyPlugin from '../scripts/rollup/socket-modify-plugin.mjs'
2828
import {
2929
getPackageName,
3030
isBuiltin,
3131
normalizeId,
32-
} from '../scripts/utils/packages.js'
32+
} from '../scripts/utils/packages.mjs'
3333

3434
const {
3535
CONSTANTS,
@@ -468,12 +468,12 @@ export default async () => {
468468
cwd: blessedContribSrcPath,
469469
})
470470
).map(filepath => {
471-
const relPath = `${path.relative(srcPath, filepath).slice(0, -4 /*.mjs*/)}.js`
471+
const relPath = `${path.relative(blessedContribSrcPath, filepath).slice(0, -4 /*.mjs*/)}.js`
472472
return {
473473
input: filepath,
474474
output: [
475475
{
476-
file: path.join(rootPath, relPath),
476+
file: path.join(constants.blessedContribPath, relPath),
477477
exports: 'auto',
478478
externalLiveBindings: false,
479479
format: 'cjs',
@@ -500,6 +500,22 @@ export default async () => {
500500
preferBuiltins: true,
501501
}),
502502
jsonPlugin(),
503+
// Fix blessed library octal escape sequences
504+
{
505+
name: 'fix-blessed-octal',
506+
transform(code, id) {
507+
if (
508+
id.includes('blessed') &&
509+
(id.includes('tput.js') || id.includes('box.js'))
510+
) {
511+
return code
512+
.replace(/ch = '\\200';/g, "ch = '\\x80';")
513+
.replace(/'\\016'/g, "'\\x0E'")
514+
.replace(/'\\017'/g, "'\\x0F'")
515+
}
516+
return null
517+
},
518+
},
503519
commonjsPlugin({
504520
defaultIsModuleExports: true,
505521
extensions: ['.cjs', '.js'],

.env.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
LINT_DIST=1
22
NODE_COMPILE_CACHE="./.cache"
3+
NODE_OPTIONS="--max-old-space-size=4096 --max-semi-space-size=512"

.env.local

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
NODE_COMPILE_CACHE="./.cache"
2+
NODE_OPTIONS="--max-old-space-size=8192 --max-semi-space-size=1024"

.env.test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
NODE_COMPILE_CACHE="./.cache"
2+
NODE_OPTIONS="--max-old-space-size=2048"
3+
NODE_ENV=test
24
VITEST=1
5+
SOCKET_CLI_DEBUG=false
6+
DEBUG=false

.github/workflows/provenance.yml.disabled

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
options:
1212
- '0'
1313
- '1'
14+
1415
jobs:
1516
build:
1617
runs-on: ubuntu-latest
@@ -26,14 +27,28 @@ jobs:
2627
scope: '@socketsecurity'
2728
- run: pnpm install
2829

30+
- name: Ensure npm version 11.5.1+ for trusted publishing
31+
run: |
32+
NPM_VERSION=$(npm --version)
33+
echo "Current npm version: $NPM_VERSION"
34+
# Check if npm version is >= 11.5.1
35+
if ! npx --yes semver "$NPM_VERSION" -r ">=11.5.1"; then
36+
echo "Installing npm 11.5.1+ for trusted publishing..."
37+
npm install -g npm@latest
38+
echo "Updated npm version: $(npm --version)"
39+
else
40+
echo "npm version $NPM_VERSION meets the 11.5.1+ requirement for trusted publishing"
41+
fi
42+
2943
# Build and publish 'socket' package (default).
3044
- name: Build socket package
3145
run: INLINED_SOCKET_CLI_PUBLISHED_BUILD=1 pnpm run build:dist
46+
env:
47+
SOCKET_CLI_DEBUG: ${{ inputs.debug }}
3248
- name: Publish socket package
33-
run: cd dist && npm publish --provenance --access public --no-git-checks
49+
run: cd dist && npm publish --access public --no-git-checks
3450
continue-on-error: true
3551
env:
36-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3752
SOCKET_CLI_DEBUG: ${{ inputs.debug }}
3853

3954
# Build and publish '@socketsecurity/cli' package (legacy).
@@ -42,10 +57,9 @@ jobs:
4257
env:
4358
SOCKET_CLI_DEBUG: ${{ inputs.debug }}
4459
- name: Publish @socketsecurity/cli package
45-
run: cd dist && npm publish --provenance --access public --no-git-checks
60+
run: cd dist && npm publish --access public --no-git-checks
4661
continue-on-error: true
4762
env:
48-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4963
SOCKET_CLI_DEBUG: ${{ inputs.debug }}
5064

5165
# Build and publish '@socketsecurity/cli-with-sentry' package.
@@ -54,8 +68,7 @@ jobs:
5468
env:
5569
SOCKET_CLI_DEBUG: ${{ inputs.debug }}
5670
- name: Publish @socketsecurity/cli-with-sentry package
57-
run: cd dist && npm publish --provenance --access public --no-git-checks
71+
run: cd dist && npm publish --access public --no-git-checks
5872
continue-on-error: true
5973
env:
60-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6174
SOCKET_CLI_DEBUG: ${{ inputs.debug }}

.github/workflows/release-sea.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,29 @@ on:
1313
jobs:
1414
build-sea:
1515
strategy:
16+
fail-fast: false # Continue building other platforms if one fails
1617
matrix:
1718
include:
19+
# Linux builds - fully supported
1820
- os: ubuntu-latest
1921
platform: linux
2022
arch: x64
2123
- os: ubuntu-latest
2224
platform: linux
23-
arch: arm64
25+
arch: arm64 # Cross-compilation, generally stable
26+
# macOS builds - fully supported (native compilation)
2427
- os: macos-latest
2528
platform: darwin
2629
arch: x64
2730
- os: macos-latest
2831
platform: darwin
2932
arch: arm64
33+
# Windows builds - x64 is stable
3034
- os: windows-latest
3135
platform: win32
3236
arch: x64
33-
- os: windows-latest
37+
# Windows ARM64 - native ARM64 runner (GitHub Actions 2025)
38+
- os: windows-2022-arm64
3439
platform: win32
3540
arch: arm64
3641

@@ -105,11 +110,17 @@ jobs:
105110
--draft
106111
fi
107112
108-
# Upload binaries
109-
for file in dist/sea/socket-*; do
110-
echo "Uploading $file..."
111-
gh release upload "$VERSION" "$file" --clobber
112-
done
113+
# Upload binaries (skip if none exist)
114+
if ls dist/sea/socket-* 1> /dev/null 2>&1; then
115+
for file in dist/sea/socket-*; do
116+
echo "Uploading $file..."
117+
gh release upload "$VERSION" "$file" --clobber
118+
done
119+
else
120+
echo "⚠️ No binaries found to upload"
121+
echo "This may be expected if some platform builds failed"
122+
echo "See docs/SEA_PLATFORM_SUPPORT.md for supported platforms"
123+
fi
113124
114125
publish-npm:
115126
needs: upload-release

0 commit comments

Comments
 (0)