create-vidra-app 0.1.8 → 0.1.9

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # create-vidra-app
2
2
 
3
- Scaffold a new [Vidra](https://github.com/rzamfiriu/vidra) application — a
3
+ Scaffold a new [Vidra](https://vidra.build) application — a
4
4
  **React UI + .NET MAUI native host**, shipped from a single codebase.
5
5
 
6
6
  > **Alpha.** APIs and templates may change between 0.x releases.
@@ -41,7 +41,13 @@ npx vidra build --target macos # build + package a macOS .dmg
41
41
 
42
42
  If the MAUI workload is missing, `create-vidra-app` will detect it after
43
43
  scaffolding and offer to install it for you. You can re-check at any time with
44
- `npm run doctor`.
44
+ `npm run doctor`.
45
+
46
+ ## Links
47
+
48
+ - Website: [vidra.build](https://vidra.build)
49
+ - GitHub: [rzamfiriu/vidra](https://github.com/rzamfiriu/vidra)
50
+ - npm: [create-vidra-app](https://www.npmjs.com/package/create-vidra-app)
45
51
 
46
52
  ## License
47
53
 
package/dist/cli.js CHANGED
@@ -29,7 +29,7 @@ var parseArgs = (argv) => {
29
29
  };
30
30
 
31
31
  // src/exec.ts
32
- import { execSync } from "child_process";
32
+ import { execSync, spawn } from "child_process";
33
33
 
34
34
  // src/theme.ts
35
35
  import chalk from "chalk";
@@ -942,7 +942,7 @@ var stepPackage = async (project, target, bundlePath) => {
942
942
  // src/commands/dev.ts
943
943
  import path6 from "path";
944
944
  import fs5 from "fs-extra";
945
- import { execFileSync as execFileSync4, spawn } from "child_process";
945
+ import { execFileSync as execFileSync4, spawn as spawn2 } from "child_process";
946
946
  import { request } from "http";
947
947
  var POLL_INTERVAL_MS = 500;
948
948
  var POLL_TIMEOUT_MS = 3e4;
@@ -1065,7 +1065,7 @@ var DevSession = class {
1065
1065
  }
1066
1066
  startVite() {
1067
1067
  console.log(taggedRow("active", "ui", dim("starting dev server\u2026")));
1068
- const vite = spawn(NPM_COMMAND, ["run", "dev"], {
1068
+ const vite = spawn2(NPM_COMMAND, ["run", "dev"], {
1069
1069
  cwd: this.project.uiDir,
1070
1070
  stdio: ["ignore", "pipe", "pipe"],
1071
1071
  shell: process.platform === "win32"
@@ -1148,7 +1148,7 @@ var DevSession = class {
1148
1148
  console.log(
1149
1149
  taggedRow("done", "host", `${dim("launched")} ${value(path6.basename(appBundle))}`)
1150
1150
  );
1151
- const host = spawn(binary, [], {
1151
+ const host = spawn2(binary, [], {
1152
1152
  cwd: this.project.root,
1153
1153
  stdio: ["ignore", "pipe", "pipe"],
1154
1154
  env: { ...process.env, VIDRA_DEV_URL: this.viteUrl }
@@ -1185,7 +1185,7 @@ var DevSession = class {
1185
1185
  console.log(
1186
1186
  taggedRow("done", "host", `${dim("launched")} ${value(path6.basename(exe))}`)
1187
1187
  );
1188
- const host = spawn(exe, [], {
1188
+ const host = spawn2(exe, [], {
1189
1189
  cwd: path6.dirname(exe),
1190
1190
  stdio: ["ignore", "pipe", "pipe"],
1191
1191
  env: { ...process.env, VIDRA_DEV_URL: this.viteUrl }
package/dist/index.js CHANGED
@@ -44,7 +44,7 @@ var parseArgs = (argv) => {
44
44
  };
45
45
 
46
46
  // src/exec.ts
47
- import { execSync } from "child_process";
47
+ import { execSync, spawn } from "child_process";
48
48
 
49
49
  // src/theme.ts
50
50
  import chalk from "chalk";
@@ -107,14 +107,11 @@ var exec = (cmd, cwd) => {
107
107
  process.exit(1);
108
108
  }
109
109
  };
110
- var tryExec = (cmd, cwd) => {
111
- try {
112
- execSync(cmd, { cwd, stdio: "pipe" });
113
- return true;
114
- } catch {
115
- return false;
116
- }
117
- };
110
+ var tryExecAsync = (cmd, cwd) => new Promise((resolve) => {
111
+ const child = spawn(cmd, { cwd, stdio: "ignore", shell: true });
112
+ child.on("error", () => resolve(false));
113
+ child.on("close", (code) => resolve(code === 0));
114
+ });
118
115
 
119
116
  // src/scaffold.ts
120
117
  import fs from "fs-extra";
@@ -335,7 +332,7 @@ var VIDRA_REPO_ROOT = path2.resolve(CLI_ROOT, "..", "..", "..");
335
332
  var LOCAL_FEED_DIR = path2.join(VIDRA_REPO_ROOT, "dist", "packages");
336
333
  var LOCAL_CLI_DIR = CLI_ROOT;
337
334
  var LOCAL_SDK_DIR = path2.join(VIDRA_REPO_ROOT, "src", "sdk", "vidra-js");
338
- var VIDRA_VERSION = "0.1.0";
335
+ var VIDRA_VERSION = "0.2.0";
339
336
  var SDK_VERSION = "0.1.0";
340
337
  var main = async () => {
341
338
  console.log();
@@ -419,8 +416,10 @@ var main = async () => {
419
416
  );
420
417
  console.log(row({ glyph: "active", detail: dim("installing dependencies\u2026") }));
421
418
  const uiDir = path2.join(root, "ui");
422
- const rootNpmOk = tryExec("npm install", root);
423
- const uiNpmOk = tryExec("npm install", uiDir);
419
+ const [rootNpmOk, uiNpmOk] = await Promise.all([
420
+ tryExecAsync("npm install", root),
421
+ tryExecAsync("npm install", uiDir)
422
+ ]);
424
423
  const npmOk = rootNpmOk && uiNpmOk;
425
424
  console.log();
426
425
  console.log(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-vidra-app",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Scaffold a new Vidra application (React + .NET MAUI)",
5
5
  "type": "module",
6
6
  "bin": {
@@ -41,7 +41,7 @@
41
41
  "url": "git+https://github.com/rzamfiriu/vidra.git",
42
42
  "directory": "src/cli/create-vidra-app"
43
43
  },
44
- "homepage": "https://github.com/rzamfiriu/vidra#readme",
44
+ "homepage": "https://vidra.build",
45
45
  "bugs": {
46
46
  "url": "https://github.com/rzamfiriu/vidra/issues"
47
47
  },
@@ -1,6 +1,6 @@
1
1
  # {{appTitle}}
2
2
 
3
- A cross-platform application built with [Vidra](https://github.com/user/vidra) — React UI + .NET MAUI native host.
3
+ A cross-platform application built with [Vidra](https://vidra.build) — React UI + .NET MAUI native host.
4
4
 
5
5
  ## Getting Started
6
6
 
@@ -69,3 +69,7 @@ npm run build
69
69
  ├── vite.config.ts
70
70
  └── package.json
71
71
  ```
72
+
73
+ ---
74
+
75
+ Built with [Vidra](https://vidra.build) — a C#/.NET native core with a web UI.