@dagger.io/dagger 0.6.3 → 0.8.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/connect.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { Writable } from "node:stream";
3
- import Client from "./api/client.gen.js";
3
+ import { Client } from "./api/client.gen.js";
4
4
  /**
5
5
  * ConnectOpts defines option used to connect to an engine.
6
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../connect.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,MAAM,MAAM,qBAAqB,CAAA;AAGxC;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;;;;;;OAUG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAA;CACrB;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;AAE3D,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAA;CACtB;AAED;;;;GAIG;AACH,wBAAsB,OAAO,CAC3B,EAAE,EAAE,WAAW,EACf,MAAM,GAAE,WAAgB,GACvB,OAAO,CAAC,IAAI,CAAC,CA+Bf"}
1
+ {"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../connect.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAG5C;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;;;;;;OAUG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAA;CACrB;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;AAE3D,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAA;CACtB;AAED;;;;GAIG;AACH,wBAAsB,OAAO,CAC3B,EAAE,EAAE,WAAW,EACf,MAAM,GAAE,WAAgB,GACvB,OAAO,CAAC,IAAI,CAAC,CAsCf"}
package/dist/connect.js CHANGED
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import Client from "./api/client.gen.js";
10
+ import { Client } from "./api/client.gen.js";
11
11
  import { Bin, CLI_VERSION } from "./provisioning/index.js";
12
12
  /**
13
13
  * connect runs GraphQL server and initializes a
@@ -38,6 +38,13 @@ export function connect(cb, config = {}) {
38
38
  client = yield engineConn.Connect(config);
39
39
  close = () => engineConn.Close();
40
40
  }
41
+ // Warning shall be throw if versions are not compatible
42
+ try {
43
+ yield client.checkVersionCompatibility(CLI_VERSION);
44
+ }
45
+ catch (e) {
46
+ console.error("failed to check version compatibility:", e);
47
+ }
41
48
  yield cb(client).finally(() => __awaiter(this, void 0, void 0, function* () {
42
49
  if (close) {
43
50
  close();
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  export * from "./api/client.gen.js";
2
2
  export * from "./common/errors/index.js";
3
- export { default } from "./api/client.gen.js";
4
3
  export { gql } from "graphql-tag";
5
4
  export { GraphQLClient } from "graphql-request";
6
5
  export { connect, ConnectOpts, CallbackFct } from "./connect.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,0BAA0B,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,0BAA0B,CAAA;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA"}
package/dist/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  export * from "./api/client.gen.js";
2
2
  export * from "./common/errors/index.js";
3
- export { default } from "./api/client.gen.js";
4
3
  export { gql } from "graphql-tag";
5
4
  export { GraphQLClient } from "graphql-request";
6
5
  export { connect } from "./connect.js";
@@ -1,4 +1,4 @@
1
- import Client from "../api/client.gen.js";
1
+ import { Client } from "../api/client.gen.js";
2
2
  import { ConnectOpts, EngineConn } from "./engineconn.js";
3
3
  /**
4
4
  * Bin runs an engine session from a specified binary
@@ -1 +1 @@
1
- {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../provisioning/bin.ts"],"names":[],"mappings":"AAaA,OAAO,MAAM,MAAM,sBAAsB,CAAA;AAQzC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAMzD;;GAEG;AACH,qBAAa,GAAI,YAAW,UAAU;IACpC,OAAO,CAAC,UAAU,CAAC,CAAmB;IAEtC,OAAO,CAAC,OAAO,CAAC,CAAQ;IACxB,OAAO,CAAC,UAAU,CAAC,CAAQ;IAE3B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAKxB;IAED,OAAO,CAAC,QAAQ,CAAC,qBAAq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ErC,OAAO,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM;IAKjD,IAAI,IAAI,MAAM;IAIR,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;YAgBnC,WAAW;IAgEzB;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAqBrB;;;OAGG;YACW,gBAAgB;YAwEhB,iBAAiB;IA2BzB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAU5B;;;;;;;OAOG;IACH,OAAO,CAAC,cAAc;IAItB;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAOpB;;OAEG;IACH,OAAO,CAAC,cAAc;IAWtB;;OAEG;IACH,OAAO,CAAC,cAAc;IAStB;;OAEG;IACH,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,cAAc;IAatB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,cAAc;YAOR,WAAW;YAkBX,gBAAgB;YAWhB,cAAc;IA4C5B;;OAEG;IACH,OAAO,CAAC,WAAW;CAGpB;AAGD,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEjD;AAGD,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE1D"}
@@ -26,7 +26,7 @@ import * as process from "process";
26
26
  import readline from "readline";
27
27
  import * as tar from "tar";
28
28
  import { fileURLToPath } from "url";
29
- import Client from "../api/client.gen.js";
29
+ import { Client } from "../api/client.gen.js";
30
30
  import { EngineSessionConnectionTimeoutError, EngineSessionConnectParamsParseError, EngineSessionError, InitEngineSessionBinaryError, } from "../common/errors/index.js";
31
31
  const CLI_HOST = "dl.dagger.io";
32
32
  let OVERRIDE_CLI_URL;
@@ -48,7 +48,13 @@ export class Bin {
48
48
  Connect(opts) {
49
49
  return __awaiter(this, void 0, void 0, function* () {
50
50
  if (!this.binPath) {
51
+ if (opts.LogOutput) {
52
+ opts.LogOutput.write("Downloading CLI... ");
53
+ }
51
54
  this.binPath = yield this.downloadCLI();
55
+ if (opts.LogOutput) {
56
+ opts.LogOutput.write("OK!\n");
57
+ }
52
58
  }
53
59
  return this.runEngineSession(this.binPath, opts);
54
60
  });
@@ -145,6 +151,9 @@ export class Bin {
145
151
  args.push(pair.flag, pair.value);
146
152
  }
147
153
  });
154
+ if (opts.LogOutput) {
155
+ opts.LogOutput.write("Creating new Engine session... ");
156
+ }
148
157
  this.subProcess = execaCommand(args.join(" "), {
149
158
  stdio: "pipe",
150
159
  reject: true,
@@ -159,14 +168,20 @@ export class Bin {
159
168
  input: (_b = this.subProcess) === null || _b === void 0 ? void 0 : _b.stdout,
160
169
  });
161
170
  const timeOutDuration = 300000;
171
+ if (opts.LogOutput) {
172
+ opts.LogOutput.write("OK!\nEstablishing connection to Engine... ");
173
+ }
162
174
  const connectParams = (yield Promise.race([
163
175
  this.readConnectParams(stdoutReader),
164
176
  new Promise((_, reject) => {
165
177
  setTimeout(() => {
166
- reject(new EngineSessionConnectionTimeoutError("timeout reading connect params from engine session", { timeOutDuration }));
178
+ reject(new EngineSessionConnectionTimeoutError("Engine connection timeout", { timeOutDuration }));
167
179
  }, timeOutDuration).unref(); // long timeout to account for extensions, though that should be optimized in future
168
180
  }),
169
181
  ]));
182
+ if (opts.LogOutput) {
183
+ opts.LogOutput.write("OK!\n");
184
+ }
170
185
  return new Client({
171
186
  host: `127.0.0.1:${connectParams.port}`,
172
187
  sessionToken: connectParams.session_token,
@@ -1,2 +1,2 @@
1
- export declare const CLI_VERSION = "0.6.3";
1
+ export declare const CLI_VERSION = "0.8.0";
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.6.3";
2
+ export const CLI_VERSION = "0.8.0";
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { Writable } from "node:stream";
3
- import Client from "../api/client.gen.js";
3
+ import { Client } from "../api/client.gen.js";
4
4
  export interface ConnectOpts {
5
5
  Workdir?: string;
6
6
  Project?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"engineconn.d.ts","sourceRoot":"","sources":["../../provisioning/engineconn.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,MAAM,MAAM,sBAAsB,CAAA;AAEzC,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,QAAQ,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,IAAI,EAAE,MAAM,MAAM,CAAA;IAElB;;;OAGG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAE/C;;OAEG;IACH,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3B"}
1
+ {"version":3,"file":"engineconn.d.ts","sourceRoot":"","sources":["../../provisioning/engineconn.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAE7C,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,QAAQ,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,IAAI,EAAE,MAAM,MAAM,CAAA;IAElB;;;OAGG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAE/C;;OAEG;IACH,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dagger.io/dagger",
3
- "version": "0.6.3",
3
+ "version": "0.8.0",
4
4
  "author": "hello@dagger.io",
5
5
  "license": "Apache-2.0",
6
6
  "types": "./dist/index.d.ts",
@@ -19,7 +19,7 @@
19
19
  "@lifeomic/axios-fetch": "^3.0.1",
20
20
  "adm-zip": "^0.5.10",
21
21
  "env-paths": "^3.0.0",
22
- "execa": "^7.1.1",
22
+ "execa": "^7.2.0",
23
23
  "graphql": "^16.7.1",
24
24
  "graphql-request": "^6.1.0",
25
25
  "graphql-tag": "^2.12.6",
@@ -33,19 +33,19 @@
33
33
  "test": "mocha",
34
34
  "lint": "yarn eslint --max-warnings=0 .",
35
35
  "fmt": "yarn eslint --fix .",
36
- "docs:lint": "yarn eslint --max-warnings=0 --resolve-plugins-relative-to=./ ../../docs/current",
37
- "docs:fmt": "yarn eslint --fix --resolve-plugins-relative-to=./ ../../docs/current ."
36
+ "docs:lint": "yarn eslint --max-warnings=0 --resolve-plugins-relative-to=./ --ext=.js,.ts,.mjs,.mts ../../docs/current",
37
+ "docs:fmt": "yarn eslint --fix --resolve-plugins-relative-to=./ --ext=.js,.ts,.mjs,.mts ../../docs/current ."
38
38
  },
39
39
  "devDependencies": {
40
- "@trivago/prettier-plugin-sort-imports": "^4.1.1",
40
+ "@trivago/prettier-plugin-sort-imports": "^4.2.0",
41
41
  "@types/adm-zip": "^0.5.0",
42
42
  "@types/mocha": "latest",
43
43
  "@types/node": "~16",
44
44
  "@types/tar": "^6.1.4",
45
- "@typescript-eslint/eslint-plugin": "^5.60.1",
46
- "@typescript-eslint/parser": "^5.60.1",
47
- "eslint": "^8.44.0",
48
- "eslint-config-prettier": "^8.7.0",
45
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
46
+ "@typescript-eslint/parser": "^5.62.0",
47
+ "eslint": "^8.46.0",
48
+ "eslint-config-prettier": "^8.9.0",
49
49
  "eslint-plugin-prettier": "^4.2.1",
50
50
  "mocha": "^10.2.0",
51
51
  "prettier": "^2.8.7",