Skip to content

Commit 84a507c

Browse files
committed
fix(scripts): correct paths after script reorganization
- Fix build-externals.mjs reference to externals.mjs - Fix fix-build.mjs reference to fix/main.mjs - Fix build-externals and config import paths - Fix rootPath calculations in all validation scripts - Fix distDir paths in dist-exports and esm-named-exports - Fix registryPkgPath in generate-package-exports - Update no-cdn-refs to skip itself with new filename
1 parent 4885f41 commit 84a507c

13 files changed

+18
-15
lines changed

scripts/build/externals.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { isQuiet } from '#socketsecurity/lib/argv/flags'
1111
import { getDefaultLogger } from '#socketsecurity/lib/logger'
1212
import { pluralize } from '#socketsecurity/lib/words'
1313

14-
import { buildExternals } from './build-externals/orchestrator.mjs'
14+
import { buildExternals } from '../build-externals/orchestrator.mjs'
1515

1616
const logger = getDefaultLogger()
1717
const printCompletedHeader = title => console.log(colors.green(`✓ ${title}`))

scripts/build/main.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ async function buildTypes(options = {}) {
121121
async function buildExternals(options = {}) {
122122
const { quiet = false, verbose = false } = options
123123

124-
const args = ['scripts/build/build-externals.mjs']
124+
const args = ['scripts/build/externals.mjs']
125125
if (quiet) {
126126
args.push('--quiet')
127127
}
@@ -152,7 +152,7 @@ async function buildExternals(options = {}) {
152152
async function fixExports(options = {}) {
153153
const { quiet = false, verbose = false } = options
154154

155-
const fixArgs = ['scripts/fix/build.mjs']
155+
const fixArgs = ['scripts/fix/main.mjs']
156156
if (quiet) {
157157
fixArgs.push('--quiet')
158158
}

scripts/fix/external-imports.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import colors from 'yoctocolors-cjs'
1212
import { isQuiet } from '#socketsecurity/lib/argv/flags'
1313
import { getDefaultLogger } from '#socketsecurity/lib/logger'
1414

15-
import { externalPackages, scopedPackages } from './build-externals/config.mjs'
15+
import { externalPackages, scopedPackages } from '../build-externals/config.mjs'
1616

1717
const logger = getDefaultLogger()
1818
const printCompletedHeader = title => console.log(colors.green(`✓ ${title}`))

scripts/fix/generate-package-exports.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url))
2424
const constants = {
2525
EXT_DTS: '.d.ts',
2626
EXT_JSON: '.json',
27-
registryPkgPath: path.join(__dirname, '..'),
27+
registryPkgPath: path.join(__dirname, '..', '..'),
2828
ignoreGlobs: [
2929
'**/node_modules/**',
3030
'**/.git/**',

scripts/validate/dist-exports.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { normalizePath } from '#socketsecurity/lib/paths'
1515
import { pluralize } from '#socketsecurity/lib/words'
1616

1717
const __dirname = path.dirname(fileURLToPath(import.meta.url))
18-
const distDir = path.resolve(__dirname, '..', 'dist')
18+
const distDir = path.resolve(__dirname, '..', '..', 'dist')
1919
const require = createRequire(import.meta.url)
2020

2121
/**

scripts/validate/esbuild-minify.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import path from 'node:path'
77
import { fileURLToPath } from 'node:url'
88

99
const __dirname = path.dirname(fileURLToPath(import.meta.url))
10-
const rootPath = path.join(__dirname, '..')
10+
const rootPath = path.join(__dirname, '..', '..')
1111

1212
/**
1313
* Validate esbuild configuration has minify: false.

scripts/validate/esm-named-exports.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { fileURLToPath } from 'node:url'
1212
import colors from 'yoctocolors-cjs'
1313

1414
const __dirname = path.dirname(fileURLToPath(import.meta.url))
15-
const distDir = path.resolve(__dirname, '..', 'dist')
15+
const distDir = path.resolve(__dirname, '..', '..', 'dist')
1616
const require = createRequire(import.meta.url)
1717

1818
// Import CommonJS modules

scripts/validate/file-count.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const logger = getDefaultLogger()
1818
const execAsync = promisify(exec)
1919

2020
const __dirname = path.dirname(fileURLToPath(import.meta.url))
21-
const rootPath = path.join(__dirname, '..')
21+
const rootPath = path.join(__dirname, '..', '..')
2222

2323
// Maximum number of files in a single commit
2424
const MAX_FILES_PER_COMMIT = 50

scripts/validate/file-size.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { getDefaultLogger } from '#socketsecurity/lib/logger'
1515
const logger = getDefaultLogger()
1616

1717
const __dirname = path.dirname(fileURLToPath(import.meta.url))
18-
const rootPath = path.join(__dirname, '..')
18+
const rootPath = path.join(__dirname, '..', '..')
1919

2020
// Maximum file size: 2MB (2,097,152 bytes)
2121
const MAX_FILE_SIZE = 2 * 1024 * 1024

scripts/validate/markdown-filenames.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { getDefaultLogger } from '#socketsecurity/lib/logger'
2424
const logger = getDefaultLogger()
2525

2626
const __dirname = path.dirname(fileURLToPath(import.meta.url))
27-
const rootPath = path.join(__dirname, '..')
27+
const rootPath = path.join(__dirname, '..', '..')
2828

2929
// Allowed SCREAMING_CASE markdown files (without .md extension for comparison)
3030
const ALLOWED_SCREAMING_CASE = new Set([

0 commit comments

Comments
 (0)