@contentful/experience-design-system-cli 2.26.2-dev-build-ccaf7cf.0 → 2.26.2-dev-build-1b57430.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.26.2-dev-build-ccaf7cf.0",
3
+ "version": "2.26.2-dev-build-1b57430.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -46,7 +46,7 @@
46
46
  "react": "^18.3.1",
47
47
  "react-devtools-core": "^4.19.1",
48
48
  "react-dom": "^18.3.1",
49
- "svelte": "^5.56.10",
49
+ "svelte": "^5.56.4",
50
50
  "ts-morph": "^27.0.2",
51
51
  "typescript": "^5.9.3"
52
52
  },
package/dist/src/index.js CHANGED
@@ -15778,6 +15778,29 @@ var init_command2 = __esm({
15778
15778
  }
15779
15779
  });
15780
15780
 
15781
+ // packages/experience-design-system-cli/src/import/path-utils.ts
15782
+ import { resolve as resolve20 } from "node:path";
15783
+ import { homedir as homedir6 } from "node:os";
15784
+ function expandTilde(input) {
15785
+ if (input === "~" || input.startsWith("~/") || input.startsWith("~\\")) {
15786
+ return homedir6() + input.slice(1);
15787
+ }
15788
+ return input;
15789
+ }
15790
+ function normalizePath(input) {
15791
+ let p = input.trim();
15792
+ if (p.length >= 2 && (p.startsWith('"') && p.endsWith('"') || p.startsWith("'") && p.endsWith("'"))) {
15793
+ p = p.slice(1, -1);
15794
+ }
15795
+ p = expandTilde(p);
15796
+ return resolve20(p);
15797
+ }
15798
+ var init_path_utils = __esm({
15799
+ "packages/experience-design-system-cli/src/import/path-utils.ts"() {
15800
+ "use strict";
15801
+ }
15802
+ });
15803
+
15781
15804
  // packages/experience-design-system-cli/src/runs/save-path-resolver.ts
15782
15805
  import { access as access8 } from "node:fs/promises";
15783
15806
  import { join as join19 } from "node:path";
@@ -15840,7 +15863,7 @@ var init_save_path_resolver = __esm({
15840
15863
  // packages/experience-design-system-cli/src/runs/store.ts
15841
15864
  import { readFile as readFile20, writeFile as writeFile5, mkdir as mkdir6, rename } from "node:fs/promises";
15842
15865
  import { join as join20 } from "node:path";
15843
- import { homedir as homedir6 } from "node:os";
15866
+ import { homedir as homedir7 } from "node:os";
15844
15867
  import { randomBytes as randomBytes2 } from "node:crypto";
15845
15868
  function runsFilePath() {
15846
15869
  return RUNS_PATH;
@@ -15960,7 +15983,7 @@ var init_store = __esm({
15960
15983
  RUNS_FILE_VERSION = 3;
15961
15984
  RUNS_FILE_CAP = 200;
15962
15985
  READABLE_VERSIONS = /* @__PURE__ */ new Set([1, 2, 3]);
15963
- RUNS_DIR = join20(homedir6(), ".config", "experiences");
15986
+ RUNS_DIR = join20(homedir7(), ".config", "experiences");
15964
15987
  RUNS_PATH = join20(RUNS_DIR, "runs.json");
15965
15988
  CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
15966
15989
  }
@@ -15971,7 +15994,7 @@ var resolve_run_target_exports = {};
15971
15994
  __export(resolve_run_target_exports, {
15972
15995
  resolveRunTarget: () => resolveRunTarget
15973
15996
  });
15974
- import { homedir as homedir7 } from "node:os";
15997
+ import { homedir as homedir8 } from "node:os";
15975
15998
  import { resolve as resolvePath } from "node:path";
15976
15999
  async function resolveRunTarget(arg) {
15977
16000
  if (looksLikePath2(arg)) {
@@ -15999,8 +16022,8 @@ function looksLikePath2(arg) {
15999
16022
  return arg.startsWith("/") || arg.startsWith("./") || arg.startsWith("../") || arg.startsWith("~/");
16000
16023
  }
16001
16024
  function expandHome(arg) {
16002
- if (arg === "~") return homedir7();
16003
- if (arg.startsWith("~/")) return resolvePath(homedir7(), arg.slice(2));
16025
+ if (arg === "~") return homedir8();
16026
+ if (arg.startsWith("~/")) return resolvePath(homedir8(), arg.slice(2));
16004
16027
  return arg;
16005
16028
  }
16006
16029
  var init_resolve_run_target = __esm({
@@ -16021,29 +16044,6 @@ var init_run_teaser = __esm({
16021
16044
  }
16022
16045
  });
16023
16046
 
16024
- // packages/experience-design-system-cli/src/import/path-utils.ts
16025
- import { resolve as resolve21 } from "node:path";
16026
- import { homedir as homedir8 } from "node:os";
16027
- function expandTilde(input) {
16028
- if (input === "~" || input.startsWith("~/") || input.startsWith("~\\")) {
16029
- return homedir8() + input.slice(1);
16030
- }
16031
- return input;
16032
- }
16033
- function normalizePath(input) {
16034
- let p = input.trim();
16035
- if (p.length >= 2 && (p.startsWith('"') && p.endsWith('"') || p.startsWith("'") && p.endsWith("'"))) {
16036
- p = p.slice(1, -1);
16037
- }
16038
- p = expandTilde(p);
16039
- return resolve21(p);
16040
- }
16041
- var init_path_utils = __esm({
16042
- "packages/experience-design-system-cli/src/import/path-utils.ts"() {
16043
- "use strict";
16044
- }
16045
- });
16046
-
16047
16047
  // packages/experience-design-system-cli/src/runs/path-prompt.tsx
16048
16048
  import { useState as useState9, useEffect as useEffect3 } from "react";
16049
16049
  import { Box as Box19, Text as Text19 } from "ink";
@@ -26572,6 +26572,22 @@ If you are using AWS Bedrock, run:
26572
26572
  return;
26573
26573
  }
26574
26574
  const tokenCount = parsePrintTokensCount(r.stdout);
26575
+ if (!state.projectPath) {
26576
+ update({
26577
+ tokensPath,
26578
+ tokenSessionId,
26579
+ tokenCount,
26580
+ skipComponents: true,
26581
+ acceptedCount: 0,
26582
+ outDir: state.outDir || join23(process.cwd(), ".contentful")
26583
+ });
26584
+ if (noPush) {
26585
+ void startSaveFlow();
26586
+ } else {
26587
+ update({ step: "credentials" });
26588
+ }
26589
+ return;
26590
+ }
26575
26591
  update({ step: "path-validation", tokensPath, tokenSessionId, tokenCount });
26576
26592
  };
26577
26593
  const runExtract = async (projectPath) => {
@@ -32435,6 +32451,7 @@ function registerPrintCommand(program) {
32435
32451
  }
32436
32452
 
32437
32453
  // packages/experience-design-system-cli/src/import/command.ts
32454
+ init_path_utils();
32438
32455
  import { resolve as resolve25, join as join25 } from "node:path";
32439
32456
 
32440
32457
  // packages/experience-design-system-cli/src/import/orchestrator.ts
@@ -32447,7 +32464,7 @@ init_analytics();
32447
32464
  init_env();
32448
32465
  init_cli_path();
32449
32466
  import { mkdir as mkdir5 } from "node:fs/promises";
32450
- import { join as join18, resolve as resolve20 } from "node:path";
32467
+ import { join as join18, resolve as resolve21 } from "node:path";
32451
32468
  import { execFile as execFile2 } from "node:child_process";
32452
32469
  async function runStep(args, cliPath, analyticsSessionId, env = {}, streamStderr = false) {
32453
32470
  const debug = getDebugLogger();
@@ -32533,8 +32550,8 @@ function buildPushStepResult(args) {
32533
32550
  };
32534
32551
  }
32535
32552
  async function runPipeline(opts, progressWriter, cliPathOverride) {
32536
- const projectRoot = resolve20(opts.project);
32537
- const outDir = resolve20(opts.out);
32553
+ const projectRoot = resolve21(opts.project);
32554
+ const outDir = resolve21(opts.out);
32538
32555
  const componentsPath = join18(outDir, "components.json");
32539
32556
  const cliPath = cliPathOverride ?? findCliPath();
32540
32557
  const db = openPipelineDb();
@@ -33608,7 +33625,7 @@ function registerImportCommand(program) {
33608
33625
  }
33609
33626
  const { access: access11 } = await import("node:fs/promises");
33610
33627
  try {
33611
- await access11(opts.rawTokens);
33628
+ await access11(normalizePath(opts.rawTokens));
33612
33629
  } catch {
33613
33630
  process.stderr.write(`Error: --raw-tokens: file not found: ${opts.rawTokens}
33614
33631
  `);
@@ -33670,7 +33687,7 @@ function registerImportCommand(program) {
33670
33687
  initialHost: toConfiguredHost(opts.host ?? creds.host) ?? DEFAULT_CONFIGURED_HOST,
33671
33688
  initialAgent: resolvedAgent,
33672
33689
  ...resolvedModel ? { initialModel: resolvedModel } : {},
33673
- initialProjectPath: opts.project !== "." ? resolve25(opts.project) : void 0,
33690
+ initialProjectPath: opts.project !== "." ? normalizePath(opts.project) : void 0,
33674
33691
  host: opts.host,
33675
33692
  autoAcceptScope,
33676
33693
  autoRejectCycles: opts.autoRejectCycles ?? false,
@@ -33690,7 +33707,7 @@ function registerImportCommand(program) {
33690
33707
  ...opts.onConflict ? { onConflictMode: opts.onConflict } : {},
33691
33708
  selectPromptPath: opts.selectPromptPath ?? creds.selectPromptPath,
33692
33709
  generatePromptPath: opts.generatePromptPath ?? creds.generatePromptPath,
33693
- ...opts.rawTokens ? { initialRawTokensPath: resolve25(opts.rawTokens) } : {},
33710
+ ...opts.rawTokens ? { initialRawTokensPath: normalizePath(opts.rawTokens) } : {},
33694
33711
  allowDeletions: opts.allowDeletions === true,
33695
33712
  ...pickerProps
33696
33713
  })
@@ -33726,7 +33743,7 @@ function registerImportCommand(program) {
33726
33743
  process.exit(1);
33727
33744
  return;
33728
33745
  }
33729
- const projectRoot = resolve25(opts.project);
33746
+ const projectRoot = normalizePath(opts.project);
33730
33747
  const outDir = opts.out ? resolve25(opts.out) : join25(projectRoot, ".contentful");
33731
33748
  const headlessCreds = await readExperiencesCredentials();
33732
33749
  const headlessAgent = resolveAgent(opts.agent, headlessCreds.agent);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.26.2-dev-build-ccaf7cf.0",
3
+ "version": "2.26.2-dev-build-1b57430.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -36,10 +36,10 @@
36
36
  "react": "^18.3.1",
37
37
  "react-devtools-core": "^4.19.1",
38
38
  "react-dom": "^18.3.1",
39
- "svelte": "^5.56.10",
39
+ "svelte": "^5.56.4",
40
40
  "ts-morph": "^27.0.2",
41
41
  "typescript": "^5.9.3",
42
- "@contentful/experience-design-system-types": "2.26.2-dev-build-ccaf7cf.0"
42
+ "@contentful/experience-design-system-types": "2.26.2-dev-build-1b57430.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@tsconfig/node24": "^24.0.4",
@@ -51,9 +51,9 @@
51
51
  "ink-testing-library": "^4.0.0",
52
52
  "typescript-eslint": "^8.67.0",
53
53
  "vitest": "^4.0.16",
54
- "@contentful/experience-design-system-client": "2.26.2-dev-build-ccaf7cf.0",
55
- "@contentful/experience-design-system-extraction": "2.26.2-dev-build-ccaf7cf.0",
56
- "@contentful/experience-design-system-generation": "2.26.2-dev-build-ccaf7cf.0"
54
+ "@contentful/experience-design-system-extraction": "2.26.2-dev-build-1b57430.0",
55
+ "@contentful/experience-design-system-client": "2.26.2-dev-build-1b57430.0",
56
+ "@contentful/experience-design-system-generation": "2.26.2-dev-build-1b57430.0"
57
57
  },
58
58
  "repository": {
59
59
  "type": "git",