@dereekb/dbx-cli 13.11.0 → 13.11.2
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/firebase-api-manifest/main.js +711 -0
- package/firebase-api-manifest/package.json +10 -0
- package/index.cjs.js +242 -54
- package/index.esm.js +240 -55
- package/manifest-extract/LICENSE +21 -0
- package/manifest-extract/index.cjs.default.js +1 -0
- package/manifest-extract/index.cjs.js +459 -0
- package/manifest-extract/index.cjs.mjs +2 -0
- package/manifest-extract/index.d.ts +1 -0
- package/manifest-extract/index.esm.js +457 -0
- package/manifest-extract/package.json +20 -0
- package/manifest-extract/src/index.d.ts +2 -0
- package/manifest-extract/src/lib/extract-crud.d.ts +36 -0
- package/manifest-extract/src/lib/types.d.ts +86 -0
- package/package.json +22 -10
- package/src/lib/config/env.d.ts +1 -1
- package/src/lib/manifest/build-manifest-commands.d.ts +58 -3
- package/src/lib/manifest/types.d.ts +20 -0
- package/src/lib/runner/run.d.ts +3 -0
- package/firebase-api-manifest/src/generate-api-manifest/bind-validators.d.ts +0 -44
- package/firebase-api-manifest/src/generate-api-manifest/emit.d.ts +0 -29
- package/firebase-api-manifest/src/generate-api-manifest/extract-crud.d.ts +0 -25
- package/firebase-api-manifest/src/generate-api-manifest/find-api-files.d.ts +0 -16
- package/firebase-api-manifest/src/generate-api-manifest/main.d.ts +0 -46
- package/firebase-api-manifest/src/generate-api-manifest/parse-functions.d.ts +0 -18
- package/firebase-api-manifest/src/generate-api-manifest/resolve-package.d.ts +0 -59
- package/firebase-api-manifest/src/generate-api-manifest/types.d.ts +0 -44
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import { type CommandModule } from 'yargs';
|
|
2
2
|
import { type CliApiManifest } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Controls which sections of an action's `--help` epilogue are rendered.
|
|
5
|
+
*
|
|
6
|
+
* - `action` (just the action explainer): only the action description JSDoc.
|
|
7
|
+
* Useful when you already know the params shape and want to remember what
|
|
8
|
+
* the command does.
|
|
9
|
+
* - `params` (just the params explainer): only the params interface
|
|
10
|
+
* description, per-field descriptions, schema, result, and source. Useful
|
|
11
|
+
* when you already know what the command does and need to remember the
|
|
12
|
+
* input shape.
|
|
13
|
+
* - `both` (default): both sections together.
|
|
14
|
+
*/
|
|
15
|
+
export type ManifestHelpMode = 'action' | 'params' | 'both';
|
|
16
|
+
/**
|
|
17
|
+
* Default help mode when no override is supplied.
|
|
18
|
+
*/
|
|
19
|
+
export declare const DEFAULT_MANIFEST_HELP_MODE: ManifestHelpMode;
|
|
3
20
|
/**
|
|
4
21
|
* Format used for the `Params Schema` section of a manifest command's `--help`
|
|
5
22
|
* epilogue.
|
|
@@ -33,6 +50,14 @@ export interface BuildManifestCommandsOptions {
|
|
|
33
50
|
* {@link DEFAULT_MANIFEST_HELP_DATA_FORMAT}.
|
|
34
51
|
*/
|
|
35
52
|
readonly dataHelpFormat?: ManifestHelpDataFormat;
|
|
53
|
+
/**
|
|
54
|
+
* Which sections of the help epilogue to render.
|
|
55
|
+
*
|
|
56
|
+
* When omitted, the configured argv is scanned for `--help-mode=<mode>` (or
|
|
57
|
+
* `--help-mode <mode>`). Falls back to {@link DEFAULT_MANIFEST_HELP_MODE}
|
|
58
|
+
* (`both`).
|
|
59
|
+
*/
|
|
60
|
+
readonly helpMode?: ManifestHelpMode;
|
|
36
61
|
/**
|
|
37
62
|
* Whether to hide unrelated global options (like `--verbose`, `--dump-dir`,
|
|
38
63
|
* `--pick`, …) from `--help` when the user passed `--data-help`. Defaults
|
|
@@ -48,19 +73,36 @@ export interface BuildManifestCommandsOptions {
|
|
|
48
73
|
* {@link createCli}).
|
|
49
74
|
*/
|
|
50
75
|
readonly hiddenWhenFocused?: readonly string[];
|
|
76
|
+
/**
|
|
77
|
+
* Name of the parent command that groups all per-model dispatch subcommands.
|
|
78
|
+
* Defaults to {@link DEFAULT_MANIFEST_MODEL_COMMAND_NAME} (`model`), so the
|
|
79
|
+
* full invocation reads `<cli> model <model> <action>`.
|
|
80
|
+
*/
|
|
81
|
+
readonly modelCommandName?: string;
|
|
51
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Default name of the parent command that groups all per-model manifest commands.
|
|
85
|
+
* Surfaces as `<cli> model <model> <action>` so the top-level `--help` stays focused
|
|
86
|
+
* on first-class commands instead of dumping every model.
|
|
87
|
+
*/
|
|
88
|
+
export declare const DEFAULT_MANIFEST_MODEL_COMMAND_NAME = "model";
|
|
52
89
|
/**
|
|
53
90
|
* Builds yargs `CommandModule[]` from a generated {@link CliApiManifest}.
|
|
54
91
|
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
92
|
+
* Returns a single parent command (default name `model`) whose subcommands are the per-model
|
|
93
|
+
* dispatch commands. Each per-model subcommand has one child action per entry
|
|
94
|
+
* (named `<verb>` or `<verb>-<specifier>`). Each leaf accepts `--data <json>`, validates the
|
|
57
95
|
* payload against the entry's bound arktype validator (when present), and dispatches via the
|
|
58
96
|
* authenticated CLI context's `callModel` helper. Standalone entries are skipped because they
|
|
59
97
|
* are not dispatched through the `/model/call` endpoint.
|
|
60
98
|
*
|
|
99
|
+
* Wrapping under `model` keeps the top-level `--help` short — users invoke
|
|
100
|
+
* `<cli> model --help` to see the full list of available models.
|
|
101
|
+
*
|
|
61
102
|
* @param manifest - The generated manifest array.
|
|
62
103
|
* @param options - Optional overrides; see {@link BuildManifestCommandsOptions}.
|
|
63
|
-
* @returns The yargs `CommandModule[]` ready to be passed to `runCli({ apiCommands })`.
|
|
104
|
+
* @returns The yargs `CommandModule[]` ready to be passed to `runCli({ apiCommands })`. Empty
|
|
105
|
+
* when the manifest has no callable entries.
|
|
64
106
|
*/
|
|
65
107
|
export declare function buildManifestCommands(manifest: CliApiManifest, options?: BuildManifestCommandsOptions): CommandModule[];
|
|
66
108
|
/**
|
|
@@ -75,3 +117,16 @@ export declare function buildManifestCommands(manifest: CliApiManifest, options?
|
|
|
75
117
|
* @returns The detected format, or {@link DEFAULT_MANIFEST_HELP_DATA_FORMAT}.
|
|
76
118
|
*/
|
|
77
119
|
export declare function detectDataHelpFormat(argv?: readonly string[]): ManifestHelpDataFormat;
|
|
120
|
+
/**
|
|
121
|
+
* Inspects an argv array for `--help-mode=<mode>` or `--help-mode <mode>` and
|
|
122
|
+
* returns the requested {@link ManifestHelpMode}. Unrecognized values fall
|
|
123
|
+
* back to {@link DEFAULT_MANIFEST_HELP_MODE}.
|
|
124
|
+
*
|
|
125
|
+
* Implemented as a raw argv scan (rather than going through yargs) because the
|
|
126
|
+
* value is needed when each command's builder runs — which is before yargs
|
|
127
|
+
* parses argv.
|
|
128
|
+
*
|
|
129
|
+
* @param argv - argv to inspect (defaults to `process.argv`).
|
|
130
|
+
* @returns The detected mode, or {@link DEFAULT_MANIFEST_HELP_MODE}.
|
|
131
|
+
*/
|
|
132
|
+
export declare function detectHelpMode(argv?: readonly string[]): ManifestHelpMode;
|
|
@@ -14,7 +14,27 @@ export interface CliApiManifestEntry {
|
|
|
14
14
|
readonly resultTypeName?: string;
|
|
15
15
|
readonly groupName: string;
|
|
16
16
|
readonly sourceFile: string;
|
|
17
|
+
/**
|
|
18
|
+
* Per-action description, rendered as the command's `describe` in `--help`.
|
|
19
|
+
*/
|
|
17
20
|
readonly description?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Description from the params interface's own JSDoc (e.g. on `ResetProfilePasswordParams`).
|
|
23
|
+
* Rendered in the `--help` epilogue under the params section.
|
|
24
|
+
*/
|
|
25
|
+
readonly paramsTypeDescription?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Per-field params descriptions read from the params interface's property JSDocs.
|
|
28
|
+
*/
|
|
18
29
|
readonly paramsFields?: readonly CliApiManifestField[];
|
|
30
|
+
/**
|
|
31
|
+
* Description from the result interface's own JSDoc (e.g. on `DownloadProfileArchiveResult`).
|
|
32
|
+
* Surfaces the same way `paramsTypeDescription` does, but for the response side.
|
|
33
|
+
*/
|
|
34
|
+
readonly resultTypeDescription?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Per-field result descriptions read from the result interface's property JSDocs.
|
|
37
|
+
*/
|
|
38
|
+
readonly resultFields?: readonly CliApiManifestField[];
|
|
19
39
|
}
|
|
20
40
|
export type CliApiManifest = readonly CliApiManifestEntry[];
|
package/src/lib/runner/run.d.ts
CHANGED
|
@@ -20,6 +20,9 @@ export interface CreateCliInput {
|
|
|
20
20
|
* App-specific API commands appended after the built-in `call` passthrough.
|
|
21
21
|
*
|
|
22
22
|
* Commands listed here run after the auth middleware, so they have access to the {@link CliContext}.
|
|
23
|
+
*
|
|
24
|
+
* For manifest-driven typed model commands, pass the result of `buildManifestCommands(manifest)` —
|
|
25
|
+
* it returns a single parent `model <model>` command so the top-level `--help` stays focused.
|
|
23
26
|
*/
|
|
24
27
|
readonly apiCommands?: CommandModule[];
|
|
25
28
|
/**
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* For a given Params type name (e.g. `SetProfileUsernameParams`), derives the
|
|
3
|
-
* canonical arktype validator identifier (`setProfileUsernameParamsType`) by
|
|
4
|
-
* naming convention and confirms it is exported from the resolved package.
|
|
5
|
-
*
|
|
6
|
-
* Verification is best-effort: we string-search the package's `src/index.ts`
|
|
7
|
-
* and follow `export * from './...';` re-exports recursively until we find
|
|
8
|
-
* the declaration of the validator. The convention everywhere in the codebase
|
|
9
|
-
* is `export const <name>ParamsType = ... as Type<<Name>Params>`.
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Derives the canonical arktype validator identifier from a Params type name.
|
|
13
|
-
*
|
|
14
|
-
* `SetProfileUsernameParams` → `setProfileUsernameParamsType`.
|
|
15
|
-
*
|
|
16
|
-
* @param paramsTypeName - PascalCase Params type identifier.
|
|
17
|
-
* @returns The lowerCamelCase validator identifier (or empty string for empty input).
|
|
18
|
-
*/
|
|
19
|
-
export declare function deriveValidatorName(paramsTypeName: string): string;
|
|
20
|
-
/**
|
|
21
|
-
* Inputs for {@link isExportedFromPackage}.
|
|
22
|
-
*/
|
|
23
|
-
export interface IsExportedInput {
|
|
24
|
-
readonly packageRoot: string;
|
|
25
|
-
readonly identifier: string;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Confirms an identifier is exported from `packageRoot/src/index.ts` —
|
|
29
|
-
* directly or via re-export chains.
|
|
30
|
-
*
|
|
31
|
-
* @param input - Package root + identifier to look up.
|
|
32
|
-
* @returns `true` when the identifier is reachable from the barrel.
|
|
33
|
-
*/
|
|
34
|
-
export declare function isExportedFromPackage(input: IsExportedInput): boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Walks the `src/lib` tree under a package and returns the absolute file
|
|
37
|
-
* paths of every `.ts` file (used as a fallback when index-chain lookup
|
|
38
|
-
* misses the identifier — some packages rely on flat barrels that don't
|
|
39
|
-
* `export *`).
|
|
40
|
-
*
|
|
41
|
-
* @param packageRoot - Absolute path to the source package's root directory.
|
|
42
|
-
* @returns Absolute paths of every non-spec `.ts` file under `src`.
|
|
43
|
-
*/
|
|
44
|
-
export declare function listPackageTsFiles(packageRoot: string): string[];
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Renders the final manifest TS module — banner + grouped imports + the
|
|
3
|
-
* `<NAMESPACE>` array literal. Formatted with the workspace prettier config
|
|
4
|
-
* so the output matches what `prettier --write` would produce on the
|
|
5
|
-
* committed file.
|
|
6
|
-
*
|
|
7
|
-
* The reusable `CliApiManifest` type is imported from `@dereekb/dbx-cli` so
|
|
8
|
-
* any consuming app gets it from the shared dbx-cli barrel.
|
|
9
|
-
*/
|
|
10
|
-
import type { CollectedEntry } from './types';
|
|
11
|
-
/**
|
|
12
|
-
* Inputs for {@link renderManifest}.
|
|
13
|
-
*/
|
|
14
|
-
export interface RenderManifestInput {
|
|
15
|
-
readonly outputFile: string;
|
|
16
|
-
readonly entries: readonly CollectedEntry[];
|
|
17
|
-
readonly projectName: string;
|
|
18
|
-
readonly namespace: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Renders the manifest TS source for a CLI app and formats it with the
|
|
22
|
-
* workspace prettier config so the output matches a `prettier --write` of the
|
|
23
|
-
* committed file.
|
|
24
|
-
*
|
|
25
|
-
* @param input - Output file path, collected entries, project name (banner),
|
|
26
|
-
* and the manifest namespace identifier.
|
|
27
|
-
* @returns Prettier-formatted TypeScript source.
|
|
28
|
-
*/
|
|
29
|
-
export declare function renderManifest(input: RenderManifestInput): Promise<string>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Walks `<Group>ModelCrudFunctionsConfig` and `<Group>FunctionTypeMap` type
|
|
3
|
-
* aliases in a `<model>.api.ts` source. Returns one entry per callable leaf,
|
|
4
|
-
* keyed by (model, verb, specifier).
|
|
5
|
-
*
|
|
6
|
-
* Mirrors `extractCrudEntries` from
|
|
7
|
-
* packages/dbx-components-mcp/src/tools/model-api-shared/extract-crud.ts —
|
|
8
|
-
* keep the two in lockstep when the .api.ts convention changes.
|
|
9
|
-
*/
|
|
10
|
-
import type { CrudExtraction } from './types';
|
|
11
|
-
/**
|
|
12
|
-
* Inputs for {@link extractCrudEntries}.
|
|
13
|
-
*/
|
|
14
|
-
export interface ExtractCrudInput {
|
|
15
|
-
readonly name: string;
|
|
16
|
-
readonly text: string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Extracts CRUD + standalone entries from a `.api.ts` source by walking its
|
|
20
|
-
* `<Group>ModelCrudFunctionsConfig` and `<Group>FunctionTypeMap` aliases.
|
|
21
|
-
*
|
|
22
|
-
* @param source - The source file's name + text.
|
|
23
|
-
* @returns The extracted entries, group name, model keys, and `*Functions` class name.
|
|
24
|
-
*/
|
|
25
|
-
export declare function extractCrudEntries(source: ExtractCrudInput): CrudExtraction;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Walks a package's `src/lib/**\/*.api.ts` and returns the files that declare
|
|
3
|
-
* an abstract `*Functions` class along with the class name. Used to map a
|
|
4
|
-
* class identifier from `<APP>_FIREBASE_FUNCTIONS_CONFIG` back to the source
|
|
5
|
-
* `*.api.ts`.
|
|
6
|
-
*/
|
|
7
|
-
import type { ApiFileMatch } from './types';
|
|
8
|
-
/**
|
|
9
|
-
* Walks `packageRoot/src/lib/**\/*.api.ts` and returns the files that declare
|
|
10
|
-
* an abstract `*Functions` class along with the class name and the
|
|
11
|
-
* extracted CRUD entries.
|
|
12
|
-
*
|
|
13
|
-
* @param packageRoot - Absolute path to the source package's root directory.
|
|
14
|
-
* @returns One {@link ApiFileMatch} per qualifying `.api.ts`.
|
|
15
|
-
*/
|
|
16
|
-
export declare function findApiFiles(packageRoot: string): ApiFileMatch[];
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generates an API manifest TS file for any dbx-components CLI app.
|
|
3
|
-
*
|
|
4
|
-
* Pipeline (build-time, run via `nx run <cli>:generate-api-manifest`):
|
|
5
|
-
*
|
|
6
|
-
* 1. Parse the app's `<APP>_FIREBASE_FUNCTIONS_CONFIG` from the file passed
|
|
7
|
-
* via --functions-config to enumerate the `*Functions` abstract classes
|
|
8
|
-
* used by the app, including their source-module specifier
|
|
9
|
-
* ("@dereekb/firebase", "demo-firebase", "./model", "./development",
|
|
10
|
-
* ...). The leading-app prefix is matched generically by
|
|
11
|
-
* `/FIREBASE_FUNCTIONS_CONFIG$/` so any app variable name works.
|
|
12
|
-
*
|
|
13
|
-
* 2. Resolve each module to a source-package root via the workspace's
|
|
14
|
-
* tsconfig.base.json `paths`.
|
|
15
|
-
*
|
|
16
|
-
* 3. Walk that package's `src/lib/**\/*.api.ts`, run the CRUD-entry walker
|
|
17
|
-
* on each, and pick the file whose abstract `*Functions` class name
|
|
18
|
-
* matches the entry's class identifier.
|
|
19
|
-
*
|
|
20
|
-
* 4. For each CRUD entry with a `paramsTypeName`, derive the canonical
|
|
21
|
-
* arktype validator name (lowercaseFirst + `Type`) and confirm it is
|
|
22
|
-
* exported from the package's barrel chain. Warn on miss; the entry is
|
|
23
|
-
* still emitted with `paramsValidator: undefined`. `--strict` makes a
|
|
24
|
-
* miss fatal.
|
|
25
|
-
*
|
|
26
|
-
* 5. Emit the manifest to the path passed via --output with grouped
|
|
27
|
-
* per-package imports + the `<NAMESPACE>_API_MANIFEST` array literal.
|
|
28
|
-
* Skip the write if the file content is byte-identical (preserves mtime
|
|
29
|
-
* for incremental builds).
|
|
30
|
-
*
|
|
31
|
-
* Flags:
|
|
32
|
-
* --functions-config=<path> (required) path to the app's functions.ts.
|
|
33
|
-
* Absolute or workspace-relative.
|
|
34
|
-
* --output=<path> (required) path to the manifest TS file to write.
|
|
35
|
-
* Absolute or workspace-relative.
|
|
36
|
-
* --project=<name> Project name shown in the regenerate banner
|
|
37
|
-
* (defaults to "<cli>"). Also used to derive
|
|
38
|
-
* the manifest namespace (e.g. "demo-cli" ->
|
|
39
|
-
* DEMO_CLI_API_MANIFEST).
|
|
40
|
-
* --only=<model[,model]> Filter the emitted entries to those models.
|
|
41
|
-
* --strict Exit 1 if any validator is missing.
|
|
42
|
-
*
|
|
43
|
-
* Run from any cwd; workspace-relative paths resolve against `process.cwd()`
|
|
44
|
-
* (Nx invokes with cwd: "{workspaceRoot}").
|
|
45
|
-
*/
|
|
46
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parses the `<APP>_FIREBASE_FUNCTIONS_CONFIG` variable from a CLI app's
|
|
3
|
-
* `functions.ts` and returns the (groupKey, className, importedFromModule)
|
|
4
|
-
* tuple for every entry.
|
|
5
|
-
*
|
|
6
|
-
* We follow the import declaration of the abstract-class identifier to know
|
|
7
|
-
* which package the `*.api.ts` lives in. The variable name is matched
|
|
8
|
-
* generically by `/FIREBASE_FUNCTIONS_CONFIG$/` so any app-prefix works.
|
|
9
|
-
*/
|
|
10
|
-
import type { FunctionsGroup } from './types';
|
|
11
|
-
/**
|
|
12
|
-
* Parses the `<APP>_FIREBASE_FUNCTIONS_CONFIG` literal at `functionsTsPath`
|
|
13
|
-
* into one entry per group declared in the config object.
|
|
14
|
-
*
|
|
15
|
-
* @param functionsTsPath - Absolute path to the app's `functions.ts`.
|
|
16
|
-
* @returns One {@link FunctionsGroup} per `<groupKey>: [<Class>, ...]` pair.
|
|
17
|
-
*/
|
|
18
|
-
export declare function parseFunctionsConfig(functionsTsPath: string): FunctionsGroup[];
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolves a workspace module specifier (e.g. "@dereekb/firebase",
|
|
3
|
-
* "demo-firebase", "./model", "./development") to a source-package root and
|
|
4
|
-
* canonical import name.
|
|
5
|
-
*
|
|
6
|
-
* Reads the workspace tsconfig.base.json `compilerOptions.paths` to map bare
|
|
7
|
-
* specifiers to their `src/index.ts` entry. Relative specifiers are resolved
|
|
8
|
-
* against the importing file's directory and then walked back up to the
|
|
9
|
-
* nearest `package.json` that owns them.
|
|
10
|
-
*/
|
|
11
|
-
import type { PackageRef } from './types';
|
|
12
|
-
/**
|
|
13
|
-
* Inputs accepted by {@link resolveModuleToPackage}.
|
|
14
|
-
*/
|
|
15
|
-
export interface ResolveModuleInput {
|
|
16
|
-
readonly workspaceRoot: string;
|
|
17
|
-
readonly importingFile: string;
|
|
18
|
-
readonly moduleSpecifier: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Reads `tsconfig.base.json` and returns the `compilerOptions.paths` map
|
|
22
|
-
* (canonical bare specifier → absolute path to its `src/index.ts`).
|
|
23
|
-
*
|
|
24
|
-
* @param workspaceRoot - Workspace root directory.
|
|
25
|
-
* @returns Cached map of canonical specifiers to absolute index paths.
|
|
26
|
-
*/
|
|
27
|
-
export declare function loadTsconfigPaths(workspaceRoot: string): Map<string, string>;
|
|
28
|
-
/**
|
|
29
|
-
* Resolves a module specifier to the source-package that owns it.
|
|
30
|
-
*
|
|
31
|
-
* @param input - Workspace root + importing-file location + the specifier.
|
|
32
|
-
* @returns The {@link PackageRef} of the owning package, or `undefined` when unresolved.
|
|
33
|
-
*/
|
|
34
|
-
export declare function resolveModuleToPackage(input: ResolveModuleInput): PackageRef | undefined;
|
|
35
|
-
/**
|
|
36
|
-
* Walks up from `startPath` until it finds a directory containing a `package.json`
|
|
37
|
-
* with a `name` field, then returns its package name + root.
|
|
38
|
-
*
|
|
39
|
-
* @param workspaceRoot - Stop walking when this directory is reached.
|
|
40
|
-
* @param startPath - Path to walk up from.
|
|
41
|
-
* @returns The package name + root, or `undefined` if no package.json is found.
|
|
42
|
-
*/
|
|
43
|
-
export declare function locatePackageForPath(workspaceRoot: string, startPath: string): PackageRef | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* Returns the workspace-root-relative path with forward slashes for display.
|
|
46
|
-
*
|
|
47
|
-
* @param workspaceRoot - Workspace root directory.
|
|
48
|
-
* @param absolutePath - Absolute path to make relative.
|
|
49
|
-
* @returns The workspace-relative path with forward slashes.
|
|
50
|
-
*/
|
|
51
|
-
export declare function relPath(workspaceRoot: string, absolutePath: string): string;
|
|
52
|
-
/**
|
|
53
|
-
* Type-narrowed `isAbsolute` re-export so the generator scripts only depend on
|
|
54
|
-
* `node:path` indirectly through this module.
|
|
55
|
-
*
|
|
56
|
-
* @param value - Path to test.
|
|
57
|
-
* @returns `true` when the path is absolute.
|
|
58
|
-
*/
|
|
59
|
-
export declare function isAbsolutePathLike(value: string): boolean;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Internal types shared between the generator's pipeline stages.
|
|
3
|
-
*
|
|
4
|
-
* The runtime manifest types (`CliApiManifest`, `CliApiManifestEntry`,
|
|
5
|
-
* `CliApiVerb`) live in `packages/dbx-cli/src/lib/manifest/types.ts` and are
|
|
6
|
-
* re-exported from `@dereekb/dbx-cli`. The generator emits TypeScript that
|
|
7
|
-
* imports those runtime types — it does not reference them itself.
|
|
8
|
-
*/
|
|
9
|
-
export interface FunctionsGroup {
|
|
10
|
-
readonly groupKey: string;
|
|
11
|
-
readonly className: string;
|
|
12
|
-
readonly importedFromModule: string;
|
|
13
|
-
}
|
|
14
|
-
export interface PackageRef {
|
|
15
|
-
readonly packageName: string;
|
|
16
|
-
readonly packageRoot: string;
|
|
17
|
-
}
|
|
18
|
-
export interface CrudEntry {
|
|
19
|
-
readonly model: string;
|
|
20
|
-
readonly verb: string;
|
|
21
|
-
readonly specifier?: string;
|
|
22
|
-
readonly paramsTypeName?: string;
|
|
23
|
-
readonly resultTypeName?: string;
|
|
24
|
-
readonly line: number;
|
|
25
|
-
}
|
|
26
|
-
export interface CrudExtraction {
|
|
27
|
-
readonly groupName: string | undefined;
|
|
28
|
-
readonly modelKeys: readonly string[];
|
|
29
|
-
readonly entries: readonly CrudEntry[];
|
|
30
|
-
readonly functionsClassName?: string;
|
|
31
|
-
}
|
|
32
|
-
export interface ApiFileMatch {
|
|
33
|
-
readonly filePath: string;
|
|
34
|
-
readonly className: string;
|
|
35
|
-
readonly extraction: CrudExtraction;
|
|
36
|
-
}
|
|
37
|
-
export interface CollectedEntry {
|
|
38
|
-
readonly entry: CrudEntry & {
|
|
39
|
-
readonly groupName: string;
|
|
40
|
-
readonly sourceFile: string;
|
|
41
|
-
};
|
|
42
|
-
readonly packageName?: string;
|
|
43
|
-
readonly validatorName?: string;
|
|
44
|
-
}
|