Skip to content

Commit

Permalink
Merge pull request #4599 from aryaemami59/fix-writeGitVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson authored Sep 3, 2024
2 parents eef4250 + cb8e9ed commit b810f63
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:

# Read existing version, reuse that, add a Git short hash
- name: Set build version to Git commit
run: node scripts/writeGitVersion.mjs $(git rev-parse --short HEAD)
run: yarn tsx scripts/writeGitVersion.mts $(git rev-parse --short HEAD)

- name: Check updated version
run: jq .version package.json
Expand Down
2 changes: 1 addition & 1 deletion packages/toolkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"size-limit": "^11.0.1",
"tslib": "^1.10.0",
"tsup": "^8.2.3",
"tsx": "^4.16.2",
"tsx": "^4.19.0",
"typescript": "^5.5.4",
"vite-tsconfig-paths": "^4.3.1",
"vitest": "^1.6.0",
Expand Down
14 changes: 0 additions & 14 deletions packages/toolkit/scripts/writeGitVersion.mjs

This file was deleted.

12 changes: 12 additions & 0 deletions packages/toolkit/scripts/writeGitVersion.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env node --import=tsx

import * as fs from 'node:fs'
import * as path from 'node:path'

const gitRev = process.argv[2]

const packagePath = path.join(import.meta.dirname, '../package.json')
const pkg = JSON.parse(fs.readFileSync(packagePath, 'utf-8'))

pkg.version = `${pkg.version}-${gitRev}`
fs.writeFileSync(packagePath, JSON.stringify(pkg, null, 2))
22 changes: 11 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6718,7 +6718,7 @@ __metadata:
size-limit: "npm:^11.0.1"
tslib: "npm:^1.10.0"
tsup: "npm:^8.2.3"
tsx: "npm:^4.16.2"
tsx: "npm:^4.19.0"
typescript: "npm:^5.5.4"
vite-tsconfig-paths: "npm:^4.3.1"
vitest: "npm:^1.6.0"
Expand Down Expand Up @@ -13656,7 +13656,7 @@ __metadata:
languageName: node
linkType: hard

"esbuild@npm:^0.21.3, esbuild@npm:~0.21.5":
"esbuild@npm:^0.21.3":
version: 0.21.5
resolution: "esbuild@npm:0.21.5"
dependencies:
Expand Down Expand Up @@ -13736,7 +13736,7 @@ __metadata:
languageName: node
linkType: hard

"esbuild@npm:^0.23.0, esbuild@npm:^0.23.1":
"esbuild@npm:^0.23.0, esbuild@npm:^0.23.1, esbuild@npm:~0.23.0":
version: 0.23.1
resolution: "esbuild@npm:0.23.1"
dependencies:
Expand Down Expand Up @@ -15384,11 +15384,11 @@ __metadata:
linkType: hard

"get-tsconfig@npm:^4.7.5":
version: 4.7.6
resolution: "get-tsconfig@npm:4.7.6"
version: 4.8.0
resolution: "get-tsconfig@npm:4.8.0"
dependencies:
resolve-pkg-maps: "npm:^1.0.0"
checksum: 10/32da95a89f3ddbabd2a2e36f2a4add51a5e3c2b28f32e3c81494fcdbd43b7d9b42baea77784e62d10f87bb564c5ee908416aabf4c5ca9cdbb2950aa3c247f124
checksum: 10/aac6d98894bdb8b9f320f5c4953f9a89d11b1cbb15cc95447abe00366dc5fcda6dbce214f2e4572b1b835ab55c4f35f004b219c3d17e07c5ddca44ef9e3858d2
languageName: node
linkType: hard

Expand Down Expand Up @@ -27014,19 +27014,19 @@ __metadata:
languageName: node
linkType: hard

"tsx@npm:^4.16.2":
version: 4.16.2
resolution: "tsx@npm:4.16.2"
"tsx@npm:^4.19.0":
version: 4.19.0
resolution: "tsx@npm:4.19.0"
dependencies:
esbuild: "npm:~0.21.5"
esbuild: "npm:~0.23.0"
fsevents: "npm:~2.3.3"
get-tsconfig: "npm:^4.7.5"
dependenciesMeta:
fsevents:
optional: true
bin:
tsx: dist/cli.mjs
checksum: 10/841ccbace3dc0c42704bb5c4cea47e1f4cd313aa4719fd4531e5ed40bb862b02349c76f7c56c53b64207eebbb1c2ac2e117482aabfbf197a30fbc0b2584b60be
checksum: 10/cd9eef1fd7de4ab01cc0fa876b0bc50688cfd7c738c137928c2487021471ce14412c758c006375e3f3b444eee9e2f77f2d69661f1a5df4427bd9ec1250996f2d
languageName: node
linkType: hard

Expand Down

0 comments on commit b810f63

Please sign in to comment.