create-lacspace-app 2.1.1 → 2.2.1

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/lib.d.cts ADDED
@@ -0,0 +1,68 @@
1
+ interface TemplateDef {
2
+ key: string;
3
+ label: string;
4
+ description: string;
5
+ /** Tailwind gradient accent (from → to). */
6
+ accent: [string, string];
7
+ siteName: string;
8
+ siteDescription: string;
9
+ }
10
+ /** Options accepted by the programmatic API (see `./lib`). */
11
+ interface GenerateOptions {
12
+ /** Project name — becomes the folder name and the default site name slug. Default `"my-app"`. */
13
+ name?: string;
14
+ /** Template key: one of {@link TEMPLATES} (`personal`, `business`, `ecommerce`, `saas`, `blog`, `docs`, `dashboard`, `restaurant`, `marketplace`). Default `"personal"`. */
15
+ template?: string;
16
+ /** Accent theme: a preset name, a `#hex`, or a `from,to` pair. Falls back to the template's default accent. */
17
+ theme?: string;
18
+ }
19
+
20
+ /** A project file map: relative path → file contents. */
21
+ type ProjectFiles = Record<string, string>;
22
+ /** The list of built-in templates, with their metadata. */
23
+ declare const templates: readonly TemplateDef[];
24
+ /** Every template key you can pass as `options.template`. */
25
+ declare const templateKeys: readonly string[];
26
+ /** Return the built-in templates (metadata: key, label, description, accent, defaults). */
27
+ declare function listTemplates(): TemplateDef[];
28
+ /** Look up one template's metadata by key, or `undefined`. */
29
+ declare function getTemplate(key: string): TemplateDef | undefined;
30
+ /** The names of every prebuilt section available (the CLI's `add <section>`). */
31
+ declare function listSections(): string[];
32
+ /**
33
+ * Return the source of one prebuilt section component (the file the CLI's
34
+ * `add <name>` would drop into `components/sections/`), or `undefined`.
35
+ */
36
+ declare function getSection(name: string): string | undefined;
37
+ /**
38
+ * Generate a full project as an in-memory file map (relative path → contents).
39
+ *
40
+ * **Pure** — performs no disk or network I/O, so it runs the same in Node, an
41
+ * edge runtime or a browser bundle. Use it for previews, snapshot tests, a
42
+ * server-side zip download, or to post-process files before writing them.
43
+ */
44
+ declare function generateProject(options?: GenerateOptions): ProjectFiles;
45
+ /** Options for {@link scaffold} — {@link GenerateOptions} plus where to write. */
46
+ interface ScaffoldOptions extends GenerateOptions {
47
+ /** Base directory the project folder is created under. Default `process.cwd()`. */
48
+ cwd?: string;
49
+ /** Write directly into this directory instead of `<cwd>/<name>`. */
50
+ dir?: string;
51
+ }
52
+ /** What {@link scaffold} returns. */
53
+ interface ScaffoldResult {
54
+ /** Absolute path the project was written to. */
55
+ dir: string;
56
+ /** Relative paths of every file written. */
57
+ files: string[];
58
+ }
59
+ /**
60
+ * Generate a project and **write it to disk** (Node only).
61
+ *
62
+ * Writes to `options.dir` when given, otherwise to `<cwd>/<name>`. Creates
63
+ * parent directories as needed. Does not install dependencies or init git —
64
+ * compose those yourself, or use the CLI for the full interactive flow.
65
+ */
66
+ declare function scaffold(options?: ScaffoldOptions): Promise<ScaffoldResult>;
67
+
68
+ export { type GenerateOptions, type ProjectFiles, type ScaffoldOptions, type ScaffoldResult, type TemplateDef, generateProject, getSection, getTemplate, listSections, listTemplates, scaffold, templateKeys, templates };
package/dist/lib.d.ts ADDED
@@ -0,0 +1,68 @@
1
+ interface TemplateDef {
2
+ key: string;
3
+ label: string;
4
+ description: string;
5
+ /** Tailwind gradient accent (from → to). */
6
+ accent: [string, string];
7
+ siteName: string;
8
+ siteDescription: string;
9
+ }
10
+ /** Options accepted by the programmatic API (see `./lib`). */
11
+ interface GenerateOptions {
12
+ /** Project name — becomes the folder name and the default site name slug. Default `"my-app"`. */
13
+ name?: string;
14
+ /** Template key: one of {@link TEMPLATES} (`personal`, `business`, `ecommerce`, `saas`, `blog`, `docs`, `dashboard`, `restaurant`, `marketplace`). Default `"personal"`. */
15
+ template?: string;
16
+ /** Accent theme: a preset name, a `#hex`, or a `from,to` pair. Falls back to the template's default accent. */
17
+ theme?: string;
18
+ }
19
+
20
+ /** A project file map: relative path → file contents. */
21
+ type ProjectFiles = Record<string, string>;
22
+ /** The list of built-in templates, with their metadata. */
23
+ declare const templates: readonly TemplateDef[];
24
+ /** Every template key you can pass as `options.template`. */
25
+ declare const templateKeys: readonly string[];
26
+ /** Return the built-in templates (metadata: key, label, description, accent, defaults). */
27
+ declare function listTemplates(): TemplateDef[];
28
+ /** Look up one template's metadata by key, or `undefined`. */
29
+ declare function getTemplate(key: string): TemplateDef | undefined;
30
+ /** The names of every prebuilt section available (the CLI's `add <section>`). */
31
+ declare function listSections(): string[];
32
+ /**
33
+ * Return the source of one prebuilt section component (the file the CLI's
34
+ * `add <name>` would drop into `components/sections/`), or `undefined`.
35
+ */
36
+ declare function getSection(name: string): string | undefined;
37
+ /**
38
+ * Generate a full project as an in-memory file map (relative path → contents).
39
+ *
40
+ * **Pure** — performs no disk or network I/O, so it runs the same in Node, an
41
+ * edge runtime or a browser bundle. Use it for previews, snapshot tests, a
42
+ * server-side zip download, or to post-process files before writing them.
43
+ */
44
+ declare function generateProject(options?: GenerateOptions): ProjectFiles;
45
+ /** Options for {@link scaffold} — {@link GenerateOptions} plus where to write. */
46
+ interface ScaffoldOptions extends GenerateOptions {
47
+ /** Base directory the project folder is created under. Default `process.cwd()`. */
48
+ cwd?: string;
49
+ /** Write directly into this directory instead of `<cwd>/<name>`. */
50
+ dir?: string;
51
+ }
52
+ /** What {@link scaffold} returns. */
53
+ interface ScaffoldResult {
54
+ /** Absolute path the project was written to. */
55
+ dir: string;
56
+ /** Relative paths of every file written. */
57
+ files: string[];
58
+ }
59
+ /**
60
+ * Generate a project and **write it to disk** (Node only).
61
+ *
62
+ * Writes to `options.dir` when given, otherwise to `<cwd>/<name>`. Creates
63
+ * parent directories as needed. Does not install dependencies or init git —
64
+ * compose those yourself, or use the CLI for the full interactive flow.
65
+ */
66
+ declare function scaffold(options?: ScaffoldOptions): Promise<ScaffoldResult>;
67
+
68
+ export { type GenerateOptions, type ProjectFiles, type ScaffoldOptions, type ScaffoldResult, type TemplateDef, generateProject, getSection, getTemplate, listSections, listTemplates, scaffold, templateKeys, templates };