create-lacspace-app 2.2.1 → 2.3.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/README.md +80 -1
- package/dist/index.js +671 -36
- package/dist/lib.cjs +679 -35
- package/dist/lib.d.cts +49 -1
- package/dist/lib.d.ts +49 -1
- package/dist/lib.js +678 -36
- package/package.json +1 -1
package/dist/lib.d.cts
CHANGED
|
@@ -7,6 +7,39 @@ interface TemplateDef {
|
|
|
7
7
|
siteName: string;
|
|
8
8
|
siteDescription: string;
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* A composable, optional feature add-on (see {@link FEATURES}).
|
|
12
|
+
*
|
|
13
|
+
* A feature is a small, self-contained bundle you can layer onto **any**
|
|
14
|
+
* template: extra files (namespaced under its own routes), npm dependencies,
|
|
15
|
+
* `package.json` scripts, `.env.example` entries and onboarding next-steps.
|
|
16
|
+
* Features are order-independent and never collide with the base scaffold.
|
|
17
|
+
*/
|
|
18
|
+
interface FeatureDef {
|
|
19
|
+
/** Stable key (used by `--with <key>` and `add <key>`). */
|
|
20
|
+
key: string;
|
|
21
|
+
/** Short human label. */
|
|
22
|
+
label: string;
|
|
23
|
+
/** One-line description (shown in the interactive picker & `--help`). */
|
|
24
|
+
description: string;
|
|
25
|
+
/** npm dependencies this feature adds, merged into `package.json`. */
|
|
26
|
+
deps: Record<string, string>;
|
|
27
|
+
/** The files this feature drops in, given the resolved {@link Ctx}. */
|
|
28
|
+
files: (ctx: Ctx) => Record<string, string>;
|
|
29
|
+
/** Optional `.env.example` entries — `NAME: "explanatory comment"`. */
|
|
30
|
+
env?: Record<string, string>;
|
|
31
|
+
/** Optional `package.json` scripts, merged in. */
|
|
32
|
+
scripts?: Record<string, string>;
|
|
33
|
+
/** Onboarding steps appended to the terminal output and `LEARN.md`. */
|
|
34
|
+
nextSteps: string[];
|
|
35
|
+
/** Optional "learn more" URL for `LEARN.md`. */
|
|
36
|
+
learn?: string;
|
|
37
|
+
}
|
|
38
|
+
interface Ctx {
|
|
39
|
+
name: string;
|
|
40
|
+
template: TemplateDef;
|
|
41
|
+
features: FeatureDef[];
|
|
42
|
+
}
|
|
10
43
|
/** Options accepted by the programmatic API (see `./lib`). */
|
|
11
44
|
interface GenerateOptions {
|
|
12
45
|
/** Project name — becomes the folder name and the default site name slug. Default `"my-app"`. */
|
|
@@ -15,6 +48,13 @@ interface GenerateOptions {
|
|
|
15
48
|
template?: string;
|
|
16
49
|
/** Accent theme: a preset name, a `#hex`, or a `from,to` pair. Falls back to the template's default accent. */
|
|
17
50
|
theme?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Optional composable feature add-ons (see {@link FEATURES}) — e.g.
|
|
53
|
+
* `["ai-chat", "rag"]`. Unknown keys are ignored; duplicates are de-duped.
|
|
54
|
+
* Purely additive: an empty (or omitted) list generates today's scaffold
|
|
55
|
+
* byte-for-byte.
|
|
56
|
+
*/
|
|
57
|
+
features?: string[];
|
|
18
58
|
}
|
|
19
59
|
|
|
20
60
|
/** A project file map: relative path → file contents. */
|
|
@@ -34,6 +74,14 @@ declare function listSections(): string[];
|
|
|
34
74
|
* `add <name>` would drop into `components/sections/`), or `undefined`.
|
|
35
75
|
*/
|
|
36
76
|
declare function getSection(name: string): string | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* The composable feature add-ons available (see {@link FeatureDef}) — the ones
|
|
79
|
+
* you can pass as `options.features` or request with the CLI's `--with <key>`.
|
|
80
|
+
* Returns copies, so mutating the result never affects the registry.
|
|
81
|
+
*/
|
|
82
|
+
declare function listFeatures(): FeatureDef[];
|
|
83
|
+
/** Look up one feature add-on's definition by key, or `undefined`. */
|
|
84
|
+
declare function getFeature(key: string): FeatureDef | undefined;
|
|
37
85
|
/**
|
|
38
86
|
* Generate a full project as an in-memory file map (relative path → contents).
|
|
39
87
|
*
|
|
@@ -65,4 +113,4 @@ interface ScaffoldResult {
|
|
|
65
113
|
*/
|
|
66
114
|
declare function scaffold(options?: ScaffoldOptions): Promise<ScaffoldResult>;
|
|
67
115
|
|
|
68
|
-
export { type GenerateOptions, type ProjectFiles, type ScaffoldOptions, type ScaffoldResult, type TemplateDef, generateProject, getSection, getTemplate, listSections, listTemplates, scaffold, templateKeys, templates };
|
|
116
|
+
export { type FeatureDef, type GenerateOptions, type ProjectFiles, type ScaffoldOptions, type ScaffoldResult, type TemplateDef, generateProject, getFeature, getSection, getTemplate, listFeatures, listSections, listTemplates, scaffold, templateKeys, templates };
|
package/dist/lib.d.ts
CHANGED
|
@@ -7,6 +7,39 @@ interface TemplateDef {
|
|
|
7
7
|
siteName: string;
|
|
8
8
|
siteDescription: string;
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* A composable, optional feature add-on (see {@link FEATURES}).
|
|
12
|
+
*
|
|
13
|
+
* A feature is a small, self-contained bundle you can layer onto **any**
|
|
14
|
+
* template: extra files (namespaced under its own routes), npm dependencies,
|
|
15
|
+
* `package.json` scripts, `.env.example` entries and onboarding next-steps.
|
|
16
|
+
* Features are order-independent and never collide with the base scaffold.
|
|
17
|
+
*/
|
|
18
|
+
interface FeatureDef {
|
|
19
|
+
/** Stable key (used by `--with <key>` and `add <key>`). */
|
|
20
|
+
key: string;
|
|
21
|
+
/** Short human label. */
|
|
22
|
+
label: string;
|
|
23
|
+
/** One-line description (shown in the interactive picker & `--help`). */
|
|
24
|
+
description: string;
|
|
25
|
+
/** npm dependencies this feature adds, merged into `package.json`. */
|
|
26
|
+
deps: Record<string, string>;
|
|
27
|
+
/** The files this feature drops in, given the resolved {@link Ctx}. */
|
|
28
|
+
files: (ctx: Ctx) => Record<string, string>;
|
|
29
|
+
/** Optional `.env.example` entries — `NAME: "explanatory comment"`. */
|
|
30
|
+
env?: Record<string, string>;
|
|
31
|
+
/** Optional `package.json` scripts, merged in. */
|
|
32
|
+
scripts?: Record<string, string>;
|
|
33
|
+
/** Onboarding steps appended to the terminal output and `LEARN.md`. */
|
|
34
|
+
nextSteps: string[];
|
|
35
|
+
/** Optional "learn more" URL for `LEARN.md`. */
|
|
36
|
+
learn?: string;
|
|
37
|
+
}
|
|
38
|
+
interface Ctx {
|
|
39
|
+
name: string;
|
|
40
|
+
template: TemplateDef;
|
|
41
|
+
features: FeatureDef[];
|
|
42
|
+
}
|
|
10
43
|
/** Options accepted by the programmatic API (see `./lib`). */
|
|
11
44
|
interface GenerateOptions {
|
|
12
45
|
/** Project name — becomes the folder name and the default site name slug. Default `"my-app"`. */
|
|
@@ -15,6 +48,13 @@ interface GenerateOptions {
|
|
|
15
48
|
template?: string;
|
|
16
49
|
/** Accent theme: a preset name, a `#hex`, or a `from,to` pair. Falls back to the template's default accent. */
|
|
17
50
|
theme?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Optional composable feature add-ons (see {@link FEATURES}) — e.g.
|
|
53
|
+
* `["ai-chat", "rag"]`. Unknown keys are ignored; duplicates are de-duped.
|
|
54
|
+
* Purely additive: an empty (or omitted) list generates today's scaffold
|
|
55
|
+
* byte-for-byte.
|
|
56
|
+
*/
|
|
57
|
+
features?: string[];
|
|
18
58
|
}
|
|
19
59
|
|
|
20
60
|
/** A project file map: relative path → file contents. */
|
|
@@ -34,6 +74,14 @@ declare function listSections(): string[];
|
|
|
34
74
|
* `add <name>` would drop into `components/sections/`), or `undefined`.
|
|
35
75
|
*/
|
|
36
76
|
declare function getSection(name: string): string | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* The composable feature add-ons available (see {@link FeatureDef}) — the ones
|
|
79
|
+
* you can pass as `options.features` or request with the CLI's `--with <key>`.
|
|
80
|
+
* Returns copies, so mutating the result never affects the registry.
|
|
81
|
+
*/
|
|
82
|
+
declare function listFeatures(): FeatureDef[];
|
|
83
|
+
/** Look up one feature add-on's definition by key, or `undefined`. */
|
|
84
|
+
declare function getFeature(key: string): FeatureDef | undefined;
|
|
37
85
|
/**
|
|
38
86
|
* Generate a full project as an in-memory file map (relative path → contents).
|
|
39
87
|
*
|
|
@@ -65,4 +113,4 @@ interface ScaffoldResult {
|
|
|
65
113
|
*/
|
|
66
114
|
declare function scaffold(options?: ScaffoldOptions): Promise<ScaffoldResult>;
|
|
67
115
|
|
|
68
|
-
export { type GenerateOptions, type ProjectFiles, type ScaffoldOptions, type ScaffoldResult, type TemplateDef, generateProject, getSection, getTemplate, listSections, listTemplates, scaffold, templateKeys, templates };
|
|
116
|
+
export { type FeatureDef, type GenerateOptions, type ProjectFiles, type ScaffoldOptions, type ScaffoldResult, type TemplateDef, generateProject, getFeature, getSection, getTemplate, listFeatures, listSections, listTemplates, scaffold, templateKeys, templates };
|