webhanger 1.0.6 → 1.0.8

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 (2) hide show
  1. package/bin/cli.js +0 -65
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -345,70 +345,6 @@ switch (command) {
345
345
  console.log(chalk.gray(` "cdn": { "url": "https://webhanger-edge.your-subdomain.workers.dev" }`));
346
346
  break;
347
347
  }
348
- case "release": {
349
- const releaseType = args[1] || "patch"; // patch | minor | major
350
- const { execSync } = await import("child_process");
351
- const { default: fsExtra } = await import("fs-extra");
352
- const { default: pathMod } = await import("path");
353
-
354
- console.log(chalk.cyan(`\nšŸš€ Releasing webhanger + webhanger-front (${releaseType})...\n`));
355
-
356
- try {
357
- // 1. Bump + publish webhanger
358
- console.log(chalk.white(" [1/4] Publishing webhanger..."));
359
- execSync(`npm version ${releaseType} --no-git-tag-version`, { stdio: "inherit" });
360
- execSync("npm publish --access public", { stdio: "inherit" });
361
- const whPkg = await fsExtra.readJson("./package.json");
362
- console.log(chalk.green(` āœ… webhanger@${whPkg.version} published`));
363
-
364
- // 2. Build + bump + publish webhanger-front
365
- console.log(chalk.white("\n [2/4] Building webhanger-front..."));
366
- execSync("npm run build", { cwd: "./webhanger-front", stdio: "inherit" });
367
- execSync(`npm version ${releaseType} --no-git-tag-version`, { cwd: "./webhanger-front", stdio: "inherit" });
368
- execSync("npm publish --access public", { cwd: "./webhanger-front", stdio: "inherit" });
369
- const whfPkg = await fsExtra.readJson("./webhanger-front/package.json");
370
- console.log(chalk.green(` āœ… webhanger-front@${whfPkg.version} published`));
371
-
372
- // 3. Update all HTML files to use new unpkg version
373
- console.log(chalk.white("\n [3/4] Updating unpkg references..."));
374
- const newUrl = `https://unpkg.com/webhanger-front@${whfPkg.version}/browser.min.js`;
375
- const oldPattern = /https:\/\/unpkg\.com\/webhanger-front@[^/]+\/browser(?:\.min)?\.js/g;
376
-
377
- const htmlFiles = [];
378
- async function findHtml(dir) {
379
- const entries = await fsExtra.readdir(dir, { withFileTypes: true });
380
- for (const e of entries) {
381
- if (e.name === "node_modules" || e.name === ".git") continue;
382
- const full = pathMod.join(dir, e.name);
383
- if (e.isDirectory()) await findHtml(full);
384
- else if (e.name.endsWith(".html") || e.name.endsWith(".js")) htmlFiles.push(full);
385
- }
386
- }
387
- await findHtml(".");
388
-
389
- let updated = 0;
390
- for (const file of htmlFiles) {
391
- const content = await fsExtra.readFile(file, "utf-8");
392
- if (oldPattern.test(content)) {
393
- await fsExtra.writeFile(file, content.replace(oldPattern, newUrl), "utf-8");
394
- console.log(chalk.gray(` → ${file}`));
395
- updated++;
396
- }
397
- }
398
- console.log(chalk.green(` āœ… Updated ${updated} files to ${newUrl}`));
399
-
400
- // 4. Summary
401
- console.log(chalk.green(`\nāœ… Release complete!`));
402
- console.log(chalk.white(` webhanger : v${whPkg.version}`));
403
- console.log(chalk.white(` webhanger-front : v${whfPkg.version}`));
404
- console.log(chalk.gray(` unpkg URL : ${newUrl}\n`));
405
-
406
- } catch (err) {
407
- console.log(chalk.red(`\nāŒ Release failed: ${err.message}`));
408
- process.exit(1);
409
- }
410
- break;
411
- }
412
348
  case "atomize": {
413
349
  const atomFile = args[1];
414
350
  const atomOut = args[2] || "./atomized";
@@ -924,7 +860,6 @@ ${mounts}
924
860
  console.log(chalk.cyan(BANNER));
925
861
  console.log(chalk.white("Commands:"));
926
862
  console.log(chalk.gray(" wh init — setup your project"));
927
- console.log(chalk.gray(" wh release [patch|minor|major] — publish both packages + update all unpkg refs"));
928
863
  console.log(chalk.gray(" wh ship <comp-dir> <site-dir> [version] [out-dir] — deploy + build + zip in one shot"));
929
864
  console.log(chalk.gray(" wh deploy <dir> <name> <version> — deploy a single component"));
930
865
  console.log(chalk.gray(" wh graph-deploy <comp-dir> [version] [out-dir] — deploy all + resolve dep graph"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webhanger",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Component-as-a-Service platform — bundle, sign, and deliver UI components via edge CDN",
5
5
  "type": "module",
6
6
  "main": "index.js",