Skip to content
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

Update Type Tests to use Vitest #1199

Open
wants to merge 5 commits into
base: yarn-berry
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-deps
- uses: ./.github/actions/build-cache
- run: yarn tsTest:custom && yarn tsTest:main
- run: yarn test:ts

test:
runs-on: ubuntu-latest
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"build": "npm run clean:build && lerna run build --stream",
"build:watch": "lerna run build:watch --parallel",
"build:readme-toc": "npx doctoc ./README.md",
"tsTest:custom": "dtslint packages/custom/types --expectOnly",
"tsTest:main": "dtslint packages/jimp/types --expectOnly",
"test:ts": "lerna run test:ts --parallel -- --watch=false",
"postinstall": "patch-package"
},
"devDependencies": {
Expand All @@ -45,7 +44,6 @@
"babel-plugin-source-map-support": "^2.2.0",
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
"cross-env": "^6.0.0",
"dtslint": "^4.2.1",
"eslint": "^8.27.0",
"eslint-config-prettier": "^8.6.0",
"eslint-config-xo": "^0.43.1",
Expand Down
12 changes: 12 additions & 0 deletions packages/config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@jimp/config",
"private": true,
"version": "0.0.0-development",
"description": "Internal configs for Jimp's codebase",
"repository": "jimp-dev/jimp",
"author": "",
"license": "MIT",
"publishConfig": {
"access": "restricted"
}
}
13 changes: 13 additions & 0 deletions packages/config/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"skipLibCheck": true,
"noEmit": true
},
"include": ["**/*.ts"]
}
3 changes: 3 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
"pixelmatch": "^4.0.2",
"tinycolor2": "^1.6.0"
},
"devDependencies": {
"@jimp/config": "workspace:*"
},
"publishConfig": {
"access": "public"
}
Expand Down
3 changes: 3 additions & 0 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@jimp/config/tsconfig.json"
}
2 changes: 1 addition & 1 deletion packages/core/types/plugins.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* These files pertain to the typings of plugins or types
*
* They're not meant as utils to decode types, but rather
* the type definitons themsleves for plugins and types of various kinds
* the type definitions themselves for plugins and types of various kinds
*/
import { Image, EncoderFn, DecoderFn } from "./etc";

Expand Down
2 changes: 1 addition & 1 deletion packages/core/types/utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,6 @@ export type GetIntersectionFromPluginsStatics<

/**
* While this was added to TS 3.5, in order to support down to TS 2.8, we need
* to export this and use it in sub-packges that utilize it
* to export this and use it in sub-packages that utilize it
*/
export type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
15 changes: 14 additions & 1 deletion packages/custom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,26 @@
"build:module": "cross-env BABEL_ENV=module babel src -d es --source-maps --config-file ../../babel.config.js",
"build:node": "babel src -d dist --source-maps --config-file ../../babel.config.js",
"build:node:debug": "cross-env BABEL_ENV=development npm run build:node",
"build:node:production": "cross-env BABEL_ENV=production npm run build:node"
"build:node:production": "cross-env BABEL_ENV=production npm run build:node",
"test:ts": "vitest typecheck"
},
"author": "",
"license": "MIT",
"dependencies": {
"@jimp/core": "workspace:*"
},
"devDependencies": {
"@jimp/config": "workspace:*",
"@jimp/gif": "workspace:*",
"@jimp/plugin-displace": "workspace:*",
"@jimp/plugin-resize": "workspace:*",
"@jimp/plugin-scale": "workspace:*",
"@jimp/plugins": "workspace:*",
"@jimp/png": "workspace:*",
"@jimp/types": "workspace:*",
"typescript": "^4.9.5",
"vitest": "0.28.4"
},
"publishConfig": {
"access": "public"
}
Expand Down
3 changes: 3 additions & 0 deletions packages/custom/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@jimp/config/tsconfig.json"
}
1 change: 0 additions & 1 deletion packages/custom/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// See the `jimp` package index.d.ts for why the version is not 2.8
import {
FunctionRet,
Jimp,
JimpPlugin,
JimpType,
GetIntersectionFromPlugins,
Expand Down