Skip to content

Commit 7efc221

Browse files
committed
Fix version number issue
1 parent 3acc17f commit 7efc221

File tree

5 files changed

+18
-8
lines changed

5 files changed

+18
-8
lines changed

CHANGELOG.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ release date when you use `npm version` (see `README.md`).
77

88
## [Unreleased]
99

10-
## Added
10+
### Added
1111

1212
- A new mobile tab. This shows the instances in iframes. Console log messages
1313
are instrumented so that the instance port number and color is shown ahead
@@ -17,9 +17,14 @@ release date when you use `npm version` (see `README.md`).
1717
tells it basic information about the application. This allows us to set the
1818
name of the webxdc app in the title of each instance tab.
1919

20+
### Fixed
21+
22+
- The version number in the info tab should now show properly in the released
23+
version.
24+
2025
## [0.11.0][] - 2022-06-28
2126

22-
## Added
27+
### Added
2328

2429
- Show version number of dev tool in info tab.
2530

@@ -36,7 +41,7 @@ release date when you use `npm version` (see `README.md`).
3641
- Add `--open` option to automatically open instances on startup and as soon as
3742
they're created.
3843

39-
## Changed
44+
### Changed
4045

4146
- Better handling of command-line arguments.
4247

backend/appInfo.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import fs from "fs";
33
import toml from "toml";
44
// have to use v2 otherwise end up in config hell because v3 is ESM only
55
import nodeFetch from "node-fetch";
6+
import pkg from "../package.json";
67

78
import { Location, UrlLocation } from "./location";
89
import { waitOnUrl } from "./waitOn";
@@ -59,7 +60,7 @@ export async function getAppInfoUrl(
5960
}
6061

6162
export function getToolVersion(): string {
62-
return process.env.npm_package_version || "Unknown";
63+
return pkg.version || "Unknown";
6364
}
6465

6566
async function getManifestInfoFromUrl(

tsconfig-backend.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"extends": "@tsconfig/recommended/tsconfig.json",
3-
"include": ["backend", "types"],
3+
"include": ["backend", "types", "package.json"],
44
"compilerOptions": {
55
"target": "ES2016",
66
"module": "commonjs",
7-
"outDir": "dist"
7+
"outDir": "dist",
8+
"resolveJsonModule": true
89
}
910
}

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"jsxImportSource": "solid-js",
1111
"noEmit": true,
1212
"outDir": "dist",
13-
"isolatedModules": true
13+
"isolatedModules": true,
14+
"resolveJsonModule": true
1415
}
1516
}

webpack.common.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ module.exports = {
3333
publicPath: "/",
3434
// clean assets, except backend which is generated by typescript
3535
clean: {
36-
keep: "backend",
36+
keep(asset) {
37+
return ["backend", "package.json"].includes(asset);
38+
},
3739
},
3840
},
3941
plugins: [

0 commit comments

Comments
 (0)