diff --git a/.prettierignore b/.prettierignore index 4bc707f97e0b..76797182438f 100644 --- a/.prettierignore +++ b/.prettierignore @@ -25,6 +25,7 @@ /ui/puz/**/*.d.ts *.min.js +readme /.bloop/ /.bsp/ diff --git a/ui/.build/readme b/ui/.build/readme index 018728558941..15b85e5aebb7 100644 --- a/ui/.build/readme +++ b/ui/.build/readme @@ -1,30 +1,34 @@ ui/build was lovingly crafted from a single block of wood as a personal gift to you. -one letter options can be consolidated after a single dash (e.g. -cdw) + ./build # modules are top level directories in ui + one letter options can be consolidated after a single dash (e.g. -cdw) + ui/build can be run from anywhere, does not care about cwd Options: --c, --clean clean build artifacts, build only if additional args provided --d, --debug build assets with lichess.debug = true --p, --prod build minified assets (prod builds) --w, --watch build, watch for changes, but terminate on package.json changes --r, --rebuild build, watch, and rebuild on package.json changes ---no-install don't run pnpm install (--no-install is not compatible with --rebuild) ---no-color don't use color in logs ---no-time don't log the time ---no-context don't log the context ---tsc run tsc # specify any of [--tsc, --sass, --esbuild, --copies] to disable the others ---sass run sass ---esbuild run esbuild ---copies run copies + -c, --clean clean build artifacts, build only if additional args provided + -d, --debug build assets with lichess.debug = true + -p, --prod build minified assets (prod builds) + -w, --watch build, watch for changes, but terminate on package.json changes + -r, --rebuild build, watch, and rebuild on package.json changes + -n, --no-install don't run pnpm install (--no-install is incompatible with --rebuild) + --no-color don't use color in logs + --no-time don't log the time + --no-context don't log the context + --update rebuild ui/build (not performed in normal builds, not even clean ones) + --tsc run tsc, any of [--tsc, --sass, --esbuild, --copies] will disable the others + --sass run sass + --esbuild run esbuild + --copies run copies -Usage examples: - -./build -c # clean build artifacts, exit without building -./build -d # build client sssets with lichess.debug = true -./build -wp # build minified, watch for changes, terminate if package.json changes -./build -cdp # clean, build minified assets with lichess.debug = true -./build -rc # clean, build, watch, and clean & rebuild again on package.json changes -./build analyse site msg # build modules analyse, site, and msg (don't build everything) -./build -w dasher chart # watch mode for modules dasher and chart -./build --tsc -w # watch mode but type checking only -./build --sass msg notify # build css only for msg and notify modules +Examples: + ./build -c # clean build artifacts, exit without building + ./build -d # build client sssets with lichess.debug = true + ./build -wn # build, watch for changes, no pnpm install + ./build -r # build, watch, and rebuild on package.json change + ./build -rd # build, watch, rebuild on package.json change, lichess.debug = true + ./build -cp # clean, build minified + ./build -rc # clean, build, watch, and clean rebuild on package.json change + ./build analyse site msg # build analyse, site, and msg modules (as opposed to everything) + ./build -w dasher chart # watch mode for dasher and chart modules + ./build --tsc -w # watch mode but type checking only + ./build --sass msg notify # build css only for msg and notify modules diff --git a/ui/.build/src/main.ts b/ui/.build/src/main.ts index d94e20d1450d..487607b11565 100644 --- a/ui/.build/src/main.ts +++ b/ui/.build/src/main.ts @@ -4,7 +4,7 @@ import * as fs from 'node:fs'; import { clean } from './clean'; import { build, postBuild } from './build'; -const shortArgs = 'hrwpsdc'; +const shortArgs = 'hrwpsdcn'; const longArgs = [ '--tsc', '--sass', @@ -49,7 +49,7 @@ export function main() { env.split = args.includes('--split') || oneDashArgs.includes('s'); env.debug = args.includes('--debug') || oneDashArgs.includes('d'); env.clean = args.includes('--clean') || oneDashArgs.includes('c'); - env.install = !args.includes('--no-install'); + env.install = !args.includes('--no-install') && !oneDashArgs.includes('n'); if (env.rebuild && !env.install) { env.warn(`--rebuild incompatible with --no-install`);