@decohere/create 0.0.1-dev.47 → 0.0.1-dev.49

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 +3 -3
  2. package/commonjs/src/resolve-launch.js +53 -0
  3. package/commonjs/src/runner.js +5 -45
  4. package/commonjs/src/version.js +1 -1
  5. package/es6/src/cli.js +3 -3
  6. package/es6/src/resolve-launch.js +46 -0
  7. package/es6/src/runner.js +8 -57
  8. package/es6/src/version.js +3 -3
  9. package/pack-builder-tgz.mjs +19 -35
  10. package/package.json +4 -11
  11. package/types/src/resolve-launch.d.ts +10 -0
  12. package/types/src/runner.d.ts +3 -13
  13. package/types/src/version.d.ts +0 -2
  14. package/commonjs/src/domain/prompt.js +0 -64
  15. package/commonjs/src/models/compose.model.js +0 -138
  16. package/commonjs/src/models/config-yaml.model.js +0 -88
  17. package/commonjs/src/models/const.js +0 -31
  18. package/commonjs/src/models/dev-container.model.js +0 -100
  19. package/commonjs/src/models/docker-image.model.js +0 -221
  20. package/commonjs/src/models/env-file.model.js +0 -47
  21. package/commonjs/src/models/gitignore.model.js +0 -31
  22. package/commonjs/src/models/launch-json.model.js +0 -74
  23. package/commonjs/src/models/package-json.model.js +0 -133
  24. package/commonjs/src/models/project.model.js +0 -134
  25. package/commonjs/src/models/source-file.js +0 -6
  26. package/commonjs/src/models/tsconfig.model.js +0 -34
  27. package/commonjs/src/models/vscode-settings.model.js +0 -31
  28. package/commonjs/src/program.js +0 -135
  29. package/commonjs/src/resolve-target-dir.js +0 -19
  30. package/commonjs/src/services/scaffold.service.js +0 -62
  31. package/commonjs/src/webapi/api-name.js +0 -95
  32. package/commonjs/src/webapi/const.js +0 -50
  33. package/commonjs/src/webapi/create-api.js +0 -285
  34. package/commonjs/src/webapi/features/auth.feature.js +0 -463
  35. package/commonjs/src/webapi/features/auth0-cli.js +0 -406
  36. package/commonjs/src/webapi/features/biome-format.js +0 -49
  37. package/commonjs/src/webapi/features/database.feature.js +0 -273
  38. package/commonjs/src/webapi/features/finalize.feature.js +0 -91
  39. package/commonjs/src/webapi/features/postman.feature.js +0 -319
  40. package/commonjs/src/webapi/models/api-package-json.model.js +0 -63
  41. package/commonjs/src/webapi/models/auth-config.model.js +0 -26
  42. package/commonjs/src/webapi/models/controller-source-file.model.js +0 -188
  43. package/commonjs/src/webapi/models/github-ci.model.js +0 -193
  44. package/commonjs/src/webapi/models/main-source-file.model.js +0 -165
  45. package/commonjs/src/webapi/models/production-dockerfile.model.js +0 -138
  46. package/commonjs/src/webapi/models/sample-files.model.js +0 -60
  47. package/commonjs/src/webapi/models/webapi-image.model.js +0 -22
  48. package/commonjs/src/webapi/postman/hello-openapi.js +0 -175
  49. package/commonjs/src/webapi/postman/local-view.js +0 -184
  50. package/commonjs/src/webapi/postman/openapi-to-postman.js +0 -202
  51. package/es6/src/domain/prompt.js +0 -43
  52. package/es6/src/models/compose.model.js +0 -132
  53. package/es6/src/models/config-yaml.model.js +0 -76
  54. package/es6/src/models/const.js +0 -21
  55. package/es6/src/models/dev-container.model.js +0 -90
  56. package/es6/src/models/docker-image.model.js +0 -185
  57. package/es6/src/models/env-file.model.js +0 -43
  58. package/es6/src/models/gitignore.model.js +0 -21
  59. package/es6/src/models/launch-json.model.js +0 -64
  60. package/es6/src/models/package-json.model.js +0 -129
  61. package/es6/src/models/project.model.js +0 -119
  62. package/es6/src/models/source-file.js +0 -3
  63. package/es6/src/models/tsconfig.model.js +0 -24
  64. package/es6/src/models/vscode-settings.model.js +0 -21
  65. package/es6/src/program.js +0 -76
  66. package/es6/src/resolve-target-dir.js +0 -9
  67. package/es6/src/services/scaffold.service.js +0 -52
  68. package/es6/src/webapi/api-name.js +0 -59
  69. package/es6/src/webapi/const.js +0 -20
  70. package/es6/src/webapi/create-api.js +0 -265
  71. package/es6/src/webapi/features/auth.feature.js +0 -412
  72. package/es6/src/webapi/features/auth0-cli.js +0 -348
  73. package/es6/src/webapi/features/biome-format.js +0 -42
  74. package/es6/src/webapi/features/database.feature.js +0 -263
  75. package/es6/src/webapi/features/finalize.feature.js +0 -81
  76. package/es6/src/webapi/features/postman.feature.js +0 -253
  77. package/es6/src/webapi/models/api-package-json.model.js +0 -58
  78. package/es6/src/webapi/models/auth-config.model.js +0 -22
  79. package/es6/src/webapi/models/controller-source-file.model.js +0 -179
  80. package/es6/src/webapi/models/github-ci.model.js +0 -186
  81. package/es6/src/webapi/models/main-source-file.model.js +0 -161
  82. package/es6/src/webapi/models/production-dockerfile.model.js +0 -126
  83. package/es6/src/webapi/models/sample-files.model.js +0 -42
  84. package/es6/src/webapi/models/webapi-image.model.js +0 -12
  85. package/es6/src/webapi/postman/hello-openapi.js +0 -168
  86. package/es6/src/webapi/postman/local-view.js +0 -169
  87. package/es6/src/webapi/postman/openapi-to-postman.js +0 -179
  88. package/types/src/domain/prompt.d.ts +0 -4
  89. package/types/src/models/compose.model.d.ts +0 -59
  90. package/types/src/models/config-yaml.model.d.ts +0 -27
  91. package/types/src/models/const.d.ts +0 -19
  92. package/types/src/models/dev-container.model.d.ts +0 -33
  93. package/types/src/models/docker-image.model.d.ts +0 -56
  94. package/types/src/models/env-file.model.d.ts +0 -15
  95. package/types/src/models/gitignore.model.d.ts +0 -6
  96. package/types/src/models/launch-json.model.d.ts +0 -7
  97. package/types/src/models/package-json.model.d.ts +0 -32
  98. package/types/src/models/project.model.d.ts +0 -60
  99. package/types/src/models/source-file.d.ts +0 -11
  100. package/types/src/models/tsconfig.model.d.ts +0 -5
  101. package/types/src/models/vscode-settings.model.d.ts +0 -7
  102. package/types/src/program.d.ts +0 -3
  103. package/types/src/resolve-target-dir.d.ts +0 -5
  104. package/types/src/services/scaffold.service.d.ts +0 -22
  105. package/types/src/webapi/api-name.d.ts +0 -14
  106. package/types/src/webapi/const.d.ts +0 -17
  107. package/types/src/webapi/create-api.d.ts +0 -15
  108. package/types/src/webapi/features/auth.feature.d.ts +0 -10
  109. package/types/src/webapi/features/auth0-cli.d.ts +0 -72
  110. package/types/src/webapi/features/biome-format.d.ts +0 -5
  111. package/types/src/webapi/features/database.feature.d.ts +0 -5
  112. package/types/src/webapi/features/finalize.feature.d.ts +0 -2
  113. package/types/src/webapi/features/postman.feature.d.ts +0 -16
  114. package/types/src/webapi/models/api-package-json.model.d.ts +0 -18
  115. package/types/src/webapi/models/auth-config.model.d.ts +0 -26
  116. package/types/src/webapi/models/controller-source-file.model.d.ts +0 -45
  117. package/types/src/webapi/models/github-ci.model.d.ts +0 -9
  118. package/types/src/webapi/models/main-source-file.model.d.ts +0 -54
  119. package/types/src/webapi/models/production-dockerfile.model.d.ts +0 -20
  120. package/types/src/webapi/models/sample-files.model.d.ts +0 -7
  121. package/types/src/webapi/models/webapi-image.model.d.ts +0 -5
  122. package/types/src/webapi/postman/hello-openapi.d.ts +0 -19
  123. package/types/src/webapi/postman/local-view.d.ts +0 -17
  124. package/types/src/webapi/postman/openapi-to-postman.d.ts +0 -62
@@ -1,54 +0,0 @@
1
- import type { KeyedModel, SourceFile } from "../../models/source-file.js";
2
- export type TypeOrmImport = {
3
- className: string;
4
- importPath: string;
5
- };
6
- export type ServiceImport = TypeOrmImport & {
7
- scope?: "singleton" | "request";
8
- };
9
- /**
10
- * Model for `projects/api/src/main.ts`.
11
- *
12
- * Starts with the minimal HTTP + YAML config setup. Features mutate the model
13
- * by calling addSideEffectImport / addImport / addBuilderCall / addEntity /
14
- * addRepository. files() renders whatever has been accumulated.
15
- */
16
- export declare class MainSourceFile implements KeyedModel {
17
- private readonly appName;
18
- readonly key: string;
19
- private readonly _sideEffectImports;
20
- private readonly _extraImports;
21
- private readonly _builderCalls;
22
- private readonly _entities;
23
- private readonly _repositories;
24
- private readonly _services;
25
- private _dataSourceName;
26
- private _typeOrmSeed;
27
- constructor(appName: string);
28
- /** Adds a bare side-effect import, e.g. `@decohere/cortex/auth`. */
29
- addSideEffectImport(path: string): this;
30
- /** Adds a named import, e.g. `import { Foo } from "bar"`. */
31
- addImport(name: string, from: string, typeOnly?: boolean): this;
32
- /**
33
- * Adds a builder call inserted after `.withConfiguration()` and before
34
- * `.withServices()`. Pass the call without leading dot, e.g. `.withAuth()`.
35
- */
36
- addBuilderCall(call: string): this;
37
- /** Adds a TypeORM entity — import and entry in `withTypeOrm({ entities })`. */
38
- addEntity(entity: TypeOrmImport): this;
39
- /** Adds a TypeORM repository — import and entry in `withTypeOrm({ repositories })`. */
40
- addRepository(repo: TypeOrmImport): this;
41
- /** Adds a service registered in `.withServices()`. */
42
- addService(service: ServiceImport): this;
43
- /**
44
- * Datasource name passed to `withTypeOrm({ name })`. Must match
45
- * `database.dataSources[].name` in config.yaml.
46
- */
47
- setDataSourceName(name: string): this;
48
- /**
49
- * Inline seed callback body for `withTypeOrm({ seed })`.
50
- * Receives `dataSource` in scope. Example: `await dataSource.getRepository(User).save(...)`.
51
- */
52
- setTypeOrmSeed(seedBody: string): this;
53
- files(): SourceFile[];
54
- }
@@ -1,20 +0,0 @@
1
- import type { KeyedModel, SourceFile } from "../../models/source-file.js";
2
- export type ProductionDockerfileOptions = {
3
- /** When true, only write `Dockerfile.<name>` (existing workspace — do not replace root Dockerfile). */
4
- namedOnly?: boolean;
5
- };
6
- /**
7
- * Production Dockerfiles for PaaS (Railway/Fly) and local `docker build`.
8
- *
9
- * Context is always the **repo root** (`docker build -f Dockerfile.billing .`).
10
- * Root `Dockerfile` is the first API (`pnpm start`). Extra or custom-named APIs
11
- * also get `Dockerfile.<name>` so each service can be deployed on its own.
12
- */
13
- export declare class WebapiProductionDockerfile implements KeyedModel {
14
- private readonly apiNames;
15
- private readonly options;
16
- readonly key: string;
17
- constructor(apiNames?: readonly string[], options?: ProductionDockerfileOptions);
18
- files(): SourceFile[];
19
- }
20
- export declare function renderProductionDockerfile(apiName: string, startScript: string): string;
@@ -1,7 +0,0 @@
1
- import type { SourceFile, SourceFileProvider } from "../../models/source-file.js";
2
- export declare class SampleConfigModel implements SourceFileProvider {
3
- files(): SourceFile[];
4
- }
5
- export declare class SampleServiceModel implements SourceFileProvider {
6
- files(): SourceFile[];
7
- }
@@ -1,5 +0,0 @@
1
- import { DevContainerImageModel } from "../../models/docker-image.model.js";
2
- export declare class WebapiDevContainer extends DevContainerImageModel {
3
- constructor(baseImage?: string);
4
- protected registerBaseLayers(): void;
5
- }
@@ -1,19 +0,0 @@
1
- /** Minimal OpenAPI 3 document shape used for Postman conversion. */
2
- export type ScaffoldOpenApiDocument = {
3
- openapi: "3.0.3";
4
- info: {
5
- title: string;
6
- version: string;
7
- description?: string;
8
- };
9
- servers?: Array<{
10
- url: string;
11
- description?: string;
12
- }>;
13
- paths: Record<string, Record<string, unknown>>;
14
- };
15
- /**
16
- * Canonical Hello WebAPI OpenAPI document used to generate Postman requests.
17
- * Keep paths aligned with scaffolded HelloController (`/hello`, `/hello/{id}`).
18
- */
19
- export declare function buildHelloOpenApiDocument(projectName: string): ScaffoldOpenApiDocument;
@@ -1,17 +0,0 @@
1
- import { type Auth0Env, type PostmanCollection } from "./openapi-to-postman.js";
2
- /** Local View / Native Git environment (YAML). */
3
- export declare function buildEnvironmentYaml(name: string, auth: Auth0Env | undefined, options: {
4
- callbacks: readonly string[];
5
- scopes: string;
6
- }): string;
7
- /**
8
- * Build Postman Local View multi-file YAML from a v2.1 collection (routes)
9
- * plus hand-authored Auth0 overlay.
10
- */
11
- export declare function buildLocalViewFilesFromCollection(collection: PostmanCollection, projectName: string, auth: Auth0Env | undefined, options: {
12
- callbacks: readonly string[];
13
- scopes: string;
14
- }): Array<{
15
- filePath: string;
16
- content: string;
17
- }>;
@@ -1,62 +0,0 @@
1
- import type { ScaffoldOpenApiDocument } from "./hello-openapi.js";
2
- export type PostmanCollection = {
3
- info: {
4
- _postman_id?: string;
5
- name: string;
6
- schema: string;
7
- description?: string;
8
- };
9
- auth?: unknown;
10
- item?: PostmanItem[];
11
- variable?: Array<{
12
- key: string;
13
- value: string;
14
- }>;
15
- [key: string]: unknown;
16
- };
17
- export type PostmanItem = {
18
- name?: string;
19
- item?: PostmanItem[];
20
- request?: PostmanRequest;
21
- [key: string]: unknown;
22
- };
23
- export type PostmanRequest = {
24
- method?: string;
25
- header?: Array<{
26
- key: string;
27
- value: string;
28
- }>;
29
- body?: {
30
- mode?: string;
31
- raw?: string;
32
- };
33
- url?: string | {
34
- raw?: string;
35
- host?: string[];
36
- path?: string[];
37
- variable?: unknown[];
38
- };
39
- auth?: {
40
- type: string;
41
- [key: string]: unknown;
42
- };
43
- [key: string]: unknown;
44
- };
45
- export type Auth0Env = {
46
- auth0Domain?: string;
47
- auth0Audience?: string;
48
- auth0ClientId?: string;
49
- };
50
- /** Convert an OpenAPI document to a Postman Collection v2.1 via openapi-to-postmanv2. */
51
- export declare function openApiToPostmanCollection(document: ScaffoldOpenApiDocument): Promise<PostmanCollection>;
52
- /**
53
- * Overlay Auth0 OAuth2 (PKCE) collection auth and fix Local View-friendly URLs.
54
- * Route items come from OpenAPI; auth/env remain hand-authored.
55
- */
56
- export declare function applyPostmanAuthOverlay(collection: PostmanCollection, projectName: string, auth: Auth0Env | undefined, options: {
57
- callbacks: readonly string[];
58
- scopes: string;
59
- description: string;
60
- }): PostmanCollection;
61
- /** OpenAPI `{id}` → Postman `:id`, without touching `{{variables}}`. */
62
- export declare function openApiPathParamsToColon(url: string): string;