Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15,405 changes: 10,989 additions & 4,416 deletions openapi.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions scripts/check.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function runCommand(command, args = []) {
return new Promise((resolve, reject) => {
const child = spawn(command, args, {
stdio: 'inherit',
shell: process.platform === 'win32',
shell: process.platform === 'win32'
})

child.on('exit', code => {
Expand All @@ -40,7 +40,7 @@ async function main() {
'-c',
'--aggregate-output',
'check:lint',
'check:tsc',
'check:tsc'
])

process.exitCode = exitCode
Expand Down
18 changes: 14 additions & 4 deletions scripts/lint.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function parseArgs() {
all: args.includes('--all'),
help: args.includes('--help') || args.includes('-h'),
// Get remaining positional arguments (file paths)
files: args.filter(arg => !arg.startsWith('--') && !arg.startsWith('-')),
files: args.filter(arg => !arg.startsWith('--') && !arg.startsWith('-'))
}
}

Expand All @@ -33,7 +33,7 @@ function runCommand(command, args = []) {
return new Promise((resolve, reject) => {
const child = spawn(command, args, {
stdio: 'inherit',
shell: process.platform === 'win32',
shell: process.platform === 'win32'
})

child.on('exit', code => {
Expand Down Expand Up @@ -76,7 +76,7 @@ async function main() {
'oxlint',
'-c=.oxlintrc.json',
'--ignore-path=.oxlintignore',
'--tsconfig=tsconfig.json',
'--tsconfig=tsconfig.json'
]

// Add fix flag if requested
Expand All @@ -101,7 +101,17 @@ async function main() {
const useEnvFile = existsSync('.env.local')
let exitCode
if (useEnvFile) {
exitCode = await runCommand('pnpm', ['exec', 'dotenvx', '-q', 'run', '-f', '.env.local', '--', 'pnpm', ...oxlintArgs])
exitCode = await runCommand('pnpm', [
'exec',
'dotenvx',
'-q',
'run',
'-f',
'.env.local',
'--',
'pnpm',
...oxlintArgs
])
} else {
exitCode = await runCommand('pnpm', oxlintArgs)
}
Expand Down
33 changes: 21 additions & 12 deletions scripts/publish.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function runCommand(command, args = [], options = {}) {
const child = spawn(command, args, {
stdio: 'inherit',
shell: process.platform === 'win32',
...options,
...options
})

child.on('exit', code => {
Expand All @@ -35,31 +35,32 @@ async function main() {
options: {
help: {
type: 'boolean',
default: false,
default: false
},
'dry-run': {
type: 'boolean',
default: false,
default: false
},
'skip-checks': {
type: 'boolean',
default: false,
default: false
},
'skip-build': {
type: 'boolean',
default: false,
default: false
},
tag: {
type: 'string',
default: process.env.DIST_TAG || process.env.NPM_CONFIG_TAG || 'latest',
default:
process.env.DIST_TAG || process.env.NPM_CONFIG_TAG || 'latest'
},
access: {
type: 'string',
default: 'public',
},
default: 'public'
}
},
allowPositionals: false,
strict: false,
strict: false
})

if (values.help) {
Expand All @@ -69,7 +70,9 @@ async function main() {
console.log(' --dry-run Perform a dry-run without publishing')
console.log(' --skip-checks Skip pre-publish checks')
console.log(' --skip-build Skip build step (not allowed in CI)')
console.log(' --tag <tag> npm dist-tag (default: $DIST_TAG or "latest")')
console.log(
' --tag <tag> npm dist-tag (default: $DIST_TAG or "latest")'
)
console.log(' --access <level> Package access level (default: public)')
console.log('\nEnvironment Variables:')
console.log(' DIST_TAG Default npm dist-tag to use')
Expand Down Expand Up @@ -121,7 +124,13 @@ async function main() {
}

// Prepare publish args
const publishArgs = ['publish', '--access', values.access, '--tag', values.tag]
const publishArgs = [
'publish',
'--access',
values.access,
'--tag',
values.tag
]

// Add provenance by default (works with trusted publishers in CI)
if (!values['dry-run']) {
Expand All @@ -136,7 +145,7 @@ async function main() {
console.log(
values['dry-run']
? 'Running dry-run publish...'
: `Publishing to npm with tag "${values.tag}"...`,
: `Publishing to npm with tag "${values.tag}"...`
)
const publishCode = await runCommand('npm', publishArgs)

Expand Down
48 changes: 40 additions & 8 deletions scripts/test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,15 @@ function parseArgs() {
// Get remaining arguments to pass to vitest
extra: args.filter(
arg =>
!['--all', '--update', '--coverage', '--cover', '--help', '-h'].includes(
arg,
),
),
![
'--all',
'--update',
'--coverage',
'--cover',
'--help',
'-h'
].includes(arg)
)
}
}

Expand All @@ -40,7 +45,7 @@ function runCommand(command, args = []) {
return new Promise((resolve, reject) => {
const child = spawn(command, args, {
stdio: 'inherit',
shell: process.platform === 'win32',
shell: process.platform === 'win32'
})

child.on('exit', code => {
Expand Down Expand Up @@ -82,7 +87,13 @@ async function main() {

// Step 1: Run checks
console.log('Running checks...')
let exitCode = await runCommand('pnpm', ['exec', 'run-p', '-c', '--aggregate-output', 'check:*'])
let exitCode = await runCommand('pnpm', [
'exec',
'run-p',
'-c',
'--aggregate-output',
'check:*'
])
if (exitCode !== 0) {
console.error('Checks failed')
process.exitCode = exitCode
Expand All @@ -92,7 +103,18 @@ async function main() {
// Step 2: Run test:prepare (build)
console.log('\nPreparing tests (building)...')
if (useEnvFile) {
exitCode = await runCommand('pnpm', ['exec', 'dotenvx', '-q', 'run', '-f', '.env.test', '--', 'pnpm', 'run', 'build'])
exitCode = await runCommand('pnpm', [
'exec',
'dotenvx',
'-q',
'run',
'-f',
'.env.test',
'--',
'pnpm',
'run',
'build'
])
} else {
exitCode = await runCommand('pnpm', ['run', 'build'])
}
Expand Down Expand Up @@ -122,7 +144,17 @@ async function main() {
}

if (useEnvFile) {
exitCode = await runCommand('pnpm', ['exec', 'dotenvx', '-q', 'run', '-f', '.env.test', '--', 'pnpm', ...vitestArgs])
exitCode = await runCommand('pnpm', [
'exec',
'dotenvx',
'-q',
'run',
'-f',
'.env.test',
'--',
'pnpm',
...vitestArgs
])
} else {
exitCode = await runCommand('pnpm', vitestArgs)
}
Expand Down
Loading