Skip to content

Commit

Permalink
move version number to a file
Browse files Browse the repository at this point in the history
  • Loading branch information
dslmeinte committed Aug 25, 2023
1 parent 3e2662c commit 623cfbc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,11 @@ The following are considerations or concerns that bubbled up during implementati
Run

```shell
deno run -A src-build/build-npm.ts x.y.z
deno run -A src-build/build-npm.ts
```

where x.y.z is the version of the package we're building. This will create a package in the `npm` directory.
This will create a package in the `npm` directory.
The version number stated in the package is stored in the file `src-build/current-version.txt`.

Then, we can build an archive with

Expand All @@ -112,7 +113,7 @@ We can use the compressed package as a dependency of local projects, for testing
```json
"dependencies": {
...
"lioncore-typescript": "file:...<relative path>.../lioncore-typescript/npm/lioncore-0.2.0.tgz"
"lioncore-typescript": "file:...<relative path>.../lioncore-typescript/npm/lioncore-0.3.0.tgz"
...
},
```
Expand Down
6 changes: 4 additions & 2 deletions src-build/build-npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,20 @@ await copy("models", "npm/script/models", { overwrite: true })
await copy("src-test/m3/ecore/library.ecore", "npm/esm/src-test/m3/ecore/library.ecore", { overwrite: true })
await copy("src-test/m3/ecore/library.ecore", "npm/script/src-test/m3/ecore/library.ecore", { overwrite: true })

const currentVersion = (await Deno.readTextFile("src-build/current-version.txt")).trim()

await build({
entryPoints: ["./src/mod.ts"],
outDir: "./npm",
scriptModule: false,
scriptModule: false, // when true (=default), testing errors out
shims: {
// see JS docs for overview and more options:
deno: true,
},
package: {
// package.json properties:
name: "lioncore-typescript",
version: Deno.args[0],
version: currentVersion,
description: "LIonWeb core for {Java|Type}Script",
license: "MIT",
repository: {
Expand Down
1 change: 1 addition & 0 deletions src-build/current-version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.3.0

0 comments on commit 623cfbc

Please sign in to comment.