@dagger.io/dagger 0.9.7 → 0.9.8

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.
@@ -5,6 +5,7 @@ export declare const log: (stack?: string) => {
5
5
  noColor: boolean;
6
6
  setLevel(level: "error" | "debug" | "info" | "warn" | "disable" | "success"): void;
7
7
  createNamedLogger(name: string): any;
8
+ setLogStream(stream: Stream): any;
8
9
  setLevelNoColor(): void;
9
10
  setLevelColor(): void;
10
11
  isLevelValid(level: "error" | "debug" | "info" | "warn" | "disable" | "success"): boolean;
@@ -18,6 +19,8 @@ export declare const log: (stack?: string) => {
18
19
  strikethrough?: boolean | undefined;
19
20
  }): string;
20
21
  joint(): any;
22
+ append(...args: any[]): any;
23
+ reset(): any;
21
24
  setDate(callback: Function): void;
22
25
  getDate(): string;
23
26
  color(ticket: "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white"): any;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../common/utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,WAAY,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACe,CAAA"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../common/utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,WAAY,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACe,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../entrypoint/load.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,WAAW,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAA;AAE7D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,GACb,MAAM,EAAE,CAiBV;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,WAAW,CAAC,CA2BtB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,WAAW,CAAC,CAYtB;AAED;;;;GAIG;AACH,wBAAsB,OAAO,CAC3B,KAAK,EAAE,GAAG,EACV,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,GACzB,OAAO,CAAC,GAAG,CAAC,CAsCd;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAY1D"}
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
1
2
  import { dag, TypeDefKind } from "../api/client.gen.js";
2
3
  /**
3
4
  * Import all given typescript files so that trigger their decorators
@@ -88,16 +89,14 @@ export function loadPropertyType(scanResult, parentName, propertyName) {
88
89
  *
89
90
  * Note: The JSON.parse() is required to remove extra quotes
90
91
  */
91
- export async function loadArg(
92
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
93
- value, type
94
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
95
- ) {
92
+ export async function loadArg(value, type) {
93
+ // If value is undefinied, return it directly.
94
+ if (value === undefined) {
95
+ return value;
96
+ }
96
97
  switch (type.kind) {
97
98
  case TypeDefKind.ListKind:
98
- return Promise.all(value.map(
99
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
100
- async (v) => await loadArg(v, type.typeDef)));
99
+ return Promise.all(value.map(async (v) => await loadArg(v, type.typeDef)));
101
100
  case TypeDefKind.ObjectKind: {
102
101
  const objectType = type.name;
103
102
  // Workaround to call get any object that has an id
@@ -127,7 +126,6 @@ value, type
127
126
  * @param result The result of the invocation.
128
127
  * @returns Loaded result.
129
128
  */
130
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
131
129
  export async function loadResult(result) {
132
130
  if (result && typeof result?.id === "function") {
133
131
  result = await result.id();
@@ -3,8 +3,8 @@ import { dag, TypeDefKind, } from "../api/client.gen.js";
3
3
  * Register the module files and returns its ID
4
4
  */
5
5
  export async function register(files, scanResult) {
6
- // Get the current module
7
- let mod = dag.currentModule();
6
+ // Get a new module that we will fill in with all the types
7
+ let mod = dag.module_();
8
8
  // For each class scanned, register its type, method and properties in the module.
9
9
  Object.values(scanResult.classes).map((modClass) => {
10
10
  // Register the class Typedef object in Dagger
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../introspector/registry/registry.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAA;AAKzB,MAAM,MAAM,KAAK,GAAG;IAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAA;CAAE,CAAA;AAGjD,MAAM,MAAM,KAAK,GAAG;IAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAA;AAE/C,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAW1C;;;;;;;;;;;;;GAaG;AACH,qBAAa,QAAQ;IACnB;;;;OAIG;IACH,MAAM,yCA+BL;IAED;;;OAGG;IAEH,KAAK,WAAY,MAAM,eAAe,MAAM,UAE3C;IAED;;;OAGG;IACH,IAAI,WAEM,MAAM,eAED,MAAM,GAAG,MAAM,cAEhB,kBAAkB,UAK/B;IAED;;;;;;;;;;OAUG;IACG,SAAS,CACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,IAAI,GAEX,OAAO,CAAC,GAAG,CAAC;CAkChB;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,UAAiB,CAAA"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../introspector/registry/registry.ts"],"names":[],"mappings":"AAGA,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,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAA;AAE/C,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAW1C;;;;;;;;;;;;;GAaG;AACH,qBAAa,QAAQ;IACnB;;;;OAIG;IACH,MAAM,yCA+BL;IAED;;;OAGG;IACH,KAAK,WAAY,MAAM,eAAe,MAAM,UAE3C;IAED;;;OAGG;IACH,IAAI,WACM,MAAM,eACD,MAAM,GAAG,MAAM,cAChB,kBAAkB,UAK/B;IAED;;;;;;;;;;OAUG;IACG,SAAS,CACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,IAAI,GACX,OAAO,CAAC,GAAG,CAAC;CAiChB;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,UAAiB,CAAA"}
@@ -1,3 +1,5 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
1
3
  import "reflect-metadata";
2
4
  import { UnknownDaggerError } from "../../common/errors/UnknownDaggerError.js";
3
5
  /**
@@ -44,7 +46,6 @@ export class Registry {
44
46
  * The definition of @field decorator that should be on top of any
45
47
  * class' property that must be exposed to the Dagger API.
46
48
  */
47
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
48
49
  field = (target, propertyKey) => {
49
50
  // A placeholder to declare fields
50
51
  };
@@ -52,13 +53,7 @@ export class Registry {
52
53
  * The definition of @func decorator that should be on top of any
53
54
  * class' method that must be exposed to the Dagger API.
54
55
  */
55
- func = (
56
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
57
- target,
58
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
59
- propertyKey,
60
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
61
- descriptor) => {
56
+ func = (target, propertyKey, descriptor) => {
62
57
  // The logic is done in the object constructor since it's not possible to
63
58
  // access the class parent's name from a method constructor without calling
64
59
  // the method itself
@@ -74,9 +69,7 @@ export class Registry {
74
69
  * @param state The current state of the class
75
70
  * @param inputs The input to send to the method to call
76
71
  */
77
- async getResult(object, method, state, inputs
78
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
79
- ) {
72
+ async getResult(object, method, state, inputs) {
80
73
  // Retrieve the resolver class from its key
81
74
  const resolver = Reflect.getMetadata(object, this);
82
75
  if (!resolver) {
@@ -92,7 +85,6 @@ export class Registry {
92
85
  throw new UnknownDaggerError(`${method} is not registered in the resolver ${object}`, {});
93
86
  }
94
87
  // Instantiate the class
95
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
96
88
  let r = new resolver.class_();
97
89
  // Apply state to the class
98
90
  r = Object.assign(r, state);
@@ -1,2 +1,2 @@
1
- export declare const CLI_VERSION = "0.9.7";
1
+ export declare const CLI_VERSION = "0.9.8";
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.9.7";
2
+ export const CLI_VERSION = "0.9.8";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dagger.io/dagger",
3
- "version": "0.9.7",
3
+ "version": "0.9.8",
4
4
  "author": "hello@dagger.io",
5
5
  "license": "Apache-2.0",
6
6
  "types": "./dist/index.d.ts",
@@ -23,10 +23,11 @@
23
23
  "graphql": "^16.8.0",
24
24
  "graphql-request": "^6.1.0",
25
25
  "graphql-tag": "^2.12.6",
26
- "node-color-log": "^10.0.2",
26
+ "node-color-log": "^11.0.0",
27
27
  "node-fetch": "^3.3.1",
28
28
  "reflect-metadata": "^0.2.1",
29
- "tar": "^6.1.13"
29
+ "tar": "^6.1.13",
30
+ "typescript": "^5.3.3"
30
31
  },
31
32
  "scripts": {
32
33
  "build": "tsc",
@@ -41,7 +42,7 @@
41
42
  "@trivago/prettier-plugin-sort-imports": "^4.2.0",
42
43
  "@types/adm-zip": "^0.5.0",
43
44
  "@types/mocha": "latest",
44
- "@types/node": "~16",
45
+ "@types/node": "~20",
45
46
  "@types/tar": "^6.1.4",
46
47
  "@typescript-eslint/eslint-plugin": "^5.62.0",
47
48
  "@typescript-eslint/parser": "^5.62.0",
@@ -50,7 +51,6 @@
50
51
  "eslint-plugin-prettier": "^4.2.1",
51
52
  "mocha": "^10.2.0",
52
53
  "prettier": "^2.8.7",
53
- "ts-node": "^10.9.1",
54
- "typescript": "^5.3.3"
54
+ "ts-node": "^10.9.1"
55
55
  }
56
56
  }