skia-canvas 3.0.1 → 3.0.3

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.
@@ -4,12 +4,7 @@
4
4
 
5
5
  "use strict"
6
6
 
7
- const {RustClass, readOnly, signature, inspect, REPR} = require('./neon'),
8
- {globSync, convertPathToPattern:quote} = require('fast-glob'),
9
- glob = paths => globSync(
10
- [paths].flat(2).map(p => p.indexOf('\\')>=0 ? quote(p) : p),
11
- {dot:true}
12
- )
7
+ const {RustClass, readOnly, signature, inspect, REPR} = require('./neon')
13
8
 
14
9
  class FontLibrary extends RustClass {
15
10
  constructor(){
@@ -27,11 +22,11 @@ class FontLibrary extends RustClass {
27
22
  if (sig=='o'){
28
23
  let results = {}
29
24
  for (let [alias, paths] of Object.entries(args.shift())){
30
- results[alias] = this.ƒ("addFamily", alias, glob(paths))
25
+ results[alias] = this.ƒ("addFamily", alias, [paths].flat())
31
26
  }
32
27
  return results
33
28
  }else if (sig.match(/^s?[as]$/)){
34
- let fonts = glob(args.pop())
29
+ let fonts = [args.pop()].flat()
35
30
  let alias = args.shift()
36
31
  return this.ƒ("addFamily", alias, fonts)
37
32
  }else{
package/lib/fetch.js CHANGED
@@ -1,9 +1,4 @@
1
- // wrapper that calls either native fetch (on node v18+) or node-fetch (for older systems)
2
- const fetch = (src, options) => {
3
- const fn = global.fetch
4
- ? Promise.resolve(global.fetch)
5
- : import('node-fetch').then(({default:fetch}) => fetch)
6
- return fn.then(fetch => fetch(src, options))
1
+ // rapper that exports either native fetch (on node v18+) or node-fetch (for older systems)
2
+ module.exports = {
3
+ fetch: global.fetch || require('node-fetch')
7
4
  }
8
-
9
- module.exports = {fetch}
package/lib/prebuild.mjs CHANGED
@@ -113,8 +113,9 @@ async function download(...args){
113
113
  }
114
114
 
115
115
  function compile(...args){
116
- let optimization = args.includes('generic') || args.includes('dev') ? '' : "--release",
117
- features = args.includes('generic') ? '' : `--features ${CARGO_FEATURES}`,
116
+ let optimization = args.includes('custom') || args.includes('dev') ? '' : "--release",
117
+ customFeatures = args.includes('custom') && (args[args.indexOf('custom')+1] || '').replace(/[^[a-z0-9\_\-\,]/g, ''),
118
+ features = `--features "${args.includes('custom') ? customFeatures || '' : CARGO_FEATURES}"`,
118
119
  isFallback = args.includes('--fallback'),
119
120
  isSrcRepo = existsSync(`${ROOT}/Cargo.toml`)
120
121
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skia-canvas",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "description": "A multi-threaded, GPU-accelerated, Canvas API for Node",
5
5
  "author": "Christian Swinehart <drafting@samizdat.co>",
6
6
  "license": "MIT",
@@ -29,9 +29,8 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "detect-libc": "^2.0.4",
32
- "fast-glob": "^3.3.3",
33
32
  "https-proxy-agent": "^7.0.6",
34
- "node-fetch": "^3.3.2",
33
+ "node-fetch": "^2.7.0",
35
34
  "string-split-by": "^1.0.0"
36
35
  },
37
36
  "devDependencies": {
@@ -40,6 +39,7 @@
40
39
  "@types/node": "^24.2.1",
41
40
  "cargo-cp-artifact": "^0.1",
42
41
  "express": "^5.1.0",
42
+ "fast-glob": "^3.3.3",
43
43
  "jest": "^30.0.5",
44
44
  "lodash": "^4.17.21",
45
45
  "nodemon": "^3.1.10",
@@ -70,15 +70,15 @@
70
70
  "rust"
71
71
  ],
72
72
  "prebuild": {
73
- "aws-lambda-arm64.zip": "sha256:6277df5424e71150ff186f28a5f083c6a04365dfe02c5750ec667171b4e3b59c",
74
- "aws-lambda-x64.zip": "sha256:8f57d142d9c739307bf4a52308151310c1b520d1540c02d2cf24941c09958615",
75
- "darwin-arm64.gz": "sha256:554b6dd523ec71337f77a650d9df413aaec156b274633611398c512a03f9ed9e",
76
- "darwin-x64.gz": "sha256:e5d701b95c74c42146e03c8a2794f96daafb32ed4afaa0ea267509847f4222f1",
77
- "linux-arm64-glibc.gz": "sha256:90f91f355e807dd336b779a7ff432999a1361b6307f60ac0c4f706d422ebc86c",
78
- "linux-arm64-musl.gz": "sha256:5952bf795abc0933a1ea0ef7be69eacf062680e72076a9370ddb0598e037e848",
79
- "linux-x64-glibc.gz": "sha256:568618bb562d79ab8c9124e9179b0139d6715689fb12c796788d5c4c6eb5897b",
80
- "linux-x64-musl.gz": "sha256:1ad2a48e5810970110dfd81216ff94c893794c58578e02af6461f9f0378b3bf6",
81
- "win32-arm64.gz": "sha256:eb65c083ade85cb1f72eb45350175cf99b642c38651ecb14c3af163bed4ef528",
82
- "win32-x64.gz": "sha256:9a60f2d71321f922fe9a54cf6af9f05e3e1e66defed2822777ce99bb2e79bab6"
73
+ "aws-lambda-arm64.zip": "sha256:d19093374276990bd6c2237fb668b1d380af2a885aa7801e24204a3c05e46213",
74
+ "aws-lambda-x64.zip": "sha256:f95d53cb199a5cca8faf3d93c88f7c10aae09bb1f274512f5b68b4169f84c4c2",
75
+ "darwin-arm64.gz": "sha256:4a4c3aa2729aa77faa189815354ce917361c00f99d69afde3b30ac45894eaeab",
76
+ "darwin-x64.gz": "sha256:4ad7daa6d6236fe5a241ad3bf404d36b06418cb4e0f9e741deb2be2a590da52a",
77
+ "linux-arm64-glibc.gz": "sha256:ea0fbea46e9cf6be3fdfb9c901fd1ef15baf192a57f717b484b5b6c6c5cd695e",
78
+ "linux-arm64-musl.gz": "sha256:04237f1708dc39ab660449b8c805f9e88520dcc935e1b8a7d4b796705f9b1a6c",
79
+ "linux-x64-glibc.gz": "sha256:6a66eb3d83088971cebf6c871a97e7f2f45dd8d1ced2add017c9161d7b289f25",
80
+ "linux-x64-musl.gz": "sha256:7e0c187d63694db0e0ac2483b0178942007e46ccbf280324d1f73541584008d9",
81
+ "win32-arm64.gz": "sha256:401c3ab4726da81e35f5bf6291f0303268f0c5de8ffba044ee24ef19f5e0f56a",
82
+ "win32-x64.gz": "sha256:1634540d246eeec976632c0adb377ec11af0cff5c539ad374509f8a1fdc1fa24"
83
83
  }
84
84
  }