From bb3da10ba49a193bc778831d3d7d661e464a75b7 Mon Sep 17 00:00:00 2001 From: macrogreg Date: Wed, 10 Dec 2025 02:16:32 -0800 Subject: [PATCH 1/2] Consider public path during release builds --- .github/workflows/release.yml | 25 +++++++++++++++---------- CNAME | 1 - quasar.config.ts | 31 +++++++++++++++++++++++++++---- 3 files changed, 42 insertions(+), 15 deletions(-) delete mode 100644 CNAME diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 871d1a8..cb3c11a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,9 +54,6 @@ jobs: - name: Check formatting run: npm run format-check - - name: Build project - run: npm run build - - name: Install jq run: sudo apt-get update && sudo apt-get install -y jq @@ -68,6 +65,21 @@ jobs: run: | echo "Version: '${{ steps.version.outputs.version }}'" + - name: Build project for Current Dir + run: npm run build --qPublicBasePath=app/current/excel + + - name: Release to current dir + run: | + # Update current + rm -rf "docs/app/current/excel" + mkdir -p "docs/app/current/excel" + cp -r dist/spa/* "docs/app/current/excel/" + + - name: Build project for Version Dir + run: | + VERSION=${{ steps.version.outputs.version }} + npm run build --qPublicBasePath=app/$VERSION/excel + - name: Release to version dir run: | VERSION=${{ steps.version.outputs.version }} @@ -79,13 +91,6 @@ jobs: # Copy dist/spa to docs/app/version/excel cp -r dist/spa/* "docs/app/$VERSION/excel/" - - name: Release to current dir - run: | - # Update current - rm -rf "docs/app/current/excel" - mkdir -p "docs/app/current/excel" - cp -r dist/spa/* "docs/app/current/excel/" - - name: Commit and push changes env: PUSH_BRANCH: ${{ github.event.workflow_run.head_branch || github.ref_name }} diff --git a/CNAME b/CNAME deleted file mode 100644 index 41f6b1a..0000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -explens.app \ No newline at end of file diff --git a/quasar.config.ts b/quasar.config.ts index cf07317..2303639 100644 --- a/quasar.config.ts +++ b/quasar.config.ts @@ -2,14 +2,37 @@ // https://v2.quasar.dev/quasar-cli-vite/quasar-config-file import { defineConfig } from "#q-app/wrappers"; +import { isNullOrWhitespace } from "src/util/string_util"; import packageSpec from "./package.json"; // import checker from "vite-plugin-checker"; // import vueDevTools from "vite-plugin-vue-devtools"; -const FLAG_ENABLE_VUE_DEV_TOOLS: boolean = false; +const FLAG_ENABLE_VUE_DEV_TOOLS: boolean = false as const; -const PUBLIC_BASE_PATH: string = "/"; +function resolvePublicBasePath(): string { + let p = process.env.Q_PUBLIC_BASE_PATH; + + if (isNullOrWhitespace(p)) { + // npm exposes `npm_config_*` env vars for `npm run build -- --publicPath=/foo` + p = process.env.npm_config_qpublicbasepath; + } + + if (isNullOrWhitespace(p)) { + p = "/"; + } + + // Ensure we always have a leading slash for Vite's base path resolution + p = p && p.startsWith("/") ? p : `/${p}`; + + if (p !== "/") { + console.log(`Q_PUBLIC_BASE_PATH is '${p}'`); + } + + return p; +} + +const Q_PUBLIC_BASE_PATH: string = resolvePublicBasePath(); export default defineConfig((ctx) => { console.log("\nquasar.config.ts: defineConfig(..): QuasarContext >>", ctx, "<< QuasarContext"); @@ -70,7 +93,7 @@ export default defineConfig((ctx) => { // rebuildCache: true, // rebuilds Vite/linter/etc cache on startup - publicPath: PUBLIC_BASE_PATH, + publicPath: Q_PUBLIC_BASE_PATH, // analyze: true, env: { PACKAGE_NAME: packageSpec.name, @@ -201,7 +224,7 @@ export default defineConfig((ctx) => { // manifestFilename: 'manifest.json', extendManifestJson(json: unknown) { (json as Record).short_name = packageSpec.productName; - (json as Record).start_url = PUBLIC_BASE_PATH; + (json as Record).start_url = Q_PUBLIC_BASE_PATH; }, // useCredentialsForManifestTag: true, // injectPwaMetaTags: false, From 4b108b3a635f2678f9b84ea6d4ad6aae10fe57a9 Mon Sep 17 00:00:00 2001 From: macrogreg Date: Wed, 10 Dec 2025 02:21:21 -0800 Subject: [PATCH 2/2] Fix build error in CI --- quasar.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quasar.config.ts b/quasar.config.ts index 2303639..e71acee 100644 --- a/quasar.config.ts +++ b/quasar.config.ts @@ -2,7 +2,7 @@ // https://v2.quasar.dev/quasar-cli-vite/quasar-config-file import { defineConfig } from "#q-app/wrappers"; -import { isNullOrWhitespace } from "src/util/string_util"; +import { isNullOrWhitespace } from "./src/util/string_util"; import packageSpec from "./package.json"; // import checker from "vite-plugin-checker";