create-pylair 0.1.0-rc.21 → 0.1.0-rc.23
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/index.d.ts +5 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -132
- package/dist/index.js.map +1 -1
- package/dist/run.d.ts +20 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +173 -0
- package/dist/run.js.map +1 -0
- package/dist/scaffold.d.ts +19 -4
- package/dist/scaffold.d.ts.map +1 -1
- package/dist/scaffold.js +29 -4
- package/dist/scaffold.js.map +1 -1
- package/dist/ui/caps.d.ts +45 -0
- package/dist/ui/caps.d.ts.map +1 -0
- package/dist/ui/caps.js +81 -0
- package/dist/ui/caps.js.map +1 -0
- package/dist/ui/index.d.ts +106 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +264 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/prompts.d.ts +39 -0
- package/dist/ui/prompts.d.ts.map +1 -0
- package/dist/ui/prompts.js +178 -0
- package/dist/ui/prompts.js.map +1 -0
- package/dist/ui/style.d.ts +27 -0
- package/dist/ui/style.d.ts.map +1 -0
- package/dist/ui/style.js +71 -0
- package/dist/ui/style.js.map +1 -0
- package/dist/version.d.ts +5 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +15 -0
- package/dist/version.js.map +1 -0
- package/dist/wordmark.d.ts +5 -0
- package/dist/wordmark.d.ts.map +1 -0
- package/dist/wordmark.js +10 -0
- package/dist/wordmark.js.map +1 -0
- package/package.json +3 -1
- package/templates/default/src-tauri/Cargo.lock +15 -15
- package/templates/wrap/pyproject.toml.tmpl +8 -7
- package/templates/wrap/requirements.txt.tmpl +1 -3
- package/templates/wrap/src-tauri/Cargo.lock +13 -13
- package/templates/wrap/variants/gradio.py +8 -0
- package/templates/wrap/variants/streamlit.py +7 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/** create-pylair
|
|
2
|
+
/** create-pylair - scaffold a new Pylair app. The bin is a thin shim; the
|
|
3
|
+
* logic lives in run.ts so tests can drive it with fake streams.
|
|
3
4
|
*
|
|
4
|
-
* npx create-pylair my-app [--mode bridge|wrap] [--
|
|
5
|
-
* npx create-pylair --mode wrap --into <existing-dir>
|
|
6
|
-
*
|
|
7
|
-
* --mode wrap scaffolds a wrap-mode app: an existing Python web UI shown in
|
|
8
|
-
* the window, with no React app (docs/wrap-mode-brief.md).
|
|
5
|
+
* npx create-pylair my-app [--mode bridge|wrap] [--framework command|gradio|streamlit]
|
|
6
|
+
* npx create-pylair --mode wrap --into <existing-dir> --name my-app
|
|
9
7
|
*
|
|
10
8
|
* --local points all three pylair deps (cargo crate, pypi package, npm
|
|
11
|
-
* package) at a local checkout
|
|
12
|
-
* until the packages are published.
|
|
9
|
+
* package) at a local checkout.
|
|
13
10
|
*/
|
|
14
11
|
export {};
|
|
15
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;GAQG"}
|
package/dist/index.js
CHANGED
|
@@ -1,138 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/** create-pylair
|
|
2
|
+
/** create-pylair - scaffold a new Pylair app. The bin is a thin shim; the
|
|
3
|
+
* logic lives in run.ts so tests can drive it with fake streams.
|
|
3
4
|
*
|
|
4
|
-
* npx create-pylair my-app [--mode bridge|wrap] [--
|
|
5
|
-
* npx create-pylair --mode wrap --into <existing-dir>
|
|
6
|
-
*
|
|
7
|
-
* --mode wrap scaffolds a wrap-mode app: an existing Python web UI shown in
|
|
8
|
-
* the window, with no React app (docs/wrap-mode-brief.md).
|
|
5
|
+
* npx create-pylair my-app [--mode bridge|wrap] [--framework command|gradio|streamlit]
|
|
6
|
+
* npx create-pylair --mode wrap --into <existing-dir> --name my-app
|
|
9
7
|
*
|
|
10
8
|
* --local points all three pylair deps (cargo crate, pypi package, npm
|
|
11
|
-
* package) at a local checkout
|
|
12
|
-
* until the packages are published.
|
|
9
|
+
* package) at a local checkout.
|
|
13
10
|
*/
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function argValue(argv, flag) {
|
|
21
|
-
const i = argv.indexOf(flag);
|
|
22
|
-
return i === -1 ? undefined : argv[i + 1];
|
|
23
|
-
}
|
|
24
|
-
function fail(msg) {
|
|
25
|
-
console.error(`create-pylair: ${msg}`);
|
|
26
|
-
process.exit(1);
|
|
27
|
-
}
|
|
28
|
-
function main(argv) {
|
|
29
|
-
const positional = argv.filter((a, i) => !a.startsWith("--") && !VALUE_FLAGS.includes(argv[i - 1]));
|
|
30
|
-
const name = positional[0];
|
|
31
|
-
if (argValue(argv, "--into") !== undefined)
|
|
32
|
-
return into(argv);
|
|
33
|
-
if (name === "create-pylair") {
|
|
34
|
-
console.log(USAGE);
|
|
35
|
-
return 1;
|
|
36
|
-
}
|
|
37
|
-
if (!name) {
|
|
38
|
-
// Interactive: ask for the name (create-vite convention). Piped or
|
|
39
|
-
// scripted: fail loudly — silently scaffolding nothing is worse.
|
|
40
|
-
if (!process.stdin.isTTY) {
|
|
41
|
-
console.error(`create-pylair: app name required: ${USAGE}`);
|
|
42
|
-
return 1;
|
|
43
|
-
}
|
|
44
|
-
return promptForName(argv);
|
|
45
|
-
}
|
|
46
|
-
return scaffold(name, argv);
|
|
47
|
-
}
|
|
48
|
-
async function promptForName(argv) {
|
|
49
|
-
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
50
|
-
try {
|
|
51
|
-
const name = (await rl.question("app name: ")).trim();
|
|
52
|
-
if (!name) {
|
|
53
|
-
console.error("create-pylair: app name required");
|
|
54
|
-
return 1;
|
|
55
|
-
}
|
|
56
|
-
return scaffold(name, argv);
|
|
57
|
-
}
|
|
58
|
-
finally {
|
|
59
|
-
rl.close();
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
/** Add the wrap shell (src-tauri, ui, package.json, .gitignore) to an
|
|
63
|
-
* existing project, never overwriting a file and leaving the project's own
|
|
64
|
-
* app, pyproject.toml and requirements.txt alone. `pylair wrap` writes the
|
|
65
|
-
* `[tool.pylair]` config first, then runs this. */
|
|
66
|
-
function into(argv) {
|
|
67
|
-
const dir = resolve(process.cwd(), argValue(argv, "--into") ?? ".");
|
|
68
|
-
if (argValue(argv, "--mode") !== "wrap")
|
|
69
|
-
fail("--into needs --mode wrap");
|
|
70
|
-
if (!existsSync(dir) || !statSync(dir).isDirectory())
|
|
71
|
-
fail(`${dir} is not a directory`);
|
|
72
|
-
const local = argValue(argv, "--local");
|
|
73
|
-
const why = wrapUnavailable(local);
|
|
74
|
-
if (why)
|
|
75
|
-
fail(why);
|
|
76
|
-
const name = argValue(argv, "--name");
|
|
77
|
-
if (!name || !/^[a-z][a-z0-9-]*$/.test(name))
|
|
78
|
-
fail(`--name is required and must be lowercase letters, digits, dashes (got '${name ?? ""}')`);
|
|
79
|
-
const identifier = argValue(argv, "--identifier") ?? `com.example.${name.replace(/-/g, "")}`;
|
|
80
|
-
const { written, kept } = copyTree(join(TEMPLATES, "wrap"), dir, substitutions(name, identifier, local), {
|
|
81
|
-
keepExisting: true,
|
|
82
|
-
skip: (rel) => rel === "app" || rel === "pyproject.toml" || rel === "requirements.txt",
|
|
83
|
-
});
|
|
84
|
-
console.log(JSON.stringify({ written, kept }));
|
|
85
|
-
return 0;
|
|
86
|
-
}
|
|
87
|
-
function scaffold(name, argv) {
|
|
88
|
-
if (!/^[a-z][a-z0-9-]*$/.test(name))
|
|
89
|
-
fail(`invalid app name '${name}' — use lowercase letters, digits, dashes`);
|
|
90
|
-
const identifier = argValue(argv, "--identifier") ?? `com.example.${name.replace(/-/g, "")}`;
|
|
91
|
-
const local = argValue(argv, "--local");
|
|
92
|
-
const mode = argValue(argv, "--mode") ?? "bridge";
|
|
93
|
-
if (mode !== "bridge" && mode !== "wrap")
|
|
94
|
-
fail(`--mode must be "bridge" or "wrap", got '${mode}'`);
|
|
95
|
-
const explicit = argValue(argv, "--template");
|
|
96
|
-
if (explicit && mode === "wrap" && explicit !== "wrap")
|
|
97
|
-
fail(`--mode wrap uses the "wrap" template, not '${explicit}'`);
|
|
98
|
-
const template = explicit ?? (mode === "wrap" ? "wrap" : "default");
|
|
99
|
-
if (template === "wrap") {
|
|
100
|
-
const why = wrapUnavailable(local);
|
|
101
|
-
if (why)
|
|
102
|
-
fail(why);
|
|
103
|
-
}
|
|
104
|
-
const templateDir = join(TEMPLATES, template);
|
|
105
|
-
if (!existsSync(templateDir))
|
|
106
|
-
fail(`no template '${template}' at ${templateDir}`);
|
|
107
|
-
const dest = resolve(process.cwd(), name);
|
|
108
|
-
if (existsSync(dest) && readdirSync(dest).length)
|
|
109
|
-
fail(`${dest} exists and is not empty`);
|
|
110
|
-
copyTree(templateDir, dest, substitutions(name, identifier, local));
|
|
111
|
-
if (!statSync(join(dest, "src-tauri/tauri.conf.json")).isFile())
|
|
112
|
-
fail("template produced no tauri.conf.json — internal error");
|
|
113
|
-
console.log(template === "wrap"
|
|
114
|
-
? `created ${name}/ (wrap mode)
|
|
115
|
-
|
|
116
|
-
next:
|
|
117
|
-
cd ${name}
|
|
118
|
-
npm install # or pnpm install
|
|
119
|
-
uv sync # python env (https://docs.astral.sh/uv/)
|
|
120
|
-
npx pylair dev # your web app in a native window, with reload
|
|
121
|
-
npx pylair build # native installer with bundled python
|
|
122
|
-
npx pylair doctor # diagnose environment any time
|
|
123
|
-
`
|
|
124
|
-
: `created ${name}/
|
|
125
|
-
|
|
126
|
-
next:
|
|
127
|
-
cd ${name}
|
|
128
|
-
npm install # or pnpm install
|
|
129
|
-
uv sync # python env (https://docs.astral.sh/uv/)
|
|
130
|
-
npx pylair dev # supervised dev: python hot reload + vite
|
|
131
|
-
# (pnpm users: pnpm pylair dev / pnpm pylair build)
|
|
132
|
-
npx pylair build # native installer with bundled python
|
|
133
|
-
npx pylair doctor # diagnose environment any time
|
|
134
|
-
`);
|
|
135
|
-
return 0;
|
|
136
|
-
}
|
|
137
|
-
process.exit(await main(process.argv.slice(2)));
|
|
11
|
+
import { run } from "./run.js";
|
|
12
|
+
process.exit(await run(process.argv.slice(2), {
|
|
13
|
+
input: process.stdin,
|
|
14
|
+
output: process.stdout,
|
|
15
|
+
error: process.stderr,
|
|
16
|
+
}));
|
|
138
17
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;GAQG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,CAAC,IAAI,CACV,MAAM,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IAC/B,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,MAAM,EAAE,OAAO,CAAC,MAAM;IACtB,KAAK,EAAE,OAAO,CAAC,MAAM;CACtB,CAAC,CACH,CAAC"}
|
package/dist/run.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** create-pylair's logic, separate from the bin so tests can drive it with
|
|
2
|
+
* fake streams. `run` resolves every answer the command line did not give -
|
|
3
|
+
* interactively on a TTY, never under CI - then scaffolds exactly the files
|
|
4
|
+
* it always did.
|
|
5
|
+
*
|
|
6
|
+
* npx create-pylair my-app [--mode bridge|wrap] [--framework command|gradio|streamlit]
|
|
7
|
+
* npx create-pylair --mode wrap --into <existing-dir> --name my-app (what `pylair wrap` runs)
|
|
8
|
+
*/
|
|
9
|
+
import { type Caps } from "./ui/caps.js";
|
|
10
|
+
import { type PromptIo } from "./ui/prompts.js";
|
|
11
|
+
export interface RunIo {
|
|
12
|
+
input: PromptIo["input"];
|
|
13
|
+
output: NodeJS.WritableStream;
|
|
14
|
+
error: NodeJS.WritableStream;
|
|
15
|
+
env?: NodeJS.ProcessEnv;
|
|
16
|
+
cwd?: string;
|
|
17
|
+
caps?: Caps;
|
|
18
|
+
}
|
|
19
|
+
export declare function run(argv: string[], io: RunIo): Promise<number>;
|
|
20
|
+
//# sourceMappingURL=run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAaH,OAAO,EAAqB,KAAK,IAAI,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAoD,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAQlG,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC,cAAc,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,IAAI,CAAC;CACb;AAUD,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAyEpE"}
|
package/dist/run.js
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/** create-pylair's logic, separate from the bin so tests can drive it with
|
|
2
|
+
* fake streams. `run` resolves every answer the command line did not give -
|
|
3
|
+
* interactively on a TTY, never under CI - then scaffolds exactly the files
|
|
4
|
+
* it always did.
|
|
5
|
+
*
|
|
6
|
+
* npx create-pylair my-app [--mode bridge|wrap] [--framework command|gradio|streamlit]
|
|
7
|
+
* npx create-pylair --mode wrap --into <existing-dir> --name my-app (what `pylair wrap` runs)
|
|
8
|
+
*/
|
|
9
|
+
import { existsSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
10
|
+
import { join, resolve } from "node:path";
|
|
11
|
+
import { TEMPLATES, WRAP_APPS, WRAP_FRAMEWORKS, copyTree, substitutions, wrapUnavailable, } from "./scaffold.js";
|
|
12
|
+
import { detectProcessCaps } from "./ui/caps.js";
|
|
13
|
+
import { PromptCancelled, askSelect, askText, interactive } from "./ui/prompts.js";
|
|
14
|
+
import { scaffolderVersion } from "./version.js";
|
|
15
|
+
import { wordmark } from "./wordmark.js";
|
|
16
|
+
const USAGE = "usage: create-pylair <app-name> [--mode bridge|wrap] [--framework command|gradio|streamlit] [--identifier com.x.y] [--local /repo] [--template default]";
|
|
17
|
+
const VALUE_FLAGS = ["--local", "--identifier", "--template", "--mode", "--into", "--name", "--framework"];
|
|
18
|
+
const NAME_RE = /^[a-z][a-z0-9-]*$/;
|
|
19
|
+
const NAME_RULE = "use lowercase letters, digits, dashes";
|
|
20
|
+
function argValue(argv, flag) {
|
|
21
|
+
const i = argv.indexOf(flag);
|
|
22
|
+
return i === -1 ? undefined : argv[i + 1];
|
|
23
|
+
}
|
|
24
|
+
export async function run(argv, io) {
|
|
25
|
+
const env = io.env ?? process.env;
|
|
26
|
+
const cwd = io.cwd ?? process.cwd();
|
|
27
|
+
const out = (s) => io.output.write(`${s}\n`);
|
|
28
|
+
const fail = (msg) => {
|
|
29
|
+
io.error.write(`create-pylair: ${msg}\n`);
|
|
30
|
+
return 1;
|
|
31
|
+
};
|
|
32
|
+
if (argValue(argv, "--into") !== undefined)
|
|
33
|
+
return into(argv, io, cwd);
|
|
34
|
+
const caps = io.caps ?? detectProcessCaps(argv);
|
|
35
|
+
if (caps.fancy)
|
|
36
|
+
out(wordmark(caps.unicode, scaffolderVersion()));
|
|
37
|
+
const positional = argv.filter((a, i) => !a.startsWith("--") && !VALUE_FLAGS.includes(argv[i - 1]));
|
|
38
|
+
const prompt = { input: io.input, output: io.output, caps };
|
|
39
|
+
const canPrompt = interactive(io.input, env);
|
|
40
|
+
try {
|
|
41
|
+
// The project name: positional arg, else prompt, else loud failure -
|
|
42
|
+
// silently scaffolding nothing is worse.
|
|
43
|
+
let name = positional[0];
|
|
44
|
+
if (name === "create-pylair") {
|
|
45
|
+
out(USAGE);
|
|
46
|
+
return 1;
|
|
47
|
+
}
|
|
48
|
+
if (!name) {
|
|
49
|
+
if (!canPrompt)
|
|
50
|
+
return fail(`app name required: ${USAGE}`);
|
|
51
|
+
name = await askText(prompt, "project name", (v) => NAME_RE.test(v) ? undefined : NAME_RULE);
|
|
52
|
+
}
|
|
53
|
+
if (!NAME_RE.test(name))
|
|
54
|
+
return fail(`invalid app name '${name}': ${NAME_RULE}`);
|
|
55
|
+
// The mode: --mode, or implied by --framework (only wrap has one), else
|
|
56
|
+
// prompt, else the bridge default.
|
|
57
|
+
const frameworkFlag = argValue(argv, "--framework");
|
|
58
|
+
let mode = argValue(argv, "--mode");
|
|
59
|
+
if (mode !== undefined && mode !== "bridge" && mode !== "wrap")
|
|
60
|
+
return fail(`--mode must be "bridge" or "wrap", got '${mode}'`);
|
|
61
|
+
if (frameworkFlag !== undefined) {
|
|
62
|
+
if (!WRAP_FRAMEWORKS.includes(frameworkFlag))
|
|
63
|
+
return fail(`--framework must be "command", "gradio" or "streamlit", got '${frameworkFlag}'`);
|
|
64
|
+
if (mode === "bridge")
|
|
65
|
+
return fail("--framework is for wrap mode; --mode bridge cannot use it");
|
|
66
|
+
mode = "wrap";
|
|
67
|
+
}
|
|
68
|
+
if (!mode && canPrompt)
|
|
69
|
+
mode = await askSelect(prompt, "what are you building?", [
|
|
70
|
+
{ value: "bridge", label: "a new UI that calls Python" },
|
|
71
|
+
{ value: "wrap", label: "wrap an existing Python web app" },
|
|
72
|
+
]);
|
|
73
|
+
mode ??= "bridge";
|
|
74
|
+
// The framework, wrap mode only: --framework, else prompt, else the
|
|
75
|
+
// command default the template has always shipped.
|
|
76
|
+
let framework = (frameworkFlag ?? "command");
|
|
77
|
+
if (mode === "wrap" && !frameworkFlag && canPrompt)
|
|
78
|
+
framework = await askSelect(prompt, "what does the app run?", [
|
|
79
|
+
{ value: "command", label: "a server command (uvicorn, gunicorn, ...)" },
|
|
80
|
+
{ value: "gradio", label: "Gradio" },
|
|
81
|
+
{ value: "streamlit", label: "Streamlit" },
|
|
82
|
+
]);
|
|
83
|
+
return scaffold(name, mode, framework, argv, io, cwd, fail);
|
|
84
|
+
}
|
|
85
|
+
catch (e) {
|
|
86
|
+
if (e instanceof PromptCancelled) {
|
|
87
|
+
out("cancelled.");
|
|
88
|
+
return 130;
|
|
89
|
+
}
|
|
90
|
+
throw e;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/** Add the wrap shell (src-tauri, ui, package.json, .gitignore) to an
|
|
94
|
+
* existing project, never overwriting a file and leaving the project's own
|
|
95
|
+
* app, pyproject.toml and requirements.txt alone. `pylair wrap` writes the
|
|
96
|
+
* `[tool.pylair]` config first, then runs this; the last stdout line is the
|
|
97
|
+
* JSON result it parses, so this path prints nothing else. */
|
|
98
|
+
function into(argv, io, cwd) {
|
|
99
|
+
const fail = (msg) => {
|
|
100
|
+
io.error.write(`create-pylair: ${msg}\n`);
|
|
101
|
+
return 1;
|
|
102
|
+
};
|
|
103
|
+
const dir = resolve(cwd, argValue(argv, "--into") ?? ".");
|
|
104
|
+
if (argValue(argv, "--mode") !== "wrap")
|
|
105
|
+
return fail("--into needs --mode wrap");
|
|
106
|
+
if (!existsSync(dir) || !statSync(dir).isDirectory())
|
|
107
|
+
return fail(`${dir} is not a directory`);
|
|
108
|
+
const local = argValue(argv, "--local");
|
|
109
|
+
const why = wrapUnavailable(local);
|
|
110
|
+
if (why)
|
|
111
|
+
return fail(why);
|
|
112
|
+
const name = argValue(argv, "--name");
|
|
113
|
+
if (!name || !NAME_RE.test(name))
|
|
114
|
+
return fail(`--name is required and must be lowercase letters, digits, dashes (got '${name ?? ""}')`);
|
|
115
|
+
const identifier = argValue(argv, "--identifier") ?? `com.example.${name.replace(/-/g, "")}`;
|
|
116
|
+
const { written, kept } = copyTree(join(TEMPLATES, "wrap"), dir, substitutions(name, identifier, local), {
|
|
117
|
+
keepExisting: true,
|
|
118
|
+
skip: (rel) => rel === "app" ||
|
|
119
|
+
rel === "pyproject.toml" ||
|
|
120
|
+
rel === "requirements.txt" ||
|
|
121
|
+
rel === "variants" ||
|
|
122
|
+
rel.startsWith("variants/"),
|
|
123
|
+
});
|
|
124
|
+
io.output.write(`${JSON.stringify({ written, kept })}\n`);
|
|
125
|
+
return 0;
|
|
126
|
+
}
|
|
127
|
+
function scaffold(name, mode, framework, argv, io, cwd, fail) {
|
|
128
|
+
const identifier = argValue(argv, "--identifier") ?? `com.example.${name.replace(/-/g, "")}`;
|
|
129
|
+
const local = argValue(argv, "--local");
|
|
130
|
+
const explicit = argValue(argv, "--template");
|
|
131
|
+
if (explicit && mode === "wrap" && explicit !== "wrap")
|
|
132
|
+
return fail(`--mode wrap uses the "wrap" template, not '${explicit}'`);
|
|
133
|
+
const template = explicit ?? (mode === "wrap" ? "wrap" : "default");
|
|
134
|
+
if (template === "wrap") {
|
|
135
|
+
const why = wrapUnavailable(local);
|
|
136
|
+
if (why)
|
|
137
|
+
return fail(why);
|
|
138
|
+
}
|
|
139
|
+
const templateDir = join(TEMPLATES, template);
|
|
140
|
+
if (!existsSync(templateDir))
|
|
141
|
+
return fail(`no template '${template}' at ${templateDir}`);
|
|
142
|
+
const dest = resolve(cwd, name);
|
|
143
|
+
if (existsSync(dest) && readdirSync(dest).length)
|
|
144
|
+
return fail(`${dest} exists and is not empty`);
|
|
145
|
+
const app = WRAP_APPS[framework];
|
|
146
|
+
copyTree(templateDir, dest, substitutions(name, identifier, local, framework), {
|
|
147
|
+
skip: (rel) => rel === "variants" || rel.startsWith("variants/") || (app.sample !== undefined && rel === "app/main.py"),
|
|
148
|
+
});
|
|
149
|
+
if (app.sample !== undefined)
|
|
150
|
+
writeFileSync(join(dest, "app", "app.py"), readFileSync(join(templateDir, "variants", app.sample), "utf-8"));
|
|
151
|
+
if (!statSync(join(dest, "src-tauri/tauri.conf.json")).isFile())
|
|
152
|
+
return fail("template produced no tauri.conf.json (internal error)");
|
|
153
|
+
io.output.write(mode === "wrap"
|
|
154
|
+
? `Created ${name}/ (wrap, ${framework})\n\n` +
|
|
155
|
+
`Next:\n` +
|
|
156
|
+
` cd ${name}\n` +
|
|
157
|
+
` npm install # or pnpm install\n` +
|
|
158
|
+
` uv sync # python env (https://docs.astral.sh/uv/)\n` +
|
|
159
|
+
` npx pylair dev # your web app in a native window, with reload\n` +
|
|
160
|
+
` npx pylair build # native installer with bundled python\n` +
|
|
161
|
+
` npx pylair doctor # diagnose environment any time\n\n`
|
|
162
|
+
: `Created ${name}/ (bridge)\n\n` +
|
|
163
|
+
`Next:\n` +
|
|
164
|
+
` cd ${name}\n` +
|
|
165
|
+
` npm install # or pnpm install\n` +
|
|
166
|
+
` uv sync # python env (https://docs.astral.sh/uv/)\n` +
|
|
167
|
+
` npx pylair dev # supervised dev: python hot reload + vite\n` +
|
|
168
|
+
` # (pnpm users: pnpm pylair dev / pnpm pylair build)\n` +
|
|
169
|
+
` npx pylair build # native installer with bundled python\n` +
|
|
170
|
+
` npx pylair doctor # diagnose environment any time\n\n`);
|
|
171
|
+
return 0;
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=run.js.map
|
package/dist/run.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;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,KAAK,EAAE,SAAS,CAAC,EAAE;QAC7E,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CACZ,GAAG,KAAK,UAAU,IAAI,GAAG,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,KAAK,SAAS,IAAI,GAAG,KAAK,aAAa,CAAC;KAC3G,CAAC,CAAC;IACH,IAAI,GAAG,CAAC,MAAM,KAAK,SAAS;QAC1B,aAAa,CACX,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,EAC3B,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CACjE,CAAC;IACJ,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,2BAA2B,CAAC,CAAC,CAAC,MAAM,EAAE;QAC7D,OAAO,IAAI,CAAC,uDAAuD,CAAC,CAAC;IAEvE,EAAE,CAAC,MAAM,CAAC,KAAK,CACb,IAAI,KAAK,MAAM;QACb,CAAC,CAAC,WAAW,IAAI,YAAY,SAAS,OAAO;YACzC,SAAS;YACT,QAAQ,IAAI,IAAI;YAChB,2CAA2C;YAC3C,mEAAmE;YACnE,wEAAwE;YACxE,gEAAgE;YAChE,2DAA2D;QAC/D,CAAC,CAAC,WAAW,IAAI,gBAAgB;YAC7B,SAAS;YACT,QAAQ,IAAI,IAAI;YAChB,2CAA2C;YAC3C,mEAAmE;YACnE,oEAAoE;YACpE,6EAA6E;YAC7E,gEAAgE;YAChE,2DAA2D,CAClE,CAAC;IACF,OAAO,CAAC,CAAC;AACX,CAAC"}
|
package/dist/scaffold.d.ts
CHANGED
|
@@ -8,9 +8,9 @@ export declare const TEMPLATES: string;
|
|
|
8
8
|
* manifests and the template `Cargo.lock` (AGENTS.md, "Scaffold pins"). */
|
|
9
9
|
export declare const PINS: {
|
|
10
10
|
readonly py: "pylair==0.1.0rc11";
|
|
11
|
-
readonly js: "0.1.0-rc.
|
|
12
|
-
readonly cli: "0.1.0-rc.
|
|
13
|
-
readonly rs: "tauri-plugin-pylair = \"=0.1.0-rc.
|
|
11
|
+
readonly js: "0.1.0-rc.23";
|
|
12
|
+
readonly cli: "0.1.0-rc.23";
|
|
13
|
+
readonly rs: "tauri-plugin-pylair = \"=0.1.0-rc.17\"";
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
16
|
* Wrap mode needs the crate (`Builder::wrap`) and the `pylair.wrap`
|
|
@@ -21,7 +21,22 @@ export declare const PINS: {
|
|
|
21
21
|
*/
|
|
22
22
|
export declare const WRAP_IN_PUBLISHED_VERSIONS = true;
|
|
23
23
|
export declare function wrapUnavailable(local: string | undefined): string | undefined;
|
|
24
|
-
export declare
|
|
24
|
+
export declare const WRAP_FRAMEWORKS: readonly ["command", "gradio", "streamlit"];
|
|
25
|
+
export type WrapFramework = (typeof WRAP_FRAMEWORKS)[number];
|
|
26
|
+
/** What a wrap-mode app needs per framework: the extra dependencies
|
|
27
|
+
* (pyproject and requirements.txt), the `[tool.pylair.wrap]` config line,
|
|
28
|
+
* and the sample app file for non-command frameworks (templates/wrap/
|
|
29
|
+
* variants/<sample> is written to app/app.py instead of app/main.py). The
|
|
30
|
+
* pins match scripts/wrap-acceptance/prepare.mjs, which turns the same
|
|
31
|
+
* scaffold into the acceptance app. */
|
|
32
|
+
export interface WrapApp {
|
|
33
|
+
deps: string[];
|
|
34
|
+
reqs: string[];
|
|
35
|
+
run: string;
|
|
36
|
+
sample?: string;
|
|
37
|
+
}
|
|
38
|
+
export declare const WRAP_APPS: Record<WrapFramework, WrapApp>;
|
|
39
|
+
export declare function substitutions(name: string, identifier: string, local?: string, framework?: WrapFramework): Record<string, string>;
|
|
25
40
|
export interface CopyOptions {
|
|
26
41
|
/** Never overwrite a file that already exists (initialising a project
|
|
27
42
|
* that has its own files). */
|
package/dist/scaffold.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,eAAO,MAAM,SAAS,QAA6D,CAAC;AAGpF;2EAC2E;AAC3E,eAAO,MAAM,IAAI;;;;;CAKP,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAM7E;AAED,
|
|
1
|
+
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,eAAO,MAAM,SAAS,QAA6D,CAAC;AAGpF;2EAC2E;AAC3E,eAAO,MAAM,IAAI;;;;;CAKP,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAM7E;AAED,eAAO,MAAM,eAAe,6CAA8C,CAAC;AAC3E,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D;;;;;uCAKuC;AACvC,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AACD,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,aAAa,EAAE,OAAO,CAkBpD,CAAC;AAEF,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,KAAK,CAAC,EAAE,MAAM,EACd,SAAS,GAAE,aAAyB,GACnC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA6BxB;AAQD,MAAM,WAAW,WAAW;IAC1B;kCAC8B;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;6EACyE;IACzE,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,UAAU;IACzB,iEAAiE;IACjE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,sEAAsE;IACtE,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,uDAAuD;AACvD,wBAAgB,QAAQ,CACtB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,IAAI,GAAE,WAAgB,EACtB,GAAG,SAAK,GACP,UAAU,CA6BZ"}
|
package/dist/scaffold.js
CHANGED
|
@@ -12,9 +12,9 @@ const BINARY = new Set([".png", ".ico", ".icns"]);
|
|
|
12
12
|
* manifests and the template `Cargo.lock` (AGENTS.md, "Scaffold pins"). */
|
|
13
13
|
export const PINS = {
|
|
14
14
|
py: "pylair==0.1.0rc11",
|
|
15
|
-
js: "0.1.0-rc.
|
|
16
|
-
cli: "0.1.0-rc.
|
|
17
|
-
rs: `tauri-plugin-pylair = "=0.1.0-rc.
|
|
15
|
+
js: "0.1.0-rc.23",
|
|
16
|
+
cli: "0.1.0-rc.23",
|
|
17
|
+
rs: `tauri-plugin-pylair = "=0.1.0-rc.17"`,
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
20
|
* Wrap mode needs the crate (`Builder::wrap`) and the `pylair.wrap`
|
|
@@ -30,7 +30,27 @@ export function wrapUnavailable(local) {
|
|
|
30
30
|
return ("wrap mode is not in the published Pylair packages yet. " +
|
|
31
31
|
"Scaffold against a checkout instead: --local /path/to/pylair-repo");
|
|
32
32
|
}
|
|
33
|
-
export
|
|
33
|
+
export const WRAP_FRAMEWORKS = ["command", "gradio", "streamlit"];
|
|
34
|
+
export const WRAP_APPS = {
|
|
35
|
+
command: {
|
|
36
|
+
deps: ['"fastapi>=0.115"', '"uvicorn>=0.30"'],
|
|
37
|
+
reqs: ["fastapi>=0.115", "uvicorn>=0.30"],
|
|
38
|
+
run: 'cmd = ["python", "-m", "uvicorn", "main:app", "--host", "127.0.0.1", "--port", "{port}"]',
|
|
39
|
+
},
|
|
40
|
+
gradio: {
|
|
41
|
+
deps: ['"gradio>=5,<6"'],
|
|
42
|
+
reqs: ["gradio>=5,<6"],
|
|
43
|
+
run: 'entry = "app.py"',
|
|
44
|
+
sample: "gradio.py",
|
|
45
|
+
},
|
|
46
|
+
streamlit: {
|
|
47
|
+
deps: ['"streamlit>=1,<2"'],
|
|
48
|
+
reqs: ["streamlit>=1,<2"],
|
|
49
|
+
run: 'entry = "app.py"',
|
|
50
|
+
sample: "streamlit.py",
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
export function substitutions(name, identifier, local, framework = "command") {
|
|
34
54
|
const snake = name.replace(/-/g, "_").replace(/\W/g, "_");
|
|
35
55
|
const subs = {
|
|
36
56
|
__APP_NAME__: name,
|
|
@@ -54,6 +74,11 @@ export function substitutions(name, identifier, local) {
|
|
|
54
74
|
subs.__PYLAIR_CLI__ = PINS.cli;
|
|
55
75
|
subs.__PYLAIR_RS__ = PINS.rs;
|
|
56
76
|
}
|
|
77
|
+
const app = WRAP_APPS[framework];
|
|
78
|
+
subs.__WRAP_FRAMEWORK__ = framework;
|
|
79
|
+
subs.__WRAP_RUN__ = app.run;
|
|
80
|
+
subs.__WRAP_DEPS__ = [`"${subs.__PYLAIR_PY__}"`, ...app.deps].join(", ");
|
|
81
|
+
subs.__WRAP_REQS__ = [subs.__PYLAIR_PY__, ...app.reqs].join("\n");
|
|
57
82
|
return subs;
|
|
58
83
|
}
|
|
59
84
|
function fill(text, subs) {
|
package/dist/scaffold.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,M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AW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBACjE,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;YACzD,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YACf,CAAC;YACD,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** What the terminal can show, decided ONCE at startup.
|
|
2
|
+
*
|
|
3
|
+
* Two independent questions:
|
|
4
|
+
*
|
|
5
|
+
* - fancy or plain? Fancy is colour, symbols, a spinner and folded tool
|
|
6
|
+
* output; plain is stable, readable text with no ANSI codes and no spinner
|
|
7
|
+
* frames (logs, CI, pipes, `--plain`).
|
|
8
|
+
* - unicode or ascii symbols? Only asked when fancy. A glyph the console
|
|
9
|
+
* cannot show comes out as mojibake (a UTF-8 em dash read as code page 437
|
|
10
|
+
* prints "ΓÇö"), so on Windows unicode is used only where it is known to
|
|
11
|
+
* work.
|
|
12
|
+
*
|
|
13
|
+
* Pure: everything it needs comes in as arguments, so it is unit-tested for
|
|
14
|
+
* every TTY / CI / NO_COLOR / FORCE_COLOR / Windows-console case.
|
|
15
|
+
*/
|
|
16
|
+
export interface Caps {
|
|
17
|
+
/** Colour, symbols, spinner, folded tool output. False means plain text. */
|
|
18
|
+
fancy: boolean;
|
|
19
|
+
/** Emit ANSI colour codes (equal to `fancy`). */
|
|
20
|
+
color: boolean;
|
|
21
|
+
/** Use Unicode symbols (otherwise ASCII). Always false when plain. */
|
|
22
|
+
unicode: boolean;
|
|
23
|
+
/** Redraw lines in place (a live spinner): fancy AND an interactive TTY. */
|
|
24
|
+
animate: boolean;
|
|
25
|
+
/** Terminal width, for truncating folded progress lines. */
|
|
26
|
+
columns: number;
|
|
27
|
+
}
|
|
28
|
+
export interface CapsInput {
|
|
29
|
+
env: Record<string, string | undefined>;
|
|
30
|
+
platform: string;
|
|
31
|
+
stdoutIsTTY: boolean;
|
|
32
|
+
/** Command-line arguments (for `--plain`). */
|
|
33
|
+
argv: readonly string[];
|
|
34
|
+
/** Windows only: the console's output code page, asked lazily and at most
|
|
35
|
+
* once, and only when the answer matters. */
|
|
36
|
+
codePage?: () => number | undefined;
|
|
37
|
+
columns?: number;
|
|
38
|
+
}
|
|
39
|
+
export declare function detectCaps(i: CapsInput): Caps;
|
|
40
|
+
/** Windows: the active console code page, from `chcp`. Undefined when it
|
|
41
|
+
* cannot be read (treated as "not UTF-8": ASCII is always safe). */
|
|
42
|
+
export declare function windowsCodePage(): number | undefined;
|
|
43
|
+
/** The real thing, from the running process. */
|
|
44
|
+
export declare function detectProcessCaps(argv?: readonly string[]): Caps;
|
|
45
|
+
//# sourceMappingURL=caps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caps.d.ts","sourceRoot":"","sources":["../../src/ui/caps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,WAAW,IAAI;IACnB,4EAA4E;IAC5E,KAAK,EAAE,OAAO,CAAC;IACf,iDAAiD;IACjD,KAAK,EAAE,OAAO,CAAC;IACf,sEAAsE;IACtE,OAAO,EAAE,OAAO,CAAC;IACjB,4EAA4E;IAC5E,OAAO,EAAE,OAAO,CAAC;IACjB,4DAA4D;IAC5D,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,8CAA8C;IAC9C,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB;iDAC6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAeD,wBAAgB,UAAU,CAAC,CAAC,EAAE,SAAS,GAAG,IAAI,CAuB7C;AAED;oEACoE;AACpE,wBAAgB,eAAe,IAAI,MAAM,GAAG,SAAS,CAapD;AAED,gDAAgD;AAChD,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,SAAS,MAAM,EAA0B,GAAG,IAAI,CASvF"}
|