webnek 0.1.1 → 0.1.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.
Files changed (3) hide show
  1. package/README.md +5 -5
  2. package/bin/cli.mjs +10 -9
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # webnek
2
2
 
3
3
  ```bash
4
- bunx webnek my-app
4
+ bunx webnek@latest my-app
5
5
  cd my-app
6
- bunx webnek dev
6
+ bunx webnek@latest dev
7
7
  ```
8
8
 
9
9
  That last command installs the Rust CLI the first time, then starts the app.
@@ -16,8 +16,8 @@ Do not `bun add webnek` inside the app.
16
16
 
17
17
  | Command | What it does |
18
18
  |---|---|
19
- | `bunx webnek [dir]` | Scaffold a project |
20
- | `bunx webnek dev` | Start the app |
21
- | `bunx webnek add <pkg>` | Add a crate or npm package |
19
+ | `bunx webnek@latest [dir]` | Scaffold a project |
20
+ | `bunx webnek@latest dev` | Start the app |
21
+ | `bunx webnek@latest add <pkg>` | Add a crate or npm package |
22
22
 
23
23
  Requires [Rust](https://rustup.rs/).
package/bin/cli.mjs CHANGED
@@ -16,6 +16,7 @@ const here = dirname(fileURLToPath(import.meta.url));
16
16
  const pkgRoot = resolve(here, "..");
17
17
  const templateRoot = join(pkgRoot, "template");
18
18
  const GIT = "https://github.com/Grenish/webnek";
19
+ const VERSION = JSON.parse(readFileSync(join(pkgRoot, "package.json"), "utf8")).version;
19
20
 
20
21
  const args = process.argv.slice(2);
21
22
  const cmd = args[0];
@@ -42,7 +43,7 @@ const IGNORE_WHEN_EMPTY = new Set([
42
43
  function help() {
43
44
  const run = invokeCmd();
44
45
  console.log(`
45
- webnek 0.1.1
46
+ webnek ${VERSION}
46
47
 
47
48
  ${run} [dir] Scaffold a new app
48
49
  ${run} new [dir] Same as above
@@ -89,7 +90,7 @@ function frameworkDep(appDir) {
89
90
  rel = rel.replaceAll("\\", "/");
90
91
  return `webnek = { path = "${rel}", features = ["ssr"] }`;
91
92
  }
92
- return `webnek = { git = "${GIT}", features = ["ssr"] }`;
93
+ return `webnek = { version = "0.1.0", features = ["ssr"] }`;
93
94
  }
94
95
 
95
96
  function isEffectivelyEmpty(dir) {
@@ -167,7 +168,7 @@ function scaffold(targetArg) {
167
168
 
168
169
  const rel = relative(process.cwd(), appDir) || ".";
169
170
  const run = invokeCmd();
170
- const lines = [` webnek created ${rel}`, ``, ` Next:`];
171
+ const lines = [` webnek ${VERSION} created ${rel}`, ``, ` Next:`];
171
172
  if (rel !== ".") {
172
173
  lines.push(` cd ${rel}`);
173
174
  }
@@ -185,13 +186,13 @@ function invokeCmd() {
185
186
  const argv0 = process.argv[0] || "";
186
187
  const argv1 = process.argv[1] || "";
187
188
  if (ua.includes("bun") || argv0.includes("bun") || argv1.includes("bun")) {
188
- return "bunx webnek";
189
+ return "bunx webnek@latest";
189
190
  }
190
191
  if (ua.includes("npx") || argv1.includes("npx") || argv1.includes("/npm/")) {
191
- return "npx webnek";
192
+ return "npx webnek@latest";
192
193
  }
193
194
  if (which("webnek")) return "webnek";
194
- return "bunx webnek";
195
+ return "bunx webnek@latest";
195
196
  }
196
197
 
197
198
  function cargoWebnekOk() {
@@ -213,10 +214,10 @@ function installCargoWebnek() {
213
214
  );
214
215
  return ins.status === 0;
215
216
  }
216
- console.log(" webnek installing cargo-webnek (once, from git) …");
217
+ console.log(" webnek installing cargo-webnek (once) …");
217
218
  const ins = spawnSync(
218
219
  "cargo",
219
- ["install", "--git", GIT, "webnek-cli"],
220
+ ["install", "webnek-cli"],
220
221
  { stdio: "inherit" }
221
222
  );
222
223
  return ins.status === 0;
@@ -238,7 +239,7 @@ function ensureCargoWeb() {
238
239
  console.error(`
239
240
  ✖ could not install cargo-webnek.
240
241
 
241
- cargo install --git ${GIT} webnek-cli
242
+ cargo install webnek-cli
242
243
  `);
243
244
  process.exit(1);
244
245
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "webnek",
3
- "version": "0.1.1",
4
- "description": "Webnek app installer. bunx webnek my-app && bunx webnek dev",
3
+ "version": "0.1.2",
4
+ "description": "Webnek app installer. bunx webnek@latest my-app && bunx webnek@latest dev",
5
5
  "type": "module",
6
6
  "license": "MIT OR Apache-2.0",
7
7
  "author": "Grenish Rai <mrcoder2033d@gmail.com>",