@dagger.io/dagger 0.11.3 → 0.11.5
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/entrypoint/entrypoint.js +1 -1
- package/dist/entrypoint/load.d.ts.map +1 -1
- package/dist/entrypoint/load.js +15 -12
- package/dist/introspector/scanner/scan.d.ts.map +1 -1
- package/dist/introspector/scanner/scan.js +6 -3
- package/dist/introspector/scanner/typeDefs.d.ts +0 -1
- package/dist/introspector/scanner/typeDefs.d.ts.map +1 -1
- package/dist/introspector/scanner/utils.d.ts +1 -1
- package/dist/introspector/scanner/utils.d.ts.map +1 -1
- package/dist/introspector/scanner/utils.js +24 -15
- package/dist/provisioning/default.d.ts +1 -1
- package/dist/provisioning/default.js +1 -1
- package/package.json +2 -2
- package/dist/introspector/scanner/serialize.d.ts +0 -10
- package/dist/introspector/scanner/serialize.d.ts.map +0 -1
- package/dist/introspector/scanner/serialize.js +0 -15
|
@@ -21,7 +21,7 @@ export async function entrypoint() {
|
|
|
21
21
|
const fnCall = dag.currentFunctionCall();
|
|
22
22
|
const moduleName = await dag.currentModule().name();
|
|
23
23
|
const parentName = await fnCall.parentName();
|
|
24
|
-
const scanResult =
|
|
24
|
+
const scanResult = scan(files, moduleName);
|
|
25
25
|
// Pre allocate the result, we got one in both case.
|
|
26
26
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
27
|
let result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../entrypoint/load.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,WAAW,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,oDAAoD,CAAA;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,+CAA+C,CAAA;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C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,EAAE,MAAM,+CAA+C,CAAA;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC;;;;;GAKG;AACH,wBAAsB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,MAAM,GACjB,YAAY,CAEd;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,SAAS,GACb,CAAC,MAAM,GAAG,WAAW,CAAC,GAAG,SAAS,CAMpC;AAED;;;;;GAKG;AACH,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,MAAM,GAAG,WAAW,EAC5B,GAAG,EAAE,SAAS,GACb,OAAO,CAAC,IAAI,CAAC,CAqCf;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,SAAS,GACb,OAAO,CAAC,IAAI,CAAC,CAaf;AAED;;;;GAIG;AACH,wBAAsB,SAAS,CAC7B,KAAK,EAAE,GAAG,EACV,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,GACzB,OAAO,CAAC,GAAG,CAAC,CAuCd;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,MAAM,GACb,YAAY,CAmBd;AAED,wBAAsB,UAAU,CAC9B,MAAM,EAAE,GAAG,EACX,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,GAAG,CAAC,CAsEd"}
|
package/dist/entrypoint/load.js
CHANGED
|
@@ -102,23 +102,12 @@ export async function loadValue(value, type) {
|
|
|
102
102
|
// TODO(supports subfields serialization)
|
|
103
103
|
return value;
|
|
104
104
|
}
|
|
105
|
-
case TypeDefKind.ScalarKind: {
|
|
106
|
-
const scalarType = type.name;
|
|
107
|
-
// Workaround to call get any scalar that has an id
|
|
108
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
109
|
-
// @ts-ignore
|
|
110
|
-
if (dag[`load${scalarType}FromID`]) {
|
|
111
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
112
|
-
// @ts-ignore
|
|
113
|
-
return dag[`load${scalarType}FromID`](value);
|
|
114
|
-
}
|
|
115
|
-
return value;
|
|
116
|
-
}
|
|
117
105
|
// Cannot use `,` to specify multiple matching case so instead we use fallthrough.
|
|
118
106
|
case TypeDefKind.StringKind:
|
|
119
107
|
case TypeDefKind.IntegerKind:
|
|
120
108
|
case TypeDefKind.BooleanKind:
|
|
121
109
|
case TypeDefKind.VoidKind:
|
|
110
|
+
case TypeDefKind.ScalarKind:
|
|
122
111
|
return value;
|
|
123
112
|
default:
|
|
124
113
|
throw new Error(`unsupported type ${type.kind}`);
|
|
@@ -170,10 +159,24 @@ export async function loadResult(result, module, object) {
|
|
|
170
159
|
throw new Error(`could not find result property ${key}`);
|
|
171
160
|
}
|
|
172
161
|
let referencedObject = undefined;
|
|
162
|
+
// Handle nested objects
|
|
173
163
|
if (property.type.kind === TypeDefKind.ObjectKind) {
|
|
174
164
|
referencedObject =
|
|
175
165
|
module.objects[property.type.name];
|
|
176
166
|
}
|
|
167
|
+
// Handle list of nested objects
|
|
168
|
+
if (property.type.kind === TypeDefKind.ListKind) {
|
|
169
|
+
let _property = property.type;
|
|
170
|
+
// Loop until we find the original type.
|
|
171
|
+
while (_property.kind === TypeDefKind.ListKind) {
|
|
172
|
+
_property = _property.typeDef;
|
|
173
|
+
}
|
|
174
|
+
// If the original type is an object, we use it as the referenced object.
|
|
175
|
+
if (_property.kind === TypeDefKind.ObjectKind) {
|
|
176
|
+
referencedObject =
|
|
177
|
+
module.objects[_property.name];
|
|
178
|
+
}
|
|
179
|
+
}
|
|
177
180
|
// If there's no referenced object, we use the current object.
|
|
178
181
|
if (!referencedObject) {
|
|
179
182
|
referencedObject = object;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../../introspector/scanner/scan.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../../introspector/scanner/scan.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE7D,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE;QACN,WAAW,CAAC,EAAE,MAAM,CAAA;KACrB,CAAA;IACD,OAAO,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAAA;KAAE,CAAA;IACzC,SAAS,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAAA;KAAE,CAAA;CAC/C,CAAA;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,UAAU,SAAK,GAAG,YAAY,CAenE"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
-
import { UnknownDaggerError } from "../../common/errors/UnknownDaggerError.js";
|
|
3
2
|
import { DaggerModule } from "./abtractions/module.js";
|
|
4
3
|
/**
|
|
5
4
|
* Scan the list of TypeScript File using the TypeScript compiler API.
|
|
@@ -14,10 +13,14 @@ import { DaggerModule } from "./abtractions/module.js";
|
|
|
14
13
|
*/
|
|
15
14
|
export function scan(files, moduleName = "") {
|
|
16
15
|
if (files.length === 0) {
|
|
17
|
-
throw new
|
|
16
|
+
throw new Error("no files to introspect found");
|
|
18
17
|
}
|
|
19
18
|
// Interpret the given typescript source files.
|
|
20
19
|
const program = ts.createProgram(files, { experimentalDecorators: true });
|
|
21
20
|
const checker = program.getTypeChecker();
|
|
22
|
-
|
|
21
|
+
const module = new DaggerModule(checker, moduleName, program.getSourceFiles());
|
|
22
|
+
if (Object.keys(module.objects).length === 0) {
|
|
23
|
+
throw new Error("no objects found in the module");
|
|
24
|
+
}
|
|
25
|
+
return module;
|
|
23
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeDefs.d.ts","sourceRoot":"","sources":["../../../introspector/scanner/typeDefs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,WAAW,CAAA;CAClB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG;IACxC,IAAI,EAAE,WAAW,CAAC,UAAU,CAAA;IAC5B,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG;IACxC,IAAI,EAAE,WAAW,CAAC,UAAU,CAAA;IAC5B,
|
|
1
|
+
{"version":3,"file":"typeDefs.d.ts","sourceRoot":"","sources":["../../../introspector/scanner/typeDefs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,WAAW,CAAA;CAClB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG;IACxC,IAAI,EAAE,WAAW,CAAC,UAAU,CAAA;IAC5B,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG;IACxC,IAAI,EAAE,WAAW,CAAC,UAAU,CAAA;IAC5B,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,WAAW,GAA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E,CAAA;CAC7C,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAAA;KAAE,CAAA;IACxC,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,OAAO,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAAA;KAAE,CAAA;CAC7C,CAAA"}
|
|
@@ -18,5 +18,5 @@ export declare function isFunction(method: ts.MethodDeclaration): boolean;
|
|
|
18
18
|
/**
|
|
19
19
|
* Convert a type into a Dagger Typedef using dynamic typing.
|
|
20
20
|
*/
|
|
21
|
-
export declare function typeToTypedef(checker: ts.TypeChecker, type: ts.Type
|
|
21
|
+
export declare function typeToTypedef(checker: ts.TypeChecker, type: ts.Type): TypeDef<TypeDefKind>;
|
|
22
22
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../introspector/scanner/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../introspector/scanner/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,gBAAgB,GAAG,OAAO,CAU7D;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAoBlD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC,iBAAiB,GAAG,OAAO,CAUhE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,IAAI,EAAE,EAAE,CAAC,IAAI,GACZ,OAAO,CAAC,WAAW,CAAC,CAgDtB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
import { TypeDefKind } from "../../api/client.gen.js";
|
|
3
|
-
import { serializeType } from "./serialize.js";
|
|
4
3
|
/**
|
|
5
4
|
* Return true if the given class declaration has the decorator @obj() on
|
|
6
5
|
* top of its declaration.
|
|
@@ -48,16 +47,31 @@ export function isFunction(method) {
|
|
|
48
47
|
/**
|
|
49
48
|
* Convert a type into a Dagger Typedef using dynamic typing.
|
|
50
49
|
*/
|
|
51
|
-
export function typeToTypedef(checker, type
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
export function typeToTypedef(checker, type) {
|
|
51
|
+
if (type.symbol?.name === "Promise") {
|
|
52
|
+
const typeArgs = checker.getTypeArguments(type);
|
|
53
|
+
if (typeArgs.length > 0) {
|
|
54
|
+
return typeToTypedef(checker, typeArgs[0]);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (type.symbol?.name === "Array") {
|
|
58
|
+
const typeArgs = checker.getTypeArguments(type);
|
|
59
|
+
if (typeArgs.length === 0) {
|
|
60
|
+
throw new Error("Generic array not supported");
|
|
61
|
+
}
|
|
55
62
|
return {
|
|
56
63
|
kind: TypeDefKind.ListKind,
|
|
57
|
-
typeDef: typeToTypedef(checker,
|
|
64
|
+
typeDef: typeToTypedef(checker, typeArgs[0]),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
if (type.symbol?.name && type.isClassOrInterface()) {
|
|
68
|
+
return {
|
|
69
|
+
kind: TypeDefKind.ObjectKind,
|
|
70
|
+
name: type.symbol.name,
|
|
58
71
|
};
|
|
59
72
|
}
|
|
60
|
-
|
|
73
|
+
const strType = checker.typeToString(type);
|
|
74
|
+
switch (strType) {
|
|
61
75
|
case "string":
|
|
62
76
|
return { kind: TypeDefKind.StringKind };
|
|
63
77
|
case "number":
|
|
@@ -67,18 +81,13 @@ export function typeToTypedef(checker, type, typeName = serializeType(checker, t
|
|
|
67
81
|
case "void":
|
|
68
82
|
return { kind: TypeDefKind.VoidKind };
|
|
69
83
|
default:
|
|
70
|
-
// If it's
|
|
84
|
+
// If it's a union, then it's a scalar type
|
|
71
85
|
if (type.isUnionOrIntersection()) {
|
|
72
86
|
return {
|
|
73
87
|
kind: TypeDefKind.ScalarKind,
|
|
74
|
-
name:
|
|
75
|
-
typeDef: typeToTypedef(checker, type.types[0]),
|
|
88
|
+
name: strType,
|
|
76
89
|
};
|
|
77
90
|
}
|
|
78
|
-
|
|
79
|
-
return {
|
|
80
|
-
kind: TypeDefKind.ObjectKind,
|
|
81
|
-
name: typeName,
|
|
82
|
-
};
|
|
91
|
+
throw new Error(`Unsupported type ${strType}`);
|
|
83
92
|
}
|
|
84
93
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const CLI_VERSION = "0.11.
|
|
1
|
+
export declare const CLI_VERSION = "0.11.5";
|
|
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.11.
|
|
2
|
+
export const CLI_VERSION = "0.11.5";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dagger.io/dagger",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.5",
|
|
4
4
|
"author": "hello@dagger.io",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"adm-zip": "^0.5.10",
|
|
28
28
|
"env-paths": "^3.0.0",
|
|
29
29
|
"execa": "^8.0.1",
|
|
30
|
-
"graphql": "^16.8.
|
|
30
|
+
"graphql": "^16.8.1",
|
|
31
31
|
"graphql-request": "^6.1.0",
|
|
32
32
|
"graphql-tag": "^2.12.6",
|
|
33
33
|
"node-color-log": "^12.0.0",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
/**
|
|
3
|
-
* Convert the TypeScript type from the compiler API into a readable textual
|
|
4
|
-
* type.
|
|
5
|
-
*
|
|
6
|
-
* @param checker The typescript compiler checker.
|
|
7
|
-
* @param type The type to convert.
|
|
8
|
-
*/
|
|
9
|
-
export declare function serializeType(checker: ts.TypeChecker, type: ts.Type): string;
|
|
10
|
-
//# sourceMappingURL=serialize.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../../introspector/scanner/serialize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,MAAM,CAS5E"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Convert the TypeScript type from the compiler API into a readable textual
|
|
3
|
-
* type.
|
|
4
|
-
*
|
|
5
|
-
* @param checker The typescript compiler checker.
|
|
6
|
-
* @param type The type to convert.
|
|
7
|
-
*/
|
|
8
|
-
export function serializeType(checker, type) {
|
|
9
|
-
const strType = checker.typeToString(type);
|
|
10
|
-
// Remove Promise<> wrapper around type if it's a promise.
|
|
11
|
-
if (strType.startsWith("Promise")) {
|
|
12
|
-
return strType.substring("Promise<".length, strType.length - 1);
|
|
13
|
-
}
|
|
14
|
-
return strType;
|
|
15
|
-
}
|