@napi-rs/cli 3.0.0 → 3.0.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.
- package/dist/cli.js +326 -513
- package/dist/index.cjs +308 -483
- package/dist/index.js +277 -468
- package/package.json +6 -6
- package/src/api/templates/load-wasi-template.ts +5 -5
- package/src/commands/rename.ts +17 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@napi-rs/cli",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "Cli tools for napi-rs",
|
|
5
5
|
"author": "LongYinan <lynweklm@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/napi-rs/napi-rs",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@inquirer/prompts": "^7.4.0",
|
|
71
|
-
"@napi-rs/cross-toolchain": "^0.0
|
|
72
|
-
"@napi-rs/wasm-tools": "^0.0
|
|
71
|
+
"@napi-rs/cross-toolchain": "^1.0.0",
|
|
72
|
+
"@napi-rs/wasm-tools": "^1.0.0",
|
|
73
73
|
"@octokit/rest": "^22.0.0",
|
|
74
74
|
"clipanion": "^4.0.0-rc.4",
|
|
75
75
|
"colorette": "^2.0.20",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"devDependencies": {
|
|
86
86
|
"@emnapi/core": "^1.4.0",
|
|
87
87
|
"@emnapi/runtime": "^1.4.0",
|
|
88
|
-
"@oxc-node/core": "^0.0.
|
|
88
|
+
"@oxc-node/core": "^0.0.30",
|
|
89
89
|
"@std/toml": "npm:@jsr/std__toml@^1.0.8",
|
|
90
90
|
"@types/debug": "^4.1.12",
|
|
91
91
|
"@types/inquirer": "^9.0.7",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"ava": "^6.2.0",
|
|
97
97
|
"env-paths": "^3.0.0",
|
|
98
98
|
"prettier": "^3.5.3",
|
|
99
|
-
"rolldown": "
|
|
99
|
+
"rolldown": "latest",
|
|
100
100
|
"tslib": "^2.8.1",
|
|
101
101
|
"typescript": "^5.8.2"
|
|
102
102
|
},
|
|
@@ -132,5 +132,5 @@
|
|
|
132
132
|
"e2e/**/*.spec.ts"
|
|
133
133
|
]
|
|
134
134
|
},
|
|
135
|
-
"gitHead": "
|
|
135
|
+
"gitHead": "5816924e6e8db467263f2a7381dd6e2aedcd33f4"
|
|
136
136
|
}
|
|
@@ -6,12 +6,12 @@ export const createWasiBrowserBinding = (
|
|
|
6
6
|
asyncInit = false,
|
|
7
7
|
buffer = false,
|
|
8
8
|
) => {
|
|
9
|
-
const fsImport = fs
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
: `import { Buffer } from 'buffer'`
|
|
9
|
+
const fsImport = fs
|
|
10
|
+
? buffer
|
|
11
|
+
? `import { memfs, Buffer } from '@napi-rs/wasm-runtime/fs'`
|
|
12
|
+
: `import { memfs } from '@napi-rs/wasm-runtime/fs'`
|
|
14
13
|
: ''
|
|
14
|
+
const bufferImport = buffer && !fs ? `import { Buffer } from 'buffer'` : ''
|
|
15
15
|
const wasiCreation = fs
|
|
16
16
|
? `
|
|
17
17
|
export const { fs: __fs, vol: __volume } = memfs()
|
package/src/commands/rename.ts
CHANGED
|
@@ -1,8 +1,25 @@
|
|
|
1
|
+
import { input } from '@inquirer/prompts'
|
|
2
|
+
|
|
1
3
|
import { renameProject } from '../api/rename.js'
|
|
2
4
|
import { BaseRenameCommand } from '../def/rename.js'
|
|
3
5
|
|
|
4
6
|
export class RenameCommand extends BaseRenameCommand {
|
|
5
7
|
async execute() {
|
|
8
|
+
const options = this.getOptions()
|
|
9
|
+
if (!options.name) {
|
|
10
|
+
const name = await input({
|
|
11
|
+
message: `Enter the new package name in the package.json`,
|
|
12
|
+
required: true,
|
|
13
|
+
})
|
|
14
|
+
options.name = name
|
|
15
|
+
}
|
|
16
|
+
if (!options.binaryName) {
|
|
17
|
+
const binaryName = await input({
|
|
18
|
+
message: `Enter the new binary name`,
|
|
19
|
+
required: true,
|
|
20
|
+
})
|
|
21
|
+
options.binaryName = binaryName
|
|
22
|
+
}
|
|
6
23
|
await renameProject(this.getOptions())
|
|
7
24
|
}
|
|
8
25
|
}
|