Skip to content

Commit

Permalink
Merge pull request #264 from Fdawgs/chore/tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs authored Jan 25, 2024
2 parents 12e618f + ef73844 commit 84239b1
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 13 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
needs: release
if: needs.release.outputs.release_created == 'true'
runs-on: ubuntu-latest
environment: main
permissions:
contents: read
id-token: write
Expand All @@ -55,7 +56,7 @@ jobs:
# Remove dev values from package.json before publishing to reduce package size
run: |
npm pkg delete commitlint devDependencies jest scripts
npm publish --ignore-scripts --provenance
npm publish --access public --ignore-scripts --provenance
publish-ghp:
name: Publish to GitHub Packages
Expand All @@ -64,6 +65,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
steps:
- name: Check out repo
Expand All @@ -89,4 +91,4 @@ jobs:
# Remove dev values from package.json before publishing to reduce package size
run: |
npm pkg delete commitlint devDependencies jest scripts
npm publish --ignore-scripts
npm publish --access public --ignore-scripts --provenance
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
},
"javascript.updateImportsOnFileMove.enabled": "always",
"npm.packageManager": "npm",
"prettier.prettierPath": "./node_modules/prettier",
"redhat.telemetry.enabled": false
}
5 changes: 2 additions & 3 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"compilerOptions": {
"checkJs": true,
"lib": ["ES2022"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"resolveJsonModule": true,
"target": "ES2022"
"target": "ES2022",
},
"exclude": ["dist", "node_modules"]
"exclude": ["dist", "node_modules"],
}
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
"main": "src/index.js",
"type": "commonjs",
"types": "types/index.d.ts",
"repository": "git+https://github.com/Fdawgs/fastify-disablecache.git",
"repository": {
"type": "git",
"url": "git+https://github.com/Fdawgs/fastify-disablecache.git"
},
"homepage": "https://github.com/Fdawgs/fastify-disablecache",
"bugs": {
"url": "https://github.com/Fdawgs/fastify-disablecache/issues"
Expand Down Expand Up @@ -72,16 +75,16 @@
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^27.6.1",
"eslint-plugin-jest": "^27.6.3",
"eslint-plugin-jsdoc": "^48.0.2",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-regexp": "^2.1.2",
"eslint-plugin-regexp": "^2.2.0",
"eslint-plugin-security": "^2.1.0",
"fastify": "^4.25.2",
"husky": "^8.0.3",
"jest": "^29.7.0",
"license-checker": "^25.0.1",
"prettier": "^3.1.1",
"prettier": "^3.2.3",
"spdx-copyleft": "^1.0.0",
"upath": "^2.0.1"
},
Expand Down
18 changes: 14 additions & 4 deletions scripts/license-checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,20 @@ async function checkLicenses() {
start: joinSafe(__dirname, ".."),
});

const copyLeftLicensesList = Object.keys(licenses).filter((license) =>
// @ts-ignore: includes() returns false if undefined is passed
copyLeftLicenses.includes(licenses[license].licenses)
);
const copyLeftLicensesList = Object.keys(licenses).filter((license) => {
let lic = licenses[license].licenses;

if (!lic) {
console.error(
`No license found for ${license}. Please check the package.json file.`
);
process.exit(1);
}

lic = Array.isArray(lic) ? lic : [lic];

return lic.some((l) => copyLeftLicenses.includes(l));
});

if (copyLeftLicensesList.length > 0) {
console.error(
Expand Down

0 comments on commit 84239b1

Please sign in to comment.