-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* move from `ts-node` to `node --experimental-strip-types`, create `build.ts` * remove `engines` field, specify `devEngines` * adjust node version for CI * fix up some more syntax * prettier * adjust precheck, bump minimal lockfile version to 3 * convert jest config to esm * move `entryPoints` to TS, make it work in mjs and jest * run rollup with ts config * update a few more node calls * some more typings * move all scripts to function invocation * migrate `prepareChangestsRelease` too * remove scripts that are not called manually * convert `prepareDist` to TS * migrate `precheck.js` * `version.js->ts` * use jest ts config * prettier * dirname.cjs->cts * dirname-related import fixes * fix up new knip issues * delete `devEngines` instead of `engines` field * require node 23.6 instead of 22.6
- Loading branch information
Showing
51 changed files
with
56,304 additions
and
5,841 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
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 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 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 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 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,63 @@ | ||
import { $ } from "zx"; | ||
import { join } from "node:path"; | ||
import { parseArgs } from "node:util"; | ||
|
||
import { inlineInheritDoc } from "./inlineInheritDoc.ts"; | ||
import { updateVersion, verifyVersion } from "./version.ts"; | ||
import { processInvariants } from "./processInvariants.ts"; | ||
import { rewriteSourceMaps } from "./rewriteSourceMaps.ts"; | ||
import { rollup } from "./rollup.ts"; | ||
import { prepareDist } from "./prepareDist.ts"; | ||
import { postprocessDist } from "./postprocessDist.ts"; | ||
import { prepareChangesetsRelease } from "./prepareChangesetsRelease.ts"; | ||
|
||
$.cwd = join(import.meta.dirname, ".."); | ||
$.verbose = true; | ||
|
||
const buildSteps = { | ||
typescript: () => $`npx tsc`, | ||
updateVersion, | ||
inlineInheritDoc, | ||
processInvariants, | ||
rewriteSourceMaps, | ||
rollup, | ||
prepareDist, | ||
postprocessDist, | ||
verifyVersion, | ||
}; | ||
const additionalSteps = { | ||
prepareChangesetsRelease, | ||
}; | ||
|
||
const args = parseArgs({ | ||
options: { | ||
step: { | ||
type: "string", | ||
multiple: true, | ||
default: ["build"], | ||
}, | ||
}, | ||
}); | ||
|
||
const allSteps = Object.assign({}, buildSteps, additionalSteps); | ||
|
||
const runSteps = args.values.step.flatMap((step) => | ||
step === "build" ? Object.keys(buildSteps) : [step] | ||
); | ||
|
||
const wrongSteps = runSteps.filter((step) => !(step in allSteps)); | ||
if (wrongSteps.length) { | ||
throw new Error( | ||
`Unknown steps: ${wrongSteps.join(", ")}. Valid steps are ${Object.keys( | ||
allSteps | ||
).join(", ")}` | ||
); | ||
} | ||
|
||
console.log("Running build steps: %s", runSteps.join(", ")); | ||
|
||
for (const step of runSteps) { | ||
console.log("--- Step %s: running ---", step); | ||
await allSteps[step](); | ||
console.log("--- Step %s: done ---", step); | ||
} |
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,4 @@ | ||
// workaround for `entryPoints.ts` that needs access to the current directory, | ||
// but cannot use `import.meta` as the file is required by Jest, which transpiles | ||
// the file to CommonJS - ending up with "SyntaxError: Cannot use 'import.meta' outside a module" | ||
module.exports.__dirname = __dirname; |
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
Oops, something went wrong.