mirror of
https://github.com/smogon/sprites.git
synced 2026-09-15 05:26:26 -05:00
Rename the deploy modules to *.build.ts
They are the buildFiles the upcoming deploy config points at; "deploy" now belongs to the config entries that ship their outputs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -50,7 +50,7 @@ $ brew install imagemagick gifsicle advancecomp optipng pngquant webp
|
||||
|
||||
Install dependencies once with `pnpm install`.
|
||||
|
||||
Each deploy is a root `*.deploy.ts` module: it declares its build rules
|
||||
Each deploy is a root `*.build.ts` module: it declares its build rules
|
||||
(shared sets are plain functions in `rules/`; declaring an identical rule
|
||||
twice is a no-op returning the existing artifacts, so any number of deploys
|
||||
can call the same set) and a `finish` function that maps the built artifacts
|
||||
@@ -62,9 +62,9 @@ reuses the build's digests. All state lives in `.build/`.
|
||||
|
||||
```
|
||||
$ pnpm build # build every deploy's rules, GC stale state
|
||||
$ pnpm deploy # assets.deploy.ts -> tar -> DEPLOY_COMMAND (.env)
|
||||
$ node tools/deploy/index.ts build ps.deploy.ts # build one deploy's rules
|
||||
$ node tools/deploy/index.ts run smogon.deploy.ts -o deploy/smogon
|
||||
$ pnpm deploy # assets.build.ts -> tar -> DEPLOY_COMMAND (.env)
|
||||
$ node tools/deploy/index.ts build ps.build.ts # build one deploy's rules
|
||||
$ node tools/deploy/index.ts run smogon.build.ts -o deploy/smogon
|
||||
$ node tools/deploy/index.ts inspect src/minisprites/items/i1.png -o /tmp/out
|
||||
```
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "node tools/deploy/index.ts build",
|
||||
"deploy": "node tools/deploy/index.ts deploy assets.deploy.ts",
|
||||
"deploy": "node tools/deploy/index.ts deploy assets.build.ts",
|
||||
"check": "tsc --build tsconfig-workspace.json"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -45,9 +45,9 @@ function common(cmd : ReturnType<typeof program.command>) : ReturnType<typeof pr
|
||||
}
|
||||
|
||||
function discoverDeployFiles() : string[] {
|
||||
const files = fs.readdirSync('.').filter(f => f.endsWith('.deploy.ts')).sort();
|
||||
const files = fs.readdirSync('.').filter(f => f.endsWith('.build.ts')).sort();
|
||||
if (files.length === 0) {
|
||||
throw new BuildError('No *.deploy.ts files at the repo root');
|
||||
throw new BuildError('No *.build.ts files at the repo root');
|
||||
}
|
||||
return files;
|
||||
}
|
||||
@@ -163,7 +163,7 @@ function waitExit(child : ChildProcess) : Promise<number | null> {
|
||||
}
|
||||
|
||||
common(program.command('build [files...]'))
|
||||
.description('build the rules of the given deploys (default: all *.deploy.ts)')
|
||||
.description('build the rules of the given deploys (default: all *.build.ts)')
|
||||
.action(async (files : string[], opts : CommonOpts) => {
|
||||
setConfig(loadConfig(opts.config));
|
||||
// GC needs the full rule universe: only an unfiltered union build
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig-base",
|
||||
"include": ["*.deploy.ts", "rules/*.ts"],
|
||||
"include": ["*.build.ts", "rules/*.ts"],
|
||||
"references": [
|
||||
{"path": "tools/build"},
|
||||
{"path": "tools/deploy"},
|
||||
|
||||
@@ -5,6 +5,6 @@ set -ex
|
||||
cd ~/smogon/sprites
|
||||
|
||||
rm -rf deploy/smogon
|
||||
node tools/deploy/index.ts run smogon.deploy.ts -o deploy/smogon
|
||||
node tools/deploy/index.ts run smogon.build.ts -o deploy/smogon
|
||||
|
||||
rsync -a deploy/smogon/xyicons/ smogon:/smog2/sprites/xyicons
|
||||
|
||||
Reference in New Issue
Block a user