Skip to content

fix: show type on invalid semver error #559

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 8 commits into from
May 12, 2023
Next Next commit
chore: add test step that makes sure no external/builtin dependencies
  • Loading branch information
tjenkinson committed May 5, 2023
commit 7328e66d4d08c2192eac93b22aad6228b4aa18e5
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@
!/SECURITY.md
!/tap-snapshots/
!/test/
!/rollup.config.js
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"description": "The semantic version parser used by npm.",
"main": "index.js",
"scripts": {
"test": "tap",
"test": "tap && npm run check-self-contained",
"snap": "tap",
"check-self-contained": "rollup -c --silent > /dev/null",
"lint": "eslint \"**/*.js\"",
"postlint": "template-oss-check",
"lintfix": "npm run lint -- --fix",
Expand All @@ -15,6 +16,8 @@
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.14.1",
"@rollup/plugin-commonjs": "^24.1.0",
"rollup": "^3.21.5",
"tap": "^16.0.0"
},
"license": "ISC",
Expand Down
22 changes: 22 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const fs = require('fs')
const commonjs = require('@rollup/plugin-commonjs')

const pkgJson = JSON.parse(fs.readFileSync('./package.json', 'utf-8'))

module.exports = {
input: pkgJson.main,
plugins: [
commonjs({
strictRequires: true,
ignoreTryCatch: true,
}),
],
external: Object.keys(pkgJson.dependencies),
onwarn: (e) => {
if (e.code === 'CIRCULAR_DEPENDENCY') {
return
}

throw new Error(e)
},
}
1 change: 1 addition & 0 deletions test/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const ignore = [
'tap-snapshots',
'test',
'fixtures',
'rollup.config.js',
]

const { statSync, readdirSync } = require('fs')
Expand Down