@dialecte/cli 0.5.0 → 0.6.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/lookups.d.ts CHANGED
@@ -8,9 +8,10 @@ declare const ROOTS: readonly ["q", "tx", "doc", "project"];
8
8
  type MethodRoot = (typeof ROOTS)[number];
9
9
  /**
10
10
  * One method of a package as `api.json` ships it: what `dialecte api find` and `api show` read. A method of a
11
- * root or a function a package entry exports: `root` tells them apart, and only an export has an `entry`.
11
+ * root, a function a package entry exports or one the package's source exports: `root` tells them apart, and only
12
+ * an export has an `entry`.
12
13
  */
13
- type ApiMethod = ApiRootMethod | ApiExportedFunction;
14
+ type ApiMethod = ApiRootMethod | ApiExportedFunction | ApiSourceFunction;
14
15
  /** A method reached from a root (`q`, `tx`, `doc`, `project`). */
15
16
  type ApiRootMethod = ApiMethodFields & {
16
17
  root: MethodRoot;
@@ -22,6 +23,11 @@ type ApiExportedFunction = ApiMethodFields & {
22
23
  /** The package entry the function comes from ('@dialecte/core/sqlite'). */
23
24
  entry: string;
24
25
  };
26
+ /** An exported function of the package's own source (`src/lib/git.ts#readGit`), read from the files, not from `api.json`. */
27
+ type ApiSourceFunction = ApiMethodFields & {
28
+ root: 'source';
29
+ entry?: undefined;
30
+ };
25
31
  /** What every row of `api.json` holds, whatever its root. */
26
32
  type ApiMethodFields = {
27
33
  /** The canonical route, as a caller writes it: `doc.query.info.of`, `@dialecte/core/sqlite.connectHub`. */
@@ -74,8 +80,8 @@ type LookupOutput = {
74
80
 
75
81
  /**
76
82
  * What `dialecte api <find|show> ...` prints for `argv` (the words after `api`) run in `cwd`: the methods found for a
77
- * need, or one method's contract, read from the `api.json` of the installed packages; the usage with exit code 2 on
78
- * a bad call.
83
+ * need, or one method's contract, read from the `api.json` of the installed packages (with `--source` or a
84
+ * `<file>#<name>` path, the own package's source functions too); the usage with exit code 2 on a bad call.
79
85
  *
80
86
  * @intent answer an api lookup without the command line, find a Dialecte method by what it is for, show a method's contract from another program
81
87
  */
@@ -84,8 +90,8 @@ declare function runApi(params: {
84
90
  cwd: string;
85
91
  }): CommandOutput;
86
92
  /**
87
- * The packages an api lookup searched, as its not-found answer names them: their names joined by commas, or the line
88
- * that says no installed package ships an `api.json`.
93
+ * The packages an api lookup searched, as its not-found answer names them: their names joined by commas (a package
94
+ * searched by its index and its source named once), or the line that says no installed package ships an `api.json`.
89
95
  *
90
96
  * @intent name the packages an api lookup searched, word a not-found api answer
91
97
  */
@@ -319,4 +325,4 @@ declare function describeElement(params: {
319
325
  parent?: string | undefined;
320
326
  }): ElementDescription | undefined;
321
327
 
322
- export { type ApiExportedFunction, type ApiJson, type ApiMethod, type ApiMethodFields, type ApiRootMethod, type AttributeDescription, type ChildDescription, type LookupOutput as CommandOutput, type ElementDescription, type LoadedDialecte, type MemberEntriesRead, type PrintedText, type SchemaDialectesRead, answerMembers, answerSchema, describeElement, packagesText, readApiIndexes, readCliVersion, readMemberEntries, readSchemaDialectes, runApi, runDoctor, runModels };
328
+ export { type ApiExportedFunction, type ApiJson, type ApiMethod, type ApiMethodFields, type ApiRootMethod, type ApiSourceFunction, type AttributeDescription, type ChildDescription, type LookupOutput as CommandOutput, type ElementDescription, type LoadedDialecte, type MemberEntriesRead, type PrintedText, type SchemaDialectesRead, answerMembers, answerSchema, describeElement, packagesText, readApiIndexes, readCliVersion, readMemberEntries, readSchemaDialectes, runApi, runDoctor, runModels };