Skip to content

Commit

Permalink
Merge pull request #14036 from schlawg/prettier-ignore-readme
Browse files Browse the repository at this point in the history
add -n alias for --no-install, prettierignore readme
  • Loading branch information
schlawg committed Nov 18, 2023
2 parents 8a63983 + 07c7d54 commit 4f8f373
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 27 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
/ui/puz/**/*.d.ts

*.min.js
readme

/.bloop/
/.bsp/
Expand Down
54 changes: 29 additions & 25 deletions ui/.build/readme
Original file line number Diff line number Diff line change
@@ -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 <options> <modules> # 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
4 changes: 2 additions & 2 deletions ui/.build/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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`);
Expand Down

0 comments on commit 4f8f373

Please sign in to comment.