create-mirinjs 0.1.0-alpha.13 → 0.1.0-alpha.15
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/package.json +1 -1
- package/src/index.ts +2 -2
- package/src/scaffold.ts +11 -8
- package/template/README.md +3 -2
- package/template/vite.config.ts +1 -1
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -16,8 +16,8 @@ try {
|
|
|
16
16
|
console.log(` cd ${target}`);
|
|
17
17
|
console.log(" bun install");
|
|
18
18
|
console.log(" bun run dev # launches a native window with HMR + typed RPC");
|
|
19
|
-
console.log(" bun run build # packages a standalone
|
|
20
|
-
console.log("Requires macOS arm64,
|
|
19
|
+
console.log(" bun run build # packages a standalone app\n");
|
|
20
|
+
console.log("Requires Bun on macOS arm64, Windows x64, or Linux x64.");
|
|
21
21
|
} catch (err) {
|
|
22
22
|
console.error(`create-mirinjs: ${err instanceof Error ? err.message : err}`);
|
|
23
23
|
process.exit(1);
|
package/src/scaffold.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
import {
|
|
7
7
|
cpSync,
|
|
8
8
|
existsSync,
|
|
9
|
-
readFileSync,
|
|
10
9
|
readdirSync,
|
|
10
|
+
readFileSync,
|
|
11
11
|
renameSync,
|
|
12
12
|
statSync,
|
|
13
13
|
writeFileSync,
|
|
@@ -37,17 +37,20 @@ export function scaffold(targetDir: string, options: ScaffoldOptions = {}): stri
|
|
|
37
37
|
const ignore = join(targetDir, "_gitignore");
|
|
38
38
|
if (existsSync(ignore)) renameSync(ignore, join(targetDir, ".gitignore"));
|
|
39
39
|
|
|
40
|
-
const replacements
|
|
41
|
-
__APP_NAME__
|
|
42
|
-
__APP_ID__
|
|
43
|
-
__MIRIN_VERSION__
|
|
44
|
-
|
|
40
|
+
const replacements = [
|
|
41
|
+
["__APP_NAME__", appName],
|
|
42
|
+
["__APP_ID__", appId],
|
|
43
|
+
["__MIRIN_VERSION__", version],
|
|
44
|
+
] as const;
|
|
45
45
|
for (const file of walk(targetDir)) applyReplacements(file, replacements);
|
|
46
46
|
|
|
47
47
|
return appName;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
function applyReplacements(
|
|
50
|
+
function applyReplacements(
|
|
51
|
+
file: string,
|
|
52
|
+
replacements: readonly (readonly [string, string])[],
|
|
53
|
+
): void {
|
|
51
54
|
let text: string;
|
|
52
55
|
try {
|
|
53
56
|
text = readFileSync(file, "utf8");
|
|
@@ -55,7 +58,7 @@ function applyReplacements(file: string, replacements: Record<string, string>):
|
|
|
55
58
|
return; // skip binary/unreadable files
|
|
56
59
|
}
|
|
57
60
|
let changed = text;
|
|
58
|
-
for (const [from, to] of
|
|
61
|
+
for (const [from, to] of replacements) {
|
|
59
62
|
changed = changed.split(from).join(to);
|
|
60
63
|
}
|
|
61
64
|
if (changed !== text) writeFileSync(file, changed);
|
package/template/README.md
CHANGED
|
@@ -6,11 +6,12 @@ TypeScript + Chromium.
|
|
|
6
6
|
```bash
|
|
7
7
|
bun install
|
|
8
8
|
bun run dev # native window with Vite HMR + typed RPC
|
|
9
|
-
bun run build # standalone
|
|
9
|
+
bun run build # standalone app in ./build
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
- `mirin.config.ts` — the app manifest (windows, ids).
|
|
13
13
|
- `main/` — the Bun main process (RPC handlers, app lifecycle).
|
|
14
14
|
- `ui/` — the React UI, served via the `app://` scheme in builds.
|
|
15
15
|
|
|
16
|
-
Requires macOS arm64,
|
|
16
|
+
Requires Bun on macOS arm64, Windows x64, or Linux x64. macOS distribution
|
|
17
|
+
builds also need the Xcode command-line tools for signing.
|