Skip to content

Commit

Permalink
chore: migrate to use release-it and tsup
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Jan 7, 2025
1 parent 3cbcb06 commit c904c99
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 75 deletions.
4 changes: 0 additions & 4 deletions .husky/commit-msg

This file was deleted.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ Install the package from the npm registry as follows:

```sh
npm i @japa/expect
```

```sh
yarn add @japa/expect
```

Expand Down
4 changes: 4 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { configPkg } from '@adonisjs/eslint-config'
export default configPkg({
ignores: ['coverage'],
})
3 changes: 1 addition & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -34,6 +33,6 @@ export function expect(): PluginFn {

declare module '@japa/runner/core' {
interface TestContext {
expect: Expect
expect: typeof jestExpect
}
}
121 changes: 67 additions & 54 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -75,24 +65,46 @@
"jest",
"japa"
],
"eslintConfig": {
"extends": "@adonisjs/eslint-config/package"
},
"prettier": "@adonisjs/prettier-config",
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"author": "Harminder Virk <[email protected]>",
"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": [
Expand All @@ -102,5 +114,6 @@
"exclude": [
"tests/**"
]
}
},
"prettier": "@adonisjs/prettier-config"
}
15 changes: 0 additions & 15 deletions src/types.ts

This file was deleted.

0 comments on commit c904c99

Please sign in to comment.