@jalvin/cli 2.0.18 → 2.0.20
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/cli.js +81 -81
- package/package.json +2 -2
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jalvin/cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.20",
|
|
4
4
|
"description": "Jalvin language — command line interface",
|
|
5
5
|
"bin": {
|
|
6
6
|
"jalvin": "dist/cli.js"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"dist"
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@jalvin/compiler": "2.0.
|
|
17
|
+
"@jalvin/compiler": "2.0.20"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"typescript": "^5.4.0",
|