create-lacspace-app 2.5.0 → 2.7.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/lib.d.cts CHANGED
@@ -34,6 +34,39 @@ interface FeatureDef {
34
34
  nextSteps: string[];
35
35
  /** Optional "learn more" URL for `LEARN.md`. */
36
36
  learn?: string;
37
+ /**
38
+ * When true, this add-on needs the full-stack backend (a database + a real API).
39
+ * Requesting it in `static` mode automatically upgrades the project to `dynamic`.
40
+ */
41
+ requiresBackend?: boolean;
42
+ /**
43
+ * Optional backend (Express) contribution — applied **only in dynamic mode**.
44
+ * Lets an add-on drop backend files, register routes, add backend deps and
45
+ * document backend env vars. See {@link FeatureBackend}.
46
+ */
47
+ backend?: (ctx: Ctx) => FeatureBackend;
48
+ }
49
+ /** An add-on's contribution to the `backend/` workspace (dynamic mode only). */
50
+ interface FeatureBackend {
51
+ /** Files under `backend/` — e.g. `"src/routes/payments.ts"`, `"src/models/payment.ts"`. */
52
+ files?: Record<string, string>;
53
+ /** Extra backend deps, merged into `backend/package.json`. */
54
+ deps?: Record<string, string>;
55
+ /** Express route groups this add-on mounts (assembled in `src/routes/index.ts`). */
56
+ routes?: FeatureRoute[];
57
+ /** Extra root `.env.example` entries — `NAME: "explanatory comment"`. */
58
+ env?: Record<string, string>;
59
+ }
60
+ /** One Express route group registered by a backend add-on. */
61
+ interface FeatureRoute {
62
+ /** Mount path, e.g. `"/payments"`. */
63
+ path: string;
64
+ /** The exact import line, e.g. `import paymentRoutes from "./payments.js";`. */
65
+ importLine: string;
66
+ /** The router identifier used in `app.use`, e.g. `"paymentRoutes"`. */
67
+ handler: string;
68
+ /** Protect the group with the shared `requireAuth` middleware. */
69
+ auth?: boolean;
37
70
  }
38
71
  interface Ctx {
39
72
  name: string;
@@ -129,4 +162,4 @@ interface ScaffoldResult {
129
162
  */
130
163
  declare function scaffold(options?: ScaffoldOptions): Promise<ScaffoldResult>;
131
164
 
132
- export { type FeatureDef, type GenerateOptions, type ProjectFiles, type ScaffoldOptions, type ScaffoldResult, type TemplateDef, generateProject, getFeature, getSection, getTemplate, listFeatures, listSections, listTemplates, scaffold, templateKeys, templates };
165
+ export { type FeatureBackend, type FeatureDef, type FeatureRoute, 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
@@ -34,6 +34,39 @@ interface FeatureDef {
34
34
  nextSteps: string[];
35
35
  /** Optional "learn more" URL for `LEARN.md`. */
36
36
  learn?: string;
37
+ /**
38
+ * When true, this add-on needs the full-stack backend (a database + a real API).
39
+ * Requesting it in `static` mode automatically upgrades the project to `dynamic`.
40
+ */
41
+ requiresBackend?: boolean;
42
+ /**
43
+ * Optional backend (Express) contribution — applied **only in dynamic mode**.
44
+ * Lets an add-on drop backend files, register routes, add backend deps and
45
+ * document backend env vars. See {@link FeatureBackend}.
46
+ */
47
+ backend?: (ctx: Ctx) => FeatureBackend;
48
+ }
49
+ /** An add-on's contribution to the `backend/` workspace (dynamic mode only). */
50
+ interface FeatureBackend {
51
+ /** Files under `backend/` — e.g. `"src/routes/payments.ts"`, `"src/models/payment.ts"`. */
52
+ files?: Record<string, string>;
53
+ /** Extra backend deps, merged into `backend/package.json`. */
54
+ deps?: Record<string, string>;
55
+ /** Express route groups this add-on mounts (assembled in `src/routes/index.ts`). */
56
+ routes?: FeatureRoute[];
57
+ /** Extra root `.env.example` entries — `NAME: "explanatory comment"`. */
58
+ env?: Record<string, string>;
59
+ }
60
+ /** One Express route group registered by a backend add-on. */
61
+ interface FeatureRoute {
62
+ /** Mount path, e.g. `"/payments"`. */
63
+ path: string;
64
+ /** The exact import line, e.g. `import paymentRoutes from "./payments.js";`. */
65
+ importLine: string;
66
+ /** The router identifier used in `app.use`, e.g. `"paymentRoutes"`. */
67
+ handler: string;
68
+ /** Protect the group with the shared `requireAuth` middleware. */
69
+ auth?: boolean;
37
70
  }
38
71
  interface Ctx {
39
72
  name: string;
@@ -129,4 +162,4 @@ interface ScaffoldResult {
129
162
  */
130
163
  declare function scaffold(options?: ScaffoldOptions): Promise<ScaffoldResult>;
131
164
 
132
- export { type FeatureDef, type GenerateOptions, type ProjectFiles, type ScaffoldOptions, type ScaffoldResult, type TemplateDef, generateProject, getFeature, getSection, getTemplate, listFeatures, listSections, listTemplates, scaffold, templateKeys, templates };
165
+ export { type FeatureBackend, type FeatureDef, type FeatureRoute, type GenerateOptions, type ProjectFiles, type ScaffoldOptions, type ScaffoldResult, type TemplateDef, generateProject, getFeature, getSection, getTemplate, listFeatures, listSections, listTemplates, scaffold, templateKeys, templates };