From 5ddeafbf4e3c140b1e56f28f36cadc3803f34197 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Sat, 9 Apr 2022 23:23:13 +0200 Subject: [PATCH] Move building of overrides into new task 'build:all' --- .github/workflows/publish.yml | 6 ------ package.json | 1 + tools/build/_/index.ts | 12 ++++++++++-- tools/build/index.ts | 8 +++++++- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cafb9cd17..7a63d7054 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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: diff --git a/package.json b/package.json index 0d64d9969..343a4624f 100644 --- a/package.json +++ b/package.json @@ -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:*", diff --git a/tools/build/_/index.ts b/tools/build/_/index.ts index 3423d976a..5584d7abe 100644 --- a/tools/build/_/index.ts +++ b/tools/build/_/index.ts @@ -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 diff --git a/tools/build/index.ts b/tools/build/index.ts index 41a683b8d..adca1b705 100644 --- a/tools/build/index.ts +++ b/tools/build/index.ts @@ -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()