@fervid/napi 0.1.2 → 0.1.4
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/index.d.ts +24 -1
- package/index.js +25 -0
- package/package.json +26 -26
package/index.d.ts
CHANGED
@@ -6,7 +6,30 @@
|
|
6
6
|
export interface CompileSyncOptions {
|
7
7
|
isProd: boolean
|
8
8
|
}
|
9
|
-
export
|
9
|
+
export interface CompileResult {
|
10
|
+
code: string
|
11
|
+
styles: Array<Style>
|
12
|
+
errors: Array<SerializedError>
|
13
|
+
customBlocks: Array<CustomBlock>
|
14
|
+
}
|
15
|
+
export interface Style {
|
16
|
+
code: string
|
17
|
+
isCompiled: boolean
|
18
|
+
lang: string
|
19
|
+
isScoped: boolean
|
20
|
+
}
|
21
|
+
export interface CustomBlock {
|
22
|
+
content: string
|
23
|
+
lo: number
|
24
|
+
hi: number
|
25
|
+
tagName: string
|
26
|
+
}
|
27
|
+
export interface SerializedError {
|
28
|
+
lo: number
|
29
|
+
hi: number
|
30
|
+
message: string
|
31
|
+
}
|
32
|
+
export function compileSync(source: string, options?: CompileSyncOptions | undefined | null): CompileResult
|
10
33
|
export function compileAsync(
|
11
34
|
source: string,
|
12
35
|
options?: CompileSyncOptions | undefined | null,
|
package/index.js
CHANGED
@@ -219,6 +219,31 @@ switch (platform) {
|
|
219
219
|
loadError = e
|
220
220
|
}
|
221
221
|
break
|
222
|
+
case 'riscv64':
|
223
|
+
if (isMusl()) {
|
224
|
+
localFileExisted = existsSync(join(__dirname, 'napi.linux-riscv64-musl.node'))
|
225
|
+
try {
|
226
|
+
if (localFileExisted) {
|
227
|
+
nativeBinding = require('./napi.linux-riscv64-musl.node')
|
228
|
+
} else {
|
229
|
+
nativeBinding = require('@fervid/napi-linux-riscv64-musl')
|
230
|
+
}
|
231
|
+
} catch (e) {
|
232
|
+
loadError = e
|
233
|
+
}
|
234
|
+
} else {
|
235
|
+
localFileExisted = existsSync(join(__dirname, 'napi.linux-riscv64-gnu.node'))
|
236
|
+
try {
|
237
|
+
if (localFileExisted) {
|
238
|
+
nativeBinding = require('./napi.linux-riscv64-gnu.node')
|
239
|
+
} else {
|
240
|
+
nativeBinding = require('@fervid/napi-linux-riscv64-gnu')
|
241
|
+
}
|
242
|
+
} catch (e) {
|
243
|
+
loadError = e
|
244
|
+
}
|
245
|
+
}
|
246
|
+
break
|
222
247
|
default:
|
223
248
|
throw new Error(`Unsupported architecture on Linux: ${arch}`)
|
224
249
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fervid/napi",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.4",
|
4
4
|
"description": "All-in-One Vue compiler written in Rust",
|
5
5
|
"main": "index.js",
|
6
6
|
"repository": "git@github.com:phoenix-ru/fervid.git",
|
@@ -59,27 +59,27 @@
|
|
59
59
|
"version": "napi version"
|
60
60
|
},
|
61
61
|
"devDependencies": {
|
62
|
-
"@napi-rs/cli": "^2.
|
62
|
+
"@napi-rs/cli": "^2.17.0",
|
63
63
|
"@swc-node/register": "^1.6.8",
|
64
|
-
"@swc/core": "^1.3.
|
64
|
+
"@swc/core": "^1.3.100",
|
65
65
|
"@taplo/cli": "^0.5.2",
|
66
|
-
"@types/node": "^20.10.
|
67
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
68
|
-
"@typescript-eslint/parser": "^6.
|
69
|
-
"@vue/compiler-sfc": "^3.3.
|
66
|
+
"@types/node": "^20.10.4",
|
67
|
+
"@typescript-eslint/eslint-plugin": "^6.14.0",
|
68
|
+
"@typescript-eslint/parser": "^6.14.0",
|
69
|
+
"@vue/compiler-sfc": "^3.3.11",
|
70
70
|
"benny": "^3.7.1",
|
71
71
|
"chalk": "^5.3.0",
|
72
|
-
"eslint": "^8.
|
73
|
-
"eslint-config-prettier": "^9.
|
74
|
-
"eslint-plugin-import": "^2.29.
|
72
|
+
"eslint": "^8.55.0",
|
73
|
+
"eslint-config-prettier": "^9.1.0",
|
74
|
+
"eslint-plugin-import": "^2.29.1",
|
75
75
|
"eslint-plugin-prettier": "^5.0.1",
|
76
76
|
"husky": "^8.0.3",
|
77
77
|
"kleur": "^4.1.5",
|
78
78
|
"lint-staged": "^14.0.1",
|
79
79
|
"npm-run-all": "^4.1.5",
|
80
|
-
"prettier": "^3.1.
|
81
|
-
"typescript": "^5.3.
|
82
|
-
"vitest": "^0.
|
80
|
+
"prettier": "^3.1.1",
|
81
|
+
"typescript": "^5.3.3",
|
82
|
+
"vitest": "^1.0.4"
|
83
83
|
},
|
84
84
|
"lint-staged": {
|
85
85
|
"*.@(js|ts|tsx)": [
|
@@ -100,19 +100,19 @@
|
|
100
100
|
"arrowParens": "always"
|
101
101
|
},
|
102
102
|
"optionalDependencies": {
|
103
|
-
"@fervid/napi-win32-x64-msvc": "0.1.
|
104
|
-
"@fervid/napi-darwin-x64": "0.1.
|
105
|
-
"@fervid/napi-linux-x64-gnu": "0.1.
|
106
|
-
"@fervid/napi-linux-x64-musl": "0.1.
|
107
|
-
"@fervid/napi-linux-arm64-gnu": "0.1.
|
108
|
-
"@fervid/napi-win32-ia32-msvc": "0.1.
|
109
|
-
"@fervid/napi-linux-arm-gnueabihf": "0.1.
|
110
|
-
"@fervid/napi-darwin-arm64": "0.1.
|
111
|
-
"@fervid/napi-android-arm64": "0.1.
|
112
|
-
"@fervid/napi-freebsd-x64": "0.1.
|
113
|
-
"@fervid/napi-linux-arm64-musl": "0.1.
|
114
|
-
"@fervid/napi-win32-arm64-msvc": "0.1.
|
115
|
-
"@fervid/napi-android-arm-eabi": "0.1.
|
103
|
+
"@fervid/napi-win32-x64-msvc": "0.1.4",
|
104
|
+
"@fervid/napi-darwin-x64": "0.1.4",
|
105
|
+
"@fervid/napi-linux-x64-gnu": "0.1.4",
|
106
|
+
"@fervid/napi-linux-x64-musl": "0.1.4",
|
107
|
+
"@fervid/napi-linux-arm64-gnu": "0.1.4",
|
108
|
+
"@fervid/napi-win32-ia32-msvc": "0.1.4",
|
109
|
+
"@fervid/napi-linux-arm-gnueabihf": "0.1.4",
|
110
|
+
"@fervid/napi-darwin-arm64": "0.1.4",
|
111
|
+
"@fervid/napi-android-arm64": "0.1.4",
|
112
|
+
"@fervid/napi-freebsd-x64": "0.1.4",
|
113
|
+
"@fervid/napi-linux-arm64-musl": "0.1.4",
|
114
|
+
"@fervid/napi-win32-arm64-msvc": "0.1.4",
|
115
|
+
"@fervid/napi-android-arm-eabi": "0.1.4"
|
116
116
|
},
|
117
117
|
"packageManager": "yarn@4.0.2",
|
118
118
|
"workspaces": [
|