diff --git a/.github/actions/build-cache/action.yml b/.github/actions/build-cache/action.yml index 3c7a68f4b..6eff7b26e 100644 --- a/.github/actions/build-cache/action.yml +++ b/.github/actions/build-cache/action.yml @@ -10,5 +10,7 @@ runs: path: | node_modules packages/*/dist + packages/*/es + packages/jimp/browser/lib key: ${{ github.run_id }} restore-keys: ${{ github.run_id }} diff --git a/.gitignore b/.gitignore index e7b9841be..f879aa727 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,4 @@ package-lock.json dist/ # ESM Version es/ +jimp.js.* \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2b7a20209..5ec41edb5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,7 +31,7 @@ If you know how to code, we welcome you to send fixes and new features, but in o ```sh yarn # install and link all packages in monorepo -yarn build # build ES5, ESM, and browserify +yarn build # or yarn build:watch # build ES5 version in watch mode. Good to run while testing or developing. ``` diff --git a/package.json b/package.json index f002d1da6..b9b596494 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "babel-plugin-source-map-support": "^2.1.1", "babel-plugin-transform-inline-environment-variables": "^0.4.3", "cross-env": "^6.0.0", - "dtslint": "^0.9.8", + "dtslint": "^4.2.1", "eslint": "^8.27.0", "eslint-config-prettier": "^8.6.0", "eslint-config-xo": "^0.43.1", @@ -58,15 +58,13 @@ "karma-mocha": "^1.3.0", "karma-mocha-reporter": "^2.2.5", "lerna": "^3.16.4", - "lerna-changelog": "^0.8.2", "lint-staged": "^9.2.5", "mocha": "^6.2.0", "nyc": "^14.1.1", "patch-package": "^6.5.1", "prettier": "^2.8.3", "should": "^13.2.3", - "source-map-support": "^0.5.13", - "watchify": "^3.11.1" + "source-map-support": "^0.5.13" }, "auto": { "plugins": [ diff --git a/packages/core/package.json b/packages/core/package.json index dc5b9e5c3..cab0287ca 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -5,6 +5,7 @@ "main": "dist/index.js", "module": "es/index.js", "types": "types/index.d.ts", + "sideEffects": false, "files": [ "dist", "es", diff --git a/packages/custom/types/index.d.ts b/packages/custom/types/index.d.ts index 4bdca8d07..dc5288788 100644 --- a/packages/custom/types/index.d.ts +++ b/packages/custom/types/index.d.ts @@ -1,4 +1,4 @@ -// TypeScript Version: 3.1 +// Minimum TypeScript Version: 3.2 // See the `jimp` package index.d.ts for why the version is not 2.8 import { FunctionRet, diff --git a/packages/jimp/README.md b/packages/jimp/README.md index 08948f229..f5251ca3e 100644 --- a/packages/jimp/README.md +++ b/packages/jimp/README.md @@ -77,21 +77,6 @@ If you're using a web bundles (webpack, rollup, parcel) you can benefit from usi import Jimp from "jimp/es"; ``` -### WebPack - -If you're using webpack you can set `process.browser` to true and your build of jimp will exclude certain parts, making it load faster. - -```js -{ - plugins: [ - new webpack.DefinePlugin({ - 'process.browser': 'true' - }), - ... - ], -} -``` - ## Basic usage The static `Jimp.read` method takes the path to a file, URL, dimensions, a Jimp instance or a buffer and returns a Promise: diff --git a/packages/jimp/browser/examples/example1.html b/packages/jimp/browser/examples/example1.html index 1145053f7..ed0b301b0 100644 --- a/packages/jimp/browser/examples/example1.html +++ b/packages/jimp/browser/examples/example1.html @@ -5,7 +5,7 @@