Lines 1-32javascript
2// create-jdesk-app — scaffolds a new JDesk desktop application.
4// npm create jdesk-app@latest my-app
5// npx create-jdesk-app@latest my-app --template react --package com.acme.myapp
6// npx create-jdesk-app@latest # fully interactive
8// A thin, dependency-free wrapper around the JDesk project generator (dev.jdesk.cli,
9// bundled here as jdesk-cli.jar). Node.js is a scaffold-time tool only; the generated
10// application is pure Java + a system WebView and needs no Node at runtime. A JDK 25+ is
11// required to scaffold (you need it to build a JDesk app anyway).
13import { spawn, spawnSync } from "node:child_process";
14import { existsSync, readdirSync } from "node:fs";
HighSandbox Evasion Gated Capability
Source gates dangerous network, credential, or execution behavior behind CI, host, platform, time, or geo fingerprint checks.
index.mjsView on unpkg · L12 15import { dirname, resolve, basename } from "node:path";
16import { fileURLToPath } from "node:url";
17import process from "node:process";
18import { text, select, confirm, spinner, isInteractive, Cancelled, color } from "./prompts.mjs";
20const HERE = dirname(fileURLToPath(import.meta.url));
21const CLI_JAR = resolve(HERE, "jdesk-cli.jar");
22const CLI_MODULE = "dev.jdesk.cli";
25const TEMPLATES = ["basic", "structured", "vanilla", "react", "vue", "svelte", "maven"];
26const BUILD_CHOICES = [
27 { value: "gradle", label: "Gradle", hint: "recommended — full tooling (run, dev/HMR, package, installer)" },
28 { value: "maven", label: "Maven", hint: "pom.xml; build + run only (no packaging yet)" },
30const TEMPLATE_CHOICES = [
31 { value: "basic", label: "Basic", hint: "single module, plain HTML/JS (great for learning)" },
32 { value: "vanilla", label: "Vanilla + Vite", hint: "single module, Vite + vanilla TypeScript" },