eitri-cli 1.9.0-beta.12 → 1.9.0-beta.14
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/bitbucket-pipelines.yml +83 -33
- package/boilerplate/mini-app-cafe-madeira.zip +0 -0
- package/config/dev.js +3 -2
- package/eitri-cli-v2/Cargo.toml +15 -7
- package/eitri-cli-v2/build.rs +5 -0
- package/eitri-cli-v2/eitri-cli-v2.darwin-arm64.node +0 -0
- package/eitri-cli-v2/eitri-cli-v2.darwin-x64.node +0 -0
- package/eitri-cli-v2/eitri-cli-v2.linux-x64-gnu.node +0 -0
- package/eitri-cli-v2/eitri-cli-v2.win32-x64-msvc.node +0 -0
- package/eitri-cli-v2/index.d.ts +6 -0
- package/eitri-cli-v2/index.js +300 -11
- package/eitri-cli-v2/package.json +28 -14
- package/eitri-cli-v2/src/commands/publish.rs +29 -61
- package/eitri-cli-v2/src/infra/mod.rs +0 -1
- package/eitri-cli-v2/src/lib.rs +7 -31
- package/index.js +1 -1
- package/install-dev.bat +1 -1
- package/install-dev.sh +1 -1
- package/package.json +1 -1
- package/test/Executor.js +21 -7
- package/test/Helper.js +2 -0
- package/test/e2e/cli.test.js +113 -98
- package/eitri-cli-v2/Cargo.lock +0 -2511
- package/eitri-cli-v2/index.darwin.node +0 -0
- package/eitri-cli-v2/index.unix.node +0 -0
- package/eitri-cli-v2/index.win32.node +0 -0
- package/eitri-cli-v2/node_modules/.package-lock.json +0 -17
- package/eitri-cli-v2/node_modules/cargo-cp-artifact/LICENSE +0 -21
- package/eitri-cli-v2/node_modules/cargo-cp-artifact/README.md +0 -93
- package/eitri-cli-v2/node_modules/cargo-cp-artifact/bin/cargo-cp-artifact.js +0 -6
- package/eitri-cli-v2/node_modules/cargo-cp-artifact/package.json +0 -34
- package/eitri-cli-v2/node_modules/cargo-cp-artifact/src/args.js +0 -131
- package/eitri-cli-v2/node_modules/cargo-cp-artifact/src/index.js +0 -164
- package/eitri-cli-v2/src/infra/async_runtime.rs +0 -9
- package/eitri-cli-v2/yarn.lock +0 -8
package/bitbucket-pipelines.yml
CHANGED
|
@@ -7,10 +7,26 @@ pipelines:
|
|
|
7
7
|
caches:
|
|
8
8
|
- node
|
|
9
9
|
script:
|
|
10
|
-
-
|
|
10
|
+
- apt-get update
|
|
11
|
+
- apt-get install -y wget
|
|
12
|
+
- wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
|
13
|
+
- apt-get install -y ./google-chrome-stable_current_amd64.deb
|
|
14
|
+
- export PUPPETEER_EXECUTABLE_PATH='/usr/bin/google-chrome-stable'
|
|
15
|
+
- apt-get install -y libssl-dev
|
|
16
|
+
- apt-get install -y pkg-config
|
|
17
|
+
- apt-get install -y git
|
|
18
|
+
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
19
|
+
- export PATH="/root/.cargo/bin:${PATH}"
|
|
20
|
+
- rustup --version
|
|
21
|
+
- rustup target add x86_64-unknown-linux-gnu
|
|
22
|
+
- cd eitri-cli-v2
|
|
23
|
+
- npm i
|
|
24
|
+
- npm run build:debug
|
|
25
|
+
- cd ..
|
|
26
|
+
- npm i
|
|
11
27
|
- npm i -g .
|
|
12
28
|
- export FOUNDRY_CONTEXT_PATH=runes-foundry
|
|
13
|
-
-
|
|
29
|
+
- npm run test cli.test.js -- --force-exit
|
|
14
30
|
default:
|
|
15
31
|
- step: &runTests
|
|
16
32
|
name: Run tests
|
|
@@ -18,6 +34,7 @@ pipelines:
|
|
|
18
34
|
- node
|
|
19
35
|
script:
|
|
20
36
|
- apt-get update
|
|
37
|
+
- curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs
|
|
21
38
|
- apt-get install -y wget
|
|
22
39
|
- wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
|
23
40
|
- apt-get install -y ./google-chrome-stable_current_amd64.deb
|
|
@@ -31,11 +48,12 @@ pipelines:
|
|
|
31
48
|
- rustup target add x86_64-unknown-linux-gnu
|
|
32
49
|
- cd eitri-cli-v2
|
|
33
50
|
- npm i
|
|
34
|
-
- npm run build
|
|
51
|
+
- npm run build:debug
|
|
35
52
|
- cd ..
|
|
36
53
|
- yarn
|
|
37
54
|
- npm i -g .
|
|
38
|
-
-
|
|
55
|
+
- export FOUNDRY_CONTEXT_PATH=runes-foundry
|
|
56
|
+
- npm run test cli.test.js -- --force-exit --runInBand --bail
|
|
39
57
|
- step: &runRustTests
|
|
40
58
|
name: Run Rust tests
|
|
41
59
|
caches:
|
|
@@ -56,7 +74,6 @@ pipelines:
|
|
|
56
74
|
caches:
|
|
57
75
|
- node
|
|
58
76
|
script:
|
|
59
|
-
- ldd --version
|
|
60
77
|
- apt-get update
|
|
61
78
|
- apt-get install -y git
|
|
62
79
|
- apt-get install -y libssl-dev
|
|
@@ -73,46 +90,79 @@ pipelines:
|
|
|
73
90
|
- export CXX=o64-clang++
|
|
74
91
|
- cd eitri-cli-v2
|
|
75
92
|
- npm install
|
|
76
|
-
- npm run build-
|
|
93
|
+
- npm run build -- --target aarch64-apple-darwin
|
|
94
|
+
- npm run build -- --target x86_64-apple-darwin
|
|
77
95
|
- rm -rf target
|
|
78
|
-
- cp
|
|
96
|
+
- cp -r ./eitri-cli-v2.darwin-arm64.node ../eitri-cli-v2.darwin-arm64.node
|
|
97
|
+
- cp -r ./eitri-cli-v2.darwin-x64.node ../eitri-cli-v2.darwin-x64.node
|
|
98
|
+
- cp -r ./index.d.ts ../index.d.ts
|
|
99
|
+
- cp -r ./index.js ../rust-index.js
|
|
100
|
+
artifacts:
|
|
101
|
+
- eitri-cli-v2.darwin-arm64.node
|
|
102
|
+
- eitri-cli-v2.darwin-x64.node
|
|
103
|
+
- index.d.ts
|
|
104
|
+
- rust-index.js
|
|
105
|
+
- step: &linuxAndWindowsCrossCompile
|
|
106
|
+
caches:
|
|
107
|
+
- node
|
|
108
|
+
name: 'Linux and Windows cross compile'
|
|
109
|
+
script:
|
|
110
|
+
- apt-get update
|
|
111
|
+
- apt-get install -y git
|
|
112
|
+
- apt-get install -y libssl-dev
|
|
113
|
+
- apt-get install -y libudev-dev
|
|
114
|
+
- apt-get install -y pkg-config
|
|
115
|
+
- apt-get install -y cargo
|
|
116
|
+
- apt-get install -y gcc-mingw-w64
|
|
117
|
+
- apt-get install -y curl
|
|
118
|
+
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
119
|
+
- export PATH="/root/.cargo/bin:${PATH}"
|
|
120
|
+
- rustup --version
|
|
121
|
+
- curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs
|
|
122
|
+
- rustup target add x86_64-pc-windows-msvc
|
|
123
|
+
- rustup target add x86_64-unknown-linux-gnu
|
|
124
|
+
- cargo install cargo-xwin
|
|
125
|
+
- cd eitri-cli-v2
|
|
126
|
+
- npm install
|
|
127
|
+
- npm run build -- --target x86_64-unknown-linux-gnu
|
|
128
|
+
- npm run build -- --target x86_64-pc-windows-msvc
|
|
129
|
+
- ls
|
|
130
|
+
- cp -r ./eitri-cli-v2.linux-x64-gnu.node ../eitri-cli-v2.linux-x64-gnu.node
|
|
131
|
+
- cp -r ./eitri-cli-v2.win32-x64-msvc.node ../eitri-cli-v2.win32-x64-msvc.node
|
|
79
132
|
artifacts:
|
|
80
|
-
-
|
|
133
|
+
- eitri-cli-v2.linux-x64-gnu.node
|
|
134
|
+
- eitri-cli-v2.win32-x64-msvc.node
|
|
81
135
|
branches:
|
|
82
136
|
"**":
|
|
83
|
-
-
|
|
84
|
-
|
|
137
|
+
- parallel:
|
|
138
|
+
fail-fast: false
|
|
139
|
+
steps:
|
|
140
|
+
- step: *runTests
|
|
141
|
+
- step: *runRustTests
|
|
85
142
|
'{beta,master}':
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
143
|
+
- parallel:
|
|
144
|
+
fail-fast: false
|
|
145
|
+
steps:
|
|
146
|
+
- step: *runTests
|
|
147
|
+
- step: *runRustTests
|
|
148
|
+
- parallel:
|
|
149
|
+
fail-fast: true
|
|
150
|
+
steps:
|
|
151
|
+
- step: *linuxAndWindowsCrossCompile
|
|
152
|
+
- step: *macOSCrossCompile
|
|
89
153
|
- step:
|
|
90
154
|
name: "Generation of a new version: beta or stable."
|
|
91
155
|
caches:
|
|
92
156
|
- node
|
|
93
157
|
script:
|
|
94
|
-
- mv ./
|
|
95
|
-
-
|
|
158
|
+
- mv ./eitri-cli-v2.darwin-arm64.node ./eitri-cli-v2/eitri-cli-v2.darwin-arm64.node
|
|
159
|
+
- mv ./eitri-cli-v2.darwin-x64.node ./eitri-cli-v2/eitri-cli-v2.darwin-x64.node
|
|
160
|
+
- mv ./eitri-cli-v2.linux-x64-gnu.node ./eitri-cli-v2/eitri-cli-v2.linux-x64-gnu.node
|
|
161
|
+
- mv ./eitri-cli-v2.win32-x64-msvc.node ./eitri-cli-v2/eitri-cli-v2.win32-x64-msvc.node
|
|
162
|
+
- mv ./index.d.ts ./eitri-cli-v2/index.d.ts
|
|
163
|
+
- mv ./rust-index.js ./eitri-cli-v2/index.js
|
|
96
164
|
- apt-get update
|
|
97
165
|
- apt-get install -y git
|
|
98
|
-
- apt-get install -y libssl-dev
|
|
99
|
-
- apt-get install -y libudev-dev
|
|
100
|
-
- apt-get install -y pkg-config
|
|
101
|
-
- apt-get install -y cargo
|
|
102
|
-
- apt-get install -y gcc-mingw-w64
|
|
103
|
-
- apt-get install -y curl
|
|
104
|
-
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
105
|
-
- export PATH="/root/.cargo/bin:${PATH}"
|
|
106
|
-
- rustup --version
|
|
107
|
-
- curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs
|
|
108
|
-
- rustup target add x86_64-pc-windows-gnu
|
|
109
|
-
- rustup target add x86_64-unknown-linux-gnu
|
|
110
|
-
- cd eitri-cli-v2
|
|
111
|
-
- npm install
|
|
112
|
-
- npm run build-release:unix
|
|
113
|
-
- npm run build-release:win32
|
|
114
|
-
- rm -rf target
|
|
115
|
-
- cd ..
|
|
116
166
|
- echo 'Start release'
|
|
117
167
|
- echo 'If there is a new version, it will be automatically published on NPM according to the channel/branch (beta or master (stable)).'
|
|
118
168
|
- npm i
|
|
Binary file
|
package/config/dev.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const HOST = "api.eitri.tech";
|
|
3
3
|
const packageJson = require("../package.json");
|
|
4
4
|
const path = require("path");
|
|
5
|
+
const FOUNDRY_CONTEXT_PATH = process.env.FOUNDRY_CONTEXT_PATH ?? 'foundry'
|
|
5
6
|
|
|
6
7
|
const config = {
|
|
7
8
|
userAgent: packageJson.name,
|
|
@@ -24,8 +25,8 @@ const config = {
|
|
|
24
25
|
},
|
|
25
26
|
workspace: {
|
|
26
27
|
url: `https://${HOST}`,
|
|
27
|
-
basePath:
|
|
28
|
-
targetPath:
|
|
28
|
+
basePath: FOUNDRY_CONTEXT_PATH,
|
|
29
|
+
targetPath: `/${FOUNDRY_CONTEXT_PATH}/targets`,
|
|
29
30
|
target: {
|
|
30
31
|
knownTargets: [
|
|
31
32
|
{
|
package/eitri-cli-v2/Cargo.toml
CHANGED
|
@@ -1,22 +1,30 @@
|
|
|
1
1
|
[package]
|
|
2
|
-
name = "eitri-cli-v2"
|
|
3
|
-
version = "0.1.0"
|
|
4
|
-
license = "ISC"
|
|
5
2
|
edition = "2021"
|
|
6
|
-
|
|
3
|
+
name = "eitri-cli-v2"
|
|
4
|
+
version = "0.0.0"
|
|
7
5
|
|
|
8
6
|
[lib]
|
|
9
7
|
crate-type = ["cdylib"]
|
|
10
8
|
|
|
11
|
-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
12
9
|
[dependencies]
|
|
10
|
+
# Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
|
|
11
|
+
napi = { version = "2.12.2", default-features = false, features = [
|
|
12
|
+
"napi4",
|
|
13
|
+
"async",
|
|
14
|
+
] }
|
|
15
|
+
napi-derive = "2.12.2"
|
|
13
16
|
homedir = "0.2.1"
|
|
14
17
|
httpmock = "0.7.0"
|
|
15
|
-
neon = "1"
|
|
16
18
|
once_cell = "1.19.0"
|
|
17
19
|
reqwest = { version = "0.11.24", features = ["json", "multipart", "cookies"] }
|
|
18
20
|
serde = { version = "1.0.197", features = ["derive"] }
|
|
19
21
|
serde_derive = "1.0.197"
|
|
20
22
|
serde_json = "1.0.114"
|
|
21
23
|
tokio = { version = "1.36.0", features = ["full"] }
|
|
22
|
-
|
|
24
|
+
|
|
25
|
+
[build-dependencies]
|
|
26
|
+
napi-build = "2.0.1"
|
|
27
|
+
|
|
28
|
+
[profile.release]
|
|
29
|
+
lto = true
|
|
30
|
+
strip = "symbols"
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/eitri-cli-v2/index.js
CHANGED
|
@@ -1,11 +1,300 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/* prettier-ignore */
|
|
4
|
+
|
|
5
|
+
/* auto-generated by NAPI-RS */
|
|
6
|
+
|
|
7
|
+
const { existsSync, readFileSync } = require('fs')
|
|
8
|
+
const { join } = require('path')
|
|
9
|
+
|
|
10
|
+
const { platform, arch } = process
|
|
11
|
+
|
|
12
|
+
let nativeBinding = null
|
|
13
|
+
let localFileExisted = false
|
|
14
|
+
let loadError = null
|
|
15
|
+
|
|
16
|
+
function isMusl() {
|
|
17
|
+
// For Node 10
|
|
18
|
+
if (!process.report || typeof process.report.getReport !== 'function') {
|
|
19
|
+
try {
|
|
20
|
+
const lddPath = require('child_process').execSync('which ldd').toString().trim()
|
|
21
|
+
return readFileSync(lddPath, 'utf8').includes('musl')
|
|
22
|
+
} catch (e) {
|
|
23
|
+
return true
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
const { glibcVersionRuntime } = process.report.getReport().header
|
|
27
|
+
return !glibcVersionRuntime
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
switch (platform) {
|
|
32
|
+
case 'android':
|
|
33
|
+
switch (arch) {
|
|
34
|
+
case 'arm64':
|
|
35
|
+
localFileExisted = existsSync(join(__dirname, 'eitri-cli-v2.android-arm64.node'))
|
|
36
|
+
try {
|
|
37
|
+
if (localFileExisted) {
|
|
38
|
+
nativeBinding = require('./eitri-cli-v2.android-arm64.node')
|
|
39
|
+
} else {
|
|
40
|
+
nativeBinding = require('eitri-cli-v2-android-arm64')
|
|
41
|
+
}
|
|
42
|
+
} catch (e) {
|
|
43
|
+
loadError = e
|
|
44
|
+
}
|
|
45
|
+
break
|
|
46
|
+
case 'arm':
|
|
47
|
+
localFileExisted = existsSync(join(__dirname, 'eitri-cli-v2.android-arm-eabi.node'))
|
|
48
|
+
try {
|
|
49
|
+
if (localFileExisted) {
|
|
50
|
+
nativeBinding = require('./eitri-cli-v2.android-arm-eabi.node')
|
|
51
|
+
} else {
|
|
52
|
+
nativeBinding = require('eitri-cli-v2-android-arm-eabi')
|
|
53
|
+
}
|
|
54
|
+
} catch (e) {
|
|
55
|
+
loadError = e
|
|
56
|
+
}
|
|
57
|
+
break
|
|
58
|
+
default:
|
|
59
|
+
throw new Error(`Unsupported architecture on Android ${arch}`)
|
|
60
|
+
}
|
|
61
|
+
break
|
|
62
|
+
case 'win32':
|
|
63
|
+
switch (arch) {
|
|
64
|
+
case 'x64':
|
|
65
|
+
localFileExisted = existsSync(
|
|
66
|
+
join(__dirname, 'eitri-cli-v2.win32-x64-msvc.node')
|
|
67
|
+
)
|
|
68
|
+
try {
|
|
69
|
+
if (localFileExisted) {
|
|
70
|
+
nativeBinding = require('./eitri-cli-v2.win32-x64-msvc.node')
|
|
71
|
+
} else {
|
|
72
|
+
nativeBinding = require('eitri-cli-v2-win32-x64-msvc')
|
|
73
|
+
}
|
|
74
|
+
} catch (e) {
|
|
75
|
+
loadError = e
|
|
76
|
+
}
|
|
77
|
+
break
|
|
78
|
+
case 'ia32':
|
|
79
|
+
localFileExisted = existsSync(
|
|
80
|
+
join(__dirname, 'eitri-cli-v2.win32-ia32-msvc.node')
|
|
81
|
+
)
|
|
82
|
+
try {
|
|
83
|
+
if (localFileExisted) {
|
|
84
|
+
nativeBinding = require('./eitri-cli-v2.win32-ia32-msvc.node')
|
|
85
|
+
} else {
|
|
86
|
+
nativeBinding = require('eitri-cli-v2-win32-ia32-msvc')
|
|
87
|
+
}
|
|
88
|
+
} catch (e) {
|
|
89
|
+
loadError = e
|
|
90
|
+
}
|
|
91
|
+
break
|
|
92
|
+
case 'arm64':
|
|
93
|
+
localFileExisted = existsSync(
|
|
94
|
+
join(__dirname, 'eitri-cli-v2.win32-arm64-msvc.node')
|
|
95
|
+
)
|
|
96
|
+
try {
|
|
97
|
+
if (localFileExisted) {
|
|
98
|
+
nativeBinding = require('./eitri-cli-v2.win32-arm64-msvc.node')
|
|
99
|
+
} else {
|
|
100
|
+
nativeBinding = require('eitri-cli-v2-win32-arm64-msvc')
|
|
101
|
+
}
|
|
102
|
+
} catch (e) {
|
|
103
|
+
loadError = e
|
|
104
|
+
}
|
|
105
|
+
break
|
|
106
|
+
default:
|
|
107
|
+
throw new Error(`Unsupported architecture on Windows: ${arch}`)
|
|
108
|
+
}
|
|
109
|
+
break
|
|
110
|
+
case 'darwin':
|
|
111
|
+
localFileExisted = existsSync(join(__dirname, 'eitri-cli-v2.darwin-universal.node'))
|
|
112
|
+
try {
|
|
113
|
+
if (localFileExisted) {
|
|
114
|
+
nativeBinding = require('./eitri-cli-v2.darwin-universal.node')
|
|
115
|
+
} else {
|
|
116
|
+
nativeBinding = require('eitri-cli-v2-darwin-universal')
|
|
117
|
+
}
|
|
118
|
+
break
|
|
119
|
+
} catch {}
|
|
120
|
+
switch (arch) {
|
|
121
|
+
case 'x64':
|
|
122
|
+
localFileExisted = existsSync(join(__dirname, 'eitri-cli-v2.darwin-x64.node'))
|
|
123
|
+
try {
|
|
124
|
+
if (localFileExisted) {
|
|
125
|
+
nativeBinding = require('./eitri-cli-v2.darwin-x64.node')
|
|
126
|
+
} else {
|
|
127
|
+
nativeBinding = require('eitri-cli-v2-darwin-x64')
|
|
128
|
+
}
|
|
129
|
+
} catch (e) {
|
|
130
|
+
loadError = e
|
|
131
|
+
}
|
|
132
|
+
break
|
|
133
|
+
case 'arm64':
|
|
134
|
+
localFileExisted = existsSync(
|
|
135
|
+
join(__dirname, 'eitri-cli-v2.darwin-arm64.node')
|
|
136
|
+
)
|
|
137
|
+
try {
|
|
138
|
+
if (localFileExisted) {
|
|
139
|
+
nativeBinding = require('./eitri-cli-v2.darwin-arm64.node')
|
|
140
|
+
} else {
|
|
141
|
+
nativeBinding = require('eitri-cli-v2-darwin-arm64')
|
|
142
|
+
}
|
|
143
|
+
} catch (e) {
|
|
144
|
+
loadError = e
|
|
145
|
+
}
|
|
146
|
+
break
|
|
147
|
+
default:
|
|
148
|
+
throw new Error(`Unsupported architecture on macOS: ${arch}`)
|
|
149
|
+
}
|
|
150
|
+
break
|
|
151
|
+
case 'freebsd':
|
|
152
|
+
if (arch !== 'x64') {
|
|
153
|
+
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
|
|
154
|
+
}
|
|
155
|
+
localFileExisted = existsSync(join(__dirname, 'eitri-cli-v2.freebsd-x64.node'))
|
|
156
|
+
try {
|
|
157
|
+
if (localFileExisted) {
|
|
158
|
+
nativeBinding = require('./eitri-cli-v2.freebsd-x64.node')
|
|
159
|
+
} else {
|
|
160
|
+
nativeBinding = require('eitri-cli-v2-freebsd-x64')
|
|
161
|
+
}
|
|
162
|
+
} catch (e) {
|
|
163
|
+
loadError = e
|
|
164
|
+
}
|
|
165
|
+
break
|
|
166
|
+
case 'linux':
|
|
167
|
+
switch (arch) {
|
|
168
|
+
case 'x64':
|
|
169
|
+
if (isMusl()) {
|
|
170
|
+
localFileExisted = existsSync(
|
|
171
|
+
join(__dirname, 'eitri-cli-v2.linux-x64-musl.node')
|
|
172
|
+
)
|
|
173
|
+
try {
|
|
174
|
+
if (localFileExisted) {
|
|
175
|
+
nativeBinding = require('./eitri-cli-v2.linux-x64-musl.node')
|
|
176
|
+
} else {
|
|
177
|
+
nativeBinding = require('eitri-cli-v2-linux-x64-musl')
|
|
178
|
+
}
|
|
179
|
+
} catch (e) {
|
|
180
|
+
loadError = e
|
|
181
|
+
}
|
|
182
|
+
} else {
|
|
183
|
+
localFileExisted = existsSync(
|
|
184
|
+
join(__dirname, 'eitri-cli-v2.linux-x64-gnu.node')
|
|
185
|
+
)
|
|
186
|
+
try {
|
|
187
|
+
if (localFileExisted) {
|
|
188
|
+
nativeBinding = require('./eitri-cli-v2.linux-x64-gnu.node')
|
|
189
|
+
} else {
|
|
190
|
+
nativeBinding = require('eitri-cli-v2-linux-x64-gnu')
|
|
191
|
+
}
|
|
192
|
+
} catch (e) {
|
|
193
|
+
loadError = e
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
break
|
|
197
|
+
case 'arm64':
|
|
198
|
+
if (isMusl()) {
|
|
199
|
+
localFileExisted = existsSync(
|
|
200
|
+
join(__dirname, 'eitri-cli-v2.linux-arm64-musl.node')
|
|
201
|
+
)
|
|
202
|
+
try {
|
|
203
|
+
if (localFileExisted) {
|
|
204
|
+
nativeBinding = require('./eitri-cli-v2.linux-arm64-musl.node')
|
|
205
|
+
} else {
|
|
206
|
+
nativeBinding = require('eitri-cli-v2-linux-arm64-musl')
|
|
207
|
+
}
|
|
208
|
+
} catch (e) {
|
|
209
|
+
loadError = e
|
|
210
|
+
}
|
|
211
|
+
} else {
|
|
212
|
+
localFileExisted = existsSync(
|
|
213
|
+
join(__dirname, 'eitri-cli-v2.linux-arm64-gnu.node')
|
|
214
|
+
)
|
|
215
|
+
try {
|
|
216
|
+
if (localFileExisted) {
|
|
217
|
+
nativeBinding = require('./eitri-cli-v2.linux-arm64-gnu.node')
|
|
218
|
+
} else {
|
|
219
|
+
nativeBinding = require('eitri-cli-v2-linux-arm64-gnu')
|
|
220
|
+
}
|
|
221
|
+
} catch (e) {
|
|
222
|
+
loadError = e
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
break
|
|
226
|
+
case 'arm':
|
|
227
|
+
localFileExisted = existsSync(
|
|
228
|
+
join(__dirname, 'eitri-cli-v2.linux-arm-gnueabihf.node')
|
|
229
|
+
)
|
|
230
|
+
try {
|
|
231
|
+
if (localFileExisted) {
|
|
232
|
+
nativeBinding = require('./eitri-cli-v2.linux-arm-gnueabihf.node')
|
|
233
|
+
} else {
|
|
234
|
+
nativeBinding = require('eitri-cli-v2-linux-arm-gnueabihf')
|
|
235
|
+
}
|
|
236
|
+
} catch (e) {
|
|
237
|
+
loadError = e
|
|
238
|
+
}
|
|
239
|
+
break
|
|
240
|
+
case 'riscv64':
|
|
241
|
+
if (isMusl()) {
|
|
242
|
+
localFileExisted = existsSync(
|
|
243
|
+
join(__dirname, 'eitri-cli-v2.linux-riscv64-musl.node')
|
|
244
|
+
)
|
|
245
|
+
try {
|
|
246
|
+
if (localFileExisted) {
|
|
247
|
+
nativeBinding = require('./eitri-cli-v2.linux-riscv64-musl.node')
|
|
248
|
+
} else {
|
|
249
|
+
nativeBinding = require('eitri-cli-v2-linux-riscv64-musl')
|
|
250
|
+
}
|
|
251
|
+
} catch (e) {
|
|
252
|
+
loadError = e
|
|
253
|
+
}
|
|
254
|
+
} else {
|
|
255
|
+
localFileExisted = existsSync(
|
|
256
|
+
join(__dirname, 'eitri-cli-v2.linux-riscv64-gnu.node')
|
|
257
|
+
)
|
|
258
|
+
try {
|
|
259
|
+
if (localFileExisted) {
|
|
260
|
+
nativeBinding = require('./eitri-cli-v2.linux-riscv64-gnu.node')
|
|
261
|
+
} else {
|
|
262
|
+
nativeBinding = require('eitri-cli-v2-linux-riscv64-gnu')
|
|
263
|
+
}
|
|
264
|
+
} catch (e) {
|
|
265
|
+
loadError = e
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
break
|
|
269
|
+
case 's390x':
|
|
270
|
+
localFileExisted = existsSync(
|
|
271
|
+
join(__dirname, 'eitri-cli-v2.linux-s390x-gnu.node')
|
|
272
|
+
)
|
|
273
|
+
try {
|
|
274
|
+
if (localFileExisted) {
|
|
275
|
+
nativeBinding = require('./eitri-cli-v2.linux-s390x-gnu.node')
|
|
276
|
+
} else {
|
|
277
|
+
nativeBinding = require('eitri-cli-v2-linux-s390x-gnu')
|
|
278
|
+
}
|
|
279
|
+
} catch (e) {
|
|
280
|
+
loadError = e
|
|
281
|
+
}
|
|
282
|
+
break
|
|
283
|
+
default:
|
|
284
|
+
throw new Error(`Unsupported architecture on Linux: ${arch}`)
|
|
285
|
+
}
|
|
286
|
+
break
|
|
287
|
+
default:
|
|
288
|
+
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
if (!nativeBinding) {
|
|
292
|
+
if (loadError) {
|
|
293
|
+
throw loadError
|
|
294
|
+
}
|
|
295
|
+
throw new Error(`Failed to load native binding`)
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
const { publish } = nativeBinding
|
|
299
|
+
|
|
300
|
+
module.exports.publish = publish
|
|
@@ -1,21 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eitri-cli-v2",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "0.0.0",
|
|
5
4
|
"main": "index.js",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
"types": "index.d.ts",
|
|
6
|
+
"napi": {
|
|
7
|
+
"name": "eitri-cli-v2",
|
|
8
|
+
"triples": {
|
|
9
|
+
"defaults": false,
|
|
10
|
+
"additional": [
|
|
11
|
+
"aarch64-apple-darwin"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
15
14
|
},
|
|
16
|
-
"
|
|
17
|
-
"license": "ISC",
|
|
15
|
+
"license": "MIT",
|
|
18
16
|
"devDependencies": {
|
|
19
|
-
"
|
|
17
|
+
"@napi-rs/cli": "^2.18.0",
|
|
18
|
+
"ava": "^6.0.1"
|
|
19
|
+
},
|
|
20
|
+
"ava": {
|
|
21
|
+
"timeout": "3m"
|
|
22
|
+
},
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">= 10"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"artifacts": "napi artifacts",
|
|
28
|
+
"build": "napi build --platform --release",
|
|
29
|
+
"build:debug": "napi build --platform",
|
|
30
|
+
"prepublishOnly": "napi prepublish -t npm",
|
|
31
|
+
"test": "ava",
|
|
32
|
+
"universal": "napi universal",
|
|
33
|
+
"version": "napi version"
|
|
20
34
|
}
|
|
21
35
|
}
|