@shqld/canvas 3.2.2-rc.1 → 3.2.2

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.
Files changed (2) hide show
  1. package/package.json +6 -6
  2. package/scripts/install.js +10 -4
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shqld/canvas",
3
3
  "description": "Canvas graphics API backed by Cairo",
4
- "version": "3.2.2-rc.1",
4
+ "version": "3.2.2",
5
5
  "author": "TJ Holowaychuk <tj@learnboost.com>",
6
6
  "main": "index.js",
7
7
  "browser": "browser.js",
@@ -47,11 +47,11 @@
47
47
  ],
48
48
  "dependencies": {},
49
49
  "optionalDependencies": {
50
- "@shqld/canvas-darwin-arm64": "3.2.2-rc.1",
51
- "@shqld/canvas-darwin-x64": "3.2.2-rc.1",
52
- "@shqld/canvas-linux-arm64-gnu": "3.2.2-rc.1",
53
- "@shqld/canvas-linux-x64-gnu": "3.2.2-rc.1",
54
- "@shqld/canvas-win32-x64": "3.2.2-rc.1"
50
+ "@shqld/canvas-darwin-arm64": "3.2.2",
51
+ "@shqld/canvas-darwin-x64": "3.2.2",
52
+ "@shqld/canvas-linux-arm64-gnu": "3.2.2",
53
+ "@shqld/canvas-linux-x64-gnu": "3.2.2",
54
+ "@shqld/canvas-win32-x64": "3.2.2"
55
55
  },
56
56
  "devDependencies": {
57
57
  "node-addon-api": "^7.0.0",
@@ -1,15 +1,21 @@
1
1
  'use strict'
2
2
 
3
- // If a prebuilt binary is available, skip node-gyp entirely.
3
+ // If a prebuilt binary is available and functional, skip node-gyp.
4
4
  // Otherwise, fall back to building from source.
5
5
 
6
6
  try {
7
- require('../lib/bindings')
7
+ const bindings = require('../lib/bindings')
8
+ new bindings.Canvas(1, 1)
8
9
  process.exit(0)
9
- } catch (_) {
10
+ } catch (err) {
11
+ console.error('Prebuilt binary not available:', err.message)
12
+ console.error('Falling back to build from source...')
10
13
  const { execSync } = require('child_process')
11
14
  try {
12
- execSync('node-gyp rebuild', { stdio: 'inherit', cwd: require('path').resolve(__dirname, '..') })
15
+ execSync('node-gyp rebuild', {
16
+ stdio: 'inherit',
17
+ cwd: require('path').resolve(__dirname, '..')
18
+ })
13
19
  } catch (e) {
14
20
  console.error('Failed to build canvas from source.')
15
21
  console.error('Please install the required system dependencies:')