@alwaysmeticulous/cli 2.289.2 → 2.290.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.
package/dist/index.d.ts CHANGED
@@ -2,5 +2,3 @@ export { recordCommand } from "./commands/record/index";
2
2
  export { replayCommand } from "./commands/replay.command";
3
3
  export { ciRunLocalCommand } from "./commands/ci/run-local.command";
4
4
  export { ciStartTunnelCommand } from "./commands/ci/start-tunnel.command";
5
- export type { Snapshot, CustomCheckInput, CustomCheckVerdict, CustomCheckOutput, CustomCheckReport, MarkdownReport, CustomCheck, CustomCheckPluginManifest, PluginManifest, NetworkRequestSnapshotData, } from "@alwaysmeticulous/api";
6
- export { NETWORK_REQUESTS_SNAPSHOT_TYPE, CUSTOM_CHECK_SUMMARY_MAX_LENGTH, } from "@alwaysmeticulous/api";
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9f89521f-690e-572a-baa1-1ac24011a277")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="60e5aee7-2c01-592e-9b98-ef4f3150569d")}catch(e){}}();
3
3
 
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.CUSTOM_CHECK_SUMMARY_MAX_LENGTH = exports.NETWORK_REQUESTS_SNAPSHOT_TYPE = exports.ciStartTunnelCommand = exports.ciRunLocalCommand = exports.replayCommand = exports.recordCommand = void 0;
5
+ exports.ciStartTunnelCommand = exports.ciRunLocalCommand = exports.replayCommand = exports.recordCommand = void 0;
6
6
  var index_1 = require("./commands/record/index");
7
7
  Object.defineProperty(exports, "recordCommand", { enumerable: true, get: function () { return index_1.recordCommand; } });
8
8
  var replay_command_1 = require("./commands/replay.command");
@@ -11,8 +11,5 @@ var run_local_command_1 = require("./commands/ci/run-local.command");
11
11
  Object.defineProperty(exports, "ciRunLocalCommand", { enumerable: true, get: function () { return run_local_command_1.ciRunLocalCommand; } });
12
12
  var start_tunnel_command_1 = require("./commands/ci/start-tunnel.command");
13
13
  Object.defineProperty(exports, "ciStartTunnelCommand", { enumerable: true, get: function () { return start_tunnel_command_1.ciStartTunnelCommand; } });
14
- var api_1 = require("@alwaysmeticulous/api");
15
- Object.defineProperty(exports, "NETWORK_REQUESTS_SNAPSHOT_TYPE", { enumerable: true, get: function () { return api_1.NETWORK_REQUESTS_SNAPSHOT_TYPE; } });
16
- Object.defineProperty(exports, "CUSTOM_CHECK_SUMMARY_MAX_LENGTH", { enumerable: true, get: function () { return api_1.CUSTOM_CHECK_SUMMARY_MAX_LENGTH; } });
17
14
  //# sourceMappingURL=index.js.map
18
- //# debugId=9f89521f-690e-572a-baa1-1ac24011a277
15
+ //# debugId=60e5aee7-2c01-592e-9b98-ef4f3150569d
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,iDAAwD;AAA/C,sGAAA,aAAa,OAAA;AACtB,4DAA0D;AAAjD,+GAAA,aAAa,OAAA;AACtB,qEAAoE;AAA3D,sHAAA,iBAAiB,OAAA;AAC1B,2EAA0E;AAAjE,4HAAA,oBAAoB,OAAA;AAgB7B,6CAG+B;AAF7B,qHAAA,8BAA8B,OAAA;AAC9B,sHAAA,+BAA+B,OAAA","debugId":"9f89521f-690e-572a-baa1-1ac24011a277"}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,iDAAwD;AAA/C,sGAAA,aAAa,OAAA;AACtB,4DAA0D;AAAjD,+GAAA,aAAa,OAAA;AACtB,qEAAoE;AAA3D,sHAAA,iBAAiB,OAAA;AAC1B,2EAA0E;AAAjE,4HAAA,oBAAoB,OAAA","debugId":"60e5aee7-2c01-592e-9b98-ef4f3150569d"}
package/dist/main.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="df8c5e0a-1e1b-5ab2-a85c-0ce2a4eeab2d")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="59f67194-c7b4-54cb-aaeb-bda81b095c8a")}catch(e){}}();
3
3
 
4
4
  var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -18,9 +18,8 @@ const index_4 = require("./commands/debug/index");
18
18
  const deprecated_aliases_1 = require("./commands/deprecated-aliases");
19
19
  const index_5 = require("./commands/download/index");
20
20
  const local_1 = require("./commands/local");
21
- const index_6 = require("./commands/plugins/index");
22
- const index_7 = require("./commands/project/index");
23
- const index_8 = require("./commands/record/index");
21
+ const index_6 = require("./commands/project/index");
22
+ const index_7 = require("./commands/record/index");
24
23
  const replay_command_1 = require("./commands/replay.command");
25
24
  const schema_command_1 = require("./commands/schema.command");
26
25
  const handleDataDir = (dataDir) => {
@@ -42,9 +41,8 @@ const main = async () => {
42
41
  .command(index_4.debugCommand)
43
42
  .command(index_5.downloadCommand)
44
43
  .command(local_1.localCommand)
45
- .command(index_6.pluginsCommand)
46
- .command(index_7.projectCommand)
47
- .command(index_8.recordCommand)
44
+ .command(index_6.projectCommand)
45
+ .command(index_7.recordCommand)
48
46
  .command(replay_command_1.replayCommand)
49
47
  .command(schema_command_1.schemaCommand);
50
48
  for (const alias of deprecated_aliases_1.deprecatedAliases) {
@@ -89,4 +87,4 @@ const main = async () => {
89
87
  exports.main = main;
90
88
  void (0, exports.main)();
91
89
  //# sourceMappingURL=main.js.map
92
- //# debugId=df8c5e0a-1e1b-5ab2-a85c-0ce2a4eeab2d
90
+ //# debugId=59f67194-c7b4-54cb-aaeb-bda81b095c8a
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sources":["../src/main.ts"],"sourceRoot":"","names":[],"mappings":";;;;;;;;AAAA,+BAAuC;AACvC,qDAKkC;AAClC,qDAAsD;AACtD,kDAA0B;AAC1B,+DAA0D;AAC1D,kDAAsD;AACtD,iDAAoD;AACpD,+CAAgD;AAChD,kDAAsD;AACtD,sEAAkE;AAClE,qDAA4D;AAC5D,4CAAgD;AAChD,oDAA0D;AAC1D,oDAA0D;AAC1D,mDAAwD;AACxD,8DAA0D;AAC1D,8DAA0D;AAE1D,MAAM,aAAa,GAAG,CAAC,OAAkC,EAAQ,EAAE;IACjE,IAAA,kCAAyB,EAAC,OAAO,CAAC,CAAC;AACrC,CAAC,CAAC;AAEK,MAAM,IAAI,GAAG,KAAK,IAAmB,EAAE;IAC5C,IAAA,mBAAU,GAAE,CAAC;IACb,MAAM,eAAe,GAAG,IAAA,gBAAS,EAAC,IAAA,WAAI,EAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC;IACtE,MAAM,iBAAiB,GAAG,MAAM,IAAA,6BAAoB,EAAC,eAAe,CAAC,CAAC;IACtE,MAAM,IAAA,mBAAU,EAAC,iBAAiB,CAAC,CAAC;IAEpC,MAAM,GAAG,GAAG,eAAK;SACd,UAAU,CAAC,YAAY,CAAC;SACxB,KAAK,CACJ;;qBAEe,CAChB;SACA,OAAO,CAAC,oBAAY,CAAC;SACrB,OAAO,CAAC,mBAAW,CAAC;SACpB,OA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AAC,CAAC,IAAI,CAAC;AACZ,CAAC,CAAC;AApEW,QAAA,IAAI,QAoEf;AAEF,KAAK,IAAA,YAAI,GAAE,CAAC","debugId":"59f67194-c7b4-54cb-aaeb-bda81b095c8a"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwaysmeticulous/cli",
3
- "version": "2.289.2",
3
+ "version": "2.290.2",
4
4
  "description": "The Meticulous CLI",
5
5
  "license": "ISC",
6
6
  "main": "dist/index.js",
@@ -23,16 +23,16 @@
23
23
  "puppeteer-core": "24.14.0",
24
24
  "tar": "^7.5.8",
25
25
  "yargs": "^17.5.1",
26
- "@alwaysmeticulous/api": "2.289.1",
27
- "@alwaysmeticulous/client": "2.289.2",
26
+ "@alwaysmeticulous/api": "2.290.2",
27
+ "@alwaysmeticulous/client": "2.290.2",
28
28
  "@alwaysmeticulous/common": "2.287.1",
29
- "@alwaysmeticulous/debug-workspace": "2.289.2",
30
- "@alwaysmeticulous/downloading-helpers": "2.289.2",
31
- "@alwaysmeticulous/record": "2.289.1",
32
- "@alwaysmeticulous/remote-replay-launcher": "2.289.2",
29
+ "@alwaysmeticulous/debug-workspace": "2.290.2",
30
+ "@alwaysmeticulous/downloading-helpers": "2.290.2",
31
+ "@alwaysmeticulous/record": "2.290.2",
32
+ "@alwaysmeticulous/remote-replay-launcher": "2.290.2",
33
33
  "@alwaysmeticulous/replay-debugger-ui": "2.283.1",
34
- "@alwaysmeticulous/replay-orchestrator-launcher": "2.289.2",
35
- "@alwaysmeticulous/sdk-bundles-api": "2.289.1",
34
+ "@alwaysmeticulous/replay-orchestrator-launcher": "2.290.2",
35
+ "@alwaysmeticulous/sdk-bundles-api": "2.290.2",
36
36
  "@alwaysmeticulous/sentry": "2.287.1",
37
37
  "@alwaysmeticulous/tunnels-client": "2.287.1"
38
38
  },
@@ -1,161 +0,0 @@
1
- "use strict";
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e2cd0d6a-625a-546f-944b-981c91fcea0c")}catch(e){}}();
3
-
4
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
- if (k2 === undefined) k2 = k;
6
- var desc = Object.getOwnPropertyDescriptor(m, k);
7
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
- desc = { enumerable: true, get: function() { return m[k]; } };
9
- }
10
- Object.defineProperty(o, k2, desc);
11
- }) : (function(o, m, k, k2) {
12
- if (k2 === undefined) k2 = k;
13
- o[k2] = m[k];
14
- }));
15
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
16
- Object.defineProperty(o, "default", { enumerable: true, value: v });
17
- }) : function(o, v) {
18
- o["default"] = v;
19
- });
20
- var __importStar = (this && this.__importStar) || (function () {
21
- var ownKeys = function(o) {
22
- ownKeys = Object.getOwnPropertyNames || function (o) {
23
- var ar = [];
24
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
25
- return ar;
26
- };
27
- return ownKeys(o);
28
- };
29
- return function (mod) {
30
- if (mod && mod.__esModule) return mod;
31
- var result = {};
32
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
33
- __setModuleDefault(result, mod);
34
- return result;
35
- };
36
- })();
37
- Object.defineProperty(exports, "__esModule", { value: true });
38
- const promises_1 = require("fs/promises");
39
- const os_1 = require("os");
40
- const path_1 = require("path");
41
- const vitest_1 = require("vitest");
42
- const load_custom_check_plugin_1 = require("../load-custom-check-plugin");
43
- // Production loads plugins via a `new Function("return import(...)")` importer
44
- // so the native dynamic import survives the CommonJS compile (verified
45
- // separately against the built output). That importer can't run inside
46
- // vitest's VM, so here we inject a plain dynamic import, which vitest supports.
47
- const importModule = (specifier) => Promise.resolve(`${specifier}`).then(s => __importStar(require(s)));
48
- const loadCustomCheckPlugin = (pluginPath) => (0, load_custom_check_plugin_1.loadCustomCheckPlugin)(pluginPath, importModule);
49
- const VALID_MANIFEST = {
50
- id: "network-requests-check",
51
- type: "custom-check",
52
- version: "1.0.0",
53
- configuration: {
54
- displayName: "Network Requests",
55
- handlesSnapshotTypes: ["network-requests"],
56
- entryPoint: "./entrypoint.cjs",
57
- },
58
- };
59
- (0, vitest_1.describe)("loadCustomCheckPlugin", () => {
60
- const tempDirs = [];
61
- (0, vitest_1.afterEach)(async () => {
62
- await Promise.all(tempDirs
63
- .splice(0)
64
- .map((dir) => (0, promises_1.rm)(dir, { recursive: true, force: true })));
65
- });
66
- const makePluginDir = async (files) => {
67
- const dir = await (0, promises_1.mkdtemp)((0, path_1.join)((0, os_1.tmpdir)(), "meticulous-plugin-test-"));
68
- tempDirs.push(dir);
69
- await Promise.all(Object.entries(files).map(([name, contents]) => (0, promises_1.writeFile)((0, path_1.join)(dir, name), contents, "utf-8")));
70
- return dir;
71
- };
72
- const CJS_ENTRYPOINT = `module.exports = {
73
- execute: async () => ({
74
- verdict: "pass",
75
- summary: "ok",
76
- report: { type: "markdown", markdown: "no new requests" },
77
- }),
78
- };`;
79
- (0, vitest_1.it)("loads a CommonJS plugin and exposes its manifest and check", async () => {
80
- const dir = await makePluginDir({
81
- "manifest.json": JSON.stringify(VALID_MANIFEST),
82
- "entrypoint.cjs": CJS_ENTRYPOINT,
83
- });
84
- const { manifest, check } = await loadCustomCheckPlugin(dir);
85
- (0, vitest_1.expect)(manifest.id).toBe("network-requests-check");
86
- (0, vitest_1.expect)(manifest.configuration.handlesSnapshotTypes).toEqual([
87
- "network-requests",
88
- ]);
89
- const output = await check.execute({
90
- baseSnapshots: [],
91
- headSnapshots: [],
92
- });
93
- (0, vitest_1.expect)(output.verdict).toBe("pass");
94
- });
95
- (0, vitest_1.it)("loads an ESM plugin that uses a default export", async () => {
96
- const dir = await makePluginDir({
97
- "manifest.json": JSON.stringify({
98
- ...VALID_MANIFEST,
99
- configuration: {
100
- ...VALID_MANIFEST.configuration,
101
- entryPoint: "./entrypoint.mjs",
102
- },
103
- }),
104
- "entrypoint.mjs": `export default {
105
- execute: async () => ({
106
- verdict: "warn",
107
- report: { type: "markdown", markdown: "1 new request" },
108
- }),
109
- };`,
110
- });
111
- const { check } = await loadCustomCheckPlugin(dir);
112
- const output = await check.execute({
113
- baseSnapshots: [],
114
- headSnapshots: [],
115
- });
116
- (0, vitest_1.expect)(output.verdict).toBe("warn");
117
- });
118
- (0, vitest_1.it)("throws when the manifest is missing", async () => {
119
- const dir = await makePluginDir({ "entrypoint.cjs": CJS_ENTRYPOINT });
120
- await (0, vitest_1.expect)(loadCustomCheckPlugin(dir)).rejects.toThrow(/Could not read plugin manifest/);
121
- });
122
- (0, vitest_1.it)("throws when the manifest is not valid JSON", async () => {
123
- const dir = await makePluginDir({ "manifest.json": "{ not json" });
124
- await (0, vitest_1.expect)(loadCustomCheckPlugin(dir)).rejects.toThrow(/not valid JSON/);
125
- });
126
- (0, vitest_1.it)("throws when the manifest type is not custom-check", async () => {
127
- const dir = await makePluginDir({
128
- "manifest.json": JSON.stringify({ ...VALID_MANIFEST, type: "other" }),
129
- "entrypoint.cjs": CJS_ENTRYPOINT,
130
- });
131
- await (0, vitest_1.expect)(loadCustomCheckPlugin(dir)).rejects.toThrow(/"custom-check"/);
132
- });
133
- (0, vitest_1.it)("throws when handlesSnapshotTypes is empty", async () => {
134
- const dir = await makePluginDir({
135
- "manifest.json": JSON.stringify({
136
- ...VALID_MANIFEST,
137
- configuration: {
138
- ...VALID_MANIFEST.configuration,
139
- handlesSnapshotTypes: [],
140
- },
141
- }),
142
- "entrypoint.cjs": CJS_ENTRYPOINT,
143
- });
144
- await (0, vitest_1.expect)(loadCustomCheckPlugin(dir)).rejects.toThrow(/handlesSnapshotTypes/);
145
- });
146
- (0, vitest_1.it)("throws when the entry point file is missing", async () => {
147
- const dir = await makePluginDir({
148
- "manifest.json": JSON.stringify(VALID_MANIFEST),
149
- });
150
- await (0, vitest_1.expect)(loadCustomCheckPlugin(dir)).rejects.toThrow(/Failed to load plugin entry point/);
151
- });
152
- (0, vitest_1.it)("throws when the entry point does not export an execute function", async () => {
153
- const dir = await makePluginDir({
154
- "manifest.json": JSON.stringify(VALID_MANIFEST),
155
- "entrypoint.cjs": `module.exports = { notExecute: 1 };`,
156
- });
157
- await (0, vitest_1.expect)(loadCustomCheckPlugin(dir)).rejects.toThrow(/must default-export a custom check with an `execute` function/);
158
- });
159
- });
160
- //# sourceMappingURL=load-custom-check-plugin.spec.js.map
161
- //# debugId=e2cd0d6a-625a-546f-944b-981c91fcea0c
@@ -1 +0,0 @@
1
- {"version":3,"file":"load-custom-check-plugin.spec.js","sources":["../../../../src/commands/plugins/__tests__/load-custom-check-plugin.spec.ts"],"sourceRoot":"","names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAqD;AACrD,2BAA4B;AAC5B,+BAA4B;AAC5B,mCAAyD;AACzD,0EAGqC;AAErC,+EAA+E;AAC/E,uEAAuE;AACvE,uEAAuE;AACvE,gFAAgF;AAChF,MAAM,YAAY,GAAmB,CAAC,SAAS,EAAE,EAAE,oBAAQ,SAAS,uCAAC,CAAC;AACtE,MAAM,qBAAqB,GAAG,CAAC,UAAkB,EAAE,EAAE,CACnD,IAAA,gDAAwB,EAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AAErD,MAAM,cAAc,GAAG;IACrB,EAAE,EAAE,wBAAwB;IAC5B,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,OAAO;IAChB,aAAa,EAAE;QACb,WAAW,EAAE,kBAAkB;QAC/B,oBAAoB,EAAE,CAAC,kBAAkB,CAAC;QAC1C,UAAU,EAAE,kBAAkB;KAC/B;CACF,CAAC;AAEF,IAAA,iBAAQ,EAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,MAAM,QAAQ,GAAa,EAAE,CAAC;I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SAAS,CAAC,cAAc,CAAC;SAChD,CAAC,CAAC;QACH,MAAM,IAAA,eAAM,EAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CACtD,mCAAmC,CACpC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,iEAAiE,EAAE,KAAK,IAAI,EAAE;QAC/E,MAAM,GAAG,GAAG,MAAM,aAAa,CAAC;YAC9B,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC;YAC/C,gBAAgB,EAAE,qCAAqC;SACxD,CAAC,CAAC;QACH,MAAM,IAAA,eAAM,EAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CACtD,+DAA+D,CAChE,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","debugId":"e2cd0d6a-625a-546f-944b-981c91fcea0c"}
@@ -1,8 +0,0 @@
1
- import { CommandModule } from "yargs";
2
- interface Options {
3
- apiToken?: string | null | undefined;
4
- testRunId: string;
5
- pluginPath: string;
6
- }
7
- export declare const executeCustomCheckLocallyCommand: CommandModule<unknown, Options>;
8
- export {};
@@ -1,80 +0,0 @@
1
- "use strict";
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4e284472-7eda-5a6e-88c4-a152c3f02e86")}catch(e){}}();
3
-
4
- var __importDefault = (this && this.__importDefault) || function (mod) {
5
- return (mod && mod.__esModule) ? mod : { "default": mod };
6
- };
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.executeCustomCheckLocallyCommand = void 0;
9
- const api_1 = require("@alwaysmeticulous/api");
10
- const client_1 = require("@alwaysmeticulous/client");
11
- const common_1 = require("@alwaysmeticulous/common");
12
- const chalk_1 = __importDefault(require("chalk"));
13
- const sentry_utils_1 = require("../../command-utils/sentry.utils");
14
- const load_custom_check_plugin_1 = require("./load-custom-check-plugin");
15
- const handler = async ({ apiToken, testRunId, pluginPath, }) => {
16
- const logger = (0, common_1.initLogger)();
17
- const { manifest, check } = await (0, load_custom_check_plugin_1.loadCustomCheckPlugin)(pluginPath);
18
- logger.info(`Loaded custom check "${manifest.configuration.displayName}" (id: ${manifest.id}, v${manifest.version})`);
19
- const client = await (0, client_1.createClientWithOAuth)({
20
- apiToken,
21
- enableOAuthLogin: true,
22
- });
23
- const snapshotTypes = manifest.configuration.handlesSnapshotTypes;
24
- logger.info(`Fetching custom check snapshots for test run ${testRunId} (types: ${snapshotTypes.join(", ")})\u2026 this can take a little while.`);
25
- const fetchStartedAt = Date.now();
26
- const { baseTestRunId, baseSnapshots, headSnapshots } = await (0, client_1.getSnapshotsFromTestRun)({
27
- client,
28
- testRunId,
29
- snapshotTypes,
30
- });
31
- logger.info(`Fetched snapshots in ${((Date.now() - fetchStartedAt) / 1000).toFixed(1)}s for test run ${testRunId} (compared against base test run ${baseTestRunId}): ${baseSnapshots.length} base, ${headSnapshots.length} head.`);
32
- const output = await check.execute({ baseSnapshots, headSnapshots });
33
- printResult(manifest.configuration.displayName, output, logger);
34
- // Exit non-zero when the check did not pass cleanly so the command is usable
35
- // as a gate while iterating on a plugin locally. (A check that throws while
36
- // running surfaces as an error from `execute` above, not as a verdict.)
37
- if (output.verdict === "fail") {
38
- process.exit(1);
39
- }
40
- };
41
- const printResult = (displayName, output, logger) => {
42
- const verdictLabel = {
43
- pass: chalk_1.default.green("pass"),
44
- warn: chalk_1.default.yellow("warn"),
45
- fail: chalk_1.default.red("fail"),
46
- }[output.verdict];
47
- logger.info("");
48
- logger.info(`${chalk_1.default.bold(displayName)}: ${verdictLabel}${output.summary ? ` — ${truncateSummary(output.summary)}` : ""}`);
49
- if (output.report.type === "markdown" && output.report.markdown.trim()) {
50
- logger.info("");
51
- logger.info(output.report.markdown);
52
- }
53
- };
54
- // Mirror the UI's inline-summary limit so authors see locally when a summary is
55
- // too long to render inline.
56
- const truncateSummary = (summary) => summary.length > api_1.CUSTOM_CHECK_SUMMARY_MAX_LENGTH
57
- ? `${summary.slice(0, api_1.CUSTOM_CHECK_SUMMARY_MAX_LENGTH - 1)}…`
58
- : summary;
59
- exports.executeCustomCheckLocallyCommand = {
60
- command: "execute-custom-check-locally",
61
- describe: "Run a custom check plugin locally against the snapshots of a test run",
62
- builder: {
63
- apiToken: {
64
- string: true,
65
- },
66
- testRunId: {
67
- string: true,
68
- demandOption: true,
69
- description: "The test run to run the custom check against",
70
- },
71
- pluginPath: {
72
- string: true,
73
- demandOption: true,
74
- description: "Path to the built plugin directory (containing manifest.json and its entry point)",
75
- },
76
- },
77
- handler: (0, sentry_utils_1.wrapHandler)(handler),
78
- };
79
- //# sourceMappingURL=execute-custom-check-locally.command.js.map
80
- //# debugId=4e284472-7eda-5a6e-88c4-a152c3f02e86
@@ -1 +0,0 @@
1
- {"version":3,"file":"execute-custom-check-locally.command.js","sources":["../../../src/commands/plugins/execute-custom-check-locally.command.ts"],"sourceRoot":"","names":[],"mappings":";;;;;;;;AAAA,+CAG+B;AAC/B,qDAGkC;AAClC,qDAAsD;AACtD,kDAA0B;AAE1B,mEAA+D;AAC/D,yEAAmE;AAQnE,MAAM,OAAO,GAAG,KAAK,EAAE,EACrB,QAAQ,EACR,SAAS,EACT,UAAU,GACF,EAAiB,EAAE;IAC3B,MAAM,MAAM,GAAG,IAAA,mBAAU,GAAE,CAAC;IAE5B,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,MAAM,IAAA,gDAAqB,EAAC,UAAU,CAAC,CAAC;IACpE,MAAM,CAAC,IAAI,CACT,wBAAwB,QAAQ,CAAC,aAAa,CAAC,WAAW,UAAU,QAAQ,CAAC,EAAE,MAAM,QAAQ,CAAC,OAAO,GAAG,CACzG,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,IAAA,8BAAqB,EAAC;QACzC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,OAAO,CAAC;CAC9B,CAAC","debugId":"4e284472-7eda-5a6e-88c4-a152c3f02e86"}
@@ -1,2 +0,0 @@
1
- import { CommandModule } from "yargs";
2
- export declare const pluginsCommand: CommandModule;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4a460f34-516d-5094-ae3f-c90749be52c1")}catch(e){}}();
3
-
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.pluginsCommand = void 0;
6
- const execute_custom_check_locally_command_1 = require("./execute-custom-check-locally.command");
7
- exports.pluginsCommand = {
8
- command: "plugins",
9
- describe: "Commands for developing Meticulous plugins",
10
- builder: (yargs) => yargs.command(execute_custom_check_locally_command_1.executeCustomCheckLocallyCommand).demandCommand().help(),
11
- handler: () => {
12
- // subcommand handles this
13
- },
14
- };
15
- //# sourceMappingURL=index.js.map
16
- //# debugId=4a460f34-516d-5094-ae3f-c90749be52c1
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/commands/plugins/index.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AACA,iGAA0F;AAE7E,QAAA,cAAc,GAAkB;IAC3C,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,4CAA4C;IACtD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CACjB,KAAK,CAAC,OAAO,CAAC,uEAAgC,CAAC,CAAC,aAAa,EAAE,CAAC,IAAI,EAAE;IACxE,OAAO,EAAE,GAAG,EAAE;QACZ,0BAA0B;IAC5B,CAAC;CACF,CAAC","debugId":"4a460f34-516d-5094-ae3f-c90749be52c1"}
@@ -1,14 +0,0 @@
1
- import type { CustomCheck, CustomCheckPluginManifest } from "@alwaysmeticulous/api";
2
- /** Imports a module by absolute file URL, returning its namespace object. */
3
- export type ModuleImporter = (specifier: string) => Promise<Record<string, unknown>>;
4
- export interface LoadedCustomCheckPlugin {
5
- manifest: CustomCheckPluginManifest;
6
- check: CustomCheck;
7
- }
8
- /**
9
- * Loads a custom check plugin from a built plugin directory containing a
10
- * `manifest.json` and the entry point it points to. The manifest is parsed and
11
- * validated first (without executing any plugin code), then the entry point is
12
- * dynamically imported and checked to expose an `execute` function.
13
- */
14
- export declare const loadCustomCheckPlugin: (pluginPath: string, importModule?: ModuleImporter) => Promise<LoadedCustomCheckPlugin>;
@@ -1,103 +0,0 @@
1
- "use strict";
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ff1476bc-5b8f-570b-aa9f-7276e2ccb9df")}catch(e){}}();
3
-
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.loadCustomCheckPlugin = void 0;
6
- const promises_1 = require("fs/promises");
7
- const path_1 = require("path");
8
- const url_1 = require("url");
9
- const MANIFEST_FILE_NAME = "manifest.json";
10
- // This package is compiled to CommonJS, where `tsc` would downlevel a direct
11
- // `import()` into `require()` — which cannot load ESM plugins and cannot accept
12
- // a file:// URL. Building the dynamic import via `new Function` preserves a
13
- // native runtime `import()`, which loads both CommonJS and ESM plugin entry
14
- // points from an absolute file URL.
15
- const nativeImportModule = new Function("specifier", "return import(specifier);");
16
- /**
17
- * Loads a custom check plugin from a built plugin directory containing a
18
- * `manifest.json` and the entry point it points to. The manifest is parsed and
19
- * validated first (without executing any plugin code), then the entry point is
20
- * dynamically imported and checked to expose an `execute` function.
21
- */
22
- const loadCustomCheckPlugin = async (pluginPath,
23
- // Injectable so unit tests can pass an importer that works inside the test
24
- // runner's VM (where the `new Function` import is unavailable). Production
25
- // uses the native dynamic import above.
26
- importModule = nativeImportModule) => {
27
- const pluginDir = (0, path_1.resolve)(pluginPath);
28
- const manifest = await readManifest(pluginDir);
29
- const check = await loadEntryPoint(pluginDir, manifest, importModule);
30
- return { manifest, check };
31
- };
32
- exports.loadCustomCheckPlugin = loadCustomCheckPlugin;
33
- const readManifest = async (pluginDir) => {
34
- const manifestPath = (0, path_1.resolve)(pluginDir, MANIFEST_FILE_NAME);
35
- let raw;
36
- try {
37
- raw = await (0, promises_1.readFile)(manifestPath, "utf-8");
38
- }
39
- catch {
40
- throw new Error(`Could not read plugin manifest at ${manifestPath}. Pass --pluginPath pointing at a built plugin directory containing a ${MANIFEST_FILE_NAME}.`);
41
- }
42
- let parsed;
43
- try {
44
- parsed = JSON.parse(raw);
45
- }
46
- catch {
47
- throw new Error(`Plugin manifest at ${manifestPath} is not valid JSON.`);
48
- }
49
- return validateManifest(parsed, manifestPath);
50
- };
51
- const validateManifest = (parsed, manifestPath) => {
52
- const fail = (reason) => {
53
- throw new Error(`Invalid plugin manifest at ${manifestPath}: ${reason}`);
54
- };
55
- if (typeof parsed !== "object" || parsed === null) {
56
- return fail("expected a JSON object.");
57
- }
58
- const manifest = parsed;
59
- if (manifest["type"] !== "custom-check") {
60
- return fail(`expected "type" to be "custom-check".`);
61
- }
62
- if (typeof manifest["id"] !== "string" || manifest["id"].length === 0) {
63
- return fail(`expected a non-empty string "id".`);
64
- }
65
- if (typeof manifest["version"] !== "string") {
66
- return fail(`expected a string "version".`);
67
- }
68
- const configuration = manifest["configuration"];
69
- if (typeof configuration !== "object" || configuration === null) {
70
- return fail(`expected a "configuration" object.`);
71
- }
72
- const config = configuration;
73
- if (typeof config["displayName"] !== "string") {
74
- return fail(`expected "configuration.displayName" to be a string.`);
75
- }
76
- if (typeof config["entryPoint"] !== "string") {
77
- return fail(`expected "configuration.entryPoint" to be a string.`);
78
- }
79
- if (!Array.isArray(config["handlesSnapshotTypes"]) ||
80
- config["handlesSnapshotTypes"].length === 0 ||
81
- !config["handlesSnapshotTypes"].every((type) => typeof type === "string")) {
82
- return fail(`expected "configuration.handlesSnapshotTypes" to be a non-empty array of strings.`);
83
- }
84
- return manifest;
85
- };
86
- const loadEntryPoint = async (pluginDir, manifest, importModule) => {
87
- const entryPointPath = (0, path_1.resolve)(pluginDir, manifest.configuration.entryPoint);
88
- let imported;
89
- try {
90
- imported = await importModule((0, url_1.pathToFileURL)(entryPointPath).href);
91
- }
92
- catch (error) {
93
- throw new Error(`Failed to load plugin entry point ${entryPointPath}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
94
- }
95
- // Support both `export default check` (ESM) and `module.exports = check` (CJS).
96
- const candidate = (imported["default"] ?? imported);
97
- if (typeof candidate?.execute !== "function") {
98
- throw new Error(`Plugin entry point ${entryPointPath} must default-export a custom check with an \`execute\` function.`);
99
- }
100
- return candidate;
101
- };
102
- //# sourceMappingURL=load-custom-check-plugin.js.map
103
- //# debugId=ff1476bc-5b8f-570b-aa9f-7276e2ccb9df
@@ -1 +0,0 @@
1
- {"version":3,"file":"load-custom-check-plugin.js","sources":["../../../src/commands/plugins/load-custom-check-plugin.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,0CAAuC;AACvC,+BAA+B;AAC/B,6BAAoC;AAMpC,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAO3C,6EAA6E;AAC7E,gFAAgF;AAChF,4EAA4E;AAC5E,4EAA4E;AAC5E,oCAAoC;AACpC,MAAM,kBAAkB,GAAG,IAAI,QAAQ,CACrC,WAAW,EACX,2BAA2B,CACV,CAAC;AAOpB;;;;;GAKG;AACI,MAAM,qBAAqB,GAAG,KAAK,EACxC,UAAkB;AAClB,2EAA2E;AAC3E,2EAA2E;AAC3E,wCAAwC;AACxC,eAA+B,kBAAkB,EACf,EAAE;IACpC,MAAM,SAAS,GAAG,IAAA,cAAO,EAAC,UAAU,CAAC,CAAC;IACtC,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,SAAS,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAG,MAAM,cAAc,CAAC,SAAS,EAAE,QAAQ,EAAE,YAAY,CAAC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