nowaki 0.12.0 → 0.13.0
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 +4 -4
- package/bin/nowaki.js +3 -4
- package/lib/resolve.js +11 -16
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -23,10 +23,10 @@ nowaki --version
|
|
|
23
23
|
## Usage
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
nowaki dev [dir] #
|
|
27
|
-
nowaki build [dir] #
|
|
28
|
-
nowaki start [dir] #
|
|
29
|
-
nowaki prerender [dir] #
|
|
26
|
+
nowaki dev [dir] # Dev server (HMR + Islands hydration)
|
|
27
|
+
nowaki build [dir] # Production build (client + server)
|
|
28
|
+
nowaki start [dir] # Serve the built app
|
|
29
|
+
nowaki prerender [dir] # Static site generation (SSG)
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
Scaffold a new app with `npm create nowaki@latest my-app`.
|
package/bin/nowaki.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
//
|
|
5
|
-
// postinstall
|
|
4
|
+
// Forwards args and stdio unchanged to the prebuilt Rust nowaki binary.
|
|
5
|
+
// No postinstall: the platform package is resolved and exec'd at runtime.
|
|
6
6
|
|
|
7
7
|
const { spawnSync } = require("node:child_process");
|
|
8
8
|
const { resolveBinary } = require("../lib/resolve.js");
|
|
@@ -18,11 +18,10 @@ try {
|
|
|
18
18
|
const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
|
|
19
19
|
|
|
20
20
|
if (result.error) {
|
|
21
|
-
console.error(`[nowaki]
|
|
21
|
+
console.error(`[nowaki] failed to launch the binary: ${result.error.message}`);
|
|
22
22
|
process.exit(1);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
// シグナルで終了した場合は 128 + シグナル番号、それ以外は終了コードをそのまま返す。
|
|
26
25
|
if (result.signal) {
|
|
27
26
|
process.exit(1);
|
|
28
27
|
}
|
package/lib/resolve.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
//
|
|
4
|
-
// バイナリの絶対パスを解決する。プリビルドバイナリは optionalDependencies で
|
|
5
|
-
// 配られ、npm/pnpm が os/cpu/libc に一致する1つだけをインストールする。
|
|
3
|
+
// Prebuilt binaries ship as optionalDependencies; npm/pnpm installs only the one matching os/cpu/libc.
|
|
6
4
|
|
|
7
|
-
// key -> npm
|
|
5
|
+
// key -> npm package name. Must match TARGETS in scripts/build-npm.mjs.
|
|
8
6
|
const PACKAGES = {
|
|
9
7
|
"darwin-arm64": "@nowaki-dev/cli-darwin-arm64",
|
|
10
8
|
"darwin-x64": "@nowaki-dev/cli-darwin-x64",
|
|
@@ -13,7 +11,6 @@ const PACKAGES = {
|
|
|
13
11
|
"win32-x64": "@nowaki-dev/cli-win32-x64",
|
|
14
12
|
};
|
|
15
13
|
|
|
16
|
-
// glibc か musl か(linux のみ)。Node の process.report から判定する。
|
|
17
14
|
function detectLibc() {
|
|
18
15
|
try {
|
|
19
16
|
const report = typeof process.report.getReport === "function" ? process.report.getReport() : null;
|
|
@@ -24,7 +21,6 @@ function detectLibc() {
|
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
23
|
|
|
27
|
-
// process.platform / process.arch (+ linux は libc) から解決キーを作る。
|
|
28
24
|
function platformKey() {
|
|
29
25
|
const platform = process.platform;
|
|
30
26
|
const arch = process.arch;
|
|
@@ -34,7 +30,6 @@ function platformKey() {
|
|
|
34
30
|
return `${platform}-${arch}`;
|
|
35
31
|
}
|
|
36
32
|
|
|
37
|
-
// 対応バイナリの絶対パスを返す。見つからない場合は分かりやすいエラーを投げる。
|
|
38
33
|
function resolveBinary() {
|
|
39
34
|
const key = platformKey();
|
|
40
35
|
const pkg = PACKAGES[key];
|
|
@@ -43,22 +38,22 @@ function resolveBinary() {
|
|
|
43
38
|
if (!pkg) {
|
|
44
39
|
const supported = Object.keys(PACKAGES).join(", ");
|
|
45
40
|
throw new Error(
|
|
46
|
-
`Nowaki:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
`https://github.com/
|
|
41
|
+
`Nowaki: no prebuilt binary is available for this platform (${key}).\n` +
|
|
42
|
+
`Supported: ${supported}\n` +
|
|
43
|
+
`Workaround: build from source with \`cargo install nowaki\`, or ` +
|
|
44
|
+
`request support at https://github.com/Tettu0530/nowaki/issues.`,
|
|
50
45
|
);
|
|
51
46
|
}
|
|
52
47
|
|
|
53
48
|
try {
|
|
54
|
-
//
|
|
55
|
-
// bin/<name>
|
|
49
|
+
// Each platform package is a plain set of files with no exports,
|
|
50
|
+
// so bin/<name> resolves as a subpath (same approach as esbuild).
|
|
56
51
|
return require.resolve(`${pkg}/bin/${binName}`);
|
|
57
52
|
} catch {
|
|
58
53
|
throw new Error(
|
|
59
|
-
`Nowaki:
|
|
60
|
-
`optionalDependencies
|
|
61
|
-
|
|
54
|
+
`Nowaki: binary package ${pkg} not found.\n` +
|
|
55
|
+
`Installing optionalDependencies may have failed.\n` +
|
|
56
|
+
`Try \`npm install nowaki --force\` (or reinstall with pnpm/yarn).`,
|
|
62
57
|
);
|
|
63
58
|
}
|
|
64
59
|
}
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nowaki",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "The Nowaki CLI — Rust-powered bundler, dev server, and SSG for the Nowaki web framework",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"author": "
|
|
6
|
+
"author": "Tettu0530",
|
|
7
7
|
"homepage": "https://nowaki.dev",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/
|
|
10
|
+
"url": "git+https://github.com/Tettu0530/nowaki.git",
|
|
11
11
|
"directory": "packages/nowaki-cli"
|
|
12
12
|
},
|
|
13
|
-
"bugs": "https://github.com/
|
|
13
|
+
"bugs": "https://github.com/Tettu0530/nowaki/issues",
|
|
14
14
|
"keywords": [
|
|
15
15
|
"nowaki",
|
|
16
16
|
"cli",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"lib/"
|
|
29
29
|
],
|
|
30
30
|
"optionalDependencies": {
|
|
31
|
-
"@nowaki-dev/cli-darwin-arm64": "0.
|
|
32
|
-
"@nowaki-dev/cli-darwin-x64": "0.
|
|
33
|
-
"@nowaki-dev/cli-linux-x64-gnu": "0.
|
|
34
|
-
"@nowaki-dev/cli-linux-arm64-gnu": "0.
|
|
35
|
-
"@nowaki-dev/cli-win32-x64": "0.
|
|
31
|
+
"@nowaki-dev/cli-darwin-arm64": "0.13.0",
|
|
32
|
+
"@nowaki-dev/cli-darwin-x64": "0.13.0",
|
|
33
|
+
"@nowaki-dev/cli-linux-x64-gnu": "0.13.0",
|
|
34
|
+
"@nowaki-dev/cli-linux-arm64-gnu": "0.13.0",
|
|
35
|
+
"@nowaki-dev/cli-win32-x64": "0.13.0"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">=22"
|