Skip to content

Commit

Permalink
Fix 0.8 typings, add type tests (#786)
Browse files Browse the repository at this point in the history
* Fixes typing issues with 0.8 and add initial typing tests

* Fix error in utils typing import

* Confirmed fixed build, test, and type test, left comments

* Moved lengthy `@core` typings to subfiles and barrel index

* Initial work to get configure composure working

* Fixed error introduced in prior commit, improved type tests

* Fixed issues with plugin or types being null

* Code cleanup, final fixes

* add type tests to CI

* Added initial 3.1 types

* Move @core/jimp to a class rather than an interface

* Minor cleanup, linting, etc
  • Loading branch information
crutchcorn authored and hipstersmoothie committed Sep 12, 2019
1 parent 11f2dcb commit 6c8b9de
Show file tree
Hide file tree
Showing 42 changed files with 1,530 additions and 426 deletions.
16 changes: 16 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ jobs:
name: Lint
command: yarn lint

test-types:
<<: *defaults
steps:
- attach_workspace:
at: ~/jimp
- run:
name: Test Types
command: yarn tsTest:custom && yarn tsTest:main

build-node6.14:
working_directory: ~/jimp-6.14
docker:
Expand Down Expand Up @@ -115,17 +124,24 @@ workflows:
requires:
- install

- test-types:
requires:
- install

- build-node6.14:
requires:
- lint
- test-types

- build-node8:
requires:
- lint
- test-types

- build-node10:
requires:
- lint
- test-types

- release:
requires:
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"repository": "oliver-moran/jimp",
"author": "Andrew Lisowski <lisowski54@gmail.com>",
"publishConfig": {
"registry":"https://registry.npmjs.org/"
},
"registry": "https://registry.npmjs.org/"
},
"scripts": {
"lint": "xo",
"test": "cross-env BABEL_ENV=test mocha --require @babel/register './packages/**/test/**/*.test.js' --require ts-node/register ./packages/**/test/*.test.ts",
Expand All @@ -20,7 +20,9 @@
"clean:build": "rm -rf packages/**/es packages/**/dist",
"build": "npm run clean:build && lerna run build --stream",
"build:watch": "lerna run build:watch --parallel",
"release": "auto shipit"
"release": "auto shipit",
"tsTest:custom": "dtslint packages/custom/types --expectOnly",
"tsTest:main": "dtslint packages/jimp/types --expectOnly"
},
"devDependencies": {
"@babel/cli": "^7.1.0",
Expand All @@ -36,6 +38,7 @@
"babel-plugin-source-map-support": "^2.0.1",
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
"cross-env": "^5.2.0",
"dtslint": "^0.9.6",
"eslint-plugin-prettier": "^2.6.2",
"express": "^4.16.3",
"husky": "^1.0.0-rc.15",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/load-font.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { log } from './log';
export async function loadFont(font?: string, verbose?: boolean) {
if (font) {
log(` 🔤 Loading font: ${font} ...`, verbose);
return await Jimp.loadFont(Jimp[font] || font);
return await Jimp.loadFont((Jimp[font] as unknown as string) || font);
}

return;
Expand Down
Loading

0 comments on commit 6c8b9de

Please sign in to comment.