@prismicio/cli 0.0.1
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/bin/prismic.js +47 -0
- package/dist/_node_modules/meow/build/dependencies.js +9040 -0
- package/dist/_node_modules/meow/build/dependencies.js.map +1 -0
- package/dist/_node_modules/meow/build/index.js +80 -0
- package/dist/_node_modules/meow/build/index.js.map +1 -0
- package/dist/_node_modules/meow/build/options.js +86 -0
- package/dist/_node_modules/meow/build/options.js.map +1 -0
- package/dist/_node_modules/meow/build/parser.js +61 -0
- package/dist/_node_modules/meow/build/parser.js.map +1 -0
- package/dist/_node_modules/meow/build/utils.js +8 -0
- package/dist/_node_modules/meow/build/utils.js.map +1 -0
- package/dist/_node_modules/meow/build/validate.js +102 -0
- package/dist/_node_modules/meow/build/validate.js.map +1 -0
- package/dist/cli.d.ts +12 -0
- package/dist/cli.js +147 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/init.d.ts +7 -0
- package/dist/commands/init.js +34 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/sync.d.ts +6 -0
- package/dist/commands/sync.js +32 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/core/auth.d.ts +2 -0
- package/dist/core/auth.js +72 -0
- package/dist/core/auth.js.map +1 -0
- package/dist/core/customType.d.ts +6 -0
- package/dist/core/customType.js +43 -0
- package/dist/core/customType.js.map +1 -0
- package/dist/core/framework.d.ts +41 -0
- package/dist/core/framework.js +128 -0
- package/dist/core/framework.js.map +1 -0
- package/dist/core/project.d.ts +19 -0
- package/dist/core/project.js +92 -0
- package/dist/core/project.js.map +1 -0
- package/dist/core/repository.d.ts +6 -0
- package/dist/core/repository.js +33 -0
- package/dist/core/repository.js.map +1 -0
- package/dist/core/slices.d.ts +6 -0
- package/dist/core/slices.js +47 -0
- package/dist/core/slices.js.map +1 -0
- package/dist/core/version.d.ts +15 -0
- package/dist/core/version.js +27 -0
- package/dist/core/version.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/packages/cli/package.json.js +63 -0
- package/dist/packages/cli/package.json.js.map +1 -0
- package/dist/utils/error.d.ts +8 -0
- package/dist/utils/error.js +18 -0
- package/dist/utils/error.js.map +1 -0
- package/dist/utils/listr.d.ts +5 -0
- package/dist/utils/listr.js +12 -0
- package/dist/utils/listr.js.map +1 -0
- package/dist/utils/output.d.ts +3 -0
- package/dist/utils/output.js +34 -0
- package/dist/utils/output.js.map +1 -0
- package/dist/utils/package.d.ts +10 -0
- package/dist/utils/package.js +20 -0
- package/dist/utils/package.js.map +1 -0
- package/dist/utils/sentry.d.ts +10 -0
- package/dist/utils/sentry.js +62 -0
- package/dist/utils/sentry.js.map +1 -0
- package/dist/utils/telemetry.d.ts +14 -0
- package/dist/utils/telemetry.js +42 -0
- package/dist/utils/telemetry.js.map +1 -0
- package/package.json +84 -0
- package/src/cli.ts +186 -0
- package/src/commands/init.ts +68 -0
- package/src/commands/sync.ts +58 -0
- package/src/core/auth.ts +98 -0
- package/src/core/customType.ts +64 -0
- package/src/core/framework.ts +180 -0
- package/src/core/project.ts +148 -0
- package/src/core/repository.ts +51 -0
- package/src/core/slices.ts +67 -0
- package/src/core/version.ts +50 -0
- package/src/index.ts +1 -0
- package/src/utils/error.ts +40 -0
- package/src/utils/listr.ts +13 -0
- package/src/utils/output.ts +45 -0
- package/src/utils/package.ts +29 -0
- package/src/utils/sentry.ts +104 -0
- package/src/utils/telemetry.ts +70 -0
|
@@ -0,0 +1,27 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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;"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { run } from "./cli.js";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handles errors that should not break the CLI by logging them in
|
|
3
|
+
* dev/pre-release mode, or silently failing otherwise.
|
|
4
|
+
*
|
|
5
|
+
* @param error - The error that occurred.
|
|
6
|
+
* @param context - Context about what operation failed.
|
|
7
|
+
*/
|
|
8
|
+
export declare function handleSilentError(error: unknown, context: string): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Listr, type ListrTask, type ListrOptions } from "listr2";
|
|
2
|
+
type ListrArgs = [tasks: ListrTask[], options?: ListrOptions];
|
|
3
|
+
export declare const listr: (...[tasks, options]: ListrArgs) => Listr;
|
|
4
|
+
export declare const listrRun: (...[tasks, options]: ListrArgs) => Promise<void>;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PrismicUserProfile } from "@prismicio/manager";
|
|
2
|
+
export declare function trackSentryError(error: unknown): Promise<void>;
|
|
3
|
+
export declare function setupSentry(): void;
|
|
4
|
+
type UpdateSentryContextArgs = {
|
|
5
|
+
repositoryName?: string;
|
|
6
|
+
framework?: string;
|
|
7
|
+
userProfile?: PrismicUserProfile;
|
|
8
|
+
};
|
|
9
|
+
export declare function updateSentryContext({ repositoryName, framework, userProfile, }: UpdateSentryContextArgs): Promise<void>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PrismicManager } from "@prismicio/manager";
|
|
2
|
+
type InitTelemetryArgs = {
|
|
3
|
+
manager: PrismicManager;
|
|
4
|
+
commandType: "init" | "sync";
|
|
5
|
+
repositoryName?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function initTelemetry(args: InitTelemetryArgs): Promise<void>;
|
|
8
|
+
type TrackErrorTelemetryArgs = {
|
|
9
|
+
manager: PrismicManager;
|
|
10
|
+
error: unknown;
|
|
11
|
+
commandType: "init" | "sync";
|
|
12
|
+
};
|
|
13
|
+
export declare function trackErrorTelemetry(args: TrackErrorTelemetryArgs): Promise<void>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { version, name } from "../packages/cli/package.json.js";
|
|
2
|
+
import { handleSilentError } from "./error.js";
|
|
3
|
+
async function initTelemetry(args) {
|
|
4
|
+
const { manager, commandType, repositoryName } = args;
|
|
5
|
+
await manager.telemetry.initTelemetry({
|
|
6
|
+
appName: name,
|
|
7
|
+
appVersion: version
|
|
8
|
+
});
|
|
9
|
+
let resolvedRepositoryName = repositoryName;
|
|
10
|
+
if (!resolvedRepositoryName) {
|
|
11
|
+
resolvedRepositoryName = await manager.project.getRepositoryName();
|
|
12
|
+
}
|
|
13
|
+
await manager.telemetry.track({
|
|
14
|
+
event: "prismic-cli:start",
|
|
15
|
+
repository: resolvedRepositoryName,
|
|
16
|
+
commandType,
|
|
17
|
+
fullCommand: process.argv.join(" ")
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
async function trackErrorTelemetry(args) {
|
|
21
|
+
const { manager, error, commandType } = args;
|
|
22
|
+
const safeError = (error instanceof Error ? error.message : `${error}`).slice(0, 512);
|
|
23
|
+
let repositoryName;
|
|
24
|
+
try {
|
|
25
|
+
repositoryName = await manager.project.getRepositoryName();
|
|
26
|
+
} catch (error2) {
|
|
27
|
+
handleSilentError(error2, "Telemetry track error while getting repository name");
|
|
28
|
+
}
|
|
29
|
+
await manager.telemetry.track({
|
|
30
|
+
event: "prismic-cli:end",
|
|
31
|
+
commandType,
|
|
32
|
+
repository: repositoryName,
|
|
33
|
+
fullCommand: process.argv.join(" "),
|
|
34
|
+
success: false,
|
|
35
|
+
error: safeError
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
initTelemetry,
|
|
40
|
+
trackErrorTelemetry
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=telemetry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.js","sources":["../../../src/utils/telemetry.ts"],"sourcesContent":["import type { PrismicManager } from \"@prismicio/manager\";\n\nimport { name as pkgName, version as pkgVersion } from \"../../package.json\";\n\nimport { handleSilentError } from \"./error\";\n\ntype InitTelemetryArgs = {\n\tmanager: PrismicManager;\n\tcommandType: \"init\" | \"sync\";\n\trepositoryName?: string;\n};\n\nexport async function initTelemetry(args: InitTelemetryArgs): Promise<void> {\n\tconst { manager, commandType, repositoryName } = args;\n\n\tawait manager.telemetry.initTelemetry({\n\t\tappName: pkgName,\n\t\tappVersion: pkgVersion,\n\t});\n\n\t// Get repository name from project config if not provided\n\tlet resolvedRepositoryName = repositoryName;\n\tif (!resolvedRepositoryName) {\n\t\tresolvedRepositoryName = await manager.project.getRepositoryName();\n\t}\n\n\tawait manager.telemetry.track({\n\t\tevent: \"prismic-cli:start\",\n\t\trepository: resolvedRepositoryName,\n\t\tcommandType,\n\t\tfullCommand: process.argv.join(\" \"),\n\t});\n}\n\ntype TrackErrorTelemetryArgs = {\n\tmanager: PrismicManager;\n\terror: unknown;\n\tcommandType: \"init\" | \"sync\";\n};\n\nexport async function trackErrorTelemetry(\n\targs: TrackErrorTelemetryArgs,\n): Promise<void> {\n\tconst { manager, error, commandType } = args;\n\n\t// Transform error to string and prevent hitting Segment 500kb API limit\n\tconst safeError = (error instanceof Error ? error.message : `${error}`).slice(\n\t\t0,\n\t\t512,\n\t);\n\n\tlet repositoryName;\n\ttry {\n\t\trepositoryName = await manager.project.getRepositoryName();\n\t} catch (error) {\n\t\thandleSilentError(\n\t\t\terror,\n\t\t\t\"Telemetry track error while getting repository name\",\n\t\t);\n\t}\n\n\tawait manager.telemetry.track({\n\t\tevent: \"prismic-cli:end\",\n\t\tcommandType,\n\t\trepository: repositoryName,\n\t\tfullCommand: process.argv.join(\" \"),\n\t\tsuccess: false,\n\t\terror: safeError,\n\t});\n}\n"],"names":["pkgName","pkgVersion","error"],"mappings":";;AAYA,eAAsB,cAAc,MAAuB;AAC1D,QAAM,EAAE,SAAS,aAAa,eAAA,IAAmB;AAEjD,QAAM,QAAQ,UAAU,cAAc;AAAA,IACrC,SAASA;AAAAA,IACT,YAAYC;AAAAA,EAAA,CACZ;AAGD,MAAI,yBAAyB;AAC7B,MAAI,CAAC,wBAAwB;AAC5B,6BAAyB,MAAM,QAAQ,QAAQ,kBAAA;AAAA,EAChD;AAEA,QAAM,QAAQ,UAAU,MAAM;AAAA,IAC7B,OAAO;AAAA,IACP,YAAY;AAAA,IACZ;AAAA,IACA,aAAa,QAAQ,KAAK,KAAK,GAAG;AAAA,EAAA,CAClC;AACF;AAQA,eAAsB,oBACrB,MAA6B;AAE7B,QAAM,EAAE,SAAS,OAAO,YAAA,IAAgB;AAGxC,QAAM,aAAa,iBAAiB,QAAQ,MAAM,UAAU,GAAG,KAAK,IAAI,MACvE,GACA,GAAG;AAGJ,MAAI;AACJ,MAAI;AACH,qBAAiB,MAAM,QAAQ,QAAQ,kBAAA;AAAA,EACxC,SAASC,QAAO;AACf,sBACCA,QACA,qDAAqD;AAAA,EAEvD;AAEA,QAAM,QAAQ,UAAU,MAAM;AAAA,IAC7B,OAAO;AAAA,IACP;AAAA,IACA,YAAY;AAAA,IACZ,aAAa,QAAQ,KAAK,KAAK,GAAG;AAAA,IAClC,SAAS;AAAA,IACT,OAAO;AAAA,EAAA,CACP;AACF;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@prismicio/cli",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Prismic CLI",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"typescript",
|
|
7
|
+
"prismic"
|
|
8
|
+
],
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "ssh://git@github.com/prismicio/devtools.git",
|
|
12
|
+
"directory": "packages/init"
|
|
13
|
+
},
|
|
14
|
+
"license": "Apache-2.0",
|
|
15
|
+
"author": "Prismic <contact@prismic.io> (https://prismic.io)",
|
|
16
|
+
"type": "module",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./cli": {
|
|
23
|
+
"types": "./dist/cli.d.ts",
|
|
24
|
+
"import": "./dist/cli.js"
|
|
25
|
+
},
|
|
26
|
+
"./package.json": "./package.json"
|
|
27
|
+
},
|
|
28
|
+
"main": "dist/index.js",
|
|
29
|
+
"module": "dist/index.js",
|
|
30
|
+
"types": "dist/index.d.ts",
|
|
31
|
+
"bin": {
|
|
32
|
+
"prismic": "./bin/prismic.js"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"bin",
|
|
36
|
+
"dist",
|
|
37
|
+
"src"
|
|
38
|
+
],
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=20.19.0"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "vite build",
|
|
47
|
+
"dev": "vite build --watch",
|
|
48
|
+
"types": "tsc --noEmit",
|
|
49
|
+
"format": "prettier --write .",
|
|
50
|
+
"lint": "eslint --max-warnings 0 .",
|
|
51
|
+
"prepack": "$npm_execpath run build",
|
|
52
|
+
"depcheck": "depcheck --config=.depcheckrc",
|
|
53
|
+
"audit": "yarn npm audit --environment production --severity high"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@prismicio/adapter-next": "0.0.1",
|
|
57
|
+
"@prismicio/adapter-nuxt": "0.0.1",
|
|
58
|
+
"@prismicio/adapter-nuxt2": "0.0.1",
|
|
59
|
+
"@prismicio/adapter-sveltekit": "0.0.1",
|
|
60
|
+
"@prismicio/manager": "0.0.1",
|
|
61
|
+
"@sentry/node": "10.27.0",
|
|
62
|
+
"chalk": "5.6.2",
|
|
63
|
+
"listr2": "9.0.5",
|
|
64
|
+
"meow": "14.0.0",
|
|
65
|
+
"open": "11.0.0",
|
|
66
|
+
"semver": "7.7.3",
|
|
67
|
+
"zod": "4.1.13"
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@eslint/js": "9.28.0",
|
|
71
|
+
"@trivago/prettier-plugin-sort-imports": "6.0.0",
|
|
72
|
+
"@types/semver": "7.7.1",
|
|
73
|
+
"depcheck": "1.4.7",
|
|
74
|
+
"eslint": "9.39.1",
|
|
75
|
+
"eslint-config-prettier": "10.1.8",
|
|
76
|
+
"eslint-plugin-tsdoc": "0.5.0",
|
|
77
|
+
"prettier": "3.7.1",
|
|
78
|
+
"prettier-plugin-jsdoc": "1.7.0",
|
|
79
|
+
"typescript": "5.9.3",
|
|
80
|
+
"typescript-eslint": "8.33.0",
|
|
81
|
+
"vite": "7.2.4",
|
|
82
|
+
"vite-plugin-sdk": "0.1.5"
|
|
83
|
+
}
|
|
84
|
+
}
|