diff --git a/.github/workflows/npm-publish-packages.yml b/.github/workflows/npm-publish-packages.yml index 30c0d5c8d..1e6b0b893 100644 --- a/.github/workflows/npm-publish-packages.yml +++ b/.github/workflows/npm-publish-packages.yml @@ -3,7 +3,7 @@ name: πŸ“¦ npm publish packages # Repo-owned (NOT cascaded): socket-registry publishes a FAMILY β€” the # `@socketregistry/*` override packages plus the registry package itself β€” # rather than the single subject `npm-publish.yml` handles. The family stager -# is `scripts/npm/publish-npm-packages.mts`, and this workflow is the only +# is `scripts/repo/npm/publish-npm-packages.mts`, and this workflow is the only # place it uploads from. # # Why a workflow at all: the fleet allows exactly ONE npm upload invocation, @@ -136,4 +136,4 @@ jobs: env: DIST_TAG: ${{ inputs.dist-tag }} ONLY: ${{ inputs.only }} - run: node scripts/npm/publish-npm-packages.mts --force-publish --dist-tag "$DIST_TAG" ${ONLY:+--only "$ONLY"} ${{ inputs.publish != true && '--dry-run' || '' }} + run: node scripts/repo/npm/publish-npm-packages.mts --force-publish --dist-tag "$DIST_TAG" ${ONLY:+--only "$ONLY"} ${{ inputs.publish != true && '--dry-run' || '' }} diff --git a/CLAUDE.md b/CLAUDE.md index cdeda88f7..8004bd34b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -137,4 +137,4 @@ Layout, commands, build, testing, vitest config, dependency policy, and the scra - 🚨 Coverage is mandatory and never decreases; every `c8 ignore` reason ends with a period. [`architecture`](docs/agents.md/repo/architecture.md) - 🚨 Never the split `@typescript-eslint/*` packages, and never swap tsgo for stock `tsc`. [`architecture`](docs/agents.md/repo/architecture.md) - 🚨 A ported `test/npm/*.test.mts` suite's provenance is its `file-fork` row in `lockstep.json`, never its prose header. [`npm-port-provenance`](docs/agents.md/repo/npm-port-provenance.md) -- Override impact is rank Γ— cut; a cut % without its gateways lies. (`scripts/npm/survey-override-deps.mts`) [`override-impact-analysis`](docs/agents.md/repo/override-impact-analysis.md) +- Override impact is rank Γ— cut; a cut % without its gateways lies. (`scripts/repo/npm/survey-override-deps.mts`) [`override-impact-analysis`](docs/agents.md/repo/override-impact-analysis.md) diff --git a/docs/agents.md/repo/architecture.md b/docs/agents.md/repo/architecture.md index 1e0cd9eff..a651a1705 100644 --- a/docs/agents.md/repo/architecture.md +++ b/docs/agents.md/repo/architecture.md @@ -13,17 +13,17 @@ The CLAUDE.md `## πŸ—οΈ Registry-Specific` section is the headline. This file ## Commands -| Command | Purpose | -| ---------------------------------------- | ----------------------------------------------------------- | -| `pnpm run build` | Build the registry (esbuild β†’ CJS). | -| `pnpm test` | Run vitest suite. | -| `pnpm run check` | Lint + type check together. | -| `pnpm run fix` | Auto-fix lint + format. | -| `pnpm run type` | Type check only (`tsgo`, no emit). | -| `pnpm run update` | Refresh dependencies via taze. | -| `pnpm run make-npm-override` | Scaffold a new NPM package override under `/packages/npm/`. | -| `pnpm run release-npm` | Publish NPM overrides. | -| `node scripts/npm/test-npm-packages.mts` | Long-running NPM-package test driver. | +| Command | Purpose | +| --------------------------------------------- | ----------------------------------------------------------- | +| `pnpm run build` | Build the registry (esbuild β†’ CJS). | +| `pnpm test` | Run vitest suite. | +| `pnpm run check` | Lint + type check together. | +| `pnpm run fix` | Auto-fix lint + format. | +| `pnpm run type` | Type check only (`tsgo`, no emit). | +| `pnpm run update` | Refresh dependencies via taze. | +| `pnpm run make-npm-override` | Scaffold a new NPM package override under `/packages/npm/`. | +| `pnpm run release-npm` | Publish NPM overrides. | +| `node scripts/repo/npm/test-npm-packages.mts` | Long-running NPM-package test driver. | ## Build system diff --git a/docs/agents.md/repo/override-impact-analysis.md b/docs/agents.md/repo/override-impact-analysis.md index cbe25ff87..d91e61c10 100644 --- a/docs/agents.md/repo/override-impact-analysis.md +++ b/docs/agents.md/repo/override-impact-analysis.md @@ -51,7 +51,7 @@ that used different ones. ## Related -- `scripts/npm/survey-override-deps.mts` β€” the offline-first survey of existing +- `scripts/repo/npm/survey-override-deps.mts` β€” the offline-first survey of existing overrides and their remaining dependencies. - The fleet skill for cross-repo impact research (wheelhouse) wraps the reachability simulation described here. diff --git a/package.json b/package.json index 01af3598e..4bc9f3961 100644 --- a/package.json +++ b/package.json @@ -19,43 +19,43 @@ "linkDirectory": false }, "scripts": { - "analyze-ci-failures": "node scripts/testing/analyze-ci-failures.mts", + "analyze-ci-failures": "node scripts/repo/testing/analyze-ci-failures.mts", "build": "node scripts/repo/build.mts", "check": "node scripts/fleet/check.mts", - "check-trusted": "node scripts/npm/check-trusted-packages.mts", + "check-trusted": "node scripts/repo/npm/check-trusted-packages.mts", "check:paths": "node scripts/fleet/check/paths-are-canonical.mts", "clean": "node scripts/fleet/clean.mts", "cover": "node scripts/fleet/cover.mts", "fix": "node scripts/fleet/fix.mts", "format": "node scripts/fleet/format.mts", "format:check": "node scripts/fleet/format.mts --check", - "generate-actions-allow-list": "node scripts/ci/generate-actions-allow-list.mts", - "generate-actions-tree": "node scripts/ci/show-actions-tree.mts", - "inline-action-shas": "node scripts/ci/inline-action-versions-as-shas.mts", + "generate-actions-allow-list": "node scripts/repo/ci/generate-actions-allow-list.mts", + "generate-actions-tree": "node scripts/repo/ci/show-actions-tree.mts", + "inline-action-shas": "node scripts/repo/ci/inline-action-versions-as-shas.mts", "lint": "node scripts/fleet/lint.mts", "lockstep": "node scripts/fleet/lockstep.mts", "lockstep:emit-schema": "node scripts/fleet/lockstep-emit-schema.mts", - "make-npm-override": "node scripts/npm/make-npm-override.mts", - "npm:configure-staged": "node scripts/npm/configure-staged-publishing.mts", + "make-npm-override": "node scripts/repo/npm/make-npm-override.mts", + "npm:configure-staged": "node scripts/repo/npm/configure-staged-publishing.mts", "npm:publish": "node scripts/fleet/publish-pipeline.mts", - "npm:wire-port": "node scripts/npm/wire-npm-port.mts", - "package-npm-access": "node scripts/npm/set-npm-package-access.mts", - "package-npm-publish": "node scripts/npm/publish-npm-packages.mts", + "npm:wire-port": "node scripts/repo/npm/wire-npm-port.mts", + "package-npm-access": "node scripts/repo/npm/set-npm-package-access.mts", + "package-npm-publish": "node scripts/repo/npm/publish-npm-packages.mts", "perf": "node scripts/repo/perf.mts", "security": "node scripts/fleet/security.mts", "setup": "node scripts/repo/setup.mts", "prepare": "node scripts/fleet/install-git-hooks.mts && node scripts/fleet/prepare.mts", "prepublishOnly": "echo 'ERROR: Use GitHub Actions workflow for publishing' && exit 1", - "release-npm": "node scripts/npm/release-npm-packages.mts", + "release-npm": "node scripts/repo/npm/release-npm-packages.mts", "test": "node scripts/fleet/test.mts", "test:fuzz": "node scripts/repo/fuzz.mts", - "test:npm": "node scripts/npm/run-vitest-npm.mts", - "test:npm:floor": "node scripts/npm/floor-node-smoke.mts", + "test:npm": "node scripts/repo/npm/run-vitest-npm.mts", + "test:npm:floor": "node scripts/repo/npm/floor-node-smoke.mts", "type": "node node_modules/typescript/bin/tsc --noEmit -p .config/fleet/tsconfig.check.json", "update": "node scripts/fleet/update.mts", "update:external-tools": "node scripts/repo/update-external-tools.mts", - "validate-ci": "node scripts/testing/reproduce-ci-locally.mts", - "validate-packages": "node scripts/testing/validate-package-tests.mts", + "validate-ci": "node scripts/repo/testing/reproduce-ci-locally.mts", + "validate-packages": "node scripts/repo/testing/validate-package-tests.mts", "setup-security-tools": "node .claude/hooks/fleet/setup-security-tools/install.mts", "ci:local": "node scripts/fleet/agent-ci-skip-locks.mts run --all --quiet --pause-on-failure --github-token", "weekly-update": "node scripts/fleet/weekly-update.mts", diff --git a/perf/npm/json-stable-stringify.perf.mts b/perf/npm/json-stable-stringify.perf.mts index 9f1737a68..aef79c3dd 100644 --- a/perf/npm/json-stable-stringify.perf.mts +++ b/perf/npm/json-stable-stringify.perf.mts @@ -7,7 +7,7 @@ import { getDefaultLogger } from '@socketsecurity/lib/logger/default' import fastJsonStableStringify from 'fast-json-stable-stringify' import { Bench } from 'tinybench' -import { PERF_NPM_FIXTURES_PATH } from '../../scripts/constants/paths.mts' +import { PERF_NPM_FIXTURES_PATH } from '../../scripts/repo/constants/paths.mts' const logger = getDefaultLogger() diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 7ca3dd08e..6c4f4a7a1 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -230,7 +230,7 @@ minimumReleaseAgeExclude: # (a scope glob would blanket-bypass any future @typescript publish). # Socket-owned scopes β€” bypass the soak window because they ship # through Socket's own provenance + publish pipeline. Canonical - # list: scripts/constants/socket-scopes.mts SOCKET_PACKAGE_PATTERNS. + # list: scripts/fleet/constants/socket-scopes.mts SOCKET_PACKAGE_PATTERNS. # Mirrored in `.config/taze.config.mts` (same scopes, same reason) # and consumed by scripts/repo/update-external-tools.mts via # isSocketSourcedPackage / isSocketSourcedRepository. diff --git a/scripts/repo/build.mts b/scripts/repo/build.mts index 8212e6401..0f5cbcdb8 100644 --- a/scripts/repo/build.mts +++ b/scripts/repo/build.mts @@ -11,7 +11,7 @@ import { isQuiet } from '@socketsecurity/lib-stable/argv/flag-predicates' import { getDefaultLogger } from '@socketsecurity/lib-stable/logger/default' import { runCommand } from '../fleet/util/run-command.mts' -import { REGISTRY_PKG_PATH } from '../constants/paths.mts' +import { REGISTRY_PKG_PATH } from './constants/paths.mts' const logger = getDefaultLogger() diff --git a/scripts/repo/check/floor-node-pin-matches-engines.mts b/scripts/repo/check/floor-node-pin-matches-engines.mts index 262e42bfc..e3c5cc7e8 100644 --- a/scripts/repo/check/floor-node-pin-matches-engines.mts +++ b/scripts/repo/check/floor-node-pin-matches-engines.mts @@ -22,7 +22,7 @@ import semver from 'semver' import { getDefaultLogger } from '@socketsecurity/lib-stable/logger/default' -import { FLOOR_NODE_VERSION } from '../../npm/floor-node-smoke.mts' +import { FLOOR_NODE_VERSION } from '../npm/floor-node-smoke.mts' const logger = getDefaultLogger() @@ -104,7 +104,7 @@ async function main(): Promise { `${findings.length} override(s) out of lock-step with the floor-node pin (${FLOOR_NODE_VERSION}):`, ...findings.map(f => ` ${f}`), 'Fix: move engines.node and FLOOR_NODE_VERSION together β€”', - ' scripts/npm/floor-node-smoke.mts (bump the pin + every sha256 from', + ' scripts/repo/npm/floor-node-smoke.mts (bump the pin + every sha256 from', ' https://nodejs.org/dist/v/SHASUMS256.txt), or correct the', ' drifted engines range.', ].join('\n'), diff --git a/scripts/ci/generate-actions-allow-list.mts b/scripts/repo/ci/generate-actions-allow-list.mts similarity index 100% rename from scripts/ci/generate-actions-allow-list.mts rename to scripts/repo/ci/generate-actions-allow-list.mts diff --git a/scripts/ci/inline-action-versions-as-shas.mts b/scripts/repo/ci/inline-action-versions-as-shas.mts similarity index 100% rename from scripts/ci/inline-action-versions-as-shas.mts rename to scripts/repo/ci/inline-action-versions-as-shas.mts diff --git a/scripts/ci/show-actions-tree.mts b/scripts/repo/ci/show-actions-tree.mts similarity index 99% rename from scripts/ci/show-actions-tree.mts rename to scripts/repo/ci/show-actions-tree.mts index 34637bc5b..a1fb2afd6 100644 --- a/scripts/ci/show-actions-tree.mts +++ b/scripts/repo/ci/show-actions-tree.mts @@ -7,7 +7,7 @@ import { promises as fs } from 'node:fs' import path from 'node:path' import process from 'node:process' import { getDefaultLogger } from '@socketsecurity/lib-stable/logger/default' -import { REPO_ROOT } from '../fleet/paths.mts' +import { REPO_ROOT } from '../../fleet/paths.mts' import { ROOT_DOT_GITHUB_ACTIONS_PATH, ROOT_DOT_GITHUB_WORKFLOWS_PATH, diff --git a/scripts/constants/core.mts b/scripts/repo/constants/core.mts similarity index 100% rename from scripts/constants/core.mts rename to scripts/repo/constants/core.mts diff --git a/scripts/constants/env.mts b/scripts/repo/constants/env.mts similarity index 100% rename from scripts/constants/env.mts rename to scripts/repo/constants/env.mts diff --git a/scripts/constants/node.mts b/scripts/repo/constants/node.mts similarity index 100% rename from scripts/constants/node.mts rename to scripts/repo/constants/node.mts diff --git a/scripts/constants/packages.mts b/scripts/repo/constants/packages.mts similarity index 100% rename from scripts/constants/packages.mts rename to scripts/repo/constants/packages.mts diff --git a/scripts/constants/paths.mts b/scripts/repo/constants/paths.mts similarity index 100% rename from scripts/constants/paths.mts rename to scripts/repo/constants/paths.mts diff --git a/scripts/constants/templates.mts b/scripts/repo/constants/templates.mts similarity index 100% rename from scripts/constants/templates.mts rename to scripts/repo/constants/templates.mts diff --git a/scripts/constants/testing.mts b/scripts/repo/constants/testing.mts similarity index 100% rename from scripts/constants/testing.mts rename to scripts/repo/constants/testing.mts diff --git a/scripts/constants/utils.mts b/scripts/repo/constants/utils.mts similarity index 100% rename from scripts/constants/utils.mts rename to scripts/repo/constants/utils.mts diff --git a/scripts/maintenance/taze.mts b/scripts/repo/maintenance/taze.mts similarity index 97% rename from scripts/maintenance/taze.mts rename to scripts/repo/maintenance/taze.mts index 2c69ed6b7..acc0c4a4f 100644 --- a/scripts/maintenance/taze.mts +++ b/scripts/repo/maintenance/taze.mts @@ -7,7 +7,7 @@ import { getDefaultLogger } from '@socketsecurity/lib-stable/logger/default' import { spawn } from '@socketsecurity/lib-stable/process/spawn/child' import process from 'node:process' -import { REPO_ROOT } from '../fleet/paths.mts' +import { REPO_ROOT } from '../../fleet/paths.mts' const logger = getDefaultLogger() diff --git a/scripts/maintenance/update-empty-dirs.mts b/scripts/repo/maintenance/update-empty-dirs.mts similarity index 100% rename from scripts/maintenance/update-empty-dirs.mts rename to scripts/repo/maintenance/update-empty-dirs.mts diff --git a/scripts/maintenance/update-empty-files.mts b/scripts/repo/maintenance/update-empty-files.mts similarity index 97% rename from scripts/maintenance/update-empty-files.mts rename to scripts/repo/maintenance/update-empty-files.mts index fcf21875f..6f694df72 100644 --- a/scripts/maintenance/update-empty-files.mts +++ b/scripts/repo/maintenance/update-empty-files.mts @@ -16,7 +16,7 @@ const logger = getDefaultLogger() import { NPM_TEMPLATES_PATH, ROOT_PATH } from '../constants/paths.mts' import { getIgnoreGlobs } from '../constants/utils.mts' -import { getModifiedFiles } from '../repo/util/git.mts' +import { getModifiedFiles } from '../util/git.mts' const { values: cliArgs } = parseArgs<{ force?: boolean | undefined diff --git a/scripts/maintenance/update-licenses.mts b/scripts/repo/maintenance/update-licenses.mts similarity index 94% rename from scripts/maintenance/update-licenses.mts rename to scripts/repo/maintenance/update-licenses.mts index c0a9ec364..444f9c0a6 100644 --- a/scripts/maintenance/update-licenses.mts +++ b/scripts/repo/maintenance/update-licenses.mts @@ -22,7 +22,7 @@ async function main(): Promise { const stream = globStreamLicenses(ROOT_PATH, { recursive: true, ignoreOriginals: true, - ignore: [LICENSE, 'scripts/templates', ...getIgnoreGlobs()], + ignore: [LICENSE, 'scripts/repo/templates', ...getIgnoreGlobs()], }) // Update each LICENSE file with the root LICENSE content. diff --git a/scripts/npm/check-trusted-packages-staged.mts b/scripts/repo/npm/check-trusted-packages-staged.mts similarity index 99% rename from scripts/npm/check-trusted-packages-staged.mts rename to scripts/repo/npm/check-trusted-packages-staged.mts index f64e04fa7..4e5b87d18 100644 --- a/scripts/npm/check-trusted-packages-staged.mts +++ b/scripts/repo/npm/check-trusted-packages-staged.mts @@ -34,7 +34,7 @@ import { } from '@socketsecurity/lib/npm/meta' import { NPM_PACKAGES_PATH } from '../constants/paths.mts' -import { REPO_ROOT } from '../fleet/paths.mts' +import { REPO_ROOT } from '../../fleet/paths.mts' import type { GetPackumentSlimOptions, @@ -300,7 +300,7 @@ export async function loadStagedRoster(options?: { `Where: ${REGISTRY_MANIFEST_PATH}`, `Saw: ${errorMessage(e)}`, 'Wanted: a readable manifest with an `npm` array of [purl, data] rows.', - 'Fix: regenerate it with `node scripts/npm/update-manifest.mts`, or restore the file from git.', + 'Fix: regenerate it with `node scripts/repo/npm/update-manifest.mts`, or restore the file from git.', ].join('\n'), ) } diff --git a/scripts/npm/check-trusted-packages.mts b/scripts/repo/npm/check-trusted-packages.mts similarity index 100% rename from scripts/npm/check-trusted-packages.mts rename to scripts/repo/npm/check-trusted-packages.mts diff --git a/scripts/npm/configure-staged-publishing-binding.mts b/scripts/repo/npm/configure-staged-publishing-binding.mts similarity index 100% rename from scripts/npm/configure-staged-publishing-binding.mts rename to scripts/repo/npm/configure-staged-publishing-binding.mts diff --git a/scripts/npm/configure-staged-publishing-browser.mts b/scripts/repo/npm/configure-staged-publishing-browser.mts similarity index 98% rename from scripts/npm/configure-staged-publishing-browser.mts rename to scripts/repo/npm/configure-staged-publishing-browser.mts index 2cb3df407..0c834914c 100644 --- a/scripts/npm/configure-staged-publishing-browser.mts +++ b/scripts/repo/npm/configure-staged-publishing-browser.mts @@ -52,12 +52,12 @@ import { DEFAULT_PROFILE_DIR, openNpmBrowserSession, optIntoChallengeCooldown, -} from '../fleet/publish-infra/npm/browser-session.mts' +} from '../../fleet/publish-infra/npm/browser-session.mts' export { DEFAULT_PROFILE_DIR } -import { CHALLENGE_PROGRESS_INTERVAL_MS } from '../fleet/publish-infra/npm/challenge-gate.mts' +import { CHALLENGE_PROGRESS_INTERVAL_MS } from '../../fleet/publish-infra/npm/challenge-gate.mts' -import type { TrustedPublisherDesired } from '../fleet/publish-infra/npm/trusted-publisher-plan.mts' +import type { TrustedPublisherDesired } from '../../fleet/publish-infra/npm/trusted-publisher-plan.mts' import { classifyAccessPageReadiness, formatBindingWriteFailure, diff --git a/scripts/npm/configure-staged-publishing-controls-report.mts b/scripts/repo/npm/configure-staged-publishing-controls-report.mts similarity index 95% rename from scripts/npm/configure-staged-publishing-controls-report.mts rename to scripts/repo/npm/configure-staged-publishing-controls-report.mts index 7ed6cf762..f23e1c509 100644 --- a/scripts/npm/configure-staged-publishing-controls-report.mts +++ b/scripts/repo/npm/configure-staged-publishing-controls-report.mts @@ -99,6 +99,6 @@ export function formatUnresolvedActionControl(config: { `Where: ${cfg.url}`, `Saw: ${cfg.reason}.${inventory}`, `Wanted: a checkbox, radio pair, select, or role="switch" control this run can set "${cfg.request.name}" to ${cfg.request.checked} with.`, - `Fix: run \`pnpm run npm:configure-staged --dump-form ${cfg.packageName}\` in the signed-in Chrome window to print the form's redacted DOM, then add the shape it reports to the ladder in scripts/npm/configure-staged-publishing-controls.mts. Do not hand-edit the hidden input's value β€” a state no rendered control offers is a state npm may refuse while the run reports success.`, + `Fix: run \`pnpm run npm:configure-staged --dump-form ${cfg.packageName}\` in the signed-in Chrome window to print the form's redacted DOM, then add the shape it reports to the ladder in scripts/repo/npm/configure-staged-publishing-controls.mts. Do not hand-edit the hidden input's value β€” a state no rendered control offers is a state npm may refuse while the run reports success.`, ].join('\n') } diff --git a/scripts/npm/configure-staged-publishing-controls.mts b/scripts/repo/npm/configure-staged-publishing-controls.mts similarity index 100% rename from scripts/npm/configure-staged-publishing-controls.mts rename to scripts/repo/npm/configure-staged-publishing-controls.mts diff --git a/scripts/npm/configure-staged-publishing-dump.mts b/scripts/repo/npm/configure-staged-publishing-dump.mts similarity index 100% rename from scripts/npm/configure-staged-publishing-dump.mts rename to scripts/repo/npm/configure-staged-publishing-dump.mts diff --git a/scripts/npm/configure-staged-publishing-form-dom.mts b/scripts/repo/npm/configure-staged-publishing-form-dom.mts similarity index 100% rename from scripts/npm/configure-staged-publishing-form-dom.mts rename to scripts/repo/npm/configure-staged-publishing-form-dom.mts diff --git a/scripts/npm/configure-staged-publishing-form-dump.mts b/scripts/repo/npm/configure-staged-publishing-form-dump.mts similarity index 98% rename from scripts/npm/configure-staged-publishing-form-dump.mts rename to scripts/repo/npm/configure-staged-publishing-form-dump.mts index dddad743b..0faafc059 100644 --- a/scripts/npm/configure-staged-publishing-form-dump.mts +++ b/scripts/repo/npm/configure-staged-publishing-form-dump.mts @@ -24,7 +24,7 @@ import { getDefaultLogger } from '@socketsecurity/lib-stable/logger/default' import type { Page } from 'playwright-core' -import { ensureFormOpen } from '../fleet/publish-infra/npm/trusted-publisher-page.mts' +import { ensureFormOpen } from '../../fleet/publish-infra/npm/trusted-publisher-page.mts' import { openNpmSettingsSession, diff --git a/scripts/npm/configure-staged-publishing-form-probe.mts b/scripts/repo/npm/configure-staged-publishing-form-probe.mts similarity index 100% rename from scripts/npm/configure-staged-publishing-form-probe.mts rename to scripts/repo/npm/configure-staged-publishing-form-probe.mts diff --git a/scripts/npm/configure-staged-publishing-markers.mts b/scripts/repo/npm/configure-staged-publishing-markers.mts similarity index 100% rename from scripts/npm/configure-staged-publishing-markers.mts rename to scripts/repo/npm/configure-staged-publishing-markers.mts diff --git a/scripts/npm/configure-staged-publishing-operator.mts b/scripts/repo/npm/configure-staged-publishing-operator.mts similarity index 98% rename from scripts/npm/configure-staged-publishing-operator.mts rename to scripts/repo/npm/configure-staged-publishing-operator.mts index 3b2097c68..c065406a6 100644 --- a/scripts/npm/configure-staged-publishing-operator.mts +++ b/scripts/repo/npm/configure-staged-publishing-operator.mts @@ -27,8 +27,8 @@ import { sleep } from '@socketsecurity/lib-stable/promises/timers' import type { Page } from 'playwright-core' -import { optIntoChallengeCooldown } from '../fleet/publish-infra/npm/browser-session.mts' -import { tickChallengeGate } from '../fleet/publish-infra/npm/challenge-gate.mts' +import { optIntoChallengeCooldown } from '../../fleet/publish-infra/npm/browser-session.mts' +import { tickChallengeGate } from '../../fleet/publish-infra/npm/challenge-gate.mts' import { buildOperatorOverlayInjectionScript, buildOperatorOverlayRemovalScript, diff --git a/scripts/npm/configure-staged-publishing-overlay.mts b/scripts/repo/npm/configure-staged-publishing-overlay.mts similarity index 100% rename from scripts/npm/configure-staged-publishing-overlay.mts rename to scripts/repo/npm/configure-staged-publishing-overlay.mts diff --git a/scripts/npm/configure-staged-publishing-payload.mts b/scripts/repo/npm/configure-staged-publishing-payload.mts similarity index 99% rename from scripts/npm/configure-staged-publishing-payload.mts rename to scripts/repo/npm/configure-staged-publishing-payload.mts index 70c662354..85e382a24 100644 --- a/scripts/npm/configure-staged-publishing-payload.mts +++ b/scripts/repo/npm/configure-staged-publishing-payload.mts @@ -20,7 +20,7 @@ * shape" back into "enter your authenticator code". */ -import { OIDC_PERMISSION_ACTIONS } from '../fleet/publish-infra/npm/access-context-schema.mts' +import { OIDC_PERMISSION_ACTIONS } from '../../fleet/publish-infra/npm/access-context-schema.mts' /** * The action token npm uses for a staged publish in the trusted publisher's diff --git a/scripts/npm/configure-staged-publishing-plan.mts b/scripts/repo/npm/configure-staged-publishing-plan.mts similarity index 98% rename from scripts/npm/configure-staged-publishing-plan.mts rename to scripts/repo/npm/configure-staged-publishing-plan.mts index 818ce9702..612282ad7 100644 --- a/scripts/npm/configure-staged-publishing-plan.mts +++ b/scripts/repo/npm/configure-staged-publishing-plan.mts @@ -23,7 +23,7 @@ import { classifyStagedFetch, isCloudflareChallenge, looksLikeHtmlBody, -} from '../fleet/publish-infra/npm/staged-browser-parse.mts' +} from '../../fleet/publish-infra/npm/staged-browser-parse.mts' import { bindingMatchesTarget, decideStagedConfigurationState, @@ -82,7 +82,7 @@ import { WAIT_FOR_OPERATOR_MS, } from './configure-staged-publishing-session.mts' -import type { StagedFetchState } from '../fleet/publish-infra/npm/staged-browser-parse.mts' +import type { StagedFetchState } from '../../fleet/publish-infra/npm/staged-browser-parse.mts' import type { StagedTrustReport } from './check-trusted-packages-staged.mts' import type { StagedConfigurationState } from './configure-staged-publishing-binding.mts' import type { diff --git a/scripts/npm/configure-staged-publishing-redaction.mts b/scripts/repo/npm/configure-staged-publishing-redaction.mts similarity index 100% rename from scripts/npm/configure-staged-publishing-redaction.mts rename to scripts/repo/npm/configure-staged-publishing-redaction.mts diff --git a/scripts/npm/configure-staged-publishing-session.mts b/scripts/repo/npm/configure-staged-publishing-session.mts similarity index 99% rename from scripts/npm/configure-staged-publishing-session.mts rename to scripts/repo/npm/configure-staged-publishing-session.mts index 7f2f18d42..e8c665299 100644 --- a/scripts/npm/configure-staged-publishing-session.mts +++ b/scripts/repo/npm/configure-staged-publishing-session.mts @@ -50,7 +50,7 @@ import { MILLISECONDS_PER_SECOND, } from '@socketsecurity/lib-stable/constants/time' -import { classifyStagedFetch } from '../fleet/publish-infra/npm/staged-browser-parse.mts' +import { classifyStagedFetch } from '../../fleet/publish-infra/npm/staged-browser-parse.mts' import { hasHumanVerificationMarkers, hasSettingsPayloadMarkers, diff --git a/scripts/npm/configure-staged-publishing-write.mts b/scripts/repo/npm/configure-staged-publishing-write.mts similarity index 98% rename from scripts/npm/configure-staged-publishing-write.mts rename to scripts/repo/npm/configure-staged-publishing-write.mts index 957861062..19e4f1a2e 100644 --- a/scripts/npm/configure-staged-publishing-write.mts +++ b/scripts/repo/npm/configure-staged-publishing-write.mts @@ -28,9 +28,9 @@ import { sleep } from '@socketsecurity/lib-stable/promises/timers' import type { Page } from 'playwright-core' -import { ensureFormOpen } from '../fleet/publish-infra/npm/trusted-publisher-page.mts' +import { ensureFormOpen } from '../../fleet/publish-infra/npm/trusted-publisher-page.mts' -import type { TrustedPublisherDesired } from '../fleet/publish-infra/npm/trusted-publisher-plan.mts' +import type { TrustedPublisherDesired } from '../../fleet/publish-infra/npm/trusted-publisher-plan.mts' import { formatUnresolvedActionControl } from './configure-staged-publishing-controls-report.mts' import { collectActionControlCandidates, @@ -167,7 +167,7 @@ export async function setPublisherActionControl( `Where: ${cfg.url}`, `Saw: the ${plan.via}-matched role toggle still reports aria-checked=${JSON.stringify(after ?? '')} after the click.`, `Wanted: aria-checked to report ${cfg.checked}.`, - 'Fix: open the page and click that control by hand to see what it does. If it needs a keypress or a nested element clicked, add that shape to the ladder in scripts/npm/configure-staged-publishing-controls.mts.', + 'Fix: open the page and click that control by hand to see what it does. If it needs a keypress or a nested element clicked, add that shape to the ladder in scripts/repo/npm/configure-staged-publishing-controls.mts.', ].join('\n'), ) } diff --git a/scripts/npm/configure-staged-publishing.mts b/scripts/repo/npm/configure-staged-publishing.mts similarity index 99% rename from scripts/npm/configure-staged-publishing.mts rename to scripts/repo/npm/configure-staged-publishing.mts index da0d890d9..f4c429dd8 100644 --- a/scripts/npm/configure-staged-publishing.mts +++ b/scripts/repo/npm/configure-staged-publishing.mts @@ -247,7 +247,7 @@ export async function dumpAccessPayload( function printHelp(): void { logger.log('') logger.log( - 'Usage: node scripts/npm/configure-staged-publishing.mts [options]', + 'Usage: node scripts/repo/npm/configure-staged-publishing.mts [options]', ) logger.log('') logger.log( diff --git a/scripts/npm/floor-node-smoke.mts b/scripts/repo/npm/floor-node-smoke.mts similarity index 99% rename from scripts/npm/floor-node-smoke.mts rename to scripts/repo/npm/floor-node-smoke.mts index f703367de..5bb3d11d7 100644 --- a/scripts/npm/floor-node-smoke.mts +++ b/scripts/repo/npm/floor-node-smoke.mts @@ -11,7 +11,7 @@ * The floor binary is a side install: it never touches PATH β€” the harness * keeps running on the repo's own Node and spawns the floor binary * explicitly, so the two runtimes can't be confused. - * Usage: node scripts/npm/floor-node-smoke.mts + * Usage: node scripts/repo/npm/floor-node-smoke.mts * Env: FLOOR_NODE_DIR overrides the install dir (default: RUNNER_TEMP, * falling back to os.tmpdir()). */ @@ -61,7 +61,7 @@ const FLOOR_NODE_PLATFORMS: Record = const repoRoot = path.resolve( path.dirname(fileURLToPath(import.meta.url)), - '../..', + '../../..', ) const npmPackagesPath = path.join(repoRoot, 'packages/npm') diff --git a/scripts/npm/make-npm-override-helpers.mts b/scripts/repo/npm/make-npm-override-helpers.mts similarity index 100% rename from scripts/npm/make-npm-override-helpers.mts rename to scripts/repo/npm/make-npm-override-helpers.mts diff --git a/scripts/npm/make-npm-override.mts b/scripts/repo/npm/make-npm-override.mts similarity index 99% rename from scripts/npm/make-npm-override.mts rename to scripts/repo/npm/make-npm-override.mts index 29baad92a..fa578f93b 100644 --- a/scripts/npm/make-npm-override.mts +++ b/scripts/repo/npm/make-npm-override.mts @@ -1,4 +1,4 @@ -/** +/* * @file Creates Socket registry package overrides for npm packages. Interactive * CLI tool that guides users through creating secure package overrides: * @@ -66,7 +66,7 @@ import { getTemplate, getTypeScriptActions, writeAction, -} from '../repo/util/templates.mts' +} from '../util/templates.mts' import { esShimChoices, getCompatData, @@ -460,12 +460,12 @@ async function main(): Promise { } as const await spawn( process.execPath, - ['scripts/npm/update-manifest.mts'], + ['scripts/repo/npm/update-manifest.mts'], spawnOptions, ) await spawn( process.execPath, - ['scripts/npm/update-npm-package-json.mts'], + ['scripts/repo/npm/update-npm-package-json.mts'], spawnOptions, ) if (!cliArgs['quiet']) { diff --git a/scripts/npm/publish-npm-packages-args.mts b/scripts/repo/npm/publish-npm-packages-args.mts similarity index 100% rename from scripts/npm/publish-npm-packages-args.mts rename to scripts/repo/npm/publish-npm-packages-args.mts diff --git a/scripts/npm/publish-npm-packages-commit.mts b/scripts/repo/npm/publish-npm-packages-commit.mts similarity index 98% rename from scripts/npm/publish-npm-packages-commit.mts rename to scripts/repo/npm/publish-npm-packages-commit.mts index 8830ed7e0..49bb0f3fa 100644 --- a/scripts/npm/publish-npm-packages-commit.mts +++ b/scripts/repo/npm/publish-npm-packages-commit.mts @@ -37,7 +37,7 @@ import { } from './publish-npm-packages-needs.mts' import { publishPackages } from './publish-npm-packages-publish.mts' -import type { NpmManifest } from '../repo/util/manifest-types.mts' +import type { NpmManifest } from '../util/manifest-types.mts' const logger = getDefaultLogger() @@ -257,7 +257,7 @@ export async function publishAtCommit( '[dry-run] Skipping the manifest.json refresh and its commit; the worktree stays untouched.', ) } else { - await spawn('node', ['scripts/npm/update-manifest.mts', '--force'], { + await spawn('node', ['scripts/repo/npm/update-manifest.mts', '--force'], { shell: WIN32, }) } diff --git a/scripts/npm/publish-npm-packages-dispatch.mts b/scripts/repo/npm/publish-npm-packages-dispatch.mts similarity index 98% rename from scripts/npm/publish-npm-packages-dispatch.mts rename to scripts/repo/npm/publish-npm-packages-dispatch.mts index 345a74a7e..1e9403871 100644 --- a/scripts/npm/publish-npm-packages-dispatch.mts +++ b/scripts/repo/npm/publish-npm-packages-dispatch.mts @@ -14,7 +14,7 @@ import { getDefaultLogger } from '@socketsecurity/lib-stable/logger/default' import { spawn } from '@socketsecurity/lib-stable/process/spawn/child' import { ROOT_PATH } from '../constants/paths.mts' -import { runInherit } from '../fleet/publish-shared.mts' +import { runInherit } from '../../fleet/publish-shared.mts' const logger = getDefaultLogger() diff --git a/scripts/npm/publish-npm-packages-failures.mts b/scripts/repo/npm/publish-npm-packages-failures.mts similarity index 100% rename from scripts/npm/publish-npm-packages-failures.mts rename to scripts/repo/npm/publish-npm-packages-failures.mts diff --git a/scripts/npm/publish-npm-packages-git.mts b/scripts/repo/npm/publish-npm-packages-git.mts similarity index 100% rename from scripts/npm/publish-npm-packages-git.mts rename to scripts/repo/npm/publish-npm-packages-git.mts diff --git a/scripts/npm/publish-npm-packages-needs.mts b/scripts/repo/npm/publish-npm-packages-needs.mts similarity index 100% rename from scripts/npm/publish-npm-packages-needs.mts rename to scripts/repo/npm/publish-npm-packages-needs.mts diff --git a/scripts/npm/publish-npm-packages-publish.mts b/scripts/repo/npm/publish-npm-packages-publish.mts similarity index 97% rename from scripts/npm/publish-npm-packages-publish.mts rename to scripts/repo/npm/publish-npm-packages-publish.mts index a0380bc17..11377b4f6 100644 --- a/scripts/npm/publish-npm-packages-publish.mts +++ b/scripts/repo/npm/publish-npm-packages-publish.mts @@ -35,11 +35,11 @@ import { recordPublishFailure, } from './publish-npm-packages-failures.mts' import type { PublishState } from './publish-npm-packages-failures.mts' -import { extractNpmError } from '../repo/util/errors.mts' -import { uploadNpmPackage } from '../fleet/publish-infra/npm/publish-command.mts' -import { listStagedPackages } from '../fleet/publish-infra/npm/shared.mts' -import type { StageListEntry } from '../fleet/publish-infra/npm/shared.mts' -import { isAlreadyPublished, runInherit } from '../fleet/publish-shared.mts' +import { extractNpmError } from '../util/errors.mts' +import { uploadNpmPackage } from '../../fleet/publish-infra/npm/publish-command.mts' +import { listStagedPackages } from '../../fleet/publish-infra/npm/shared.mts' +import type { StageListEntry } from '../../fleet/publish-infra/npm/shared.mts' +import { isAlreadyPublished, runInherit } from '../../fleet/publish-shared.mts' const logger = getDefaultLogger() diff --git a/scripts/npm/publish-npm-packages-stage.mts b/scripts/repo/npm/publish-npm-packages-stage.mts similarity index 99% rename from scripts/npm/publish-npm-packages-stage.mts rename to scripts/repo/npm/publish-npm-packages-stage.mts index dc184ceae..5c12249f3 100644 --- a/scripts/npm/publish-npm-packages-stage.mts +++ b/scripts/repo/npm/publish-npm-packages-stage.mts @@ -36,7 +36,7 @@ import { getCurrentBranch, } from './publish-npm-packages-git.mts' -import type { NpmManifest } from '../repo/util/manifest-types.mts' +import type { NpmManifest } from '../util/manifest-types.mts' const logger = getDefaultLogger() diff --git a/scripts/npm/publish-npm-packages.mts b/scripts/repo/npm/publish-npm-packages.mts similarity index 95% rename from scripts/npm/publish-npm-packages.mts rename to scripts/repo/npm/publish-npm-packages.mts index 385eab549..9fc95562f 100644 --- a/scripts/npm/publish-npm-packages.mts +++ b/scripts/repo/npm/publish-npm-packages.mts @@ -1,4 +1,4 @@ -/** +/* * @file Publish the socket-registry FAMILY β€” the `@socketregistry/*` override * packages plus the registry package itself. Three lanes, picked by where the * run is and what it was asked for: @@ -18,9 +18,9 @@ import { getDefaultLogger } from '@socketsecurity/lib-stable/logger/default' import { getEnv } from '../constants/env.mts' -import { isMainModule } from '../fleet/_shared/is-main-module.mts' -import { runMain } from '../fleet/_shared/run-main.mts' -import type { ScriptMeta } from '../fleet/_shared/run-main.mts' +import { isMainModule } from '../../fleet/_shared/is-main-module.mts' +import { runMain } from '../../fleet/_shared/run-main.mts' +import type { ScriptMeta } from '../../fleet/_shared/run-main.mts' import { approveFlag, cliArgs, @@ -130,7 +130,7 @@ export async function main(): Promise { const SCRIPT_META: ScriptMeta = { describe: 'publishes the socket-registry package family β€” CI stages, local dispatches the workflow or promotes what is staged', - help: `Usage: node scripts/npm/publish-npm-packages.mts [options] + help: `Usage: node scripts/repo/npm/publish-npm-packages.mts [options] Outside CI this DISPATCHES .github/workflows/npm-publish-packages.yml and watches the run; it never uploads. Inside CI it stages every needs-publish diff --git a/scripts/npm/release-npm-packages-hashes.mts b/scripts/repo/npm/release-npm-packages-hashes.mts similarity index 100% rename from scripts/npm/release-npm-packages-hashes.mts rename to scripts/repo/npm/release-npm-packages-hashes.mts diff --git a/scripts/npm/release-npm-packages-report.mts b/scripts/repo/npm/release-npm-packages-report.mts similarity index 93% rename from scripts/npm/release-npm-packages-report.mts rename to scripts/repo/npm/release-npm-packages-report.mts index b0dba73fe..219f1b716 100644 --- a/scripts/npm/release-npm-packages-report.mts +++ b/scripts/repo/npm/release-npm-packages-report.mts @@ -10,7 +10,7 @@ import { getDefaultLogger } from '@socketsecurity/lib-stable/logger/default' -import { logSectionHeader } from '../repo/util/logging.mts' +import { logSectionHeader } from '../util/logging.mts' import type { BumpState } from './release-npm-packages.mts' @@ -65,7 +65,7 @@ export function reportReleaseState( if (state.unresolved.length) { logger.fail( `npm resolved no manifest for ${state.unresolved.length} ${state.unresolved.length === 1 ? 'package' : 'packages'}.\n` + - ` Where: scripts/npm/release-npm-packages.mts, the per-package manifest lookup.\n` + + ` Where: scripts/repo/npm/release-npm-packages.mts, the per-package manifest lookup.\n` + ` Saw vs wanted: ${state.unresolved.map(pkg => `${pkg.name}@${pkg.tag}`).join(', ')} resolved to nothing; wanted a manifest for every package, so the run can say whether it needs publishing.\n` + ` Fix: confirm the names exist with \`npm view \`, and confirm the dist-tag resolves. A never-claimed name has to be reserved before a release can stage it.`, ) @@ -76,7 +76,7 @@ export function reportReleaseState( if (release) { logger.fail( `Nothing can be staged, but a release was requested.\n` + - ` Where: scripts/npm/release-npm-packages.mts --release.\n` + + ` Where: scripts/repo/npm/release-npm-packages.mts --release.\n` + ` Saw vs wanted: 0 packages changed and 0 sit at the npm 0.0.0 placeholder; wanted at least one publishable package.\n` + ` Fix: land the change you meant to release, then re-run. Drop --release to use this as a read-only check.`, ) diff --git a/scripts/npm/release-npm-packages.mts b/scripts/repo/npm/release-npm-packages.mts similarity index 96% rename from scripts/npm/release-npm-packages.mts rename to scripts/repo/npm/release-npm-packages.mts index 6d6b71863..e4be046f7 100644 --- a/scripts/npm/release-npm-packages.mts +++ b/scripts/repo/npm/release-npm-packages.mts @@ -31,9 +31,9 @@ import { SOCKET_REGISTRY_SCOPE, } from '../constants/paths.mts' import { getNpmPackageNames } from '../constants/testing.mts' -import { isMainModule } from '../fleet/_shared/is-main-module.mts' -import { runMain } from '../fleet/_shared/run-main.mts' -import type { ScriptMeta } from '../fleet/_shared/run-main.mts' +import { isMainModule } from '../../fleet/_shared/is-main-module.mts' +import { runMain } from '../../fleet/_shared/run-main.mts' +import type { ScriptMeta } from '../../fleet/_shared/run-main.mts' import { getLocalPackageFileHashes, getRemotePackageFileHashes, @@ -44,7 +44,7 @@ import { } from './publish-npm-packages-needs.mts' import { reportReleaseState } from './release-npm-packages-report.mts' import { fetchPackageManifest } from '@socketsecurity/lib-stable/packages/manifest' -import type { NpmManifest as PackageManifest } from '../repo/util/manifest-types.mts' +import type { NpmManifest as PackageManifest } from '../util/manifest-types.mts' export interface PackageDataInput { manifest?: PackageManifest | undefined @@ -393,8 +393,8 @@ async function main(): Promise { const spawnOptions = { cwd: ROOT_PATH, stdio: 'inherit' as const } const update = (args: string[]) => spawn(process.execPath, args, spawnOptions) - await update(['scripts/npm/update-npm-package-json.mts']) - await update(['scripts/npm/update-manifest.mts', '--force']) + await update(['scripts/repo/npm/update-npm-package-json.mts']) + await update(['scripts/repo/npm/update-manifest.mts', '--force']) }, spinner: getCachedDefaultSpinner(), }) @@ -405,7 +405,7 @@ async function main(): Promise { const SCRIPT_META: ScriptMeta = { describe: 'reports which socket-registry packages need publishing and bumps the ones whose shipped bytes changed', - help: `Usage: node scripts/npm/release-npm-packages.mts [options] + help: `Usage: node scripts/repo/npm/release-npm-packages.mts [options] Compares each package's shipped bytes against what npm has, bumps the ones that changed, and lists the ones npm still holds at the 0.0.0 placeholder. diff --git a/scripts/npm/run-vitest-npm.mts b/scripts/repo/npm/run-vitest-npm.mts similarity index 100% rename from scripts/npm/run-vitest-npm.mts rename to scripts/repo/npm/run-vitest-npm.mts diff --git a/scripts/npm/set-npm-package-access.mts b/scripts/repo/npm/set-npm-package-access.mts similarity index 98% rename from scripts/npm/set-npm-package-access.mts rename to scripts/repo/npm/set-npm-package-access.mts index a7be34959..3d0041661 100644 --- a/scripts/npm/set-npm-package-access.mts +++ b/scripts/repo/npm/set-npm-package-access.mts @@ -13,7 +13,7 @@ import { pluralize } from '@socketsecurity/lib-stable/words/pluralize' import { COLUMN_LIMIT } from '../constants/core.mts' import { getEnv } from '../constants/env.mts' import { getNpmPackageNames } from '../constants/testing.mts' -import { extractNpmError } from '../repo/util/errors.mts' +import { extractNpmError } from '../util/errors.mts' import { NPM_PACKAGES_PATH, REGISTRY_PKG_PATH, diff --git a/scripts/npm/survey-override-deps.mts b/scripts/repo/npm/survey-override-deps.mts similarity index 98% rename from scripts/npm/survey-override-deps.mts rename to scripts/repo/npm/survey-override-deps.mts index 301c8703b..6e600917d 100644 --- a/scripts/npm/survey-override-deps.mts +++ b/scripts/repo/npm/survey-override-deps.mts @@ -1,4 +1,4 @@ -/** +/* * @file Surveys packages/npm overrides for dependency-reduction opportunities. * socket-registry ships ~131 overrides that REPLACE upstream npm packages * (many from the es-shims / ljharb micro-dependency web) with lighter, @@ -14,7 +14,7 @@ * and install size from the registry, or --transitive to walk the full * upstream dependency tree (memoized BFS). Writes a ranked Markdown + JSON * report to .claude/reports/ (gitignored). Run: node - * scripts/npm/survey-override-deps.mts [--upstream] [--transitive] + * scripts/repo/npm/survey-override-deps.mts [--upstream] [--transitive] * [--target ] [--top ] [--offline] */ @@ -32,7 +32,7 @@ import { UTF8 } from '@socketsecurity/lib-stable/constants/encoding' import { DEFAULT_CONCURRENCY } from '../constants/core.mts' import { getNpmPackageNames } from '../constants/testing.mts' import { NPM_PACKAGES_PATH, ROOT_PATH } from '../constants/paths.mts' -import { getPackageVersionSpec } from '../repo/util/packages.mts' +import { getPackageVersionSpec } from '../util/packages.mts' const logger = getDefaultLogger() diff --git a/scripts/npm/update-manifest.mts b/scripts/repo/npm/update-manifest.mts similarity index 98% rename from scripts/npm/update-manifest.mts rename to scripts/repo/npm/update-manifest.mts index 359057840..de5a5bd4f 100644 --- a/scripts/npm/update-manifest.mts +++ b/scripts/repo/npm/update-manifest.mts @@ -19,8 +19,8 @@ import { withSpinner } from '@socketsecurity/lib-stable/spinner/with' import { spawn } from '@socketsecurity/lib-stable/process/spawn/child' import { DEFAULT_CONCURRENCY } from '../constants/core.mts' import { getNpmPackageNames } from '../constants/testing.mts' -import { isMainModule } from '../fleet/_shared/is-main-module.mts' -import { getModifiedFiles } from '../repo/util/git.mts' +import { isMainModule } from '../../fleet/_shared/is-main-module.mts' +import { getModifiedFiles } from '../util/git.mts' import { fetchPackageManifest } from '@socketsecurity/lib-stable/packages/manifest' import { resolveOriginalPackageName } from '@socketsecurity/lib-stable/packages/normalize' import { resolvePackageJsonEntryExports } from '@socketsecurity/lib-stable/packages/exports' @@ -36,10 +36,7 @@ import { ROOT_PATH, TEST_NPM_PATH, } from '../constants/paths.mts' -import { - getPackageVersionSpec, - shouldSkipTests, -} from '../repo/util/packages.mts' +import { getPackageVersionSpec, shouldSkipTests } from '../util/packages.mts' import { AT_LATEST, getPackageDefaultNodeRange, diff --git a/scripts/npm/update-npm-package-json.mts b/scripts/repo/npm/update-npm-package-json.mts similarity index 100% rename from scripts/npm/update-npm-package-json.mts rename to scripts/repo/npm/update-npm-package-json.mts diff --git a/scripts/npm/update-npm-readmes.mts b/scripts/repo/npm/update-npm-readmes.mts similarity index 93% rename from scripts/npm/update-npm-readmes.mts rename to scripts/repo/npm/update-npm-readmes.mts index 5d308fcf2..d25794c8c 100644 --- a/scripts/npm/update-npm-readmes.mts +++ b/scripts/repo/npm/update-npm-readmes.mts @@ -17,8 +17,8 @@ import { README_MD, } from '../constants/paths.mts' import { getNpmPackageNames } from '../constants/testing.mts' -import { isModified } from '../repo/util/git.mts' -import { getNpmReadmeAction } from '../repo/util/templates.mts' +import { isModified } from '../util/git.mts' +import { getNpmReadmeAction } from '../util/templates.mts' const { values: cliArgs } = parseArgs({ options: { diff --git a/scripts/npm/update-package-json.mts b/scripts/repo/npm/update-package-json.mts similarity index 100% rename from scripts/npm/update-package-json.mts rename to scripts/repo/npm/update-package-json.mts diff --git a/scripts/npm/wire-npm-port.mts b/scripts/repo/npm/wire-npm-port.mts similarity index 99% rename from scripts/npm/wire-npm-port.mts rename to scripts/repo/npm/wire-npm-port.mts index 33c477749..39eef053e 100644 --- a/scripts/npm/wire-npm-port.mts +++ b/scripts/repo/npm/wire-npm-port.mts @@ -453,7 +453,7 @@ async function main(): Promise { 'What: nothing to wire.', 'Where: wire-npm-port.mts argv.', 'Saw: no package names; wanted one or more packages/npm/ names.', - 'Fix: node scripts/npm/wire-npm-port.mts [--upstream ] [--tag ] [--upstream-path ] [--dry-run].', + 'Fix: node scripts/repo/npm/wire-npm-port.mts [--upstream ] [--tag ] [--upstream-path ] [--dry-run].', ].join('\n'), ) } diff --git a/scripts/repo/perf.mts b/scripts/repo/perf.mts index df02239c8..0b48a6763 100644 --- a/scripts/repo/perf.mts +++ b/scripts/repo/perf.mts @@ -13,7 +13,7 @@ import fastGlob from 'fast-glob' const logger = getDefaultLogger() -import { PERF_NPM_PATH } from '../constants/paths.mts' +import { PERF_NPM_PATH } from './constants/paths.mts' async function main(): Promise { for (const perfFile of await fastGlob.glob(['*.perf.mts'], { diff --git a/scripts/templates/npm/README.md b/scripts/repo/templates/npm/README.md similarity index 100% rename from scripts/templates/npm/README.md rename to scripts/repo/templates/npm/README.md diff --git a/scripts/templates/npm/cjs-browser/LICENSE b/scripts/repo/templates/npm/cjs-browser/LICENSE similarity index 100% rename from scripts/templates/npm/cjs-browser/LICENSE rename to scripts/repo/templates/npm/cjs-browser/LICENSE diff --git a/scripts/templates/npm/cjs-browser/README.md b/scripts/repo/templates/npm/cjs-browser/README.md similarity index 100% rename from scripts/templates/npm/cjs-browser/README.md rename to scripts/repo/templates/npm/cjs-browser/README.md diff --git a/scripts/templates/npm/cjs-browser/index.cjs b/scripts/repo/templates/npm/cjs-browser/index.cjs similarity index 100% rename from scripts/templates/npm/cjs-browser/index.cjs rename to scripts/repo/templates/npm/cjs-browser/index.cjs diff --git a/scripts/templates/npm/cjs-browser/index.d.cts b/scripts/repo/templates/npm/cjs-browser/index.d.cts similarity index 100% rename from scripts/templates/npm/cjs-browser/index.d.cts rename to scripts/repo/templates/npm/cjs-browser/index.d.cts diff --git a/scripts/templates/npm/cjs-browser/index.d.ts b/scripts/repo/templates/npm/cjs-browser/index.d.ts similarity index 100% rename from scripts/templates/npm/cjs-browser/index.d.ts rename to scripts/repo/templates/npm/cjs-browser/index.d.ts diff --git a/scripts/templates/npm/cjs-browser/index.js b/scripts/repo/templates/npm/cjs-browser/index.js similarity index 100% rename from scripts/templates/npm/cjs-browser/index.js rename to scripts/repo/templates/npm/cjs-browser/index.js diff --git a/scripts/templates/npm/cjs-browser/package.json b/scripts/repo/templates/npm/cjs-browser/package.json similarity index 100% rename from scripts/templates/npm/cjs-browser/package.json rename to scripts/repo/templates/npm/cjs-browser/package.json diff --git a/scripts/templates/npm/cjs-esm/LICENSE b/scripts/repo/templates/npm/cjs-esm/LICENSE similarity index 100% rename from scripts/templates/npm/cjs-esm/LICENSE rename to scripts/repo/templates/npm/cjs-esm/LICENSE diff --git a/scripts/templates/npm/cjs-esm/README.md b/scripts/repo/templates/npm/cjs-esm/README.md similarity index 100% rename from scripts/templates/npm/cjs-esm/README.md rename to scripts/repo/templates/npm/cjs-esm/README.md diff --git a/scripts/templates/npm/cjs-esm/index.cjs b/scripts/repo/templates/npm/cjs-esm/index.cjs similarity index 100% rename from scripts/templates/npm/cjs-esm/index.cjs rename to scripts/repo/templates/npm/cjs-esm/index.cjs diff --git a/scripts/templates/npm/cjs-esm/index.d.cts b/scripts/repo/templates/npm/cjs-esm/index.d.cts similarity index 100% rename from scripts/templates/npm/cjs-esm/index.d.cts rename to scripts/repo/templates/npm/cjs-esm/index.d.cts diff --git a/scripts/templates/npm/cjs-esm/index.d.mts b/scripts/repo/templates/npm/cjs-esm/index.d.mts similarity index 100% rename from scripts/templates/npm/cjs-esm/index.d.mts rename to scripts/repo/templates/npm/cjs-esm/index.d.mts diff --git a/scripts/templates/npm/cjs-esm/index.js b/scripts/repo/templates/npm/cjs-esm/index.js similarity index 100% rename from scripts/templates/npm/cjs-esm/index.js rename to scripts/repo/templates/npm/cjs-esm/index.js diff --git a/scripts/templates/npm/cjs-esm/package.json b/scripts/repo/templates/npm/cjs-esm/package.json similarity index 100% rename from scripts/templates/npm/cjs-esm/package.json rename to scripts/repo/templates/npm/cjs-esm/package.json diff --git a/scripts/templates/npm/cjs/LICENSE b/scripts/repo/templates/npm/cjs/LICENSE similarity index 100% rename from scripts/templates/npm/cjs/LICENSE rename to scripts/repo/templates/npm/cjs/LICENSE diff --git a/scripts/templates/npm/cjs/README.md b/scripts/repo/templates/npm/cjs/README.md similarity index 100% rename from scripts/templates/npm/cjs/README.md rename to scripts/repo/templates/npm/cjs/README.md diff --git a/scripts/templates/npm/cjs/index.d.ts b/scripts/repo/templates/npm/cjs/index.d.ts similarity index 100% rename from scripts/templates/npm/cjs/index.d.ts rename to scripts/repo/templates/npm/cjs/index.d.ts diff --git a/scripts/templates/npm/cjs/index.js b/scripts/repo/templates/npm/cjs/index.js similarity index 100% rename from scripts/templates/npm/cjs/index.js rename to scripts/repo/templates/npm/cjs/index.js diff --git a/scripts/templates/npm/cjs/package.json b/scripts/repo/templates/npm/cjs/package.json similarity index 100% rename from scripts/templates/npm/cjs/package.json rename to scripts/repo/templates/npm/cjs/package.json diff --git a/scripts/templates/npm/es-shim-constructor/LICENSE b/scripts/repo/templates/npm/es-shim-constructor/LICENSE similarity index 100% rename from scripts/templates/npm/es-shim-constructor/LICENSE rename to scripts/repo/templates/npm/es-shim-constructor/LICENSE diff --git a/scripts/templates/npm/es-shim-constructor/README.md b/scripts/repo/templates/npm/es-shim-constructor/README.md similarity index 100% rename from scripts/templates/npm/es-shim-constructor/README.md rename to scripts/repo/templates/npm/es-shim-constructor/README.md diff --git a/scripts/templates/npm/es-shim-constructor/auto.d.ts b/scripts/repo/templates/npm/es-shim-constructor/auto.d.ts similarity index 100% rename from scripts/templates/npm/es-shim-constructor/auto.d.ts rename to scripts/repo/templates/npm/es-shim-constructor/auto.d.ts diff --git a/scripts/templates/npm/es-shim-constructor/auto.js b/scripts/repo/templates/npm/es-shim-constructor/auto.js similarity index 100% rename from scripts/templates/npm/es-shim-constructor/auto.js rename to scripts/repo/templates/npm/es-shim-constructor/auto.js diff --git a/scripts/templates/npm/es-shim-constructor/implementation.d.ts b/scripts/repo/templates/npm/es-shim-constructor/implementation.d.ts similarity index 100% rename from scripts/templates/npm/es-shim-constructor/implementation.d.ts rename to scripts/repo/templates/npm/es-shim-constructor/implementation.d.ts diff --git a/scripts/templates/npm/es-shim-constructor/implementation.js b/scripts/repo/templates/npm/es-shim-constructor/implementation.js similarity index 100% rename from scripts/templates/npm/es-shim-constructor/implementation.js rename to scripts/repo/templates/npm/es-shim-constructor/implementation.js diff --git a/scripts/templates/npm/es-shim-constructor/index.d.ts b/scripts/repo/templates/npm/es-shim-constructor/index.d.ts similarity index 100% rename from scripts/templates/npm/es-shim-constructor/index.d.ts rename to scripts/repo/templates/npm/es-shim-constructor/index.d.ts diff --git a/scripts/templates/npm/es-shim-constructor/index.js b/scripts/repo/templates/npm/es-shim-constructor/index.js similarity index 100% rename from scripts/templates/npm/es-shim-constructor/index.js rename to scripts/repo/templates/npm/es-shim-constructor/index.js diff --git a/scripts/templates/npm/es-shim-constructor/package.json b/scripts/repo/templates/npm/es-shim-constructor/package.json similarity index 100% rename from scripts/templates/npm/es-shim-constructor/package.json rename to scripts/repo/templates/npm/es-shim-constructor/package.json diff --git a/scripts/templates/npm/es-shim-constructor/polyfill.d.ts b/scripts/repo/templates/npm/es-shim-constructor/polyfill.d.ts similarity index 100% rename from scripts/templates/npm/es-shim-constructor/polyfill.d.ts rename to scripts/repo/templates/npm/es-shim-constructor/polyfill.d.ts diff --git a/scripts/templates/npm/es-shim-constructor/polyfill.js b/scripts/repo/templates/npm/es-shim-constructor/polyfill.js similarity index 100% rename from scripts/templates/npm/es-shim-constructor/polyfill.js rename to scripts/repo/templates/npm/es-shim-constructor/polyfill.js diff --git a/scripts/templates/npm/es-shim-constructor/shim.d.ts b/scripts/repo/templates/npm/es-shim-constructor/shim.d.ts similarity index 100% rename from scripts/templates/npm/es-shim-constructor/shim.d.ts rename to scripts/repo/templates/npm/es-shim-constructor/shim.d.ts diff --git a/scripts/templates/npm/es-shim-constructor/shim.js b/scripts/repo/templates/npm/es-shim-constructor/shim.js similarity index 100% rename from scripts/templates/npm/es-shim-constructor/shim.js rename to scripts/repo/templates/npm/es-shim-constructor/shim.js diff --git a/scripts/templates/npm/es-shim-prototype-method/LICENSE b/scripts/repo/templates/npm/es-shim-prototype-method/LICENSE similarity index 100% rename from scripts/templates/npm/es-shim-prototype-method/LICENSE rename to scripts/repo/templates/npm/es-shim-prototype-method/LICENSE diff --git a/scripts/templates/npm/es-shim-prototype-method/README.md b/scripts/repo/templates/npm/es-shim-prototype-method/README.md similarity index 100% rename from scripts/templates/npm/es-shim-prototype-method/README.md rename to scripts/repo/templates/npm/es-shim-prototype-method/README.md diff --git a/scripts/templates/npm/es-shim-prototype-method/auto.d.ts b/scripts/repo/templates/npm/es-shim-prototype-method/auto.d.ts similarity index 100% rename from scripts/templates/npm/es-shim-prototype-method/auto.d.ts rename to scripts/repo/templates/npm/es-shim-prototype-method/auto.d.ts diff --git a/scripts/templates/npm/es-shim-prototype-method/auto.js b/scripts/repo/templates/npm/es-shim-prototype-method/auto.js similarity index 100% rename from scripts/templates/npm/es-shim-prototype-method/auto.js rename to scripts/repo/templates/npm/es-shim-prototype-method/auto.js diff --git a/scripts/templates/npm/es-shim-prototype-method/implementation.d.ts b/scripts/repo/templates/npm/es-shim-prototype-method/implementation.d.ts similarity index 100% rename from scripts/templates/npm/es-shim-prototype-method/implementation.d.ts rename to scripts/repo/templates/npm/es-shim-prototype-method/implementation.d.ts diff --git a/scripts/templates/npm/es-shim-prototype-method/implementation.js b/scripts/repo/templates/npm/es-shim-prototype-method/implementation.js similarity index 100% rename from scripts/templates/npm/es-shim-prototype-method/implementation.js rename to scripts/repo/templates/npm/es-shim-prototype-method/implementation.js diff --git a/scripts/templates/npm/es-shim-prototype-method/index.d.ts b/scripts/repo/templates/npm/es-shim-prototype-method/index.d.ts similarity index 100% rename from scripts/templates/npm/es-shim-prototype-method/index.d.ts rename to scripts/repo/templates/npm/es-shim-prototype-method/index.d.ts diff --git a/scripts/templates/npm/es-shim-prototype-method/index.js b/scripts/repo/templates/npm/es-shim-prototype-method/index.js similarity index 100% rename from scripts/templates/npm/es-shim-prototype-method/index.js rename to scripts/repo/templates/npm/es-shim-prototype-method/index.js diff --git a/scripts/templates/npm/es-shim-prototype-method/package.json b/scripts/repo/templates/npm/es-shim-prototype-method/package.json similarity index 100% rename from scripts/templates/npm/es-shim-prototype-method/package.json rename to scripts/repo/templates/npm/es-shim-prototype-method/package.json diff --git a/scripts/templates/npm/es-shim-prototype-method/polyfill.d.ts b/scripts/repo/templates/npm/es-shim-prototype-method/polyfill.d.ts similarity index 100% rename from scripts/templates/npm/es-shim-prototype-method/polyfill.d.ts rename to scripts/repo/templates/npm/es-shim-prototype-method/polyfill.d.ts diff --git a/scripts/templates/npm/es-shim-prototype-method/polyfill.js b/scripts/repo/templates/npm/es-shim-prototype-method/polyfill.js similarity index 100% rename from scripts/templates/npm/es-shim-prototype-method/polyfill.js rename to scripts/repo/templates/npm/es-shim-prototype-method/polyfill.js diff --git a/scripts/templates/npm/es-shim-prototype-method/shim.d.ts b/scripts/repo/templates/npm/es-shim-prototype-method/shim.d.ts similarity index 100% rename from scripts/templates/npm/es-shim-prototype-method/shim.d.ts rename to scripts/repo/templates/npm/es-shim-prototype-method/shim.d.ts diff --git a/scripts/templates/npm/es-shim-prototype-method/shim.js b/scripts/repo/templates/npm/es-shim-prototype-method/shim.js similarity index 100% rename from scripts/templates/npm/es-shim-prototype-method/shim.js rename to scripts/repo/templates/npm/es-shim-prototype-method/shim.js diff --git a/scripts/templates/npm/es-shim-static-method/LICENSE b/scripts/repo/templates/npm/es-shim-static-method/LICENSE similarity index 100% rename from scripts/templates/npm/es-shim-static-method/LICENSE rename to scripts/repo/templates/npm/es-shim-static-method/LICENSE diff --git a/scripts/templates/npm/es-shim-static-method/README.md b/scripts/repo/templates/npm/es-shim-static-method/README.md similarity index 100% rename from scripts/templates/npm/es-shim-static-method/README.md rename to scripts/repo/templates/npm/es-shim-static-method/README.md diff --git a/scripts/templates/npm/es-shim-static-method/auto.d.ts b/scripts/repo/templates/npm/es-shim-static-method/auto.d.ts similarity index 100% rename from scripts/templates/npm/es-shim-static-method/auto.d.ts rename to scripts/repo/templates/npm/es-shim-static-method/auto.d.ts diff --git a/scripts/templates/npm/es-shim-static-method/auto.js b/scripts/repo/templates/npm/es-shim-static-method/auto.js similarity index 100% rename from scripts/templates/npm/es-shim-static-method/auto.js rename to scripts/repo/templates/npm/es-shim-static-method/auto.js diff --git a/scripts/templates/npm/es-shim-static-method/implementation.d.ts b/scripts/repo/templates/npm/es-shim-static-method/implementation.d.ts similarity index 100% rename from scripts/templates/npm/es-shim-static-method/implementation.d.ts rename to scripts/repo/templates/npm/es-shim-static-method/implementation.d.ts diff --git a/scripts/templates/npm/es-shim-static-method/implementation.js b/scripts/repo/templates/npm/es-shim-static-method/implementation.js similarity index 100% rename from scripts/templates/npm/es-shim-static-method/implementation.js rename to scripts/repo/templates/npm/es-shim-static-method/implementation.js diff --git a/scripts/templates/npm/es-shim-static-method/index.d.ts b/scripts/repo/templates/npm/es-shim-static-method/index.d.ts similarity index 100% rename from scripts/templates/npm/es-shim-static-method/index.d.ts rename to scripts/repo/templates/npm/es-shim-static-method/index.d.ts diff --git a/scripts/templates/npm/es-shim-static-method/index.js b/scripts/repo/templates/npm/es-shim-static-method/index.js similarity index 100% rename from scripts/templates/npm/es-shim-static-method/index.js rename to scripts/repo/templates/npm/es-shim-static-method/index.js diff --git a/scripts/templates/npm/es-shim-static-method/package.json b/scripts/repo/templates/npm/es-shim-static-method/package.json similarity index 100% rename from scripts/templates/npm/es-shim-static-method/package.json rename to scripts/repo/templates/npm/es-shim-static-method/package.json diff --git a/scripts/templates/npm/es-shim-static-method/polyfill.d.ts b/scripts/repo/templates/npm/es-shim-static-method/polyfill.d.ts similarity index 100% rename from scripts/templates/npm/es-shim-static-method/polyfill.d.ts rename to scripts/repo/templates/npm/es-shim-static-method/polyfill.d.ts diff --git a/scripts/templates/npm/es-shim-static-method/polyfill.js b/scripts/repo/templates/npm/es-shim-static-method/polyfill.js similarity index 100% rename from scripts/templates/npm/es-shim-static-method/polyfill.js rename to scripts/repo/templates/npm/es-shim-static-method/polyfill.js diff --git a/scripts/templates/npm/es-shim-static-method/shim.d.ts b/scripts/repo/templates/npm/es-shim-static-method/shim.d.ts similarity index 100% rename from scripts/templates/npm/es-shim-static-method/shim.d.ts rename to scripts/repo/templates/npm/es-shim-static-method/shim.d.ts diff --git a/scripts/templates/npm/es-shim-static-method/shim.js b/scripts/repo/templates/npm/es-shim-static-method/shim.js similarity index 100% rename from scripts/templates/npm/es-shim-static-method/shim.js rename to scripts/repo/templates/npm/es-shim-static-method/shim.js diff --git a/scripts/testing/analyze-ci-failures.mts b/scripts/repo/testing/analyze-ci-failures.mts similarity index 100% rename from scripts/testing/analyze-ci-failures.mts rename to scripts/repo/testing/analyze-ci-failures.mts diff --git a/scripts/testing/helpers.mts b/scripts/repo/testing/helpers.mts similarity index 100% rename from scripts/testing/helpers.mts rename to scripts/repo/testing/helpers.mts diff --git a/scripts/testing/reproduce-ci-locally.mts b/scripts/repo/testing/reproduce-ci-locally.mts similarity index 100% rename from scripts/testing/reproduce-ci-locally.mts rename to scripts/repo/testing/reproduce-ci-locally.mts diff --git a/scripts/testing/validate-package-tests.mts b/scripts/repo/testing/validate-package-tests.mts similarity index 100% rename from scripts/testing/validate-package-tests.mts rename to scripts/repo/testing/validate-package-tests.mts diff --git a/scripts/repo/update.mts b/scripts/repo/update.mts index 0366b5cb6..4dfb7dd01 100644 --- a/scripts/repo/update.mts +++ b/scripts/repo/update.mts @@ -3,7 +3,7 @@ * socket-registry's release subject carries a generated artifact the * canonical `scripts/fleet/update.mts` knows nothing about: * `registry/manifest.json`, regenerated from each override package's npm - * `latest` by `scripts/npm/update-manifest.mts`. Before this overlay the + * `latest` by `scripts/repo/npm/update-manifest.mts`. Before this overlay the * regeneration was a manual step someone had to remember after every * `pnpm run update`, so the manifest drifted stale between releases. * The `update` package.json script now resolves here β€” the same @@ -61,6 +61,7 @@ export async function main(): Promise { const manifestScript = path.join( REPO_ROOT, 'scripts', + 'repo', 'npm', 'update-manifest.mts', ) diff --git a/scripts/repo/util/git.mts b/scripts/repo/util/git.mts index 509446ac3..36ea3d6b4 100644 --- a/scripts/repo/util/git.mts +++ b/scripts/repo/util/git.mts @@ -13,7 +13,7 @@ import { REL_REGISTRY_PKG_PATH, ROOT_PACKAGES_PATH, ROOT_PATH, -} from '../../constants/paths.mts' +} from '../constants/paths.mts' // Import sync and additional functions from helpers import { getChangedFilesSync, diff --git a/scripts/repo/util/package-test-install.mts b/scripts/repo/util/package-test-install.mts index ad4261aa8..0a3b71a0a 100644 --- a/scripts/repo/util/package-test-install.mts +++ b/scripts/repo/util/package-test-install.mts @@ -18,7 +18,7 @@ import { readPackageJson } from '@socketsecurity/lib-stable/packages/read' import { cleanTestScript } from './script-cleaning.mts' import { spawn } from './spawn.mts' import { testRunners } from './test-runners.mts' -import { ROOT_PATH } from '../../constants/paths.mts' +import { ROOT_PATH } from '../constants/paths.mts' // Shared pnpm flags to make it behave like npm with hoisting. export const PNPM_NPM_LIKE_FLAGS = [ diff --git a/scripts/repo/util/package.mts b/scripts/repo/util/package.mts index 755aca874..5ca92bd97 100644 --- a/scripts/repo/util/package.mts +++ b/scripts/repo/util/package.mts @@ -23,7 +23,7 @@ import type { } from '@socketsecurity/lib-stable/packages/types' import type { SpinnerInstance } from '@socketsecurity/lib-stable/spinner/types' -import { DEFAULT_CONCURRENCY } from '../../constants/core.mts' +import { DEFAULT_CONCURRENCY } from '../constants/core.mts' export { buildTestEnv, diff --git a/scripts/repo/util/packages.mts b/scripts/repo/util/packages.mts index edcb60edc..bad9a8b05 100644 --- a/scripts/repo/util/packages.mts +++ b/scripts/repo/util/packages.mts @@ -7,7 +7,7 @@ import path from 'node:path' import { hasOwn } from '@socketsecurity/lib-stable/objects/predicates' -import { PACKAGE_JSON, TEST_NPM_PATH } from '../../constants/paths.mts' +import { PACKAGE_JSON, TEST_NPM_PATH } from '../constants/paths.mts' export interface TestNpmPackageJson { devDependencies?: Record | undefined diff --git a/scripts/repo/util/templates.mts b/scripts/repo/util/templates.mts index 8d65f64a0..f740f5234 100644 --- a/scripts/repo/util/templates.mts +++ b/scripts/repo/util/templates.mts @@ -27,7 +27,7 @@ import { NPM_TEMPLATES_PATH, PACKAGE_JSON, README_MD, -} from '../../constants/paths.mts' +} from '../constants/paths.mts' import { TEMPLATE_CJS, TEMPLATE_CJS_BROWSER, @@ -35,8 +35,8 @@ import { TEMPLATE_ES_SHIM_CONSTRUCTOR, TEMPLATE_ES_SHIM_PROTOTYPE_METHOD, TEMPLATE_ES_SHIM_STATIC_METHOD, -} from '../../constants/templates.mts' -import { getLicenseContent } from '../../constants/utils.mts' +} from '../constants/templates.mts' +import { getLicenseContent } from '../constants/utils.mts' import { biomeFormat } from './biome.mts' import type { ManifestEntry, diff --git a/scripts/validation/bundle-deps.mts b/scripts/repo/validation/bundle-deps.mts similarity index 99% rename from scripts/validation/bundle-deps.mts rename to scripts/repo/validation/bundle-deps.mts index db9df3eb2..297226ea0 100644 --- a/scripts/validation/bundle-deps.mts +++ b/scripts/repo/validation/bundle-deps.mts @@ -1,4 +1,4 @@ -/** +/* * @file Validates that bundled vs external dependencies are correctly declared * in package.json. Rules: * @@ -16,7 +16,7 @@ import path from 'node:path' import { getDefaultLogger } from '@socketsecurity/lib-stable/logger/default' import { ROOT_PATH } from '../constants/paths.mts' -import { runValidationScript } from '../repo/util/validation-runner.mts' +import { runValidationScript } from '../util/validation-runner.mts' const logger = getDefaultLogger() diff --git a/scripts/validation/file-size.mts b/scripts/repo/validation/file-size.mts similarity index 98% rename from scripts/validation/file-size.mts rename to scripts/repo/validation/file-size.mts index 6214b6d8f..76aa25652 100644 --- a/scripts/validation/file-size.mts +++ b/scripts/repo/validation/file-size.mts @@ -1,4 +1,4 @@ -/** +/* * @file Validates that no individual files exceed size threshold. Rules: * * - No single file should exceed 2MB (2,097,152 bytes) @@ -13,7 +13,7 @@ import path from 'node:path' import { getDefaultLogger } from '@socketsecurity/lib-stable/logger/default' import { ROOT_PATH } from '../constants/paths.mts' -import { runValidationScript } from '../repo/util/validation-runner.mts' +import { runValidationScript } from '../util/validation-runner.mts' interface FileSizeViolation { file: string diff --git a/scripts/validation/markdown-filenames.mts b/scripts/repo/validation/markdown-filenames.mts similarity index 99% rename from scripts/validation/markdown-filenames.mts rename to scripts/repo/validation/markdown-filenames.mts index 897aa7586..e26facab3 100644 --- a/scripts/validation/markdown-filenames.mts +++ b/scripts/repo/validation/markdown-filenames.mts @@ -1,4 +1,4 @@ -/** +/* * @file Validates that markdown files follow naming conventions. Special files * (allowed anywhere): * @@ -19,7 +19,7 @@ import path from 'node:path' import { getDefaultLogger } from '@socketsecurity/lib-stable/logger/default' import { ROOT_PATH } from '../constants/paths.mts' -import { runValidationScript } from '../repo/util/validation-runner.mts' +import { runValidationScript } from '../util/validation-runner.mts' const logger = getDefaultLogger() diff --git a/test/npm/.pnpmfile.cjs b/test/npm/.pnpmfile.cjs index 75580e96e..e5a96e466 100644 --- a/test/npm/.pnpmfile.cjs +++ b/test/npm/.pnpmfile.cjs @@ -8,7 +8,7 @@ */ // Must use hardcoded string as this runs before dependencies are available -// This matches the WORKSPACE_ANY constant from scripts/constants +// This matches the WORKSPACE_ANY constant from scripts/repo/constants const WORKSPACE_ANY = 'workspace:*' module.exports = { diff --git a/test/npm/hyrious__bun.lockb.test.mts b/test/npm/hyrious__bun.lockb.test.mts index 5b5d613a7..2120dce57 100644 --- a/test/npm/hyrious__bun.lockb.test.mts +++ b/test/npm/hyrious__bun.lockb.test.mts @@ -6,7 +6,7 @@ import path from 'node:path' import { describe, expect, it } from 'vitest' -import { TEST_NPM_FIXTURES_PATH } from '../../scripts/constants/paths.mts' +import { TEST_NPM_FIXTURES_PATH } from '../../scripts/repo/constants/paths.mts' import { setupNpmPackageTest } from '../util/npm-package-helper.mts' const UTF8 = 'utf8' diff --git a/test/packages.test.mts b/test/packages.test.mts index e886fc497..dd3e69c23 100644 --- a/test/packages.test.mts +++ b/test/packages.test.mts @@ -31,12 +31,12 @@ import { NPM_PACKAGES_PATH, PACKAGE_JSON, SOCKET_REGISTRY_SCOPE, -} from '../scripts/constants/paths.mts' +} from '../scripts/repo/constants/paths.mts' import { getEcosystems, getNpmPackageNames, -} from '../scripts/constants/testing.mts' -import { getIgnoreGlobs } from '../scripts/constants/utils.mts' +} from '../scripts/repo/constants/testing.mts' +import { getIgnoreGlobs } from '../scripts/repo/constants/utils.mts' const LICENSE_GLOB = '**/+(LICENSE|LICENCE|LICENSE.original|LICENSE.*.original)*' diff --git a/test/scripts/npm/check-trusted-packages-staged.test.mts b/test/scripts/npm/check-trusted-packages-staged.test.mts index 63ccfc397..292d11d26 100644 --- a/test/scripts/npm/check-trusted-packages-staged.test.mts +++ b/test/scripts/npm/check-trusted-packages-staged.test.mts @@ -30,12 +30,12 @@ import { mergeStagedRosters, readLocalNpmPackages, readStagedTrust, -} from '../../../scripts/npm/check-trusted-packages-staged.mts' +} from '../../../scripts/repo/npm/check-trusted-packages-staged.mts' import type { StagedManifestRow, StagedRosterEntry, -} from '../../../scripts/npm/check-trusted-packages-staged.mts' +} from '../../../scripts/repo/npm/check-trusted-packages-staged.mts' import type { PackumentMetaSlim } from '@socketsecurity/lib/npm/meta-types' interface VersionSpec { diff --git a/test/scripts/npm/configure-staged-publishing-browser.test.mts b/test/scripts/npm/configure-staged-publishing-browser.test.mts index 6693915a2..7f4259170 100644 --- a/test/scripts/npm/configure-staged-publishing-browser.test.mts +++ b/test/scripts/npm/configure-staged-publishing-browser.test.mts @@ -16,9 +16,9 @@ import { describe, expect, test } from 'vitest' -import { waitForAccessPage } from '../../../scripts/npm/configure-staged-publishing-browser.mts' +import { waitForAccessPage } from '../../../scripts/repo/npm/configure-staged-publishing-browser.mts' -import type { StagedConfigurationTarget } from '../../../scripts/npm/configure-staged-publishing-plan.mts' +import type { StagedConfigurationTarget } from '../../../scripts/repo/npm/configure-staged-publishing-plan.mts' import type { Page } from 'playwright-core' const ACCESS_URL = 'https://www.npmjs.com/package/@socketregistry/abab/access' diff --git a/test/scripts/npm/configure-staged-publishing-controls-report.test.mts b/test/scripts/npm/configure-staged-publishing-controls-report.test.mts index d7355995a..791df68f4 100644 --- a/test/scripts/npm/configure-staged-publishing-controls-report.test.mts +++ b/test/scripts/npm/configure-staged-publishing-controls-report.test.mts @@ -15,14 +15,14 @@ import { describe, expect, test } from 'vitest' import { describeActionControlCandidate, formatUnresolvedActionControl, -} from '../../../scripts/npm/configure-staged-publishing-controls-report.mts' -import { collectActionControlCandidates } from '../../../scripts/npm/configure-staged-publishing-controls.mts' +} from '../../../scripts/repo/npm/configure-staged-publishing-controls-report.mts' +import { collectActionControlCandidates } from '../../../scripts/repo/npm/configure-staged-publishing-controls.mts' -import type { ActionControlCandidate } from '../../../scripts/npm/configure-staged-publishing-controls.mts' +import type { ActionControlCandidate } from '../../../scripts/repo/npm/configure-staged-publishing-controls.mts' import type { FormDomNode, FormDomSnapshot, -} from '../../../scripts/npm/configure-staged-publishing-form-dom.mts' +} from '../../../scripts/repo/npm/configure-staged-publishing-form-dom.mts' const CLEAR_DIRECT = { actionTokens: ['npm publish', 'createPackage', 'publish'], diff --git a/test/scripts/npm/configure-staged-publishing-controls.test.mts b/test/scripts/npm/configure-staged-publishing-controls.test.mts index 5d47690e2..37fe77013 100644 --- a/test/scripts/npm/configure-staged-publishing-controls.test.mts +++ b/test/scripts/npm/configure-staged-publishing-controls.test.mts @@ -16,9 +16,9 @@ import { describe, expect, test } from 'vitest' import { encodesActionState, resolveActionControlPlan, -} from '../../../scripts/npm/configure-staged-publishing-controls.mts' +} from '../../../scripts/repo/npm/configure-staged-publishing-controls.mts' -import type { ActionControlCandidate } from '../../../scripts/npm/configure-staged-publishing-controls.mts' +import type { ActionControlCandidate } from '../../../scripts/repo/npm/configure-staged-publishing-controls.mts' const CLEAR_DIRECT = { actionTokens: [ diff --git a/test/scripts/npm/configure-staged-publishing-dump.test.mts b/test/scripts/npm/configure-staged-publishing-dump.test.mts index f6b184c52..18ba1b3fc 100644 --- a/test/scripts/npm/configure-staged-publishing-dump.test.mts +++ b/test/scripts/npm/configure-staged-publishing-dump.test.mts @@ -15,7 +15,7 @@ import { describePayloadKeyTree, describeValueType, findPayloadKeyPaths, -} from '../../../scripts/npm/configure-staged-publishing-dump.mts' +} from '../../../scripts/repo/npm/configure-staged-publishing-dump.mts' // The shape npm answered the access URL with while a two-factor step-up was // outstanding. Keys real, values invented. Built through JSON.parse because diff --git a/test/scripts/npm/configure-staged-publishing-form-dom.test.mts b/test/scripts/npm/configure-staged-publishing-form-dom.test.mts index cf448a89c..256cda123 100644 --- a/test/scripts/npm/configure-staged-publishing-form-dom.test.mts +++ b/test/scripts/npm/configure-staged-publishing-form-dom.test.mts @@ -24,12 +24,12 @@ import { redactAttributeValue, redactUiText, summarizeFormDomControls, -} from '../../../scripts/npm/configure-staged-publishing-form-dom.mts' +} from '../../../scripts/repo/npm/configure-staged-publishing-form-dom.mts' import type { FormDomNode, FormDomSnapshot, -} from '../../../scripts/npm/configure-staged-publishing-form-dom.mts' +} from '../../../scripts/repo/npm/configure-staged-publishing-form-dom.mts' function node(config: Partial & { tag: string }): FormDomNode { return { diff --git a/test/scripts/npm/configure-staged-publishing-markers.test.mts b/test/scripts/npm/configure-staged-publishing-markers.test.mts index 2054d12a1..4e1f2db2b 100644 --- a/test/scripts/npm/configure-staged-publishing-markers.test.mts +++ b/test/scripts/npm/configure-staged-publishing-markers.test.mts @@ -17,7 +17,7 @@ import { hasSettingsPayloadMarkers, normalizeChallengeText, stripDismissableBanners, -} from '../../../scripts/npm/configure-staged-publishing-markers.mts' +} from '../../../scripts/repo/npm/configure-staged-publishing-markers.mts' // The four spellings of one phrase. Enumerating them as regexes is the bug this // normalization replaces; enumerating them as TEST INPUT is the point. diff --git a/test/scripts/npm/configure-staged-publishing-operator.test.mts b/test/scripts/npm/configure-staged-publishing-operator.test.mts index 7663b64a0..31d582ba3 100644 --- a/test/scripts/npm/configure-staged-publishing-operator.test.mts +++ b/test/scripts/npm/configure-staged-publishing-operator.test.mts @@ -15,7 +15,7 @@ import { dismissSiteNotifications, isPolledPageOnTarget, SITE_NOTIFICATION_CLOSE_SELECTOR, -} from '../../../scripts/npm/configure-staged-publishing-operator.mts' +} from '../../../scripts/repo/npm/configure-staged-publishing-operator.mts' import type { Page } from 'playwright-core' diff --git a/test/scripts/npm/configure-staged-publishing-overlay.test.mts b/test/scripts/npm/configure-staged-publishing-overlay.test.mts index 57d22d6c4..dab6c66fe 100644 --- a/test/scripts/npm/configure-staged-publishing-overlay.test.mts +++ b/test/scripts/npm/configure-staged-publishing-overlay.test.mts @@ -18,7 +18,7 @@ import { OPERATOR_OVERLAY_CAPTION, OPERATOR_OVERLAY_ELEMENT_ID, shouldShowOperatorOverlay, -} from '../../../scripts/npm/configure-staged-publishing-overlay.mts' +} from '../../../scripts/repo/npm/configure-staged-publishing-overlay.mts' describe('shouldShowOperatorOverlay', () => { test('only a real challenge earns the shield', () => { diff --git a/test/scripts/npm/configure-staged-publishing-permissions.test.mts b/test/scripts/npm/configure-staged-publishing-permissions.test.mts index 7aaa73b7f..c5c32baf2 100644 --- a/test/scripts/npm/configure-staged-publishing-permissions.test.mts +++ b/test/scripts/npm/configure-staged-publishing-permissions.test.mts @@ -29,11 +29,11 @@ import { TARGET_ENVIRONMENT_NAME, TARGET_REPOSITORY_NAME, TARGET_WORKFLOW_FILENAME, -} from '../../../scripts/npm/configure-staged-publishing-plan.mts' +} from '../../../scripts/repo/npm/configure-staged-publishing-plan.mts' -import { normalizePayloadKey } from '../../../scripts/npm/configure-staged-publishing-payload.mts' +import { normalizePayloadKey } from '../../../scripts/repo/npm/configure-staged-publishing-payload.mts' -import type { StagedTrustReport } from '../../../scripts/npm/check-trusted-packages-staged.mts' +import type { StagedTrustReport } from '../../../scripts/repo/npm/check-trusted-packages-staged.mts' // One npm access-page payload carrying a single live trusted-publisher // connection, in the shape npm's own `oidcConnections` list uses. diff --git a/test/scripts/npm/configure-staged-publishing-plan.test.mts b/test/scripts/npm/configure-staged-publishing-plan.test.mts index 00f49da50..1731525f0 100644 --- a/test/scripts/npm/configure-staged-publishing-plan.test.mts +++ b/test/scripts/npm/configure-staged-publishing-plan.test.mts @@ -32,9 +32,9 @@ import { TARGET_ENVIRONMENT_NAME, TARGET_REPOSITORY_NAME, TARGET_WORKFLOW_FILENAME, -} from '../../../scripts/npm/configure-staged-publishing-plan.mts' +} from '../../../scripts/repo/npm/configure-staged-publishing-plan.mts' -import type { StagedTrustReport } from '../../../scripts/npm/check-trusted-packages-staged.mts' +import type { StagedTrustReport } from '../../../scripts/repo/npm/check-trusted-packages-staged.mts' // One npm access-page payload carrying a single live trusted-publisher // connection, in the shape npm's own `oidcConnections` list uses. diff --git a/test/scripts/npm/configure-staged-publishing-session.test.mts b/test/scripts/npm/configure-staged-publishing-session.test.mts index b876b24cc..1f7a6bffa 100644 --- a/test/scripts/npm/configure-staged-publishing-session.test.mts +++ b/test/scripts/npm/configure-staged-publishing-session.test.mts @@ -24,7 +24,7 @@ import { isOperatorSignInUrl, OPERATOR_POLL_MS, WAIT_FOR_OPERATOR_MS, -} from '../../../scripts/npm/configure-staged-publishing-session.mts' +} from '../../../scripts/repo/npm/configure-staged-publishing-session.mts' const ACCESS_URL = 'https://www.npmjs.com/package/@socketregistry/abab/access' const LOGIN_URL = diff --git a/test/scripts/npm/configure-staged-publishing-write.test.mts b/test/scripts/npm/configure-staged-publishing-write.test.mts index edc31bcf2..cb6494add 100644 --- a/test/scripts/npm/configure-staged-publishing-write.test.mts +++ b/test/scripts/npm/configure-staged-publishing-write.test.mts @@ -9,7 +9,7 @@ import { describe, expect, test } from 'vitest' -import { verifyStagedPayload } from '../../../scripts/npm/configure-staged-publishing-write.mts' +import { verifyStagedPayload } from '../../../scripts/repo/npm/configure-staged-publishing-write.mts' import type { TrustedPublisherDesired } from '../../../scripts/fleet/publish-infra/npm/trusted-publisher-plan.mts' diff --git a/test/scripts/npm/publish-npm-packages-commit.test.mts b/test/scripts/npm/publish-npm-packages-commit.test.mts index dfc9353f3..1cdddd1fa 100644 --- a/test/scripts/npm/publish-npm-packages-commit.test.mts +++ b/test/scripts/npm/publish-npm-packages-commit.test.mts @@ -1,5 +1,5 @@ /** - * @file Tests for scripts/npm/publish-npm-packages-commit.mts. The + * @file Tests for scripts/repo/npm/publish-npm-packages-commit.mts. The * publish-registry-last and --force-registry branches key off the registry * package's identity; a hardcoded '@socketsecurity/registry-stable' literal * never matched registry/package.json's actual name, so both branches were @@ -17,15 +17,16 @@ import { describe, expect, test } from 'vitest' import { REGISTRY_PKG_PATH, ROOT_PATH, -} from '../../../scripts/constants/paths.mts' +} from '../../../scripts/repo/constants/paths.mts' import { packageData, requirePackageJson, -} from '../../../scripts/npm/publish-npm-packages-commit.mts' +} from '../../../scripts/repo/npm/publish-npm-packages-commit.mts' const COMMIT_MODULE_PATH = path.join( ROOT_PATH, 'scripts', + 'repo', 'npm', 'publish-npm-packages-commit.mts', ) diff --git a/test/scripts/npm/publish-npm-packages-dispatch.test.mts b/test/scripts/npm/publish-npm-packages-dispatch.test.mts index e147a9c1d..a12c3dc86 100644 --- a/test/scripts/npm/publish-npm-packages-dispatch.test.mts +++ b/test/scripts/npm/publish-npm-packages-dispatch.test.mts @@ -1,5 +1,5 @@ /** - * @file Tests for scripts/npm/publish-npm-packages-dispatch.mts β€” the local + * @file Tests for scripts/repo/npm/publish-npm-packages-dispatch.mts β€” the local * lane's argv mapping. The dispatch is the ONLY thing a local run may do, so * what it hands `gh` is the whole contract: every workflow input is passed * explicitly rather than left to the YAML's default, and `publish` defaults @@ -12,7 +12,7 @@ import { buildWorkflowDispatchArgs, buildWorkflowWatchArgs, PUBLISH_WORKFLOW_FILE, -} from '../../../scripts/npm/publish-npm-packages-dispatch.mts' +} from '../../../scripts/repo/npm/publish-npm-packages-dispatch.mts' describe('buildWorkflowDispatchArgs', () => { test('a bare dispatch targets the workflow and defaults to a dry run', () => { diff --git a/test/scripts/npm/publish-npm-packages-failures.test.mts b/test/scripts/npm/publish-npm-packages-failures.test.mts index 77c502af4..e632974fb 100644 --- a/test/scripts/npm/publish-npm-packages-failures.test.mts +++ b/test/scripts/npm/publish-npm-packages-failures.test.mts @@ -1,5 +1,5 @@ /** - * @file Tests for scripts/npm/publish-npm-packages-failures.mts. A wave that + * @file Tests for scripts/repo/npm/publish-npm-packages-failures.mts. A wave that * collected nine failures once logged `Unable to publish 9 packages` and * exited 0, so every caller reading the exit code saw a successful publish. * These specs pin that a recorded failure is both reportable and non-zero, @@ -13,9 +13,9 @@ import { isTrustedPublisherProblem, publishExitCode, recordPublishFailure, -} from '../../../scripts/npm/publish-npm-packages-failures.mts' +} from '../../../scripts/repo/npm/publish-npm-packages-failures.mts' -import type { PublishState } from '../../../scripts/npm/publish-npm-packages-failures.mts' +import type { PublishState } from '../../../scripts/repo/npm/publish-npm-packages-failures.mts' function emptyState(): PublishState { return { fails: [], failures: [] } diff --git a/test/scripts/npm/publish-npm-packages-git.test.mts b/test/scripts/npm/publish-npm-packages-git.test.mts index 8c04ed9ab..10ba05a45 100644 --- a/test/scripts/npm/publish-npm-packages-git.test.mts +++ b/test/scripts/npm/publish-npm-packages-git.test.mts @@ -1,5 +1,5 @@ /** - * @file Tests for scripts/npm/publish-npm-packages-git.mts checkoutCommit. + * @file Tests for scripts/repo/npm/publish-npm-packages-git.mts checkoutCommit. * The publish flow runs in checkouts shared with other sessions, so the * `git reset --hard` + `git checkout ` pair has two safety rails: a * --dry-run preview touches the worktree not at all, and a real run over a @@ -15,7 +15,7 @@ vi.mock(import('@socketsecurity/lib-stable/process/spawn/child'), () => ({ spawn: mockSpawn, })) -import { checkoutCommit } from '../../../scripts/npm/publish-npm-packages-git.mts' +import { checkoutCommit } from '../../../scripts/repo/npm/publish-npm-packages-git.mts' // Every `git` invocation the mock recorded, as a space-joined command line. function spawnedCommands(): string[] { diff --git a/test/scripts/npm/publish-npm-packages-needs.test.mts b/test/scripts/npm/publish-npm-packages-needs.test.mts index fbab8710d..923670cee 100644 --- a/test/scripts/npm/publish-npm-packages-needs.test.mts +++ b/test/scripts/npm/publish-npm-packages-needs.test.mts @@ -1,5 +1,5 @@ /** - * @file Tests for scripts/npm/publish-npm-packages-needs.mts. Two defects live + * @file Tests for scripts/repo/npm/publish-npm-packages-needs.mts. Two defects live * here. `getReleaseTag` parses a SPEC, so the call sites that handed it a * bare version always got back the empty string and npm rejected every upload * with `Tag must be a non-empty string`. And a package npm holds at the @@ -16,7 +16,7 @@ import { PLACEHOLDER_NPM_VERSION, resolveDistTag, resolveNeedsPublish, -} from '../../../scripts/npm/publish-npm-packages-needs.mts' +} from '../../../scripts/repo/npm/publish-npm-packages-needs.mts' describe('resolveDistTag', () => { test('a release version publishes under latest', () => { diff --git a/test/scripts/npm/publish-npm-packages-publish.test.mts b/test/scripts/npm/publish-npm-packages-publish.test.mts index dfb46169c..0ee40500f 100644 --- a/test/scripts/npm/publish-npm-packages-publish.test.mts +++ b/test/scripts/npm/publish-npm-packages-publish.test.mts @@ -1,5 +1,5 @@ /** - * @file Tests for scripts/npm/publish-npm-packages-publish.mts with the npm + * @file Tests for scripts/repo/npm/publish-npm-packages-publish.mts with the npm * upload MOCKED β€” nothing here touches the network or a registry. The live * run that prompted this passed an EMPTY dist-tag to every package and npm * 400'd each one with `Tag must be a non-empty string`; the old `?? 'latest'` @@ -34,7 +34,7 @@ describe('stagePublish tag defaulting', () => { test('an empty tag never reaches npm', async () => { const { stagePublish } = - await import('../../../scripts/npm/publish-npm-packages-publish.mts') + await import('../../../scripts/repo/npm/publish-npm-packages-publish.mts') const state = { fails: [] as string[], failures: [] } await stagePublish( { path: '/tmp/pkg', printName: '@socketregistry/own-keys', tag: '' }, @@ -48,7 +48,7 @@ describe('stagePublish tag defaulting', () => { test('an explicit prerelease tag is forwarded as-is', async () => { const { stagePublish } = - await import('../../../scripts/npm/publish-npm-packages-publish.mts') + await import('../../../scripts/repo/npm/publish-npm-packages-publish.mts') await stagePublish( { path: '/tmp/pkg', printName: '@socketregistry/own-keys', tag: 'beta' }, { fails: [], failures: [] }, @@ -65,7 +65,7 @@ describe('stagePublish tag defaulting', () => { ran: true, }) const { stagePublish } = - await import('../../../scripts/npm/publish-npm-packages-publish.mts') + await import('../../../scripts/repo/npm/publish-npm-packages-publish.mts') const state = { fails: [] as string[], failures: [] } await stagePublish( { path: '/tmp/pkg', printName: '@socketregistry/own-keys' }, @@ -87,7 +87,7 @@ describe('stagePublish tag defaulting', () => { ran: true, }) const { stagePublish } = - await import('../../../scripts/npm/publish-npm-packages-publish.mts') + await import('../../../scripts/repo/npm/publish-npm-packages-publish.mts') const state = { fails: [] as string[], failures: [] } await stagePublish( { path: '/tmp/pkg', printName: '@socketregistry/own-keys' }, @@ -101,7 +101,7 @@ describe('stagePublish tag defaulting', () => { test('a dry run stages nothing at all', async () => { const { stagePublish } = - await import('../../../scripts/npm/publish-npm-packages-publish.mts') + await import('../../../scripts/repo/npm/publish-npm-packages-publish.mts') await stagePublish( { path: '/tmp/pkg', printName: '@socketregistry/own-keys', tag: '' }, { fails: [], failures: [] }, diff --git a/test/scripts/npm/publish-npm-packages.test.mts b/test/scripts/npm/publish-npm-packages.test.mts index ba51d80cb..f34d05b8c 100644 --- a/test/scripts/npm/publish-npm-packages.test.mts +++ b/test/scripts/npm/publish-npm-packages.test.mts @@ -1,5 +1,5 @@ /** - * @file Tests for the scripts/npm/publish-npm-packages.mts lane router. The + * @file Tests for the scripts/repo/npm/publish-npm-packages.mts lane router. The * orchestrator used to carry a local upload path behind `--force`; that path * is deleted, so outside CI the only thing the script can do is DISPATCH the * workflow. These specs pin that the escape hatch is gone and that the local @@ -11,11 +11,12 @@ import path from 'node:path' import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest' -import { ROOT_PATH } from '../../../scripts/constants/paths.mts' +import { ROOT_PATH } from '../../../scripts/repo/constants/paths.mts' const ORCHESTRATOR_PATH = path.join( ROOT_PATH, 'scripts', + 'repo', 'npm', 'publish-npm-packages.mts', ) @@ -23,6 +24,7 @@ const ORCHESTRATOR_PATH = path.join( const ARGS_PATH = path.join( ROOT_PATH, 'scripts', + 'repo', 'npm', 'publish-npm-packages-args.mts', ) @@ -63,7 +65,7 @@ describe('main outside CI', () => { // The module captures ENV + cliArgs at import time, so it is imported // fresh under the stubbed environment. const { main } = - await import('../../../scripts/npm/publish-npm-packages.mts') + await import('../../../scripts/repo/npm/publish-npm-packages.mts') await expect(main()).resolves.toBe(0) }) }) diff --git a/test/scripts/npm/release-npm-packages-report.test.mts b/test/scripts/npm/release-npm-packages-report.test.mts index e28c50048..4d457243e 100644 --- a/test/scripts/npm/release-npm-packages-report.test.mts +++ b/test/scripts/npm/release-npm-packages-report.test.mts @@ -1,5 +1,5 @@ /** - * @file Tests for scripts/npm/release-npm-packages-report.mts. The release + * @file Tests for scripts/repo/npm/release-npm-packages-report.mts. The release * check used to walk every package, print nothing, and exit 0 while nine of * them sat at the npm `0.0.0` placeholder with a real version on disk. These * specs pin the two exit-1 triggers and that a placeholder is listed by name. @@ -7,12 +7,12 @@ import { describe, expect, test } from 'vitest' -import { reportReleaseState } from '../../../scripts/npm/release-npm-packages-report.mts' +import { reportReleaseState } from '../../../scripts/repo/npm/release-npm-packages-report.mts' import type { BumpState, PkgData, -} from '../../../scripts/npm/release-npm-packages.mts' +} from '../../../scripts/repo/npm/release-npm-packages.mts' function pkg(name: string, version: string): PkgData { return { diff --git a/test/scripts/npm/update-manifest.test.mts b/test/scripts/npm/update-manifest.test.mts index a17193e5f..6e4df4db8 100644 --- a/test/scripts/npm/update-manifest.test.mts +++ b/test/scripts/npm/update-manifest.test.mts @@ -1,5 +1,5 @@ /** - * @file Tests for the scripts/npm/update-manifest.mts dropped-package guard. + * @file Tests for the scripts/repo/npm/update-manifest.mts dropped-package guard. * The regeneration loop skips a package whenever its registry fetch fails, * which used to silently DROP it from the rewritten manifest β€” observed * live when @socketregistry/string.prototype.at vanished on one run and @@ -12,9 +12,9 @@ import { describe, expect, test, vi } from 'vitest' -import { diffDroppedPackages } from '../../../scripts/npm/update-manifest.mts' +import { diffDroppedPackages } from '../../../scripts/repo/npm/update-manifest.mts' -import type { ManifestEntry } from '../../../scripts/npm/update-manifest.mts' +import type { ManifestEntry } from '../../../scripts/repo/npm/update-manifest.mts' interface FakeManifest { version: string diff --git a/test/util/npm-package-helper.mts b/test/util/npm-package-helper.mts index 6d058ef32..6746bdbd0 100644 --- a/test/util/npm-package-helper.mts +++ b/test/util/npm-package-helper.mts @@ -5,7 +5,7 @@ import path from 'node:path' -import { NPM, NPM_PACKAGES_PATH } from '../../scripts/constants/paths.mts' +import { NPM, NPM_PACKAGES_PATH } from '../../scripts/repo/constants/paths.mts' import { isPackageTestingSkipped } from '../../scripts/repo/util/tests.mts' interface SetupNpmPackageTestResult {