@speedkit/cli 4.44.0-beta.1 → 4.44.0-beta.3

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.
Files changed (28) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/services/bundler/bundle-service-factory.d.ts +1 -3
  3. package/dist/services/bundler/bundle-service-factory.js +3 -6
  4. package/dist/services/bundler/bundle-service.d.ts +2 -2
  5. package/dist/services/bundler/bundle-service.js +2 -2
  6. package/dist/services/bundler/packjockel-service.d.ts +24 -22
  7. package/dist/services/bundler/packjockel-service.js +53 -68
  8. package/dist/services/bundler/spec/packjockel-service.spec.js +39 -45
  9. package/dist/services/cli/cli-environment.js +0 -1
  10. package/dist/services/cli/cli-settings.d.ts +0 -5
  11. package/dist/services/cli/cli-settings.js +0 -1
  12. package/dist/services/deploy/deploy-service-factory.js +1 -1
  13. package/dist/services/deploy/mr/merge-request-deploy-service-factory.js +1 -1
  14. package/dist/services/document-handler-runtime/document-handler-runtime-model.d.ts +0 -2
  15. package/dist/services/document-handler-runtime/document-handler-runtime-model.js +0 -2
  16. package/dist/services/document-handler-runtime/document-handler-server.d.ts +2 -2
  17. package/dist/services/document-handler-runtime/document-handler-server.js +10 -10
  18. package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.js +1 -1
  19. package/dist/services/integration-api/integration-api-factory.js +1 -1
  20. package/dist/services/integration-api/spec/speed-kit-config-file.spec.js +4 -6
  21. package/dist/services/integration-api/struct/customer-config.d.ts +17 -4
  22. package/dist/services/integration-api/struct/customer-config.js +28 -6
  23. package/dist/services/integration-api/struct/speed-kit-config-file.d.ts +3 -3
  24. package/dist/services/integration-api/struct/speed-kit-config-file.js +3 -6
  25. package/dist/services/onboarding/config-renderer/speed-kit-install-context.js +1 -5
  26. package/dist/services/onboarding/onboarding-service-factory.js +1 -1
  27. package/oclif.manifest.json +144 -144
  28. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [4.44.0-beta.3](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.44.0-beta.2...v4.44.0-beta.3) (2026-10-12)
2
+
3
+
4
+ ### Features
5
+
6
+ * **integration-api:** name the feature flag enableSpeedKitConfigPlugins like the server ([23f5ffb](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/23f5ffb307aa1743f8434c7ad136a2bf251363e0))
7
+
8
+ # [4.44.0-beta.2](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.44.0-beta.1...v4.44.0-beta.2) (2026-10-09)
9
+
10
+
11
+ ### Features
12
+
13
+ * **bundler:** follow packjockel 3.0.0 and run it through binaryPath() ([200ae27](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/200ae276087eee79d4791652ff712eb0cd0237fb))
14
+
1
15
  # [4.44.0-beta.1](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.43.0...v4.44.0-beta.1) (2026-10-09)
2
16
 
3
17
 
@@ -1,11 +1,9 @@
1
1
  import { BundleService } from "./bundle-service.js";
2
2
  export declare class BundleServiceFactory {
3
3
  private customerFolder?;
4
- private packjockelPath;
5
4
  /**
6
5
  * @param customerFolder the directory bundled code resolves its own imports from
7
- * @param packjockelPath the `PACKJOCKEL_PATH` setting; empty means the installed npm package
8
6
  */
9
- constructor(customerFolder?: string, packjockelPath?: string);
7
+ constructor(customerFolder?: string);
10
8
  buildService(): BundleService;
11
9
  }
@@ -1,17 +1,14 @@
1
1
  import { BundleService } from "./bundle-service.js";
2
- import { PackjockelService, resolvePackjockelBinary, } from "./packjockel-service.js";
2
+ import { PackjockelService } from "./packjockel-service.js";
3
3
  export class BundleServiceFactory {
4
4
  customerFolder;
5
- packjockelPath;
6
5
  /**
7
6
  * @param customerFolder the directory bundled code resolves its own imports from
8
- * @param packjockelPath the `PACKJOCKEL_PATH` setting; empty means the installed npm package
9
7
  */
10
- constructor(customerFolder, packjockelPath = "") {
8
+ constructor(customerFolder) {
11
9
  this.customerFolder = customerFolder;
12
- this.packjockelPath = packjockelPath;
13
10
  }
14
11
  buildService() {
15
- return new BundleService(this.customerFolder, new PackjockelService(resolvePackjockelBinary(this.packjockelPath)));
12
+ return new BundleService(this.customerFolder, new PackjockelService());
16
13
  }
17
14
  }
@@ -12,11 +12,11 @@ export declare class BundleService {
12
12
  private readonly packjockelService?;
13
13
  /**
14
14
  * @param moduleDiscoveryDir the directory bundled code resolves its own imports from
15
- * @param packjockelService bundles instead of esbuild for customers with the `configPlugins` feature
15
+ * @param packjockelService bundles instead of esbuild for customers with the `enableSpeedKitConfigPlugins` feature
16
16
  */
17
17
  constructor(moduleDiscoveryDir: string, packjockelService?: PackjockelService);
18
18
  /**
19
- * The packjockel bundler for customers with the `configPlugins` feature.
19
+ * The packjockel bundler for customers with the `enableSpeedKitConfigPlugins` feature.
20
20
  *
21
21
  * @throws ApplicationError when the service was built without one
22
22
  */
@@ -13,14 +13,14 @@ export class BundleService {
13
13
  packjockelService;
14
14
  /**
15
15
  * @param moduleDiscoveryDir the directory bundled code resolves its own imports from
16
- * @param packjockelService bundles instead of esbuild for customers with the `configPlugins` feature
16
+ * @param packjockelService bundles instead of esbuild for customers with the `enableSpeedKitConfigPlugins` feature
17
17
  */
18
18
  constructor(moduleDiscoveryDir, packjockelService) {
19
19
  this.moduleDiscoveryDir = moduleDiscoveryDir;
20
20
  this.packjockelService = packjockelService;
21
21
  }
22
22
  /**
23
- * The packjockel bundler for customers with the `configPlugins` feature.
23
+ * The packjockel bundler for customers with the `enableSpeedKitConfigPlugins` feature.
24
24
  *
25
25
  * @throws ApplicationError when the service was built without one
26
26
  */
@@ -1,39 +1,36 @@
1
1
  /**
2
- * The packjockel binary to run.
3
- *
4
- * `@speedkit/packjockel` installs one package per platform, `@speedkit/packjockel-<platform>-<arch>`.
5
- * The CLI runs its binary directly, not the `bin` script of the meta package, which would start a
6
- * second node process for every bundle.
7
- *
8
- * @param configured the `PACKJOCKEL_PATH` setting; empty means the npm package, else the `PATH`
9
- * @param resolve resolves a module path, for tests
10
- */
11
- export declare function resolvePackjockelBinary(configured: string, resolve?: (request: string) => string): string;
12
- /**
13
- * The base path of the `speed-kit-config` imports for a pinned plugin release.
14
- *
15
- * @param configPluginsVersion a version such as `1.8.0`, or a channel such as `@release`;
16
- * empty means the `release` channel
2
+ * The tags of the Speed Kit assets that packjockel bundles, each a version such as `1.8.0` or a channel
3
+ * such as `@release`. packjockel takes `latest` for a tag that is not set. The names are the client
4
+ * config keys of packjockel.
17
5
  */
18
- export declare function speedKitConfigBasePath(configPluginsVersion?: string): string;
6
+ export interface AssetVersions {
7
+ /** Speed Kit: snippet, service worker and dynamic fetcher */
8
+ speedKitVersion?: string;
9
+ rumPluginVersion?: string;
10
+ /** predictive preloading */
11
+ ppVersion?: string;
12
+ configPluginsVersion?: string;
13
+ documentHandlerVersion?: string;
14
+ }
19
15
  export interface PackjockelBundleRequest {
20
16
  /** The entry points by file name, in output order. */
21
17
  entryPoints: Record<string, string>;
22
- basePaths?: Record<string, string>;
18
+ versions?: AssetVersions;
23
19
  define?: Record<string, string>;
24
20
  platform?: "browser" | "node";
25
21
  target?: "es5" | "es6";
26
22
  minify?: boolean;
27
23
  }
28
24
  export interface PackjockelDocumentHandlerRequest {
29
- documentHandler: string;
25
+ /** The document handler library; without it packjockel bundles the published one of `documentHandlerVersion`. */
26
+ documentHandler?: string;
30
27
  documentHandlerConfig: string;
31
28
  speedKitConfig: string;
32
29
  appName: string;
33
30
  dynamicFetcher?: string;
34
31
  dynamicFetcherConfig?: string;
35
32
  customStyle?: string;
36
- basePaths?: Record<string, string>;
33
+ versions?: AssetVersions;
37
34
  }
38
35
  /**
39
36
  * Bundles with the packjockel binary in embedded mode, so no packjockel server is needed.
@@ -42,11 +39,12 @@ export interface PackjockelDocumentHandlerRequest {
42
39
  * command line argument.
43
40
  */
44
41
  export declare class PackjockelService {
45
- private readonly binaryPath;
42
+ private readonly resolveBinary;
46
43
  /**
47
- * @param binaryPath the packjockel binary, a path or a command on the `PATH`
44
+ * @param resolveBinary returns the packjockel binary; it runs only when a bundle is needed, so
45
+ * a platform without a packjockel package fails only for the `enableSpeedKitConfigPlugins` feature
48
46
  */
49
- constructor(binaryPath: string);
47
+ constructor(resolveBinary?: () => string);
50
48
  /**
51
49
  * Bundles the entry points in their order into one script. packjockel puts a script before them
52
50
  * which exposes the `SpeedKit` global.
@@ -66,5 +64,9 @@ export declare class PackjockelService {
66
64
  * @param buildArgs writes the inputs into the directory and returns the arguments that read them
67
65
  */
68
66
  private run;
67
+ /**
68
+ * Runs the binary without stdin: packjockel reads a piped stdin as the document handler, and only
69
+ * without input it bundles the published one.
70
+ */
69
71
  private execute;
70
72
  }
@@ -1,50 +1,16 @@
1
- import { execFile } from "node:child_process";
2
- import { createRequire } from "node:module";
1
+ import { spawn } from "node:child_process";
3
2
  import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
4
3
  import { tmpdir } from "node:os";
5
4
  import { join } from "node:path";
6
- import { promisify } from "node:util";
5
+ import { binaryPath } from "@speedkit/packjockel";
7
6
  import { PackjockelError } from "./error/packjockel-error.js";
8
- const execFileAsync = promisify(execFile);
9
- /** The binary on the `PATH`, when no npm package of packjockel is installed. */
10
- const PACKJOCKEL_ON_PATH = "packjockel";
11
- /**
12
- * The packjockel binary to run.
13
- *
14
- * `@speedkit/packjockel` installs one package per platform, `@speedkit/packjockel-<platform>-<arch>`.
15
- * The CLI runs its binary directly, not the `bin` script of the meta package, which would start a
16
- * second node process for every bundle.
17
- *
18
- * @param configured the `PACKJOCKEL_PATH` setting; empty means the npm package, else the `PATH`
19
- * @param resolve resolves a module path, for tests
20
- */
21
- export function resolvePackjockelBinary(configured, resolve = createRequire(import.meta.url).resolve) {
22
- if (configured) {
23
- return configured;
24
- }
25
- const executable = process.platform === "win32" ? "packjockel.exe" : "packjockel";
26
- try {
27
- return resolve(`@speedkit/packjockel-${process.platform}-${process.arch}/bin/${executable}`);
28
- }
29
- catch {
30
- return PACKJOCKEL_ON_PATH;
31
- }
32
- }
33
- /** Where speed-kit-config publishes its plugins, one folder per version and channel. */
34
- const SPEED_KIT_CONFIG_URL = "https://www.baqend.com/speed-kit-config/";
35
- /** The channel the plugins in the `export` format are published to. */
36
- const DEFAULT_CONFIG_PLUGINS_CHANNEL = "release";
37
- /**
38
- * The base path of the `speed-kit-config` imports for a pinned plugin release.
39
- *
40
- * @param configPluginsVersion a version such as `1.8.0`, or a channel such as `@release`;
41
- * empty means the `release` channel
42
- */
43
- export function speedKitConfigBasePath(configPluginsVersion) {
44
- const folder = configPluginsVersion?.trim().replace(/^@/, "") ||
45
- DEFAULT_CONFIG_PLUGINS_CHANNEL;
46
- return `${SPEED_KIT_CONFIG_URL}${folder}/`;
47
- }
7
+ const VERSION_FLAGS = {
8
+ speedKitVersion: "--speed-kit-version",
9
+ rumPluginVersion: "--rum-plugin-version",
10
+ ppVersion: "--pp-version",
11
+ configPluginsVersion: "--config-plugins-version",
12
+ documentHandlerVersion: "--document-handler-version",
13
+ };
48
14
  /**
49
15
  * Bundles with the packjockel binary in embedded mode, so no packjockel server is needed.
50
16
  *
@@ -52,12 +18,13 @@ export function speedKitConfigBasePath(configPluginsVersion) {
52
18
  * command line argument.
53
19
  */
54
20
  export class PackjockelService {
55
- binaryPath;
21
+ resolveBinary;
56
22
  /**
57
- * @param binaryPath the packjockel binary, a path or a command on the `PATH`
23
+ * @param resolveBinary returns the packjockel binary; it runs only when a bundle is needed, so
24
+ * a platform without a packjockel package fails only for the `enableSpeedKitConfigPlugins` feature
58
25
  */
59
- constructor(binaryPath) {
60
- this.binaryPath = binaryPath;
26
+ constructor(resolveBinary = binaryPath) {
27
+ this.resolveBinary = resolveBinary;
61
28
  }
62
29
  /**
63
30
  * Bundles the entry points in their order into one script. packjockel puts a script before them
@@ -81,7 +48,7 @@ export class PackjockelService {
81
48
  args.push(await writeInput(directory, name, code));
82
49
  }
83
50
  return args;
84
- }, request.basePaths);
51
+ }, request.versions);
85
52
  }
86
53
  /**
87
54
  * Bundles a document handler with its config, the embedded Speed Kit config and the default `post`.
@@ -90,14 +57,11 @@ export class PackjockelService {
90
57
  */
91
58
  async bundleDocumentHandler(request) {
92
59
  return this.run(async (directory) => {
93
- const args = [
94
- "bundle",
95
- "document-handler",
96
- await writeInput(directory, "DocumentHandler.js", request.documentHandler),
97
- `--document-handler-config=${await writeInput(directory, "documentHandlerConfig.js", request.documentHandlerConfig)}`,
98
- `--speed-kit-config=${await writeInput(directory, "speedKitConfig.js", request.speedKitConfig)}`,
99
- `--app-name=${request.appName}`,
100
- ];
60
+ const args = ["bundle", "document-handler"];
61
+ if (request.documentHandler !== undefined) {
62
+ args.push(await writeInput(directory, "DocumentHandler.js", request.documentHandler));
63
+ }
64
+ args.push(`--document-handler-config=${await writeInput(directory, "documentHandlerConfig.js", request.documentHandlerConfig)}`, `--speed-kit-config=${await writeInput(directory, "speedKitConfig.js", request.speedKitConfig)}`, `--app-name=${request.appName}`);
101
65
  const optional = {
102
66
  "dynamic-fetcher": ["dynamicFetcher.js", request.dynamicFetcher],
103
67
  "dynamic-fetcher-config": [
@@ -112,20 +76,20 @@ export class PackjockelService {
112
76
  }
113
77
  }
114
78
  return args;
115
- }, request.basePaths);
79
+ }, request.versions);
116
80
  }
117
81
  /**
118
82
  * Runs packjockel in a scratch directory, which is removed afterwards.
119
83
  *
120
84
  * @param buildArgs writes the inputs into the directory and returns the arguments that read them
121
85
  */
122
- async run(buildArgs, basePaths = {}) {
86
+ async run(buildArgs, versions = {}) {
123
87
  const directory = await mkdtemp(join(tmpdir(), "sk-packjockel-"));
124
88
  try {
125
89
  const output = join(directory, "out.js");
126
90
  const args = [
127
91
  ...(await buildArgs(directory)),
128
- ...keyValueFlags("--base-path", basePaths),
92
+ ...versionFlags(versions),
129
93
  "--embedded",
130
94
  `--output=${output}`,
131
95
  ];
@@ -136,19 +100,34 @@ export class PackjockelService {
136
100
  await rm(directory, { recursive: true, force: true });
137
101
  }
138
102
  }
139
- async execute(args) {
103
+ /**
104
+ * Runs the binary without stdin: packjockel reads a piped stdin as the document handler, and only
105
+ * without input it bundles the published one.
106
+ */
107
+ execute(args) {
108
+ let binary;
140
109
  try {
141
- await execFileAsync(this.binaryPath, args, {
142
- maxBuffer: 64 * 1024 * 1024,
143
- });
110
+ binary = this.resolveBinary();
144
111
  }
145
112
  catch (error) {
146
- const failure = error;
147
- if (failure.code === "ENOENT") {
148
- throw new PackjockelError(`packjockel not found at "${this.binaryPath}". Install @speedkit/packjockel or set PACKJOCKEL_PATH to the packjockel binary.`);
149
- }
150
- throw new PackjockelError(`packjockel failed: ${withoutLogLines(failure.stderr) || failure.message}`);
113
+ return Promise.reject(new PackjockelError(error.message));
151
114
  }
115
+ return new Promise((resolve, reject) => {
116
+ const child = spawn(binary, args, {
117
+ stdio: ["ignore", "ignore", "pipe"],
118
+ });
119
+ let stderr = "";
120
+ child.stderr.on("data", (chunk) => (stderr += chunk));
121
+ child.on("error", (error) => reject(new PackjockelError(`packjockel failed: ${error.message}`)));
122
+ child.on("close", (code) => {
123
+ if (code === 0) {
124
+ resolve();
125
+ }
126
+ else {
127
+ reject(new PackjockelError(`packjockel failed: ${withoutLogLines(stderr) || `exit code ${code}`}`));
128
+ }
129
+ });
130
+ });
152
131
  }
153
132
  }
154
133
  /** Writes one input into the scratch directory and returns the `file://` value that reads it. */
@@ -157,6 +136,12 @@ async function writeInput(directory, name, content) {
157
136
  await writeFile(path, content);
158
137
  return `file://${path}`;
159
138
  }
139
+ /** The flags of the tags that are set. */
140
+ function versionFlags(versions) {
141
+ return Object.entries(VERSION_FLAGS)
142
+ .filter(([key]) => versions[key])
143
+ .map(([key, flag]) => `${flag}=${versions[key]}`);
144
+ }
160
145
  function keyValueFlags(flag, values = {}) {
161
146
  return Object.entries(values).map(([key, value]) => `${flag}=${key}=${value}`);
162
147
  }
@@ -1,15 +1,19 @@
1
1
  import { expect } from "chai";
2
2
  import { afterEach, beforeEach, describe, it } from "mocha";
3
3
  import { chmod, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
4
+ import { existsSync } from "node:fs";
4
5
  import { tmpdir } from "node:os";
5
6
  import { join } from "node:path";
6
- import { PackjockelService, resolvePackjockelBinary, speedKitConfigBasePath, } from "../packjockel-service.js";
7
+ import { PackjockelService } from "../packjockel-service.js";
7
8
  import { PackjockelError } from "../error/packjockel-error.js";
8
9
  /**
9
- * A packjockel stand-in: it records its arguments and the content of every `file://` input,
10
- * and writes a fixed bundle to `--output`.
10
+ * A packjockel stand-in: it records its arguments, the content of every `file://` input and a
11
+ * piped stdin, and writes a fixed bundle to `--output`.
11
12
  */
12
13
  const FAKE_PACKJOCKEL = `#!/bin/sh
14
+ if [ -p /dev/stdin ] || [ -f /dev/stdin ]; then
15
+ echo "piped" > "$RECORD_DIR/stdin"
16
+ fi
13
17
  out=""
14
18
  for arg in "$@"; do
15
19
  echo "$arg" >> "$RECORD_DIR/args"
@@ -37,7 +41,7 @@ describe("PackjockelService", () => {
37
41
  await writeFile(binary, FAKE_PACKJOCKEL);
38
42
  await chmod(binary, 0o755);
39
43
  process.env.RECORD_DIR = directory;
40
- service = new PackjockelService(binary);
44
+ service = new PackjockelService(() => binary);
41
45
  });
42
46
  afterEach(async () => {
43
47
  delete process.env.RECORD_DIR;
@@ -56,9 +60,7 @@ describe("PackjockelService", () => {
56
60
  it("should bundle the entry points in their order", async () => {
57
61
  const bundle = await service.bundle({
58
62
  entryPoints: { "rum.js": "rum()", "config.js": "SpeedKit.config = {}" },
59
- basePaths: {
60
- "speed-kit-config": "https://cdn/speed-kit-config/release/",
61
- },
63
+ versions: { configPluginsVersion: "@release", rumPluginVersion: "" },
62
64
  define: { APP: '"shop"' },
63
65
  platform: "browser",
64
66
  });
@@ -71,7 +73,8 @@ describe("PackjockelService", () => {
71
73
  "--target=es5",
72
74
  '--define=APP="shop"',
73
75
  ]);
74
- expect(args).to.include("--base-path=speed-kit-config=https://cdn/speed-kit-config/release/");
76
+ expect(args).to.include("--config-plugins-version=@release");
77
+ expect(args.filter((arg) => arg.endsWith("-version=")), "a tag that is not set is left to packjockel").to.deep.equal([]);
75
78
  expect(args).to.include("--embedded");
76
79
  expect(inputs).to.deep.equal([
77
80
  "rum.js: rum()",
@@ -97,6 +100,29 @@ describe("PackjockelService", () => {
97
100
  "dynamicFetcherConfig.js: window.dynamicBlockConfig = {}",
98
101
  ]);
99
102
  });
103
+ it("should leave the document handler to packjockel without one", async () => {
104
+ await service.bundleDocumentHandler({
105
+ documentHandlerConfig: "export default new DomDocumentHandler()",
106
+ speedKitConfig: "SpeedKit.config = {}",
107
+ appName: "shop",
108
+ versions: {
109
+ documentHandlerVersion: "1.8.0",
110
+ speedKitVersion: "2.22.4",
111
+ rumPluginVersion: "@release",
112
+ },
113
+ });
114
+ const { args, inputs } = await recorded();
115
+ expect(args.slice(0, 2)).to.deep.equal(["bundle", "document-handler"]);
116
+ expect(args[2], "no handler argument").to.match(/^--document-handler-config=/);
117
+ expect(args).to.include("--document-handler-version=1.8.0");
118
+ expect(args).to.include("--speed-kit-version=2.22.4");
119
+ expect(args).to.include("--rum-plugin-version=@release");
120
+ expect(existsSync(join(directory, "stdin")), "packjockel reads a piped stdin as the handler").to.equal(false);
121
+ expect(inputs).to.deep.equal([
122
+ "documentHandlerConfig.js: export default new DomDocumentHandler()",
123
+ "speedKitConfig.js: SpeedKit.config = {}",
124
+ ]);
125
+ });
100
126
  it("should report the error of packjockel without its log lines", async () => {
101
127
  process.env.FAIL = "1";
102
128
  const failure = await service
@@ -105,45 +131,13 @@ describe("PackjockelService", () => {
105
131
  expect(failure).to.be.instanceOf(PackjockelError);
106
132
  expect(failure.message).to.equal("packjockel failed: invalid bundle: could not resolve x");
107
133
  });
108
- it("should say how to set the binary when it is missing", async () => {
109
- const failure = await new PackjockelService(join(directory, "missing"))
134
+ it("should report a platform without a packjockel package", async () => {
135
+ const failure = await new PackjockelService(() => {
136
+ throw new Error("packjockel: @speedkit/packjockel-aix-ppc64 is not installed.");
137
+ })
110
138
  .bundle({ entryPoints: { "config.js": "x" } })
111
139
  .catch((error) => error);
112
140
  expect(failure).to.be.instanceOf(PackjockelError);
113
- expect(failure.message).to.contain("PACKJOCKEL_PATH");
114
- });
115
- });
116
- describe("speedKitConfigBasePath", () => {
117
- it("should use the release channel by default", () => {
118
- expect(speedKitConfigBasePath()).to.equal("https://www.baqend.com/speed-kit-config/release/");
119
- });
120
- it("should read a channel with or without its @", () => {
121
- expect(speedKitConfigBasePath("@latest")).to.equal("https://www.baqend.com/speed-kit-config/latest/");
122
- expect(speedKitConfigBasePath("latest")).to.equal("https://www.baqend.com/speed-kit-config/latest/");
123
- });
124
- it("should read a version", () => {
125
- expect(speedKitConfigBasePath("1.8.0")).to.equal("https://www.baqend.com/speed-kit-config/1.8.0/");
126
- });
127
- });
128
- describe("resolvePackjockelBinary", () => {
129
- const executable = process.platform === "win32" ? "packjockel.exe" : "packjockel";
130
- it("should use the configured binary", () => {
131
- expect(resolvePackjockelBinary("/opt/packjockel")).to.equal("/opt/packjockel");
132
- });
133
- it("should use the binary of the platform package", () => {
134
- const requests = [];
135
- const binary = resolvePackjockelBinary("", (request) => {
136
- requests.push(request);
137
- return `/node_modules/${request}`;
138
- });
139
- const request = `@speedkit/packjockel-${process.platform}-${process.arch}/bin/${executable}`;
140
- expect(requests).to.deep.equal([request]);
141
- expect(binary).to.equal(`/node_modules/${request}`);
142
- });
143
- it("should fall back to the PATH without the package", () => {
144
- const binary = resolvePackjockelBinary("", () => {
145
- throw new Error("Cannot find module");
146
- });
147
- expect(binary).to.equal("packjockel");
141
+ expect(failure.message).to.contain("is not installed");
148
142
  });
149
143
  });
@@ -16,7 +16,6 @@ const environmentMapping = {
16
16
  ideaDirectory: "IDEA_INITIAL_DIRECTORY",
17
17
  slackToken: "SLACK_TOKEN",
18
18
  testApp: "TEST_APP",
19
- packjockelPath: "PACKJOCKEL_PATH",
20
19
  };
21
20
  const CONFIG_FILE_NAME = "config.json";
22
21
  /** Variables CI providers set besides `CI`. */
@@ -24,11 +24,6 @@ export interface CliSettings {
24
24
  ideaDirectory: string;
25
25
  slackToken: string;
26
26
  testApp: string;
27
- /**
28
- * the packjockel binary, run for customers with the `configPlugins` feature; empty means the one of
29
- * the installed `@speedkit/packjockel` package
30
- */
31
- packjockelPath: string;
32
27
  browserChannel: string;
33
28
  browserBuildId: string;
34
29
  browserAutoUpdate: boolean;
@@ -11,7 +11,6 @@ export function defaultSettings() {
11
11
  ideaDirectory: "",
12
12
  slackToken: "",
13
13
  testApp: "",
14
- packjockelPath: "",
15
14
  browserChannel: "",
16
15
  browserBuildId: "",
17
16
  browserAutoUpdate: false,
@@ -60,7 +60,7 @@ export default class DeployServiceFactory {
60
60
  })).getService();
61
61
  const policy = this.policyOverride ?? new InteractiveDeployPolicy(cliService);
62
62
  const installResourceBuilder = new InstallResourceBuilder(configApi);
63
- const bundler = new BundleServiceFactory("./", this.context.environment.settings.packjockelPath).buildService();
63
+ const bundler = new BundleServiceFactory("./").buildService();
64
64
  const deletedFilesChecker = new DeletedFileCheck(cliService, policy, this.context.hasArtifacts);
65
65
  this.service = new DeployService(files, [
66
66
  new CustomerConfigHandler(customer, configApi, configName, diffService, cliService, installResourceBuilder, policy),
@@ -63,6 +63,6 @@ export class MergeRequestDeployServiceFactory {
63
63
  whitelist: [],
64
64
  }))
65
65
  .buildService()
66
- .run()), new LiveStateCheck(diffService), new CustomerApprovalCheck(cliService, deployFactory.files.getCustomerConfig().config, policy, new BundleServiceFactory("./", this.context.environment.settings.packjockelPath).buildService()), deployFactory.configApi, deployFactory.files, deployFactory.configName, deployService);
66
+ .run()), new LiveStateCheck(diffService), new CustomerApprovalCheck(cliService, deployFactory.files.getCustomerConfig().config, policy, new BundleServiceFactory("./").buildService()), deployFactory.configApi, deployFactory.files, deployFactory.configName, deployService);
67
67
  }
68
68
  }
@@ -4,6 +4,4 @@ export declare const LOCAL_DYNAMIC_FETCHER = "custom_dynamicFetcher";
4
4
  export declare const LOCAL_DYNAMIC_FETCHER_CONFIG = "config_dynamicBlocks";
5
5
  export declare const LOCAL_STYLES = "config_dynamicStyles";
6
6
  export declare const LATEST_DYNAMIC_FETCHER_URL = "https://www.baqend.com/speed-kit/latest/dynamic-fetcher.js";
7
- /** Where the imports of the latest dynamic fetcher resolve. */
8
- export declare const DYNAMIC_FETCHER_BASE_PATH = "https://www.baqend.com/speed-kit/latest/";
9
7
  export declare const LOCAL_TRIGGERED_BY = "STREAM:QA";
@@ -4,8 +4,6 @@ export const LOCAL_DYNAMIC_FETCHER = "custom_dynamicFetcher";
4
4
  export const LOCAL_DYNAMIC_FETCHER_CONFIG = "config_dynamicBlocks";
5
5
  export const LOCAL_STYLES = "config_dynamicStyles";
6
6
  export const LATEST_DYNAMIC_FETCHER_URL = "https://www.baqend.com/speed-kit/latest/dynamic-fetcher.js";
7
- /** Where the imports of the latest dynamic fetcher resolve. */
8
- export const DYNAMIC_FETCHER_BASE_PATH = "https://www.baqend.com/speed-kit/latest/";
9
7
  // Local runs have no persistent cache, so an origin HTML is served straight to the developer and may
10
8
  // legitimately be older than the default five minutes. STREAM:QA relaxes the document handler's
11
9
  // Shopify staleness check to one hour, see ONE_HOUR_STALENESS_TRIGGERS in document-handler.
@@ -14,7 +14,7 @@ export declare class DocumentHandlerServer {
14
14
  private documentHandlerCode;
15
15
  private documentHandlerConfigCode;
16
16
  /**
17
- * The packjockel bundle for a customer with the `configPlugins` feature: the handler, its config
17
+ * The packjockel bundle for a customer with the `enableSpeedKitConfigPlugins` feature: the handler, its config
18
18
  * and the Speed Kit config in one CommonJS module, which exports `post`.
19
19
  */
20
20
  private documentHandlerBundle?;
@@ -36,7 +36,7 @@ export declare class DocumentHandlerServer {
36
36
  buildDocumentHandler(): Promise<void>;
37
37
  /**
38
38
  * Bundles the handler, its config and the Speed Kit config into one module, the way the server
39
- * deploys a customer with the `configPlugins` feature.
39
+ * deploys a customer with the `enableSpeedKitConfigPlugins` feature.
40
40
  */
41
41
  private bundleWithPackjockel;
42
42
  private deactivateReleaseAndDeploymentDetection;
@@ -1,8 +1,7 @@
1
- import { DYNAMIC_FETCHER_BASE_PATH, LATEST_DYNAMIC_FETCHER_URL, LOCAL_DOCUMENT_HANDLER, LOCAL_DOCUMENT_HANDLER_CONFIG, LOCAL_DYNAMIC_FETCHER, LOCAL_DYNAMIC_FETCHER_CONFIG, LOCAL_STYLES, } from "./document-handler-runtime-model.js";
1
+ import { LATEST_DYNAMIC_FETCHER_URL, LOCAL_DOCUMENT_HANDLER, LOCAL_DOCUMENT_HANDLER_CONFIG, LOCAL_DYNAMIC_FETCHER, LOCAL_DYNAMIC_FETCHER_CONFIG, LOCAL_STYLES, } from "./document-handler-runtime-model.js";
2
2
  import RequiredFileNotFoundError from "./error/required-file-not-found-error.js";
3
3
  import DatabaseMock from "./templates/database-mock.js";
4
4
  import * as vm from "node:vm";
5
- import { speedKitConfigBasePath, } from "../bundler/index.js";
6
5
  import { usesConfigPlugins, } from "../integration-api/index.js";
7
6
  import { INTEGRATION_FILES } from "../../models/files.js";
8
7
  // documentHandlerDependencies
@@ -28,7 +27,7 @@ export class DocumentHandlerServer {
28
27
  documentHandlerCode;
29
28
  documentHandlerConfigCode;
30
29
  /**
31
- * The packjockel bundle for a customer with the `configPlugins` feature: the handler, its config
30
+ * The packjockel bundle for a customer with the `enableSpeedKitConfigPlugins` feature: the handler, its config
32
31
  * and the Speed Kit config in one CommonJS module, which exports `post`.
33
32
  */
34
33
  documentHandlerBundle;
@@ -137,11 +136,15 @@ export class DocumentHandlerServer {
137
136
  }
138
137
  /**
139
138
  * Bundles the handler, its config and the Speed Kit config into one module, the way the server
140
- * deploys a customer with the `configPlugins` feature.
139
+ * deploys a customer with the `enableSpeedKitConfigPlugins` feature.
141
140
  */
142
141
  async bundleWithPackjockel() {
142
+ const customDocumentHandler = this.files.getByName(INTEGRATION_FILES.CUSTOM.DOCUMENT_HANDLER);
143
143
  return this.bundler.packjockel.bundleDocumentHandler({
144
- documentHandler: await this.getDocumentHandler(),
144
+ // Without a custom one, packjockel bundles the published handler of documentHandlerVersion.
145
+ documentHandler: customDocumentHandler?.path
146
+ ? await this.getDocumentHandler()
147
+ : undefined,
145
148
  documentHandlerConfig: this.deactivateReleaseAndDeploymentDetection(),
146
149
  speedKitConfig: this.files
147
150
  .getByName(INTEGRATION_FILES.CONFIG.SPEED_KIT)
@@ -150,10 +153,7 @@ export class DocumentHandlerServer {
150
153
  dynamicFetcher: await this.getDynamicFetcherSource(),
151
154
  dynamicFetcherConfig: await this.getDynamicFetcherConfig(),
152
155
  customStyle: this.getStyles(),
153
- basePaths: {
154
- "speed-kit-config": speedKitConfigBasePath(this.customerConfig.configPluginsVersion),
155
- "dynamic-fetcher": DYNAMIC_FETCHER_BASE_PATH,
156
- },
156
+ versions: this.customerConfig,
157
157
  });
158
158
  }
159
159
  deactivateReleaseAndDeploymentDetection() {
@@ -169,7 +169,7 @@ export class DocumentHandlerServer {
169
169
  }
170
170
  async getDynamicFetcher() {
171
171
  if (!this.files.hasFile(LOCAL_DYNAMIC_FETCHER)) {
172
- return await this.bundleDynamicFetcher({ "dynamic-fetcher": DYNAMIC_FETCHER_BASE_PATH }, await this.getDynamicFetcherSource());
172
+ return await this.bundleDynamicFetcher({ "dynamic-fetcher": "https://www.baqend.com/speed-kit/latest/" }, await this.getDynamicFetcherSource());
173
173
  }
174
174
  return this.getDynamicFetcherSource();
175
175
  }
@@ -25,7 +25,7 @@ export default class DocumentHandlerRuntimeServiceFactory {
25
25
  const customerConfig = this.getCustomerConfig(files);
26
26
  const cliService = this.context.environment.cli;
27
27
  await this.installAdditionalDependencies(customerConfig, cliService);
28
- const bundler = new BundleServiceFactory(this.context.customerPath, this.context.environment.settings.packjockelPath).buildService();
28
+ const bundler = new BundleServiceFactory(this.context.customerPath).buildService();
29
29
  // the non-prompting lookup: the document handler runs with a session when
30
30
  // there is one and without when there is not, so it must not stop the
31
31
  // command at a login prompt to find out
@@ -30,7 +30,7 @@ export class IntegrationApiFactory {
30
30
  const virtualFileHandler = new VirtualFileHandler(cli);
31
31
  this.service = new IntegrationApiService(fileReader, virtualFileHandler, new MandatoryFilesValidator(), [
32
32
  new CustomerConfigHandler(fileReader, cli, new CustomerConfigValidator(), this.context.configName, this.context.environment.settings.testApp, this.context.useTestConfig ?? false),
33
- new InstallResourceHandler(fileReader, new BundleServiceFactory("./", this.context.environment.settings.packjockelPath).buildService()),
33
+ new InstallResourceHandler(fileReader, new BundleServiceFactory("./").buildService()),
34
34
  new ServerConfigHandler(fileReader),
35
35
  new ModuleHandler(fileReader),
36
36
  ], new FileWriter(fs, this.context.basePath), this.whitelist.length === 0);
@@ -126,11 +126,11 @@ describe("SpeedKitConfigFile", () => {
126
126
  expect(deployed).to.deep.equal(local);
127
127
  expect(remote.getContent()).to.equal(source);
128
128
  });
129
- describe("with the configPlugins feature", () => {
129
+ describe("with the enableSpeedKitConfigPlugins feature", () => {
130
130
  const SOURCE = "window.speedKit = { split: 0.1 };";
131
131
  const EMBEDDED = {
132
132
  app: "shop-de",
133
- features: { configPlugins: true },
133
+ features: { enableSpeedKitConfigPlugins: true },
134
134
  configPluginsVersion: "@release",
135
135
  };
136
136
  function embeddedFile(bundled) {
@@ -143,15 +143,13 @@ describe("SpeedKitConfigFile", () => {
143
143
  }, new BundleService("./", packjockel));
144
144
  return { file, packjockel };
145
145
  }
146
- it("should bundle with packjockel and its plugins of the pinned release", async () => {
146
+ it("should bundle with packjockel and the tags of the customer", async () => {
147
147
  const { file, packjockel } = embeddedFile(`SpeedKit.config = {};`);
148
148
  await file.evaluate(EMBEDDED, "https://www.shop.de");
149
149
  expect(packjockel.requests).to.have.length(1);
150
150
  expect(packjockel.requests[0]).to.deep.equal({
151
151
  entryPoints: { "config.js": SOURCE },
152
- basePaths: {
153
- "speed-kit-config": "https://www.baqend.com/speed-kit-config/release/",
154
- },
152
+ versions: EMBEDDED,
155
153
  define: { APP: '"shop-de"' },
156
154
  platform: "browser",
157
155
  });
@@ -1,3 +1,4 @@
1
+ import type { AssetVersions } from "../../bundler/index.js";
1
2
  /**
2
3
  * The installation features of a config. `null` leaves a feature at its default.
3
4
  */
@@ -7,7 +8,7 @@ export interface CustomerFeatures {
7
8
  * embeds it into the document handler and the install script. The config
8
9
  * writes `SpeedKit.config`.
9
10
  */
10
- configPlugins?: boolean | null;
11
+ enableSpeedKitConfigPlugins?: boolean | null;
11
12
  [feature: string]: unknown;
12
13
  }
13
14
  export interface CustomerConfigs {
@@ -35,10 +36,22 @@ export declare class CustomerConfig {
35
36
  readonly needsCustomerApproval?: boolean;
36
37
  readonly features?: CustomerFeatures;
37
38
  /**
38
- * The speed-kit-config release the packjockel bundles import plugins from: a version such as
39
- * `1.8.0`, or a channel such as `@release`.
39
+ * The tag of Speed Kit (snippet, service worker, dynamic fetcher) for the `enableSpeedKitConfigPlugins` feature: a
40
+ * version such as `2.22.4`, or a channel such as `@release`; `latest` when not set. This and the other
41
+ * tags are named like the client config keys of packjockel.
40
42
  */
43
+ readonly speedKitVersion?: string;
44
+ /** The tag of RUM for the `enableSpeedKitConfigPlugins` feature, see {@link speedKitVersion}. */
45
+ readonly rumPluginVersion?: string;
46
+ /** The tag of predictive preloading for the `enableSpeedKitConfigPlugins` feature, see {@link speedKitVersion}. */
47
+ readonly ppVersion?: string;
48
+ /** The tag of the speed-kit-config plugins for the `enableSpeedKitConfigPlugins` feature, see {@link speedKitVersion}. */
41
49
  readonly configPluginsVersion?: string;
42
- constructor(app: string, origins: string[], domain: string, swPath: string, scope: string, appDomain?: string, installPath?: string, installParameters?: string, name?: string, forceInstall?: boolean, chromeFlags?: string[], dependencies?: Record<string, string>, needsCustomerApproval?: boolean, features?: CustomerFeatures, configPluginsVersion?: string);
50
+ /**
51
+ * The tag of the published document handler for the `enableSpeedKitConfigPlugins` feature, see {@link speedKitVersion}.
52
+ * A `custom_documentHandler.js` replaces it.
53
+ */
54
+ readonly documentHandlerVersion?: string;
55
+ constructor(app: string, origins: string[], domain: string, swPath: string, scope: string, appDomain?: string, installPath?: string, installParameters?: string, name?: string, forceInstall?: boolean, chromeFlags?: string[], dependencies?: Record<string, string>, needsCustomerApproval?: boolean, features?: CustomerFeatures, versions?: AssetVersions);
43
56
  static createFrom(configFile: Partial<CustomerConfig>, configName?: string): CustomerConfig;
44
57
  }
@@ -20,11 +20,23 @@ export class CustomerConfig {
20
20
  needsCustomerApproval;
21
21
  features;
22
22
  /**
23
- * The speed-kit-config release the packjockel bundles import plugins from: a version such as
24
- * `1.8.0`, or a channel such as `@release`.
23
+ * The tag of Speed Kit (snippet, service worker, dynamic fetcher) for the `enableSpeedKitConfigPlugins` feature: a
24
+ * version such as `2.22.4`, or a channel such as `@release`; `latest` when not set. This and the other
25
+ * tags are named like the client config keys of packjockel.
25
26
  */
27
+ speedKitVersion;
28
+ /** The tag of RUM for the `enableSpeedKitConfigPlugins` feature, see {@link speedKitVersion}. */
29
+ rumPluginVersion;
30
+ /** The tag of predictive preloading for the `enableSpeedKitConfigPlugins` feature, see {@link speedKitVersion}. */
31
+ ppVersion;
32
+ /** The tag of the speed-kit-config plugins for the `enableSpeedKitConfigPlugins` feature, see {@link speedKitVersion}. */
26
33
  configPluginsVersion;
27
- constructor(app, origins, domain, swPath, scope, appDomain, installPath, installParameters, name, forceInstall, chromeFlags, dependencies, needsCustomerApproval, features, configPluginsVersion) {
34
+ /**
35
+ * The tag of the published document handler for the `enableSpeedKitConfigPlugins` feature, see {@link speedKitVersion}.
36
+ * A `custom_documentHandler.js` replaces it.
37
+ */
38
+ documentHandlerVersion;
39
+ constructor(app, origins, domain, swPath, scope, appDomain, installPath, installParameters, name, forceInstall, chromeFlags, dependencies, needsCustomerApproval, features, versions = {}) {
28
40
  this.app = app;
29
41
  this.origins = origins;
30
42
  this.domain = domain;
@@ -39,12 +51,22 @@ export class CustomerConfig {
39
51
  this.dependencies = dependencies;
40
52
  this.needsCustomerApproval = needsCustomerApproval;
41
53
  this.features = features;
42
- this.configPluginsVersion = configPluginsVersion;
54
+ this.speedKitVersion = versions.speedKitVersion;
55
+ this.rumPluginVersion = versions.rumPluginVersion;
56
+ this.ppVersion = versions.ppVersion;
57
+ this.configPluginsVersion = versions.configPluginsVersion;
58
+ this.documentHandlerVersion = versions.documentHandlerVersion;
43
59
  }
44
60
  static createFrom(configFile, configName) {
45
- const { app, origins, domain, swPath, scope, appDomain, installPath, installParams, name, forceInstall, chromeFlags, dependencies, needsCustomerApproval, features, configPluginsVersion, } = configFile;
61
+ const { app, origins, domain, swPath, scope, appDomain, installPath, installParams, name, forceInstall, chromeFlags, dependencies, needsCustomerApproval, features, speedKitVersion, rumPluginVersion, ppVersion, configPluginsVersion, documentHandlerVersion, } = configFile;
46
62
  return new CustomerConfig(new RequiredParameter("app", app).isString().getValue(), new RequiredParameter("origins", origins).isArray().getValue(), domain, new RequiredParameter("swPath", swPath).isString().getValue(), new RequiredParameter("scope", scope).isString().getValue(), appDomain || `${app}.app.baqend.com`, installPath ||
47
- `https://${app}.app.baqend.com/v1/speedkit/install.js?d=${name || configName}`, installParams || 'async="" crossorigin="anonymous"', name, forceInstall || false, chromeFlags, dependencies || {}, needsCustomerApproval || false, features || {}, configPluginsVersion);
63
+ `https://${app}.app.baqend.com/v1/speedkit/install.js?d=${name || configName}`, installParams || 'async="" crossorigin="anonymous"', name, forceInstall || false, chromeFlags, dependencies || {}, needsCustomerApproval || false, features || {}, {
64
+ speedKitVersion,
65
+ rumPluginVersion,
66
+ ppVersion,
67
+ configPluginsVersion,
68
+ documentHandlerVersion,
69
+ });
48
70
  }
49
71
  }
50
72
  class RequiredParameter {
@@ -1,10 +1,10 @@
1
- import { type BundleService } from "../../bundler/index.js";
1
+ import type { AssetVersions, BundleService } from "../../bundler/index.js";
2
2
  import type { SpeedKitConfigInterface, VirtualFileInterface, VirtualFileRecipe } from "../integration-api-model.js";
3
3
  import { InstallResourceFile } from "./install-resource-file.js";
4
4
  import { SpeedKitConfig } from "./speed-kit-config.js";
5
5
  import type { CustomerConfig } from "./customer-config.js";
6
6
  /** What of the customer config decides how a Speed Kit config is bundled and read. */
7
- export type SpeedKitConfigCustomer = Pick<CustomerConfig, "app" | "features" | "configPluginsVersion">;
7
+ export type SpeedKitConfigCustomer = Pick<CustomerConfig, "app" | "features"> & AssetVersions;
8
8
  /** The name the config deployed to the app is read back under. */
9
9
  export declare const REMOTE_SPEED_KIT_CONFIG = "config_SpeedKit@remote";
10
10
  /** The file a {@link SpeedKitConfigFile} stands for. */
@@ -63,5 +63,5 @@ export declare class VirtualSpeedKitConfigFile extends SpeedKitConfigFile implem
63
63
  delete(): Promise<void>;
64
64
  onChange(): void;
65
65
  }
66
- /** The customer has the `configPlugins` feature: packjockel bundles its config. */
66
+ /** The customer has the `enableSpeedKitConfigPlugins` feature: packjockel bundles its config. */
67
67
  export declare function usesConfigPlugins(customer: SpeedKitConfigCustomer): boolean;
@@ -1,5 +1,4 @@
1
1
  import * as vm from "node:vm";
2
- import { speedKitConfigBasePath, } from "../../bundler/index.js";
3
2
  import { EvaluateSkConfigError } from "../error/evaluate-sk-config-error.js";
4
3
  import ApplicationError from "../../error-handling/error/application-error.js";
5
4
  import { StaticRecipe } from "../virtual/static-recipe.js";
@@ -219,9 +218,9 @@ function safeFileContentWrapper(fileContent) {
219
218
  }
220
219
  `;
221
220
  }
222
- /** The customer has the `configPlugins` feature: packjockel bundles its config. */
221
+ /** The customer has the `enableSpeedKitConfigPlugins` feature: packjockel bundles its config. */
223
222
  export function usesConfigPlugins(customer) {
224
- return customer.features?.configPlugins === true;
223
+ return customer.features?.enableSpeedKitConfigPlugins === true;
225
224
  }
226
225
  async function bundle(bundler, content, customer) {
227
226
  if (!content) {
@@ -231,9 +230,7 @@ async function bundle(bundler, content, customer) {
231
230
  if (usesConfigPlugins(customer)) {
232
231
  return bundler.packjockel.bundle({
233
232
  entryPoints: { "config.js": content },
234
- basePaths: {
235
- "speed-kit-config": speedKitConfigBasePath(customer.configPluginsVersion),
236
- },
233
+ versions: customer,
237
234
  define: { APP: JSON.stringify(app) },
238
235
  platform: "browser",
239
236
  });
@@ -1,4 +1,3 @@
1
- import { speedKitConfigBasePath } from "../../bundler/index.js";
2
1
  import { usesConfigPlugins, } from "../../integration-api/index.js";
3
2
  import { INTEGRATION_FILES } from "../../../models/files.js";
4
3
  const IMPORT_PATHS = {
@@ -43,10 +42,7 @@ export class SpeedKitInstallContext {
43
42
  if (configPlugins) {
44
43
  return this.bundler.packjockel.bundle({
45
44
  entryPoints,
46
- basePaths: {
47
- ...IMPORT_PATHS,
48
- "speed-kit-config": speedKitConfigBasePath(this.customerConfig.configPluginsVersion),
49
- },
45
+ versions: this.customerConfig,
50
46
  define: { APP: JSON.stringify(this.customerConfig.app) },
51
47
  platform: "browser",
52
48
  });
@@ -230,7 +230,7 @@ export class OnboardingServiceFactory {
230
230
  customerPath: this.context.customerPath,
231
231
  verboseLevel: this.context.verboseLevel,
232
232
  }), files).buildDocumentHandlerServer();
233
- const bundler = new BundleServiceFactory(this.context.customerPath, this.context.environment.settings.packjockelPath).buildService();
233
+ const bundler = new BundleServiceFactory(this.context.customerPath).buildService();
234
234
  const skTemplate = new InstallSpeedKitJsTemplate();
235
235
  const speedKitInstallContext = new SpeedKitInstallContext(customerConfig, this.context.configName, files, bundler, skTemplate);
236
236
  await this.buildInstallResource(speedKitInstallContext, files, cli);
@@ -1333,149 +1333,6 @@
1333
1333
  "setup.js"
1334
1334
  ]
1335
1335
  },
1336
- "extension:add": {
1337
- "aliases": [],
1338
- "args": {
1339
- "ref": {
1340
- "description": "Chrome Web Store link or extension id",
1341
- "name": "ref",
1342
- "required": false
1343
- }
1344
- },
1345
- "description": "Install a Chrome extension into the onboarding browser by Web Store link or id",
1346
- "examples": [
1347
- "$ sk extension add fmkadmapgofadopljbjfkapdkoienihi",
1348
- "$ sk extension add https://chromewebstore.google.com/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi",
1349
- "$ sk extension add"
1350
- ],
1351
- "flags": {},
1352
- "hasDynamicHelp": false,
1353
- "hiddenAliases": [],
1354
- "id": "extension:add",
1355
- "pluginAlias": "@speedkit/cli",
1356
- "pluginName": "@speedkit/cli",
1357
- "pluginType": "core",
1358
- "strict": true,
1359
- "enableJsonFlag": false,
1360
- "isESM": true,
1361
- "relativePath": [
1362
- "dist",
1363
- "commands",
1364
- "extension",
1365
- "add.js"
1366
- ]
1367
- },
1368
- "extension:devtools": {
1369
- "aliases": [],
1370
- "args": {},
1371
- "description": "Install the integration-devtools extension for the onboarding browser, or update it to the latest release",
1372
- "examples": [
1373
- "$ sk extension devtools",
1374
- "$ sk extension devtools --force"
1375
- ],
1376
- "flags": {
1377
- "force": {
1378
- "description": "reinstall the latest release even when it is up to date",
1379
- "name": "force",
1380
- "allowNo": false,
1381
- "type": "boolean"
1382
- }
1383
- },
1384
- "hasDynamicHelp": false,
1385
- "hiddenAliases": [],
1386
- "id": "extension:devtools",
1387
- "pluginAlias": "@speedkit/cli",
1388
- "pluginName": "@speedkit/cli",
1389
- "pluginType": "core",
1390
- "strict": true,
1391
- "enableJsonFlag": false,
1392
- "isESM": true,
1393
- "relativePath": [
1394
- "dist",
1395
- "commands",
1396
- "extension",
1397
- "devtools.js"
1398
- ]
1399
- },
1400
- "extension:list": {
1401
- "aliases": [],
1402
- "args": {},
1403
- "description": "List Chrome extensions managed by the setup wizard",
1404
- "examples": [
1405
- "$ sk extension list"
1406
- ],
1407
- "flags": {},
1408
- "hasDynamicHelp": false,
1409
- "hiddenAliases": [],
1410
- "id": "extension:list",
1411
- "pluginAlias": "@speedkit/cli",
1412
- "pluginName": "@speedkit/cli",
1413
- "pluginType": "core",
1414
- "strict": true,
1415
- "enableJsonFlag": false,
1416
- "isESM": true,
1417
- "relativePath": [
1418
- "dist",
1419
- "commands",
1420
- "extension",
1421
- "list.js"
1422
- ]
1423
- },
1424
- "extension:remove": {
1425
- "aliases": [],
1426
- "args": {
1427
- "ref": {
1428
- "description": "Chrome Web Store link or extension id",
1429
- "name": "ref",
1430
- "required": false
1431
- }
1432
- },
1433
- "description": "Remove a managed Chrome extension",
1434
- "examples": [
1435
- "$ sk extension remove",
1436
- "$ sk extension remove <id>"
1437
- ],
1438
- "flags": {},
1439
- "hasDynamicHelp": false,
1440
- "hiddenAliases": [],
1441
- "id": "extension:remove",
1442
- "pluginAlias": "@speedkit/cli",
1443
- "pluginName": "@speedkit/cli",
1444
- "pluginType": "core",
1445
- "strict": true,
1446
- "enableJsonFlag": false,
1447
- "isESM": true,
1448
- "relativePath": [
1449
- "dist",
1450
- "commands",
1451
- "extension",
1452
- "remove.js"
1453
- ]
1454
- },
1455
- "extension:update": {
1456
- "aliases": [],
1457
- "args": {},
1458
- "description": "Check managed Chrome extensions for updates and install them",
1459
- "examples": [
1460
- "$ sk extension update"
1461
- ],
1462
- "flags": {},
1463
- "hasDynamicHelp": false,
1464
- "hiddenAliases": [],
1465
- "id": "extension:update",
1466
- "pluginAlias": "@speedkit/cli",
1467
- "pluginName": "@speedkit/cli",
1468
- "pluginType": "core",
1469
- "strict": true,
1470
- "enableJsonFlag": false,
1471
- "isESM": true,
1472
- "relativePath": [
1473
- "dist",
1474
- "commands",
1475
- "extension",
1476
- "update.js"
1477
- ]
1478
- },
1479
1336
  "query:parameter": {
1480
1337
  "aliases": [
1481
1338
  "build-parameter-query"
@@ -1786,7 +1643,150 @@
1786
1643
  "query",
1787
1644
  "prewarm.js"
1788
1645
  ]
1646
+ },
1647
+ "extension:add": {
1648
+ "aliases": [],
1649
+ "args": {
1650
+ "ref": {
1651
+ "description": "Chrome Web Store link or extension id",
1652
+ "name": "ref",
1653
+ "required": false
1654
+ }
1655
+ },
1656
+ "description": "Install a Chrome extension into the onboarding browser by Web Store link or id",
1657
+ "examples": [
1658
+ "$ sk extension add fmkadmapgofadopljbjfkapdkoienihi",
1659
+ "$ sk extension add https://chromewebstore.google.com/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi",
1660
+ "$ sk extension add"
1661
+ ],
1662
+ "flags": {},
1663
+ "hasDynamicHelp": false,
1664
+ "hiddenAliases": [],
1665
+ "id": "extension:add",
1666
+ "pluginAlias": "@speedkit/cli",
1667
+ "pluginName": "@speedkit/cli",
1668
+ "pluginType": "core",
1669
+ "strict": true,
1670
+ "enableJsonFlag": false,
1671
+ "isESM": true,
1672
+ "relativePath": [
1673
+ "dist",
1674
+ "commands",
1675
+ "extension",
1676
+ "add.js"
1677
+ ]
1678
+ },
1679
+ "extension:devtools": {
1680
+ "aliases": [],
1681
+ "args": {},
1682
+ "description": "Install the integration-devtools extension for the onboarding browser, or update it to the latest release",
1683
+ "examples": [
1684
+ "$ sk extension devtools",
1685
+ "$ sk extension devtools --force"
1686
+ ],
1687
+ "flags": {
1688
+ "force": {
1689
+ "description": "reinstall the latest release even when it is up to date",
1690
+ "name": "force",
1691
+ "allowNo": false,
1692
+ "type": "boolean"
1693
+ }
1694
+ },
1695
+ "hasDynamicHelp": false,
1696
+ "hiddenAliases": [],
1697
+ "id": "extension:devtools",
1698
+ "pluginAlias": "@speedkit/cli",
1699
+ "pluginName": "@speedkit/cli",
1700
+ "pluginType": "core",
1701
+ "strict": true,
1702
+ "enableJsonFlag": false,
1703
+ "isESM": true,
1704
+ "relativePath": [
1705
+ "dist",
1706
+ "commands",
1707
+ "extension",
1708
+ "devtools.js"
1709
+ ]
1710
+ },
1711
+ "extension:list": {
1712
+ "aliases": [],
1713
+ "args": {},
1714
+ "description": "List Chrome extensions managed by the setup wizard",
1715
+ "examples": [
1716
+ "$ sk extension list"
1717
+ ],
1718
+ "flags": {},
1719
+ "hasDynamicHelp": false,
1720
+ "hiddenAliases": [],
1721
+ "id": "extension:list",
1722
+ "pluginAlias": "@speedkit/cli",
1723
+ "pluginName": "@speedkit/cli",
1724
+ "pluginType": "core",
1725
+ "strict": true,
1726
+ "enableJsonFlag": false,
1727
+ "isESM": true,
1728
+ "relativePath": [
1729
+ "dist",
1730
+ "commands",
1731
+ "extension",
1732
+ "list.js"
1733
+ ]
1734
+ },
1735
+ "extension:remove": {
1736
+ "aliases": [],
1737
+ "args": {
1738
+ "ref": {
1739
+ "description": "Chrome Web Store link or extension id",
1740
+ "name": "ref",
1741
+ "required": false
1742
+ }
1743
+ },
1744
+ "description": "Remove a managed Chrome extension",
1745
+ "examples": [
1746
+ "$ sk extension remove",
1747
+ "$ sk extension remove <id>"
1748
+ ],
1749
+ "flags": {},
1750
+ "hasDynamicHelp": false,
1751
+ "hiddenAliases": [],
1752
+ "id": "extension:remove",
1753
+ "pluginAlias": "@speedkit/cli",
1754
+ "pluginName": "@speedkit/cli",
1755
+ "pluginType": "core",
1756
+ "strict": true,
1757
+ "enableJsonFlag": false,
1758
+ "isESM": true,
1759
+ "relativePath": [
1760
+ "dist",
1761
+ "commands",
1762
+ "extension",
1763
+ "remove.js"
1764
+ ]
1765
+ },
1766
+ "extension:update": {
1767
+ "aliases": [],
1768
+ "args": {},
1769
+ "description": "Check managed Chrome extensions for updates and install them",
1770
+ "examples": [
1771
+ "$ sk extension update"
1772
+ ],
1773
+ "flags": {},
1774
+ "hasDynamicHelp": false,
1775
+ "hiddenAliases": [],
1776
+ "id": "extension:update",
1777
+ "pluginAlias": "@speedkit/cli",
1778
+ "pluginName": "@speedkit/cli",
1779
+ "pluginType": "core",
1780
+ "strict": true,
1781
+ "enableJsonFlag": false,
1782
+ "isESM": true,
1783
+ "relativePath": [
1784
+ "dist",
1785
+ "commands",
1786
+ "extension",
1787
+ "update.js"
1788
+ ]
1789
1789
  }
1790
1790
  },
1791
- "version": "4.44.0-beta.1"
1791
+ "version": "4.44.0-beta.3"
1792
1792
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@speedkit/cli",
3
3
  "description": "Speed Kit CLI",
4
- "version": "4.44.0-beta.1",
4
+ "version": "4.44.0-beta.3",
5
5
  "author": {
6
6
  "name": "Baqend.com",
7
7
  "email": "info@baqend.com"
@@ -110,7 +110,7 @@
110
110
  "@oclif/plugin-help": "^6.2.45",
111
111
  "@oclif/plugin-not-found": "^3.2.81",
112
112
  "@oclif/plugin-warn-if-update-available": "^3.1.61",
113
- "@speedkit/packjockel": "2.0.0-beta",
113
+ "@speedkit/packjockel": "3.0.0",
114
114
  "@speedkit/rules": "^1.3.0-0",
115
115
  "baqend": "^4.2.5",
116
116
  "chalk": "^5.6.2",