Skip to content

Commit d4fa563

Browse files
authored
Update _app\version.json with version of template (#926)
1 parent 6c91cca commit d4fa563

4 files changed

Lines changed: 22 additions & 3 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,13 @@ 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`.
81+
AppBuilders includes the latest tagged version of the repo. Before making a new release with the
82+
AppBuilders, do the following:
83+
84+
- update the version in package.json with the version of the AppBuilders
85+
- merge into main
86+
- 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: 1 addition & 1 deletion
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\"",

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
@@ -30,6 +36,9 @@ const config = {
3036
options: {
3137
scope: process.env.BUILD_BASE_PATH
3238
}
39+
},
40+
version: {
41+
name: `${templateVersion}-${buildTimestamp}`
3342
}
3443
}
3544
};

0 commit comments

Comments
 (0)