-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(http-codex): Switch from esbuild to tsc
- Loading branch information
Showing
28 changed files
with
533 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@repo/typescript-config': minor | ||
--- | ||
|
||
Add lib-emit.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@repo/tools': patch | ||
--- | ||
|
||
Add / improve scripts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'http-codex': minor | ||
--- | ||
|
||
chore: Switch from esbuild to tsc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export type { HttpStatusCodeName, HttpStatusCode } from './status' | ||
export type { HttpStatusCodeName, HttpStatusCode } from './status.js' | ||
|
||
export { isNullBodyStatus } from './status' | ||
export { httpStatus } from './combined' | ||
export { isNullBodyStatus } from './status.js' | ||
export { httpStatus } from './combined.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"extends": "@repo/typescript-config/workers-lib.json", | ||
"extends": "@repo/typescript-config/lib-emit.json", | ||
"include": ["**/*.ts"], | ||
"exclude": ["node_modules", "dist", "tsconfig.json"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
import { Command } from '@commander-js/extra-typings' | ||
import Table from 'cli-table3' | ||
|
||
import { getRepoRoot } from '../path' | ||
import { getOutcome } from '../proc' | ||
|
||
export const checkCmd = new Command('check') | ||
.description( | ||
'Check for issues with deps/lint/types/format. If no options are provided, all default checks are run.' | ||
) | ||
|
||
.option('-r, --root', 'Run checks from root of repo. Defaults to cwd', false) | ||
|
||
// Default checks | ||
.option('-d, --deps', 'Check for dependency issues with Syncpack') | ||
.option('-l, --lint', 'Check for eslint issues') | ||
.option('-t, --types', 'Check for TypeScript issues') | ||
.option('-f, --format', 'Check for formatting issues with prettier') | ||
|
||
// Non-default checks | ||
.option('-e, --exports', 'Checks package exports') | ||
|
||
.action(async ({ root, deps, lint, types, format, exports }) => { | ||
const repoRoot = getRepoRoot() | ||
if (root) { | ||
cd(repoRoot) | ||
} | ||
// Run all default checks if none are selected | ||
if (!deps && !lint && !types && !format && !exports) { | ||
deps = true | ||
lint = true | ||
types = true | ||
format = true | ||
} | ||
|
||
const cwd = process.cwd() | ||
const runFromRoot = cwd === repoRoot | ||
const cwdName = path.basename(cwd) | ||
|
||
const checks = { | ||
deps: ['syncpack', 'lint'], | ||
lint: ['turbo', 'check:lint'], | ||
format: ['runx', 'prettier', 'check'], | ||
types: ['turbo', 'check:types'], | ||
exports: ['attw', '--pack', '.', '--profile=esm-only'], | ||
} as const satisfies { [key: string]: string[] } | ||
|
||
type TableRow = [string, string, string, string] | ||
const table = new Table({ | ||
head: [ | ||
chalk.whiteBright('Name'), | ||
chalk.whiteBright('Command'), | ||
chalk.whiteBright('Outcome'), | ||
chalk.whiteBright('Ran From'), | ||
] satisfies TableRow, | ||
}) | ||
|
||
$.stdio = 'inherit' | ||
$.verbose = true | ||
$.nothrow = true | ||
|
||
if (deps) { | ||
await within(async () => { | ||
cd(repoRoot) // Must be run from root | ||
const exitCode = await $`${checks.deps}`.exitCode | ||
table.push(['deps', `${checks.deps}`, getOutcome(exitCode), 'Root'] satisfies TableRow) | ||
}) | ||
} | ||
|
||
if (lint) { | ||
const exitCode = await $`${checks.lint}`.exitCode | ||
table.push([ | ||
'lint', | ||
checks.lint.join(' '), | ||
getOutcome(exitCode), | ||
runFromRoot ? 'Root' : `cwd (${cwdName})`, | ||
] satisfies TableRow) | ||
} | ||
|
||
if (types) { | ||
const exitCode = await $`${checks.types}`.exitCode | ||
table.push([ | ||
'types', | ||
checks.types.join(' '), | ||
getOutcome(exitCode), | ||
runFromRoot ? 'Root' : `cwd (${cwdName})`, | ||
] satisfies TableRow) | ||
} | ||
|
||
if (format) { | ||
await within(async () => { | ||
cd(repoRoot) // Must be run from root | ||
const exitCode = await $`${checks.format}`.exitCode | ||
table.push([ | ||
'format', | ||
checks.format.join(' '), | ||
getOutcome(exitCode), | ||
'Root', | ||
] satisfies TableRow) | ||
}) | ||
} | ||
|
||
if (exports) { | ||
await within(async () => { | ||
const exitCode = await $`${checks.exports}`.exitCode | ||
table.push([ | ||
'exports', | ||
checks.exports.join(' '), | ||
getOutcome(exitCode), | ||
'Root', | ||
] satisfies TableRow) | ||
}) | ||
} | ||
|
||
echo(table.toString()) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.