Skip to content

Commit e950f9b

Browse files
authored
fix: Fix loader not being published anymore (#1358)
1 parent 40440f7 commit e950f9b

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

Diff for: .github/stale.yml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ daysUntilClose: 7
55
exemptLabels:
66
- bug
77
- enhancement
8+
- compatibility
89
exemptProjects: true
910
exemptMilestones: true
1011
exemptAssignees: true

Diff for: .github/workflows/publish.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,9 @@ jobs:
2626
env:
2727
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2828
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
29-
run: node node_modules/semantic-release/bin/semantic-release.js --unstable
29+
run: |
30+
node node_modules/semantic-release/bin/semantic-release.js --unstable
31+
cd lib/loader
32+
npm config set "//registry.npmjs.org/:_authToken=${NPM_TOKEN}"
33+
npm publish --access public
34+
cd ../..

Diff for: lib/loader/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@
3535
"package.json",
3636
"README.md"
3737
]
38-
}
38+
}

Diff for: scripts/postversion.js

+16-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1-
// Make sure that we are not publishing a v1 just yet
2-
3-
const pkg = require("../package.json");
1+
const fs = require("fs");
2+
const path = require("path");
43

5-
if (!/^0\./.test(pkg.version)) {
6-
throw Error("Unexpected version: " + pkg.version);
4+
// Make sure that we are not publishing a v1 just yet
5+
const mainPkg = require("../package.json");
6+
if (!/^0\./.test(mainPkg.version)) {
7+
throw Error("Unexpected version: " + mainPkg.version);
78
}
9+
10+
// Sync lib with main package
11+
[
12+
"lib/loader"
13+
].forEach(dir => {
14+
const pkgFile = path.join(__dirname, "..", dir, "package.json");
15+
const pkg = require(pkgFile);
16+
pkg.version = mainPkg.version;
17+
fs.writeFileSync(pkgFile, JSON.stringify(pkg, null, 2));
18+
});

0 commit comments

Comments
 (0)