@oscharko-dev/keiko 0.2.0-beta.0 → 0.2.0-beta.1
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/README.md +6 -5
- package/dist/ui/csp-hashes.json +18 -18
- package/dist/ui/static/404.html +1 -1
- package/dist/ui/static/_next/static/chunks/{422-70c16ea4b1f77f2e.js → 923-4141696576191bc0.js} +1 -1
- package/dist/ui/static/_next/static/chunks/app/_not-found/page-03d642dcd0f15b52.js +1 -0
- package/dist/ui/static/_next/static/chunks/app/launch/page-c725ff0c02b50663.js +1 -0
- package/dist/ui/static/_next/static/chunks/app/layout-aadefe615729db05.js +1 -0
- package/dist/ui/static/_next/static/chunks/app/local-knowledge/capsule/{page-0dc74e194a1f0092.js → page-4a7f242906e19a07.js} +1 -1
- package/dist/ui/static/_next/static/chunks/app/local-knowledge/page-3361769b8964e659.js +1 -0
- package/dist/ui/static/_next/static/chunks/app/memoriaviva/consolidation/{page-dc6c6bd180bc47a3.js → page-44b3f4fa3e10085f.js} +1 -1
- package/dist/ui/static/_next/static/chunks/app/memoriaviva/detail/{page-659e308e68ab2b1e.js → page-0cdfb3eeb659daeb.js} +1 -1
- package/dist/ui/static/_next/static/chunks/app/memoriaviva/{page-d6ba78f54207b69f.js → page-e78e0cd2876fec41.js} +1 -1
- package/dist/ui/static/_next/static/chunks/app/memoriaviva/review-queue/page-e32fe86466827484.js +1 -0
- package/dist/ui/static/_next/static/chunks/app/page-9ad91065d05ddfa0.js +1 -0
- package/dist/ui/static/_next/static/chunks/{main-app-5b043f6c611974ae.js → main-app-b52a8fa1d8127a5f.js} +1 -1
- package/dist/ui/static/index.html +1 -1
- package/dist/ui/static/index.txt +2 -2
- package/dist/ui/static/launch.html +1 -1
- package/dist/ui/static/launch.txt +2 -2
- package/dist/ui/static/local-knowledge/capsule.html +1 -1
- package/dist/ui/static/local-knowledge/capsule.txt +2 -2
- package/dist/ui/static/local-knowledge.html +1 -1
- package/dist/ui/static/local-knowledge.txt +2 -2
- package/dist/ui/static/memoriaviva/consolidation.html +1 -1
- package/dist/ui/static/memoriaviva/consolidation.txt +2 -2
- package/dist/ui/static/memoriaviva/detail.html +1 -1
- package/dist/ui/static/memoriaviva/detail.txt +2 -2
- package/dist/ui/static/memoriaviva/review-queue.html +1 -1
- package/dist/ui/static/memoriaviva/review-queue.txt +2 -2
- package/dist/ui/static/memoriaviva.html +1 -1
- package/dist/ui/static/memoriaviva.txt +2 -2
- package/node_modules/@oscharko-dev/keiko-cli/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-cli/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/index.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/index.js +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-evaluations/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-evaluations/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-evidence/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-evidence/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/parsers/pdf-parser.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/parsers/pdf-parser.js +2 -2
- package/node_modules/@oscharko-dev/keiko-local-knowledge/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-capture/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-consolidation/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-governance/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-retrieval/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-quality-intelligence/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-sdk/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-sdk/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-security/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-server/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-tools/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-tools/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-verification/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-verification/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/package.json +1 -1
- package/package.json +4 -3
- package/dist/ui/static/_next/static/chunks/app/_not-found/page-c4d800f366186be0.js +0 -1
- package/dist/ui/static/_next/static/chunks/app/launch/page-08afd1a052e7662c.js +0 -1
- package/dist/ui/static/_next/static/chunks/app/layout-0f75a39edc90325d.js +0 -1
- package/dist/ui/static/_next/static/chunks/app/local-knowledge/page-48bd57c5e542349e.js +0 -1
- package/dist/ui/static/_next/static/chunks/app/memoriaviva/review-queue/page-7186cd8b22efc78b.js +0 -1
- package/dist/ui/static/_next/static/chunks/app/page-f8386b8e05b3db03.js +0 -1
- package/node_modules/@napi-rs/canvas/LICENSE +0 -21
- package/node_modules/@napi-rs/canvas/README.md +0 -448
- package/node_modules/@napi-rs/canvas/geometry.js +0 -873
- package/node_modules/@napi-rs/canvas/index.d.ts +0 -1097
- package/node_modules/@napi-rs/canvas/index.js +0 -196
- package/node_modules/@napi-rs/canvas/js-binding.js +0 -464
- package/node_modules/@napi-rs/canvas/load-image.js +0 -156
- package/node_modules/@napi-rs/canvas/node-canvas.d.ts +0 -216
- package/node_modules/@napi-rs/canvas/node-canvas.js +0 -379
- package/node_modules/@napi-rs/canvas/package.json +0 -179
- package/node_modules/@napi-rs/canvas-linux-x64-gnu/README.md +0 -3
- package/node_modules/@napi-rs/canvas-linux-x64-gnu/package.json +0 -47
- package/node_modules/@napi-rs/canvas-linux-x64-gnu/skia.linux-x64-gnu.node +0 -0
- package/node_modules/@napi-rs/canvas-linux-x64-musl/README.md +0 -3
- package/node_modules/@napi-rs/canvas-linux-x64-musl/package.json +0 -47
- package/node_modules/@napi-rs/canvas-linux-x64-musl/skia.linux-x64-musl.node +0 -0
- /package/dist/ui/static/_next/static/{IZjQES_2JaG9qZ7_fkEPl → 12efBQERZ9Itf_HaPzx5q}/_buildManifest.js +0 -0
- /package/dist/ui/static/_next/static/{IZjQES_2JaG9qZ7_fkEPl → 12efBQERZ9Itf_HaPzx5q}/_ssgManifest.js +0 -0
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
const { platform, homedir } = require('os')
|
|
2
|
-
const { join } = require('path')
|
|
3
|
-
|
|
4
|
-
const {
|
|
5
|
-
clearAllCache,
|
|
6
|
-
CanvasRenderingContext2D,
|
|
7
|
-
CanvasElement,
|
|
8
|
-
SVGCanvas,
|
|
9
|
-
Path: Path2D,
|
|
10
|
-
ImageData,
|
|
11
|
-
Image,
|
|
12
|
-
FontKey,
|
|
13
|
-
GlobalFonts,
|
|
14
|
-
PathOp,
|
|
15
|
-
FillType,
|
|
16
|
-
StrokeJoin,
|
|
17
|
-
StrokeCap,
|
|
18
|
-
convertSVGTextToPath,
|
|
19
|
-
PdfDocument,
|
|
20
|
-
GifEncoder,
|
|
21
|
-
GifDisposal,
|
|
22
|
-
LottieAnimation,
|
|
23
|
-
} = require('./js-binding')
|
|
24
|
-
|
|
25
|
-
const { DOMPoint, DOMMatrix, DOMRect } = require('./geometry')
|
|
26
|
-
|
|
27
|
-
const loadImage = require('./load-image')
|
|
28
|
-
|
|
29
|
-
// Add Symbol.dispose support for GifEncoder (ECMAScript 2024 Explicit Resource Management)
|
|
30
|
-
if (GifEncoder && typeof Symbol.dispose !== 'undefined') {
|
|
31
|
-
GifEncoder.prototype[Symbol.dispose] = function () {
|
|
32
|
-
this.dispose()
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const SvgExportFlag = {
|
|
37
|
-
ConvertTextToPaths: 0x01,
|
|
38
|
-
NoPrettyXML: 0x02,
|
|
39
|
-
RelativePathEncoding: 0x04,
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (!('families' in GlobalFonts)) {
|
|
43
|
-
Object.defineProperty(GlobalFonts, 'families', {
|
|
44
|
-
get: function () {
|
|
45
|
-
return JSON.parse(GlobalFonts.getFamilies().toString())
|
|
46
|
-
},
|
|
47
|
-
})
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (!('has' in GlobalFonts)) {
|
|
51
|
-
Object.defineProperty(GlobalFonts, 'has', {
|
|
52
|
-
value: function has(name) {
|
|
53
|
-
return !!JSON.parse(GlobalFonts.getFamilies().toString()).find(({ family }) => family === name)
|
|
54
|
-
},
|
|
55
|
-
configurable: false,
|
|
56
|
-
enumerable: false,
|
|
57
|
-
writable: false,
|
|
58
|
-
})
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const _toBlob = CanvasElement.prototype.toBlob
|
|
62
|
-
const _convertToBlob = CanvasElement.prototype.convertToBlob
|
|
63
|
-
if ('Blob' in globalThis) {
|
|
64
|
-
CanvasElement.prototype.toBlob = function toBlob(callback, mimeType, quality) {
|
|
65
|
-
_toBlob.call(
|
|
66
|
-
this,
|
|
67
|
-
function (/** @type {Uint8Array} */ imageBuffer) {
|
|
68
|
-
const blob = new Blob([imageBuffer.buffer], { type: mimeType })
|
|
69
|
-
callback(blob)
|
|
70
|
-
},
|
|
71
|
-
mimeType,
|
|
72
|
-
quality,
|
|
73
|
-
)
|
|
74
|
-
}
|
|
75
|
-
CanvasElement.prototype.convertToBlob = function convertToBlob(options) {
|
|
76
|
-
return _convertToBlob.call(this, options).then((/** @type {Uint8Array} */ imageBuffer) => {
|
|
77
|
-
const blob = new Blob([imageBuffer.buffer], { type: options?.mime || 'image/png' })
|
|
78
|
-
return blob
|
|
79
|
-
})
|
|
80
|
-
}
|
|
81
|
-
} else {
|
|
82
|
-
// oxlint-disable-next-line no-unused-vars
|
|
83
|
-
CanvasElement.prototype.toBlob = function toBlob(callback, mimeType, quality) {
|
|
84
|
-
callback(null)
|
|
85
|
-
}
|
|
86
|
-
// oxlint-disable-next-line no-unused-vars
|
|
87
|
-
CanvasElement.prototype.convertToBlob = function convertToBlob(options) {
|
|
88
|
-
return Promise.reject(new Error('Blob is not supported in this environment'))
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const _getTransform = CanvasRenderingContext2D.prototype.getTransform
|
|
93
|
-
|
|
94
|
-
CanvasRenderingContext2D.prototype.getTransform = function getTransform() {
|
|
95
|
-
const transform = _getTransform.apply(this, arguments)
|
|
96
|
-
// monkey patched, skip
|
|
97
|
-
if (transform instanceof DOMMatrix) {
|
|
98
|
-
return transform
|
|
99
|
-
}
|
|
100
|
-
const { a, b, c, d, e, f } = transform
|
|
101
|
-
return new DOMMatrix([a, b, c, d, e, f])
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// Workaround for webpack bundling issue with drawImage
|
|
105
|
-
// Store the original drawImage method
|
|
106
|
-
const _drawImage = CanvasRenderingContext2D.prototype.drawImage
|
|
107
|
-
|
|
108
|
-
// Override drawImage to ensure proper type recognition in bundled environments
|
|
109
|
-
CanvasRenderingContext2D.prototype.drawImage = function drawImage(image, ...args) {
|
|
110
|
-
// If the image is a Canvas-like object but not recognized due to bundling,
|
|
111
|
-
// we need to ensure it's properly identified
|
|
112
|
-
if (image && typeof image === 'object') {
|
|
113
|
-
// First check if it's a wrapped canvas object
|
|
114
|
-
if (image.canvas instanceof CanvasElement || image.canvas instanceof SVGCanvas) {
|
|
115
|
-
image = image.canvas
|
|
116
|
-
} else if (image._canvas instanceof CanvasElement || image._canvas instanceof SVGCanvas) {
|
|
117
|
-
image = image._canvas
|
|
118
|
-
}
|
|
119
|
-
// Then check if it's a Canvas-like object by checking for getContext method
|
|
120
|
-
else if (typeof image.getContext === 'function' && image.width && image.height) {
|
|
121
|
-
// If it has canvas properties but isn't recognized as CanvasElement or SVGCanvas,
|
|
122
|
-
// try to correct the prototype chain
|
|
123
|
-
if (!(image instanceof CanvasElement) && !(image instanceof SVGCanvas)) {
|
|
124
|
-
// Try to create a proper CanvasElement from the canvas-like object
|
|
125
|
-
// This helps when webpack has transformed the prototype chain
|
|
126
|
-
Object.setPrototypeOf(image, CanvasElement.prototype)
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// Call the original drawImage with the potentially corrected image
|
|
132
|
-
return _drawImage.apply(this, [image, ...args])
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function createCanvas(width, height, flag) {
|
|
136
|
-
const isSvgBackend = typeof flag !== 'undefined'
|
|
137
|
-
return isSvgBackend ? new SVGCanvas(width, height, flag) : new CanvasElement(width, height)
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
class Canvas {
|
|
141
|
-
constructor(width, height, flag) {
|
|
142
|
-
return createCanvas(width, height, flag)
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
static [Symbol.hasInstance](instance) {
|
|
146
|
-
return instance instanceof CanvasElement || instance instanceof SVGCanvas
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (!process.env.DISABLE_SYSTEM_FONTS_LOAD) {
|
|
151
|
-
GlobalFonts.loadSystemFonts()
|
|
152
|
-
const platformName = platform()
|
|
153
|
-
const homedirPath = homedir()
|
|
154
|
-
switch (platformName) {
|
|
155
|
-
case 'win32':
|
|
156
|
-
GlobalFonts.loadFontsFromDir(join(homedirPath, 'AppData', 'Local', 'Microsoft', 'Windows', 'Fonts'))
|
|
157
|
-
break
|
|
158
|
-
case 'darwin':
|
|
159
|
-
GlobalFonts.loadFontsFromDir(join(homedirPath, 'Library', 'Fonts'))
|
|
160
|
-
break
|
|
161
|
-
case 'linux':
|
|
162
|
-
GlobalFonts.loadFontsFromDir(join('usr', 'local', 'share', 'fonts'))
|
|
163
|
-
GlobalFonts.loadFontsFromDir(join(homedirPath, '.fonts'))
|
|
164
|
-
break
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
module.exports = {
|
|
169
|
-
clearAllCache,
|
|
170
|
-
Canvas,
|
|
171
|
-
createCanvas,
|
|
172
|
-
Path2D,
|
|
173
|
-
ImageData,
|
|
174
|
-
Image,
|
|
175
|
-
PathOp,
|
|
176
|
-
FillType,
|
|
177
|
-
StrokeCap,
|
|
178
|
-
StrokeJoin,
|
|
179
|
-
SvgExportFlag,
|
|
180
|
-
GlobalFonts: GlobalFonts,
|
|
181
|
-
convertSVGTextToPath,
|
|
182
|
-
DOMPoint,
|
|
183
|
-
DOMMatrix,
|
|
184
|
-
DOMRect,
|
|
185
|
-
loadImage,
|
|
186
|
-
FontKey,
|
|
187
|
-
// Export these for better webpack compatibility
|
|
188
|
-
CanvasElement,
|
|
189
|
-
SVGCanvas,
|
|
190
|
-
PDFDocument: PdfDocument,
|
|
191
|
-
// GIF encoding
|
|
192
|
-
GifEncoder,
|
|
193
|
-
GifDisposal,
|
|
194
|
-
// Lottie animation
|
|
195
|
-
LottieAnimation,
|
|
196
|
-
}
|
|
@@ -1,464 +0,0 @@
|
|
|
1
|
-
// prettier-ignore
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
// @ts-nocheck
|
|
4
|
-
/* auto-generated by NAPI-RS */
|
|
5
|
-
|
|
6
|
-
const { readFileSync } = require('fs')
|
|
7
|
-
let nativeBinding = null
|
|
8
|
-
const loadErrors = []
|
|
9
|
-
|
|
10
|
-
const isMusl = () => {
|
|
11
|
-
let musl = false
|
|
12
|
-
if (process.platform === 'linux') {
|
|
13
|
-
musl = isMuslFromFilesystem()
|
|
14
|
-
if (musl === null) {
|
|
15
|
-
musl = isMuslFromReport()
|
|
16
|
-
}
|
|
17
|
-
if (musl === null) {
|
|
18
|
-
musl = isMuslFromChildProcess()
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return musl
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-')
|
|
25
|
-
|
|
26
|
-
const isMuslFromFilesystem = () => {
|
|
27
|
-
try {
|
|
28
|
-
return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl')
|
|
29
|
-
} catch {
|
|
30
|
-
return null
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const isMuslFromReport = () => {
|
|
35
|
-
let report = null
|
|
36
|
-
if (typeof process.report?.getReport === 'function') {
|
|
37
|
-
process.report.excludeNetwork = true
|
|
38
|
-
report = process.report.getReport()
|
|
39
|
-
}
|
|
40
|
-
if (!report) {
|
|
41
|
-
return null
|
|
42
|
-
}
|
|
43
|
-
if (report.header && report.header.glibcVersionRuntime) {
|
|
44
|
-
return false
|
|
45
|
-
}
|
|
46
|
-
if (Array.isArray(report.sharedObjects)) {
|
|
47
|
-
if (report.sharedObjects.some(isFileMusl)) {
|
|
48
|
-
return true
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return false
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const isMuslFromChildProcess = () => {
|
|
55
|
-
try {
|
|
56
|
-
return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl')
|
|
57
|
-
} catch (e) {
|
|
58
|
-
// If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
|
|
59
|
-
return false
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function requireNative() {
|
|
64
|
-
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
|
|
65
|
-
try {
|
|
66
|
-
return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)
|
|
67
|
-
} catch (err) {
|
|
68
|
-
loadErrors.push(err)
|
|
69
|
-
}
|
|
70
|
-
} else if (process.platform === 'android') {
|
|
71
|
-
if (process.arch === 'arm64') {
|
|
72
|
-
try {
|
|
73
|
-
return require('./skia.android-arm64.node')
|
|
74
|
-
} catch (e) {
|
|
75
|
-
loadErrors.push(e)
|
|
76
|
-
}
|
|
77
|
-
try {
|
|
78
|
-
return require('@napi-rs/canvas-android-arm64')
|
|
79
|
-
} catch (e) {
|
|
80
|
-
loadErrors.push(e)
|
|
81
|
-
}
|
|
82
|
-
} else if (process.arch === 'arm') {
|
|
83
|
-
try {
|
|
84
|
-
return require('./skia.android-arm-eabi.node')
|
|
85
|
-
} catch (e) {
|
|
86
|
-
loadErrors.push(e)
|
|
87
|
-
}
|
|
88
|
-
try {
|
|
89
|
-
return require('@napi-rs/canvas-android-arm-eabi')
|
|
90
|
-
} catch (e) {
|
|
91
|
-
loadErrors.push(e)
|
|
92
|
-
}
|
|
93
|
-
} else {
|
|
94
|
-
loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`))
|
|
95
|
-
}
|
|
96
|
-
} else if (process.platform === 'win32') {
|
|
97
|
-
if (process.arch === 'x64') {
|
|
98
|
-
if (
|
|
99
|
-
process.config?.variables?.shlib_suffix === 'dll.a' ||
|
|
100
|
-
process.config?.variables?.node_target_type === 'shared_library'
|
|
101
|
-
) {
|
|
102
|
-
try {
|
|
103
|
-
return require('./skia.win32-x64-gnu.node')
|
|
104
|
-
} catch (e) {
|
|
105
|
-
loadErrors.push(e)
|
|
106
|
-
}
|
|
107
|
-
try {
|
|
108
|
-
return require('@napi-rs/canvas-win32-x64-gnu')
|
|
109
|
-
} catch (e) {
|
|
110
|
-
loadErrors.push(e)
|
|
111
|
-
}
|
|
112
|
-
} else {
|
|
113
|
-
try {
|
|
114
|
-
return require('./skia.win32-x64-msvc.node')
|
|
115
|
-
} catch (e) {
|
|
116
|
-
loadErrors.push(e)
|
|
117
|
-
}
|
|
118
|
-
try {
|
|
119
|
-
return require('@napi-rs/canvas-win32-x64-msvc')
|
|
120
|
-
} catch (e) {
|
|
121
|
-
loadErrors.push(e)
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
} else if (process.arch === 'ia32') {
|
|
125
|
-
try {
|
|
126
|
-
return require('./skia.win32-ia32-msvc.node')
|
|
127
|
-
} catch (e) {
|
|
128
|
-
loadErrors.push(e)
|
|
129
|
-
}
|
|
130
|
-
try {
|
|
131
|
-
return require('@napi-rs/canvas-win32-ia32-msvc')
|
|
132
|
-
} catch (e) {
|
|
133
|
-
loadErrors.push(e)
|
|
134
|
-
}
|
|
135
|
-
} else if (process.arch === 'arm64') {
|
|
136
|
-
try {
|
|
137
|
-
return require('./skia.win32-arm64-msvc.node')
|
|
138
|
-
} catch (e) {
|
|
139
|
-
loadErrors.push(e)
|
|
140
|
-
}
|
|
141
|
-
try {
|
|
142
|
-
return require('@napi-rs/canvas-win32-arm64-msvc')
|
|
143
|
-
} catch (e) {
|
|
144
|
-
loadErrors.push(e)
|
|
145
|
-
}
|
|
146
|
-
} else {
|
|
147
|
-
loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))
|
|
148
|
-
}
|
|
149
|
-
} else if (process.platform === 'darwin') {
|
|
150
|
-
try {
|
|
151
|
-
return require('./skia.darwin-universal.node')
|
|
152
|
-
} catch (e) {
|
|
153
|
-
loadErrors.push(e)
|
|
154
|
-
}
|
|
155
|
-
try {
|
|
156
|
-
return require('@napi-rs/canvas-darwin-universal')
|
|
157
|
-
} catch (e) {
|
|
158
|
-
loadErrors.push(e)
|
|
159
|
-
}
|
|
160
|
-
if (process.arch === 'x64') {
|
|
161
|
-
try {
|
|
162
|
-
return require('./skia.darwin-x64.node')
|
|
163
|
-
} catch (e) {
|
|
164
|
-
loadErrors.push(e)
|
|
165
|
-
}
|
|
166
|
-
try {
|
|
167
|
-
return require('@napi-rs/canvas-darwin-x64')
|
|
168
|
-
} catch (e) {
|
|
169
|
-
loadErrors.push(e)
|
|
170
|
-
}
|
|
171
|
-
} else if (process.arch === 'arm64') {
|
|
172
|
-
try {
|
|
173
|
-
return require('./skia.darwin-arm64.node')
|
|
174
|
-
} catch (e) {
|
|
175
|
-
loadErrors.push(e)
|
|
176
|
-
}
|
|
177
|
-
try {
|
|
178
|
-
return require('@napi-rs/canvas-darwin-arm64')
|
|
179
|
-
} catch (e) {
|
|
180
|
-
loadErrors.push(e)
|
|
181
|
-
}
|
|
182
|
-
} else {
|
|
183
|
-
loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
|
|
184
|
-
}
|
|
185
|
-
} else if (process.platform === 'freebsd') {
|
|
186
|
-
if (process.arch === 'x64') {
|
|
187
|
-
try {
|
|
188
|
-
return require('./skia.freebsd-x64.node')
|
|
189
|
-
} catch (e) {
|
|
190
|
-
loadErrors.push(e)
|
|
191
|
-
}
|
|
192
|
-
try {
|
|
193
|
-
return require('@napi-rs/canvas-freebsd-x64')
|
|
194
|
-
} catch (e) {
|
|
195
|
-
loadErrors.push(e)
|
|
196
|
-
}
|
|
197
|
-
} else if (process.arch === 'arm64') {
|
|
198
|
-
try {
|
|
199
|
-
return require('./skia.freebsd-arm64.node')
|
|
200
|
-
} catch (e) {
|
|
201
|
-
loadErrors.push(e)
|
|
202
|
-
}
|
|
203
|
-
try {
|
|
204
|
-
return require('@napi-rs/canvas-freebsd-arm64')
|
|
205
|
-
} catch (e) {
|
|
206
|
-
loadErrors.push(e)
|
|
207
|
-
}
|
|
208
|
-
} else {
|
|
209
|
-
loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))
|
|
210
|
-
}
|
|
211
|
-
} else if (process.platform === 'linux') {
|
|
212
|
-
if (process.arch === 'x64') {
|
|
213
|
-
if (isMusl()) {
|
|
214
|
-
try {
|
|
215
|
-
return require('./skia.linux-x64-musl.node')
|
|
216
|
-
} catch (e) {
|
|
217
|
-
loadErrors.push(e)
|
|
218
|
-
}
|
|
219
|
-
try {
|
|
220
|
-
return require('@napi-rs/canvas-linux-x64-musl')
|
|
221
|
-
} catch (e) {
|
|
222
|
-
loadErrors.push(e)
|
|
223
|
-
}
|
|
224
|
-
} else {
|
|
225
|
-
try {
|
|
226
|
-
return require('./skia.linux-x64-gnu.node')
|
|
227
|
-
} catch (e) {
|
|
228
|
-
loadErrors.push(e)
|
|
229
|
-
}
|
|
230
|
-
try {
|
|
231
|
-
return require('@napi-rs/canvas-linux-x64-gnu')
|
|
232
|
-
} catch (e) {
|
|
233
|
-
loadErrors.push(e)
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
} else if (process.arch === 'arm64') {
|
|
237
|
-
if (isMusl()) {
|
|
238
|
-
try {
|
|
239
|
-
return require('./skia.linux-arm64-musl.node')
|
|
240
|
-
} catch (e) {
|
|
241
|
-
loadErrors.push(e)
|
|
242
|
-
}
|
|
243
|
-
try {
|
|
244
|
-
return require('@napi-rs/canvas-linux-arm64-musl')
|
|
245
|
-
} catch (e) {
|
|
246
|
-
loadErrors.push(e)
|
|
247
|
-
}
|
|
248
|
-
} else {
|
|
249
|
-
try {
|
|
250
|
-
return require('./skia.linux-arm64-gnu.node')
|
|
251
|
-
} catch (e) {
|
|
252
|
-
loadErrors.push(e)
|
|
253
|
-
}
|
|
254
|
-
try {
|
|
255
|
-
return require('@napi-rs/canvas-linux-arm64-gnu')
|
|
256
|
-
} catch (e) {
|
|
257
|
-
loadErrors.push(e)
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
} else if (process.arch === 'arm') {
|
|
261
|
-
if (isMusl()) {
|
|
262
|
-
try {
|
|
263
|
-
return require('./skia.linux-arm-musleabihf.node')
|
|
264
|
-
} catch (e) {
|
|
265
|
-
loadErrors.push(e)
|
|
266
|
-
}
|
|
267
|
-
try {
|
|
268
|
-
return require('@napi-rs/canvas-linux-arm-musleabihf')
|
|
269
|
-
} catch (e) {
|
|
270
|
-
loadErrors.push(e)
|
|
271
|
-
}
|
|
272
|
-
} else {
|
|
273
|
-
try {
|
|
274
|
-
return require('./skia.linux-arm-gnueabihf.node')
|
|
275
|
-
} catch (e) {
|
|
276
|
-
loadErrors.push(e)
|
|
277
|
-
}
|
|
278
|
-
try {
|
|
279
|
-
return require('@napi-rs/canvas-linux-arm-gnueabihf')
|
|
280
|
-
} catch (e) {
|
|
281
|
-
loadErrors.push(e)
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
} else if (process.arch === 'loong64') {
|
|
285
|
-
if (isMusl()) {
|
|
286
|
-
try {
|
|
287
|
-
return require('./skia.linux-loong64-musl.node')
|
|
288
|
-
} catch (e) {
|
|
289
|
-
loadErrors.push(e)
|
|
290
|
-
}
|
|
291
|
-
try {
|
|
292
|
-
return require('@napi-rs/canvas-linux-loong64-musl')
|
|
293
|
-
} catch (e) {
|
|
294
|
-
loadErrors.push(e)
|
|
295
|
-
}
|
|
296
|
-
} else {
|
|
297
|
-
try {
|
|
298
|
-
return require('./skia.linux-loong64-gnu.node')
|
|
299
|
-
} catch (e) {
|
|
300
|
-
loadErrors.push(e)
|
|
301
|
-
}
|
|
302
|
-
try {
|
|
303
|
-
return require('@napi-rs/canvas-linux-loong64-gnu')
|
|
304
|
-
} catch (e) {
|
|
305
|
-
loadErrors.push(e)
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
} else if (process.arch === 'riscv64') {
|
|
309
|
-
if (isMusl()) {
|
|
310
|
-
try {
|
|
311
|
-
return require('./skia.linux-riscv64-musl.node')
|
|
312
|
-
} catch (e) {
|
|
313
|
-
loadErrors.push(e)
|
|
314
|
-
}
|
|
315
|
-
try {
|
|
316
|
-
return require('@napi-rs/canvas-linux-riscv64-musl')
|
|
317
|
-
} catch (e) {
|
|
318
|
-
loadErrors.push(e)
|
|
319
|
-
}
|
|
320
|
-
} else {
|
|
321
|
-
try {
|
|
322
|
-
return require('./skia.linux-riscv64-gnu.node')
|
|
323
|
-
} catch (e) {
|
|
324
|
-
loadErrors.push(e)
|
|
325
|
-
}
|
|
326
|
-
try {
|
|
327
|
-
return require('@napi-rs/canvas-linux-riscv64-gnu')
|
|
328
|
-
} catch (e) {
|
|
329
|
-
loadErrors.push(e)
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
} else if (process.arch === 'ppc64') {
|
|
333
|
-
try {
|
|
334
|
-
return require('./skia.linux-ppc64-gnu.node')
|
|
335
|
-
} catch (e) {
|
|
336
|
-
loadErrors.push(e)
|
|
337
|
-
}
|
|
338
|
-
try {
|
|
339
|
-
return require('@napi-rs/canvas-linux-ppc64-gnu')
|
|
340
|
-
} catch (e) {
|
|
341
|
-
loadErrors.push(e)
|
|
342
|
-
}
|
|
343
|
-
} else if (process.arch === 's390x') {
|
|
344
|
-
try {
|
|
345
|
-
return require('./skia.linux-s390x-gnu.node')
|
|
346
|
-
} catch (e) {
|
|
347
|
-
loadErrors.push(e)
|
|
348
|
-
}
|
|
349
|
-
try {
|
|
350
|
-
return require('@napi-rs/canvas-linux-s390x-gnu')
|
|
351
|
-
} catch (e) {
|
|
352
|
-
loadErrors.push(e)
|
|
353
|
-
}
|
|
354
|
-
} else {
|
|
355
|
-
loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))
|
|
356
|
-
}
|
|
357
|
-
} else if (process.platform === 'openharmony') {
|
|
358
|
-
if (process.arch === 'arm64') {
|
|
359
|
-
try {
|
|
360
|
-
return require('./skia.openharmony-arm64.node')
|
|
361
|
-
} catch (e) {
|
|
362
|
-
loadErrors.push(e)
|
|
363
|
-
}
|
|
364
|
-
try {
|
|
365
|
-
return require('@napi-rs/canvas-openharmony-arm64')
|
|
366
|
-
} catch (e) {
|
|
367
|
-
loadErrors.push(e)
|
|
368
|
-
}
|
|
369
|
-
} else if (process.arch === 'x64') {
|
|
370
|
-
try {
|
|
371
|
-
return require('./skia.openharmony-x64.node')
|
|
372
|
-
} catch (e) {
|
|
373
|
-
loadErrors.push(e)
|
|
374
|
-
}
|
|
375
|
-
try {
|
|
376
|
-
return require('@napi-rs/canvas-openharmony-x64')
|
|
377
|
-
} catch (e) {
|
|
378
|
-
loadErrors.push(e)
|
|
379
|
-
}
|
|
380
|
-
} else if (process.arch === 'arm') {
|
|
381
|
-
try {
|
|
382
|
-
return require('./skia.openharmony-arm.node')
|
|
383
|
-
} catch (e) {
|
|
384
|
-
loadErrors.push(e)
|
|
385
|
-
}
|
|
386
|
-
try {
|
|
387
|
-
const binding = require('@napi-rs/canvas-openharmony-arm')
|
|
388
|
-
return binding
|
|
389
|
-
} catch (e) {
|
|
390
|
-
loadErrors.push(e)
|
|
391
|
-
}
|
|
392
|
-
} else {
|
|
393
|
-
loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`))
|
|
394
|
-
}
|
|
395
|
-
} else {
|
|
396
|
-
loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
nativeBinding = requireNative()
|
|
401
|
-
|
|
402
|
-
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
403
|
-
let wasiBinding = null
|
|
404
|
-
let wasiBindingError = null
|
|
405
|
-
try {
|
|
406
|
-
wasiBinding = require('./skia.wasi.cjs')
|
|
407
|
-
nativeBinding = wasiBinding
|
|
408
|
-
} catch (err) {
|
|
409
|
-
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
410
|
-
wasiBindingError = err
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
if (!nativeBinding) {
|
|
414
|
-
try {
|
|
415
|
-
wasiBinding = require('@napi-rs/canvas-wasm32-wasi')
|
|
416
|
-
nativeBinding = wasiBinding
|
|
417
|
-
} catch (err) {
|
|
418
|
-
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
419
|
-
wasiBindingError.cause = err
|
|
420
|
-
loadErrors.push(err)
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
if (!nativeBinding) {
|
|
427
|
-
if (loadErrors.length > 0) {
|
|
428
|
-
throw new Error(
|
|
429
|
-
`Cannot find native binding. ` +
|
|
430
|
-
`npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
|
|
431
|
-
'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
|
|
432
|
-
{
|
|
433
|
-
cause: loadErrors.reduce((err, cur) => {
|
|
434
|
-
cur.cause = err
|
|
435
|
-
return cur
|
|
436
|
-
}),
|
|
437
|
-
},
|
|
438
|
-
)
|
|
439
|
-
}
|
|
440
|
-
throw new Error(`Failed to load native binding`)
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
module.exports = nativeBinding
|
|
444
|
-
module.exports.GlobalFonts = nativeBinding.GlobalFonts
|
|
445
|
-
module.exports.CanvasElement = nativeBinding.CanvasElement
|
|
446
|
-
module.exports.CanvasGradient = nativeBinding.CanvasGradient
|
|
447
|
-
module.exports.CanvasPattern = nativeBinding.CanvasPattern
|
|
448
|
-
module.exports.CanvasRenderingContext2D = nativeBinding.CanvasRenderingContext2D
|
|
449
|
-
module.exports.FontKey = nativeBinding.FontKey
|
|
450
|
-
module.exports.Image = nativeBinding.Image
|
|
451
|
-
module.exports.ImageData = nativeBinding.ImageData
|
|
452
|
-
module.exports.Path = nativeBinding.Path
|
|
453
|
-
module.exports.PdfDocument = nativeBinding.PdfDocument
|
|
454
|
-
module.exports.SVGCanvas = nativeBinding.SVGCanvas
|
|
455
|
-
module.exports.ChromaSubsampling = nativeBinding.ChromaSubsampling
|
|
456
|
-
module.exports.clearAllCache = nativeBinding.clearAllCache
|
|
457
|
-
module.exports.convertSVGTextToPath = nativeBinding.convertSVGTextToPath
|
|
458
|
-
module.exports.FillType = nativeBinding.FillType
|
|
459
|
-
module.exports.PathOp = nativeBinding.PathOp
|
|
460
|
-
module.exports.StrokeCap = nativeBinding.StrokeCap
|
|
461
|
-
module.exports.StrokeJoin = nativeBinding.StrokeJoin
|
|
462
|
-
module.exports.SvgExportFlag = nativeBinding.SvgExportFlag
|
|
463
|
-
module.exports.GifEncoder = nativeBinding.GifEncoder
|
|
464
|
-
module.exports.GifDisposal = nativeBinding.GifDisposal
|