diff --git a/.github/workflows/.install.yml b/.github/workflows/.install.yml index a9dfa96..bc60def 100644 --- a/.github/workflows/.install.yml +++ b/.github/workflows/.install.yml @@ -28,7 +28,7 @@ jobs: echo "PACKAGE_DEPS_HASH=$PACKAGE_DEPS_HASH" echo "package-deps-hash=$PACKAGE_DEPS_HASH" >> "$GITHUB_OUTPUT" - name: node-modules cache get - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 id: cache with: path: ./node_modules @@ -40,7 +40,7 @@ jobs: - name: node-modules cache set if: steps.cache.outputs.cache-hit != 'true' - uses: actions/cache/save@v3 + uses: actions/cache/save@v4 with: path: ./node_modules key: ${{ steps.cache.outputs.cache-primary-key }} diff --git a/.github/workflows/.publish-npm.yml b/.github/workflows/.publish-npm.yml index 52ccf9b..4c3eb76 100644 --- a/.github/workflows/.publish-npm.yml +++ b/.github/workflows/.publish-npm.yml @@ -25,7 +25,7 @@ jobs: node-version-file: '.nvmrc' - name: node-modules cache get - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 id: cache with: path: ./node_modules diff --git a/.github/workflows/.test.yml b/.github/workflows/.test.yml index 2b162d3..fbb08a9 100644 --- a/.github/workflows/.test.yml +++ b/.github/workflows/.test.yml @@ -40,7 +40,7 @@ jobs: node-version-file: '.nvmrc' - name: get node-modules from cache - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: path: ./node_modules key: ${{ needs.install.outputs.node-modules-cache-key }} @@ -61,7 +61,7 @@ jobs: node-version-file: '.nvmrc' - name: get node-modules from cache - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: path: ./node_modules key: ${{ needs.install.outputs.node-modules-cache-key }} @@ -82,7 +82,7 @@ jobs: node-version-file: '.nvmrc' - name: get node-modules from cache - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: path: ./node_modules key: ${{ needs.install.outputs.node-modules-cache-key }} @@ -103,7 +103,7 @@ jobs: node-version-file: '.nvmrc' - name: get node-modules from cache - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: path: ./node_modules key: ${{ needs.install.outputs.node-modules-cache-key }} @@ -124,7 +124,7 @@ jobs: node-version-file: '.nvmrc' - name: get node-modules from cache - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: path: ./node_modules key: ${{ needs.install.outputs.node-modules-cache-key }} @@ -145,7 +145,7 @@ jobs: node-version-file: '.nvmrc' - name: get node-modules from cache - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: path: ./node_modules key: ${{ needs.install.outputs.node-modules-cache-key }} @@ -185,7 +185,7 @@ jobs: node-version-file: '.nvmrc' - name: get node-modules from cache - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: path: ./node_modules key: ${{ needs.install.outputs.node-modules-cache-key }} diff --git a/.husky/post-checkout b/.husky/post-checkout index 825c2ec..9ef84af 100755 --- a/.husky/post-checkout +++ b/.husky/post-checkout @@ -1,4 +1,5 @@ #!/bin/sh . "$(dirname -- "$0")/_/husky.sh" +. "$(dirname -- "$0")/check.nvm.sh" . "$(dirname -- "$0")/check.lockfile.sh" diff --git a/.husky/post-rewrite b/.husky/post-rewrite index 9ef84af..825c2ec 100755 --- a/.husky/post-rewrite +++ b/.husky/post-rewrite @@ -1,5 +1,4 @@ #!/bin/sh . "$(dirname -- "$0")/_/husky.sh" -. "$(dirname -- "$0")/check.nvm.sh" . "$(dirname -- "$0")/check.lockfile.sh" diff --git a/jest.acceptance.config.ts b/jest.acceptance.config.ts index a8ae45a..4a62e00 100644 --- a/jest.acceptance.config.ts +++ b/jest.acceptance.config.ts @@ -3,6 +3,9 @@ import type { Config } from 'jest'; // ensure tests run in utc, like they will on cicd and on server; https://stackoverflow.com/a/56277249/15593329 process.env.TZ = 'UTC'; +// ensure tests run like on local machines, so snapshots are equal on local && cicd +process.env.FORCE_COLOR = 'true'; + // https://jestjs.io/docs/configuration const config: Config = { verbose: true, diff --git a/jest.integration.config.ts b/jest.integration.config.ts index 6715b55..ef32f9c 100644 --- a/jest.integration.config.ts +++ b/jest.integration.config.ts @@ -3,6 +3,9 @@ import type { Config } from 'jest'; // ensure tests run in utc, like they will on cicd and on server; https://stackoverflow.com/a/56277249/15593329 process.env.TZ = 'UTC'; +// ensure tests run like on local machines, so snapshots are equal on local && cicd +process.env.FORCE_COLOR = 'true'; + // https://jestjs.io/docs/configuration const config: Config = { verbose: true, diff --git a/jest.unit.config.ts b/jest.unit.config.ts index eb408ec..8267acc 100644 --- a/jest.unit.config.ts +++ b/jest.unit.config.ts @@ -3,6 +3,9 @@ import type { Config } from 'jest'; // ensure tests run in utc, like they will on cicd and on server; https://stackoverflow.com/a/56277249/15593329 process.env.TZ = 'UTC'; +// ensure tests run like on local machines, so snapshots are equal on local && cicd +process.env.FORCE_COLOR = 'true'; + // https://jestjs.io/docs/configuration const config: Config = { verbose: true, diff --git a/package-lock.json b/package-lock.json index e414220..e50fd64 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "pretty-bytes": "5.6.0", "simple-leveled-log-methods": "0.1.4", "ts-node": "8.6.2", - "type-fns": "1.16.0", + "type-fns": "1.17.0", "uuid": "9.0.0", "yaml": "1.6.0" }, @@ -48,7 +48,7 @@ "core-js": "3.26.1", "cz-conventional-changelog": "3.3.0", "declapract": "0.11.5", - "declapract-typescript-ehmpathy": "0.33.6", + "declapract-typescript-ehmpathy": "0.33.11", "depcheck": "1.4.3", "eslint": "8.56.0", "eslint-config-airbnb-typescript": "18.0.0", @@ -7741,9 +7741,9 @@ } }, "node_modules/declapract-typescript-ehmpathy": { - "version": "0.33.6", - "resolved": "https://registry.npmjs.org/declapract-typescript-ehmpathy/-/declapract-typescript-ehmpathy-0.33.6.tgz", - "integrity": "sha512-F8cLN3HkoqekvQYlz3a8KDpliljZ/LFSejGWnryTEqoXIGnmSLS4eeVsa6uUmzo2yd3RcuqHCBTSwl7HcN0UrQ==", + "version": "0.33.11", + "resolved": "https://registry.npmjs.org/declapract-typescript-ehmpathy/-/declapract-typescript-ehmpathy-0.33.11.tgz", + "integrity": "sha512-nNCfpsSU/YSEtQ7m3mctWsrEIqRPAmAFK/2pOO5uXC2QCwlyNuD1oqqSt8AYTK98878KBl+TQ2P2EzEeJt/KfA==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -8475,6 +8475,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/declapract/node_modules/type-fns": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-1.16.0.tgz", + "integrity": "sha512-4erPa91wW979ZHH/zVI340b3s4HQGFYUMH5rBUUP0tyqPGzpZJddUpZXBliu8KF/oXEMOq3Elydb7OgdgKpung==", + "dev": true, + "dependencies": { + "@ehmpathy/error-fns": "1.0.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/declapract/node_modules/uuid": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", @@ -16402,6 +16414,20 @@ } }, "node_modules/type-fns": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-1.17.0.tgz", + "integrity": "sha512-zscRD2lGbnD2Ktyvb79cZ7R1kGm0OBnfisG3g3LdFS9C9pR8YKdXtUojDStvgQtaqyb/a77E5gYTsBY3jrZMsA==", + "hasInstallScript": true, + "dependencies": { + "@ehmpathy/error-fns": "1.0.2", + "type-fns": "1.16.0", + "uuid": "9.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/type-fns/node_modules/type-fns": { "version": "1.16.0", "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-1.16.0.tgz", "integrity": "sha512-4erPa91wW979ZHH/zVI340b3s4HQGFYUMH5rBUUP0tyqPGzpZJddUpZXBliu8KF/oXEMOq3Elydb7OgdgKpung==", @@ -16412,6 +16438,14 @@ "node": ">=8.0.0" } }, + "node_modules/type-fns/node_modules/uuid": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -23776,6 +23810,15 @@ "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true }, + "type-fns": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-1.16.0.tgz", + "integrity": "sha512-4erPa91wW979ZHH/zVI340b3s4HQGFYUMH5rBUUP0tyqPGzpZJddUpZXBliu8KF/oXEMOq3Elydb7OgdgKpung==", + "dev": true, + "requires": { + "@ehmpathy/error-fns": "1.0.2" + } + }, "uuid": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", @@ -23807,9 +23850,9 @@ } }, "declapract-typescript-ehmpathy": { - "version": "0.33.6", - "resolved": "https://registry.npmjs.org/declapract-typescript-ehmpathy/-/declapract-typescript-ehmpathy-0.33.6.tgz", - "integrity": "sha512-F8cLN3HkoqekvQYlz3a8KDpliljZ/LFSejGWnryTEqoXIGnmSLS4eeVsa6uUmzo2yd3RcuqHCBTSwl7HcN0UrQ==", + "version": "0.33.11", + "resolved": "https://registry.npmjs.org/declapract-typescript-ehmpathy/-/declapract-typescript-ehmpathy-0.33.11.tgz", + "integrity": "sha512-nNCfpsSU/YSEtQ7m3mctWsrEIqRPAmAFK/2pOO5uXC2QCwlyNuD1oqqSt8AYTK98878KBl+TQ2P2EzEeJt/KfA==", "dev": true, "requires": { "@ehmpathy/error-fns": "1.3.1", @@ -29807,11 +29850,28 @@ "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==" }, "type-fns": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-1.16.0.tgz", - "integrity": "sha512-4erPa91wW979ZHH/zVI340b3s4HQGFYUMH5rBUUP0tyqPGzpZJddUpZXBliu8KF/oXEMOq3Elydb7OgdgKpung==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-1.17.0.tgz", + "integrity": "sha512-zscRD2lGbnD2Ktyvb79cZ7R1kGm0OBnfisG3g3LdFS9C9pR8YKdXtUojDStvgQtaqyb/a77E5gYTsBY3jrZMsA==", "requires": { - "@ehmpathy/error-fns": "1.0.2" + "@ehmpathy/error-fns": "1.0.2", + "type-fns": "1.16.0", + "uuid": "9.0.0" + }, + "dependencies": { + "type-fns": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/type-fns/-/type-fns-1.16.0.tgz", + "integrity": "sha512-4erPa91wW979ZHH/zVI340b3s4HQGFYUMH5rBUUP0tyqPGzpZJddUpZXBliu8KF/oXEMOq3Elydb7OgdgKpung==", + "requires": { + "@ehmpathy/error-fns": "1.0.2" + } + }, + "uuid": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==" + } } }, "typedarray-to-buffer": { diff --git a/package.json b/package.json index b6aef30..472ad3f 100644 --- a/package.json +++ b/package.json @@ -58,11 +58,11 @@ "test:lint:deps": "npx depcheck -c ./depcheckrc.yml", "test:lint:eslint": "eslint -c ./.eslintrc.js src/**/*.ts", "test:lint": "npm run test:lint:eslint && npm run test:lint:deps", - "test:unit": "FORCE_COLOR=true jest -c ./jest.unit.config.ts --forceExit --verbose --passWithNoTests $([ -z $THOROUGH ] && echo '--changedSince=main')", - "test:integration": "FORCE_COLOR=true jest -c ./jest.integration.config.ts --forceExit --verbose --passWithNoTests $([ -z $THOROUGH ] && echo '--changedSince=main')", - "test:acceptance:locally": "npm run build && FORCE_COLOR=true LOCALLY=true jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests", + "test:unit": "jest -c ./jest.unit.config.ts --forceExit --verbose --passWithNoTests $([ -z $THOROUGH ] && echo '--changedSince=main')", + "test:integration": "jest -c ./jest.integration.config.ts --forceExit --verbose --passWithNoTests $([ -z $THOROUGH ] && echo '--changedSince=main')", + "test:acceptance:locally": "npm run build && LOCALLY=true jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests", "test": "npm run test:commits && npm run test:types && npm run test:format && npm run test:lint && npm run test:unit && npm run test:integration && npm run test:acceptance:locally", - "test:acceptance": "npm run build && FORCE_COLOR=true jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests", + "test:acceptance": "npm run build && jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests", "prepush": "npm run test && npm run build", "prepublish": "npm run build", "preversion": "npm run prepush", @@ -83,7 +83,7 @@ "pretty-bytes": "5.6.0", "simple-leveled-log-methods": "0.1.4", "ts-node": "8.6.2", - "type-fns": "1.16.0", + "type-fns": "1.17.0", "uuid": "9.0.0", "yaml": "1.6.0" }, @@ -105,7 +105,7 @@ "core-js": "3.26.1", "cz-conventional-changelog": "3.3.0", "declapract": "0.11.5", - "declapract-typescript-ehmpathy": "0.33.6", + "declapract-typescript-ehmpathy": "0.33.11", "depcheck": "1.4.3", "eslint": "8.56.0", "eslint-config-airbnb-typescript": "18.0.0",