Skip to content

fix: Fix loader not being published anymore #1358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ daysUntilClose: 7
exemptLabels:
- bug
- enhancement
- compatibility
exemptProjects: true
exemptMilestones: true
exemptAssignees: true
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,9 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: node node_modules/semantic-release/bin/semantic-release.js --unstable
run: |
node node_modules/semantic-release/bin/semantic-release.js --unstable
cd lib/loader
npm config set "//registry.npmjs.org/:_authToken=${NPM_TOKEN}"
npm publish --access public
cd ../..
2 changes: 1 addition & 1 deletion lib/loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@
"package.json",
"README.md"
]
}
}
21 changes: 16 additions & 5 deletions scripts/postversion.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
// Make sure that we are not publishing a v1 just yet

const pkg = require("../package.json");
const fs = require("fs");
const path = require("path");

if (!/^0\./.test(pkg.version)) {
throw Error("Unexpected version: " + pkg.version);
// Make sure that we are not publishing a v1 just yet
const mainPkg = require("../package.json");
if (!/^0\./.test(mainPkg.version)) {
throw Error("Unexpected version: " + mainPkg.version);
}

// Sync lib with main package
[
"lib/loader"
].forEach(dir => {
const pkgFile = path.join(__dirname, "..", dir, "package.json");
const pkg = require(pkgFile);
pkg.version = mainPkg.version;
fs.writeFileSync(pkgFile, JSON.stringify(pkg, null, 2));
});