kuhul-es 1.0.13 → 1.0.15

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/bin/kuhul-es.js CHANGED
@@ -3,12 +3,13 @@
3
3
 
4
4
  /*
5
5
  * KUHUL-ES CLI
6
- * v1.0.12 — Version Integrity + Trace Artifact
6
+ * Version Integrity + Trace Artifact
7
7
  */
8
8
 
9
9
  const fs = require('fs');
10
10
  const path = require('path');
11
11
  const crypto = require('crypto');
12
+ const chalk = require('chalk');
12
13
  const { program } = require('commander');
13
14
 
14
15
  // -----------------------------------------------------------------------------
@@ -41,7 +42,70 @@ program
41
42
  .command('init [project-name]')
42
43
  .description('Initialize a new KUHUL-ES project')
43
44
  .action((projectName = 'my-kuhul-app') => {
44
- console.log(`Creating project: ${projectName}`);
45
+ console.log(chalk.green(`Creating project: ${projectName}`));
46
+ console.log(chalk.yellow('Use `kuhul-es new <name>` for full scaffold'));
47
+ process.exit(0);
48
+ });
49
+
50
+ // -----------------------------------------------------------------------------
51
+ // new (FULL PROJECT SCAFFOLD)
52
+ // -----------------------------------------------------------------------------
53
+ program
54
+ .command('new <name>')
55
+ .description('Create a new KUHUL-ES project from template')
56
+ .action((name) => {
57
+ console.log(chalk.green(`Creating project: ${name}`));
58
+
59
+ fs.mkdirSync(name, { recursive: true });
60
+
61
+ const template = `
62
+ π config = {
63
+ name: "${name}",
64
+ version: "1.0.0",
65
+ author: "${process.env.USERNAME || 'Developer'}"
66
+ };
67
+
68
+ τ frame = 0;
69
+
70
+ function* main() {
71
+ yield* Sek('log', \`🚀 Starting \${config.name} v\${config.version}\`);
72
+
73
+ @for (let i = 0; i < 5; i++) {
74
+ yield* Sek('log', \`Frame: \${frame}\`);
75
+ frame += 1;
76
+ yield* Sek('wait', 100);
77
+ }
78
+
79
+ yield* Sek('log', '✅ Project ready!');
80
+ }
81
+
82
+ main();
83
+ `.trim();
84
+
85
+ fs.writeFileSync(path.join(name, 'main.kuhules'), template);
86
+
87
+ const packageJson = {
88
+ name,
89
+ version: "1.0.0",
90
+ private: true,
91
+ scripts: {
92
+ start: "kuhul-es run main.kuhules",
93
+ dev: "kuhul-es run main.kuhules --record"
94
+ },
95
+ dependencies: {
96
+ "kuhul-es": `^${pkg.version}`
97
+ }
98
+ };
99
+
100
+ fs.writeFileSync(
101
+ path.join(name, 'package.json'),
102
+ JSON.stringify(packageJson, null, 2)
103
+ );
104
+
105
+ console.log(chalk.green(`✓ Project created: ${name}`));
106
+ console.log(chalk.cyan(` cd ${name}`));
107
+ console.log(chalk.cyan(` npm install`));
108
+ console.log(chalk.cyan(` npm start`));
45
109
  process.exit(0);
46
110
  });
47
111
 
@@ -49,10 +113,21 @@ program
49
113
  // compile
50
114
  // -----------------------------------------------------------------------------
51
115
  program
52
- .command('compile <file>')
116
+ .command('compile <input>')
53
117
  .description('Compile KUHUL-ES source file')
54
- .action((file) => {
55
- console.log(`Compiling: ${file}`);
118
+ .option('-o, --output <file>', 'Output file')
119
+ .option('-w, --watch', 'Watch for changes')
120
+ .action((input, options) => {
121
+ console.log(chalk.green(`Compiling ${input}...`));
122
+
123
+ if (options.output) {
124
+ console.log(`→ Output: ${options.output}`);
125
+ }
126
+ if (options.watch) {
127
+ console.log('👀 Watch mode enabled (stub)');
128
+ }
129
+
130
+ console.log('✓ Compile complete (stub)');
56
131
  process.exit(0);
57
132
  });
58
133
 
@@ -89,7 +164,7 @@ program
89
164
  const outPath = path.resolve(process.cwd(), 'trace.json');
90
165
  fs.writeFileSync(outPath, JSON.stringify(trace, null, 2));
91
166
 
92
- console.log(`📄 trace.json written`);
167
+ console.log('📄 trace.json written');
93
168
  console.log(`🔑 trace hash: ${trace.hash}`);
94
169
  }
95
170
 
@@ -115,7 +190,7 @@ program
115
190
  process.exit(1);
116
191
  }
117
192
 
118
- console.log(`✓ Trace verified`);
193
+ console.log('✓ Trace verified');
119
194
  console.log(`🔑 trace hash: ${trace.hash}`);
120
195
  }
121
196
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kuhul-es",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "main": "src/index.js",
5
5
  "bin": {
6
6
  "kuhul-es": "bin/kuhul-es.js"
@@ -20,7 +20,7 @@
20
20
  "node": ">=14"
21
21
  },
22
22
  "dependencies": {
23
- "commander": "^14.0.2",
24
- "kuhul-es": "^1.0.9"
23
+ "commander": "^11.0.0",
24
+ "chalk": "^5.3.0"
25
25
  }
26
26
  }
File without changes
File without changes