-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
code cleanup, improve readme, modify lint-staged to avoid passing sym…
…links to prettier
- Loading branch information
Showing
11 changed files
with
57 additions
and
49 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,19 @@ | ||
import { lstat } from 'fs/promises'; | ||
|
||
async function filterSymlinks(files) { | ||
const checks = await Promise.all( | ||
files.map(async file => | ||
lstat(file) | ||
.then(s => s && !s.isSymbolicLink() && file) | ||
.catch(() => null), | ||
), | ||
); | ||
return checks.filter(Boolean); | ||
} | ||
|
||
export default { | ||
'*.{json,scss,ts}': async files => { | ||
const regularFiles = await filterSymlinks(files); | ||
return regularFiles.length ? `prettier --write ${regularFiles.join(' ')}` : 'true'; | ||
}, | ||
}; |
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,36 +1,39 @@ | ||
ui/build was lovingly crafted from a single block of wood as a personal gift to you. | ||
Usage: | ||
ui/build <options> <packages> # <packages> are top level directories in ui | ||
# if no packages are specified, all will be processed | ||
# multiple short options can be preceded by a single dash | ||
|
||
./build <options> <packages> # packages are top level directories in ui | ||
one letter options can be consolidated after a single dash (e.g. -cdw) | ||
if no packages are specified, all will be processed | ||
Recommended: | ||
ui/build -cdw # clean, build debug, and watch for changes with clean rebuilds | ||
|
||
Options: | ||
-h, --help show this help and exit | ||
-w, --watch build and watch for changes | ||
-c, --clean-build build fresh artifacts | ||
-c, --clean-build clean all non-i18n build artifacts and build fresh | ||
-p, --prod build minified assets (prod builds) | ||
-n, --no-install don't run pnpm install | ||
-d, --debug build assets with site.debug = true | ||
-l, --log=<url> monkey patch console log functions in javascript manifest to POST log messages to | ||
<url> or localhost:8666 (default). if used with --watch, the ui/build process | ||
will listen for http on 8666 and display received json as 'web' in build logs | ||
--clean clean all build artifacts, including translation/js, and exit | ||
--update update ui/build's node_modules | ||
--update update ui/.build/node_modules with pnpm install | ||
--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, any of [--tsc, --sass, --esbuild, --copies] will disable the others | ||
|
||
Exclusive Options: (any of these will disable other functions) | ||
--clean clean all build artifacts, including i18n/translation, and exit | ||
--tsc run tsc on {package}/tsconfig.json and dependencies | ||
--sass run sass on {package}/css/build/*.scss and dependencies | ||
--esbuild run esbuild (given in {package}/package.json/lichess/bundles array) | ||
--copies run copies (given in {package}/package.json/lichess/sync objects) | ||
--sync run sync copies (given in {package}/package.json/lichess/sync objects) | ||
--i18n build @types/lichess/i18n.d.ts and translation/js files | ||
|
||
Examples: | ||
./build -w # build and watch for changes <- this is the most common use case | ||
./build -wc # clean build, watch <- recommended for maintainers | ||
./build -w --log=/path # build, watch, and patch js console POST to ${location.origin}/path. | ||
# ui/build listens on 8666, displays received json as 'web' over stdout | ||
./build -np # no pnpm install, build minified | ||
./build analyse site msg # build analyse, site, and msg packages (as opposed to everything) | ||
./build -w dasher chart # watch mode for dasher and chart packages | ||
./build --tsc -w # watch mode but type checking only | ||
./build --sass msg notify # build css only for msg and notify packages | ||
./build -w -l=/path # build, watch, and patch js console with POST to ${location.origin}/path. | ||
# ui/build listens on 8666, displays received json as 'web' over stdout |
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 @@ | ||
../../common/src/algo.ts |
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