Move building of overrides into new task 'build:all'

This commit is contained in:
squidfunk 2022-04-09 23:23:13 +02:00
parent e1546745db
commit 5ddeafbf4e
4 changed files with 18 additions and 9 deletions

View File

@ -66,12 +66,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v1
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:

View File

@ -25,6 +25,7 @@
},
"scripts": {
"build": "rimraf material && ts-node -T tools/build --optimize",
"build:all": "rimraf material && ts-node -T tools/build --all --optimize",
"build:dirty": "ts-node -T tools/build --dirty",
"clean": "rimraf material",
"check": "run-p check:*",

View File

@ -25,6 +25,8 @@ import * as fs from "fs/promises"
import {
EMPTY,
Observable,
concatAll,
filter,
from,
fromEvent,
identity,
@ -33,7 +35,6 @@ import {
map,
mergeWith,
of,
switchMap,
tap
} from "rxjs"
import glob from "tiny-glob"
@ -108,7 +109,14 @@ export function resolve(
return from(glob(pattern, options))
.pipe(
catchError(() => EMPTY),
switchMap(files => files),
concatAll(),
/* Build overrides */
!process.argv.includes("--all")
? filter(file => !file.startsWith("overrides/"))
: identity,
/* Start file watcher */
options?.watch
? mergeWith(watch(pattern, options))
: identity

View File

@ -342,6 +342,12 @@ const schema$ = merge(
)
)
/* Build overrides */
const overrides$ =
process.argv.includes("--all")
? merge(index$, schema$)
: EMPTY
/* ----------------------------------------------------------------------------
* Program
* ------------------------------------------------------------------------- */
@ -350,7 +356,7 @@ const schema$ = merge(
const build$ =
process.argv.includes("--dirty")
? merge(templates$, sources$)
: concat(assets$, merge(templates$, sources$, index$, schema$))
: concat(assets$, merge(templates$, sources$, overrides$))
/* Let's get rolling */
build$.subscribe()