@alwaysmeticulous/cli 2.279.0 → 2.280.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/dist/commands/ci/run-local.command.d.ts +1 -0
- package/dist/commands/ci/run-local.command.js +9 -3
- package/dist/commands/ci/run-local.command.js.map +1 -1
- package/dist/commands/project/index.js +4 -3
- package/dist/commands/project/index.js.map +1 -1
- package/dist/commands/project/upload-source.command.d.ts +31 -0
- package/dist/commands/project/upload-source.command.js +109 -0
- package/dist/commands/project/upload-source.command.js.map +1 -0
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/constants.js +4 -3
- package/dist/utils/constants.js.map +1 -1
- package/package.json +33 -33
|
@@ -20,6 +20,7 @@ interface Options extends ScreenshotDiffOptions, Omit<ReplayExecutionOptions, "m
|
|
|
20
20
|
enableCssCoverage?: boolean;
|
|
21
21
|
enablePerScreenshotCoverage?: boolean;
|
|
22
22
|
dryRun?: boolean;
|
|
23
|
+
onlyReplaySessionsInTestsFile: boolean;
|
|
23
24
|
}
|
|
24
25
|
export declare const ciRunLocalCommand: CommandModule<unknown, Options>;
|
|
25
26
|
export {};
|
|
@@ -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]="
|
|
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]="9973c527-febb-51cf-bd36-19a722785f0b")}catch(e){}}();
|
|
3
3
|
|
|
4
4
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
5
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -13,7 +13,7 @@ const common_options_1 = require("../../command-utils/common-options");
|
|
|
13
13
|
const sentry_utils_1 = require("../../command-utils/sentry.utils");
|
|
14
14
|
const out_of_date_client_error_1 = require("../../utils/out-of-date-client-error");
|
|
15
15
|
const NO_PARALLELIZE_FLAG = "--no-parallelize";
|
|
16
|
-
const handler = async ({ apiToken, commitSha: commitSha_, baseCommitSha, appUrl, headless, devTools, bypassCSP, diffThreshold, diffPixelThreshold, shiftTime, networkStubbing, githubSummary, noParallelize, parallelTasks: parallelTasks_, maxRetriesOnFailure, rerunTestsNTimes, testsFile, disableRemoteFonts, noSandbox, skipPauses, moveBeforeMouseEvent, maxDurationMs, maxEventCount, storyboard, essentialFeaturesOnly, logPossibleNonDeterminism, baseTestRunId, sessionIdForApplicationStorage, enableCssCoverage, enablePerScreenshotCoverage, dryRun, }) => {
|
|
16
|
+
const handler = async ({ apiToken, commitSha: commitSha_, baseCommitSha, appUrl, headless, devTools, bypassCSP, diffThreshold, diffPixelThreshold, shiftTime, networkStubbing, githubSummary, noParallelize, parallelTasks: parallelTasks_, maxRetriesOnFailure, rerunTestsNTimes, testsFile, disableRemoteFonts, noSandbox, skipPauses, moveBeforeMouseEvent, maxDurationMs, maxEventCount, storyboard, essentialFeaturesOnly, logPossibleNonDeterminism, baseTestRunId, sessionIdForApplicationStorage, enableCssCoverage, enablePerScreenshotCoverage, dryRun, onlyReplaySessionsInTestsFile, }) => {
|
|
17
17
|
const executionOptions = {
|
|
18
18
|
headless,
|
|
19
19
|
devTools,
|
|
@@ -58,6 +58,7 @@ const handler = async ({ apiToken, commitSha: commitSha_, baseCommitSha, appUrl,
|
|
|
58
58
|
try {
|
|
59
59
|
const { testRun } = await (0, replay_orchestrator_launcher_1.executeTestRun)({
|
|
60
60
|
testsFile: testsFile ?? null,
|
|
61
|
+
onlyReplaySessionsInTestsFile,
|
|
61
62
|
executionOptions,
|
|
62
63
|
screenshottingOptions,
|
|
63
64
|
apiToken: apiToken ?? null,
|
|
@@ -134,6 +135,11 @@ exports.ciRunLocalCommand = {
|
|
|
134
135
|
string: true,
|
|
135
136
|
description: "The path to the meticulous.json file containing the list of tests you want to run. If not set a search will be performed to find a meticulous.json file in the current directory or the nearest parent directory.",
|
|
136
137
|
},
|
|
138
|
+
onlyReplaySessionsInTestsFile: {
|
|
139
|
+
boolean: true,
|
|
140
|
+
description: "Only run sessions listed in testsFile / meticulous.json. By default, UI-selected and automatically selected sessions (and sessions from the base test run) are also executed.",
|
|
141
|
+
default: false,
|
|
142
|
+
},
|
|
137
143
|
baseTestRunId: {
|
|
138
144
|
string: true,
|
|
139
145
|
description: "The id of a test run to compare visual snapshots against.",
|
|
@@ -145,4 +151,4 @@ exports.ciRunLocalCommand = {
|
|
|
145
151
|
handler: (0, sentry_utils_1.wrapHandler)(handler),
|
|
146
152
|
};
|
|
147
153
|
//# sourceMappingURL=run-local.command.js.map
|
|
148
|
-
//# debugId=
|
|
154
|
+
//# debugId=9973c527-febb-51cf-bd36-19a722785f0b
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-local.command.js","sources":["../../../src/commands/ci/run-local.command.ts"],"sourceRoot":"","names":[],"mappings":";;;;;;;;AAKA,qDAAoE;AACpE,iGAAgF;AAEhF,kDAA0B;AAE1B,uEAK4C;AAC5C,mEAA+D;AAC/D,mFAG8C;
|
|
1
|
+
{"version":3,"file":"run-local.command.js","sources":["../../../src/commands/ci/run-local.command.ts"],"sourceRoot":"","names":[],"mappings":";;;;;;;;AAKA,qDAAoE;AACpE,iGAAgF;AAEhF,kDAA0B;AAE1B,uEAK4C;AAC5C,mEAA+D;AAC/D,mFAG8C;AA0B9C,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAE/C,MAAM,OAAO,GAAG,KAAK,EAAE,EACrB,QAAQ,EACR,SAAS,EAAE,UAAU,EACrB,aAAa,EACb,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,aAAa,EACb,kBAAkB,E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EACT,mNAAmN;SACtN;QACD,6BAA6B,EAAE;YAC7B,OAAO,EAAE,IAAI;YACb,WAAW,EACT,+KAA+K;YACjL,OAAO,EAAE,KAAK;SACf;QACD,aAAa,EAAE;YACb,MAAM,EAAE,IAAI;YACZ,WAAW,EAAE,2DAA2D;SACzE;QACD,oBAAoB,EAAE,wBAAO,CAAC,oBAAoB;QAClD,GAAG,sCAAqB;QACxB,GAAG,wCAAuB;KAC3B;IACD,OAAO,EAAE,IAAA,0BAAW,EAAC,OAAO,CAAC;CAC9B,CAAC","debugId":"9973c527-febb-51cf-bd36-19a722785f0b"}
|
|
@@ -1,16 +1,17 @@
|
|
|
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]="
|
|
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]="55f684ba-706c-5f96-aff2-b198119381aa")}catch(e){}}();
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.projectCommand = void 0;
|
|
6
6
|
const show_command_1 = require("./show.command");
|
|
7
|
+
const upload_source_command_1 = require("./upload-source.command");
|
|
7
8
|
exports.projectCommand = {
|
|
8
9
|
command: "project",
|
|
9
10
|
describe: "Project commands",
|
|
10
|
-
builder: (yargs) => yargs.command(show_command_1.showCommand).demandCommand().help(),
|
|
11
|
+
builder: (yargs) => yargs.command(show_command_1.showCommand).command(upload_source_command_1.uploadSourceCommand).demandCommand().help(),
|
|
11
12
|
handler: () => {
|
|
12
13
|
// subcommand handles this
|
|
13
14
|
},
|
|
14
15
|
};
|
|
15
16
|
//# sourceMappingURL=index.js.map
|
|
16
|
-
//# debugId=
|
|
17
|
+
//# debugId=55f684ba-706c-5f96-aff2-b198119381aa
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/commands/project/index.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AACA,iDAA6C;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/commands/project/index.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AACA,iDAA6C;AAC7C,mEAA8D;AAEjD,QAAA,cAAc,GAAkB;IAC3C,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,kBAAkB;IAC5B,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CACjB,KAAK,CAAC,OAAO,CAAC,0BAAW,CAAC,CAAC,OAAO,CAAC,2CAAmB,CAAC,CAAC,aAAa,EAAE,CAAC,IAAI,EAAE;IAChF,OAAO,EAAE,GAAG,EAAE;QACZ,0BAA0B;IAC5B,CAAC;CACF,CAAC","debugId":"55f684ba-706c-5f96-aff2-b198119381aa"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { CommandModule } from "yargs";
|
|
2
|
+
interface Options {
|
|
3
|
+
apiToken?: string | null | undefined;
|
|
4
|
+
commitSha: string;
|
|
5
|
+
sourceDir: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Packages `--sourceDir` as a `source.tar.gz` archive and uploads it to
|
|
9
|
+
* Meticulous so it can be used in place of `git clone` for projects that
|
|
10
|
+
* have source-code uploads enabled.
|
|
11
|
+
*
|
|
12
|
+
* The contents of the archive are exactly the contents of `--sourceDir` —
|
|
13
|
+
* we do not parse `.gitignore` or apply any filtering, so it is the
|
|
14
|
+
* caller's responsibility to point at a directory that contains only what
|
|
15
|
+
* Meticulous needs (i.e. exclude `.git/`, `node_modules/`, `dist/`, build
|
|
16
|
+
* artefacts, secrets, etc.). The recommended pattern is to invoke this
|
|
17
|
+
* after a fresh `git checkout` into a clean directory, or after a
|
|
18
|
+
* `git archive`/`rsync --exclude` step in CI.
|
|
19
|
+
*
|
|
20
|
+
* Usage (typically from the customer's CI on every commit):
|
|
21
|
+
*
|
|
22
|
+
* meticulous project upload-source \
|
|
23
|
+
* --commitSha "$(git rev-parse HEAD)" \
|
|
24
|
+
* --sourceDir ./checkout
|
|
25
|
+
*
|
|
26
|
+
* Requires a project API token (env `METICULOUS_API_TOKEN` or
|
|
27
|
+
* `--apiToken`). Calls from projects that don't have source-code uploads
|
|
28
|
+
* enabled are rejected with a 403.
|
|
29
|
+
*/
|
|
30
|
+
export declare const uploadSourceCommand: CommandModule<unknown, Options>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,109 @@
|
|
|
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]="80bf9498-6e60-5fd3-8e7a-5798f20c3eed")}catch(e){}}();
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.uploadSourceCommand = void 0;
|
|
6
|
+
const fs_1 = require("fs");
|
|
7
|
+
const promises_1 = require("fs/promises");
|
|
8
|
+
const os_1 = require("os");
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
const promises_2 = require("stream/promises");
|
|
11
|
+
const client_1 = require("@alwaysmeticulous/client");
|
|
12
|
+
const common_1 = require("@alwaysmeticulous/common");
|
|
13
|
+
const tar_1 = require("tar");
|
|
14
|
+
const sentry_utils_1 = require("../../command-utils/sentry.utils");
|
|
15
|
+
/**
|
|
16
|
+
* Packages `--sourceDir` as a `source.tar.gz` archive and uploads it to
|
|
17
|
+
* Meticulous so it can be used in place of `git clone` for projects that
|
|
18
|
+
* have source-code uploads enabled.
|
|
19
|
+
*
|
|
20
|
+
* The contents of the archive are exactly the contents of `--sourceDir` —
|
|
21
|
+
* we do not parse `.gitignore` or apply any filtering, so it is the
|
|
22
|
+
* caller's responsibility to point at a directory that contains only what
|
|
23
|
+
* Meticulous needs (i.e. exclude `.git/`, `node_modules/`, `dist/`, build
|
|
24
|
+
* artefacts, secrets, etc.). The recommended pattern is to invoke this
|
|
25
|
+
* after a fresh `git checkout` into a clean directory, or after a
|
|
26
|
+
* `git archive`/`rsync --exclude` step in CI.
|
|
27
|
+
*
|
|
28
|
+
* Usage (typically from the customer's CI on every commit):
|
|
29
|
+
*
|
|
30
|
+
* meticulous project upload-source \
|
|
31
|
+
* --commitSha "$(git rev-parse HEAD)" \
|
|
32
|
+
* --sourceDir ./checkout
|
|
33
|
+
*
|
|
34
|
+
* Requires a project API token (env `METICULOUS_API_TOKEN` or
|
|
35
|
+
* `--apiToken`). Calls from projects that don't have source-code uploads
|
|
36
|
+
* enabled are rejected with a 403.
|
|
37
|
+
*/
|
|
38
|
+
exports.uploadSourceCommand = {
|
|
39
|
+
command: "upload-source",
|
|
40
|
+
describe: "Upload a source-code archive for a given commit to Meticulous",
|
|
41
|
+
builder: {
|
|
42
|
+
apiToken: {
|
|
43
|
+
string: true,
|
|
44
|
+
description: "Meticulous project API token. Defaults to METICULOUS_API_TOKEN.",
|
|
45
|
+
},
|
|
46
|
+
commitSha: {
|
|
47
|
+
string: true,
|
|
48
|
+
demandOption: true,
|
|
49
|
+
description: "Commit SHA the uploaded archive corresponds to",
|
|
50
|
+
},
|
|
51
|
+
sourceDir: {
|
|
52
|
+
string: true,
|
|
53
|
+
demandOption: true,
|
|
54
|
+
description: "Directory to package into source.tar.gz. The directory's contents " +
|
|
55
|
+
"are uploaded verbatim — exclude `.git`, `node_modules`, build " +
|
|
56
|
+
"artefacts and any other paths you don't want sent to Meticulous " +
|
|
57
|
+
"before invoking this command.",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
handler: (0, sentry_utils_1.wrapHandler)(async ({ apiToken, commitSha, sourceDir }) => {
|
|
61
|
+
const logger = (0, common_1.initLogger)();
|
|
62
|
+
const client = (0, client_1.createClient)({ apiToken });
|
|
63
|
+
const tmpDir = await (0, promises_1.mkdtemp)((0, path_1.join)((0, os_1.tmpdir)(), "meticulous-source-"));
|
|
64
|
+
const archivePath = (0, path_1.join)(tmpDir, "source.tar.gz");
|
|
65
|
+
try {
|
|
66
|
+
logger.info(`Packaging ${sourceDir} into ${archivePath}...`);
|
|
67
|
+
// We package `sourceDir` verbatim: no `.gitignore` parsing, no
|
|
68
|
+
// filtering. The caller is responsible for pointing at a directory
|
|
69
|
+
// that contains only what Meticulous needs — see the JSDoc above.
|
|
70
|
+
// `portable` produces reproducible archives across platforms; `gzip`
|
|
71
|
+
// gives us the `.gz` wire format the cloud worker decompresses with
|
|
72
|
+
// `streamDownloadAndExtractTarGz`.
|
|
73
|
+
await (0, promises_2.pipeline)((0, tar_1.create)({
|
|
74
|
+
cwd: sourceDir,
|
|
75
|
+
gzip: true,
|
|
76
|
+
portable: true,
|
|
77
|
+
}, ["."]), (0, fs_1.createWriteStream)(archivePath));
|
|
78
|
+
const { size } = (0, fs_1.statSync)(archivePath);
|
|
79
|
+
logger.info(`Archive ready: ${(size / (1024 * 1024)).toFixed(2)} MiB. Requesting upload URL...`);
|
|
80
|
+
const { uploadUrl } = await (0, client_1.requestSourceCodeUploadUrl)({
|
|
81
|
+
client,
|
|
82
|
+
commitSha,
|
|
83
|
+
size,
|
|
84
|
+
});
|
|
85
|
+
logger.info(`Uploading source archive for commit ${commitSha}...`);
|
|
86
|
+
await (0, client_1.retryTransientUploadErrors)(() => (0, client_1.putFileToSignedUrl)({
|
|
87
|
+
filePath: archivePath,
|
|
88
|
+
signedUrl: uploadUrl,
|
|
89
|
+
size,
|
|
90
|
+
contentType: "application/gzip",
|
|
91
|
+
}), {
|
|
92
|
+
onRetry: (attempt, error) => {
|
|
93
|
+
const reason = error instanceof client_1.UploadError
|
|
94
|
+
? `HTTP ${error.statusCode}`
|
|
95
|
+
: error instanceof Error
|
|
96
|
+
? error.message
|
|
97
|
+
: String(error);
|
|
98
|
+
logger.warn(`Transient upload error on attempt ${attempt} (${reason}); will retry...`);
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
logger.info(`Successfully uploaded source archive for commit ${commitSha}.`);
|
|
102
|
+
}
|
|
103
|
+
finally {
|
|
104
|
+
await (0, promises_1.rm)(tmpDir, { recursive: true, force: true });
|
|
105
|
+
}
|
|
106
|
+
}),
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=upload-source.command.js.map
|
|
109
|
+
//# debugId=80bf9498-6e60-5fd3-8e7a-5798f20c3eed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-source.command.js","sources":["../../../src/commands/project/upload-source.command.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,2BAAiD;AACjD,0CAA0C;AAC1C,2BAA4B;AAC5B,+BAA4B;AAC5B,8CAA2C;AAC3C,qDAMkC;AAClC,qDAAsD;AACtD,6BAA0C;AAE1C,mEAA+D;AAQ/D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACU,QAAA,mBAAmB,GAAoC;IAClE,OAAO,EAAE,eAAe;IACxB,QAAQ,EAAE,+DAA+D;IACzE,OAAO,EAAE;QACP,QAAQ,EAAE;YACR,MAAM,EAAE,IAAI;YACZ,WAAW,EACT,iEAAiE;SACpE;QACD,SAAS,EAAE;YACT,MAAM,EAAE,IAAI;YACZ,YAAY,EAAE,IAAI;YAClB,WAAW,EAAE,gDAAgD;SAC9D;QACD,SAAS,EAAE;YACT,MAAM,EAAE,IAAI;YACZ,YAAY,EAAE,IAAI;YAClB,WAAW,EACT,oEAAoE;gBACpE,gEAAgE;gBAChE,kEAAkE;gBAClE,+BAA+B;SAClC;KACF;IACD,OAAO,EAAE,IAAA,0BAAW,EAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE;QAChE,MAAM,MAAM,GAAG,IAA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AChC,CAAC,EACJ;gBACE,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;oBAC1B,MAAM,MAAM,GACV,KAAK,YAAY,oBAAW;wBAC1B,CAAC,CAAC,QAAQ,KAAK,CAAC,UAAU,EAAE;wBAC5B,CAAC,CAAC,KAAK,YAAY,KAAK;4BACtB,CAAC,CAAC,KAAK,CAAC,OAAO;4BACf,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;oBACtB,MAAM,CAAC,IAAI,CACT,qCAAqC,OAAO,KAAK,MAAM,kBAAkB,CAC1E,CAAC;gBACJ,CAAC;aACF,CACF,CAAC;YAEF,MAAM,CAAC,IAAI,CACT,mDAAmD,SAAS,GAAG,CAChE,CAAC;QACJ,CAAC;gBAAS,CAAC;YACT,MAAM,IAAA,aAAE,EAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACrD,CAAC;IACH,CAAC,CAAC;CACH,CAAC","debugId":"80bf9498-6e60-5fd3-8e7a-5798f20c3eed"}
|
package/dist/utils/constants.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
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]="
|
|
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]="797d4326-b2e4-560d-8e44-4dc471c92cac")}catch(e){}}();
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.RECORDING_SNIPPET_PATH = void 0;
|
|
5
|
+
exports.BACKEND_RECORDING_SNIPPET_PATH = exports.RECORDING_SNIPPET_PATH = void 0;
|
|
6
6
|
exports.RECORDING_SNIPPET_PATH = "v1/meticulous.js";
|
|
7
|
+
exports.BACKEND_RECORDING_SNIPPET_PATH = "backend-record-js/v1/manual-init.bundle.js";
|
|
7
8
|
//# sourceMappingURL=constants.js.map
|
|
8
|
-
//# debugId=
|
|
9
|
+
//# debugId=797d4326-b2e4-560d-8e44-4dc471c92cac
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../src/utils/constants.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAa,QAAA,sBAAsB,GAAG,kBAAkB,CAAC","debugId":"
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../src/utils/constants.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAa,QAAA,sBAAsB,GAAG,kBAAkB,CAAC;AAC5C,QAAA,8BAA8B,GACzC,4CAA4C,CAAC","debugId":"797d4326-b2e4-560d-8e44-4dc471c92cac"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwaysmeticulous/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.280.1",
|
|
4
4
|
"description": "The Meticulous CLI",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,35 +12,7 @@
|
|
|
12
12
|
"bin": {
|
|
13
13
|
"meticulous": "bin/meticulous"
|
|
14
14
|
},
|
|
15
|
-
"scripts": {
|
|
16
|
-
"clean": "rimraf dist tsconfig.tsbuildinfo",
|
|
17
|
-
"build": "tsc --build tsconfig.json",
|
|
18
|
-
"dev": "tsc --build tsconfig.json --watch",
|
|
19
|
-
"format": "prettier --write src",
|
|
20
|
-
"lint": "eslint \"src/**/*.{js,ts,tsx}\" --cache",
|
|
21
|
-
"lint:commit": "eslint --cache $(git diff --relative --name-only --diff-filter=ACMRTUXB master | grep -E \"(.js$|.ts$|.tsx$)\")",
|
|
22
|
-
"lint:fix": "eslint \"src/**/*.{js,ts,tsx}\" --cache --fix",
|
|
23
|
-
"cli": "node dist/main.js",
|
|
24
|
-
"cli:debug": "echo '\n\nVisit chrome://inspect in Chrome and attach the debugger\n\n' && METICULOUS_NO_TIMEOUT=true METICULOUS_REPLAY_NODE_DEBUGGER_ENABLED=true node --inspect-brk dist/main.js",
|
|
25
|
-
"cli:dev": "ts-node src/main.ts",
|
|
26
|
-
"cli:dev-localhost": "METICULOUS_API_URL=http://localhost:3000/api/ ts-node src/main.ts",
|
|
27
|
-
"cli:dev-staging": "METICULOUS_API_URL=https://staging-backend.alb.meticulous.ai/api/ ts-node src/main.ts",
|
|
28
|
-
"test": "vitest run --passWithNoTests",
|
|
29
|
-
"depcheck": "depcheck --ignore-patterns=dist"
|
|
30
|
-
},
|
|
31
15
|
"dependencies": {
|
|
32
|
-
"@alwaysmeticulous/api": "2.276.2",
|
|
33
|
-
"@alwaysmeticulous/client": "2.277.0",
|
|
34
|
-
"@alwaysmeticulous/common": "2.277.0",
|
|
35
|
-
"@alwaysmeticulous/debug-workspace": "2.278.0",
|
|
36
|
-
"@alwaysmeticulous/downloading-helpers": "2.277.0",
|
|
37
|
-
"@alwaysmeticulous/record": "2.277.0",
|
|
38
|
-
"@alwaysmeticulous/remote-replay-launcher": "2.277.0",
|
|
39
|
-
"@alwaysmeticulous/replay-debugger-ui": "2.277.0",
|
|
40
|
-
"@alwaysmeticulous/replay-orchestrator-launcher": "2.277.0",
|
|
41
|
-
"@alwaysmeticulous/sdk-bundles-api": "2.277.0",
|
|
42
|
-
"@alwaysmeticulous/sentry": "2.277.0",
|
|
43
|
-
"@alwaysmeticulous/tunnels-client": "2.277.0",
|
|
44
16
|
"@sentry/node": "^10.3.0",
|
|
45
17
|
"chalk": "^4.1.2",
|
|
46
18
|
"ci-info": "^4.0.0",
|
|
@@ -49,14 +21,27 @@
|
|
|
49
21
|
"ora": "^5.4.1",
|
|
50
22
|
"parse-diff": "^0.11.1",
|
|
51
23
|
"puppeteer-core": "24.14.0",
|
|
52
|
-
"
|
|
24
|
+
"tar": "^7.5.8",
|
|
25
|
+
"yargs": "^17.5.1",
|
|
26
|
+
"@alwaysmeticulous/api": "2.280.0",
|
|
27
|
+
"@alwaysmeticulous/common": "2.280.0",
|
|
28
|
+
"@alwaysmeticulous/debug-workspace": "2.280.0",
|
|
29
|
+
"@alwaysmeticulous/downloading-helpers": "2.280.0",
|
|
30
|
+
"@alwaysmeticulous/client": "2.280.0",
|
|
31
|
+
"@alwaysmeticulous/remote-replay-launcher": "2.280.0",
|
|
32
|
+
"@alwaysmeticulous/replay-debugger-ui": "2.280.0",
|
|
33
|
+
"@alwaysmeticulous/sdk-bundles-api": "2.280.0",
|
|
34
|
+
"@alwaysmeticulous/replay-orchestrator-launcher": "2.280.0",
|
|
35
|
+
"@alwaysmeticulous/sentry": "2.280.0",
|
|
36
|
+
"@alwaysmeticulous/tunnels-client": "2.280.0",
|
|
37
|
+
"@alwaysmeticulous/record": "2.280.0"
|
|
53
38
|
},
|
|
54
39
|
"devDependencies": {
|
|
55
40
|
"@types/cli-progress": "^3.11.5",
|
|
56
41
|
"@types/inquirer": "^8.2.12",
|
|
57
42
|
"@types/yargs": "^17.0.10",
|
|
58
43
|
"loglevel": "^1.8.0",
|
|
59
|
-
"vitest": "
|
|
44
|
+
"vitest": "^4.1.4"
|
|
60
45
|
},
|
|
61
46
|
"author": {
|
|
62
47
|
"name": "The Meticulous Team",
|
|
@@ -75,5 +60,20 @@
|
|
|
75
60
|
"bugs": {
|
|
76
61
|
"url": "https://github.com/alwaysmeticulous/meticulous-sdk/issues"
|
|
77
62
|
},
|
|
78
|
-
"
|
|
79
|
-
|
|
63
|
+
"scripts": {
|
|
64
|
+
"clean": "rimraf dist tsconfig.tsbuildinfo",
|
|
65
|
+
"build": "tsc --build tsconfig.json",
|
|
66
|
+
"dev": "tsc --build tsconfig.json --watch",
|
|
67
|
+
"format": "prettier --write src",
|
|
68
|
+
"lint": "eslint \"src/**/*.{js,ts,tsx}\" --cache",
|
|
69
|
+
"lint:commit": "eslint --cache $(git diff --relative --name-only --diff-filter=ACMRTUXB master | grep -E \"(.js$|.ts$|.tsx$)\")",
|
|
70
|
+
"lint:fix": "eslint \"src/**/*.{js,ts,tsx}\" --cache --fix",
|
|
71
|
+
"cli": "node dist/main.js",
|
|
72
|
+
"cli:debug": "echo '\n\nVisit chrome://inspect in Chrome and attach the debugger\n\n' && METICULOUS_NO_TIMEOUT=true METICULOUS_REPLAY_NODE_DEBUGGER_ENABLED=true node --inspect-brk dist/main.js",
|
|
73
|
+
"cli:dev": "ts-node src/main.ts",
|
|
74
|
+
"cli:dev-localhost": "METICULOUS_API_URL=http://localhost:3000/api/ ts-node src/main.ts",
|
|
75
|
+
"cli:dev-staging": "METICULOUS_API_URL=https://staging-backend.alb.meticulous.ai/api/ ts-node src/main.ts",
|
|
76
|
+
"test": "vitest run --passWithNoTests",
|
|
77
|
+
"depcheck": "depcheck --ignore-patterns=dist"
|
|
78
|
+
}
|
|
79
|
+
}
|