Skip to content

Commit 6728654

Browse files
committed
Update _app\version.json with version of template
1 parent 8ea53c7 commit 6728654

4 files changed

Lines changed: 23 additions & 4 deletions

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,11 @@ npm run sandbox
7474
```
7575

7676
Open a browser to http://localhost:2468/graphql to query the Scripture data using GraphQL.
77+
78+
### Release
79+
80+
The version of the PWA can be read from the property `version` from the file `_app/version.json`.AppBuilders includes the latest tagged version of the repo. Before making a new release with the AppBuilders, do the following:
81+
82+
- update the version in package.json with the version of the AppBuilders
83+
- merge into main
84+
- tag main with "v{version}"

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "appbuilder-pwa",
3-
"version": "0.0.1",
3+
"version": "13.3.2",
44
"type": "module",
55
"scripts": {
66
"dev": "concurrently --restart-tries -1 --restart-after 10 -t HH:mm:ss -p \"[{time} {name}]\" -n Converter,Svelte \"ts-node convert/index.ts --watch\" \"vite dev --host\"",
@@ -21,7 +21,9 @@
2121
"clean:data": "rimraf --glob data/*",
2222
"clean:all": "npm run clean && npm run clean:data",
2323
"test": "vitest",
24-
"test:ui": "vitest --ui"
24+
"test:ui": "vitest --ui",
25+
"release": "./release.sh",
26+
"release:help": "echo 'Usage: npm run release <version> (e.g., npm run release 1.0.0)'"
2527
},
2628
"devDependencies": {
2729
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",

svelte.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
import { readFileSync } from 'fs';
12
import adapter from '@sveltejs/adapter-static';
23
import { sveltePreprocess } from 'svelte-preprocess';
34

5+
// Read template version from package.json
6+
const packageJson = JSON.parse(readFileSync('package.json', 'utf-8'));
7+
const templateVersion = packageJson.version;
8+
const buildTimestamp = Date.now();
9+
410
/** @type {import('@sveltejs/kit').Config} */
511
const config = {
612
// Consult https://github.com/sveltejs/svelte-preprocess
@@ -23,6 +29,9 @@ const config = {
2329
},
2430
router: {
2531
type: 'hash'
32+
},
33+
version: {
34+
name: `${templateVersion}-${buildTimestamp}`
2635
}
2736
}
2837
};

0 commit comments

Comments
 (0)