@parall/cli 1.78.0 → 1.80.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/dist/commands/apps-access.d.ts +8 -0
- package/dist/commands/apps-access.d.ts.map +1 -0
- package/dist/commands/apps-access.js +151 -0
- package/dist/commands/apps-actions-sdk.generated.d.ts +1 -1
- package/dist/commands/apps-actions-sdk.generated.d.ts.map +1 -1
- package/dist/commands/apps-actions-sdk.generated.js +1 -1
- package/dist/commands/apps-actions.d.ts +5 -3
- package/dist/commands/apps-actions.d.ts.map +1 -1
- package/dist/commands/apps-actions.js +11 -4
- package/dist/commands/apps-add.js +1 -1
- package/dist/commands/apps-blocks.d.ts.map +1 -1
- package/dist/commands/apps-blocks.js +8 -0
- package/dist/commands/apps-dev-page.d.ts +2 -0
- package/dist/commands/apps-dev-page.d.ts.map +1 -1
- package/dist/commands/apps-dev-page.js +3 -3
- package/dist/commands/apps-dev-server.d.ts +10 -1
- package/dist/commands/apps-dev-server.d.ts.map +1 -1
- package/dist/commands/apps-dev-server.js +26 -3
- package/dist/commands/apps-dev.d.ts +12 -1
- package/dist/commands/apps-dev.d.ts.map +1 -1
- package/dist/commands/apps-dev.js +25 -10
- package/dist/commands/apps-page-sdk.generated.d.ts +1 -1
- package/dist/commands/apps-page-sdk.generated.d.ts.map +1 -1
- package/dist/commands/apps-page-sdk.generated.js +1 -1
- package/dist/commands/apps-placement.d.ts +13 -0
- package/dist/commands/apps-placement.d.ts.map +1 -0
- package/dist/commands/apps-placement.js +20 -0
- package/dist/commands/apps-scaffold.d.ts +7 -1
- package/dist/commands/apps-scaffold.d.ts.map +1 -1
- package/dist/commands/apps-scaffold.js +88 -30
- package/dist/commands/apps-template-catalog.d.ts +85 -0
- package/dist/commands/apps-template-catalog.d.ts.map +1 -0
- package/dist/commands/apps-template-catalog.gen.d.ts +3 -0
- package/dist/commands/apps-template-catalog.gen.d.ts.map +1 -0
- package/dist/commands/apps-template-catalog.gen.js +228 -0
- package/dist/commands/apps-template-catalog.js +49 -0
- package/dist/commands/apps-template-init.d.ts +39 -0
- package/dist/commands/apps-template-init.d.ts.map +1 -0
- package/dist/commands/apps-template-init.js +118 -0
- package/dist/commands/apps-template.d.ts +11 -0
- package/dist/commands/apps-template.d.ts.map +1 -1
- package/dist/commands/apps-template.js +18 -7
- package/dist/commands/apps-templates.gen.d.ts +1 -0
- package/dist/commands/apps-templates.gen.d.ts.map +1 -1
- package/dist/commands/apps-templates.gen.js +27 -18
- package/dist/commands/apps.d.ts +3 -2
- package/dist/commands/apps.d.ts.map +1 -1
- package/dist/commands/apps.js +15 -4
- package/dist/commands/chat-connections.d.ts +11 -0
- package/dist/commands/chat-connections.d.ts.map +1 -0
- package/dist/commands/chat-connections.js +162 -0
- package/dist/commands/chats.d.ts.map +1 -1
- package/dist/commands/chats.js +6 -1
- package/dist/commands/db-plane.d.ts.map +1 -1
- package/dist/commands/db-plane.js +10 -6
- package/dist/commands/dbs.d.ts +3 -2
- package/dist/commands/dbs.d.ts.map +1 -1
- package/dist/commands/dbs.js +10 -5
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +1 -1
- package/dist/lib/output.d.ts +11 -0
- package/dist/lib/output.d.ts.map +1 -1
- package/dist/lib/output.js +32 -5
- package/package.json +5 -5
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { MiniAppPlacement } from '@parall/sdk';
|
|
2
|
+
import type { AppTemplate } from './apps-template-catalog.js';
|
|
3
|
+
/**
|
|
4
|
+
* `parall app init <dir> --template <id> --app <app_…>` (design §5.2): the
|
|
5
|
+
* `--actions` scaffold with the template's reference source over it, its
|
|
6
|
+
* blocks added the way `parall app add` adds them, its skill as SKILL.md and
|
|
7
|
+
* a line in AGENTS.md pointing to it. The app is created first; its
|
|
8
|
+
* Database decides whether the template fits: the templates are written for
|
|
9
|
+
* PostgreSQL, so one on TiDB is refused before anything is written.
|
|
10
|
+
*/
|
|
11
|
+
/** The app a project is for (`init --app`) and where its Database keeps
|
|
12
|
+
* its data. */
|
|
13
|
+
export interface InitTarget {
|
|
14
|
+
appId: string;
|
|
15
|
+
databaseId: string;
|
|
16
|
+
placement: MiniAppPlacement;
|
|
17
|
+
}
|
|
18
|
+
export declare function resolveInitTarget(raw: string): Promise<InitTarget>;
|
|
19
|
+
/** Why the template cannot be used for this app, or undefined when it can. */
|
|
20
|
+
export declare function templateRefusal(template: AppTemplate, target: InitTarget): string | undefined;
|
|
21
|
+
/** The project's files, sorted by path. */
|
|
22
|
+
export declare function templateProject(name: string, template: AppTemplate): Array<[string, string]>;
|
|
23
|
+
/** The blocks the template names (_overlay.json `blocks`). */
|
|
24
|
+
export declare function templateBlocks(template: AppTemplate): string[];
|
|
25
|
+
/**
|
|
26
|
+
* Writes the project to out (absent or empty): built beside it, blocks
|
|
27
|
+
* added there, then moved into place — a block that cannot be added leaves
|
|
28
|
+
* nothing behind.
|
|
29
|
+
*/
|
|
30
|
+
export declare function writeTemplateProject(out: string, files: Array<[string, string]>, blocks: string[]): Promise<void>;
|
|
31
|
+
/** What init prints when it is done. */
|
|
32
|
+
export declare function templateNextSteps(p: {
|
|
33
|
+
name: string;
|
|
34
|
+
dir: string;
|
|
35
|
+
out: string;
|
|
36
|
+
template: AppTemplate;
|
|
37
|
+
target: InitTarget;
|
|
38
|
+
}): string;
|
|
39
|
+
//# sourceMappingURL=apps-template-init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apps-template-init.d.ts","sourceRoot":"","sources":["../../src/commands/apps-template-init.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAKpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;;;;;;GAOG;AAEH;eACe;AACf,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,gBAAgB,CAAC;CAC7B;AAED,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAYxE;AAED,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAQ7F;AAUD,2CAA2C;AAC3C,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAkB5F;AAED,8DAA8D;AAC9D,wBAAgB,cAAc,CAAC,QAAQ,EAAE,WAAW,GAAG,MAAM,EAAE,CAG9D;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAC9B,MAAM,EAAE,MAAM,EAAE,GACf,OAAO,CAAC,IAAI,CAAC,CAkCf;AAED,wCAAwC;AACxC,wBAAgB,iBAAiB,CAAC,CAAC,EAAE;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,WAAW,CAAC;IACtB,MAAM,EAAE,UAAU,CAAC;CACpB,GAAG,MAAM,CAcT"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { randomBytes } from 'node:crypto';
|
|
2
|
+
import { promises as fs } from 'node:fs';
|
|
3
|
+
import { basename, dirname, join, resolve } from 'node:path';
|
|
4
|
+
import { resolveCredentials } from '../lib/client.js';
|
|
5
|
+
import { stripPrllScheme } from '../lib/output.js';
|
|
6
|
+
import { applyBlock, conflictMessage, findBlock, planBlock } from './apps-blocks.js';
|
|
7
|
+
import { applyOverlay, scaffoldProject, sortKeys } from './apps-template.js';
|
|
8
|
+
export async function resolveInitTarget(raw) {
|
|
9
|
+
const appId = stripPrllScheme(raw.trim());
|
|
10
|
+
if (!appId.startsWith('app_')) {
|
|
11
|
+
throw new Error('--app takes an app ID (app_…); create the app first with parall app create --name "<name>"');
|
|
12
|
+
}
|
|
13
|
+
const { client, orgId } = resolveCredentials();
|
|
14
|
+
const app = await client.getMiniApp(orgId, appId);
|
|
15
|
+
const database = await client.getMiniAppDatabase(orgId, app.database_id);
|
|
16
|
+
// A server older than placements sends none: that is `apps`.
|
|
17
|
+
return { appId, databaseId: database.id, placement: database.placement ?? 'apps' };
|
|
18
|
+
}
|
|
19
|
+
/** Why the template cannot be used for this app, or undefined when it can. */
|
|
20
|
+
export function templateRefusal(template, target) {
|
|
21
|
+
if (target.placement !== 'tidb')
|
|
22
|
+
return undefined;
|
|
23
|
+
return (`The ${template.id} template is written for PostgreSQL, and the Database of ${target.appId} ` +
|
|
24
|
+
`(${target.databaseId}) is on TiDB (placement tidb), which speaks MySQL: its tables, SQL and ` +
|
|
25
|
+
'actions would not run there. Nothing was written. Templates have no MySQL version yet — ' +
|
|
26
|
+
'tell the person this template cannot be used for this app.');
|
|
27
|
+
}
|
|
28
|
+
/** The line init puts under the title of AGENTS.md. */
|
|
29
|
+
function skillPointer(template) {
|
|
30
|
+
return (`> 这个项目由应用模板「${template.intro.name.zh}」(\`${template.id}\`)生成,` +
|
|
31
|
+
'模板的页面、action 与表换掉了下文提到的示例;日常工作照 `SKILL.md`。');
|
|
32
|
+
}
|
|
33
|
+
/** The project's files, sorted by path. */
|
|
34
|
+
export function templateProject(name, template) {
|
|
35
|
+
const files = new Map(scaffoldProject({ name, actions: true }));
|
|
36
|
+
const pkg = files.get('package.json');
|
|
37
|
+
applyOverlay(files, template.overlay);
|
|
38
|
+
if (files.get('package.json') !== pkg) {
|
|
39
|
+
// A template's own dependencies, sorted the way the scaffold's are.
|
|
40
|
+
const merged = JSON.parse(files.get('package.json') ?? '{}');
|
|
41
|
+
for (const field of ['dependencies', 'devDependencies']) {
|
|
42
|
+
if (merged[field])
|
|
43
|
+
merged[field] = sortKeys(merged[field]);
|
|
44
|
+
}
|
|
45
|
+
files.set('package.json', `${JSON.stringify(merged, null, 2)}\n`);
|
|
46
|
+
}
|
|
47
|
+
files.set('SKILL.md', template.skill);
|
|
48
|
+
const agents = (files.get('AGENTS.md') ?? '').split('\n');
|
|
49
|
+
const at = agents[0]?.startsWith('# ') ? 1 : 0;
|
|
50
|
+
agents.splice(at, 0, ...(at ? ['', skillPointer(template)] : [skillPointer(template), '']));
|
|
51
|
+
files.set('AGENTS.md', agents.join('\n'));
|
|
52
|
+
return [...files].sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0));
|
|
53
|
+
}
|
|
54
|
+
/** The blocks the template names (_overlay.json `blocks`). */
|
|
55
|
+
export function templateBlocks(template) {
|
|
56
|
+
const meta = JSON.parse(template.overlay['_overlay.json'] ?? '{}');
|
|
57
|
+
return meta.blocks ?? [];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Writes the project to out (absent or empty): built beside it, blocks
|
|
61
|
+
* added there, then moved into place — a block that cannot be added leaves
|
|
62
|
+
* nothing behind.
|
|
63
|
+
*/
|
|
64
|
+
export async function writeTemplateProject(out, files, blocks) {
|
|
65
|
+
const parent = dirname(resolve(out));
|
|
66
|
+
await fs.mkdir(parent, { recursive: true });
|
|
67
|
+
// Not mkdtemp: the project keeps the permissions a plain mkdir gives it.
|
|
68
|
+
const staging = join(parent, `.${basename(out)}.parall-init-${randomBytes(4).toString('hex')}`);
|
|
69
|
+
await fs.mkdir(staging);
|
|
70
|
+
try {
|
|
71
|
+
for (const [rel, content] of files) {
|
|
72
|
+
const target = join(staging, rel);
|
|
73
|
+
await fs.mkdir(dirname(target), { recursive: true });
|
|
74
|
+
await fs.writeFile(target, content);
|
|
75
|
+
}
|
|
76
|
+
for (const name of blocks) {
|
|
77
|
+
const block = findBlock(name);
|
|
78
|
+
if (!block)
|
|
79
|
+
throw new Error(`the template names a block this CLI does not have: ${name}`);
|
|
80
|
+
const plan = await planBlock(staging, block);
|
|
81
|
+
if (plan.conflicts.length > 0 || plan.actions.conflicts.length > 0) {
|
|
82
|
+
throw new Error(conflictMessage(plan));
|
|
83
|
+
}
|
|
84
|
+
if (plan.manual.length > 0) {
|
|
85
|
+
throw new Error(`cannot add ${name}: ${plan.manual.join('; ')}`);
|
|
86
|
+
}
|
|
87
|
+
await applyBlock(plan);
|
|
88
|
+
}
|
|
89
|
+
try {
|
|
90
|
+
await fs.rmdir(out);
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
if (err.code !== 'ENOENT')
|
|
94
|
+
throw err;
|
|
95
|
+
}
|
|
96
|
+
await fs.rename(staging, out);
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
await fs.rm(staging, { recursive: true, force: true });
|
|
100
|
+
throw err;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/** What init prints when it is done. */
|
|
104
|
+
export function templateNextSteps(p) {
|
|
105
|
+
const app = p.target.appId;
|
|
106
|
+
return [
|
|
107
|
+
`Scaffolded ${p.name} from the ${p.template.id} template (${p.template.intro.name.en}) in ${p.out}, for ${app}: its Database ${p.target.databaseId} is PostgreSQL.`,
|
|
108
|
+
'SKILL.md is the template’s skill and AGENTS.md points to it: follow SKILL.md from here.',
|
|
109
|
+
'',
|
|
110
|
+
'Next steps (SKILL.md has the details):',
|
|
111
|
+
' 1. Adapt the source to what the person answered: stages, fields, copy',
|
|
112
|
+
` 2. cd ${p.dir} && pnpm install && pnpm build`,
|
|
113
|
+
` 3. parall app db exec --app ${app} --file db/schema.sql # create the tables`,
|
|
114
|
+
' 4. Import the data the person agreed to, from those sources only — nothing made up',
|
|
115
|
+
` 5. parall app check dist && parall app publish dist --app ${app} --source .`,
|
|
116
|
+
' 6. Wake-ups: an app.data.changed trigger on the tables that matter, and a daily schedule',
|
|
117
|
+
].join('\n');
|
|
118
|
+
}
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
+
/** The SQL a Database speaks, by its placement: `apps` is PostgreSQL,
|
|
2
|
+
* `tidb` MySQL. */
|
|
3
|
+
export type SqlDialect = 'postgres' | 'mysql';
|
|
1
4
|
export interface ScaffoldOptions {
|
|
2
5
|
/** The app's display name (the directory name). */
|
|
3
6
|
name: string;
|
|
4
7
|
/** Include actions, the schema and the example list. */
|
|
5
8
|
actions: boolean;
|
|
9
|
+
/** The dialect the actions and the schema write SQL in; PostgreSQL when
|
|
10
|
+
* absent. Only --actions writes SQL. */
|
|
11
|
+
dialect?: SqlDialect;
|
|
6
12
|
}
|
|
7
13
|
/** The project's files, sorted by path. */
|
|
8
14
|
export declare function scaffoldProject(options: ScaffoldOptions): Array<[string, string]>;
|
|
9
15
|
/** An npm-valid package name from a directory name ("My App" → "my-app"). */
|
|
10
16
|
export declare function packageName(name: string): string;
|
|
17
|
+
/** Applies the --actions overlay: _overlay.json's remove list drops base
|
|
18
|
+
* paths (a directory drops everything under it), JSON files present in both
|
|
19
|
+
* are deep-merged, AGENTS.md is appended, anything else is added or
|
|
20
|
+
* replaced. */
|
|
21
|
+
export declare function applyOverlay(files: Map<string, string>, overlay: Readonly<Record<string, string>>): void;
|
|
11
22
|
/** Objects merge key by key; anything else (arrays included) is replaced. */
|
|
12
23
|
export declare function mergeJSON(base: unknown, over: unknown): unknown;
|
|
13
24
|
/** The same object with its keys in sorted order (package.json style). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps-template.d.ts","sourceRoot":"","sources":["../../src/commands/apps-template.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apps-template.d.ts","sourceRoot":"","sources":["../../src/commands/apps-template.ts"],"names":[],"mappings":"AA+BA;mBACmB;AACnB,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,OAAO,CAAC;AAE9C,MAAM,WAAW,eAAe;IAC9B,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,OAAO,EAAE,OAAO,CAAC;IACjB;4CACwC;IACxC,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AAED,2CAA2C;AAC3C,wBAAgB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA8BjF;AAMD,6EAA6E;AAC7E,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOhD;AAED;;;eAGe;AACf,wBAAgB,YAAY,CAC1B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC1B,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,QAoB1C;AAED,6EAA6E;AAC7E,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAO/D;AAED,0EAA0E;AAC1E,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAIxE"}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { ACTIONS_SDK_SOURCE } from './apps-actions-sdk.generated.js';
|
|
2
2
|
import { PAGE_SDK_SOURCE } from './apps-page-sdk.generated.js';
|
|
3
|
-
import { TEMPLATE_BASE, TEMPLATE_WITH_ACTIONS } from './apps-templates.gen.js';
|
|
3
|
+
import { TEMPLATE_BASE, TEMPLATE_MYSQL, TEMPLATE_WITH_ACTIONS } from './apps-templates.gen.js';
|
|
4
4
|
/** What `parall app init` writes (design §7.4): the base template — Vite +
|
|
5
5
|
* React + TypeScript + Tailwind + shadcn/ui, a responsive app shell, light
|
|
6
6
|
* and dark themes, loading / empty / error states and typed action hooks —
|
|
7
7
|
* and, with --actions, the server-side actions, the schema and an example
|
|
8
|
-
* list wired to them
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* ts/
|
|
8
|
+
* list wired to them, their SQL in the dialect of the app's Database
|
|
9
|
+
* (PostgreSQL unless --app names one on TiDB, which speaks MySQL:
|
|
10
|
+
* mini-app-tidb-placement-design.md §6.7). The sources live in
|
|
11
|
+
* ts/cli/templates/mini-app and are embedded by
|
|
12
|
+
* scripts/generate-app-templates.mjs (the build checks the embedded copy is
|
|
13
|
+
* current); the two SDK halves are vendored from ts/miniapp-sdk until it is
|
|
14
|
+
* on npm. */
|
|
12
15
|
const PAGE_VENDORED_HEADER = `// Vendored copy of @parall/miniapp-sdk, written by \`parall app init\`. Do
|
|
13
16
|
// not edit; replace it with the npm package once that ships.
|
|
14
17
|
`;
|
|
@@ -24,8 +27,16 @@ const RENAMES = { _gitignore: '.gitignore' };
|
|
|
24
27
|
/** The project's files, sorted by path. */
|
|
25
28
|
export function scaffoldProject(options) {
|
|
26
29
|
const files = new Map(Object.entries(TEMPLATE_BASE));
|
|
27
|
-
if (options.actions)
|
|
30
|
+
if (options.actions && options.dialect === 'mysql') {
|
|
31
|
+
// The MySQL overlay's AGENTS.md is the whole data part, in place of
|
|
32
|
+
// with-actions' one: the two say different things about the Database.
|
|
33
|
+
const { 'AGENTS.md': _postgres, ...withActions } = TEMPLATE_WITH_ACTIONS;
|
|
34
|
+
applyOverlay(files, withActions);
|
|
35
|
+
applyOverlay(files, TEMPLATE_MYSQL);
|
|
36
|
+
}
|
|
37
|
+
else if (options.actions) {
|
|
28
38
|
applyOverlay(files, TEMPLATE_WITH_ACTIONS);
|
|
39
|
+
}
|
|
29
40
|
files.set('src/parall.ts', PAGE_VENDORED_HEADER + PAGE_SDK_SOURCE);
|
|
30
41
|
if (options.actions) {
|
|
31
42
|
files.set('actions/parall-actions.ts', ACTIONS_VENDORED_HEADER + ACTIONS_SDK_SOURCE);
|
|
@@ -62,7 +73,7 @@ export function packageName(name) {
|
|
|
62
73
|
* paths (a directory drops everything under it), JSON files present in both
|
|
63
74
|
* are deep-merged, AGENTS.md is appended, anything else is added or
|
|
64
75
|
* replaced. */
|
|
65
|
-
function applyOverlay(files, overlay) {
|
|
76
|
+
export function applyOverlay(files, overlay) {
|
|
66
77
|
const meta = JSON.parse(overlay['_overlay.json'] ?? '{}');
|
|
67
78
|
for (const prefix of meta.remove ?? []) {
|
|
68
79
|
for (const path of [...files.keys()]) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { RegistryItem } from './apps-blocks.js';
|
|
2
2
|
export declare const TEMPLATE_BASE: Readonly<Record<string, string>>;
|
|
3
3
|
export declare const TEMPLATE_WITH_ACTIONS: Readonly<Record<string, string>>;
|
|
4
|
+
export declare const TEMPLATE_MYSQL: Readonly<Record<string, string>>;
|
|
4
5
|
export declare const TEMPLATE_BLOCKS: readonly RegistryItem[];
|
|
5
6
|
//# sourceMappingURL=apps-templates.gen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps-templates.gen.d.ts","sourceRoot":"","sources":["../../src/commands/apps-templates.gen.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA0D1D,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAsBlE,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,SAAS,YAAY,EAyclD,CAAC"}
|
|
1
|
+
{"version":3,"file":"apps-templates.gen.d.ts","sourceRoot":"","sources":["../../src/commands/apps-templates.gen.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA0D1D,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAsBlE,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQ3D,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,SAAS,YAAY,EAyclD,CAAC"}
|