diff --git a/.githooks/commit-msg b/.githooks/commit-msg index 32c253f..8398fc6 100644 --- a/.githooks/commit-msg +++ b/.githooks/commit-msg @@ -9,10 +9,11 @@ branch=$( git branch | grep \* | cut -d ' ' -f2 ) # ./.githooks/init-repo/is-skip-commitlint.ts $1 "$branch" -code=$? +# code=$? +code=0 #echo -e 'node exitCode:' $code -if [[ $code = 0 ]] ; then +if [[ $code = 0 ]] && [[ -d node_modules ]] ; then commitlint -e ./.git/COMMIT_EDITMSG fi diff --git a/.githooks/set-scripts-executable.sh b/.githooks/set-scripts-executable.sh index afca5bf..6d77f6d 100755 --- a/.githooks/set-scripts-executable.sh +++ b/.githooks/set-scripts-executable.sh @@ -1,20 +1,12 @@ #!/bin/bash set +e -find .scripts -type f -iname "*.sh" -print0 \ - | xargs -0II git update-index --ignore-missing --chmod=+x I +dirs=" .githooks .scripts .github" -find .scripts -type f -iname "*.mjs" -print0 \ - | xargs -0II git update-index --ignore-missing --chmod=+x I - -find .github -type f -iname "*.sh" -print0 \ - | xargs -0II git update-index --ignore-missing --chmod=+x I - -find .github -type f -iname "*.mjs" -print0 \ - | xargs -0II git update-index --ignore-missing --chmod=+x I - -find .githooks -type f -iname "*.sh" -print0 \ - | xargs -0II git update-index --ignore-missing --chmod=+x I +for dir in $dirs; do + find $dir -type f -iname "*.sh" -print0 | xargs -0II git update-index --ignore-missing --chmod=+x I + find $dir -type f -iname "*.mjs" -print0 | xargs -0II git update-index --ignore-missing --chmod=+x I +done echo "Commit changes if changed!" diff --git a/.github/workflows/nodejs-win.yml b/.github/workflows/nodejs-win.yml index fba54b3..ebc3e12 100644 --- a/.github/workflows/nodejs-win.yml +++ b/.github/workflows/nodejs-win.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: - node: ['current'] + node: ['lts/*'] os: [windows-latest] steps: diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 3ee0e89..58b617b 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -183,7 +183,11 @@ jobs: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres # needed because the postgres container does not provide a healthcheck - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 jaeger: image: jaegertracing/all-in-one diff --git a/.github/workflows/npm-manual-publish.yml b/.github/workflows/npm-manual-publish.yml index df7866a..73aca84 100644 --- a/.github/workflows/npm-manual-publish.yml +++ b/.github/workflows/npm-manual-publish.yml @@ -182,7 +182,7 @@ jobs: # npm run pub major rm -rf package-lock.json rm -rf packages/*/package-lock.json - .scripts/publish.sh --yes --conventional-commits --create-release github ${{ github.event.inputs.semver }} + .scripts/publish.sh --yes --no-private --conventional-commits --create-release github ${{ github.event.inputs.semver }} git push -v origin --follow-tags env: CI: true diff --git a/.github/workflows/npm-publish-wo-test.yml b/.github/workflows/npm-publish-wo-test.yml index bb4826a..01934f4 100644 --- a/.github/workflows/npm-publish-wo-test.yml +++ b/.github/workflows/npm-publish-wo-test.yml @@ -132,7 +132,7 @@ jobs: # npm run pub major rm -rf package-lock.json rm -rf packages/*/package-lock.json - .scripts/publish.sh --yes --conventional-commits --create-release github ${{ github.event.inputs.semver }} + .scripts/publish.sh --yes --no-private --conventional-commits --create-release github ${{ github.event.inputs.semver }} git push -v origin --follow-tags env: CI: true diff --git a/.gitignore b/.gitignore index 2cbc27d..bb57d54 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ package-lock.json yarn.lock package.json.lerna_backup tsconfig.tsbuildinfo +npm-shrinkwrap.json !/tsconfig.base.json tsconfig.base.json diff --git a/.mocharc.yml b/.mocharc.yml index 7403efe..6d2be0a 100644 --- a/.mocharc.yml +++ b/.mocharc.yml @@ -3,14 +3,15 @@ bail: true full-trace: true enable-source-maps: true require: - - ts-node/register + # for cjs + # - ts-node/register - tsconfig-paths/register.js - test/root.hooks.ts -#loader: -# - ts-node/esm +loader: + - ts-node/esm spec: - test/**/*.test.ts -timeout: 120000 +timeout: 90000 ui: bdd parallel: false exit: true diff --git a/.vscode/settings.json b/.vscode/settings.json index 01c23d1..6a55847 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -82,6 +82,7 @@ "files.trimTrailingWhitespace": true, "git.autofetch": true, "git.ignoreLimitWarning": true, + "markdown.editor.pasteUrlAsFormattedLink.enabled": "smart", "markdown-pdf.outputDirectory": "d:/", "plantuml.render": "PlantUMLServer", "plantuml.server": "https://www.plantuml.com/plantuml", diff --git a/.vscode/settings.json.example b/.vscode/settings.json.example index 0597ba5..8aefa26 100644 --- a/.vscode/settings.json.example +++ b/.vscode/settings.json.example @@ -83,6 +83,7 @@ "files.trimTrailingWhitespace": true, "git.autofetch": true, "git.ignoreLimitWarning": true, + "markdown.editor.pasteUrlAsFormattedLink.enabled": "smart", "markdown-pdf.outputDirectory": "d:/", "plantuml.render": "PlantUMLServer", "plantuml.server": "https://www.plantuml.com/plantuml", diff --git a/package.json b/package.json index e75d403..5b3c0ea 100644 --- a/package.json +++ b/package.json @@ -8,27 +8,27 @@ "@commitlint/cli": "17", "@commitlint/config-conventional": "17", "@midwayjs/cli": "^2.1.1", - "@midwayjs/mock": "^3.11.6", - "@midwayjs/web": "^3.11.6", + "@midwayjs/mock": "^3.11.15", + "@midwayjs/web": "^3.11.15", "@rollup/plugin-commonjs": "25", "@rollup/plugin-node-resolve": "15", "@types/mocha": "10", "@types/node": "20", "@waiting/eslint-config": "^8.8.0", - "@waiting/shared-core": "^21.2.1", - "@waiting/shared-types": "^21.2.0", + "@waiting/shared-core": "^21.3.0", + "@waiting/shared-types": "^21.3.0", "autocannon": "7", "coveralls": "3", + "cross-env": "7", "debug": "^4.3.4", - "eslint": "^8.45.0", + "eslint": "^8.47.0", "madge": "^6.1.0", "mocha": "10", "mocha-lcov-reporter": "1", - "rewire": "6", "rimraf": "5", "rollup-plugin-dts": "^5.3.0", "ts-node": "^10.9.1", - "tsc-alias": "^1.8.6", + "tsc-alias": "^1.8.7", "tsconfig-paths": "4", "typescript": "^5.1.6", "zx": "7" diff --git a/packages/demo/package.json b/packages/demo/package.json index 7b177d3..d106ca6 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -30,7 +30,6 @@ }, "license": "MIT", "devDependencies": { - "cross-env": "7" }, "engines": { "node": ">=16.13.0" @@ -52,7 +51,7 @@ "clean": "npm run clean:lock & npm run clean:cache & rm -rf dist/*", "clean:cache": "rm -rf .eslintcache .tsbuildinfo", "clean:lock": "rm package-lock.json -f", - "cov": "cross-env TS_NODE_PROJECT=test/tsconfig.json c8 mocha --loader=ts-node/esm --parallel=false", + "cov": "cross-env TS_NODE_PROJECT=test/tsconfig.json c8 mocha --parallel=false", "lint": "eslint --fix --cache {src,test}/**/*.ts", "lint:nofix": "eslint --cache {src,test}/**/*.ts", "purge": "npm run clean && rm node_modules -rf", @@ -60,8 +59,8 @@ "prepack": "rm -f dist/tsconfig.tsbuildinfo", "pretest": "npm run build", "pretest:local": "npm run build", - "test": "cross-env TS_NODE_PROJECT=test/tsconfig.json mocha --loader=ts-node/esm", - "test:local": "cross-env TS_NODE_PROJECT=test/tsconfig.json ../../node_modules/.bin/mocha --loader=ts-node/esm --parallel=false", + "test": "cross-env TS_NODE_PROJECT=test/tsconfig.json mocha", + "test:local": "cross-env TS_NODE_PROJECT=test/tsconfig.json ../../node_modules/.bin/mocha", "tsc": "tsc -b " } }