@jalvin/cli 2.0.32 → 2.0.34

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/dist/cli.js +81 -81
  2. package/package.json +9 -13
package/dist/cli.js CHANGED
@@ -51,31 +51,31 @@ const config_js_1 = require("./config.js");
51
51
  const JALVIN_EXT = ".jalvin";
52
52
  const VERSION = "1.0.0";
53
53
  function usage() {
54
- console.log(`
55
- jalvin — the Jalvin language compiler & toolchain
56
- version ${VERSION}
57
-
58
- Usage:
59
- jalvin build [--out <dir>] [<files|dirs>] Compile .jalvin → TypeScript
60
- jalvin check [<files|dirs>] Type-check without emitting
61
- jalvin run <file> [-- args...] Compile + execute (requires tsx)
62
- jalvin init [<dir>] Create new project scaffold
63
- jalvin version Print version
64
-
65
- Flags:
66
- --out, -o <dir> Output directory (default: as per JALVIN config or ./dist)
67
- --emit-types Include TS type annotations in output
68
- --verbose, -v Show all diagnostics
69
- --no-color Disable ANSI color output
70
-
71
- Config:
72
- Place a 'JALVIN' file (no extension) at your project root to configure the
73
- compiler. Example:
74
-
75
- outDir = dist
76
- rootDir = src
77
- jsx = true
78
- emitTypes = false
54
+ console.log(`
55
+ jalvin — the Jalvin language compiler & toolchain
56
+ version ${VERSION}
57
+
58
+ Usage:
59
+ jalvin build [--out <dir>] [<files|dirs>] Compile .jalvin → TypeScript
60
+ jalvin check [<files|dirs>] Type-check without emitting
61
+ jalvin run <file> [-- args...] Compile + execute (requires tsx)
62
+ jalvin init [<dir>] Create new project scaffold
63
+ jalvin version Print version
64
+
65
+ Flags:
66
+ --out, -o <dir> Output directory (default: as per JALVIN config or ./dist)
67
+ --emit-types Include TS type annotations in output
68
+ --verbose, -v Show all diagnostics
69
+ --no-color Disable ANSI color output
70
+
71
+ Config:
72
+ Place a 'JALVIN' file (no extension) at your project root to configure the
73
+ compiler. Example:
74
+
75
+ outDir = dist
76
+ rootDir = src
77
+ jsx = true
78
+ emitTypes = false
79
79
  `);
80
80
  }
81
81
  function parseArgs(argv) {
@@ -307,73 +307,73 @@ async function runInit(args) {
307
307
  const projectName = path.basename(path.resolve(dir));
308
308
  fs.mkdirSync(path.join(dir, "src"), { recursive: true });
309
309
  // JALVIN config
310
- const jalvinConfig = `# Jalvin project configuration
311
- name = ${projectName}
312
- version = 1.0.0
313
-
314
- rootDir = src
315
- outDir = dist
316
-
317
- # Uncomment to enable JSX / React
318
- # jsx = true
319
-
320
- # Enable TypeScript type annotations in emitted code
321
- emitTypes = false
310
+ const jalvinConfig = `# Jalvin project configuration
311
+ name = ${projectName}
312
+ version = 1.0.0
313
+
314
+ rootDir = src
315
+ outDir = dist
316
+
317
+ # Uncomment to enable JSX / React
318
+ # jsx = true
319
+
320
+ # Enable TypeScript type annotations in emitted code
321
+ emitTypes = false
322
322
  `;
323
323
  writeUnlessExists(path.join(dir, "JALVIN"), jalvinConfig);
324
324
  // package.json
325
- const pkgJson = `{
326
- "name": "${projectName}",
327
- "version": "1.0.0",
328
- "type": "module",
329
- "scripts": {
330
- "build": "jalvin build",
331
- "check": "jalvin check",
332
- "dev": "jalvin build --watch"
333
- },
334
- "dependencies": {
335
- "@jalvin/runtime": "^1.0.0"
336
- },
337
- "devDependencies": {
338
- "@jalvin/cli": "^1.0.0"
339
- }
340
- }
325
+ const pkgJson = `{
326
+ "name": "${projectName}",
327
+ "version": "1.0.0",
328
+ "type": "module",
329
+ "scripts": {
330
+ "build": "jalvin build",
331
+ "check": "jalvin check",
332
+ "dev": "jalvin build --watch"
333
+ },
334
+ "dependencies": {
335
+ "@jalvin/runtime": "^1.0.0"
336
+ },
337
+ "devDependencies": {
338
+ "@jalvin/cli": "^1.0.0"
339
+ }
340
+ }
341
341
  `;
342
342
  writeUnlessExists(path.join(dir, "package.json"), pkgJson);
343
343
  // Entry file
344
- const mainJalvin = `// ${projectName} — main entry point
345
- import @jalvin/runtime.*
346
-
347
- fun main() {
348
- println("Hello from ${projectName}!")
349
-
350
- val greeting = buildGreeting("World")
351
- println(greeting)
352
- }
353
-
354
- fun buildGreeting(name: String): String {
355
- return "Hello, $name! Welcome to Jalvin."
356
- }
344
+ const mainJalvin = `// ${projectName} — main entry point
345
+ import @jalvin/runtime.*
346
+
347
+ fun main() {
348
+ println("Hello from ${projectName}!")
349
+
350
+ val greeting = buildGreeting("World")
351
+ println(greeting)
352
+ }
353
+
354
+ fun buildGreeting(name: String): String {
355
+ return "Hello, $name! Welcome to Jalvin."
356
+ }
357
357
  `;
358
358
  writeUnlessExists(path.join(dir, "src", "main.jalvin"), mainJalvin);
359
359
  // .gitignore
360
- const gitignore = `node_modules/
361
- dist/
362
- .jalvin-cache/
363
- *.js.map
360
+ const gitignore = `node_modules/
361
+ dist/
362
+ .jalvin-cache/
363
+ *.js.map
364
364
  `;
365
365
  writeUnlessExists(path.join(dir, ".gitignore"), gitignore);
366
- console.log(`
367
- ✓ Created new Jalvin project: ${projectName}/
368
- src/main.jalvin — your first Jalvin source file
369
- JALVIN — project configuration
370
- package.json — npm manifest
371
-
372
- Next steps:
373
- cd ${dir}
374
- npm install
375
- jalvin build
376
- jalvin run src/main.jalvin
366
+ console.log(`
367
+ ✓ Created new Jalvin project: ${projectName}/
368
+ src/main.jalvin — your first Jalvin source file
369
+ JALVIN — project configuration
370
+ package.json — npm manifest
371
+
372
+ Next steps:
373
+ cd ${dir}
374
+ npm install
375
+ jalvin build
376
+ jalvin run src/main.jalvin
377
377
  `);
378
378
  }
379
379
  function writeUnlessExists(filePath, content) {
package/package.json CHANGED
@@ -1,28 +1,24 @@
1
1
  {
2
2
  "name": "@jalvin/cli",
3
- "version": "2.0.32",
3
+ "version": "2.0.34",
4
4
  "description": "Jalvin language — command line interface",
5
5
  "bin": {
6
6
  "jalvin": "dist/cli.js"
7
7
  },
8
8
  "main": "dist/cli.js",
9
9
  "types": "dist/cli.d.ts",
10
- "publishConfig": {
11
- "access": "public"
10
+ "publishConfig": { "access": "public" },
11
+ "files": ["dist"],
12
+ "scripts": {
13
+ "build": "tsc -p tsconfig.json",
14
+ "typecheck": "tsc -p tsconfig.json --noEmit",
15
+ "clean": "rm -rf dist"
12
16
  },
13
- "files": [
14
- "dist"
15
- ],
16
17
  "dependencies": {
17
- "@jalvin/compiler": "2.0.32"
18
+ "@jalvin/compiler": "workspace:*"
18
19
  },
19
20
  "devDependencies": {
20
21
  "typescript": "^5.4.0",
21
22
  "@types/node": "^20.0.0"
22
- },
23
- "scripts": {
24
- "build": "tsc -p tsconfig.json",
25
- "typecheck": "tsc -p tsconfig.json --noEmit",
26
- "clean": "rm -rf dist"
27
23
  }
28
- }
24
+ }