From 232fa7dff2826df1f8a08bee3d2ece56daedbdc0 Mon Sep 17 00:00:00 2001 From: Harminder Virk Date: Mon, 3 Jul 2023 16:01:16 +0530 Subject: [PATCH 1/8] chore: update dependencies --- package.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 48981a8..860f433 100644 --- a/package.json +++ b/package.json @@ -41,35 +41,35 @@ "author": "adonisjs,virk", "license": "MIT", "devDependencies": { - "@commitlint/cli": "^17.5.0", - "@commitlint/config-conventional": "^17.4.4", + "@commitlint/cli": "^17.6.6", + "@commitlint/config-conventional": "^17.6.6", "@japa/assert": "^1.4.1", "@japa/expect-type": "^1.0.3", "@japa/run-failed-tests": "^1.1.1", "@japa/runner": "^2.5.1", "@japa/spec-reporter": "^1.3.3", - "@swc/core": "^1.3.42", + "@swc/core": "^1.3.67", "@types/bcrypt": "^5.0.0", - "@types/node": "^18.15.10", + "@types/node": "^20.3.3", "argon2": "^0.30.3", "bcrypt": "^5.1.0", - "c8": "^7.13.0", + "c8": "^8.0.0", "cross-env": "^7.0.3", "del-cli": "^5.0.0", - "eslint": "^8.36.0", + "eslint": "^8.44.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-adonis": "^3.0.3", "eslint-plugin-prettier": "^4.2.1", "github-label-sync": "^2.3.1", "husky": "^8.0.3", - "np": "^7.6.4", - "prettier": "^2.8.7", + "np": "^8.0.4", + "prettier": "^2.8.8", "ts-node": "^10.9.1", - "typescript": "^5.0.2" + "typescript": "^5.1.6" }, "dependencies": { "@phc/format": "^1.0.0", - "@poppinss/utils": "^6.5.0-2" + "@poppinss/utils": "^6.5.0-3" }, "peerDependencies": { "argon2": "^0.30.3", From 56de0b085ff0c4b40e74177d6338223c592ce2b3 Mon Sep 17 00:00:00 2001 From: Harminder Virk Date: Mon, 3 Jul 2023 16:03:25 +0530 Subject: [PATCH 2/8] chore: upgrade japa to v3 --- bin/japa_types.ts | 7 ------- bin/test.ts | 15 ++++----------- package.json | 8 +++----- 3 files changed, 7 insertions(+), 23 deletions(-) delete mode 100644 bin/japa_types.ts diff --git a/bin/japa_types.ts b/bin/japa_types.ts deleted file mode 100644 index d42cac6..0000000 --- a/bin/japa_types.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Assert } from '@japa/assert' - -declare module '@japa/runner' { - interface TestContext { - assert: Assert - } -} diff --git a/bin/test.ts b/bin/test.ts index ee6d2e9..c4a7b31 100644 --- a/bin/test.ts +++ b/bin/test.ts @@ -1,9 +1,6 @@ import { assert } from '@japa/assert' -import { pathToFileURL } from 'node:url' import { expectTypeOf } from '@japa/expect-type' -import { specReporter } from '@japa/spec-reporter' -import { runFailedTests } from '@japa/run-failed-tests' -import { processCliArgs, configure, run } from '@japa/runner' +import { processCLIArgs, configure, run } from '@japa/runner' /* |-------------------------------------------------------------------------- @@ -18,14 +15,10 @@ import { processCliArgs, configure, run } from '@japa/runner' | | Please consult japa.dev/runner-config for the config docs. */ +processCLIArgs(process.argv.slice(2)) configure({ - ...processCliArgs(process.argv.slice(2)), - ...{ - files: ['tests/**/*.spec.ts'], - plugins: [assert(), runFailedTests(), expectTypeOf()], - reporters: [specReporter()], - importer: (filePath: string) => import(pathToFileURL(filePath).href), - }, + files: ['tests/**/*.spec.ts'], + plugins: [assert(), expectTypeOf()], }) /* diff --git a/package.json b/package.json index 860f433..9e48cf7 100644 --- a/package.json +++ b/package.json @@ -43,11 +43,9 @@ "devDependencies": { "@commitlint/cli": "^17.6.6", "@commitlint/config-conventional": "^17.6.6", - "@japa/assert": "^1.4.1", - "@japa/expect-type": "^1.0.3", - "@japa/run-failed-tests": "^1.1.1", - "@japa/runner": "^2.5.1", - "@japa/spec-reporter": "^1.3.3", + "@japa/assert": "^2.0.0-1", + "@japa/expect-type": "^2.0.0-0", + "@japa/runner": "^3.0.0-3", "@swc/core": "^1.3.67", "@types/bcrypt": "^5.0.0", "@types/node": "^20.3.3", From 3eb00d177f7dee6c5d87926fcbfae84998c5bf4e Mon Sep 17 00:00:00 2001 From: Harminder Virk Date: Mon, 3 Jul 2023 16:04:43 +0530 Subject: [PATCH 3/8] chore: use @adonisjs/tooling presets for tooling config --- .github/workflows/checks.yml | 14 ++++++++++++ .github/workflows/test.yml | 7 ------ package.json | 43 ++++++++---------------------------- tsconfig.json | 31 +++----------------------- 4 files changed, 26 insertions(+), 69 deletions(-) create mode 100644 .github/workflows/checks.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000..c27fb04 --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,14 @@ +name: checks +on: + - push + - pull_request + +jobs: + test: + uses: adonisjs/.github/.github/workflows/test.yml@main + + lint: + uses: adonisjs/.github/.github/workflows/lint.yml@main + + typecheck: + uses: adonisjs/.github/.github/workflows/typecheck.yml@main diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 2d9bc9e..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: test -on: - - push - - pull_request -jobs: - test: - uses: adonisjs/.github/.github/workflows/test.yml@main diff --git a/package.json b/package.json index 9e48cf7..3f85dc7 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "pretest": "npm run lint", "test": "cross-env NODE_DEBUG=adonisjs:hash c8 npm run vscode:test", "clean": "del-cli build", + "typecheck": "tsc --noEmit", "compile": "npm run lint && npm run clean && tsc", "build": "npm run compile", "release": "np", @@ -41,6 +42,9 @@ "author": "adonisjs,virk", "license": "MIT", "devDependencies": { + "@adonisjs/eslint-config": "^1.1.7", + "@adonisjs/prettier-config": "^1.1.7", + "@adonisjs/tsconfig": "^1.1.7", "@commitlint/cli": "^17.6.6", "@commitlint/config-conventional": "^17.6.6", "@japa/assert": "^2.0.0-1", @@ -55,9 +59,6 @@ "cross-env": "^7.0.3", "del-cli": "^5.0.0", "eslint": "^8.44.0", - "eslint-config-prettier": "^8.8.0", - "eslint-plugin-adonis": "^3.0.3", - "eslint-plugin-prettier": "^4.2.1", "github-label-sync": "^2.3.1", "husky": "^8.0.3", "np": "^8.0.4", @@ -89,36 +90,6 @@ "url": "https://github.com/poppinss/hash/issues" }, "homepage": "https://github.com/poppinss/hash#readme", - "eslintConfig": { - "extends": [ - "plugin:adonis/typescriptPackage", - "prettier" - ], - "plugins": [ - "prettier" - ], - "rules": { - "prettier/prettier": [ - "error", - { - "endOfLine": "auto" - } - ] - } - }, - "eslintIgnore": [ - "build" - ], - "prettier": { - "trailingComma": "es5", - "semi": false, - "singleQuote": true, - "useTabs": false, - "quoteProps": "consistent", - "bracketSpacing": true, - "arrowParens": "always", - "printWidth": 100 - }, "commitlint": { "extends": [ "@commitlint/config-conventional" @@ -143,5 +114,9 @@ "tests/**", "src/legacy/**" ] - } + }, + "eslintConfig": { + "extends": "@adonisjs/eslint-config/package" + }, + "prettier": "@adonisjs/prettier-config" } diff --git a/tsconfig.json b/tsconfig.json index d6f4b0f..2039043 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,32 +1,7 @@ { + "extends": "@adonisjs/tsconfig/tsconfig.package.json", "compilerOptions": { - "target": "ESNext", - "module": "NodeNext", - "lib": ["ESNext"], - "noUnusedLocals": true, - "noUnusedParameters": true, - "isolatedModules": true, - "removeComments": true, - "allowJs": true, - "declaration": true, "rootDir": "./", - "outDir": "./build", - "esModuleInterop": true, - "strictNullChecks": true, - "allowSyntheticDefaultImports": true, - "forceConsistentCasingInFileNames": true, - "strictPropertyInitialization": true, - "noImplicitAny": true, - "strictBindCallApply": true, - "strictFunctionTypes": true, - "declarationMap": true, - "noImplicitThis": true, - "skipLibCheck": true, - "types": ["@types/node"] - }, - "include": ["./**/*"], - "exclude": ["./node_modules", "./build"], - "ts-node": { - "swc": true + "outDir": "./build" } -} +} \ No newline at end of file From c4f4204b99bd8cfd34f35d916cdd3d90dce0e745 Mon Sep 17 00:00:00 2001 From: Harminder Virk Date: Mon, 3 Jul 2023 16:05:14 +0530 Subject: [PATCH 4/8] chore: do not publish source files --- package.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/package.json b/package.json index 3f85dc7..4e77a33 100644 --- a/package.json +++ b/package.json @@ -5,13 +5,9 @@ "main": "build/index.js", "type": "module", "files": [ - "src", - "test_factories", - "index.ts", "build/src", "build/test_factories", "build/index.d.ts", - "build/index.d.ts.map", "build/index.js" ], "exports": { From 36ac3e77fa762cc1ab59b4f303ad0eafdde1f76b Mon Sep 17 00:00:00 2001 From: Harminder Virk Date: Mon, 3 Jul 2023 16:05:37 +0530 Subject: [PATCH 5/8] chore: add engines to package.json file --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 4e77a33..ebb358e 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,9 @@ "./types": "./build/src/types.js", "./factories": "./build/test_factories/main.js" }, + "engines": { + "node": ">=18.16.0" + }, "scripts": { "pretest": "npm run lint", "test": "cross-env NODE_DEBUG=adonisjs:hash c8 npm run vscode:test", From f1bafa56a6cef49b137223cc64930c8c6400cb12 Mon Sep 17 00:00:00 2001 From: Harminder Virk Date: Mon, 3 Jul 2023 16:06:38 +0530 Subject: [PATCH 6/8] docs(README): remove snyk badge and update tests badge URL --- README.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 814ebe5..f33cc42 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@
-[![gh-workflow-image]][gh-workflow-url] [![npm-image]][npm-url] ![][typescript-image] [![license-image]][license-url] [![synk-image]][synk-url] +[![gh-workflow-image]][gh-workflow-url] [![npm-image]][npm-url] ![][typescript-image] [![license-image]][license-url] ## Introduction AdonisJS hash is a driver based hashing library. We ship with `argon2`, `bcrypt` and `scrypt` drivers. The generated hash from all the drivers are formatted using the [PHC string format](https://github.com/P-H-C/phc-string-format/blob/master/phc-sf-spec.md) @@ -21,8 +21,8 @@ In order to ensure that the AdonisJS community is welcoming to all, please revie ## License AdonisJS hash is open-sourced software licensed under the [MIT license](LICENSE.md). -[gh-workflow-image]: https://img.shields.io/github/actions/workflow/status/adonisjs/hash/test.yml?style=for-the-badge -[gh-workflow-url]: https://github.com/adonisjs/hash/actions/workflows/test.yml "Github action" +[gh-workflow-image]: https://img.shields.io/github/actions/workflow/status/adonisjs/hash/checks.yml?style=for-the-badge +[gh-workflow-url]: https://github.com/adonisjs/hash/actions/workflows/checks.yml "Github action" [typescript-image]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript [typescript-url]: "typescript" @@ -32,6 +32,3 @@ AdonisJS hash is open-sourced software licensed under the [MIT license](LICENSE. [license-image]: https://img.shields.io/npm/l/@adonisjs/hash?color=blueviolet&style=for-the-badge [license-url]: LICENSE.md "license" - -[synk-image]: https://img.shields.io/snyk/vulnerabilities/github/adonisjs/hash?label=Synk%20Vulnerabilities&style=for-the-badge -[synk-url]: https://snyk.io/test/github/adonisjs/hash?targetFile=package.json "synk" From ab7c0cee804aae839545210f90fc2aaf62efd767 Mon Sep 17 00:00:00 2001 From: Harminder Virk Date: Mon, 3 Jul 2023 16:11:05 +0530 Subject: [PATCH 7/8] chore: allow js files in tsconfig file --- tsconfig.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 2039043..e6fe66f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,6 +2,7 @@ "extends": "@adonisjs/tsconfig/tsconfig.package.json", "compilerOptions": { "rootDir": "./", - "outDir": "./build" + "outDir": "./build", + "allowJs": true } -} \ No newline at end of file +} From cc16ea9b553101aacfcbf94927ea68c71caa122c Mon Sep 17 00:00:00 2001 From: Harminder Virk Date: Mon, 3 Jul 2023 16:11:56 +0530 Subject: [PATCH 8/8] chore(release): 8.3.1-3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ebb358e..8fed6dd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@adonisjs/hash", - "version": "8.3.1-2", + "version": "8.3.1-3", "description": "Framework agnostic Password hashing package with support for PHC string format", "main": "build/index.js", "type": "module",