diff --git a/.husky/commit-msg b/.husky/commit-msg deleted file mode 100755 index b567676..0000000 --- a/.husky/commit-msg +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - -npx --no -- commitlint --edit "$1" diff --git a/README.md b/README.md index d631768..1ec4966 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,9 @@ Install the package from the npm registry as follows: ```sh npm i @japa/expect +``` +```sh yarn add @japa/expect ``` diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..6c99b74 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,4 @@ +import { configPkg } from '@adonisjs/eslint-config' +export default configPkg({ + ignores: ['coverage'], +}) diff --git a/index.ts b/index.ts index af26158..37cd022 100644 --- a/index.ts +++ b/index.ts @@ -10,7 +10,6 @@ import { expect as jestExpect } from 'expect' import type { PluginFn } from '@japa/runner/types' import { Test, TestContext } from '@japa/runner/core' -import { Expect } from './src/types.js' /** * Expect plugin for "@japa/runner" @@ -34,6 +33,6 @@ export function expect(): PluginFn { declare module '@japa/runner/core' { interface TestContext { - expect: Expect + expect: typeof jestExpect } } diff --git a/package.json b/package.json index bc2e799..39d0ad2 100644 --- a/package.json +++ b/package.json @@ -5,63 +5,53 @@ "engines": { "node": ">=18.16.0" }, - "main": "build/index.js", "type": "module", "files": [ - "index.ts", - "src", - "build/src", - "build/index.d.ts", - "build/index.js", - "build/index.d.ts.map" + "build", + "!build/bin", + "!build/tests" ], "exports": { - ".": "./build/index.js", - "./types": "./build/src/types.js" + ".": "./build/index.js" }, "scripts": { - "pretest": "npm run lint && npm run typecheck", + "pretest": "npm run lint", "test": "c8 npm run quick:test", - "quick:test": "echo \"No tests yet\"", + "lint": "eslint .", + "format": "prettier --write .", + "typecheck": "tsc --noEmit", "clean": "del-cli build", - "compile": "npm run lint && npm run clean && tsc", + "precompile": "npm run lint && npm run clean", + "compile": "tsup-node && tsc --emitDeclarationOnly --declaration", "build": "npm run compile", - "release": "np --message=\"chore(release): %s\"", "version": "npm run build", "prepublishOnly": "npm run build", - "lint": "eslint . --ext=.ts", - "typecheck": "tsc --noEmit", - "format": "prettier --write .", - "sync-labels": "github-label-sync --labels .github/labels.json japa/expect" + "release": "release-it", + "quick:test": "echo \"No tests yet\"" }, "devDependencies": { - "@adonisjs/eslint-config": "^1.3.0", - "@adonisjs/prettier-config": "^1.3.0", - "@adonisjs/tsconfig": "^1.3.0", - "@commitlint/cli": "^19.2.1", - "@commitlint/config-conventional": "^19.1.0", - "@japa/runner": "^3.1.2", - "@swc/core": "^1.4.11", + "@adonisjs/eslint-config": "^2.0.0-beta.7", + "@adonisjs/prettier-config": "^1.4.0", + "@adonisjs/tsconfig": "^1.4.0", + "@japa/runner": "^4.0.0", + "@release-it/conventional-changelog": "^9.0.4", + "@swc/core": "^1.10.4", "@types/luxon": "^3.4.2", - "@types/node": "^20.11.30", - "c8": "^9.1.0", - "del-cli": "^5.1.0", - "eslint": "^8.57.0", - "github-label-sync": "^2.3.1", - "husky": "^9.0.11", - "np": "^10.0.2", - "prettier": "^3.2.5", - "ts-node": "^10.9.2", - "typescript": "^5.4.3" + "@types/node": "^22.10.5", + "c8": "^10.1.3", + "del-cli": "^6.0.0", + "eslint": "^9.17.0", + "prettier": "^3.4.2", + "release-it": "^17.11.0", + "tsup": "^8.3.5", + "typescript": "^5.7.2" }, "dependencies": { - "expect": "^29.5.0" + "expect": "^29.7.0" }, "peerDependencies": { - "@japa/runner": "^3.0.0" + "@japa/runner": "^3.0.0 || ^4.0.0" }, - "author": "virk,japa", - "license": "MIT", "homepage": "https://github.com/japa/expect#readme", "repository": { "type": "git", @@ -75,24 +65,46 @@ "jest", "japa" ], - "eslintConfig": { - "extends": "@adonisjs/eslint-config/package" - }, - "prettier": "@adonisjs/prettier-config", - "commitlint": { - "extends": [ - "@commitlint/config-conventional" - ] - }, + "author": "Harminder Virk ", + "license": "MIT", "publishConfig": { "access": "public", - "tag": "latest" + "provenance": true }, - "np": { - "message": "chore(release): %s", - "tag": "latest", - "branch": "main", - "anyBranch": false + "tsup": { + "entry": [ + "index.ts" + ], + "outDir": "./build", + "clean": true, + "format": "esm", + "dts": false, + "sourcemap": false, + "target": "esnext" + }, + "release-it": { + "git": { + "requireCleanWorkingDir": true, + "requireUpstream": true, + "commitMessage": "chore(release): ${version}", + "tagAnnotation": "v${version}", + "push": true, + "tagName": "v${version}" + }, + "github": { + "release": true + }, + "npm": { + "publish": true, + "skipChecks": true + }, + "plugins": { + "@release-it/conventional-changelog": { + "preset": { + "name": "angular" + } + } + } }, "c8": { "reporter": [ @@ -102,5 +114,6 @@ "exclude": [ "tests/**" ] - } + }, + "prettier": "@adonisjs/prettier-config" } diff --git a/src/types.ts b/src/types.ts deleted file mode 100644 index b4f7f8e..0000000 --- a/src/types.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * @japa/expect - * - * (c) Japa.dev - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -import { expect as jestExpect } from 'expect' - -/** - * Jest expect type - */ -export type Expect = typeof jestExpect