From 1969a6cdd138561e4c9641fbb8a83eb5458b5d11 Mon Sep 17 00:00:00 2001 From: Peter Baker Date: Mon, 5 Aug 2024 13:36:19 +1000 Subject: [PATCH] Making changes based on experiments in personal fork --- .commitlintrc | 5 --- .github/semantic.yml | 14 +++++++ .github/workflows/check-package-lock.yml | 37 +++++++++++++++++ .github/workflows/release-on-push.yml | 49 +++++++++++++++++++++++ .husky/commit-msg | 4 -- api/package-lock.json | 27 ------------- app/package-lock.json | 16 -------- configs/config-release-it/.release-it.js | 2 +- library/data-model/package.json | 4 -- package-lock.json | 51 +----------------------- package.json | 2 - 11 files changed, 102 insertions(+), 109 deletions(-) delete mode 100644 .commitlintrc create mode 100644 .github/semantic.yml create mode 100644 .github/workflows/check-package-lock.yml create mode 100644 .github/workflows/release-on-push.yml delete mode 100755 .husky/commit-msg diff --git a/.commitlintrc b/.commitlintrc deleted file mode 100644 index 0df1d2536..000000000 --- a/.commitlintrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": [ - "@commitlint/config-conventional" - ] -} diff --git a/.github/semantic.yml b/.github/semantic.yml new file mode 100644 index 000000000..3756083e0 --- /dev/null +++ b/.github/semantic.yml @@ -0,0 +1,14 @@ +enabled: true +titleOnly: false +types: + - feat + - fix + - docs + - style + - refactor + - perf + - test + - build + - ci + - chore + - revert \ No newline at end of file diff --git a/.github/workflows/check-package-lock.yml b/.github/workflows/check-package-lock.yml new file mode 100644 index 000000000..3b0b3a75e --- /dev/null +++ b/.github/workflows/check-package-lock.yml @@ -0,0 +1,37 @@ +name: Check package lock up to date + +on: + pull_request: + branches: [main] + +jobs: + package-lock-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: "20" + + - name: Setup node cache + id: node-cache + uses: actions/cache@v3 + with: + path: "**/node_modules" + key: npm-${{ hashFiles('package-lock.json') }}-${{ hashFiles('package.json') }} + restore-keys: npm- + + - name: Install dependencies + if: steps.node-cache.outputs.cache-hit != 'true' + run: npm i + + - name: Verify package-lock.json files are up to date + run: | + if ! git status --porcelain; then + echo "::error::Changes detected in git after running 'npm install --package-lock-only'. Please run 'npm install' and commit and push the changes." + git status + exit 1 + fi + echo "No changes in package-lock detected." diff --git a/.github/workflows/release-on-push.yml b/.github/workflows/release-on-push.yml new file mode 100644 index 000000000..6912dbeb4 --- /dev/null +++ b/.github/workflows/release-on-push.yml @@ -0,0 +1,49 @@ +name: Release + +on: + pull_request: + # will be checked is merged + types: [closed] + branches: + - main + +jobs: + release: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: "20" + + - name: Setup node cache + id: node-cache + uses: actions/cache@v3 + with: + path: "**/node_modules" + key: npm-${{ hashFiles('package-lock.json') }}-${{ hashFiles('package.json') }} + restore-keys: npm- + + - name: Install dependencies + if: steps.node-cache.outputs.cache-hit != 'true' + run: npm i --include dev + + - name: Configure Git + run: | + git config user.name "${GITHUB_ACTOR}" + git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" + + - name: Run release-it + run: npm run release + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_IT_OAUTH_TOKEN }} diff --git a/.husky/commit-msg b/.husky/commit-msg deleted file mode 100755 index 314e82147..000000000 --- a/.husky/commit-msg +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -npx --no-install commitlint --edit $1 \ No newline at end of file diff --git a/api/package-lock.json b/api/package-lock.json index 78533bda6..8d0b2c991 100644 --- a/api/package-lock.json +++ b/api/package-lock.json @@ -17,7 +17,6 @@ "express-handlebars": "7.1.2", "express-rate-limit": "^7.1.5", "express-validator": "7.0.1", - "faims3-datamodel": "github:FAIMS/faims3-data-model#v1.1.6", "fast-check": "2.25.0", "gts": "3.1.1", "handlebars": "4.7.7.", @@ -4775,21 +4774,6 @@ "node": ">=4" } }, - "node_modules/faims3-datamodel": { - "version": "1.1.6", - "resolved": "git+ssh://git@github.com/FAIMS/faims3-data-model.git#9636e49b44fd0e736a9b3b9152b995d2a203567b", - "license": "Apache", - "dependencies": { - "@demvsystems/yup-ast": "^1.2.2", - "@types/pouchdb": "^6.4.0", - "fast-json-stable-stringify": "^2.1.0", - "lodash": "^4.17.21", - "uuid": "^9.0.0" - }, - "peerDependencies": { - "pouchdb": "^7.3.0" - } - }, "node_modules/fast-check": { "version": "2.25.0", "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-2.25.0.tgz", @@ -14988,17 +14972,6 @@ "tmp": "^0.0.33" } }, - "faims3-datamodel": { - "version": "git+ssh://git@github.com/FAIMS/faims3-data-model.git#9636e49b44fd0e736a9b3b9152b995d2a203567b", - "from": "faims3-datamodel@github:FAIMS/faims3-data-model#v1.1.6", - "requires": { - "@demvsystems/yup-ast": "^1.2.2", - "@types/pouchdb": "^6.4.0", - "fast-json-stable-stringify": "^2.1.0", - "lodash": "^4.17.21", - "uuid": "^9.0.0" - } - }, "fast-check": { "version": "2.25.0", "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-2.25.0.tgz", diff --git a/app/package-lock.json b/app/package-lock.json index 074a9b493..5762bae45 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -59,7 +59,6 @@ "assert": "^2.0.0", "buffer": "^6.0.3", "clsx": "1.2.1", - "faims3-datamodel": "github:FAIMS/faims3-data-model#v1.1.4", "fast-json-stable-stringify": "2.1.0", "formik": "2.4.6", "formik-mui": "4.0.0", @@ -5650,21 +5649,6 @@ "node": ">=0.6.0" } }, - "node_modules/faims3-datamodel": { - "version": "1.1.4", - "resolved": "git+ssh://git@github.com/FAIMS/faims3-data-model.git#d16e68f4a82549384cbe8449d990fa8b7463bb64", - "license": "Apache", - "dependencies": { - "@demvsystems/yup-ast": "^1.2.2", - "@types/pouchdb": "^6.4.0", - "fast-json-stable-stringify": "^2.1.0", - "lodash": "^4.17.21", - "uuid": "^9.0.0" - }, - "peerDependencies": { - "pouchdb": "^7.3.0" - } - }, "node_modules/fast-check": { "version": "2.25.0", "dev": true, diff --git a/configs/config-release-it/.release-it.js b/configs/config-release-it/.release-it.js index 106f9270b..79d518c45 100644 --- a/configs/config-release-it/.release-it.js +++ b/configs/config-release-it/.release-it.js @@ -16,7 +16,7 @@ module.exports = { git: { push: true, tagName: `${packageName}-v${version}`, - pushRepo: 'git@github.com:FAIMS/FAIMS3.git', + pushRepo: 'https://github.com/FAIMS/FAIMS3.git', commitsPath: '.', commitMessage: `feat(${scope}): released version v${version} [no ci]`, requireCommits: true, diff --git a/library/data-model/package.json b/library/data-model/package.json index 39dd91b6e..396433e83 100644 --- a/library/data-model/package.json +++ b/library/data-model/package.json @@ -20,10 +20,6 @@ }, "author": "", "license": "Apache", - "repository": { - "type": "git", - "url": "https://github.com/FAIMS/faims3-data-model" - }, "peerDependencies": { "pouchdb": "^7.3.0" }, diff --git a/package-lock.json b/package-lock.json index 3734a2bc1..b57da0198 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,6 @@ "devDependencies": { "@commitlint/cli": "17.6.1", "@commitlint/config-conventional": "17.6.1", - "husky": "8.0.3", "turbo": "^2.0.11" } }, @@ -443,6 +442,7 @@ } }, "configs/config-release-it": { + "name": "@faims3/config-release-it", "version": "0.0.0", "license": "MIT", "devDependencies": { @@ -19580,13 +19580,11 @@ }, "node_modules/aws-cdk-lib/node_modules/@balena/dockerignore": { "version": "1.0.2", - "extraneous": true, "inBundle": true, "license": "Apache-2.0" }, "node_modules/aws-cdk-lib/node_modules/ajv": { "version": "8.16.0", - "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -19602,7 +19600,6 @@ }, "node_modules/aws-cdk-lib/node_modules/ansi-regex": { "version": "5.0.1", - "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -19611,7 +19608,6 @@ }, "node_modules/aws-cdk-lib/node_modules/ansi-styles": { "version": "4.3.0", - "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -19626,7 +19622,6 @@ }, "node_modules/aws-cdk-lib/node_modules/astral-regex": { "version": "2.0.0", - "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -19635,13 +19630,11 @@ }, "node_modules/aws-cdk-lib/node_modules/balanced-match": { "version": "1.0.2", - "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/aws-cdk-lib/node_modules/brace-expansion": { "version": "1.1.11", - "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -19651,7 +19644,6 @@ }, "node_modules/aws-cdk-lib/node_modules/case": { "version": "1.6.3", - "extraneous": true, "inBundle": true, "license": "(MIT OR GPL-3.0-or-later)", "engines": { @@ -19660,7 +19652,6 @@ }, "node_modules/aws-cdk-lib/node_modules/color-convert": { "version": "2.0.1", - "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -19672,31 +19663,26 @@ }, "node_modules/aws-cdk-lib/node_modules/color-name": { "version": "1.1.4", - "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/aws-cdk-lib/node_modules/concat-map": { "version": "0.0.1", - "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/aws-cdk-lib/node_modules/emoji-regex": { "version": "8.0.0", - "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/aws-cdk-lib/node_modules/fast-deep-equal": { "version": "3.1.3", - "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/aws-cdk-lib/node_modules/fs-extra": { "version": "11.2.0", - "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -19710,13 +19696,11 @@ }, "node_modules/aws-cdk-lib/node_modules/graceful-fs": { "version": "4.2.11", - "extraneous": true, "inBundle": true, "license": "ISC" }, "node_modules/aws-cdk-lib/node_modules/ignore": { "version": "5.3.1", - "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -19725,7 +19709,6 @@ }, "node_modules/aws-cdk-lib/node_modules/is-fullwidth-code-point": { "version": "3.0.0", - "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -19734,13 +19717,11 @@ }, "node_modules/aws-cdk-lib/node_modules/json-schema-traverse": { "version": "1.0.0", - "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/aws-cdk-lib/node_modules/jsonfile": { "version": "6.1.0", - "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -19752,7 +19733,6 @@ }, "node_modules/aws-cdk-lib/node_modules/jsonschema": { "version": "1.4.1", - "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -19761,13 +19741,11 @@ }, "node_modules/aws-cdk-lib/node_modules/lodash.truncate": { "version": "4.4.2", - "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/aws-cdk-lib/node_modules/mime-db": { "version": "1.52.0", - "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -19776,7 +19754,6 @@ }, "node_modules/aws-cdk-lib/node_modules/mime-types": { "version": "2.1.35", - "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -19788,7 +19765,6 @@ }, "node_modules/aws-cdk-lib/node_modules/minimatch": { "version": "3.1.2", - "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -19800,7 +19776,6 @@ }, "node_modules/aws-cdk-lib/node_modules/punycode": { "version": "2.3.1", - "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -19809,7 +19784,6 @@ }, "node_modules/aws-cdk-lib/node_modules/require-from-string": { "version": "2.0.2", - "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -19818,7 +19792,6 @@ }, "node_modules/aws-cdk-lib/node_modules/semver": { "version": "7.6.2", - "extraneous": true, "inBundle": true, "license": "ISC", "bin": { @@ -19830,7 +19803,6 @@ }, "node_modules/aws-cdk-lib/node_modules/slice-ansi": { "version": "4.0.0", - "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -19847,7 +19819,6 @@ }, "node_modules/aws-cdk-lib/node_modules/string-width": { "version": "4.2.3", - "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -19861,7 +19832,6 @@ }, "node_modules/aws-cdk-lib/node_modules/strip-ansi": { "version": "6.0.1", - "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -19873,7 +19843,6 @@ }, "node_modules/aws-cdk-lib/node_modules/table": { "version": "6.8.2", - "extraneous": true, "inBundle": true, "license": "BSD-3-Clause", "dependencies": { @@ -19889,7 +19858,6 @@ }, "node_modules/aws-cdk-lib/node_modules/universalify": { "version": "2.0.1", - "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -19898,7 +19866,6 @@ }, "node_modules/aws-cdk-lib/node_modules/uri-js": { "version": "4.4.1", - "extraneous": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -19907,7 +19874,6 @@ }, "node_modules/aws-cdk-lib/node_modules/yaml": { "version": "1.10.2", - "extraneous": true, "inBundle": true, "license": "ISC", "engines": { @@ -27890,21 +27856,6 @@ "ms": "^2.0.0" } }, - "node_modules/husky": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", - "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", - "dev": true, - "bin": { - "husky": "lib/bin.js" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/typicode" - } - }, "node_modules/hyphenate-style-name": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/hyphenate-style-name/-/hyphenate-style-name-1.1.0.tgz", diff --git a/package.json b/package.json index 8a016a120..998915a31 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,6 @@ "start-app": "npm start --workspace=app", "watch-api": "npm run watch --workspace=api", "start-designer": "npm run start --workspace=designer", - "prepare": "husky install", "release": "turbo release --concurrency=1" }, "keywords": [], @@ -34,7 +33,6 @@ "devDependencies": { "@commitlint/cli": "17.6.1", "@commitlint/config-conventional": "17.6.1", - "husky": "8.0.3", "turbo": "^2.0.11" }, "packageManager": "npm@10.7.0"