qcobjectsnewapp 2.5.13-ts → 2.5.14-ts
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qcobjectsnewapp",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.14-ts",
|
|
4
4
|
"description": "App template for New App in QCObjects",
|
|
5
5
|
"targets": {
|
|
6
6
|
"default": {
|
|
@@ -52,13 +52,14 @@
|
|
|
52
52
|
"minify:css": "(npx esbuild build/css/*.css build/css/**/*.css --outdir=public/css --keep-names --minify --global-name=global --sourcemap --loader:.svg=file --target=es2021)",
|
|
53
53
|
"build:docker": "docker build -t qcobjects/qcobjects-newapp:latest .",
|
|
54
54
|
"build:docker-compose": "docker-compose -f docker-compose.yml build --no-cache --force-rm --pull -q qcobjects",
|
|
55
|
-
"build:static": "npx qcobjects-cli publish:static src/ build/ --exclude js --exclude=.DS_Store",
|
|
56
|
-
"clean:
|
|
55
|
+
"build:static": "node scripts/clean-stale-templates.js build/templates && npx qcobjects-cli publish:static src/ build/ --exclude js --exclude=.DS_Store",
|
|
56
|
+
"clean:stale-templates": "node scripts/clean-stale-templates.js",
|
|
57
|
+
"clean:appledouble": "node -e \"const fs=require('fs'),path=require('path');let n=0;for(const d of ['build','src','public'])if(fs.existsSync(d)){const walk=x=>fs.readdirSync(x,{withFileTypes:true}).flatMap(e=>{const p=path.join(x,e.name);return e.isDirectory()?walk(p):[p]});for(const f of walk(d))if(path.basename(f).startsWith('._')){fs.rmSync(f);n++;}}console.log('appledouble removed:',n)\"",
|
|
57
58
|
"build:ts": "npm test && qcobjects build:typescript tsconfig.json",
|
|
58
59
|
"build:ts-types": "qcobjects build:typescript tsconfig.d.json",
|
|
59
60
|
"build:netlify": "npm run publish:web",
|
|
60
61
|
"build": "npm run publish:web",
|
|
61
|
-
"publish:static": "npm run clean:appledouble && (npx qcobjects-cli publish:static build/ public/ --exclude js --exclude=.DS_Store) && npm run minify:css",
|
|
62
|
+
"publish:static": "npm run clean:appledouble && npm run clean:stale-templates public/templates && (npx qcobjects-cli publish:static build/ public/ --exclude js --exclude=.DS_Store) && npm run minify:css",
|
|
62
63
|
"postpublish:static": "npm run clean:appledouble",
|
|
63
64
|
"publish:ios": "qcobjects publish ios",
|
|
64
65
|
"publish:android": "qcobjects publish android",
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/*
|
|
3
|
+
publish:static copies build/ into public/ but never deletes, so a template that
|
|
4
|
+
was renamed or removed from src/ survives in build/ and is republished on every
|
|
5
|
+
subsequent build. Renaming card-image.svg through placeholder.svg and
|
|
6
|
+
svg-component.svg left both names in public/templates/components/ forever.
|
|
7
|
+
|
|
8
|
+
Usage: node scripts/clean-stale-templates.js <dir> [<dir> ...]
|
|
9
|
+
|
|
10
|
+
Pass the DESTINATION of the copy that is about to run, never its source:
|
|
11
|
+
build:static src/ -> build/ clean build/templates
|
|
12
|
+
publish:static build/ -> public/ clean public/templates
|
|
13
|
+
|
|
14
|
+
Cleaning a source instead would delete the files the copy is meant to publish,
|
|
15
|
+
and the build would silently ship no templates at all.
|
|
16
|
+
*/
|
|
17
|
+
const fs = require('node:fs');
|
|
18
|
+
|
|
19
|
+
const targets = process.argv.slice(2);
|
|
20
|
+
|
|
21
|
+
if (targets.length === 0) {
|
|
22
|
+
console.error('usage: node scripts/clean-stale-templates.js <dir> [<dir> ...]');
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let removed = 0;
|
|
27
|
+
|
|
28
|
+
for (const target of targets) {
|
|
29
|
+
if (!fs.existsSync(target)) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
fs.rmSync(target, { recursive: true, force: true });
|
|
33
|
+
removed += 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
console.log('stale template dirs removed:', removed);
|