@prismicio/cli 0.0.1 → 0.0.2-alpha.xru-fix-npx-install-warnings.2

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 (91) hide show
  1. package/dist/acorn-CCr8VihG.js +3019 -0
  2. package/dist/acorn-CCr8VihG.js.map +1 -0
  3. package/dist/angular-B-6Sdz-P.js +2737 -0
  4. package/dist/angular-B-6Sdz-P.js.map +1 -0
  5. package/dist/babel-DSSzU6fH.js +7175 -0
  6. package/dist/babel-DSSzU6fH.js.map +1 -0
  7. package/dist/cli-NVpkXC9F.js +150015 -0
  8. package/dist/cli-NVpkXC9F.js.map +1 -0
  9. package/dist/cli.js +3 -144
  10. package/dist/cli.js.map +1 -1
  11. package/dist/estree-DHLJIae3.js +4486 -0
  12. package/dist/estree-DHLJIae3.js.map +1 -0
  13. package/dist/flow-DVd4L7fO.js +27426 -0
  14. package/dist/flow-DVd4L7fO.js.map +1 -0
  15. package/dist/glimmer-ffe_QHPj.js +2696 -0
  16. package/dist/glimmer-ffe_QHPj.js.map +1 -0
  17. package/dist/graphql-Cx6A4xbM.js +1241 -0
  18. package/dist/graphql-Cx6A4xbM.js.map +1 -0
  19. package/dist/html-Cp0WeaDh.js +2794 -0
  20. package/dist/html-Cp0WeaDh.js.map +1 -0
  21. package/dist/index-CAoPVwid.js +397 -0
  22. package/dist/index-CAoPVwid.js.map +1 -0
  23. package/dist/index-CqzxeUkd.js +835 -0
  24. package/dist/index-CqzxeUkd.js.map +1 -0
  25. package/dist/index-D3Z7xY3-.js +323 -0
  26. package/dist/index-D3Z7xY3-.js.map +1 -0
  27. package/dist/index-D80unpFN.js +3003 -0
  28. package/dist/index-D80unpFN.js.map +1 -0
  29. package/dist/index-DA8FlEll.js +35 -0
  30. package/dist/index-DA8FlEll.js.map +1 -0
  31. package/dist/index-DVTRroeB.js +189 -0
  32. package/dist/index-DVTRroeB.js.map +1 -0
  33. package/dist/index.js +2 -2
  34. package/dist/markdown-B2nQpAgl.js +3380 -0
  35. package/dist/markdown-B2nQpAgl.js.map +1 -0
  36. package/dist/meriyah-oMgd23nK.js +2640 -0
  37. package/dist/meriyah-oMgd23nK.js.map +1 -0
  38. package/dist/multipart-parser-jkRZKgYV.js +354 -0
  39. package/dist/multipart-parser-jkRZKgYV.js.map +1 -0
  40. package/dist/postcss-4okJ6bzF.js +4943 -0
  41. package/dist/postcss-4okJ6bzF.js.map +1 -0
  42. package/dist/typescript-eHDX_fq8.js +12974 -0
  43. package/dist/typescript-eHDX_fq8.js.map +1 -0
  44. package/dist/yaml-CoPGVzvb.js +4165 -0
  45. package/dist/yaml-CoPGVzvb.js.map +1 -0
  46. package/package.json +16 -17
  47. package/src/utils/sentry.ts +2 -0
  48. package/dist/_node_modules/meow/build/dependencies.js +0 -9040
  49. package/dist/_node_modules/meow/build/dependencies.js.map +0 -1
  50. package/dist/_node_modules/meow/build/index.js +0 -80
  51. package/dist/_node_modules/meow/build/index.js.map +0 -1
  52. package/dist/_node_modules/meow/build/options.js +0 -86
  53. package/dist/_node_modules/meow/build/options.js.map +0 -1
  54. package/dist/_node_modules/meow/build/parser.js +0 -61
  55. package/dist/_node_modules/meow/build/parser.js.map +0 -1
  56. package/dist/_node_modules/meow/build/utils.js +0 -8
  57. package/dist/_node_modules/meow/build/utils.js.map +0 -1
  58. package/dist/_node_modules/meow/build/validate.js +0 -102
  59. package/dist/_node_modules/meow/build/validate.js.map +0 -1
  60. package/dist/commands/init.js +0 -34
  61. package/dist/commands/init.js.map +0 -1
  62. package/dist/commands/sync.js +0 -32
  63. package/dist/commands/sync.js.map +0 -1
  64. package/dist/core/auth.js +0 -72
  65. package/dist/core/auth.js.map +0 -1
  66. package/dist/core/customType.js +0 -43
  67. package/dist/core/customType.js.map +0 -1
  68. package/dist/core/framework.js +0 -128
  69. package/dist/core/framework.js.map +0 -1
  70. package/dist/core/project.js +0 -92
  71. package/dist/core/project.js.map +0 -1
  72. package/dist/core/repository.js +0 -33
  73. package/dist/core/repository.js.map +0 -1
  74. package/dist/core/slices.js +0 -47
  75. package/dist/core/slices.js.map +0 -1
  76. package/dist/core/version.js +0 -27
  77. package/dist/core/version.js.map +0 -1
  78. package/dist/packages/cli/package.json.js +0 -63
  79. package/dist/packages/cli/package.json.js.map +0 -1
  80. package/dist/utils/error.js +0 -18
  81. package/dist/utils/error.js.map +0 -1
  82. package/dist/utils/listr.js +0 -12
  83. package/dist/utils/listr.js.map +0 -1
  84. package/dist/utils/output.js +0 -34
  85. package/dist/utils/output.js.map +0 -1
  86. package/dist/utils/package.js +0 -20
  87. package/dist/utils/package.js.map +0 -1
  88. package/dist/utils/sentry.js +0 -62
  89. package/dist/utils/sentry.js.map +0 -1
  90. package/dist/utils/telemetry.js +0 -42
  91. package/dist/utils/telemetry.js.map +0 -1
@@ -1,128 +0,0 @@
1
- import { readdir, rm, readFile } from "node:fs/promises";
2
- import { join } from "node:path";
3
- import adapterNextPlugin from "@prismicio/adapter-next";
4
- import adapterNuxtPlugin from "@prismicio/adapter-nuxt";
5
- import adapterNuxt2Plugin from "@prismicio/adapter-nuxt2";
6
- import adapterSveltekitPlugin from "@prismicio/adapter-sveltekit";
7
- import semver from "semver";
8
- import { listrRun } from "../utils/listr.js";
9
- const FRAMEWORKS = {
10
- "nuxt-2": {
11
- name: "Nuxt 2",
12
- telemetryID: "nuxt-2",
13
- adapterName: "@prismicio/adapter-nuxt2",
14
- compatibility: {
15
- nuxt: "^2.0.0"
16
- }
17
- },
18
- nuxt: {
19
- name: "Nuxt",
20
- telemetryID: "nuxt",
21
- adapterName: "@prismicio/adapter-nuxt",
22
- compatibility: {
23
- nuxt: "^3.0.0 || ^4.0.0"
24
- }
25
- },
26
- next: {
27
- name: "Next.js",
28
- telemetryID: "next",
29
- adapterName: "@prismicio/adapter-next",
30
- compatibility: {
31
- next: "^11 || ^12 || ^13 || ^14 || ^15 || ^16.0.0-beta.0"
32
- }
33
- },
34
- "sveltekit-1": {
35
- name: "SvelteKit",
36
- telemetryID: "sveltekit-1",
37
- adapterName: "@prismicio/adapter-sveltekit",
38
- compatibility: {
39
- "@sveltejs/kit": "^1.0.0"
40
- }
41
- },
42
- "sveltekit-2": {
43
- name: "SvelteKit",
44
- telemetryID: "sveltekit-2",
45
- adapterName: "@prismicio/adapter-sveltekit",
46
- compatibility: {
47
- "@sveltejs/kit": "^2.0.0"
48
- }
49
- }
50
- };
51
- const detectFramework = async (cwd) => {
52
- const path = join(cwd, "package.json");
53
- let allDependencies;
54
- try {
55
- const pkg = JSON.parse(await readFile(path, "utf-8"));
56
- allDependencies = {
57
- ...pkg.dependencies,
58
- ...pkg.devDependencies
59
- };
60
- } catch (error) {
61
- throw new Error(`Failed to read project's \`package.json\` at \`${path}\``, { cause: error });
62
- }
63
- const framework = Object.values(FRAMEWORKS).find((framework2) => {
64
- return Object.entries(framework2.compatibility).every(([pkg, range]) => {
65
- if (pkg in allDependencies) {
66
- try {
67
- const minimumVersion = semver.minVersion(allDependencies[pkg]);
68
- return semver.satisfies(minimumVersion, range);
69
- } catch {
70
- return true;
71
- }
72
- }
73
- return false;
74
- });
75
- });
76
- if (!framework) {
77
- throw new Error("No framework compatible with Prismic was found.");
78
- }
79
- return framework;
80
- };
81
- async function initFramework(args) {
82
- const { manager, projectContext } = args;
83
- const { framework } = projectContext;
84
- await listrRun([
85
- {
86
- title: `Initializing project for ${framework.name}...`,
87
- task: async (_, parentTask) => {
88
- const updateOutput = (data) => {
89
- if (data instanceof Buffer) {
90
- parentTask.output = data.toString();
91
- } else if (typeof data === "string") {
92
- parentTask.output = data;
93
- }
94
- };
95
- await manager.project.initProject({
96
- log: updateOutput
97
- });
98
- const projectRoot = await manager.project.getRoot();
99
- const entries = await readdir(projectRoot, {
100
- recursive: true,
101
- withFileTypes: true
102
- });
103
- for (const entry of entries) {
104
- if (entry.isDirectory() && entry.name === "slice-simulator") {
105
- await rm(join(entry.path, entry.name), {
106
- recursive: true,
107
- force: true
108
- });
109
- }
110
- }
111
- parentTask.title = `Updated project for ${framework.name}`;
112
- }
113
- }
114
- ]);
115
- }
116
- const FRAMEWORK_PLUGINS = {
117
- "@prismicio/adapter-next": adapterNextPlugin,
118
- "@prismicio/adapter-nuxt": adapterNuxtPlugin,
119
- "@prismicio/adapter-nuxt2": adapterNuxt2Plugin,
120
- "@prismicio/adapter-sveltekit": adapterSveltekitPlugin
121
- };
122
- export {
123
- FRAMEWORKS,
124
- FRAMEWORK_PLUGINS,
125
- detectFramework,
126
- initFramework
127
- };
128
- //# sourceMappingURL=framework.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"framework.js","sources":["../../../src/core/framework.ts"],"sourcesContent":["import { readFile, readdir, rm } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\nimport adapterNextPlugin from \"@prismicio/adapter-next\";\nimport adapterNuxtPlugin from \"@prismicio/adapter-nuxt\";\nimport adapterNuxt2Plugin from \"@prismicio/adapter-nuxt2\";\nimport adapterSveltekitPlugin from \"@prismicio/adapter-sveltekit\";\nimport { type PrismicManager } from \"@prismicio/manager\";\nimport semver from \"semver\";\n\nimport { listrRun } from \"../utils/listr\";\n\nimport { type ProjectContext } from \"./project\";\n\nexport type Framework = {\n\t/**\n\t * Framework's human readable name.\n\t */\n\tname: string;\n\n\t/**\n\t * Framework 's id sent to Segment from Slice Machine\n\t */\n\ttelemetryID: \"next\" | \"nuxt-2\" | \"nuxt\" | \"sveltekit-1\" | \"sveltekit-2\";\n\n\t/**\n\t * Package name of the adapter responsible for this framework\n\t */\n\tadapterName: string;\n\n\t/**\n\t * A package name/semver range map defining framework compatibility\n\t * requirements.\n\t *\n\t * Project should match all entries to be considered compatible.\n\t */\n\tcompatibility: Record<string, string>;\n};\n\n/**\n * Frameworks we support, orders shouldn't matter much but is respected (the\n * higher it is the more priority it has in case multiple matches)\n */\nexport const FRAMEWORKS: Record<string, Framework> = {\n\t\"nuxt-2\": {\n\t\tname: \"Nuxt 2\",\n\t\ttelemetryID: \"nuxt-2\",\n\t\tadapterName: \"@prismicio/adapter-nuxt2\",\n\t\tcompatibility: {\n\t\t\tnuxt: \"^2.0.0\",\n\t\t},\n\t},\n\tnuxt: {\n\t\tname: \"Nuxt\",\n\t\ttelemetryID: \"nuxt\",\n\t\tadapterName: \"@prismicio/adapter-nuxt\",\n\t\tcompatibility: {\n\t\t\tnuxt: \"^3.0.0 || ^4.0.0\",\n\t\t},\n\t},\n\tnext: {\n\t\tname: \"Next.js\",\n\t\ttelemetryID: \"next\",\n\t\tadapterName: \"@prismicio/adapter-next\",\n\t\tcompatibility: {\n\t\t\tnext: \"^11 || ^12 || ^13 || ^14 || ^15 || ^16.0.0-beta.0\",\n\t\t},\n\t},\n\t\"sveltekit-1\": {\n\t\tname: \"SvelteKit\",\n\t\ttelemetryID: \"sveltekit-1\",\n\t\tadapterName: \"@prismicio/adapter-sveltekit\",\n\t\tcompatibility: {\n\t\t\t\"@sveltejs/kit\": \"^1.0.0\",\n\t\t},\n\t},\n\t\"sveltekit-2\": {\n\t\tname: \"SvelteKit\",\n\t\ttelemetryID: \"sveltekit-2\",\n\t\tadapterName: \"@prismicio/adapter-sveltekit\",\n\t\tcompatibility: {\n\t\t\t\"@sveltejs/kit\": \"^2.0.0\",\n\t\t},\n\t},\n} as const;\n\nexport const detectFramework = async (cwd: string): Promise<Framework> => {\n\tconst path = join(cwd, \"package.json\");\n\n\tlet allDependencies: Record<string, string>;\n\ttry {\n\t\tconst pkg = JSON.parse(await readFile(path, \"utf-8\"));\n\n\t\tallDependencies = {\n\t\t\t...pkg.dependencies,\n\t\t\t...pkg.devDependencies,\n\t\t};\n\t} catch (error) {\n\t\tthrow new Error(\n\t\t\t`Failed to read project's \\`package.json\\` at \\`${path}\\``,\n\t\t\t{ cause: error },\n\t\t);\n\t}\n\n\tconst framework = Object.values(FRAMEWORKS).find((framework) => {\n\t\treturn Object.entries(framework.compatibility).every(([pkg, range]) => {\n\t\t\tif (pkg in allDependencies) {\n\t\t\t\ttry {\n\t\t\t\t\t// Determine lowest version possibly in use\n\t\t\t\t\tconst minimumVersion = semver.minVersion(allDependencies[pkg]);\n\n\t\t\t\t\treturn semver.satisfies(minimumVersion!, range);\n\t\t\t\t} catch {\n\t\t\t\t\t// We assume unconventional tags, `latest`, `beta`, `dev` matches the framework\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t});\n\t});\n\n\tif (!framework) {\n\t\tthrow new Error(\"No framework compatible with Prismic was found.\");\n\t}\n\n\treturn framework;\n};\n\ntype InitFrameworkArgs = {\n\tmanager: PrismicManager;\n\tprojectContext: ProjectContext;\n};\n\nexport async function initFramework(args: InitFrameworkArgs): Promise<void> {\n\tconst { manager, projectContext } = args;\n\tconst { framework } = projectContext;\n\n\tawait listrRun([\n\t\t{\n\t\t\ttitle: `Initializing project for ${framework.name}...`,\n\t\t\ttask: async (_, parentTask) => {\n\t\t\t\tconst updateOutput = (data: Buffer | string | null) => {\n\t\t\t\t\tif (data instanceof Buffer) {\n\t\t\t\t\t\tparentTask.output = data.toString();\n\t\t\t\t\t} else if (typeof data === \"string\") {\n\t\t\t\t\t\tparentTask.output = data;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tawait manager.project.initProject({\n\t\t\t\t\tlog: updateOutput,\n\t\t\t\t});\n\n\t\t\t\t// TODO: Export simulator management out of adapter and remove this code\n\t\t\t\tconst projectRoot = await manager.project.getRoot();\n\t\t\t\tconst entries = await readdir(projectRoot, {\n\t\t\t\t\trecursive: true,\n\t\t\t\t\twithFileTypes: true,\n\t\t\t\t});\n\t\t\t\tfor (const entry of entries) {\n\t\t\t\t\tif (entry.isDirectory() && entry.name === \"slice-simulator\") {\n\t\t\t\t\t\tawait rm(join(entry.path, entry.name), {\n\t\t\t\t\t\t\trecursive: true,\n\t\t\t\t\t\t\tforce: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tparentTask.title = `Updated project for ${framework.name}`;\n\t\t\t},\n\t\t},\n\t]);\n}\n\nexport const FRAMEWORK_PLUGINS = {\n\t\"@prismicio/adapter-next\": adapterNextPlugin,\n\t\"@prismicio/adapter-nuxt\": adapterNuxtPlugin,\n\t\"@prismicio/adapter-nuxt2\": adapterNuxt2Plugin,\n\t\"@prismicio/adapter-sveltekit\": adapterSveltekitPlugin,\n};\n"],"names":["framework"],"mappings":";;;;;;;;AA2CO,MAAM,aAAwC;AAAA,EACpD,UAAU;AAAA,IACT,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aAAa;AAAA,IACb,eAAe;AAAA,MACd,MAAM;AAAA,IAAA;AAAA,EACN;AAAA,EAEF,MAAM;AAAA,IACL,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aAAa;AAAA,IACb,eAAe;AAAA,MACd,MAAM;AAAA,IAAA;AAAA,EACN;AAAA,EAEF,MAAM;AAAA,IACL,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aAAa;AAAA,IACb,eAAe;AAAA,MACd,MAAM;AAAA,IAAA;AAAA,EACN;AAAA,EAEF,eAAe;AAAA,IACd,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aAAa;AAAA,IACb,eAAe;AAAA,MACd,iBAAiB;AAAA,IAAA;AAAA,EACjB;AAAA,EAEF,eAAe;AAAA,IACd,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aAAa;AAAA,IACb,eAAe;AAAA,MACd,iBAAiB;AAAA,IAAA;AAAA,EACjB;;AAII,MAAM,kBAAkB,OAAO,QAAmC;AACxE,QAAM,OAAO,KAAK,KAAK,cAAc;AAErC,MAAI;AACJ,MAAI;AACH,UAAM,MAAM,KAAK,MAAM,MAAM,SAAS,MAAM,OAAO,CAAC;AAEpD,sBAAkB;AAAA,MACjB,GAAG,IAAI;AAAA,MACP,GAAG,IAAI;AAAA,IAAA;AAAA,EAET,SAAS,OAAO;AACf,UAAM,IAAI,MACT,kDAAkD,IAAI,MACtD,EAAE,OAAO,OAAO;AAAA,EAElB;AAEA,QAAM,YAAY,OAAO,OAAO,UAAU,EAAE,KAAK,CAACA,eAAa;AAC9D,WAAO,OAAO,QAAQA,WAAU,aAAa,EAAE,MAAM,CAAC,CAAC,KAAK,KAAK,MAAK;AACrE,UAAI,OAAO,iBAAiB;AAC3B,YAAI;AAEH,gBAAM,iBAAiB,OAAO,WAAW,gBAAgB,GAAG,CAAC;AAE7D,iBAAO,OAAO,UAAU,gBAAiB,KAAK;AAAA,QAC/C,QAAQ;AAEP,iBAAO;AAAA,QACR;AAAA,MACD;AAEA,aAAO;AAAA,IACR,CAAC;AAAA,EACF,CAAC;AAED,MAAI,CAAC,WAAW;AACf,UAAM,IAAI,MAAM,iDAAiD;AAAA,EAClE;AAEA,SAAO;AACR;AAOA,eAAsB,cAAc,MAAuB;AAC1D,QAAM,EAAE,SAAS,eAAA,IAAmB;AACpC,QAAM,EAAE,cAAc;AAEtB,QAAM,SAAS;AAAA,IACd;AAAA,MACC,OAAO,4BAA4B,UAAU,IAAI;AAAA,MACjD,MAAM,OAAO,GAAG,eAAc;AAC7B,cAAM,eAAe,CAAC,SAAgC;AACrD,cAAI,gBAAgB,QAAQ;AAC3B,uBAAW,SAAS,KAAK,SAAA;AAAA,UAC1B,WAAW,OAAO,SAAS,UAAU;AACpC,uBAAW,SAAS;AAAA,UACrB;AAAA,QACD;AACA,cAAM,QAAQ,QAAQ,YAAY;AAAA,UACjC,KAAK;AAAA,QAAA,CACL;AAGD,cAAM,cAAc,MAAM,QAAQ,QAAQ,QAAA;AAC1C,cAAM,UAAU,MAAM,QAAQ,aAAa;AAAA,UAC1C,WAAW;AAAA,UACX,eAAe;AAAA,QAAA,CACf;AACD,mBAAW,SAAS,SAAS;AAC5B,cAAI,MAAM,YAAA,KAAiB,MAAM,SAAS,mBAAmB;AAC5D,kBAAM,GAAG,KAAK,MAAM,MAAM,MAAM,IAAI,GAAG;AAAA,cACtC,WAAW;AAAA,cACX,OAAO;AAAA,YAAA,CACP;AAAA,UACF;AAAA,QACD;AAEA,mBAAW,QAAQ,uBAAuB,UAAU,IAAI;AAAA,MACzD;AAAA,IAAA;AAAA,EACA,CACD;AACF;AAEO,MAAM,oBAAoB;AAAA,EAChC,2BAA2B;AAAA,EAC3B,2BAA2B;AAAA,EAC3B,4BAA4B;AAAA,EAC5B,gCAAgC;;"}
@@ -1,92 +0,0 @@
1
- import chalk from "chalk";
2
- import { detectFramework } from "./framework.js";
3
- import { listrRun, listr } from "../utils/listr.js";
4
- import { updateSentryContext } from "../utils/sentry.js";
5
- async function detectProjectState(args) {
6
- const { manager, commandType } = args;
7
- let prismicConfig;
8
- try {
9
- prismicConfig = await manager.project.getPrismicConfig();
10
- } catch {
11
- }
12
- const legacyConfigExists = await manager.project.checkLegacyConfigExists();
13
- if (commandType === "init" && (prismicConfig || legacyConfigExists)) {
14
- throw new Error("Project has already been initialized.");
15
- } else if (commandType === "sync" && !prismicConfig) {
16
- if (legacyConfigExists) {
17
- await manager.project.migrateLegacyConfig();
18
- } else {
19
- throw new Error("Project requires initialization before syncing.");
20
- }
21
- }
22
- }
23
- async function detectProjectContext(manager) {
24
- let framework;
25
- let packageManager;
26
- await listrRun([
27
- {
28
- title: "Detecting environment...",
29
- task: (_, parentTask) => listr([
30
- {
31
- title: "Detecting framework...",
32
- task: async (_2, task) => {
33
- framework = await detectFramework(manager.cwd);
34
- updateSentryContext({ framework: framework.telemetryID });
35
- task.title = `Detected framework ${chalk.cyan(framework.name)}`;
36
- }
37
- },
38
- {
39
- title: "Detecting package manager...",
40
- task: async (_2, task) => {
41
- packageManager = await manager.project.detectPackageManager({
42
- root: manager.cwd
43
- });
44
- task.title = `Detected package manager ${chalk.cyan(packageManager)}`;
45
- if (!framework) {
46
- throw new Error("Project framework must be available through context to proceed");
47
- }
48
- parentTask.title = `Detected framework ${chalk.cyan(framework.name)} and package manager ${chalk.cyan(packageManager)}`;
49
- }
50
- }
51
- ])
52
- }
53
- ]);
54
- if (!framework) {
55
- throw new Error("Project framework must be available through context to proceed");
56
- }
57
- if (!packageManager) {
58
- throw new Error("Project package manager must be available through context to proceed");
59
- }
60
- return {
61
- framework,
62
- packageManager
63
- };
64
- }
65
- async function createPrismicConfig(args) {
66
- const { manager, projectContext, repositoryName } = args;
67
- const { framework } = projectContext;
68
- return listrRun([
69
- {
70
- title: "Creating Prismic configuration...",
71
- task: async (_, parentTask) => {
72
- parentTask.title = "Creating Prismic configuration...";
73
- const prismicConfigPath = await manager.project.suggestPrismicConfigPath();
74
- await manager.project.writePrismicConfig({
75
- config: {
76
- repositoryName,
77
- adapter: framework.adapterName,
78
- libraries: ["./slices"]
79
- },
80
- path: prismicConfigPath
81
- });
82
- parentTask.title = "Created Prismic configuration";
83
- }
84
- }
85
- ]);
86
- }
87
- export {
88
- createPrismicConfig,
89
- detectProjectContext,
90
- detectProjectState
91
- };
92
- //# sourceMappingURL=project.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"project.js","sources":["../../../src/core/project.ts"],"sourcesContent":["import type {\n\tPackageManager,\n\tPrismicConfig,\n\tPrismicManager,\n} from \"@prismicio/manager\";\nimport chalk from \"chalk\";\n\nimport { type Framework, detectFramework } from \"../core/framework\";\nimport { listr, listrRun } from \"../utils/listr\";\nimport { updateSentryContext } from \"../utils/sentry\";\n\ntype DetectProjectStateArgs = {\n\tmanager: PrismicManager;\n\tcommandType: \"init\" | \"sync\";\n};\n\nexport async function detectProjectState(\n\targs: DetectProjectStateArgs,\n): Promise<void> {\n\tconst { manager, commandType } = args;\n\n\tlet prismicConfig: PrismicConfig | undefined;\n\n\ttry {\n\t\tprismicConfig = await manager.project.getPrismicConfig();\n\t} catch {\n\t\t// We want to manage the error depending on the need to be initialized or not\n\t}\n\n\tconst legacyConfigExists = await manager.project.checkLegacyConfigExists();\n\n\tif (commandType === \"init\" && (prismicConfig || legacyConfigExists)) {\n\t\tthrow new Error(\"Project has already been initialized.\");\n\t} else if (commandType === \"sync\" && !prismicConfig) {\n\t\tif (legacyConfigExists) {\n\t\t\tawait manager.project.migrateLegacyConfig();\n\t\t} else {\n\t\t\tthrow new Error(\"Project requires initialization before syncing.\");\n\t\t}\n\t}\n}\n\nexport type ProjectContext = {\n\tframework: Framework;\n\tpackageManager: PackageManager;\n};\n\nexport async function detectProjectContext(\n\tmanager: PrismicManager,\n): Promise<ProjectContext> {\n\tlet framework: Framework | undefined;\n\tlet packageManager: PackageManager | undefined;\n\n\tawait listrRun([\n\t\t{\n\t\t\ttitle: \"Detecting environment...\",\n\t\t\ttask: (_, parentTask) =>\n\t\t\t\tlistr([\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle: \"Detecting framework...\",\n\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\tframework = await detectFramework(manager.cwd);\n\n\t\t\t\t\t\t\t// Update Sentry context for the framework\n\t\t\t\t\t\t\tupdateSentryContext({ framework: framework.telemetryID });\n\n\t\t\t\t\t\t\ttask.title = `Detected framework ${chalk.cyan(framework.name)}`;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle: \"Detecting package manager...\",\n\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\tpackageManager = await manager.project.detectPackageManager({\n\t\t\t\t\t\t\t\troot: manager.cwd,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\ttask.title = `Detected package manager ${chalk.cyan(\n\t\t\t\t\t\t\t\tpackageManager,\n\t\t\t\t\t\t\t)}`;\n\n\t\t\t\t\t\t\tif (!framework) {\n\t\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t\t\"Project framework must be available through context to proceed\",\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tparentTask.title = `Detected framework ${chalk.cyan(\n\t\t\t\t\t\t\t\tframework.name,\n\t\t\t\t\t\t\t)} and package manager ${chalk.cyan(packageManager)}`;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t]),\n\t\t},\n\t]);\n\n\tif (!framework) {\n\t\tthrow new Error(\n\t\t\t\"Project framework must be available through context to proceed\",\n\t\t);\n\t}\n\n\tif (!packageManager) {\n\t\tthrow new Error(\n\t\t\t\"Project package manager must be available through context to proceed\",\n\t\t);\n\t}\n\n\treturn {\n\t\tframework,\n\t\tpackageManager,\n\t};\n}\n\ntype CreatePrismicConfigArgs = {\n\tmanager: PrismicManager;\n\tprojectContext: ProjectContext;\n\trepositoryName: string;\n};\n\nexport async function createPrismicConfig(\n\targs: CreatePrismicConfigArgs,\n): Promise<void> {\n\tconst { manager, projectContext, repositoryName } = args;\n\tconst { framework } = projectContext;\n\n\treturn listrRun([\n\t\t{\n\t\t\ttitle: \"Creating Prismic configuration...\",\n\t\t\ttask: async (_, parentTask) => {\n\t\t\t\tparentTask.title = \"Creating Prismic configuration...\";\n\n\t\t\t\tconst prismicConfigPath =\n\t\t\t\t\tawait manager.project.suggestPrismicConfigPath();\n\n\t\t\t\tawait manager.project.writePrismicConfig({\n\t\t\t\t\tconfig: {\n\t\t\t\t\t\trepositoryName,\n\t\t\t\t\t\tadapter: framework.adapterName,\n\t\t\t\t\t\tlibraries: [\"./slices\"],\n\t\t\t\t\t},\n\t\t\t\t\tpath: prismicConfigPath,\n\t\t\t\t});\n\n\t\t\t\tparentTask.title = \"Created Prismic configuration\";\n\t\t\t},\n\t\t},\n\t]);\n}\n"],"names":["_"],"mappings":";;;;AAgBA,eAAsB,mBACrB,MAA4B;AAE5B,QAAM,EAAE,SAAS,YAAA,IAAgB;AAEjC,MAAI;AAEJ,MAAI;AACH,oBAAgB,MAAM,QAAQ,QAAQ,iBAAA;AAAA,EACvC,QAAQ;AAAA,EAER;AAEA,QAAM,qBAAqB,MAAM,QAAQ,QAAQ,wBAAA;AAEjD,MAAI,gBAAgB,WAAW,iBAAiB,qBAAqB;AACpE,UAAM,IAAI,MAAM,uCAAuC;AAAA,EACxD,WAAW,gBAAgB,UAAU,CAAC,eAAe;AACpD,QAAI,oBAAoB;AACvB,YAAM,QAAQ,QAAQ,oBAAA;AAAA,IACvB,OAAO;AACN,YAAM,IAAI,MAAM,iDAAiD;AAAA,IAClE;AAAA,EACD;AACD;AAOA,eAAsB,qBACrB,SAAuB;AAEvB,MAAI;AACJ,MAAI;AAEJ,QAAM,SAAS;AAAA,IACd;AAAA,MACC,OAAO;AAAA,MACP,MAAM,CAAC,GAAG,eACT,MAAM;AAAA,QACL;AAAA,UACC,OAAO;AAAA,UACP,MAAM,OAAOA,IAAG,SAAQ;AACvB,wBAAY,MAAM,gBAAgB,QAAQ,GAAG;AAG7C,gCAAoB,EAAE,WAAW,UAAU,YAAA,CAAa;AAExD,iBAAK,QAAQ,sBAAsB,MAAM,KAAK,UAAU,IAAI,CAAC;AAAA,UAC9D;AAAA,QAAA;AAAA,QAED;AAAA,UACC,OAAO;AAAA,UACP,MAAM,OAAOA,IAAG,SAAQ;AACvB,6BAAiB,MAAM,QAAQ,QAAQ,qBAAqB;AAAA,cAC3D,MAAM,QAAQ;AAAA,YAAA,CACd;AAED,iBAAK,QAAQ,4BAA4B,MAAM,KAC9C,cAAc,CACd;AAED,gBAAI,CAAC,WAAW;AACf,oBAAM,IAAI,MACT,gEAAgE;AAAA,YAElE;AAEA,uBAAW,QAAQ,sBAAsB,MAAM,KAC9C,UAAU,IAAI,CACd,wBAAwB,MAAM,KAAK,cAAc,CAAC;AAAA,UACpD;AAAA,QAAA;AAAA,MACA,CACD;AAAA,IAAA;AAAA,EACF,CACD;AAED,MAAI,CAAC,WAAW;AACf,UAAM,IAAI,MACT,gEAAgE;AAAA,EAElE;AAEA,MAAI,CAAC,gBAAgB;AACpB,UAAM,IAAI,MACT,sEAAsE;AAAA,EAExE;AAEA,SAAO;AAAA,IACN;AAAA,IACA;AAAA,EAAA;AAEF;AAQA,eAAsB,oBACrB,MAA6B;AAE7B,QAAM,EAAE,SAAS,gBAAgB,eAAA,IAAmB;AACpD,QAAM,EAAE,cAAc;AAEtB,SAAO,SAAS;AAAA,IACf;AAAA,MACC,OAAO;AAAA,MACP,MAAM,OAAO,GAAG,eAAc;AAC7B,mBAAW,QAAQ;AAEnB,cAAM,oBACL,MAAM,QAAQ,QAAQ,yBAAA;AAEvB,cAAM,QAAQ,QAAQ,mBAAmB;AAAA,UACxC,QAAQ;AAAA,YACP;AAAA,YACA,SAAS,UAAU;AAAA,YACnB,WAAW,CAAC,UAAU;AAAA,UAAA;AAAA,UAEvB,MAAM;AAAA,QAAA,CACN;AAED,mBAAW,QAAQ;AAAA,MACpB;AAAA,IAAA;AAAA,EACA,CACD;AACF;"}
@@ -1,33 +0,0 @@
1
- import { listrRun } from "../utils/listr.js";
2
- import { updateSentryContext } from "../utils/sentry.js";
3
- async function validateRepository(args) {
4
- const { manager, repository } = args;
5
- return listrRun([
6
- {
7
- title: `Validating repository...`,
8
- task: async (_, task) => {
9
- updateSentryContext({ repositoryName: repository });
10
- const repositoryExists = await manager.prismicRepository.checkExists({
11
- domain: repository
12
- });
13
- if (!repositoryExists) {
14
- throw new Error(`Repository ${repository} does not exist.`);
15
- }
16
- const userRepositories = await manager.prismicRepository.readAll();
17
- const userSelectedRepository = userRepositories.find((repo) => repo.domain === repository);
18
- if (!userSelectedRepository) {
19
- throw new Error(`You're not part of the repository ${repository}.`);
20
- }
21
- const hasWriteAccess = await manager.prismicRepository.hasWriteAccess(userSelectedRepository);
22
- if (!hasWriteAccess) {
23
- throw new Error(`You do not have administrator access to repository ${repository}.`);
24
- }
25
- task.title = `Validated repository (${repository})`;
26
- }
27
- }
28
- ]);
29
- }
30
- export {
31
- validateRepository
32
- };
33
- //# sourceMappingURL=repository.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"repository.js","sources":["../../../src/core/repository.ts"],"sourcesContent":["import type { PrismicManager } from \"@prismicio/manager\";\n\nimport { listrRun } from \"../utils/listr\";\nimport { updateSentryContext } from \"../utils/sentry\";\n\nexport type ValidateRepositoryArgs = {\n\tmanager: PrismicManager;\n\trepository: string;\n};\n\nexport async function validateRepository(\n\targs: ValidateRepositoryArgs,\n): Promise<void> {\n\tconst { manager, repository } = args;\n\n\treturn listrRun([\n\t\t{\n\t\t\ttitle: `Validating repository...`,\n\t\t\ttask: async (_, task) => {\n\t\t\t\t// Update Sentry context for the repository name\n\t\t\t\tupdateSentryContext({ repositoryName: repository });\n\n\t\t\t\tconst repositoryExists = await manager.prismicRepository.checkExists({\n\t\t\t\t\tdomain: repository,\n\t\t\t\t});\n\t\t\t\tif (!repositoryExists) {\n\t\t\t\t\tthrow new Error(`Repository ${repository} does not exist.`);\n\t\t\t\t}\n\n\t\t\t\tconst userRepositories = await manager.prismicRepository.readAll();\n\t\t\t\tconst userSelectedRepository = userRepositories.find(\n\t\t\t\t\t(repo) => repo.domain === repository,\n\t\t\t\t);\n\t\t\t\tif (!userSelectedRepository) {\n\t\t\t\t\tthrow new Error(`You're not part of the repository ${repository}.`);\n\t\t\t\t}\n\n\t\t\t\tconst hasWriteAccess = await manager.prismicRepository.hasWriteAccess(\n\t\t\t\t\tuserSelectedRepository,\n\t\t\t\t);\n\t\t\t\tif (!hasWriteAccess) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`You do not have administrator access to repository ${repository}.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\ttask.title = `Validated repository (${repository})`;\n\t\t\t},\n\t\t},\n\t]);\n}\n"],"names":[],"mappings":";;AAUA,eAAsB,mBACrB,MAA4B;AAE5B,QAAM,EAAE,SAAS,WAAA,IAAe;AAEhC,SAAO,SAAS;AAAA,IACf;AAAA,MACC,OAAO;AAAA,MACP,MAAM,OAAO,GAAG,SAAQ;AAEvB,4BAAoB,EAAE,gBAAgB,YAAY;AAElD,cAAM,mBAAmB,MAAM,QAAQ,kBAAkB,YAAY;AAAA,UACpE,QAAQ;AAAA,QAAA,CACR;AACD,YAAI,CAAC,kBAAkB;AACtB,gBAAM,IAAI,MAAM,cAAc,UAAU,kBAAkB;AAAA,QAC3D;AAEA,cAAM,mBAAmB,MAAM,QAAQ,kBAAkB,QAAA;AACzD,cAAM,yBAAyB,iBAAiB,KAC/C,CAAC,SAAS,KAAK,WAAW,UAAU;AAErC,YAAI,CAAC,wBAAwB;AAC5B,gBAAM,IAAI,MAAM,qCAAqC,UAAU,GAAG;AAAA,QACnE;AAEA,cAAM,iBAAiB,MAAM,QAAQ,kBAAkB,eACtD,sBAAsB;AAEvB,YAAI,CAAC,gBAAgB;AACpB,gBAAM,IAAI,MACT,sDAAsD,UAAU,GAAG;AAAA,QAErE;AAEA,aAAK,QAAQ,yBAAyB,UAAU;AAAA,MACjD;AAAA,IAAA;AAAA,EACA,CACD;AACF;"}
@@ -1,47 +0,0 @@
1
- import { listrRun } from "../utils/listr.js";
2
- async function saveSlices(args) {
3
- const { manager } = args;
4
- await listrRun([
5
- {
6
- title: "Fetching Prismic slices...",
7
- task: async (_, parentTask) => {
8
- const slices = await manager.slices.fetchRemoteSlices();
9
- parentTask.title = "Saving Prismic slices changes...";
10
- const localSlices = await manager.slices.readAllSlices();
11
- for (const remoteSlice of slices) {
12
- const localSlice = localSlices.models.find((local) => local.model.id === remoteSlice.id);
13
- if (localSlice) {
14
- await manager.slices.updateSlice({
15
- libraryID: localSlice.libraryID,
16
- model: remoteSlice
17
- });
18
- }
19
- }
20
- for (const localSlice of localSlices.models) {
21
- const existsRemotely = slices.some((slice) => slice.id === localSlice.model.id);
22
- if (!existsRemotely) {
23
- await manager.slices.deleteSlice({
24
- libraryID: localSlice.libraryID,
25
- sliceID: localSlice.model.id
26
- });
27
- }
28
- }
29
- const defaultLibraryID = await manager.slices.getDefaultLibraryID();
30
- for (const remoteSlice of slices) {
31
- const existsLocally = localSlices.models.some((localSlice) => localSlice.model.id === remoteSlice.id);
32
- if (!existsLocally) {
33
- await manager.slices.createSlice({
34
- libraryID: defaultLibraryID,
35
- model: remoteSlice
36
- });
37
- }
38
- }
39
- parentTask.title = "Prismic slices changes saved";
40
- }
41
- }
42
- ]);
43
- }
44
- export {
45
- saveSlices
46
- };
47
- //# sourceMappingURL=slices.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"slices.js","sources":["../../../src/core/slices.ts"],"sourcesContent":["import type { PrismicManager } from \"@prismicio/manager\";\n\nimport { listrRun } from \"../utils/listr\";\n\ntype SaveSlicesArgs = {\n\tmanager: PrismicManager;\n};\n\nexport async function saveSlices(args: SaveSlicesArgs): Promise<void> {\n\tconst { manager } = args;\n\n\t// Save slices to local directory\n\tawait listrRun([\n\t\t{\n\t\t\ttitle: \"Fetching Prismic slices...\",\n\t\t\ttask: async (_, parentTask) => {\n\t\t\t\tconst slices = await manager.slices.fetchRemoteSlices();\n\n\t\t\t\tparentTask.title = \"Saving Prismic slices changes...\";\n\n\t\t\t\tconst localSlices = await manager.slices.readAllSlices();\n\n\t\t\t\t// Handle slices update\n\t\t\t\tfor (const remoteSlice of slices) {\n\t\t\t\t\tconst localSlice = localSlices.models.find(\n\t\t\t\t\t\t(local) => local.model.id === remoteSlice.id,\n\t\t\t\t\t);\n\t\t\t\t\tif (localSlice) {\n\t\t\t\t\t\tawait manager.slices.updateSlice({\n\t\t\t\t\t\t\tlibraryID: localSlice.libraryID,\n\t\t\t\t\t\t\tmodel: remoteSlice,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Handle slices deletion\n\t\t\t\tfor (const localSlice of localSlices.models) {\n\t\t\t\t\tconst existsRemotely = slices.some(\n\t\t\t\t\t\t(slice) => slice.id === localSlice.model.id,\n\t\t\t\t\t);\n\t\t\t\t\tif (!existsRemotely) {\n\t\t\t\t\t\tawait manager.slices.deleteSlice({\n\t\t\t\t\t\t\tlibraryID: localSlice.libraryID,\n\t\t\t\t\t\t\tsliceID: localSlice.model.id,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Handle slices creation\n\t\t\t\tconst defaultLibraryID = await manager.slices.getDefaultLibraryID();\n\t\t\t\tfor (const remoteSlice of slices) {\n\t\t\t\t\tconst existsLocally = localSlices.models.some(\n\t\t\t\t\t\t(localSlice) => localSlice.model.id === remoteSlice.id,\n\t\t\t\t\t);\n\t\t\t\t\tif (!existsLocally) {\n\t\t\t\t\t\tawait manager.slices.createSlice({\n\t\t\t\t\t\t\tlibraryID: defaultLibraryID,\n\t\t\t\t\t\t\tmodel: remoteSlice,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tparentTask.title = \"Prismic slices changes saved\";\n\t\t\t},\n\t\t},\n\t]);\n}\n"],"names":[],"mappings":";AAQA,eAAsB,WAAW,MAAoB;AACpD,QAAM,EAAE,YAAY;AAGpB,QAAM,SAAS;AAAA,IACd;AAAA,MACC,OAAO;AAAA,MACP,MAAM,OAAO,GAAG,eAAc;AAC7B,cAAM,SAAS,MAAM,QAAQ,OAAO,kBAAA;AAEpC,mBAAW,QAAQ;AAEnB,cAAM,cAAc,MAAM,QAAQ,OAAO,cAAA;AAGzC,mBAAW,eAAe,QAAQ;AACjC,gBAAM,aAAa,YAAY,OAAO,KACrC,CAAC,UAAU,MAAM,MAAM,OAAO,YAAY,EAAE;AAE7C,cAAI,YAAY;AACf,kBAAM,QAAQ,OAAO,YAAY;AAAA,cAChC,WAAW,WAAW;AAAA,cACtB,OAAO;AAAA,YAAA,CACP;AAAA,UACF;AAAA,QACD;AAGA,mBAAW,cAAc,YAAY,QAAQ;AAC5C,gBAAM,iBAAiB,OAAO,KAC7B,CAAC,UAAU,MAAM,OAAO,WAAW,MAAM,EAAE;AAE5C,cAAI,CAAC,gBAAgB;AACpB,kBAAM,QAAQ,OAAO,YAAY;AAAA,cAChC,WAAW,WAAW;AAAA,cACtB,SAAS,WAAW,MAAM;AAAA,YAAA,CAC1B;AAAA,UACF;AAAA,QACD;AAGA,cAAM,mBAAmB,MAAM,QAAQ,OAAO,oBAAA;AAC9C,mBAAW,eAAe,QAAQ;AACjC,gBAAM,gBAAgB,YAAY,OAAO,KACxC,CAAC,eAAe,WAAW,MAAM,OAAO,YAAY,EAAE;AAEvD,cAAI,CAAC,eAAe;AACnB,kBAAM,QAAQ,OAAO,YAAY;AAAA,cAChC,WAAW;AAAA,cACX,OAAO;AAAA,YAAA,CACP;AAAA,UACF;AAAA,QACD;AAEA,mBAAW,QAAQ;AAAA,MACpB;AAAA,IAAA;AAAA,EACA,CACD;AACF;"}
@@ -1,27 +0,0 @@
1
- import semver from "semver";
2
- import { listrRun } from "../utils/listr.js";
3
- async function checkCLIVersion(args) {
4
- await listrRun([
5
- {
6
- title: "Checking CLI version...",
7
- task: async (_, parentTask) => {
8
- if (semver.prerelease(args.currentVersion) !== null) {
9
- parentTask.title = "CLI version is a pre-release, skipping version check";
10
- } else {
11
- const isLatestVersion = await args.manager.versions.checkIsCLIVersionLatest({
12
- currentVersion: args.currentVersion
13
- });
14
- if (!isLatestVersion) {
15
- const latestVersion = await args.manager.versions.getLatestCLIVersion();
16
- throw new Error(`You are using an outdated version (${args.currentVersion}). The latest version is ${latestVersion}.`);
17
- }
18
- parentTask.title = "CLI version is up to date";
19
- }
20
- }
21
- }
22
- ]);
23
- }
24
- export {
25
- checkCLIVersion
26
- };
27
- //# sourceMappingURL=version.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.js","sources":["../../../src/core/version.ts"],"sourcesContent":["import type { PrismicManager } from \"@prismicio/manager\";\nimport semver from \"semver\";\n\nimport { listrRun } from \"../utils/listr\";\n\ntype CheckCLIVersionArgs = {\n\tmanager: PrismicManager;\n\tcurrentVersion: string;\n};\n\n/**\n * Checks if the current CLI version is the latest available version. Throws an\n * Error if the version is outdated.\n *\n * @param args - Arguments object containing the manager and current version.\n *\n * @throws Error If the current version is not the latest.\n */\nexport async function checkCLIVersion(\n\targs: CheckCLIVersionArgs,\n): Promise<void> {\n\tawait listrRun([\n\t\t{\n\t\t\ttitle: \"Checking CLI version...\",\n\t\t\ttask: async (_, parentTask) => {\n\t\t\t\t// Skip version check if current version is a pre-release (alpha, beta, rc, etc.)\n\t\t\t\tif (semver.prerelease(args.currentVersion) !== null) {\n\t\t\t\t\tparentTask.title =\n\t\t\t\t\t\t\"CLI version is a pre-release, skipping version check\";\n\t\t\t\t} else {\n\t\t\t\t\tconst isLatestVersion =\n\t\t\t\t\t\tawait args.manager.versions.checkIsCLIVersionLatest({\n\t\t\t\t\t\t\tcurrentVersion: args.currentVersion,\n\t\t\t\t\t\t});\n\n\t\t\t\t\tif (!isLatestVersion) {\n\t\t\t\t\t\tconst latestVersion =\n\t\t\t\t\t\t\tawait args.manager.versions.getLatestCLIVersion();\n\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t`You are using an outdated version (${args.currentVersion}). The latest version is ${latestVersion}.`,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tparentTask.title = \"CLI version is up to date\";\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t]);\n}\n"],"names":[],"mappings":";;AAkBA,eAAsB,gBACrB,MAAyB;AAEzB,QAAM,SAAS;AAAA,IACd;AAAA,MACC,OAAO;AAAA,MACP,MAAM,OAAO,GAAG,eAAc;AAE7B,YAAI,OAAO,WAAW,KAAK,cAAc,MAAM,MAAM;AACpD,qBAAW,QACV;AAAA,QACF,OAAO;AACN,gBAAM,kBACL,MAAM,KAAK,QAAQ,SAAS,wBAAwB;AAAA,YACnD,gBAAgB,KAAK;AAAA,UAAA,CACrB;AAEF,cAAI,CAAC,iBAAiB;AACrB,kBAAM,gBACL,MAAM,KAAK,QAAQ,SAAS,oBAAA;AAE7B,kBAAM,IAAI,MACT,sCAAsC,KAAK,cAAc,4BAA4B,aAAa,GAAG;AAAA,UAEvG;AAEA,qBAAW,QAAQ;AAAA,QACpB;AAAA,MACD;AAAA,IAAA;AAAA,EACA,CACD;AACF;"}
@@ -1,63 +0,0 @@
1
- const name = "@prismicio/cli";
2
- const version = "0.0.1";
3
- const description = "Prismic CLI";
4
- const keywords = ["typescript", "prismic"];
5
- const repository = { "type": "git", "url": "ssh://git@github.com/prismicio/devtools.git", "directory": "packages/init" };
6
- const license = "Apache-2.0";
7
- const author = "Prismic <contact@prismic.io> (https://prismic.io)";
8
- const type = "module";
9
- const exports$1 = { ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" }, "./cli": { "types": "./dist/cli.d.ts", "import": "./dist/cli.js" }, "./package.json": "./package.json" };
10
- const main = "dist/index.js";
11
- const module$1 = "dist/index.js";
12
- const types = "dist/index.d.ts";
13
- const bin = { "prismic": "./bin/prismic.js" };
14
- const files = ["bin", "dist", "src"];
15
- const engines = { "node": ">=20.19.0" };
16
- const publishConfig = { "access": "public" };
17
- const scripts = { "build": "vite build", "dev": "vite build --watch", "types": "tsc --noEmit", "format": "prettier --write .", "lint": "eslint --max-warnings 0 .", "prepack": "$npm_execpath run build", "depcheck": "depcheck --config=.depcheckrc", "audit": "yarn npm audit --environment production --severity high" };
18
- const dependencies = { "@prismicio/adapter-next": "workspace:*", "@prismicio/adapter-nuxt": "workspace:*", "@prismicio/adapter-nuxt2": "workspace:*", "@prismicio/adapter-sveltekit": "workspace:*", "@prismicio/manager": "workspace:*", "@sentry/node": "10.27.0", "chalk": "5.6.2", "listr2": "9.0.5", "meow": "14.0.0", "open": "11.0.0", "semver": "7.7.3", "zod": "4.1.13" };
19
- const devDependencies = { "@eslint/js": "9.28.0", "@trivago/prettier-plugin-sort-imports": "6.0.0", "@types/semver": "7.7.1", "depcheck": "1.4.7", "eslint": "9.39.1", "eslint-config-prettier": "10.1.8", "eslint-plugin-tsdoc": "0.5.0", "prettier": "3.7.1", "prettier-plugin-jsdoc": "1.7.0", "typescript": "5.9.3", "typescript-eslint": "8.33.0", "vite": "7.2.4", "vite-plugin-sdk": "0.1.5" };
20
- const _package = {
21
- name,
22
- version,
23
- description,
24
- keywords,
25
- repository,
26
- license,
27
- author,
28
- type,
29
- exports: exports$1,
30
- main,
31
- module: module$1,
32
- types,
33
- bin,
34
- files,
35
- engines,
36
- publishConfig,
37
- scripts,
38
- dependencies,
39
- devDependencies
40
- };
41
- export {
42
- author,
43
- bin,
44
- _package as default,
45
- dependencies,
46
- description,
47
- devDependencies,
48
- engines,
49
- exports$1 as exports,
50
- files,
51
- keywords,
52
- license,
53
- main,
54
- module$1 as module,
55
- name,
56
- publishConfig,
57
- repository,
58
- scripts,
59
- type,
60
- types,
61
- version
62
- };
63
- //# sourceMappingURL=package.json.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,18 +0,0 @@
1
- import semver from "semver";
2
- import { version } from "../packages/cli/package.json.js";
3
- const shouldShowErrors = () => {
4
- if (semver.prerelease(version) !== null) {
5
- return true;
6
- }
7
- return false;
8
- };
9
- function handleSilentError(error, context) {
10
- if (shouldShowErrors()) {
11
- const errorMessage = error instanceof Error ? error.message : String(error);
12
- console.error(`[${context}] Failed: ${errorMessage}`, error instanceof Error ? error : void 0);
13
- }
14
- }
15
- export {
16
- handleSilentError
17
- };
18
- //# sourceMappingURL=error.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.js","sources":["../../../src/utils/error.ts"],"sourcesContent":["import semver from \"semver\";\n\nimport * as pkg from \"../../package.json\";\n\n/**\n * Checks if we should show errors in the console. Errors are shown in\n * development mode or when using a pre-release version.\n *\n * @returns Whether to show errors.\n */\nconst shouldShowErrors = (): boolean => {\n\t// Show errors in development mode\n\tif (import.meta.env.DEV) {\n\t\treturn true;\n\t}\n\n\t// Show errors if it's a pre-release version\n\tif (semver.prerelease(pkg.version) !== null) {\n\t\treturn true;\n\t}\n\n\treturn false;\n};\n\n/**\n * Handles errors that should not break the CLI by logging them in\n * dev/pre-release mode, or silently failing otherwise.\n *\n * @param error - The error that occurred.\n * @param context - Context about what operation failed.\n */\nexport function handleSilentError(error: unknown, context: string): void {\n\tif (shouldShowErrors()) {\n\t\tconst errorMessage = error instanceof Error ? error.message : String(error);\n\t\tconsole.error(\n\t\t\t`[${context}] Failed: ${errorMessage}`,\n\t\t\terror instanceof Error ? error : undefined,\n\t\t);\n\t}\n}\n"],"names":["pkg.version"],"mappings":";;AAUA,MAAM,mBAAmB,MAAc;AAOtC,MAAI,OAAO,WAAWA,OAAW,MAAM,MAAM;AAC5C,WAAO;AAAA,EACR;AAEA,SAAO;AACR;AASM,SAAU,kBAAkB,OAAgB,SAAe;AAChE,MAAI,oBAAoB;AACvB,UAAM,eAAe,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC1E,YAAQ,MACP,IAAI,OAAO,aAAa,YAAY,IACpC,iBAAiB,QAAQ,QAAQ,MAAS;AAAA,EAE5C;AACD;"}
@@ -1,12 +0,0 @@
1
- import { Listr } from "listr2";
2
- const listr = (...[tasks, options]) => {
3
- return new Listr(tasks, options);
4
- };
5
- const listrRun = async (...[tasks, options]) => {
6
- return listr(tasks, options).run();
7
- };
8
- export {
9
- listr,
10
- listrRun
11
- };
12
- //# sourceMappingURL=listr.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"listr.js","sources":["../../../src/utils/listr.ts"],"sourcesContent":["import { Listr, type ListrTask, type ListrOptions } from \"listr2\";\n\ntype ListrArgs = [tasks: ListrTask[], options?: ListrOptions];\n\nexport const listr = (...[tasks, options]: ListrArgs): Listr => {\n\treturn new Listr(tasks, options);\n};\n\nexport const listrRun = async (\n\t...[tasks, options]: ListrArgs\n): Promise<void> => {\n\treturn listr(tasks, options).run();\n};\n"],"names":[],"mappings":";AAIO,MAAM,QAAQ,IAAI,CAAC,OAAO,OAAO,MAAuB;AAC9D,SAAO,IAAI,MAAM,OAAO,OAAO;AAChC;AAEO,MAAM,WAAW,UACpB,CAAC,OAAO,OAAO,MACA;AAClB,SAAO,MAAM,OAAO,OAAO,EAAE,IAAA;AAC9B;"}
@@ -1,34 +0,0 @@
1
- import chalk from "chalk";
2
- import { version } from "../packages/cli/package.json.js";
3
- function displayHeader() {
4
- console.info(chalk.cyan.bold("┌" + "─".repeat(48) + "┐\n") + chalk.white(" Prismic ") + chalk.gray(`v${version}
5
- `) + chalk.cyan.bold("└" + "─".repeat(48) + "┘\n"));
6
- }
7
- function displaySuccess(message, context) {
8
- console.info("\n" + chalk.green.bold("✓ Success"));
9
- console.info(chalk.green("─".repeat(50)));
10
- console.info(chalk.green(message));
11
- if (context) {
12
- console.info(chalk.gray(context + "\n"));
13
- } else {
14
- console.info();
15
- }
16
- }
17
- function displayError(error) {
18
- const errorMessage = error instanceof Error ? error.message : String(error);
19
- const errorStack = error instanceof Error && error.stack ? error.stack : void 0;
20
- console.error("\n" + chalk.red.bold("✕ Error"));
21
- console.error(chalk.red("─".repeat(50)));
22
- console.error(chalk.red(errorMessage) + "\n");
23
- if (errorStack) {
24
- console.error(chalk.gray("Stack trace:"));
25
- console.error(chalk.gray(errorStack) + "\n");
26
- }
27
- console.error(chalk.gray("─".repeat(50)) + chalk.gray("\nNeed help?") + chalk.white("\n • Documentation: https://prismic.io/docs") + chalk.white("\n • Raise an issue: https://community.prismic.io\n"));
28
- }
29
- export {
30
- displayError,
31
- displayHeader,
32
- displaySuccess
33
- };
34
- //# sourceMappingURL=output.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"output.js","sources":["../../../src/utils/output.ts"],"sourcesContent":["import chalk from \"chalk\";\n\nimport { version as pkgVersion } from \"../../package.json\";\n\nexport function displayHeader(): void {\n\tconsole.info(\n\t\tchalk.cyan.bold(\"┌\" + \"─\".repeat(48) + \"┐\\n\") +\n\t\t\tchalk.white(\" Prismic \") +\n\t\t\tchalk.gray(`v${pkgVersion}\\n`) +\n\t\t\tchalk.cyan.bold(\"└\" + \"─\".repeat(48) + \"┘\\n\"),\n\t);\n}\n\nexport function displaySuccess(message: string, context?: string): void {\n\tconsole.info(\"\\n\" + chalk.green.bold(\"✓ Success\"));\n\tconsole.info(chalk.green(\"─\".repeat(50)));\n\tconsole.info(chalk.green(message));\n\tif (context) {\n\t\tconsole.info(chalk.gray(context + \"\\n\"));\n\t} else {\n\t\tconsole.info();\n\t}\n}\n\nexport function displayError(error: unknown): void {\n\tconst errorMessage = error instanceof Error ? error.message : String(error);\n\tconst errorStack =\n\t\terror instanceof Error && error.stack ? error.stack : undefined;\n\n\tconsole.error(\"\\n\" + chalk.red.bold(\"✕ Error\"));\n\tconsole.error(chalk.red(\"─\".repeat(50)));\n\tconsole.error(chalk.red(errorMessage) + \"\\n\");\n\n\tif (errorStack) {\n\t\tconsole.error(chalk.gray(\"Stack trace:\"));\n\t\tconsole.error(chalk.gray(errorStack) + \"\\n\");\n\t}\n\n\tconsole.error(\n\t\tchalk.gray(\"─\".repeat(50)) +\n\t\t\tchalk.gray(\"\\nNeed help?\") +\n\t\t\tchalk.white(\"\\n • Documentation: https://prismic.io/docs\") +\n\t\t\tchalk.white(\"\\n • Raise an issue: https://community.prismic.io\\n\"),\n\t);\n}\n"],"names":["pkgVersion"],"mappings":";;SAIgB,gBAAa;AAC5B,UAAQ,KACP,MAAM,KAAK,KAAK,MAAM,IAAI,OAAO,EAAE,IAAI,KAAK,IAC3C,MAAM,MAAM,YAAY,IACxB,MAAM,KAAK,IAAIA,OAAU;AAAA,CAAI,IAC7B,MAAM,KAAK,KAAK,MAAM,IAAI,OAAO,EAAE,IAAI,KAAK,CAAC;AAEhD;AAEM,SAAU,eAAe,SAAiB,SAAgB;AAC/D,UAAQ,KAAK,OAAO,MAAM,MAAM,KAAK,WAAW,CAAC;AACjD,UAAQ,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC,CAAC;AACxC,UAAQ,KAAK,MAAM,MAAM,OAAO,CAAC;AACjC,MAAI,SAAS;AACZ,YAAQ,KAAK,MAAM,KAAK,UAAU,IAAI,CAAC;AAAA,EACxC,OAAO;AACN,YAAQ,KAAA;AAAA,EACT;AACD;AAEM,SAAU,aAAa,OAAc;AAC1C,QAAM,eAAe,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC1E,QAAM,aACL,iBAAiB,SAAS,MAAM,QAAQ,MAAM,QAAQ;AAEvD,UAAQ,MAAM,OAAO,MAAM,IAAI,KAAK,SAAS,CAAC;AAC9C,UAAQ,MAAM,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC,CAAC;AACvC,UAAQ,MAAM,MAAM,IAAI,YAAY,IAAI,IAAI;AAE5C,MAAI,YAAY;AACf,YAAQ,MAAM,MAAM,KAAK,cAAc,CAAC;AACxC,YAAQ,MAAM,MAAM,KAAK,UAAU,IAAI,IAAI;AAAA,EAC5C;AAEA,UAAQ,MACP,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC,IACxB,MAAM,KAAK,cAAc,IACzB,MAAM,MAAM,8CAA8C,IAC1D,MAAM,MAAM,sDAAsD,CAAC;AAEtE;"}
@@ -1,20 +0,0 @@
1
- import semver from "semver";
2
- function getPackageInfo(pkg) {
3
- const parsedPkgVersion = semver.parse(pkg.version);
4
- if (parsedPkgVersion === null) {
5
- throw new Error(`Package \`${pkg.name}\` has an invalid version \`${pkg.version}\` in its manifest.`);
6
- }
7
- let environment;
8
- if (parsedPkgVersion.prerelease.length === 0) {
9
- environment = "production";
10
- } else if (parsedPkgVersion.prerelease[0] === "alpha" || parsedPkgVersion.prerelease[0] === "beta") {
11
- environment = parsedPkgVersion.prerelease[0];
12
- } else {
13
- throw new Error(`Invalid package version: \`${pkg.name}@${parsedPkgVersion.version}\`. The first prerelease component \`${parsedPkgVersion.prerelease[0]}\` must be either \`alpha\` or \`beta\`.`);
14
- }
15
- return { environment, release: parsedPkgVersion.version };
16
- }
17
- export {
18
- getPackageInfo
19
- };
20
- //# sourceMappingURL=package.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package.js","sources":["../../../src/utils/package.ts"],"sourcesContent":["import semver from \"semver\";\n\ntype PackageManifest = { name: string; version: string };\ntype PackageInfo = { environment: string; release: string };\n\nexport function getPackageInfo(pkg: PackageManifest): PackageInfo {\n\tconst parsedPkgVersion = semver.parse(pkg.version);\n\tif (parsedPkgVersion === null) {\n\t\tthrow new Error(\n\t\t\t`Package \\`${pkg.name}\\` has an invalid version \\`${pkg.version}\\` in its manifest.`,\n\t\t);\n\t}\n\n\tlet environment;\n\tif (parsedPkgVersion.prerelease.length === 0) {\n\t\tenvironment = import.meta.env.MODE || \"production\";\n\t} else if (\n\t\tparsedPkgVersion.prerelease[0] === \"alpha\" ||\n\t\tparsedPkgVersion.prerelease[0] === \"beta\"\n\t) {\n\t\tenvironment = parsedPkgVersion.prerelease[0];\n\t} else {\n\t\tthrow new Error(\n\t\t\t`Invalid package version: \\`${pkg.name}@${parsedPkgVersion.version}\\`. The first prerelease component \\`${parsedPkgVersion.prerelease[0]}\\` must be either \\`alpha\\` or \\`beta\\`.`,\n\t\t);\n\t}\n\n\treturn { environment, release: parsedPkgVersion.version };\n}\n"],"names":[],"mappings":";AAKM,SAAU,eAAe,KAAoB;AAClD,QAAM,mBAAmB,OAAO,MAAM,IAAI,OAAO;AACjD,MAAI,qBAAqB,MAAM;AAC9B,UAAM,IAAI,MACT,aAAa,IAAI,IAAI,+BAA+B,IAAI,OAAO,qBAAqB;AAAA,EAEtF;AAEA,MAAI;AACJ,MAAI,iBAAiB,WAAW,WAAW,GAAG;AAC7C,kBAAc;AAAA,EACf,WACC,iBAAiB,WAAW,CAAC,MAAM,WACnC,iBAAiB,WAAW,CAAC,MAAM,QAClC;AACD,kBAAc,iBAAiB,WAAW,CAAC;AAAA,EAC5C,OAAO;AACN,UAAM,IAAI,MACT,8BAA8B,IAAI,IAAI,IAAI,iBAAiB,OAAO,wCAAwC,iBAAiB,WAAW,CAAC,CAAC,0CAA0C;AAAA,EAEpL;AAEA,SAAO,EAAE,aAAa,SAAS,iBAAiB,QAAA;AACjD;"}
@@ -1,62 +0,0 @@
1
- import * as Sentry from "@sentry/node";
2
- import * as _package from "../packages/cli/package.json.js";
3
- import { handleSilentError } from "./error.js";
4
- import { getPackageInfo } from "./package.js";
5
- const SENTRY_DSN = "https://e1886b1775bd397cd1afc60bfd2ebfc8@o146123.ingest.us.sentry.io/4510445143588864";
6
- const checkIsSentryEnabled = () => true;
7
- async function trackSentryError(error) {
8
- try {
9
- if (!checkIsSentryEnabled()) ;
10
- Sentry.captureException(error, {
11
- ...error instanceof Error ? { extra: { cause: error.cause, fullCommand: process.argv.join(" ") } } : {}
12
- });
13
- await Sentry.flush();
14
- } catch (sentryError) {
15
- handleSilentError(sentryError, "Sentry tracking error");
16
- }
17
- }
18
- function setupSentry() {
19
- try {
20
- if (!checkIsSentryEnabled()) ;
21
- const { environment, release } = getPackageInfo(_package);
22
- Sentry.init({
23
- dsn: SENTRY_DSN,
24
- release,
25
- environment,
26
- // Increase the default truncation length of 250 to 2500 (x10)
27
- // to have enough details in Sentry
28
- maxValueLength: 2500
29
- });
30
- } catch (error) {
31
- handleSilentError(error, "Sentry setup error");
32
- }
33
- }
34
- async function updateSentryContext({ repositoryName, framework, userProfile }) {
35
- try {
36
- if (!checkIsSentryEnabled()) ;
37
- if (userProfile) {
38
- Sentry.setUser({ id: userProfile.shortId });
39
- }
40
- if (repositoryName) {
41
- Sentry.setTag("repository", repositoryName);
42
- Sentry.setContext("Repository Data", {
43
- name: repositoryName
44
- });
45
- }
46
- if (framework) {
47
- Sentry.setTag("framework", framework);
48
- }
49
- Sentry.setContext("Process", {
50
- "Command used": process.argv.join(" "),
51
- cwd: process.cwd()
52
- });
53
- } catch (error) {
54
- handleSilentError(error, "Sentry context update error");
55
- }
56
- }
57
- export {
58
- setupSentry,
59
- trackSentryError,
60
- updateSentryContext
61
- };
62
- //# sourceMappingURL=sentry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sentry.js","sources":["../../../src/utils/sentry.ts"],"sourcesContent":["import { PrismicUserProfile } from \"@prismicio/manager\";\nimport * as Sentry from \"@sentry/node\";\n\nimport * as pkg from \"../../package.json\";\n\nimport { handleSilentError } from \"./error\";\nimport { getPackageInfo } from \"./package\";\n\nconst SENTRY_DSN =\n\timport.meta.env.VITE_SENTRY_DSN ||\n\t\"https://e1886b1775bd397cd1afc60bfd2ebfc8@o146123.ingest.us.sentry.io/4510445143588864\";\n\n/**\n * Checks whether or not Sentry is enabled.\n *\n * Sentry is enabled automatically in production but can be disabled by setting\n * `VITE_ENABLE_SENTRY` to `false`.\n *\n * @returns Whether or not Sentry is enabled.\n */\nconst checkIsSentryEnabled = (): boolean =>\n\timport.meta.env.VITE_ENABLE_SENTRY === undefined\n\t\t? import.meta.env.PROD\n\t\t: import.meta.env.VITE_ENABLE_SENTRY === \"true\";\n\nexport async function trackSentryError(error: unknown): Promise<void> {\n\ttry {\n\t\tif (!checkIsSentryEnabled()) {\n\t\t\treturn;\n\t\t}\n\n\t\tSentry.captureException(error, {\n\t\t\t...(error instanceof Error\n\t\t\t\t? { extra: { cause: error.cause, fullCommand: process.argv.join(\" \") } }\n\t\t\t\t: {}),\n\t\t});\n\n\t\t// Flush Sentry events before process exit\n\t\tawait Sentry.flush();\n\t} catch (sentryError) {\n\t\thandleSilentError(sentryError, \"Sentry tracking error\");\n\t}\n}\n\nexport function setupSentry(): void {\n\ttry {\n\t\tif (!checkIsSentryEnabled()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { environment, release } = getPackageInfo(pkg);\n\n\t\tSentry.init({\n\t\t\tdsn: SENTRY_DSN,\n\t\t\trelease,\n\t\t\tenvironment,\n\t\t\t// Increase the default truncation length of 250 to 2500 (x10)\n\t\t\t// to have enough details in Sentry\n\t\t\tmaxValueLength: 2_500,\n\t\t});\n\t} catch (error) {\n\t\thandleSilentError(error, \"Sentry setup error\");\n\t}\n}\n\ntype UpdateSentryContextArgs = {\n\trepositoryName?: string;\n\tframework?: string;\n\tuserProfile?: PrismicUserProfile;\n};\n\nexport async function updateSentryContext({\n\trepositoryName,\n\tframework,\n\tuserProfile,\n}: UpdateSentryContextArgs): Promise<void> {\n\ttry {\n\t\tif (!checkIsSentryEnabled()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (userProfile) {\n\t\t\tSentry.setUser({ id: userProfile.shortId });\n\t\t}\n\n\t\tif (repositoryName) {\n\t\t\tSentry.setTag(\"repository\", repositoryName);\n\t\t\tSentry.setContext(\"Repository Data\", {\n\t\t\t\tname: repositoryName,\n\t\t\t});\n\t\t}\n\n\t\tif (framework) {\n\t\t\tSentry.setTag(\"framework\", framework);\n\t\t}\n\n\t\tSentry.setContext(\"Process\", {\n\t\t\t\"Command used\": process.argv.join(\" \"),\n\t\t\tcwd: process.cwd(),\n\t\t});\n\t} catch (error) {\n\t\thandleSilentError(error, \"Sentry context update error\");\n\t}\n}\n"],"names":["pkg"],"mappings":";;;;AAQA,MAAM,aAEL;AAUD,MAAM,uBAAuB,MAEzB;AAGJ,eAAsB,iBAAiB,OAAc;AACpD,MAAI;AACH,QAAI,CAAC,uBAAwB;AAI7B,WAAO,iBAAiB,OAAO;AAAA,MAC9B,GAAI,iBAAiB,QAClB,EAAE,OAAO,EAAE,OAAO,MAAM,OAAO,aAAa,QAAQ,KAAK,KAAK,GAAG,EAAA,EAAC,IAClE,CAAA;AAAA,KACH;AAGD,UAAM,OAAO,MAAA;AAAA,EACd,SAAS,aAAa;AACrB,sBAAkB,aAAa,uBAAuB;AAAA,EACvD;AACD;SAEgB,cAAW;AAC1B,MAAI;AACH,QAAI,CAAC,uBAAwB;AAI7B,UAAM,EAAE,aAAa,YAAY,eAAeA,QAAG;AAEnD,WAAO,KAAK;AAAA,MACX,KAAK;AAAA,MACL;AAAA,MACA;AAAA;AAAA;AAAA,MAGA,gBAAgB;AAAA,IAAA,CAChB;AAAA,EACF,SAAS,OAAO;AACf,sBAAkB,OAAO,oBAAoB;AAAA,EAC9C;AACD;AAQA,eAAsB,oBAAoB,EACzC,gBACA,WACA,eACyB;AACzB,MAAI;AACH,QAAI,CAAC,uBAAwB;AAI7B,QAAI,aAAa;AAChB,aAAO,QAAQ,EAAE,IAAI,YAAY,SAAS;AAAA,IAC3C;AAEA,QAAI,gBAAgB;AACnB,aAAO,OAAO,cAAc,cAAc;AAC1C,aAAO,WAAW,mBAAmB;AAAA,QACpC,MAAM;AAAA,MAAA,CACN;AAAA,IACF;AAEA,QAAI,WAAW;AACd,aAAO,OAAO,aAAa,SAAS;AAAA,IACrC;AAEA,WAAO,WAAW,WAAW;AAAA,MAC5B,gBAAgB,QAAQ,KAAK,KAAK,GAAG;AAAA,MACrC,KAAK,QAAQ,IAAA;AAAA,IAAG,CAChB;AAAA,EACF,SAAS,OAAO;AACf,sBAAkB,OAAO,6BAA6B;AAAA,EACvD;AACD;"}