@decohere/create 0.0.1-dev.18 → 0.0.1-dev.20

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.
Files changed (124) hide show
  1. package/commonjs/src/cli.js +10 -6
  2. package/commonjs/src/domain/prompt.js +55 -0
  3. package/commonjs/src/models/package-json.model.js +2 -2
  4. package/commonjs/src/runner.js +56 -0
  5. package/commonjs/src/version.js +32 -0
  6. package/commonjs/src/webapi/features/auth.feature.js +2 -2
  7. package/commonjs/src/webapi/features/database.feature.js +3 -3
  8. package/commonjs/src/webapi/features/finalize.feature.js +11 -6
  9. package/commonjs/src/webapi/features/postman.feature.js +4 -4
  10. package/commonjs/src/webapi/models/api-package-json.model.js +2 -2
  11. package/es6/src/cli.js +10 -6
  12. package/es6/src/domain/prompt.js +37 -0
  13. package/es6/src/models/package-json.model.js +2 -2
  14. package/es6/src/runner.js +55 -0
  15. package/es6/src/version.js +22 -0
  16. package/es6/src/webapi/features/auth.feature.js +2 -2
  17. package/es6/src/webapi/features/database.feature.js +3 -3
  18. package/es6/src/webapi/features/finalize.feature.js +11 -6
  19. package/es6/src/webapi/features/postman.feature.js +4 -4
  20. package/es6/src/webapi/models/api-package-json.model.js +2 -2
  21. package/package.json +2 -2
  22. package/types/src/runner.d.ts +13 -0
  23. package/commonjs/v1/cli.js +0 -15
  24. package/commonjs/v1/domain/class-model.js +0 -106
  25. package/commonjs/v1/domain/compose.model.js +0 -74
  26. package/commonjs/v1/domain/context.js +0 -53
  27. package/commonjs/v1/domain/devcontainer.model.js +0 -116
  28. package/commonjs/v1/domain/dockerfile.model.js +0 -62
  29. package/commonjs/v1/domain/feature.js +0 -19
  30. package/commonjs/v1/domain/import-map.js +0 -74
  31. package/commonjs/v1/domain/index.js +0 -68
  32. package/commonjs/v1/domain/prompt.js +0 -45
  33. package/commonjs/v1/domain/workflow.js +0 -37
  34. package/commonjs/v1/features/api-core/feature.js +0 -103
  35. package/commonjs/v1/features/api-core/hello-controller.model.js +0 -100
  36. package/commonjs/v1/features/api-core/main-ts.model.js +0 -85
  37. package/commonjs/v1/features/api-core/scaffold-files.template.js +0 -158
  38. package/commonjs/v1/features/auth0/auth0-cli.js +0 -151
  39. package/commonjs/v1/features/auth0/feature.js +0 -187
  40. package/commonjs/v1/features/auth0/models.js +0 -14
  41. package/commonjs/v1/features/auth0/prod-config.template.js +0 -19
  42. package/commonjs/v1/features/cli-core/feature.js +0 -37
  43. package/commonjs/v1/features/cli-core/scaffold-files.template.js +0 -103
  44. package/commonjs/v1/features/devcontainer/feature.js +0 -38
  45. package/commonjs/v1/features/finalize/feature.js +0 -48
  46. package/commonjs/v1/features/postgresql/feature.js +0 -81
  47. package/commonjs/v1/features/postgresql/models.js +0 -14
  48. package/commonjs/v1/features/postman/collection.template.js +0 -80
  49. package/commonjs/v1/features/postman/environment.template.js +0 -24
  50. package/commonjs/v1/features/postman/feature.js +0 -192
  51. package/commonjs/v1/features/typeorm/feature.js +0 -66
  52. package/commonjs/v1/features/typeorm/scaffold-files.template.js +0 -80
  53. package/commonjs/v1/scaffold.js +0 -50
  54. package/commonjs/v1/version.js +0 -32
  55. package/commonjs/v1/workflows/api.js +0 -29
  56. package/commonjs/v1/workflows/cli.js +0 -19
  57. package/es6/v1/cli.js +0 -11
  58. package/es6/v1/domain/class-model.js +0 -104
  59. package/es6/v1/domain/compose.model.js +0 -61
  60. package/es6/v1/domain/context.js +0 -37
  61. package/es6/v1/domain/devcontainer.model.js +0 -104
  62. package/es6/v1/domain/dockerfile.model.js +0 -52
  63. package/es6/v1/domain/feature.js +0 -9
  64. package/es6/v1/domain/import-map.js +0 -64
  65. package/es6/v1/domain/index.js +0 -11
  66. package/es6/v1/domain/prompt.js +0 -27
  67. package/es6/v1/domain/workflow.js +0 -24
  68. package/es6/v1/features/api-core/feature.js +0 -93
  69. package/es6/v1/features/api-core/hello-controller.model.js +0 -96
  70. package/es6/v1/features/api-core/main-ts.model.js +0 -74
  71. package/es6/v1/features/api-core/scaffold-files.template.js +0 -116
  72. package/es6/v1/features/auth0/auth0-cli.js +0 -116
  73. package/es6/v1/features/auth0/feature.js +0 -136
  74. package/es6/v1/features/auth0/models.js +0 -4
  75. package/es6/v1/features/auth0/prod-config.template.js +0 -9
  76. package/es6/v1/features/cli-core/feature.js +0 -27
  77. package/es6/v1/features/cli-core/scaffold-files.template.js +0 -73
  78. package/es6/v1/features/devcontainer/feature.js +0 -28
  79. package/es6/v1/features/finalize/feature.js +0 -38
  80. package/es6/v1/features/postgresql/feature.js +0 -71
  81. package/es6/v1/features/postgresql/models.js +0 -4
  82. package/es6/v1/features/postman/collection.template.js +0 -70
  83. package/es6/v1/features/postman/environment.template.js +0 -14
  84. package/es6/v1/features/postman/feature.js +0 -141
  85. package/es6/v1/features/typeorm/feature.js +0 -56
  86. package/es6/v1/features/typeorm/scaffold-files.template.js +0 -56
  87. package/es6/v1/scaffold.js +0 -40
  88. package/es6/v1/version.js +0 -22
  89. package/es6/v1/workflows/api.js +0 -25
  90. package/es6/v1/workflows/cli.js +0 -9
  91. package/types/v1/cli.d.ts +0 -2
  92. package/types/v1/domain/class-model.d.ts +0 -70
  93. package/types/v1/domain/compose.model.d.ts +0 -25
  94. package/types/v1/domain/context.d.ts +0 -36
  95. package/types/v1/domain/devcontainer.model.d.ts +0 -35
  96. package/types/v1/domain/dockerfile.model.d.ts +0 -11
  97. package/types/v1/domain/feature.d.ts +0 -29
  98. package/types/v1/domain/import-map.d.ts +0 -24
  99. package/types/v1/domain/index.d.ts +0 -12
  100. package/types/v1/domain/workflow.d.ts +0 -14
  101. package/types/v1/features/api-core/feature.d.ts +0 -2
  102. package/types/v1/features/api-core/hello-controller.model.d.ts +0 -9
  103. package/types/v1/features/api-core/main-ts.model.d.ts +0 -31
  104. package/types/v1/features/api-core/scaffold-files.template.d.ts +0 -10
  105. package/types/v1/features/auth0/auth0-cli.d.ts +0 -22
  106. package/types/v1/features/auth0/feature.d.ts +0 -2
  107. package/types/v1/features/auth0/models.d.ts +0 -5
  108. package/types/v1/features/auth0/prod-config.template.d.ts +0 -1
  109. package/types/v1/features/cli-core/feature.d.ts +0 -2
  110. package/types/v1/features/cli-core/scaffold-files.template.d.ts +0 -6
  111. package/types/v1/features/devcontainer/feature.d.ts +0 -2
  112. package/types/v1/features/finalize/feature.d.ts +0 -2
  113. package/types/v1/features/postgresql/feature.d.ts +0 -2
  114. package/types/v1/features/postgresql/models.d.ts +0 -6
  115. package/types/v1/features/postman/collection.template.d.ts +0 -1
  116. package/types/v1/features/postman/environment.template.d.ts +0 -6
  117. package/types/v1/features/postman/feature.d.ts +0 -2
  118. package/types/v1/features/typeorm/feature.d.ts +0 -2
  119. package/types/v1/features/typeorm/scaffold-files.template.d.ts +0 -9
  120. package/types/v1/scaffold.d.ts +0 -3
  121. package/types/v1/workflows/api.d.ts +0 -8
  122. package/types/v1/workflows/cli.d.ts +0 -1
  123. /package/types/{v1 → src}/domain/prompt.d.ts +0 -0
  124. /package/types/{v1 → src}/version.d.ts +0 -0
@@ -1,25 +0,0 @@
1
- import { defineWorkflow } from "../domain/index.js";
2
- import { apiCoreFeature } from "../features/api-core/feature.js";
3
- import { auth0Feature } from "../features/auth0/feature.js";
4
- import { devcontainerFeature } from "../features/devcontainer/feature.js";
5
- import { finalizeFeature } from "../features/finalize/feature.js";
6
- import { postgresqlFeature } from "../features/postgresql/feature.js";
7
- import { postmanFeature } from "../features/postman/feature.js";
8
- import { typeormFeature } from "../features/typeorm/feature.js";
9
- /**
10
- * Order matters within each phase:
11
- * - apiCore must render before typeorm (typeorm reads the config.yaml that
12
- * apiCore writes).
13
- * - typeorm must render before auth0 (both append to config.prod.yaml; the
14
- * existing behaviour writes the database section first, then auth).
15
- */ export const apiWorkflow = defineWorkflow("api", [
16
- apiCoreFeature,
17
- typeormFeature,
18
- postgresqlFeature,
19
- auth0Feature,
20
- postmanFeature,
21
- devcontainerFeature,
22
- finalizeFeature
23
- ]);
24
-
25
- //# sourceMappingURL=data:application/json;base64,eyJ2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aEU7Ozs7OztDQU1DLEdBQ0QsT0FBTyxNQUFNQyxjQUFjUixlQUFlLE9BQU87SUFDaERDO0lBQ0FNO0lBQ0FGO0lBQ0FIO0lBQ0FJO0lBQ0FIO0lBQ0FDO0NBQ0EsRUFBRSJ9
@@ -1,9 +0,0 @@
1
- import { defineWorkflow } from "../domain/index.js";
2
- import { cliCoreFeature } from "../features/cli-core/feature.js";
3
- import { finalizeFeature } from "../features/finalize/feature.js";
4
- export const cliWorkflow = defineWorkflow("cli", [
5
- cliCoreFeature,
6
- finalizeFeature
7
- ]);
8
-
9
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL2RlY29oZXJlL2RlY29oZXJlL3Byb2plY3RzL2NyZWF0ZS92MS93b3JrZmxvd3MvY2xpLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGRlZmluZVdvcmtmbG93IH0gZnJvbSBcIi4uL2RvbWFpbi9pbmRleC5qc1wiO1xuaW1wb3J0IHsgY2xpQ29yZUZlYXR1cmUgfSBmcm9tIFwiLi4vZmVhdHVyZXMvY2xpLWNvcmUvZmVhdHVyZS5qc1wiO1xuaW1wb3J0IHsgZmluYWxpemVGZWF0dXJlIH0gZnJvbSBcIi4uL2ZlYXR1cmVzL2ZpbmFsaXplL2ZlYXR1cmUuanNcIjtcblxuZXhwb3J0IGNvbnN0IGNsaVdvcmtmbG93ID0gZGVmaW5lV29ya2Zsb3coXCJjbGlcIiwgW2NsaUNvcmVGZWF0dXJlLCBmaW5hbGl6ZUZlYXR1cmVdKTtcbiJdLCJuYW1lcyI6WyJkZWZpbmVXb3JrZmxvdyIsImNsaUNvcmVGZWF0dXJlIiwiZmluYWxpemVGZWF0dXJlIiwiY2xpV29ya2Zsb3ciXSwibWFwcGluZ3MiOiJBQUFBLFNBQVNBLGNBQWMsUUFBUSxxQkFBcUI7QUFDcEQsU0FBU0MsY0FBYyxRQUFRLGtDQUFrQztBQUNqRSxTQUFTQyxlQUFlLFFBQVEsa0NBQWtDO0FBRWxFLE9BQU8sTUFBTUMsY0FBY0gsZUFBZSxPQUFPO0lBQUNDO0lBQWdCQztDQUFnQixFQUFFIn0=
package/types/v1/cli.d.ts DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
@@ -1,70 +0,0 @@
1
- import { ImportMap } from "./import-map.js";
2
- export interface ConstructorParam {
3
- /** e.g. ["@inject(IPrincipalProviderToken)"] */
4
- paramDecorators: string[];
5
- name: string;
6
- typeName: string;
7
- isPrivate: boolean;
8
- isReadonly: boolean;
9
- }
10
- export interface MethodParam {
11
- /** e.g. `@Query("filter")` */
12
- decorator?: string;
13
- name: string;
14
- typeName: string;
15
- }
16
- export interface MethodDef {
17
- /** Base HTTP decorator(s), e.g. ["@Get()"]. Rendered bottom-most. */
18
- decorators: string[];
19
- name: string;
20
- isAsync?: boolean;
21
- params?: MethodParam[];
22
- body: string;
23
- }
24
- export interface BodyClassField {
25
- decorator: string;
26
- name: string;
27
- typeName: string;
28
- }
29
- export interface BodyClassDef {
30
- name: string;
31
- fields: BodyClassField[];
32
- }
33
- /**
34
- * A live, mutable model of a generated TypeScript class.
35
- *
36
- * Features call the fluent API to contribute imports, decorators, constructor
37
- * params, and method decorators. When all configure phases are done, `render()`
38
- * produces the final TypeScript source.
39
- *
40
- * Subclass to model controllers, services, repositories, etc.
41
- */
42
- export declare class ClassModel {
43
- readonly className: string;
44
- readonly fileName: string;
45
- protected readonly _imports: ImportMap;
46
- private readonly _classDecorators;
47
- private readonly _constructorParams;
48
- private readonly _bodyClasses;
49
- private readonly _methods;
50
- constructor(className: string, fileName: string);
51
- /**
52
- * Add named value imports from `pkg`.
53
- * Called with no names, registers a side-effect `import "pkg"`.
54
- */
55
- addImport(pkg: string, ...names: string[]): this;
56
- /** Add named type-only imports from `pkg`. */
57
- addTypeImport(pkg: string, ...names: string[]): this;
58
- /** Prepend a class-level decorator (goes above any already-registered ones). */
59
- decorateClass(decorator: string): this;
60
- addBodyClass(def: BodyClassDef): this;
61
- addConstructorParam(param: ConstructorParam): this;
62
- defineMethod(def: MethodDef): this;
63
- /**
64
- * Prepend a decorator onto an existing method.
65
- * Silently ignored if `methodName` is not found, so features are
66
- * resilient to controllers that don't expose a particular method.
67
- */
68
- decorateMethod(methodName: string, ...decorators: string[]): this;
69
- render(): string;
70
- }
@@ -1,25 +0,0 @@
1
- export declare const COMPOSE_KEY: import("./context.js").FeatureModelKey<ComposeModel>;
2
- export interface ComposeService {
3
- build?: string;
4
- image?: string;
5
- env_file?: string[];
6
- environment?: Record<string, string>;
7
- ports?: string[];
8
- volumes?: string[];
9
- command?: string;
10
- restart?: string;
11
- depends_on?: string[];
12
- }
13
- /**
14
- * Live builder for `docker-compose.yml`.
15
- *
16
- * Features call `addService` / `addVolume` in their `configure` phases.
17
- * The devcontainer `render` phase calls `render()` and writes the file.
18
- */
19
- export declare class ComposeModel {
20
- private readonly _services;
21
- private readonly _volumes;
22
- addService(name: string, config: ComposeService): this;
23
- addVolume(name: string): this;
24
- render(): string;
25
- }
@@ -1,36 +0,0 @@
1
- import type { ClassModel } from "./class-model.js";
2
- /** Type-safe key for a value in the FeatureModelStore. */
3
- export interface FeatureModelKey<T> {
4
- readonly _sym: symbol;
5
- readonly _type?: T;
6
- }
7
- export declare function modelKey<T>(name?: string): FeatureModelKey<T>;
8
- /**
9
- * Immutable typed store of feature models. Each feature defines its own keys
10
- * (typed via `modelKey<T>()`) and writes to / reads from the store during the
11
- * `configure` and `render` phases. The store is the only mechanism by which
12
- * features communicate.
13
- */
14
- export declare class FeatureModelStore {
15
- private readonly _store;
16
- constructor(store?: ReadonlyMap<symbol, unknown>);
17
- get<T>(key: FeatureModelKey<T>): T | undefined;
18
- set<T>(key: FeatureModelKey<T>, value: T): FeatureModelStore;
19
- }
20
- export interface ScaffoldOptions {
21
- yes?: boolean;
22
- template?: "api" | "cli";
23
- database?: "typeorm";
24
- idp?: "auth0";
25
- postman?: boolean;
26
- }
27
- export interface ScaffoldContext {
28
- projectName: string;
29
- targetDir: string;
30
- opts: ScaffoldOptions;
31
- template: "api" | "cli";
32
- models: FeatureModelStore;
33
- /** Live controller models that features contribute to during configure. */
34
- controllers: ClassModel[];
35
- }
36
- export declare function createContext(targetDir: string, opts: ScaffoldOptions, template?: "api" | "cli"): ScaffoldContext;
@@ -1,35 +0,0 @@
1
- import { DockerfileModel } from "./dockerfile.model.js";
2
- export declare const DEVCONTAINER_KEY: import("./context.js").FeatureModelKey<DevcontainerModel>;
3
- /**
4
- * Live builder for `.devcontainer/devcontainer.json`.
5
- *
6
- * The api-core feature creates an instance in its `configure` phase.
7
- * Other features (typeorm, auth0, …) call `addExtension` / `addFeature` / etc.
8
- * in their own `configure` phases. The devcontainer `render` phase calls `render()`.
9
- */
10
- export declare class DevcontainerModel {
11
- private readonly _name;
12
- private _image;
13
- private _composeFile;
14
- private _composeService;
15
- private _dockerfile;
16
- private readonly _extensions;
17
- private readonly _ports;
18
- private readonly _postCreateCommands;
19
- private readonly _postStartCommands;
20
- private readonly _devcontainerFeatures;
21
- constructor(name: string, image?: string);
22
- get image(): string;
23
- setImage(image: string): this;
24
- /** Switch to Docker Compose mode. Call from a feature that adds a compose service. */
25
- useCompose(file?: string, service?: string): this;
26
- /** The Dockerfile model, available only when in compose mode. */
27
- get dockerfile(): DockerfileModel | null;
28
- addExtension(...ids: string[]): this;
29
- forwardPort(...ports: number[]): this;
30
- addPostCreateCommand(cmd: string): this;
31
- addPostStartCommand(cmd: string): this;
32
- /** Add a devcontainer Feature, e.g. `ghcr.io/devcontainers/features/node:1`. */
33
- addFeature(id: string, options?: Record<string, unknown>): this;
34
- render(): string;
35
- }
@@ -1,11 +0,0 @@
1
- export declare class DockerfileModel {
2
- private readonly _baseImage;
3
- private readonly _runs;
4
- constructor(baseImage?: string);
5
- /**
6
- * Append a RUN instruction executed as root, inserted after the base
7
- * toolchain setup and before the USER switch.
8
- */
9
- addRun(cmd: string): this;
10
- render(): string;
11
- }
@@ -1,29 +0,0 @@
1
- import type { ScaffoldContext } from "./context.js";
2
- export type ScaffoldStep = (ctx: ScaffoldContext) => Promise<ScaffoldContext>;
3
- /**
4
- * A Feature is a self-contained unit of scaffolding behavior. Each feature
5
- * may contribute to one or more phases. Phases run in order across all
6
- * features, so any cross-feature dependency on shared models is naturally
7
- * satisfied (e.g. `typeorm.configure` runs before `apiCore.render`).
8
- *
9
- * Phases (in execution order):
10
- * 1. resolve — interactive prompts; may update ctx.opts or seed models
11
- * 2. configure — pure model contributions to the FeatureModelStore
12
- * 3. render — read models, write files to disk
13
- * 4. integrate — external system calls (CLI binaries, REST APIs)
14
- * 5. finalize — install deps, print next steps, etc.
15
- *
16
- * `enabled(ctx)` is re-evaluated before each phase so features can opt in
17
- * based on options set by earlier `resolve` phases.
18
- */
19
- export interface Feature {
20
- name: string;
21
- enabled?: (ctx: ScaffoldContext) => boolean;
22
- resolve?: ScaffoldStep;
23
- configure?: ScaffoldStep;
24
- render?: ScaffoldStep;
25
- integrate?: ScaffoldStep;
26
- finalize?: ScaffoldStep;
27
- }
28
- export type Phase = "resolve" | "configure" | "render" | "integrate" | "finalize";
29
- export declare const PHASES: readonly Phase[];
@@ -1,24 +0,0 @@
1
- /**
2
- * Groups imports from the same package, rendering mixed value+type imports
3
- * as `import { A, type B } from "pkg"` rather than two separate statements.
4
- */
5
- export declare class ImportMap {
6
- private readonly _packages;
7
- private _entry;
8
- /**
9
- * Add named value imports.
10
- * Called with no names, registers a side-effect `import "pkg"`.
11
- */
12
- add(pkg: string, ...names: string[]): this;
13
- /** Add type-only named imports. */
14
- addType(pkg: string, ...names: string[]): this;
15
- /**
16
- * Render to an array of import statement strings (insertion order preserved).
17
- *
18
- * - All-type package → `import type { A, B } from "pkg";`
19
- * - All-value package → `import { A, B } from "pkg";`
20
- * - Mixed package → `import { A, type B } from "pkg";`
21
- * - Side-effect only → `import "pkg";`
22
- */
23
- render(): string[];
24
- }
@@ -1,12 +0,0 @@
1
- export { type BodyClassDef, type BodyClassField, ClassModel, type ConstructorParam, type MethodDef, type MethodParam, } from "./class-model.js";
2
- export { COMPOSE_KEY, ComposeModel, type ComposeService } from "./compose.model.js";
3
- export type { FeatureModelKey, ScaffoldContext, ScaffoldOptions, } from "./context.js";
4
- export { createContext, FeatureModelStore, modelKey } from "./context.js";
5
- export { DEVCONTAINER_KEY, DevcontainerModel } from "./devcontainer.model.js";
6
- export { DockerfileModel } from "./dockerfile.model.js";
7
- export type { Feature, Phase, ScaffoldStep } from "./feature.js";
8
- export { PHASES } from "./feature.js";
9
- export { ImportMap } from "./import-map.js";
10
- export { ask, pick } from "./prompt.js";
11
- export type { Workflow } from "./workflow.js";
12
- export { defineWorkflow, runWorkflow } from "./workflow.js";
@@ -1,14 +0,0 @@
1
- import type { ScaffoldContext } from "./context.js";
2
- import { type Feature } from "./feature.js";
3
- export interface Workflow {
4
- readonly name: string;
5
- readonly features: readonly Feature[];
6
- }
7
- export declare function defineWorkflow(name: string, features: Feature[]): Workflow;
8
- /**
9
- * Runs a workflow by iterating phases × features. Within each phase, every
10
- * enabled feature's step for that phase is executed in feature order. The
11
- * `enabled` predicate is re-evaluated before each phase so a feature can
12
- * become active based on options set by earlier `resolve` phases.
13
- */
14
- export declare function runWorkflow(workflow: Workflow, ctx: ScaffoldContext): Promise<void>;
@@ -1,2 +0,0 @@
1
- import { type Feature } from "../../domain/index.js";
2
- export declare const apiCoreFeature: Feature;
@@ -1,9 +0,0 @@
1
- import { ClassModel } from "../../domain/class-model.js";
2
- /**
3
- * Create the seed controller scaffolded into every new api project.
4
- *
5
- * Defines only the base CRUD structure. Auth decorators, IPrincipalProvider
6
- * injection, and other cross-cutting concerns are added by the relevant
7
- * feature during its configure phase.
8
- */
9
- export declare function createHelloController(): ClassModel;
@@ -1,31 +0,0 @@
1
- import type { ClassModel } from "../../domain/class-model.js";
2
- /** Key for retrieving the MainTsModel from the FeatureModelStore. */
3
- export declare const MAIN_TS_KEY: import("../../domain/context.js").FeatureModelKey<MainTsModel>;
4
- /**
5
- * Live builder for `projects/api/src/main.ts`.
6
- *
7
- * The api-core feature creates an instance in its `configure` phase.
8
- * Other features (typeorm, auth0, …) call `addImport` / `appendBuilderChain`
9
- * in their own `configure` phases. The api-core `render` phase calls
10
- * `addController(model)` for each controller, then `render()`.
11
- */
12
- export declare class MainTsModel {
13
- private readonly _applicationName;
14
- private readonly _imports;
15
- private readonly _builderChain;
16
- private readonly _controllers;
17
- constructor(applicationName: string);
18
- /** Add named value imports (or side-effect when called with no names). */
19
- addImport(pkg: string, ...names: string[]): this;
20
- /** Add named type-only imports. */
21
- addTypeImport(pkg: string, ...names: string[]): this;
22
- /**
23
- * Append a builder chain call inserted between `.withServices(…)` and
24
- * `.withControllers(…)`. Pass the call with its leading dot,
25
- * e.g. `.withTypeOrm({ … })`.
26
- */
27
- appendBuilderChain(call: string): this;
28
- /** Register a controller; adds its import and queues it for withControllers(). */
29
- addController(model: ClassModel): this;
30
- render(): string;
31
- }
@@ -1,10 +0,0 @@
1
- export declare function rootPackageJson(name: string): string;
2
- export declare function apiPackageJson(name: string): string;
3
- export declare const TSCONFIG: string;
4
- export declare const VSCODE_LAUNCH_JSON: string;
5
- export declare function vscodeSettingsJson(name: string): string;
6
- export declare const GITIGNORE = "node_modules/\ndist/\n.env.local\n.pnpm-store\n";
7
- export declare function configYaml(): string;
8
- export declare const CONFIG_DEV_YAML = "sample:\n greeting: Hello from dev configuration!\n";
9
- export declare const SAMPLE_CONFIG_TS = "export class SampleConfig {\n\tpublic greeting: string = \"\";\n}\n";
10
- export declare const SAMPLE_SERVICE_TS = "import { inject, injectable } from \"@decohere/crucible/decorators\";\nimport { ConfigurationServiceToken } from \"@decohere/nexus/configuration\";\nimport type { IConfigurationService } from \"@decohere/nexus/configuration\";\nimport { SampleConfig } from \"./sample.config.js\";\n\n@injectable()\nexport class SampleService {\n\tpublic constructor(\n\t\t@inject(ConfigurationServiceToken) private readonly config: IConfigurationService,\n\t) {}\n\n\tpublic async getGreeting(): Promise<string> {\n\t\tconst config = await this.config.get(SampleConfig);\n\t\treturn config.greeting;\n\t}\n}\n";
@@ -1,22 +0,0 @@
1
- declare const REQUIRED_SCOPES = "create:clients";
2
- export declare class Auth0AuthError extends Error {
3
- constructor(message: string);
4
- }
5
- export interface Auth0Tenant {
6
- name: string;
7
- active?: boolean;
8
- }
9
- export declare function isInstalled(): boolean;
10
- export declare function listTenants(): Auth0Tenant[];
11
- export declare function login(): boolean;
12
- export declare function listApis(): Array<{
13
- identifier: string;
14
- name: string;
15
- }>;
16
- export declare function createApi(name: string, identifier: string): {
17
- identifier: string;
18
- };
19
- export declare function createSpaApp(name: string, callbackUrl: string): {
20
- client_id: string;
21
- };
22
- export { REQUIRED_SCOPES };
@@ -1,2 +0,0 @@
1
- import { type Feature } from "../../domain/index.js";
2
- export declare const auth0Feature: Feature;
@@ -1,5 +0,0 @@
1
- export interface Auth0Config {
2
- issuerBaseUrl: string;
3
- audience: string;
4
- }
5
- export declare const AUTH0_CONFIG_KEY: import("../../domain/context.js").FeatureModelKey<Auth0Config>;
@@ -1 +0,0 @@
1
- export declare function auth0ConfigYaml(issuerBaseUrl?: string, audience?: string): string;
@@ -1,2 +0,0 @@
1
- import type { Feature } from "../../domain/index.js";
2
- export declare const cliCoreFeature: Feature;
@@ -1,6 +0,0 @@
1
- export declare const TSCONFIG: string;
2
- export declare const VSCODE_LAUNCH_JSON: string;
3
- export declare function rootPackageJson(name: string): string;
4
- export declare function appPackageJson(name: string): string;
5
- export declare function vscodeSettingsJson(name: string): string;
6
- export declare const MAIN_TS = "console.log(\"Hello from Decohere!\");\n";
@@ -1,2 +0,0 @@
1
- import type { Feature } from "../../domain/index.js";
2
- export declare const devcontainerFeature: Feature;
@@ -1,2 +0,0 @@
1
- import { type Feature } from "../../domain/index.js";
2
- export declare const finalizeFeature: Feature;
@@ -1,2 +0,0 @@
1
- import type { Feature } from "../../domain/index.js";
2
- export declare const postgresqlFeature: Feature;
@@ -1,6 +0,0 @@
1
- export interface PostgresCreds {
2
- db: string;
3
- user: string;
4
- password: string;
5
- }
6
- export declare const POSTGRES_CREDS_KEY: import("../../domain/context.js").FeatureModelKey<PostgresCreds>;
@@ -1 +0,0 @@
1
- export declare function buildPostmanCollection(projectName: string, withAuth0: boolean): unknown;
@@ -1,6 +0,0 @@
1
- export interface PostmanEnvOptions {
2
- auth0Domain?: string;
3
- auth0Audience?: string;
4
- auth0ClientId?: string;
5
- }
6
- export declare function postmanEnvironmentYaml(name: string, opts?: PostmanEnvOptions): string;
@@ -1,2 +0,0 @@
1
- import { type Feature } from "../../domain/index.js";
2
- export declare const postmanFeature: Feature;
@@ -1,2 +0,0 @@
1
- import type { Feature } from "../../domain/index.js";
2
- export declare const typeormFeature: Feature;
@@ -1,9 +0,0 @@
1
- export declare const SAMPLE_ENTITY_TS = "import { Column, Entity, PrimaryGeneratedColumn } from \"typeorm\";\nimport type { Entity as IEntity } from \"@decohere/codex\";\n\n@Entity()\nexport class SampleEntity implements IEntity {\n\t@PrimaryGeneratedColumn()\n\tpublic id!: number;\n\n\t@Column()\n\tpublic name!: string;\n}\n";
2
- export declare const SAMPLE_REPOSITORY_TS = "import { injectable } from \"@decohere/crucible/decorators\";\nimport { injectUnitOfWork } from \"@decohere/codex\";\nimport { TypeOrmRepository, TypeOrmUnitOfWork } from \"@decohere/codex-typeorm\";\nimport { SampleEntity } from \"../entities/sample.entity.js\";\n\n@injectable()\nexport class SampleEntityRepository extends TypeOrmRepository<SampleEntity> {\n\tpublic constructor(@injectUnitOfWork() unitOfWork: TypeOrmUnitOfWork) {\n\t\tsuper(unitOfWork, SampleEntity);\n\t}\n}\n";
3
- export interface DbDevCreds {
4
- db?: string;
5
- user?: string;
6
- password?: string;
7
- }
8
- export declare function databaseDevConfigYaml(name: string, creds?: DbDevCreds): string;
9
- export declare const DATABASE_BASE_CONFIG_YAML = "database:\n dataSources:\n - name: default\n provider: postgres\n host: ${DB_HOST}\n port: ${DB_PORT}\n database: ${DB_NAME}\n username: ${DB_USER}\n password: ${DB_PASSWORD}\n synchronize: false\n seed: false\n adminUser: ${DB_ADMIN_USER}\n adminPassword: ${DB_ADMIN_PASSWORD}\n";
@@ -1,3 +0,0 @@
1
- import { type ScaffoldOptions } from "./domain/index.js";
2
- export type { ScaffoldOptions };
3
- export declare function scaffold(targetDir: string, opts: ScaffoldOptions): Promise<void>;
@@ -1,8 +0,0 @@
1
- /**
2
- * Order matters within each phase:
3
- * - apiCore must render before typeorm (typeorm reads the config.yaml that
4
- * apiCore writes).
5
- * - typeorm must render before auth0 (both append to config.prod.yaml; the
6
- * existing behaviour writes the database section first, then auth).
7
- */
8
- export declare const apiWorkflow: import("../domain/workflow.js").Workflow;
@@ -1 +0,0 @@
1
- export declare const cliWorkflow: import("../domain/workflow.js").Workflow;
File without changes
File without changes