-
-
Notifications
You must be signed in to change notification settings - Fork 698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: migrate to typescript #1567
base: main
Are you sure you want to change the base?
Changes from all commits
ccd7706
4beb6f5
7e614bd
5c0e656
c8c24a1
9b98008
133e05c
50ded4d
e175899
941cbe8
2e165b2
aedefa2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,4 @@ test/auth/* | |
|
||
/chai.js | ||
/chai.cjs | ||
/lib |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -3,6 +3,11 @@ | |||||
"name": "chai", | ||||||
"type": "module", | ||||||
"description": "BDD/TDD assertion library for node.js and the browser. Test framework agnostic.", | ||||||
"files": [ | ||||||
"lib", | ||||||
"/chai.js", | ||||||
"/register-*" | ||||||
], | ||||||
"keywords": [ | ||||||
"test", | ||||||
"assertion", | ||||||
|
@@ -29,14 +34,15 @@ | |||||
"main": "./chai.js", | ||||||
"scripts": { | ||||||
"prebuild": "npm run clean", | ||||||
"build": "npm run build:esm", | ||||||
"build:esm": "esbuild --bundle --format=esm --keep-names --outfile=chai.js index.js", | ||||||
"build": "npm run build:ts && npm run build:esm", | ||||||
"build:ts": "tsc", | ||||||
"build:esm": "esbuild --bundle --format=esm --keep-names --outfile=chai.js src/chai.ts", | ||||||
"pretest": "npm run lint && npm run build", | ||||||
"test": "npm run test-node && npm run test-chrome", | ||||||
"test-node": "mocha --require ./test/bootstrap/index.js --reporter dot test/*.js", | ||||||
"test-chrome": "web-test-runner --playwright", | ||||||
"lint": "eslint lib/", | ||||||
"clean": "rm -f chai.js coverage" | ||||||
"clean": "rm -rf chai.js coverage lib" | ||||||
}, | ||||||
"engines": { | ||||||
"node": ">=12" | ||||||
|
@@ -46,7 +52,10 @@ | |||||
"check-error": "^2.1.1", | ||||||
"deep-eql": "^5.0.1", | ||||||
"loupe": "^3.1.0", | ||||||
"pathval": "^2.0.0" | ||||||
"pathval": "^2.0.0", | ||||||
"@types/check-error": "^1.0.3", | ||||||
"@types/deep-eql": "^4.0.2", | ||||||
"@types/pathval": "^1.1.2" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if you're curious: these are prod dependencies since we export some of them in our public interface. so typescript consumers need to pull these types down too |
||||||
}, | ||||||
"devDependencies": { | ||||||
"@rollup/plugin-commonjs": "^25.0.7", | ||||||
|
@@ -56,6 +65,7 @@ | |||||
"esbuild": "^0.19.10", | ||||||
"eslint": "^8.56.0", | ||||||
"eslint-plugin-jsdoc": "^48.0.4", | ||||||
"mocha": "^10.2.0" | ||||||
"mocha": "^10.2.0", | ||||||
"typescript": "^5.3.3" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think about changing this to a tilde since TypeScript doesn't follow semver?
Suggested change
|
||||||
} | ||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import {assert} from './index.js'; | ||
import {assert} from './lib/chai.js'; | ||
|
||
globalThis.assert = assert; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we doing both? Is it to check for type errors? If yes, can we create a
"lint:types": "tsc --noEmit"
task and run that in the existinglint
task?