create-ilorb 0.0.0-stage → 0.2.0
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/LICENSE-API.md +108 -0
- package/README.md +285 -2
- package/assets/dev-local.mjs +205 -0
- package/dist/args.js +39 -0
- package/dist/cli.js +7 -0
- package/dist/cloudflare/provider.js +48 -0
- package/dist/cloudflare/real.js +211 -0
- package/dist/cloudflare/simulated.js +213 -0
- package/dist/core-admin.js +85 -0
- package/dist/engine.js +52 -0
- package/dist/errors.js +23 -0
- package/dist/exec.js +49 -0
- package/dist/fsutil.js +130 -0
- package/dist/generate.js +260 -0
- package/dist/i18n/en.js +380 -0
- package/dist/i18n/es.js +372 -0
- package/dist/i18n/index.js +23 -0
- package/dist/i18n/pt.js +372 -0
- package/dist/license/activate.js +71 -0
- package/dist/license/keys.js +14 -0
- package/dist/license/verify.js +56 -0
- package/dist/local/ports.js +33 -0
- package/dist/main.js +594 -0
- package/dist/products.js +1528 -0
- package/dist/readme.js +228 -0
- package/dist/state.js +58 -0
- package/dist/steps.js +869 -0
- package/dist/templates.js +31 -0
- package/dist/theme/preview.js +39 -0
- package/dist/theme/vendor/color.js +133 -0
- package/dist/theme/vendor/tokens.js +314 -0
- package/dist/ui/prompt.js +108 -0
- package/dist/ui/term.js +92 -0
- package/package.json +50 -4
package/dist/ui/term.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// Terminal output: colors (respects NO_COLOR and colorless terminals), numbered steps, and a copy WITHOUT color in
|
|
2
|
+
// .overture/install.log (and in --log, which is where the video text comes from).
|
|
3
|
+
import { appendFileSync, mkdirSync } from 'node:fs';
|
|
4
|
+
import { dirname } from 'node:path';
|
|
5
|
+
import { hexToRgb } from "../theme/vendor/color.js";
|
|
6
|
+
const ESC = '\x1b[';
|
|
7
|
+
export const stripAnsi = (s) => s.replace(/\x1b\[[0-9;]*m/g, '');
|
|
8
|
+
export class Out {
|
|
9
|
+
color;
|
|
10
|
+
logFiles = [];
|
|
11
|
+
w;
|
|
12
|
+
t0 = Date.now();
|
|
13
|
+
constructor(o = {}) {
|
|
14
|
+
this.w = o.write ?? ((s) => process.stdout.write(s));
|
|
15
|
+
this.color = o.color ?? (!process.env.NO_COLOR && !!process.stdout.isTTY && process.env.TERM !== 'dumb');
|
|
16
|
+
}
|
|
17
|
+
logTo(file) {
|
|
18
|
+
mkdirSync(dirname(file), { recursive: true });
|
|
19
|
+
if (!this.logFiles.includes(file))
|
|
20
|
+
this.logFiles.push(file);
|
|
21
|
+
}
|
|
22
|
+
/** writes to the terminal and (without color) to the logs */
|
|
23
|
+
raw(s) {
|
|
24
|
+
this.w(this.color ? s : stripAnsi(s));
|
|
25
|
+
for (const f of this.logFiles) {
|
|
26
|
+
try {
|
|
27
|
+
appendFileSync(f, stripAnsi(s));
|
|
28
|
+
}
|
|
29
|
+
catch { }
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
line(s = '') {
|
|
33
|
+
this.raw(s + '\n');
|
|
34
|
+
}
|
|
35
|
+
/** on SCREEN the full text; in the logs on disk the masked version (e.g. first-access link, which is a credential) */
|
|
36
|
+
secretLine(s, masked) {
|
|
37
|
+
this.w((this.color ? s : stripAnsi(s)) + '\n');
|
|
38
|
+
for (const f of this.logFiles) {
|
|
39
|
+
try {
|
|
40
|
+
appendFileSync(f, stripAnsi(masked) + '\n');
|
|
41
|
+
}
|
|
42
|
+
catch { }
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/** log only (technical detail) */
|
|
46
|
+
log(s) {
|
|
47
|
+
for (const f of this.logFiles) {
|
|
48
|
+
try {
|
|
49
|
+
appendFileSync(f, stripAnsi(s) + '\n');
|
|
50
|
+
}
|
|
51
|
+
catch { }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
c = (code, s) => (this.color ? `${ESC}${code}m${s}${ESC}0m` : s);
|
|
55
|
+
bold = (s) => this.c('1', s);
|
|
56
|
+
dim = (s) => this.c('2', s);
|
|
57
|
+
green = (s) => this.c('32', s);
|
|
58
|
+
red = (s) => this.c('31', s);
|
|
59
|
+
yellow = (s) => this.c('33', s);
|
|
60
|
+
cyan = (s) => this.c('36', s);
|
|
61
|
+
magenta = (s) => this.c('35', s);
|
|
62
|
+
/** color block (truecolor background) with optional text on top */
|
|
63
|
+
swatch(bgHex, text = ' ', fgHex) {
|
|
64
|
+
if (!this.color)
|
|
65
|
+
return text.trim() ? `[${text.trim()}]` : '';
|
|
66
|
+
const [r, g, b] = hexToRgb(bgHex).map((x) => Math.round(x * 255));
|
|
67
|
+
const fg = fgHex ? hexToRgb(fgHex).map((x) => Math.round(x * 255)) : null;
|
|
68
|
+
return `${ESC}48;2;${r};${g};${b}m${fg ? `${ESC}38;2;${fg[0]};${fg[1]};${fg[2]}m` : ''}${text}${ESC}0m`;
|
|
69
|
+
}
|
|
70
|
+
elapsed() {
|
|
71
|
+
const s = Math.round((Date.now() - this.t0) / 1000);
|
|
72
|
+
return `${String(Math.floor(s / 60)).padStart(2, '0')}:${String(s % 60).padStart(2, '0')}`;
|
|
73
|
+
}
|
|
74
|
+
step(n, total, title) {
|
|
75
|
+
this.line(`${this.dim(`[${this.elapsed()}]`)} ${this.cyan(`${n}/${total}`)} ${this.bold(title)}`);
|
|
76
|
+
}
|
|
77
|
+
ok(s) {
|
|
78
|
+
this.line(` ${this.green('✔')} ${s}`);
|
|
79
|
+
}
|
|
80
|
+
skip(n, total, title, why) {
|
|
81
|
+
this.line(`${this.dim(`[${this.elapsed()}]`)} ${this.dim(`${n}/${total}`)} ${title} ${this.dim(`— ${why}`)}`);
|
|
82
|
+
}
|
|
83
|
+
info(s) {
|
|
84
|
+
this.line(` ${this.dim('·')} ${s}`);
|
|
85
|
+
}
|
|
86
|
+
warn(s) {
|
|
87
|
+
this.line(` ${this.yellow('!')} ${s}`);
|
|
88
|
+
}
|
|
89
|
+
cmd(s) {
|
|
90
|
+
this.line(` ${this.dim('$')} ${s}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-ilorb",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Ilorb Code installer: a free template (with its Ilorb key from ilorb.env) → your project, database and Ilorb Core, locally or on your own Cloudflare account. npm create ilorb",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"create-ilorb": "dist/cli.js",
|
|
9
|
+
"create-overture": "dist/cli.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"assets",
|
|
14
|
+
"LICENSE-API.md",
|
|
15
|
+
"README.md"
|
|
16
|
+
],
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=20"
|
|
19
|
+
},
|
|
20
|
+
"packageManager": "pnpm@11.25.0",
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc -p tsconfig.build.json && node tools/postbuild.mjs",
|
|
23
|
+
"typecheck": "tsc --noEmit -p .",
|
|
24
|
+
"test": "vitest run",
|
|
25
|
+
"e2e": "node e2e/local.mjs",
|
|
26
|
+
"e2e:widgets": "node e2e/widgets-local.mjs",
|
|
27
|
+
"e2e:consultas": "node e2e/consultas-local.mjs",
|
|
28
|
+
"e2e:status": "node e2e/status-local.mjs",
|
|
29
|
+
"e2e:agenda": "node e2e/agenda-local.mjs",
|
|
30
|
+
"e2e:sites": "node e2e/sites-local.mjs",
|
|
31
|
+
"e2e:starter": "node e2e/starter-local.mjs",
|
|
32
|
+
"e2e:link": "node e2e/link-local.mjs",
|
|
33
|
+
"e2e:imoveis": "node e2e/imoveis-local.mjs",
|
|
34
|
+
"e2e:quiz": "node e2e/quiz-local.mjs",
|
|
35
|
+
"e2e:helpcenter": "node e2e/helpcenter-local.mjs",
|
|
36
|
+
"e2e:classificados": "node e2e/classificados-local.mjs",
|
|
37
|
+
"e2e:delivery": "node e2e/delivery-local.mjs",
|
|
38
|
+
"e2e:cardapio": "node e2e/cardapio-local.mjs",
|
|
39
|
+
"e2e:shop": "node e2e/shop-local.mjs",
|
|
40
|
+
"e2e:faturas": "node e2e/faturas-local.mjs",
|
|
41
|
+
"e2e:cursos": "node e2e/cursos-local.mjs",
|
|
42
|
+
"license-server": "node tools/fake-license-server.mjs"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/node": "22.20.5",
|
|
46
|
+
"typescript": "5.9.3",
|
|
47
|
+
"vitest": "4.1.11"
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
}
|
|
52
|
+
}
|