create-fhevm-example 1.3.1 → 1.3.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.
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Help Menu - CLI Usage and Documentation.
3
+ */
4
+ /**
5
+ * Displays the CLI help menu.
6
+ * Adapts content based on LOCAL_DEV environment variable.
7
+ */
8
+ export declare function showHelp(): void;
9
+ //# sourceMappingURL=help.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../scripts/help.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH;;;GAGG;AACH,wBAAgB,QAAQ,IAAI,IAAI,CAgF/B"}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ /**
3
+ * Help Menu - CLI Usage and Documentation.
4
+ */
5
+ var __importDefault = (this && this.__importDefault) || function (mod) {
6
+ return (mod && mod.__esModule) ? mod : { "default": mod };
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.showHelp = showHelp;
10
+ const picocolors_1 = __importDefault(require("picocolors"));
11
+ const config_1 = require("./config");
12
+ /**
13
+ * Displays the CLI help menu.
14
+ * Adapts content based on LOCAL_DEV environment variable.
15
+ */
16
+ function showHelp() {
17
+ const isDev = process.env.LOCAL_DEV === "1";
18
+ const cmd = isDev ? "npm run" : "npx";
19
+ const createCmd = isDev ? "create" : "create-fhevm-example";
20
+ console.log(`
21
+ ${picocolors_1.default.bgCyan(picocolors_1.default.black(picocolors_1.default.bold(" 🔐 create-fhevm-example ")))}
22
+ ${picocolors_1.default.dim("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")}
23
+
24
+ ${picocolors_1.default.cyan(picocolors_1.default.bold("📋 USAGE"))}
25
+
26
+ ${picocolors_1.default.dim("$")} ${picocolors_1.default.white(`${cmd} ${createCmd}`)} ${picocolors_1.default.dim("→")} Interactive mode ${picocolors_1.default.yellow("(recommended)")}
27
+ ${picocolors_1.default.dim("$")} ${picocolors_1.default.white(`${cmd} ${createCmd}`)} ${picocolors_1.default.green("--example")} ${picocolors_1.default.yellow("<name>")} ${picocolors_1.default.dim("→")} Create single example
28
+ ${picocolors_1.default.dim("$")} ${picocolors_1.default.white(`${cmd} ${createCmd}`)} ${picocolors_1.default.green("--category")} ${picocolors_1.default.yellow("<name>")} ${picocolors_1.default.dim("→")} Create category project
29
+ ${picocolors_1.default.dim("$")} ${picocolors_1.default.white(`${cmd} ${createCmd}`)} ${picocolors_1.default.green("--add")} ${picocolors_1.default.dim("→")} Add to existing project
30
+
31
+ ${picocolors_1.default.cyan(picocolors_1.default.bold("⚙️ OPTIONS"))}
32
+
33
+ ${picocolors_1.default.green("--example")} ${picocolors_1.default.dim("<name>")} Create a single example project
34
+ ${picocolors_1.default.green("--category")} ${picocolors_1.default.dim("<name>")} Create a category project
35
+ ${picocolors_1.default.green("--add")} Add FHEVM to existing Hardhat project
36
+ ${picocolors_1.default.green("--target")} ${picocolors_1.default.dim("<dir>")} Target directory for --add mode
37
+ ${picocolors_1.default.green("--output")} ${picocolors_1.default.dim("<dir>")} Output directory
38
+ ${picocolors_1.default.green("--install")} Auto-install dependencies
39
+ ${picocolors_1.default.green("--test")} Auto-run tests (requires --install)
40
+ ${picocolors_1.default.green("--help")}${picocolors_1.default.dim(", -h")} Show this help message
41
+
42
+ ${isDev
43
+ ? `
44
+ ${picocolors_1.default.cyan(picocolors_1.default.bold("🛠️ DEVELOPER TOOLS"))}
45
+
46
+ ${picocolors_1.default.green("npm run create:docs")} Generate documentation
47
+ ${picocolors_1.default.green("npm run generate:config")} Update contract registry
48
+ ${picocolors_1.default.green("npm run doctor")} Run system health check
49
+ ${picocolors_1.default.green("npm run test:all")} Run bulk project tests
50
+ `
51
+ : ""}
52
+
53
+ ${picocolors_1.default.cyan(picocolors_1.default.bold("⚡ EXAMPLES"))}
54
+
55
+ ${picocolors_1.default.dim("$")} ${picocolors_1.default.white(`${cmd} ${createCmd}`)} ${picocolors_1.default.green("--example")} ${picocolors_1.default.yellow("fhe-counter")}
56
+ ${picocolors_1.default.dim("$")} ${picocolors_1.default.white(`${cmd} ${createCmd}`)} ${picocolors_1.default.green("--category")} ${picocolors_1.default.yellow("basic")} ${picocolors_1.default.green("--output")} ${picocolors_1.default.blue("./my-project")}
57
+ ${picocolors_1.default.dim("$")} ${picocolors_1.default.white(`${cmd} ${createCmd}`)} ${picocolors_1.default.green("--add")}
58
+
59
+ ${picocolors_1.default.cyan(picocolors_1.default.bold("📦 AVAILABLE EXAMPLES"))}
60
+
61
+ ${picocolors_1.default.dim(Object.keys(config_1.EXAMPLES).slice(0, 10).join(", "))}
62
+ ${picocolors_1.default.dim("...")} and ${picocolors_1.default.yellow(String(Object.keys(config_1.EXAMPLES).length - 10))} more
63
+
64
+ ${picocolors_1.default.cyan(picocolors_1.default.bold("📁 AVAILABLE CATEGORIES"))}
65
+
66
+ ${Object.keys(config_1.CATEGORIES)
67
+ .map((c) => picocolors_1.default.yellow(c))
68
+ .join(", ")}
69
+
70
+ ${picocolors_1.default.dim("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")}
71
+ ${picocolors_1.default.dim("📚 Documentation:")} ${picocolors_1.default.blue("https://github.com/NecipAkgz/fhevm-example-factory")}
72
+ `);
73
+ }
@@ -323,49 +323,72 @@ async function runDirectMode(args) {
323
323
  // QUICK MODE (CLI Arguments)
324
324
  // =============================================================================
325
325
  function showHelp() {
326
- console.log(`
326
+ const isDev = process.env.LOCAL_DEV === "1";
327
+ if (isDev) {
328
+ // Developer help - show npm run scripts
329
+ console.log(`
330
+ ${picocolors_1.default.bgCyan(picocolors_1.default.black(picocolors_1.default.bold(" 🔐 FHEVM Example Factory - Developer Mode ")))}
331
+ ${picocolors_1.default.dim("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")}
332
+
333
+ ${picocolors_1.default.cyan(picocolors_1.default.bold("📋 CREATE COMMANDS"))}
334
+
335
+ ${picocolors_1.default.green("npm run create")} Interactive mode ${picocolors_1.default.yellow("(recommended)")}
336
+ ${picocolors_1.default.green("npm run create:example")} ${picocolors_1.default.dim("<name>")} Create single example
337
+ ${picocolors_1.default.green("npm run create:category")} ${picocolors_1.default.dim("<name>")} Create category project
338
+ ${picocolors_1.default.green("npm run create:docs")} Generate documentation
339
+
340
+ ${picocolors_1.default.cyan(picocolors_1.default.bold("🛠️ MAINTENANCE"))}
341
+
342
+ ${picocolors_1.default.green("npm run test:all")} Test multiple examples
343
+ ${picocolors_1.default.green("npm run generate:config")} Update contract registry
344
+ ${picocolors_1.default.green("npm run doctor")} System health check
345
+
346
+ ${picocolors_1.default.cyan(picocolors_1.default.bold("❓ HELP"))}
347
+
348
+ ${picocolors_1.default.green("npm run help:create")} This help
349
+ ${picocolors_1.default.green("npm run help:docs")} Docs generator help
350
+ ${picocolors_1.default.green("npm run help:test")} Test runner help
351
+
352
+ ${picocolors_1.default.dim("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")}
353
+ `);
354
+ }
355
+ else {
356
+ // End-user help - show npx commands
357
+ console.log(`
327
358
  ${picocolors_1.default.bgCyan(picocolors_1.default.black(picocolors_1.default.bold(" 🔐 create-fhevm-example ")))}
328
359
  ${picocolors_1.default.dim("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")}
329
360
 
330
361
  ${picocolors_1.default.cyan(picocolors_1.default.bold("📋 USAGE"))}
331
362
 
332
- ${picocolors_1.default.dim("$")} ${picocolors_1.default.white("npx create-fhevm-example")} ${picocolors_1.default.dim("→")} Interactive mode ${picocolors_1.default.yellow("(recommended)")}
333
- ${picocolors_1.default.dim("$")} ${picocolors_1.default.white("npx create-fhevm-example")} ${picocolors_1.default.green("--example")} ${picocolors_1.default.yellow("<name>")} ${picocolors_1.default.dim("→")} Create single example
334
- ${picocolors_1.default.dim("$")} ${picocolors_1.default.white("npx create-fhevm-example")} ${picocolors_1.default.green("--category")} ${picocolors_1.default.yellow("<name>")} ${picocolors_1.default.dim("→")} Create category project
335
- ${picocolors_1.default.dim("$")} ${picocolors_1.default.white("npx create-fhevm-example")} ${picocolors_1.default.green("--add")} ${picocolors_1.default.dim("→")} Add to existing project
363
+ ${picocolors_1.default.dim("$")} npx create-fhevm-example ${picocolors_1.default.dim("→")} Interactive ${picocolors_1.default.yellow("(recommended)")}
364
+ ${picocolors_1.default.dim("$")} npx create-fhevm-example ${picocolors_1.default.green("--example")} ${picocolors_1.default.yellow("<name>")} ${picocolors_1.default.dim("→")} Single example
365
+ ${picocolors_1.default.dim("$")} npx create-fhevm-example ${picocolors_1.default.green("--category")} ${picocolors_1.default.yellow("<name>")} ${picocolors_1.default.dim("→")} Category project
366
+ ${picocolors_1.default.dim("$")} npx create-fhevm-example ${picocolors_1.default.green("--add")} ${picocolors_1.default.dim("→")} Add to existing project
336
367
 
337
368
  ${picocolors_1.default.cyan(picocolors_1.default.bold("⚙️ OPTIONS"))}
338
369
 
339
- ${picocolors_1.default.green("--example")} ${picocolors_1.default.dim("<name>")} Create a single example project
340
- ${picocolors_1.default.green("--category")} ${picocolors_1.default.dim("<name>")} Create a category project
341
- ${picocolors_1.default.green("--add")} Add FHEVM to existing Hardhat project
342
- ${picocolors_1.default.green("--target")} ${picocolors_1.default.dim("<dir>")} Target directory for --add mode
343
- ${picocolors_1.default.green("--output")} ${picocolors_1.default.dim("<dir>")} Output directory
344
- ${picocolors_1.default.green("--install")} Auto-install dependencies
345
- ${picocolors_1.default.green("--test")} Auto-run tests (requires --install)
346
- ${picocolors_1.default.green("--help")}${picocolors_1.default.dim(", -h")} Show this help message
370
+ ${picocolors_1.default.green("--example")} ${picocolors_1.default.dim("<name>")} Single example project
371
+ ${picocolors_1.default.green("--category")} ${picocolors_1.default.dim("<name>")} Category project
372
+ ${picocolors_1.default.green("--add")} Add FHEVM to existing Hardhat project
373
+ ${picocolors_1.default.green("--output")} ${picocolors_1.default.dim("<dir>")} Output directory
374
+ ${picocolors_1.default.green("--install")} Auto-install dependencies
375
+ ${picocolors_1.default.green("--help")} Show this help
347
376
 
348
377
  ${picocolors_1.default.cyan(picocolors_1.default.bold("⚡ EXAMPLES"))}
349
378
 
350
- ${picocolors_1.default.dim("$")} ${picocolors_1.default.white("npx create-fhevm-example")} ${picocolors_1.default.green("--example")} ${picocolors_1.default.yellow("fhe-counter")}
351
- ${picocolors_1.default.dim("$")} ${picocolors_1.default.white("npx create-fhevm-example")} ${picocolors_1.default.green("--category")} ${picocolors_1.default.yellow("basic")} ${picocolors_1.default.green("--output")} ${picocolors_1.default.blue("./my-project")}
352
- ${picocolors_1.default.dim("$")} ${picocolors_1.default.white("npx create-fhevm-example")} ${picocolors_1.default.green("--add")}
353
- ${picocolors_1.default.dim("$")} ${picocolors_1.default.white("npx create-fhevm-example")} ${picocolors_1.default.green("--example")} ${picocolors_1.default.yellow("fhe-counter")} ${picocolors_1.default.green("--install")} ${picocolors_1.default.green("--test")}
379
+ ${picocolors_1.default.dim("$")} npx create-fhevm-example --example fhe-counter
380
+ ${picocolors_1.default.dim("$")} npx create-fhevm-example --category basic --output ./my-project
381
+ ${picocolors_1.default.dim("$")} npx create-fhevm-example --add
354
382
 
355
- ${picocolors_1.default.cyan(picocolors_1.default.bold("📦 AVAILABLE EXAMPLES"))}
383
+ ${picocolors_1.default.cyan(picocolors_1.default.bold("📦 AVAILABLE"))}
356
384
 
357
- ${picocolors_1.default.dim(Object.keys(config_1.EXAMPLES).slice(0, 10).join(", "))}
358
- ${picocolors_1.default.dim("...")} and ${picocolors_1.default.yellow(String(Object.keys(config_1.EXAMPLES).length - 10))} more
359
-
360
- ${picocolors_1.default.cyan(picocolors_1.default.bold("📁 AVAILABLE CATEGORIES"))}
361
-
362
- ${Object.keys(config_1.CATEGORIES)
363
- .map((c) => picocolors_1.default.yellow(c))
364
- .join(", ")}
385
+ Examples: ${picocolors_1.default.dim(Object.keys(config_1.EXAMPLES).slice(0, 5).join(", "))} ${picocolors_1.default.dim("...")} (${Object.keys(config_1.EXAMPLES).length} total)
386
+ Categories: ${Object.keys(config_1.CATEGORIES).map((c) => picocolors_1.default.yellow(c)).join(", ")}
365
387
 
366
388
  ${picocolors_1.default.dim("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")}
367
- ${picocolors_1.default.dim("📚 Documentation:")} ${picocolors_1.default.blue("https://github.com/NecipAkgz/fhevm-example-factory")}
389
+ ${picocolors_1.default.dim("📚 Docs:")} ${picocolors_1.default.blue("https://github.com/NecipAkgz/fhevm-example-factory")}
368
390
  `);
391
+ }
369
392
  }
370
393
  // =============================================================================
371
394
  // MAIN ENTRY POINT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fhevm-example",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "Create FHEVM example projects with a single command - A comprehensive toolkit for building privacy-preserving smart contracts",
5
5
  "bin": {
6
6
  "create-fhevm-example": "./dist/scripts/index.js"
@@ -18,11 +18,11 @@
18
18
  "test:all": "npx ts-node scripts/maintenance.ts test-all",
19
19
  "generate:config": "npx ts-node scripts/generate-config.ts",
20
20
  "doctor": "npx ts-node scripts/doctor.ts",
21
- "help:create": "npx ts-node scripts/index.ts --help",
21
+ "help:create": "LOCAL_DEV=1 npx ts-node scripts/index.ts --help",
22
22
  "help:docs": "npx ts-node scripts/generate-docs.ts --help",
23
23
  "help:test": "npx ts-node scripts/maintenance.ts test-all --help",
24
24
 
25
- "postinstall": "git submodule update --init --recursive",
25
+ "prepare": "git submodule update --init --recursive || true",
26
26
  "prepublishOnly": "npm run build",
27
27
  "prepack": "mv README.md GITHUB_README.md && cp NPM_README.md README.md",
28
28
  "postpack": "mv GITHUB_README.md README.md"