@napi-rs/canvas 0.1.15 → 0.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,27 +1,32 @@
1
- ## [0.1.15](https://github.com/Brooooooklyn/canvas/compare/v0.1.14...v0.1.15) (2021-11-11)
1
+ ## [0.1.17](https://github.com/Brooooooklyn/canvas/compare/v0.1.16...v0.1.17) (2021-12-12)
2
2
 
3
+ ## [0.1.16](https://github.com/Brooooooklyn/canvas/compare/v0.1.15...v0.1.16) (2021-12-12)
3
4
 
4
5
  ### Bug Fixes
5
6
 
6
- * `vercel/nft` and `webpack` compatible issue ([f2e23f5](https://github.com/Brooooooklyn/canvas/commit/f2e23f5d763795c1e499e1eda5b70078a6de501a))
7
+ - make methods on ctx configurable & writable ([affe82d](https://github.com/Brooooooklyn/canvas/commit/affe82d0b8880441737497403d790f4d39a217c3))
7
8
 
9
+ ### Features
8
10
 
11
+ - chrome/m97 ([66c900f](https://github.com/Brooooooklyn/canvas/commit/66c900f4307f8204b55912659874a83513220460))
9
12
 
10
- ## [0.1.14](https://github.com/Brooooooklyn/canvas/compare/v0.1.13...v0.1.14) (2021-10-26)
11
-
13
+ ## [0.1.15](https://github.com/Brooooooklyn/canvas/compare/v0.1.14...v0.1.15) (2021-11-11)
12
14
 
13
15
  ### Bug Fixes
14
16
 
15
- * Now generating avif images is 10x+ faster. ([407d1d1](https://github.com/Brooooooklyn/canvas/commit/407d1d1f09dce622426b71ee800480534c8e0888))
16
- * Use different quality for WebP and JPEG formats, which is more in line with the browser's default values. ([fdefa5d](https://github.com/Brooooooklyn/canvas/commit/fdefa5dd278fcc911cb74524388ec7960d9cd1f6))
17
+ - `vercel/nft` and `webpack` compatible issue ([f2e23f5](https://github.com/Brooooooklyn/canvas/commit/f2e23f5d763795c1e499e1eda5b70078a6de501a))
17
18
 
19
+ ## [0.1.14](https://github.com/Brooooooklyn/canvas/compare/v0.1.13...v0.1.14) (2021-10-26)
18
20
 
19
- ### Features
21
+ ### Bug Fixes
20
22
 
21
- * The option to generate avif removes alphaQuality and calculates it internally. ([8de6e95](https://github.com/Brooooooklyn/canvas/commit/8de6e95d23383897870c66e59698a71cd0e73631))
22
- * Add a new SVG generation avif example. ([04d401a](https://github.com/Brooooooklyn/canvas/commit/04d401aaf3d35d13223e32af9e13b829f13170fc))
23
+ - Now generating avif images is 10x+ faster. ([407d1d1](https://github.com/Brooooooklyn/canvas/commit/407d1d1f09dce622426b71ee800480534c8e0888))
24
+ - Use different quality for WebP and JPEG formats, which is more in line with the browser's default values. ([fdefa5d](https://github.com/Brooooooklyn/canvas/commit/fdefa5dd278fcc911cb74524388ec7960d9cd1f6))
23
25
 
26
+ ### Features
24
27
 
28
+ - The option to generate avif removes alphaQuality and calculates it internally. ([8de6e95](https://github.com/Brooooooklyn/canvas/commit/8de6e95d23383897870c66e59698a71cd0e73631))
29
+ - Add a new SVG generation avif example. ([04d401a](https://github.com/Brooooooklyn/canvas/commit/04d401aaf3d35d13223e32af9e13b829f13170fc))
25
30
 
26
31
  ## [0.1.13](https://github.com/Brooooooklyn/canvas/compare/v0.1.12...v0.1.13) (2021-10-20)
27
32
 
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # `skr canvas`
2
2
 
3
3
  ![CI](https://github.com/Brooooooklyn/canvas/workflows/CI/badge.svg)
4
- ![Skia Version](https://img.shields.io/badge/Skia-chrome%2Fm96-hotpink)
4
+ ![Skia Version](https://img.shields.io/badge/Skia-chrome%2Fm97-hotpink)
5
5
  [![install size](https://packagephobia.com/badge?p=@napi-rs/canvas)](https://packagephobia.com/result?p=@napi-rs/canvas)
6
6
  [![Downloads](https://img.shields.io/npm/dm/@napi-rs/canvas.svg?sanitize=true)](https://npmcharts.com/compare/@napi-rs/canvas?minimal=true)
7
7
 
@@ -300,7 +300,6 @@ path.simplify().toSVGString()
300
300
 
301
301
  <img width="500" src="example/tiger.png">
302
302
 
303
-
304
303
  ```shell
305
304
  node example/anime-girl.js
306
305
  ```
@@ -309,7 +308,6 @@ node example/anime-girl.js
309
308
  | ---------------------------------------------- | ---------------------------------------------- |
310
309
  | <img width="500" src="example/anime-girl.svg"> | <img width="500" src="example/anime-girl.png"> |
311
310
 
312
-
313
311
  # Building
314
312
 
315
313
  ## Build skia from source
package/index.js CHANGED
@@ -187,9 +187,9 @@ function createCanvas(width, height, flag) {
187
187
  }
188
188
  return new ImageData(widthOrImage, height, { colorSpace: 'srgb', ...attrs })
189
189
  },
190
- configurable: false,
190
+ configurable: true,
191
191
  enumerable: false,
192
- writable: false,
192
+ writable: true,
193
193
  })
194
194
 
195
195
  Object.defineProperty(canvasElement, 'ctx', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@napi-rs/canvas",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "Canvas for Node.js with skia backend",
5
5
  "main": "index.js",
6
6
  "repository": "https://github.com/Brooooooklyn/canvas.git",
@@ -50,12 +50,9 @@
50
50
  "bench": "node -r @swc-node/register benchmark/bench.ts",
51
51
  "build": "napi build --platform --release",
52
52
  "build:debug": "napi build --platform",
53
- "format": "run-p format:md format:json format:yaml format:source format:rs",
54
- "format:md": "prettier --parser markdown --write ./**/*.md",
55
- "format:json": "prettier --parser json --write ./**/*.json",
53
+ "format": "run-p format:source format:rs",
56
54
  "format:rs": "cargo fmt",
57
- "format:source": "prettier --config ./package.json --write ./**/*.{js,ts}",
58
- "format:yaml": "prettier --parser yaml --write ./**/*.{yml,yaml}",
55
+ "format:source": "prettier . -w",
59
56
  "lint": "eslint . -c ./.eslintrc.yml",
60
57
  "prepublishOnly": "pinst --disable && napi prepublish -t npm",
61
58
  "postpublish": "pinst --enable",
@@ -70,44 +67,37 @@
70
67
  "@napi-rs/cli": "^1.3.5",
71
68
  "@octokit/rest": "^18.12.0",
72
69
  "@swc-node/register": "^1.4.0",
73
- "@types/lodash": "^4.14.176",
74
- "@typescript-eslint/eslint-plugin": "^5.3.1",
75
- "@typescript-eslint/parser": "^5.3.1",
70
+ "@types/lodash": "^4.14.178",
71
+ "@typescript-eslint/eslint-plugin": "^5.6.0",
72
+ "@typescript-eslint/parser": "^5.6.0",
76
73
  "ava": "^3.15.0",
77
74
  "benny": "^3.7.1",
78
75
  "canvas": "^2.8.0",
79
- "canvaskit-wasm": "^0.30.0",
80
- "chalk": "^4.1.2",
76
+ "canvaskit-wasm": "^0.31.0",
77
+ "chalk": "4",
81
78
  "conventional-changelog-cli": "^2.1.1",
82
- "eslint": "^8.2.0",
79
+ "eslint": "^8.4.1",
83
80
  "eslint-config-prettier": "^8.3.0",
84
81
  "eslint-plugin-import": "^2.25.3",
85
82
  "eslint-plugin-prettier": "^4.0.0",
86
- "eslint-plugin-sonarjs": "^0.10.0",
83
+ "eslint-plugin-sonarjs": "^0.11.0",
87
84
  "husky": "^7.0.4",
88
- "lint-staged": "^11.2.6",
85
+ "lint-staged": "^12.1.2",
89
86
  "lodash": "^4.17.21",
90
87
  "npm-run-all": "^4.1.5",
91
88
  "pinst": "^2.1.6",
92
89
  "png.js": "^0.2.1",
93
- "prettier": "^2.4.1",
90
+ "prettier": "^2.5.1",
94
91
  "putasset": "^5.0.3",
95
92
  "skia-canvas": "^0.9.27",
96
- "typescript": "^4.4.4"
93
+ "typescript": "^4.5.3"
97
94
  },
98
95
  "lint-staged": {
96
+ "*.@(js|ts|tsx|yml|yaml|md|json)": [
97
+ "prettier --write"
98
+ ],
99
99
  "*.@(js|ts|tsx)": [
100
- "prettier --write",
101
100
  "eslint -c .eslintrc.yml --fix"
102
- ],
103
- "*.@(yml|yaml)": [
104
- "prettier --parser yaml --write"
105
- ],
106
- "*.md": [
107
- "prettier --parser markdown --write"
108
- ],
109
- "*.json": [
110
- "prettier --parser json --write"
111
101
  ]
112
102
  },
113
103
  "ava": {
@@ -128,18 +118,17 @@
128
118
  "semi": false,
129
119
  "trailingComma": "all",
130
120
  "singleQuote": true,
131
- "arrowParens": "always",
132
- "parser": "typescript"
121
+ "arrowParens": "always"
133
122
  },
134
123
  "optionalDependencies": {
135
- "@napi-rs/canvas-win32-x64-msvc": "0.1.15",
136
- "@napi-rs/canvas-darwin-x64": "0.1.15",
137
- "@napi-rs/canvas-linux-x64-gnu": "0.1.15",
138
- "@napi-rs/canvas-linux-arm-gnueabihf": "0.1.15",
139
- "@napi-rs/canvas-linux-x64-musl": "0.1.15",
140
- "@napi-rs/canvas-linux-arm64-gnu": "0.1.15",
141
- "@napi-rs/canvas-linux-arm64-musl": "0.1.15",
142
- "@napi-rs/canvas-darwin-arm64": "0.1.15",
143
- "@napi-rs/canvas-android-arm64": "0.1.15"
124
+ "@napi-rs/canvas-win32-x64-msvc": "0.1.17",
125
+ "@napi-rs/canvas-darwin-x64": "0.1.17",
126
+ "@napi-rs/canvas-linux-x64-gnu": "0.1.17",
127
+ "@napi-rs/canvas-linux-arm-gnueabihf": "0.1.17",
128
+ "@napi-rs/canvas-linux-x64-musl": "0.1.17",
129
+ "@napi-rs/canvas-linux-arm64-gnu": "0.1.17",
130
+ "@napi-rs/canvas-linux-arm64-musl": "0.1.17",
131
+ "@napi-rs/canvas-darwin-arm64": "0.1.17",
132
+ "@napi-rs/canvas-android-arm64": "0.1.17"
144
133
  }
145
134
  }