@dagger.io/dagger 0.15.0 → 0.15.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/dist/src/api/client.gen.d.ts +51 -1
- package/dist/src/api/client.gen.d.ts.map +1 -1
- package/dist/src/api/client.gen.js +22 -2
- package/dist/src/common/utils.d.ts +14 -14
- package/dist/src/module/decorators.d.ts.map +1 -1
- package/dist/src/module/entrypoint/load.d.ts.map +1 -1
- package/dist/src/module/entrypoint/load.js +3 -2
- package/dist/src/module/entrypoint/register.d.ts.map +1 -1
- package/dist/src/module/entrypoint/register.js +10 -0
- package/dist/src/module/introspector/dagger_module/argument.d.ts +2 -1
- package/dist/src/module/introspector/dagger_module/argument.d.ts.map +1 -1
- package/dist/src/module/introspector/dagger_module/argument.js +3 -1
- package/dist/src/module/introspector/dagger_module/enum.d.ts +3 -2
- package/dist/src/module/introspector/dagger_module/enum.d.ts.map +1 -1
- package/dist/src/module/introspector/dagger_module/enum.js +5 -2
- package/dist/src/module/introspector/dagger_module/enumBase.d.ts +3 -2
- package/dist/src/module/introspector/dagger_module/enumBase.d.ts.map +1 -1
- package/dist/src/module/introspector/dagger_module/enumClass.d.ts +3 -2
- package/dist/src/module/introspector/dagger_module/enumClass.d.ts.map +1 -1
- package/dist/src/module/introspector/dagger_module/enumClass.js +5 -2
- package/dist/src/module/introspector/dagger_module/function.d.ts +2 -1
- package/dist/src/module/introspector/dagger_module/function.d.ts.map +1 -1
- package/dist/src/module/introspector/dagger_module/function.js +3 -1
- package/dist/src/module/introspector/dagger_module/index.d.ts +1 -0
- package/dist/src/module/introspector/dagger_module/index.d.ts.map +1 -1
- package/dist/src/module/introspector/dagger_module/index.js +1 -0
- package/dist/src/module/introspector/dagger_module/locatable.d.ts +12 -0
- package/dist/src/module/introspector/dagger_module/locatable.d.ts.map +1 -0
- package/dist/src/module/introspector/dagger_module/locatable.js +14 -0
- package/dist/src/module/introspector/dagger_module/object.d.ts +17 -2
- package/dist/src/module/introspector/dagger_module/object.d.ts.map +1 -1
- package/dist/src/module/introspector/dagger_module/object.js +19 -1
- package/dist/src/module/introspector/dagger_module/objectBase.d.ts +3 -2
- package/dist/src/module/introspector/dagger_module/objectBase.d.ts.map +1 -1
- package/dist/src/module/introspector/dagger_module/property.d.ts +2 -1
- package/dist/src/module/introspector/dagger_module/property.d.ts.map +1 -1
- package/dist/src/module/introspector/dagger_module/property.js +3 -1
- package/dist/src/module/introspector/dagger_module/typeObject.d.ts +24 -2
- package/dist/src/module/introspector/dagger_module/typeObject.d.ts.map +1 -1
- package/dist/src/module/introspector/dagger_module/typeObject.js +26 -1
- package/dist/src/module/introspector/dagger_module/typeObjectProperty.d.ts +2 -1
- package/dist/src/module/introspector/dagger_module/typeObjectProperty.d.ts.map +1 -1
- package/dist/src/module/introspector/dagger_module/typeObjectProperty.js +3 -1
- package/dist/src/module/introspector/typescript_module/ast.d.ts +14 -0
- package/dist/src/module/introspector/typescript_module/ast.d.ts.map +1 -1
- package/dist/src/module/introspector/typescript_module/ast.js +28 -0
- package/dist/src/module/introspector/typescript_module/index.d.ts +1 -0
- package/dist/src/module/introspector/typescript_module/index.d.ts.map +1 -1
- package/dist/src/module/introspector/typescript_module/index.js +1 -0
- package/dist/src/module/introspector/typescript_module/location.d.ts +6 -0
- package/dist/src/module/introspector/typescript_module/location.d.ts.map +1 -0
- package/dist/src/module/introspector/typescript_module/location.js +1 -0
- package/dist/src/module/registry.d.ts.map +1 -1
- package/dist/src/provisioning/default.d.ts +1 -1
- package/dist/src/provisioning/default.js +1 -1
- package/package.json +19 -19
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { Locatable } from "./locatable.js";
|
|
2
|
+
export interface DaggerEnumBaseValue extends Locatable {
|
|
2
3
|
name: string;
|
|
3
4
|
value: string;
|
|
4
5
|
description: string;
|
|
@@ -6,7 +7,7 @@ export interface DaggerEnumBaseValue {
|
|
|
6
7
|
export type DaggerEnumBaseValues = {
|
|
7
8
|
[name: string]: DaggerEnumBaseValue;
|
|
8
9
|
};
|
|
9
|
-
export interface DaggerEnumBase {
|
|
10
|
+
export interface DaggerEnumBase extends Locatable {
|
|
10
11
|
name: string;
|
|
11
12
|
description: string;
|
|
12
13
|
values: DaggerEnumBaseValues;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enumBase.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/enumBase.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"enumBase.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/enumBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,MAAM,oBAAoB,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,CAAA;CAAE,CAAA;AAE1E,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,oBAAoB,CAAA;CAC7B;AAED,MAAM,MAAM,eAAe,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAAA;CAAE,CAAA"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
import { AST } from "../typescript_module/index.js";
|
|
3
3
|
import { DaggerEnumBase, DaggerEnumBaseValue } from "./enumBase.js";
|
|
4
|
+
import { Locatable } from "./locatable.js";
|
|
4
5
|
export type DaggerEnumClasses = {
|
|
5
6
|
[name: string]: DaggerEnumClass;
|
|
6
7
|
};
|
|
7
8
|
export type DaggerEnumClassValues = {
|
|
8
9
|
[name: string]: DaggerEnumClassValue;
|
|
9
10
|
};
|
|
10
|
-
export declare class DaggerEnumClassValue implements DaggerEnumBaseValue {
|
|
11
|
+
export declare class DaggerEnumClassValue extends Locatable implements DaggerEnumBaseValue {
|
|
11
12
|
private readonly node;
|
|
12
13
|
private readonly ast;
|
|
13
14
|
name: string;
|
|
@@ -20,7 +21,7 @@ export declare class DaggerEnumClassValue implements DaggerEnumBaseValue {
|
|
|
20
21
|
description: string;
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
|
-
export declare class DaggerEnumClass implements DaggerEnumBase {
|
|
24
|
+
export declare class DaggerEnumClass extends Locatable implements DaggerEnumBase {
|
|
24
25
|
private readonly node;
|
|
25
26
|
private readonly ast;
|
|
26
27
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enumClass.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/enumClass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAG3B,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"enumClass.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/enumClass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAG3B,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,MAAM,iBAAiB,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAAA;CAAE,CAAA;AAEnE,MAAM,MAAM,qBAAqB,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,CAAA;CAAE,CAAA;AAE5E,qBAAa,oBACX,SAAQ,SACR,YAAW,mBAAmB;IAS5B,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG;IARf,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IAE1B,OAAO,CAAC,MAAM,CAAW;gBAGN,IAAI,EAAE,EAAE,CAAC,mBAAmB,EAC5B,GAAG,EAAE,GAAG;IAe3B,MAAM;;;;CAMP;AAED,qBAAa,eAAgB,SAAQ,SAAU,YAAW,cAAc;IAQpE,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG;IARf,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,qBAAqB,CAAK;IAEzC,OAAO,CAAC,MAAM,CAAW;gBAGN,IAAI,EAAE,EAAE,CAAC,gBAAgB,EACzB,GAAG,EAAE,GAAG;IAuB3B,MAAM;;;;;CAOP"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
import { IntrospectionError } from "../../../common/errors/index.js";
|
|
3
3
|
import { AST } from "../typescript_module/index.js";
|
|
4
|
-
|
|
4
|
+
import { Locatable } from "./locatable.js";
|
|
5
|
+
export class DaggerEnumClassValue extends Locatable {
|
|
5
6
|
node;
|
|
6
7
|
ast;
|
|
7
8
|
name;
|
|
@@ -9,6 +10,7 @@ export class DaggerEnumClassValue {
|
|
|
9
10
|
description;
|
|
10
11
|
symbol;
|
|
11
12
|
constructor(node, ast) {
|
|
13
|
+
super(node);
|
|
12
14
|
this.node = node;
|
|
13
15
|
this.ast = ast;
|
|
14
16
|
this.name = this.node.name.getText();
|
|
@@ -27,7 +29,7 @@ export class DaggerEnumClassValue {
|
|
|
27
29
|
};
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
|
-
export class DaggerEnumClass {
|
|
32
|
+
export class DaggerEnumClass extends Locatable {
|
|
31
33
|
node;
|
|
32
34
|
ast;
|
|
33
35
|
name;
|
|
@@ -35,6 +37,7 @@ export class DaggerEnumClass {
|
|
|
35
37
|
values = {};
|
|
36
38
|
symbol;
|
|
37
39
|
constructor(node, ast) {
|
|
40
|
+
super(node);
|
|
38
41
|
this.node = node;
|
|
39
42
|
this.ast = ast;
|
|
40
43
|
if (!this.node.name) {
|
|
@@ -3,11 +3,12 @@ import { TypeDefKind } from "../../../api/client.gen.js";
|
|
|
3
3
|
import { TypeDef } from "../typedef.js";
|
|
4
4
|
import { AST } from "../typescript_module/index.js";
|
|
5
5
|
import { DaggerArguments } from "./argument.js";
|
|
6
|
+
import { Locatable } from "./locatable.js";
|
|
6
7
|
import { References } from "./reference.js";
|
|
7
8
|
export type DaggerFunctions = {
|
|
8
9
|
[name: string]: DaggerFunction;
|
|
9
10
|
};
|
|
10
|
-
export declare class DaggerFunction {
|
|
11
|
+
export declare class DaggerFunction extends Locatable {
|
|
11
12
|
private readonly node;
|
|
12
13
|
private readonly ast;
|
|
13
14
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EACL,GAAG,EAGJ,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAkB,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,MAAM,MAAM,eAAe,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAAA;CAAE,CAAA;AAEhE,qBAAa,
|
|
1
|
+
{"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EACL,GAAG,EAGJ,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAkB,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,MAAM,MAAM,eAAe,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAAA;CAAE,CAAA;AAEhE,qBAAa,cAAe,SAAQ,SAAS;IAYzC,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAZf,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IAC1B,OAAO,CAAC,cAAc,CAAC,CAAQ;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;IACjC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,SAAS,EAAE,eAAe,CAAK;IAEtC,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,MAAM,CAAW;gBAGN,IAAI,EAAE,EAAE,CAAC,iBAAiB,EAC1B,GAAG,EAAE,GAAG;IAmB3B,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,QAAQ;IAaT,YAAY,IAAI,MAAM,EAAE;IAIxB,aAAa,IAAI,MAAM,EAAE;IAoBzB,mBAAmB,CAAC,UAAU,EAAE,UAAU;IAuB1C,MAAM;;;;;;;CASd"}
|
|
@@ -2,7 +2,8 @@ import { IntrospectionError } from "../../../common/errors/index.js";
|
|
|
2
2
|
import { AST, isTypeDefResolved, resolveTypeDef, } from "../typescript_module/index.js";
|
|
3
3
|
import { DaggerArgument } from "./argument.js";
|
|
4
4
|
import { FUNCTION_DECORATOR } from "./decorator.js";
|
|
5
|
-
|
|
5
|
+
import { Locatable } from "./locatable.js";
|
|
6
|
+
export class DaggerFunction extends Locatable {
|
|
6
7
|
node;
|
|
7
8
|
ast;
|
|
8
9
|
name;
|
|
@@ -14,6 +15,7 @@ export class DaggerFunction {
|
|
|
14
15
|
signature;
|
|
15
16
|
symbol;
|
|
16
17
|
constructor(node, ast) {
|
|
18
|
+
super(node);
|
|
17
19
|
this.node = node;
|
|
18
20
|
this.ast = ast;
|
|
19
21
|
this.symbol = this.ast.getSymbolOrThrow(node.name);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { Location } from "../typescript_module/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Locatable is a base class that any Dagger object can extend from to
|
|
5
|
+
* provide a location method.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Locatable {
|
|
8
|
+
private readonly __node;
|
|
9
|
+
constructor(__node: ts.Node);
|
|
10
|
+
getLocation(): Location;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=locatable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locatable.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/locatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAO,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AAE7D;;;GAGG;AACH,qBAAa,SAAS;IACR,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,EAAE,CAAC,IAAI;IAE5C,WAAW,IAAI,QAAQ;CAGxB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AST } from "../typescript_module/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Locatable is a base class that any Dagger object can extend from to
|
|
4
|
+
* provide a location method.
|
|
5
|
+
*/
|
|
6
|
+
export class Locatable {
|
|
7
|
+
__node;
|
|
8
|
+
constructor(__node) {
|
|
9
|
+
this.__node = __node;
|
|
10
|
+
}
|
|
11
|
+
getLocation() {
|
|
12
|
+
return AST.getNodeLocation(this.__node);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
-
import { AST } from "../typescript_module/index.js";
|
|
2
|
+
import { AST, Location } from "../typescript_module/index.js";
|
|
3
3
|
import { DaggerConstructor } from "./constructor.js";
|
|
4
4
|
import { DaggerFunctions } from "./function.js";
|
|
5
|
+
import { Locatable } from "./locatable.js";
|
|
5
6
|
import { DaggerObjectBase } from "./objectBase.js";
|
|
6
7
|
import { DaggerProperties } from "./property.js";
|
|
7
8
|
import { References } from "./reference.js";
|
|
8
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Represents an object defined using the `class` keyword.
|
|
11
|
+
*
|
|
12
|
+
* The class may contains methods and fields, that may or may not be exposed to the Dagger API.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* type MyObject = {
|
|
17
|
+
* name: string
|
|
18
|
+
* age: number
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare class DaggerObject extends Locatable implements DaggerObjectBase {
|
|
9
23
|
private readonly node;
|
|
10
24
|
private readonly ast;
|
|
11
25
|
name: string;
|
|
@@ -16,6 +30,7 @@ export declare class DaggerObject implements DaggerObjectBase {
|
|
|
16
30
|
private symbol;
|
|
17
31
|
kind(): "class" | "object";
|
|
18
32
|
constructor(node: ts.ClassDeclaration, ast: AST);
|
|
33
|
+
getLocation(): Location;
|
|
19
34
|
getReferences(): string[];
|
|
20
35
|
propagateReferences(references: References): void;
|
|
21
36
|
toJSON(): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAG3B,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;
|
|
1
|
+
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAG3B,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEpD,OAAO,EAAkB,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAkB,MAAM,eAAe,CAAA;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C;;;;;;;;;;;;GAYG;AACH,qBAAa,YAAa,SAAQ,SAAU,YAAW,gBAAgB;IAcnE,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAdf,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,iBAAiB,GAAG,SAAS,CAAY;IACvD,OAAO,EAAE,eAAe,CAAK;IAC7B,UAAU,EAAE,gBAAgB,CAAK;IAExC,OAAO,CAAC,MAAM,CAAW;IAEzB,IAAI,IAAI,OAAO,GAAG,QAAQ;gBAKP,IAAI,EAAE,EAAE,CAAC,gBAAgB,EACzB,GAAG,EAAE,GAAG;IAuDpB,WAAW,IAAI,QAAQ;IAIvB,aAAa,IAAI,MAAM,EAAE;IAqBzB,mBAAmB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAcjD,MAAM;;;;;;;CASd"}
|
|
@@ -4,8 +4,22 @@ import { AST } from "../typescript_module/index.js";
|
|
|
4
4
|
import { DaggerConstructor } from "./constructor.js";
|
|
5
5
|
import { FUNCTION_DECORATOR, OBJECT_DECORATOR } from "./decorator.js";
|
|
6
6
|
import { DaggerFunction } from "./function.js";
|
|
7
|
+
import { Locatable } from "./locatable.js";
|
|
7
8
|
import { DaggerProperty } from "./property.js";
|
|
8
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Represents an object defined using the `class` keyword.
|
|
11
|
+
*
|
|
12
|
+
* The class may contains methods and fields, that may or may not be exposed to the Dagger API.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* type MyObject = {
|
|
17
|
+
* name: string
|
|
18
|
+
* age: number
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export class DaggerObject extends Locatable {
|
|
9
23
|
node;
|
|
10
24
|
ast;
|
|
11
25
|
name;
|
|
@@ -18,6 +32,7 @@ export class DaggerObject {
|
|
|
18
32
|
return "class";
|
|
19
33
|
}
|
|
20
34
|
constructor(node, ast) {
|
|
35
|
+
super(node);
|
|
21
36
|
this.node = node;
|
|
22
37
|
this.ast = ast;
|
|
23
38
|
if (!this.node.name) {
|
|
@@ -52,6 +67,9 @@ export class DaggerObject {
|
|
|
52
67
|
}
|
|
53
68
|
}
|
|
54
69
|
}
|
|
70
|
+
getLocation() {
|
|
71
|
+
return AST.getNodeLocation(this.node);
|
|
72
|
+
}
|
|
55
73
|
getReferences() {
|
|
56
74
|
const references = [];
|
|
57
75
|
if (this._constructor) {
|
|
@@ -2,8 +2,9 @@ import { TypeDefKind } from "../../../api/client.gen.js";
|
|
|
2
2
|
import { TypeDef } from "../typedef.js";
|
|
3
3
|
import { DaggerConstructor } from "./constructor.js";
|
|
4
4
|
import { DaggerFunctions } from "./function.js";
|
|
5
|
+
import { Locatable } from "./locatable.js";
|
|
5
6
|
import { References } from "./reference.js";
|
|
6
|
-
export interface DaggerObjectPropertyBase {
|
|
7
|
+
export interface DaggerObjectPropertyBase extends Locatable {
|
|
7
8
|
name: string;
|
|
8
9
|
description: string;
|
|
9
10
|
alias?: string;
|
|
@@ -14,7 +15,7 @@ export interface DaggerObjectPropertyBase {
|
|
|
14
15
|
export type DaggerObjectPropertiesBase = {
|
|
15
16
|
[name: string]: DaggerObjectPropertyBase;
|
|
16
17
|
};
|
|
17
|
-
export interface DaggerObjectBase {
|
|
18
|
+
export interface DaggerObjectBase extends Locatable {
|
|
18
19
|
name: string;
|
|
19
20
|
description: string;
|
|
20
21
|
_constructor: DaggerConstructor | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectBase.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/objectBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"objectBase.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/objectBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,MAAM,WAAW,wBAAyB,SAAQ,SAAS;IACzD,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;IAE3B,mBAAmB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAA;CAClD;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,CAAC,IAAI,EAAE,MAAM,GAAG,wBAAwB,CAAA;CACzC,CAAA;AAED,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IACjD,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,iBAAiB,GAAG,SAAS,CAAA;IAC3C,OAAO,EAAE,eAAe,CAAA;IACxB,UAAU,EAAE,0BAA0B,CAAA;IAEtC,IAAI,IAAI,OAAO,GAAG,QAAQ,CAAA;IAE1B,mBAAmB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAA;CAClD;AAED,MAAM,MAAM,iBAAiB,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAAA;CAAE,CAAA"}
|
|
@@ -2,12 +2,13 @@ import ts from "typescript";
|
|
|
2
2
|
import { TypeDefKind } from "../../../api/client.gen.js";
|
|
3
3
|
import { TypeDef } from "../typedef.js";
|
|
4
4
|
import { AST } from "../typescript_module/index.js";
|
|
5
|
+
import { Locatable } from "./locatable.js";
|
|
5
6
|
import { DaggerObjectPropertyBase } from "./objectBase.js";
|
|
6
7
|
import { References } from "./reference.js";
|
|
7
8
|
export type DaggerProperties = {
|
|
8
9
|
[name: string]: DaggerProperty;
|
|
9
10
|
};
|
|
10
|
-
export declare class DaggerProperty implements DaggerObjectPropertyBase {
|
|
11
|
+
export declare class DaggerProperty extends Locatable implements DaggerObjectPropertyBase {
|
|
11
12
|
private readonly node;
|
|
12
13
|
private readonly ast;
|
|
13
14
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/property.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EACL,GAAG,EAGJ,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE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,GAAG,IAAI;IAmBjD,MAAM;;;;;;;CASd"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { IntrospectionError } from "../../../common/errors/index.js";
|
|
2
2
|
import { AST, isTypeDefResolved, resolveTypeDef, } from "../typescript_module/index.js";
|
|
3
3
|
import { FIELD_DECORATOR, FUNCTION_DECORATOR } from "./decorator.js";
|
|
4
|
-
|
|
4
|
+
import { Locatable } from "./locatable.js";
|
|
5
|
+
export class DaggerProperty extends Locatable {
|
|
5
6
|
node;
|
|
6
7
|
ast;
|
|
7
8
|
name;
|
|
@@ -12,6 +13,7 @@ export class DaggerProperty {
|
|
|
12
13
|
_typeRef;
|
|
13
14
|
type;
|
|
14
15
|
constructor(node, ast) {
|
|
16
|
+
super(node);
|
|
15
17
|
this.node = node;
|
|
16
18
|
this.ast = ast;
|
|
17
19
|
if (!this.node.name) {
|
|
@@ -1,9 +1,30 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
-
import { AST } from "../typescript_module/index.js";
|
|
2
|
+
import { AST, Location } from "../typescript_module/index.js";
|
|
3
|
+
import { Locatable } from "./locatable.js";
|
|
3
4
|
import { DaggerObjectBase } from "./objectBase.js";
|
|
4
5
|
import { References } from "./reference.js";
|
|
5
6
|
import { DaggerObjectTypeProperties } from "./typeObjectProperty.js";
|
|
6
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Represents an object defined using the `type` keyword.
|
|
9
|
+
*
|
|
10
|
+
* Type object can only contains fields, no methods are allowed.
|
|
11
|
+
* All fields are public and exposed to the Dagger API.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* @object()
|
|
16
|
+
* export class MyObject {
|
|
17
|
+
* @func()
|
|
18
|
+
* public name: string
|
|
19
|
+
*
|
|
20
|
+
* @func()
|
|
21
|
+
* async getName(): Promise<string> {
|
|
22
|
+
* return this.name
|
|
23
|
+
* }
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare class DaggerTypeObject extends Locatable implements DaggerObjectBase {
|
|
7
28
|
private readonly node;
|
|
8
29
|
private readonly ast;
|
|
9
30
|
name: string;
|
|
@@ -14,6 +35,7 @@ export declare class DaggerTypeObject implements DaggerObjectBase {
|
|
|
14
35
|
private symbol;
|
|
15
36
|
kind(): "class" | "object";
|
|
16
37
|
constructor(node: ts.TypeAliasDeclaration, ast: AST);
|
|
38
|
+
getLocation(): Location;
|
|
17
39
|
getReferences(): string[];
|
|
18
40
|
propagateReferences(references: References): void;
|
|
19
41
|
toJSON(): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeObject.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/typeObject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAG3B,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;
|
|
1
|
+
{"version":3,"file":"typeObject.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/typeObject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAG3B,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EACL,0BAA0B,EAE3B,MAAM,yBAAyB,CAAA;AAEhC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,gBAAiB,SAAQ,SAAU,YAAW,gBAAgB;IAcvE,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAdf,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,YAAY;IACxB,OAAO,KAAK;IACZ,UAAU,EAAE,0BAA0B,CAAK;IAElD,OAAO,CAAC,MAAM,CAAW;IAEzB,IAAI,IAAI,OAAO,GAAG,QAAQ;gBAKP,IAAI,EAAE,EAAE,CAAC,oBAAoB,EAC7B,GAAG,EAAE,GAAG;IA6BpB,WAAW,IAAI,QAAQ;IAIvB,aAAa,IAAI,MAAM,EAAE;IAazB,mBAAmB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAMxD,MAAM;;;;;CAOP"}
|
|
@@ -1,8 +1,29 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
import { IntrospectionError } from "../../../common/errors/index.js";
|
|
3
3
|
import { AST } from "../typescript_module/index.js";
|
|
4
|
+
import { Locatable } from "./locatable.js";
|
|
4
5
|
import { DaggerObjectTypeProperty, } from "./typeObjectProperty.js";
|
|
5
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Represents an object defined using the `type` keyword.
|
|
8
|
+
*
|
|
9
|
+
* Type object can only contains fields, no methods are allowed.
|
|
10
|
+
* All fields are public and exposed to the Dagger API.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* @object()
|
|
15
|
+
* export class MyObject {
|
|
16
|
+
* @func()
|
|
17
|
+
* public name: string
|
|
18
|
+
*
|
|
19
|
+
* @func()
|
|
20
|
+
* async getName(): Promise<string> {
|
|
21
|
+
* return this.name
|
|
22
|
+
* }
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export class DaggerTypeObject extends Locatable {
|
|
6
27
|
node;
|
|
7
28
|
ast;
|
|
8
29
|
name;
|
|
@@ -15,6 +36,7 @@ export class DaggerTypeObject {
|
|
|
15
36
|
return "object";
|
|
16
37
|
}
|
|
17
38
|
constructor(node, ast) {
|
|
39
|
+
super(node);
|
|
18
40
|
this.node = node;
|
|
19
41
|
this.ast = ast;
|
|
20
42
|
if (!this.node.name) {
|
|
@@ -33,6 +55,9 @@ export class DaggerTypeObject {
|
|
|
33
55
|
}
|
|
34
56
|
}
|
|
35
57
|
}
|
|
58
|
+
getLocation() {
|
|
59
|
+
return AST.getNodeLocation(this.node);
|
|
60
|
+
}
|
|
36
61
|
getReferences() {
|
|
37
62
|
const references = [];
|
|
38
63
|
for (const property of Object.values(this.properties)) {
|
|
@@ -2,12 +2,13 @@ import ts from "typescript";
|
|
|
2
2
|
import { TypeDefKind } from "../../../api/client.gen.js";
|
|
3
3
|
import { TypeDef } from "../typedef.js";
|
|
4
4
|
import { AST } from "../typescript_module/index.js";
|
|
5
|
+
import { Locatable } from "./locatable.js";
|
|
5
6
|
import { DaggerObjectPropertyBase } from "./objectBase.js";
|
|
6
7
|
import { References } from "./reference.js";
|
|
7
8
|
export type DaggerObjectTypeProperties = {
|
|
8
9
|
[name: string]: DaggerObjectTypeProperty;
|
|
9
10
|
};
|
|
10
|
-
export declare class DaggerObjectTypeProperty implements DaggerObjectPropertyBase {
|
|
11
|
+
export declare class DaggerObjectTypeProperty extends Locatable implements DaggerObjectPropertyBase {
|
|
11
12
|
private readonly node;
|
|
12
13
|
private readonly symbol;
|
|
13
14
|
private readonly ast;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeObjectProperty.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/typeObjectProperty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EACL,GAAG,EAGJ,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,MAAM,MAAM,0BAA0B,GAAG;IACvC,CAAC,IAAI,EAAE,MAAM,GAAG,wBAAwB,CAAA;CACzC,CAAA;AAED,qBAAa,
|
|
1
|
+
{"version":3,"file":"typeObjectProperty.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/typeObjectProperty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EACL,GAAG,EAGJ,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,MAAM,MAAM,0BAA0B,GAAG;IACvC,CAAC,IAAI,EAAE,MAAM,GAAG,wBAAwB,CAAA;CACzC,CAAA;AAED,qBAAa,wBACX,SAAQ,SACR,YAAW,wBAAwB;IAWjC,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAXf,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,YAAY;IACjB,SAAS,EAAE,OAAO,CAAO;IAEhC,OAAO,CAAC,QAAQ,CAAC,CAAQ;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;gBAGf,IAAI,EAAE,EAAE,CAAC,oBAAoB,EAC7B,MAAM,EAAE,EAAE,CAAC,MAAM,EACjB,GAAG,EAAE,GAAG;IAiBpB,YAAY,IAAI,MAAM,GAAG,SAAS;IAWlC,mBAAmB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAmBjD,MAAM;;;;;;;CASd"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IntrospectionError } from "../../../common/errors/index.js";
|
|
2
2
|
import { isTypeDefResolved, resolveTypeDef, } from "../typescript_module/index.js";
|
|
3
|
-
|
|
3
|
+
import { Locatable } from "./locatable.js";
|
|
4
|
+
export class DaggerObjectTypeProperty extends Locatable {
|
|
4
5
|
node;
|
|
5
6
|
symbol;
|
|
6
7
|
ast;
|
|
@@ -11,6 +12,7 @@ export class DaggerObjectTypeProperty {
|
|
|
11
12
|
_typeRef;
|
|
12
13
|
type;
|
|
13
14
|
constructor(node, symbol, ast) {
|
|
15
|
+
super(node);
|
|
14
16
|
this.node = node;
|
|
15
17
|
this.symbol = symbol;
|
|
16
18
|
this.ast = ast;
|
|
@@ -4,6 +4,7 @@ import { TypeDefKind } from "../../../api/client.gen.js";
|
|
|
4
4
|
import { DaggerDecorators } from "../dagger_module/index.js";
|
|
5
5
|
import { TypeDef } from "../typedef.js";
|
|
6
6
|
import { DeclarationsMap } from "./declarations.js";
|
|
7
|
+
import { Location } from "./location.js";
|
|
7
8
|
export declare const CLIENT_GEN_FILE = "client.gen.ts";
|
|
8
9
|
export type ResolvedNodeWithSymbol<T extends keyof DeclarationsMap> = {
|
|
9
10
|
type: T;
|
|
@@ -25,6 +26,19 @@ export declare class AST {
|
|
|
25
26
|
kind: T): ResolvedNodeWithSymbol<T> | undefined;
|
|
26
27
|
getTypeFromTypeAlias(typeAlias: ts.TypeAliasDeclaration): ts.Type;
|
|
27
28
|
static getNodePosition(node: ts.Node): string;
|
|
29
|
+
/**
|
|
30
|
+
* Returns the location of the node in the source file.
|
|
31
|
+
*
|
|
32
|
+
* The filepath is relative to the module root directory.
|
|
33
|
+
* Ideally, we use the identifier of the node accessible by node.name but fallback
|
|
34
|
+
* to node itself if it's not available.
|
|
35
|
+
*
|
|
36
|
+
* The TypeScript SDK based it's line and column on index 0 but editors starts
|
|
37
|
+
* at 1 so we always add 1 to fix that difference.
|
|
38
|
+
*/
|
|
39
|
+
static getNodeLocation(node: ts.Node & {
|
|
40
|
+
name?: ts.Identifier;
|
|
41
|
+
}): Location;
|
|
28
42
|
getDocFromSymbol(symbol: ts.Symbol): string;
|
|
29
43
|
getSymbolOrThrow(node: ts.Node): ts.Symbol;
|
|
30
44
|
getSignatureFromFunctionOrThrow(node: ts.SignatureDeclaration): ts.Signature;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/typescript_module/ast.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/typescript_module/ast.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,eAAe,EAAmB,MAAM,mBAAmB,CAAA;AAEpE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,eAAO,MAAM,eAAe,kBAAkB,CAAA;AAE9C,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,MAAM,eAAe,IAAI;IACpE,IAAI,EAAE,CAAC,CAAA;IACP,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,CAAA;IACxB,MAAM,EAAE,EAAE,CAAC,MAAM,CAAA;IACjB,IAAI,EAAE,EAAE,CAAC,UAAU,CAAA;CACpB,CAAA;AAED,qBAAa,GAAG;aAMI,KAAK,EAAE,MAAM,EAAE;IAC/B,OAAO,CAAC,QAAQ,CAAC,UAAU;IANtB,OAAO,EAAE,EAAE,CAAC,WAAW,CAAA;IAE9B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiB;gBAG3B,KAAK,EAAE,MAAM,EAAE,EACd,UAAU,EAAE,MAAM,EAAE;IAahC,sBAAsB,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EAAE,EAAE,CAAC,IAAI,EACb,IAAI,EAAE,EAAE,CAAC,IAAI,GACZ,OAAO,CAAC,WAAW,CAAC,GAAG,SAAS;IAoDnC,OAAO,CAAC,yCAAyC;IAoB1C,4BAA4B,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,GAAG,GAAG;CAkDpE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as path from "path";
|
|
1
2
|
import ts from "typescript";
|
|
2
3
|
import { TypeDefKind } from "../../../api/client.gen.js";
|
|
3
4
|
import { IntrospectionError } from "../../../common/errors/index.js";
|
|
@@ -71,6 +72,33 @@ export class AST {
|
|
|
71
72
|
const position = ts.getLineAndCharacterOfPosition(sourceFile, node.getStart());
|
|
72
73
|
return `${sourceFile.fileName}:${position.line}:${position.character}`;
|
|
73
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Returns the location of the node in the source file.
|
|
77
|
+
*
|
|
78
|
+
* The filepath is relative to the module root directory.
|
|
79
|
+
* Ideally, we use the identifier of the node accessible by node.name but fallback
|
|
80
|
+
* to node itself if it's not available.
|
|
81
|
+
*
|
|
82
|
+
* The TypeScript SDK based it's line and column on index 0 but editors starts
|
|
83
|
+
* at 1 so we always add 1 to fix that difference.
|
|
84
|
+
*/
|
|
85
|
+
static getNodeLocation(node) {
|
|
86
|
+
const sourceFile = node.getSourceFile();
|
|
87
|
+
// Use the identifier of the node if available.
|
|
88
|
+
const targetNode = node.name ?? node;
|
|
89
|
+
const position = ts.getLineAndCharacterOfPosition(sourceFile, targetNode.getStart(sourceFile));
|
|
90
|
+
// sourceFile.fileName is the absolute path to the file, we need to get the relative path
|
|
91
|
+
// from the module path so we exclude the module path from the given path.
|
|
92
|
+
// But since root will always start with `/src`, we want to catch the second `src`
|
|
93
|
+
// inside the module.
|
|
94
|
+
const pathParts = sourceFile.fileName.split(path.sep);
|
|
95
|
+
const srcIndex = pathParts.indexOf("src", 2);
|
|
96
|
+
return {
|
|
97
|
+
filepath: pathParts.slice(srcIndex).join(path.sep),
|
|
98
|
+
line: position.line + 1,
|
|
99
|
+
column: position.character + 1,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
74
102
|
getDocFromSymbol(symbol) {
|
|
75
103
|
return ts.displayPartsToString(symbol.getDocumentationComment(this.checker));
|
|
76
104
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/typescript_module/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/typescript_module/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/typescript_module/location.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACf,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/module/registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/module/registry.ts"],"names":[],"mappings":"AAIA,OAAO,kBAAkB,CAAA;AAIzB,MAAM,MAAM,KAAK,GAAG;IAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAA;CAAE,CAAA;AAEjD,MAAM,MAAM,KAAK,GAAG;IAAE,CAAC,QAAQ,EAA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,UAAiB,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const CLI_VERSION = "0.15.
|
|
1
|
+
export declare const CLI_VERSION = "0.15.2";
|
|
2
2
|
//# sourceMappingURL=default.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Code generated by dagger. DO NOT EDIT.
|
|
2
|
-
export const CLI_VERSION = "0.15.
|
|
2
|
+
export const CLI_VERSION = "0.15.2";
|