Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

Commit 4ee1d80

Browse files
authored
Fix: Ensure correct version in package (#73)
* Fix: Ensure correct version in package * Add comments to lib/version.js * Run build before lint and test scripts * Fix CI script
1 parent 82a7e6d commit 4ee1d80

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ name: CI
22
on:
33
push:
44
branches:
5-
- master
5+
- main
66
pull_request:
77
branches:
8-
- master
8+
- main
99
jobs:
1010
lint:
1111
name: Lint
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v2
1515
- name: Setup Node.js
16-
uses: actions/setup-node@v1
16+
uses: actions/setup-node@v2
1717
with:
1818
node-version: '12.x'
1919
- name: Install dependencies
@@ -29,7 +29,7 @@ jobs:
2929
runs-on: ${{ matrix.os }}
3030
steps:
3131
- uses: actions/checkout@v2
32-
- uses: actions/setup-node@v1
32+
- uses: actions/setup-node@v2
3333
with:
3434
node-version: ${{ matrix.node }}
3535
- name: Install dependencies

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ npm-debug.log
99
.sublimelinterrc
1010
.eslint-release-info.json
1111
dist
12+
*.tgz

lib/version.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1-
const version = "5.1.1";
1+
/**
2+
* @fileoverview Contains the current version number. This file is checked in
3+
* to source control and should always return "main". During the release
4+
* process, this file is overwritten with a new on that returns the actual
5+
* version number. The file with the actual version number is *not* checked
6+
* back into the repo. This is only necessary until Node.js supports import
7+
* assertions, at which time we can just import package.json for this info.
8+
* @author Nicholas C. Zakas
9+
*/
10+
const version = "main";
211

312
export default version;

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
},
2222
"license": "BSD-2-Clause",
2323
"scripts": {
24-
"prepare": "npm run update-version && npm run build",
2524
"build": "rollup -c",
25+
"lint": "npm run build && node Makefile.js lint",
2626
"update-version": "node tools/update-version.js",
27-
"test": "node Makefile.js test",
28-
"lint": "node Makefile.js lint",
27+
"test": "npm run build && node Makefile.js test",
28+
"prepublishOnly": "npm run update-version && npm run build",
2929
"generate-release": "eslint-generate-release",
3030
"generate-alpharelease": "eslint-generate-prerelease alpha",
3131
"generate-betarelease": "eslint-generate-prerelease beta",

0 commit comments

Comments
 (0)