@julien-lin/universal-pwa-cli 1.1.1 → 1.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.
package/dist/index.cjs CHANGED
@@ -26,6 +26,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  // src/index.ts
27
27
  var import_commander = require("commander");
28
28
  var import_chalk3 = __toESM(require("chalk"), 1);
29
+ var import_fs3 = require("fs");
30
+ var import_url = require("url");
31
+ var import_path3 = require("path");
29
32
 
30
33
  // src/commands/init.ts
31
34
  var import_universal_pwa_core = require("@julien-lin/universal-pwa-core");
@@ -325,8 +328,20 @@ function previewCommand(options = {}) {
325
328
 
326
329
  // src/index.ts
327
330
  var import_universal_pwa_core8 = require("@julien-lin/universal-pwa-core");
331
+ var import_meta = {};
332
+ var __filename = (0, import_url.fileURLToPath)(import_meta.url);
333
+ var __dirname = (0, import_path3.dirname)(__filename);
334
+ var packageJsonPath = (0, import_path3.join)(__dirname, "../package.json");
335
+ var version = "0.0.0";
336
+ try {
337
+ const packageJsonContent = (0, import_fs3.readFileSync)(packageJsonPath, "utf-8");
338
+ const packageJson = JSON.parse(packageJsonContent);
339
+ version = packageJson.version || "0.0.0";
340
+ } catch {
341
+ version = "0.0.0";
342
+ }
328
343
  var program = new import_commander.Command();
329
- program.name("universal-pwa").description("Transform any web project into a PWA with one click").version("0.0.0");
344
+ program.name("universal-pwa").description("Transform any web project into a PWA with one click").version(version);
330
345
  program.command("init").description("Initialize PWA in your project").option("-p, --project-path <path>", "Project path", process.cwd()).option("-n, --name <name>", "App name").option("-s, --short-name <shortName>", "App short name (max 12 chars)").option("-i, --icon-source <path>", "Source image for icons").option("-t, --theme-color <color>", "Theme color (hex)").option("-b, --background-color <color>", "Background color (hex)").option("--skip-icons", "Skip icon generation").option("--skip-service-worker", "Skip service worker generation").option("--skip-injection", "Skip HTML meta-tag injection").option("-o, --output-dir <dir>", "Output directory", "public").action(async (options) => {
331
346
  try {
332
347
  const result = await initCommand({
package/dist/index.js CHANGED
@@ -3,6 +3,9 @@
3
3
  // src/index.ts
4
4
  import { Command } from "commander";
5
5
  import chalk3 from "chalk";
6
+ import { readFileSync } from "fs";
7
+ import { fileURLToPath } from "url";
8
+ import { dirname, join as join3 } from "path";
6
9
 
7
10
  // src/commands/init.ts
8
11
  import { scanProject } from "@julien-lin/universal-pwa-core";
@@ -302,8 +305,19 @@ function previewCommand(options = {}) {
302
305
 
303
306
  // src/index.ts
304
307
  import { scanProject as scanProject2 } from "@julien-lin/universal-pwa-core";
308
+ var __filename = fileURLToPath(import.meta.url);
309
+ var __dirname = dirname(__filename);
310
+ var packageJsonPath = join3(__dirname, "../package.json");
311
+ var version = "0.0.0";
312
+ try {
313
+ const packageJsonContent = readFileSync(packageJsonPath, "utf-8");
314
+ const packageJson = JSON.parse(packageJsonContent);
315
+ version = packageJson.version || "0.0.0";
316
+ } catch {
317
+ version = "0.0.0";
318
+ }
305
319
  var program = new Command();
306
- program.name("universal-pwa").description("Transform any web project into a PWA with one click").version("0.0.0");
320
+ program.name("universal-pwa").description("Transform any web project into a PWA with one click").version(version);
307
321
  program.command("init").description("Initialize PWA in your project").option("-p, --project-path <path>", "Project path", process.cwd()).option("-n, --name <name>", "App name").option("-s, --short-name <shortName>", "App short name (max 12 chars)").option("-i, --icon-source <path>", "Source image for icons").option("-t, --theme-color <color>", "Theme color (hex)").option("-b, --background-color <color>", "Background color (hex)").option("--skip-icons", "Skip icon generation").option("--skip-service-worker", "Skip service worker generation").option("--skip-injection", "Skip HTML meta-tag injection").option("-o, --output-dir <dir>", "Output directory", "public").action(async (options) => {
308
322
  try {
309
323
  const result = await initCommand({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@julien-lin/universal-pwa-cli",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "CLI pour transformer n'importe quel projet web en PWA",
5
5
  "keywords": [
6
6
  "pwa",
@@ -44,7 +44,7 @@
44
44
  "glob": "^13.0.0",
45
45
  "pino": "^9.14.0",
46
46
  "zod": "^4.2.1",
47
- "@julien-lin/universal-pwa-core": "^1.1.1"
47
+ "@julien-lin/universal-pwa-core": "^1.1.2"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@vitest/coverage-v8": "^2.1.4",