Skip to content

Commit 9b6424a

Browse files
committed
chore(sync): cascade fleet template@f9243b8
Auto-applied by socket-wheelhouse sync-scaffolding into socket-registry. 5 file(s) touched: - .config/oxlint-plugin/rules/prefer-cached-for-loop.mts - .config/oxlint-plugin/test/prefer-cached-for-loop.test.mts - .config/oxlint-plugin/test/socket-api-token-env.test.mts - scripts/install-token-minifier.mts - scripts/validate-file-size.mts
1 parent 4f1b767 commit 9b6424a

5 files changed

Lines changed: 43 additions & 11 deletions

File tree

.config/oxlint-plugin/rules/prefer-cached-for-loop.mts

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.config/oxlint-plugin/test/prefer-cached-for-loop.test.mts

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.config/oxlint-plugin/test/socket-api-token-env.test.mts

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/install-token-minifier.mts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ interface CatalogYamlMap {
9494
* line-shaped (key: value) and we only need the @socketsecurity/* entries the
9595
* proxy actually references.
9696
*/
97-
function readNeededCatalogEntries(): CatalogYamlMap {
97+
export function readNeededCatalogEntries(): CatalogYamlMap {
9898
const yamlPath = path.join(WHEELHOUSE_ROOT, 'pnpm-workspace.yaml')
9999
const text = readFileSync(yamlPath, 'utf8')
100100
const lines = text.split('\n')
@@ -140,7 +140,7 @@ function readNeededCatalogEntries(): CatalogYamlMap {
140140
* catalog aliases the package source declares. Keeps imports of
141141
* `@socketsecurity/lib-stable/...` resolvable from inside the install.
142142
*/
143-
function writeInstallWorkspaceYaml(catalog: CatalogYamlMap): void {
143+
export function writeInstallWorkspaceYaml(catalog: CatalogYamlMap): void {
144144
const lines = ['catalog:']
145145
for (const [k, v] of Object.entries(catalog)) {
146146
// Quote values that aren't bare versions (e.g. `npm:foo@1.0.0`).
@@ -161,7 +161,7 @@ function writeInstallWorkspaceYaml(catalog: CatalogYamlMap): void {
161161
* Stripping `bin`/`exports` keeps pnpm from trying to wire global binaries at
162162
* install time — we drop our own shim explicitly.
163163
*/
164-
function writeInstallPackageJson(sourceVersion: string): void {
164+
export function writeInstallPackageJson(sourceVersion: string): void {
165165
const sourcePkg = JSON.parse(
166166
readFileSync(path.join(PKG_SOURCE_DIR, 'package.json'), 'utf8'),
167167
)
@@ -190,7 +190,7 @@ function writeInstallPackageJson(sourceVersion: string): void {
190190
* `fs.cp` with recursive + force is the cross-platform equivalent of `cp -r`.
191191
* Force overwrites stale files on reinstall.
192192
*/
193-
function copySource(): void {
193+
export function copySource(): void {
194194
// Use sync fs API for consistency with the rest of the script — this
195195
// is a one-shot install, not a hot path. `cpSync` exists since
196196
// Node 20; the recursive option is required for directories.
@@ -207,14 +207,14 @@ function copySource(): void {
207207
* when the recorded x-source-version in the dest's package.json differs from
208208
* the source.
209209
*/
210-
function readSourceVersion(): string {
210+
export function readSourceVersion(): string {
211211
const pkg = JSON.parse(
212212
readFileSync(path.join(PKG_SOURCE_DIR, 'package.json'), 'utf8'),
213213
)
214214
return pkg.version ?? '0.0.0'
215215
}
216216

217-
function readInstalledVersion(): string | undefined {
217+
export function readInstalledVersion(): string | undefined {
218218
const installedPkgPath = path.join(INSTALL_DIR, 'package.json')
219219
if (!existsSync(installedPkgPath)) {
220220
return undefined
@@ -227,7 +227,7 @@ function readInstalledVersion(): string | undefined {
227227
}
228228
}
229229

230-
function pnpmInstallAtDest(quiet: boolean): void {
230+
export function pnpmInstallAtDest(quiet: boolean): void {
231231
const result = spawnSync(
232232
'pnpm',
233233
[
@@ -248,7 +248,7 @@ function pnpmInstallAtDest(quiet: boolean): void {
248248
}
249249
}
250250

251-
function writeBinShim(): void {
251+
export function writeBinShim(): void {
252252
// Shim execs the proxy's top-level bin/ entry. Source lives at
253253
// INSTALL_DIR/bin/, NOT under node_modules/ — so Node 22+ can strip
254254
// types from the .mts file at runtime. `node` is on PATH on every

scripts/validate-file-size.mts

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)