happo 6.0.5 → 6.0.7
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/cli/{cancelJob-FZN3FED2.js → cancelJob-JU2MFYL2.js} +4 -4
- package/dist/cli/{chunk-GS5VDGV6.js → chunk-67E4ZKZT.js} +2 -2
- package/dist/cli/{chunk-O5GJGAW5.js → chunk-P6FFKL3Q.js} +8 -8
- package/dist/cli/chunk-P6FFKL3Q.js.map +7 -0
- package/dist/cli/{chunk-UVYFRXQW.js → chunk-RJHSQJGS.js} +2 -2
- package/dist/cli/{chunk-L2YFFA77.js → chunk-ZAMXPRVQ.js} +2 -2
- package/dist/cli/createAsyncComparison-WLHVVZXU.js +10 -0
- package/dist/cli/{createAsyncReport-ZJG3YRUK.js → createAsyncReport-SR43S4B4.js} +4 -4
- package/dist/cli/main.d.ts +2 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/{index.js → main.js} +14 -18
- package/dist/cli/main.js.map +7 -0
- package/dist/cli/package-JPC4TQC4.js +7 -0
- package/dist/cli/{prepareSnapRequests-7DDDCYNL.js → prepareSnapRequests-6XYMUHER.js} +4 -4
- package/dist/cli/{startJob-JUDYTDEM.js → startJob-H4JOASFE.js} +4 -4
- package/dist/cli/{wrapper-ZMK7MDL2.js → wrapper-KEZ4X2R6.js} +5 -5
- package/dist/cypress/task.js +7 -7
- package/dist/cypress/task.js.map +1 -1
- package/dist/isomorphic/types.d.ts +1 -1
- package/dist/isomorphic/types.d.ts.map +1 -1
- package/dist/playwright/index.js +7 -7
- package/dist/playwright/index.js.map +1 -1
- package/dist/storybook/browser/register.d.ts.map +1 -1
- package/dist/storybook/browser/register.js +6 -5
- package/dist/storybook/browser/register.js.map +2 -2
- package/package.json +7 -7
- package/dist/cli/chunk-O5GJGAW5.js.map +0 -7
- package/dist/cli/createAsyncComparison-5AUI4A72.js +0 -10
- package/dist/cli/index.js.map +0 -7
- package/dist/cli/package-X4FVUDQZ.js +0 -7
- /package/dist/cli/{cancelJob-FZN3FED2.js.map → cancelJob-JU2MFYL2.js.map} +0 -0
- /package/dist/cli/{chunk-GS5VDGV6.js.map → chunk-67E4ZKZT.js.map} +0 -0
- /package/dist/cli/{chunk-UVYFRXQW.js.map → chunk-RJHSQJGS.js.map} +0 -0
- /package/dist/cli/{chunk-L2YFFA77.js.map → chunk-ZAMXPRVQ.js.map} +0 -0
- /package/dist/cli/{createAsyncComparison-5AUI4A72.js.map → createAsyncComparison-WLHVVZXU.js.map} +0 -0
- /package/dist/cli/{createAsyncReport-ZJG3YRUK.js.map → createAsyncReport-SR43S4B4.js.map} +0 -0
- /package/dist/cli/{package-X4FVUDQZ.js.map → package-JPC4TQC4.js.map} +0 -0
- /package/dist/cli/{prepareSnapRequests-7DDDCYNL.js.map → prepareSnapRequests-6XYMUHER.js.map} +0 -0
- /package/dist/cli/{startJob-JUDYTDEM.js.map → startJob-H4JOASFE.js.map} +0 -0
- /package/dist/cli/{wrapper-ZMK7MDL2.js.map → wrapper-KEZ4X2R6.js.map} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
makeHappoAPIRequest
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-ZAMXPRVQ.js";
|
|
4
|
+
import "./chunk-67E4ZKZT.js";
|
|
5
|
+
import "./chunk-P6FFKL3Q.js";
|
|
6
6
|
|
|
7
7
|
// src/network/cancelJob.ts
|
|
8
8
|
async function cancelJob(status, config, { beforeSha, afterSha, link, message }, logger) {
|
|
@@ -25,4 +25,4 @@ async function cancelJob(status, config, { beforeSha, afterSha, link, message },
|
|
|
25
25
|
export {
|
|
26
26
|
cancelJob as default
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=cancelJob-
|
|
28
|
+
//# sourceMappingURL=cancelJob-JU2MFYL2.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
package_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-P6FFKL3Q.js";
|
|
4
4
|
|
|
5
5
|
// src/network/fetchWithRetry.ts
|
|
6
6
|
import asyncRetry from "async-retry";
|
|
@@ -93,4 +93,4 @@ async function fetchWithRetry(url, {
|
|
|
93
93
|
export {
|
|
94
94
|
fetchWithRetry
|
|
95
95
|
};
|
|
96
|
-
//# sourceMappingURL=chunk-
|
|
96
|
+
//# sourceMappingURL=chunk-67E4ZKZT.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var package_default = {
|
|
3
3
|
name: "happo",
|
|
4
|
-
version: "6.0.
|
|
4
|
+
version: "6.0.7",
|
|
5
5
|
description: "Catch unexpected visual and accessibility changes and UI bugs",
|
|
6
6
|
license: "MIT",
|
|
7
7
|
repository: {
|
|
@@ -11,7 +11,7 @@ var package_default = {
|
|
|
11
11
|
bugs: "https://github.com/happo/happo/issues",
|
|
12
12
|
homepage: "https://happo.io",
|
|
13
13
|
bin: {
|
|
14
|
-
happo: "dist/cli/
|
|
14
|
+
happo: "dist/cli/main.js"
|
|
15
15
|
},
|
|
16
16
|
type: "module",
|
|
17
17
|
main: "./dist/config/index.js",
|
|
@@ -69,12 +69,12 @@ var package_default = {
|
|
|
69
69
|
prepublishOnly: "pnpm clean && pnpm build",
|
|
70
70
|
"storybook:dev": "storybook dev --config-dir src/storybook/__tests__/storybook-app -p ${PORT:-6007}",
|
|
71
71
|
test: "node --env-file-if-exists=.env.local ./scripts/test.ts",
|
|
72
|
-
"test:custom": "pnpm build:dist && pnpm build:custom && node --env-file-if-exists=.env.local dist/cli/
|
|
73
|
-
"test:cypress": "pnpm build:dist && node --env-file-if-exists=.env.local dist/cli/
|
|
72
|
+
"test:custom": "pnpm build:dist && pnpm build:custom && node --env-file-if-exists=.env.local dist/cli/main.js -c ./happoconfigs/happo.custom.config.ts",
|
|
73
|
+
"test:cypress": "pnpm build:dist && node --env-file-if-exists=.env.local dist/cli/main.js -c ./happoconfigs/happo.cypress.config.ts e2e -- cypress run -C src/cypress/__cypress__/cypress.config.ts",
|
|
74
74
|
"test:cypress:open": "cypress open -C src/cypress/__cypress__/cypress.config.ts",
|
|
75
|
-
"test:playwright": "pnpm build:dist && node --env-file-if-exists=.env.local dist/cli/
|
|
76
|
-
"test:storybook": "pnpm build:dist && node --env-file-if-exists=.env.local dist/cli/
|
|
77
|
-
"test:pages": "pnpm build:dist && node --env-file-if-exists=.env.local dist/cli/
|
|
75
|
+
"test:playwright": "pnpm build:dist && node --env-file-if-exists=.env.local dist/cli/main.js -c ./happoconfigs/happo.playwright.config.ts e2e -- playwright test",
|
|
76
|
+
"test:storybook": "pnpm build:dist && node --env-file-if-exists=.env.local dist/cli/main.js -c ./happoconfigs/happo.storybook.config.ts",
|
|
77
|
+
"test:pages": "pnpm build:dist && node --env-file-if-exists=.env.local dist/cli/main.js -c ./happoconfigs/happo.pages.config.ts",
|
|
78
78
|
tsc: "tsc --build tsconfig.json"
|
|
79
79
|
},
|
|
80
80
|
browserslist: {
|
|
@@ -184,4 +184,4 @@ var package_default = {
|
|
|
184
184
|
export {
|
|
185
185
|
package_default
|
|
186
186
|
};
|
|
187
|
-
//# sourceMappingURL=chunk-
|
|
187
|
+
//# sourceMappingURL=chunk-P6FFKL3Q.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../package.json"],
|
|
4
|
+
"sourcesContent": ["{\n \"name\": \"happo\",\n \"version\": \"6.0.7\",\n \"description\": \"Catch unexpected visual and accessibility changes and UI bugs\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/happo/happo.git\"\n },\n \"bugs\": \"https://github.com/happo/happo/issues\",\n \"homepage\": \"https://happo.io\",\n \"bin\": {\n \"happo\": \"dist/cli/main.js\"\n },\n \"type\": \"module\",\n \"main\": \"./dist/config/index.js\",\n \"types\": \"./dist/config/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/config/index.d.ts\",\n \"default\": \"./dist/config/index.js\"\n },\n \"./cypress\": {\n \"types\": \"./dist/cypress/index.d.ts\",\n \"default\": \"./dist/cypress/index.js\"\n },\n \"./cypress/task\": {\n \"types\": \"./dist/cypress/task.d.ts\",\n \"default\": \"./dist/cypress/task.js\"\n },\n \"./playwright\": {\n \"types\": \"./dist/playwright/index.d.ts\",\n \"default\": \"./dist/playwright/index.js\"\n },\n \"./custom\": {\n \"types\": \"./dist/custom/index.d.ts\",\n \"default\": \"./dist/custom/index.js\"\n },\n \"./storybook/addon\": {\n \"types\": \"./dist/storybook/browser/addon.d.ts\",\n \"default\": \"./dist/storybook/browser/addon.js\"\n },\n \"./storybook/decorator\": {\n \"types\": \"./dist/storybook/browser/decorator.d.ts\",\n \"default\": \"./dist/storybook/browser/decorator.js\"\n },\n \"./storybook/preset\": {\n \"types\": \"./dist/storybook/preset.d.ts\",\n \"default\": \"./dist/storybook/preset.js\"\n },\n \"./storybook/register\": {\n \"types\": \"./dist/storybook/browser/register.d.ts\",\n \"default\": \"./dist/storybook/browser/register.js\"\n }\n },\n \"files\": [\n \"dist\"\n ],\n \"scripts\": {\n \"all\": \"node ./scripts/allchecks.ts\",\n \"build\": \"pnpm build:types && pnpm build:dist\",\n \"build:custom\": \"esbuild src/custom/__happo__/index.ts --bundle --format=iife --global-name=happoCustom --outfile=tmp/happo-custom/bundle.js --platform=browser --target=esnext\",\n \"build:dist\": \"./scripts/build.ts\",\n \"build:types\": \"pnpm tsc --pretty\",\n \"build:watch\": \"tsc --build --watch\",\n \"clean\": \"rm -rf dist tmp/tsc tmp/happo-custom\",\n \"lint\": \"eslint .\",\n \"prepublishOnly\": \"pnpm clean && pnpm build\",\n \"storybook:dev\": \"storybook dev --config-dir src/storybook/__tests__/storybook-app -p ${PORT:-6007}\",\n \"test\": \"node --env-file-if-exists=.env.local ./scripts/test.ts\",\n \"test:custom\": \"pnpm build:dist && pnpm build:custom && node --env-file-if-exists=.env.local dist/cli/main.js -c ./happoconfigs/happo.custom.config.ts\",\n \"test:cypress\": \"pnpm build:dist && node --env-file-if-exists=.env.local dist/cli/main.js -c ./happoconfigs/happo.cypress.config.ts e2e -- cypress run -C src/cypress/__cypress__/cypress.config.ts\",\n \"test:cypress:open\": \"cypress open -C src/cypress/__cypress__/cypress.config.ts\",\n \"test:playwright\": \"pnpm build:dist && node --env-file-if-exists=.env.local dist/cli/main.js -c ./happoconfigs/happo.playwright.config.ts e2e -- playwright test\",\n \"test:storybook\": \"pnpm build:dist && node --env-file-if-exists=.env.local dist/cli/main.js -c ./happoconfigs/happo.storybook.config.ts\",\n \"test:pages\": \"pnpm build:dist && node --env-file-if-exists=.env.local dist/cli/main.js -c ./happoconfigs/happo.pages.config.ts\",\n \"tsc\": \"tsc --build tsconfig.json\"\n },\n \"browserslist\": {\n \"node\": [\n \"node 22\"\n ],\n \"browser\": [\n \"last 2 Chrome major versions\",\n \"last 2 Firefox major versions\",\n \"last 2 Safari major versions\",\n \"last 2 Edge major versions\"\n ],\n \"isomorphic\": [\n \"node 22\",\n \"last 2 Chrome major versions\",\n \"last 2 Firefox major versions\",\n \"last 2 Safari major versions\",\n \"last 2 Edge major versions\"\n ]\n },\n \"prettier\": {\n \"printWidth\": 85,\n \"singleQuote\": true,\n \"trailingComma\": \"all\",\n \"arrowParens\": \"always\"\n },\n \"devDependencies\": {\n \"@eslint/js\": \"^9.36.0\",\n \"@playwright/test\": \"^1.55.1\",\n \"@reporters/github\": \"^1.11.0\",\n \"@storybook/builder-vite\": \"^10.0.1\",\n \"@storybook/react-vite\": \"^10.0.1\",\n \"@types/async-retry\": \"^1.4.9\",\n \"@types/base64-stream\": \"^1.0.5\",\n \"@types/jsdom\": \"^27.0.0\",\n \"@types/mime-types\": \"^3.0.1\",\n \"@types/multiparty\": \"^4.2.1\",\n \"@types/node\": \"^24.9.1\",\n \"@types/react\": \"^19.2.0\",\n \"@types/react-dom\": \"^19.2.0\",\n \"@types/serve-handler\": \"^6.1.4\",\n \"cypress\": \"^15.5.0\",\n \"esbuild\": \"^0.27.0\",\n \"eslint\": \"^9.36.0\",\n \"eslint-config-prettier\": \"^10.1.8\",\n \"eslint-plugin-compat\": \"^6.0.2\",\n \"eslint-plugin-depend\": \"^1.3.1\",\n \"eslint-plugin-simple-import-sort\": \"^12.1.1\",\n \"eslint-plugin-unicorn\": \"^62.0.0\",\n \"jiti\": \"^2.6.0\",\n \"jsdom\": \"^27.0.0\",\n \"multiparty\": \"^4.2.3\",\n \"prettier\": \"^3.6.2\",\n \"react\": \"^19.2.0\",\n \"react-dom\": \"^19.2.0\",\n \"react-error-boundary\": \"^6.0.0\",\n \"serve-handler\": \"^6.1.6\",\n \"storybook\": \"^10.0.1\",\n \"typescript\": \"^5.9.2\",\n \"typescript-eslint\": \"^8.44.1\"\n },\n \"dependencies\": {\n \"async-retry\": \"^1.3.3\",\n \"base64-stream\": \"^1.0.0\",\n \"empathic\": \"^2.0.0\",\n \"fflate\": \"^0.8.2\",\n \"jose\": \"^6.1.0\",\n \"limit-concur\": \"^4.0.0\",\n \"mime-types\": \"^3.0.1\",\n \"srcset\": \"^5.0.2\"\n },\n \"storybook\": {\n \"displayName\": \"Happo\",\n \"icon\": \"https://happo.io/static/happo-hippo.png\",\n \"supportedFrameworks\": [\n \"angular\",\n \"ember\",\n \"html\",\n \"preact\",\n \"react\",\n \"react-native\",\n \"svelte\",\n \"vue\",\n \"web-components\"\n ],\n \"unsupportedFrameworks\": []\n },\n \"keywords\": [\n \"storybook-addon\",\n \"accessibility\",\n \"cypress\",\n \"playwright\",\n \"regression\",\n \"storybook\",\n \"test\",\n \"testing\",\n \"ui\",\n \"visual-regression\",\n \"visual\",\n \"vrt\"\n ],\n \"engines\": {\n \"node\": \">=22\"\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAAA;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,aAA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ACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,uBAAyB,CAAC;AAAA,EAC5B;AAAA,EACA,UAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,SAAW;AAAA,IACT,MAAQ;AAAA,EACV;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
makeHappoAPIRequest
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZAMXPRVQ.js";
|
|
4
4
|
|
|
5
5
|
// src/network/createAsyncComparison.ts
|
|
6
6
|
function assertResultIsCreateAsyncComparisonResult(result) {
|
|
@@ -56,4 +56,4 @@ async function createAsyncComparison(config, {
|
|
|
56
56
|
export {
|
|
57
57
|
createAsyncComparison
|
|
58
58
|
};
|
|
59
|
-
//# sourceMappingURL=chunk-
|
|
59
|
+
//# sourceMappingURL=chunk-RJHSQJGS.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fetchWithRetry
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-67E4ZKZT.js";
|
|
4
4
|
|
|
5
5
|
// src/network/makeHappoAPIRequest.ts
|
|
6
6
|
import { SignJWT } from "jose";
|
|
@@ -48,4 +48,4 @@ async function makeHappoAPIRequest({ url, path, method = "GET", formData, body }
|
|
|
48
48
|
export {
|
|
49
49
|
makeHappoAPIRequest
|
|
50
50
|
};
|
|
51
|
-
//# sourceMappingURL=chunk-
|
|
51
|
+
//# sourceMappingURL=chunk-ZAMXPRVQ.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createAsyncComparison
|
|
3
|
+
} from "./chunk-RJHSQJGS.js";
|
|
4
|
+
import "./chunk-ZAMXPRVQ.js";
|
|
5
|
+
import "./chunk-67E4ZKZT.js";
|
|
6
|
+
import "./chunk-P6FFKL3Q.js";
|
|
7
|
+
export {
|
|
8
|
+
createAsyncComparison as default
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=createAsyncComparison-WLHVVZXU.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
makeHappoAPIRequest
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-ZAMXPRVQ.js";
|
|
4
|
+
import "./chunk-67E4ZKZT.js";
|
|
5
|
+
import "./chunk-P6FFKL3Q.js";
|
|
6
6
|
|
|
7
7
|
// src/network/createAsyncReport.ts
|
|
8
8
|
function assertResultIsCreateAsyncReportResult(result) {
|
|
@@ -38,4 +38,4 @@ async function createAsyncReport(snapRequestIds, config, { afterSha, link, messa
|
|
|
38
38
|
export {
|
|
39
39
|
createAsyncReport as default
|
|
40
40
|
};
|
|
41
|
-
//# sourceMappingURL=createAsyncReport-
|
|
41
|
+
//# sourceMappingURL=createAsyncReport-SR43S4B4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":""}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
import {
|
|
3
2
|
fetchWithRetry
|
|
4
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-67E4ZKZT.js";
|
|
5
4
|
import {
|
|
6
5
|
package_default
|
|
7
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-P6FFKL3Q.js";
|
|
8
7
|
|
|
9
8
|
// src/cli/index.ts
|
|
10
9
|
import path2 from "node:path";
|
|
@@ -808,7 +807,7 @@ function createReporter(opts = {}) {
|
|
|
808
807
|
|
|
809
808
|
// src/cli/index.ts
|
|
810
809
|
async function getVersion() {
|
|
811
|
-
const packageJson = await import("./package-
|
|
810
|
+
const packageJson = await import("./package-JPC4TQC4.js");
|
|
812
811
|
return packageJson.default.version;
|
|
813
812
|
}
|
|
814
813
|
function parseDashdashCommandParts(rawArgs) {
|
|
@@ -998,10 +997,10 @@ async function main(rawArgs = process.argv, logger = console) {
|
|
|
998
997
|
async function handleDefaultCommand(config, environment, logger) {
|
|
999
998
|
logger.log("Running happo tests...");
|
|
1000
999
|
const [startJob, createAsyncComparison, createAsyncReport, prepareSnapRequests] = await Promise.all([
|
|
1001
|
-
(await import("./startJob-
|
|
1002
|
-
(await import("./createAsyncComparison-
|
|
1003
|
-
(await import("./createAsyncReport-
|
|
1004
|
-
(await import("./prepareSnapRequests-
|
|
1000
|
+
(await import("./startJob-H4JOASFE.js")).default,
|
|
1001
|
+
(await import("./createAsyncComparison-WLHVVZXU.js")).default,
|
|
1002
|
+
(await import("./createAsyncReport-SR43S4B4.js")).default,
|
|
1003
|
+
(await import("./prepareSnapRequests-6XYMUHER.js")).default
|
|
1005
1004
|
]);
|
|
1006
1005
|
await startJob(config, environment, logger);
|
|
1007
1006
|
try {
|
|
@@ -1023,7 +1022,7 @@ async function handleDefaultCommand(config, environment, logger) {
|
|
|
1023
1022
|
}
|
|
1024
1023
|
} catch (e) {
|
|
1025
1024
|
logger.error(e instanceof Error ? e.message : String(e), e);
|
|
1026
|
-
const cancelJob = (await import("./cancelJob-
|
|
1025
|
+
const cancelJob = (await import("./cancelJob-JU2MFYL2.js")).default;
|
|
1027
1026
|
await cancelJob("failure", config, environment, logger);
|
|
1028
1027
|
process.exitCode = 1;
|
|
1029
1028
|
return;
|
|
@@ -1034,7 +1033,7 @@ async function handleFinalizeCommand(config, environment, logger) {
|
|
|
1034
1033
|
logger.log("Config:", config);
|
|
1035
1034
|
logger.log("Environment:", environment);
|
|
1036
1035
|
try {
|
|
1037
|
-
const finalizeAll = (await import("./wrapper-
|
|
1036
|
+
const finalizeAll = (await import("./wrapper-KEZ4X2R6.js")).finalizeAll;
|
|
1038
1037
|
await finalizeAll({ happoConfig: config, environment, logger });
|
|
1039
1038
|
} catch (e) {
|
|
1040
1039
|
logger.error(e instanceof Error ? e.message : String(e), e);
|
|
@@ -1063,7 +1062,7 @@ async function handleE2ECommand(config, environment, dashdashCommandParts, confi
|
|
|
1063
1062
|
logger.log("Config:", config);
|
|
1064
1063
|
logger.log("Environment:", environment);
|
|
1065
1064
|
logger.log("Dashdash command parts:", dashdashCommandParts);
|
|
1066
|
-
const runWithWrapper = (await import("./wrapper-
|
|
1065
|
+
const runWithWrapper = (await import("./wrapper-KEZ4X2R6.js")).default;
|
|
1067
1066
|
const exitCode = await runWithWrapper(
|
|
1068
1067
|
dashdashCommandParts,
|
|
1069
1068
|
config,
|
|
@@ -1073,10 +1072,7 @@ async function handleE2ECommand(config, environment, dashdashCommandParts, confi
|
|
|
1073
1072
|
);
|
|
1074
1073
|
process.exitCode = exitCode;
|
|
1075
1074
|
}
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
main
|
|
1081
|
-
};
|
|
1082
|
-
//# sourceMappingURL=index.js.map
|
|
1075
|
+
|
|
1076
|
+
// src/cli/main.ts
|
|
1077
|
+
await main();
|
|
1078
|
+
//# sourceMappingURL=main.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/cli/index.ts", "../../src/config/loadConfig.ts", "../../src/environment/index.ts", "../../src/cli/telemetry.ts", "../../src/cli/main.ts"],
|
|
4
|
+
"sourcesContent": ["#!/usr/bin/env node\n\nimport path from 'node:path';\nimport { parseArgs } from 'node:util';\n\nimport type { ConfigWithDefaults } from '../config/index.ts';\nimport { findConfigFile, loadConfigFile } from '../config/loadConfig.ts';\nimport type { EnvironmentResult } from '../environment/index.ts';\nimport resolveEnvironment from '../environment/index.ts';\nimport type { Logger } from '../isomorphic/types.ts';\nimport type { Reporter } from './telemetry.ts';\nimport { createReporter } from './telemetry.ts';\n\nasync function getVersion() {\n const packageJson = await import('../../package.json', {\n with: { type: 'json' },\n });\n return packageJson.default.version;\n}\n\nfunction parseDashdashCommandParts(\n rawArgs: Array<string>,\n): Array<string> | undefined {\n const dashdashIndex = rawArgs.indexOf('--');\n if (dashdashIndex === -1) {\n return undefined;\n }\n return rawArgs.slice(dashdashIndex + 1);\n}\n\nfunction parseRawArgs(rawArgs: Array<string>) {\n const parsedArgs = parseArgs({\n args: rawArgs,\n\n options: {\n version: {\n type: 'boolean',\n short: 'v',\n },\n\n help: {\n type: 'boolean',\n short: 'h',\n },\n\n config: {\n type: 'string',\n short: 'c',\n },\n\n baseBranch: {\n type: 'string',\n },\n\n link: {\n type: 'string',\n },\n\n message: {\n type: 'string',\n },\n\n authorEmail: {\n type: 'string',\n },\n\n afterSha: {\n type: 'string',\n },\n\n beforeSha: {\n type: 'string',\n },\n\n fallbackShas: {\n type: 'string',\n },\n\n fallbackShasCount: {\n type: 'string',\n },\n\n notify: {\n type: 'string',\n },\n\n nonce: {\n type: 'string',\n },\n\n githubToken: {\n type: 'string',\n },\n },\n\n allowPositionals: true,\n });\n\n return {\n ...parsedArgs,\n dashdashCommandParts: parseDashdashCommandParts(rawArgs),\n };\n}\n\nconst helpText = `Happo ${await getVersion()}\nUsage: happo [options]\n\nCommands:\n <default> Run happo tests\n finalize Finalize happo report for Cypress/Playwright tests running in parallel\n\nOptions:\n --config Path to happo config file\n --version Show version number\n --help Show help text\n --baseBranch <branch> Base branch to use for comparison (default: 'origin/main')\n --link <url> URL to contextualize the comparison (default: auto-detected from CI environment)\n --message <message> Message to associate with the comparison (default: auto-detected from CI environment)\n --authorEmail <email> Email address of the author of the comparison (default: auto-detected from CI environment)\n --afterSha <sha> \"After\" SHA to use for comparison (default: auto-detected from CI environment, or HEAD SHA if not set)\n --beforeSha <sha> \"Before\" SHA to use for comparison (default: auto-detected from CI environment)\n --beforeShaTagMatcher <matcher> git tag matcher to use for \"before\" SHA resolution\n --fallbackShas <shas> Space-, newline- or comma-separated list of fallback shas for compare calls (default: auto-detected from CI environment)\n --fallbackShasCount <count> Number of fallback shas to use for compare calls (default: 50)\n --notify <emails> One or more (comma-separated) email addresses to notify with results\n --nonce <nonce> Nonce to use for Cypress/Playwright comparison\n --githubToken <token> GitHub token to use for posting Happo statuses as comments. Use in combination with the \\`githubApiUrl\\` configuration option. (default: auto-detected from environment)\n\nExamples:\n happo\n\n happo --config path/to/happo.config.ts\n happo --baseBranch origin/long-lived-branch\n happo --link https://github.com/happo/happo/pull/123\n happo --message \"Add new feature\"\n happo --notify me@example.com,you@example.com\n happo --nonce my-unique-nonce\n happo --githubToken {{ secrets.GITHUB_TOKEN }}\n\n happo --version\n happo --help\n\n happo -- playwright test\n\n happo finalize\n happo finalize --nonce my-unique-nonce\n `;\n\nfunction makeAbsolute(configFilePath: string): string {\n if (configFilePath.startsWith('.')) {\n return path.resolve(process.cwd(), configFilePath);\n }\n return configFilePath;\n}\n\nfunction installErrorHandlers(reporter: Reporter, logger: Logger) {\n const unhandledRejectionHandler: NodeJS.UnhandledRejectionListener = (reason) => {\n if (reason instanceof Error) {\n reporter.captureException(reason);\n logger.error(reason.stack || reason.message || String(reason));\n } else {\n reporter.captureException(reason);\n logger.error(`Unhandled rejection (non-Error value): ${String(reason)}`);\n }\n\n process.exitCode = 1;\n return;\n };\n\n const uncaughtExceptionHandler: NodeJS.UncaughtExceptionListener = (error) => {\n reporter.captureException(error);\n logger.error(error.stack || error.message || String(error));\n process.exitCode = 1;\n };\n\n process.on('unhandledRejection', unhandledRejectionHandler);\n process.on('uncaughtException', uncaughtExceptionHandler);\n\n return () => {\n process.removeListener('unhandledRejection', unhandledRejectionHandler);\n process.removeListener('uncaughtException', uncaughtExceptionHandler);\n };\n}\n\nexport async function main(\n rawArgs: Array<string> = process.argv,\n logger: Logger = console,\n): Promise<void> {\n const reporter = createReporter();\n const uninstallErrorHandlers = installErrorHandlers(reporter, logger);\n\n try {\n const args = parseRawArgs(rawArgs.slice(2));\n\n if (args.values.version) {\n // --version\n logger.log(await getVersion());\n return;\n }\n\n if (args.values.help) {\n // --help\n logger.log(helpText);\n return;\n }\n\n const environment = await resolveEnvironment(args.values);\n\n // Get config file path (use --config if provided, otherwise find default)\n const configFilePath = makeAbsolute(args.values.config || findConfigFile());\n const config = await loadConfigFile(configFilePath, environment, logger);\n\n // Handle positional arguments (commands)\n const command = args.positionals[0];\n\n if (args.dashdashCommandParts) {\n await handleE2ECommand(\n config,\n environment,\n args.dashdashCommandParts,\n configFilePath,\n logger,\n );\n return;\n }\n\n if (command === 'finalize') {\n await handleFinalizeCommand(config, environment, logger);\n return;\n }\n\n if (command === undefined) {\n await handleDefaultCommand(config, environment, logger);\n return;\n }\n\n logger.error(`Unknown command: ${command}\\n`);\n logger.error(helpText);\n process.exitCode = 1;\n } catch (error) {\n await reporter.captureException(error);\n logger.error(error instanceof Error ? error.message : String(error));\n process.exitCode = 1;\n } finally {\n uninstallErrorHandlers();\n }\n}\n\nasync function handleDefaultCommand(\n config: ConfigWithDefaults,\n environment: EnvironmentResult,\n logger: Logger,\n): Promise<void> {\n logger.log('Running happo tests...');\n\n const [startJob, createAsyncComparison, createAsyncReport, prepareSnapRequests] =\n await Promise.all([\n (await import('../network/startJob.ts')).default,\n (await import('../network/createAsyncComparison.ts')).default,\n (await import('../network/createAsyncReport.ts')).default,\n (await import('../network/prepareSnapRequests.ts')).default,\n ]);\n\n // Tell Happo that we are about to run a job\n await startJob(config, environment, logger);\n\n try {\n // Prepare the snap requests for the job. This includes bundling static\n // assets and uploading them.\n const snapRequestIds = await prepareSnapRequests(config);\n\n // Put together a report from the snap requests.\n const asyncReport = await createAsyncReport(\n snapRequestIds,\n config,\n environment,\n logger,\n );\n\n // Create an async comparison.\n logger.log(`[HAPPO] Async report URL: ${asyncReport.url}`);\n if (environment.beforeSha !== environment.afterSha) {\n const asyncComparison = await createAsyncComparison(\n config,\n environment,\n logger,\n );\n logger.log(`[HAPPO] Async comparison URL: ${asyncComparison.compareUrl}`);\n }\n } catch (e) {\n logger.error(e instanceof Error ? e.message : String(e), e);\n const cancelJob = (await import('../network/cancelJob.ts')).default;\n await cancelJob('failure', config, environment, logger);\n process.exitCode = 1;\n return;\n }\n}\n\nasync function handleFinalizeCommand(\n config: ConfigWithDefaults,\n environment: EnvironmentResult,\n logger: Logger,\n): Promise<void> {\n logger.log('Finalizing happo report...');\n logger.log('Config:', config);\n logger.log('Environment:', environment);\n\n try {\n const finalizeAll = (await import('../e2e/wrapper.ts')).finalizeAll;\n await finalizeAll({ happoConfig: config, environment, logger });\n } catch (e) {\n logger.error(e instanceof Error ? e.message : String(e), e);\n process.exitCode = 1;\n return;\n }\n process.exitCode = 0;\n return;\n}\n\nconst E2E_INTEGRATION_TYPES = ['cypress', 'playwright'];\n\nasync function handleE2ECommand(\n config: ConfigWithDefaults,\n environment: EnvironmentResult,\n dashdashCommandParts: Array<string>,\n configFilePath: string,\n logger: Logger,\n): Promise<void> {\n if (!E2E_INTEGRATION_TYPES.includes(config.integration.type)) {\n logger.error(\n `Unsupported integration type used for e2e command: ${config.integration.type}. Supported integration types for e2e are: ${E2E_INTEGRATION_TYPES.join(', ')}`,\n );\n process.exitCode = 1;\n return;\n }\n\n if (!dashdashCommandParts || dashdashCommandParts.length === 0) {\n logger.error('Missing command for e2e action');\n logger.error(helpText);\n process.exitCode = 1;\n return;\n }\n\n logger.log('Setting up happo wrapper for Cypress and Playwright...');\n logger.log('Config:', config);\n logger.log('Environment:', environment);\n logger.log('Dashdash command parts:', dashdashCommandParts);\n\n const runWithWrapper = (await import('../e2e/wrapper.ts')).default;\n const exitCode = await runWithWrapper(\n dashdashCommandParts,\n config,\n environment,\n logger,\n configFilePath,\n );\n process.exitCode = exitCode;\n}\n", "import fs from 'node:fs';\n\nimport { any as findAny } from 'empathic/find';\n\nimport type { EnvironmentResult } from '../environment/index.ts';\nimport type { Logger } from '../isomorphic/types.ts';\nimport fetchWithRetry from '../network/fetchWithRetry.ts';\nimport type { ConfigWithDefaults, TargetWithDefaults } from './index.ts';\n\nconst CONFIG_FILENAMES = [\n 'happo.config.js',\n 'happo.config.mjs',\n 'happo.config.cjs',\n 'happo.config.ts',\n 'happo.config.mts',\n 'happo.config.cts',\n];\n\nconst DEFAULT_ENDPOINT = 'https://happo.io';\n\nexport function findConfigFile(): string {\n if (process.env.HAPPO_CONFIG_FILE) {\n return process.env.HAPPO_CONFIG_FILE;\n }\n\n const configFilePath = findAny(CONFIG_FILENAMES, { cwd: process.cwd() });\n\n if (!configFilePath) {\n throw new Error(\n 'Happo config file could not be found. Please create a config file in the root of your project.',\n );\n }\n\n return configFilePath;\n}\n\nfunction assertIsPullRequestTokenResponse(\n response: unknown,\n): asserts response is { secret: string } {\n if (typeof response !== 'object' || response === null || !('secret' in response)) {\n throw new TypeError('Unexpected pull request token response');\n }\n}\n\nasync function getPullRequestSecret(\n endpoint: string,\n prUrl: string,\n logger: Logger,\n): Promise<string> {\n const url = new URL('/api/pull-request-token', endpoint);\n const res = await fetchWithRetry(\n url,\n {\n method: 'POST',\n body: { prUrl },\n retryCount: 3,\n },\n logger,\n );\n\n if (!res || !res.ok) {\n throw new Error(\n `Failed to get pull request secret: ${res.status} - ${await res.text()}`,\n );\n }\n\n const json = await res.json();\n assertIsPullRequestTokenResponse(json);\n\n return json.secret;\n}\n\nexport async function loadConfigFile(\n configFilePath: string,\n environment?: Pick<EnvironmentResult, 'link'>,\n logger: Logger = console,\n): Promise<ConfigWithDefaults> {\n try {\n const stats = await fs.promises.stat(configFilePath);\n if (!stats.isFile()) {\n throw new Error(`Happo config file path is not a file: ${configFilePath}`);\n }\n } catch (error) {\n if (error instanceof Error && 'code' in error && error.code === 'ENOENT') {\n throw new Error(`Happo config file could not be found: ${configFilePath}`);\n }\n\n throw error;\n }\n\n const config = (await import(configFilePath)).default;\n\n // We read these in here so that they can be passed along to the child process\n // in e2e/wrapper.ts. This allows us to use pull-request authentication\n // without having to make an additional HTTP request.\n if (!config.apiKey && process.env.HAPPO_API_KEY) {\n config.apiKey = process.env.HAPPO_API_KEY;\n }\n if (!config.apiSecret && process.env.HAPPO_API_SECRET) {\n config.apiSecret = process.env.HAPPO_API_SECRET;\n }\n\n if (!config.apiKey || !config.apiSecret) {\n const missing = [\n config.apiKey ? null : 'apiKey',\n config.apiSecret ? null : 'apiSecret',\n ]\n .filter(Boolean)\n .map((key) => `\\`${key}\\``)\n .join(' and ');\n\n if (!environment?.link) {\n throw new Error(\n `Missing ${missing} in your Happo config. Reference yours at https://happo.io/settings`,\n );\n }\n\n try {\n // Reassign API tokens to temporary ones provided for the PR\n logger.log(\n `Missing ${missing} in Happo config. Falling back to pull-request authentication.`,\n );\n config.apiKey = environment.link;\n config.apiSecret = await getPullRequestSecret(\n config.endpoint || DEFAULT_ENDPOINT,\n environment.link,\n logger,\n );\n } catch (e) {\n throw new Error('Failed to obtain temporary pull-request token', { cause: e });\n }\n }\n\n if (!config.targets) {\n config.targets = {\n chrome: {\n type: 'chrome',\n viewport: '1024x768',\n },\n };\n }\n\n if (!config.integration) {\n config.integration = {\n type: 'storybook',\n };\n }\n\n const allTargets = Object.values(config.targets);\n for (const target of allTargets as Array<TargetWithDefaults>) {\n target.viewport = target.viewport || '1024x768';\n target.freezeAnimations = target.freezeAnimations || 'last-frame';\n target.prefersReducedMotion = target.prefersReducedMotion ?? true;\n }\n\n const configWithDefaults = {\n endpoint: DEFAULT_ENDPOINT,\n githubApiUrl: 'https://api.github.com',\n targets: allTargets,\n ...config,\n };\n\n return configWithDefaults;\n}\n", "import { spawnSync } from 'node:child_process';\nimport crypto, { randomBytes } from 'node:crypto';\nimport { readFileSync } from 'node:fs';\n\ninterface GitHubEvent {\n pull_request?: {\n html_url: string;\n title: string;\n base: {\n sha: string;\n };\n head: {\n sha: string;\n };\n };\n head_commit?: {\n url: string;\n };\n merge_group?: {\n head_sha: string;\n base_sha: string;\n };\n repository?: {\n html_url: string;\n };\n before?: string;\n after?: string;\n}\n\ninterface CLIArgs {\n baseBranch?: string;\n afterSha?: string;\n beforeSha?: string;\n message?: string;\n link?: string;\n authorEmail?: string;\n beforeShaTagMatcher?: string;\n notify?: string;\n fallbackShas?: string;\n fallbackShasCount?: string;\n nonce?: string;\n githubToken?: string;\n}\n\nexport interface EnvironmentResult {\n link: string | undefined;\n message: string | undefined;\n authorEmail: string | undefined;\n beforeSha: string;\n afterSha: string;\n nonce: string | undefined;\n debugMode: boolean;\n notify: string | undefined;\n fallbackShas: Array<string> | undefined;\n githubToken: string | undefined;\n}\n\nconst envKeys: ReadonlyArray<string> = [\n 'BUILD_REPOSITORY_URI',\n 'BUILD_SOURCEVERSION',\n 'CIRCLE_PROJECT_REPONAME',\n 'CIRCLE_PROJECT_USERNAME',\n 'CIRCLE_SHA1',\n 'CI_PULL_REQUEST',\n 'GITHUB_EVENT_PATH',\n 'GITHUB_SERVER_URL',\n 'GITHUB_SHA',\n 'HAPPO_DEBUG',\n 'SYSTEM_PULLREQUEST_PULLREQUESTID',\n 'SYSTEM_PULLREQUEST_SOURCEBRANCH',\n 'SYSTEM_PULLREQUEST_SOURCEREPOSITORYURI',\n 'SYSTEM_PULLREQUEST_TARGETBRANCH',\n 'TRAVIS_COMMIT',\n 'TRAVIS_COMMIT_RANGE',\n 'TRAVIS_PULL_REQUEST',\n 'TRAVIS_PULL_REQUEST_SHA',\n 'TRAVIS_REPO_SLUG',\n];\n\nasync function resolveGithubEvent(GITHUB_EVENT_PATH: string): Promise<GitHubEvent> {\n try {\n const fs = await import('node:fs/promises');\n const content = await fs.readFile(GITHUB_EVENT_PATH, 'utf8');\n return JSON.parse(content);\n } catch (e) {\n throw new Error(\n `Failed to load GitHub event from the GITHUB_EVENT_PATH environment variable: ${JSON.stringify(GITHUB_EVENT_PATH)}`,\n { cause: e },\n );\n }\n}\n\nasync function resolveLink(\n cliArgs: CLIArgs,\n env: Record<string, string | undefined>,\n): Promise<string | undefined> {\n if (cliArgs.link) {\n // Validate the link\n let parsed: URL;\n try {\n parsed = new URL(cliArgs.link);\n } catch (e) {\n throw new TypeError(\n `link must be a valid http/https URL. Invalid URL: '${cliArgs.link}'`,\n { cause: e },\n );\n }\n\n if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {\n throw new TypeError(\n `link must be a valid http/https URL. Invalid protocol: '${parsed.protocol}' (from '${cliArgs.link}')`,\n );\n }\n\n return cliArgs.link;\n }\n\n const {\n BUILD_REPOSITORY_URI,\n BUILD_SOURCEVERSION,\n\n // https://circleci.com/docs/reference/variables/\n CIRCLE_PROJECT_REPONAME,\n CIRCLE_PROJECT_USERNAME,\n CIRCLE_PULL_REQUEST,\n CIRCLE_SHA1,\n\n CI_PULL_REQUEST,\n\n // https://docs.github.com/en/actions/reference/workflows-and-actions/variables#default-environment-variables\n GITHUB_EVENT_PATH,\n GITHUB_SHA,\n\n SYSTEM_PULLREQUEST_PULLREQUESTID,\n SYSTEM_PULLREQUEST_SOURCEREPOSITORYURI,\n\n // https://docs.travis-ci.com/user/environment-variables/#default-environment-variables\n TRAVIS_COMMIT,\n TRAVIS_PULL_REQUEST,\n TRAVIS_REPO_SLUG,\n } = env;\n\n if (CI_PULL_REQUEST) {\n // Circle CI\n return CI_PULL_REQUEST;\n }\n\n if (GITHUB_EVENT_PATH) {\n const ghEvent = await resolveGithubEvent(GITHUB_EVENT_PATH);\n\n if (ghEvent.pull_request) {\n return ghEvent.pull_request.html_url;\n }\n if (ghEvent.head_commit) {\n return ghEvent.head_commit.url;\n }\n if (ghEvent.merge_group && ghEvent.repository) {\n return `${ghEvent.repository.html_url}/commit/${ghEvent.merge_group.head_sha}`;\n }\n if (GITHUB_SHA && ghEvent.repository) {\n return `${ghEvent.repository.html_url}/commit/${GITHUB_SHA}`;\n }\n }\n\n if (SYSTEM_PULLREQUEST_PULLREQUESTID && SYSTEM_PULLREQUEST_SOURCEREPOSITORYURI) {\n return `${SYSTEM_PULLREQUEST_SOURCEREPOSITORYURI}/pullrequest/${SYSTEM_PULLREQUEST_PULLREQUESTID}`.replace(\n /[^/]+@/,\n '',\n );\n }\n\n if (BUILD_REPOSITORY_URI && BUILD_SOURCEVERSION) {\n return `${BUILD_REPOSITORY_URI}/commit/${BUILD_SOURCEVERSION}`.replace(\n /[^/]+@/,\n '',\n );\n }\n\n const githubBase = 'https://github.com';\n\n if (TRAVIS_REPO_SLUG && TRAVIS_PULL_REQUEST) {\n return `${githubBase}/${TRAVIS_REPO_SLUG}/pull/${TRAVIS_PULL_REQUEST}`;\n }\n\n if (TRAVIS_REPO_SLUG && TRAVIS_COMMIT) {\n return `${githubBase}/${TRAVIS_REPO_SLUG}/commit/${TRAVIS_COMMIT}`;\n }\n\n if (CIRCLE_PULL_REQUEST) {\n return CIRCLE_PULL_REQUEST;\n }\n\n if (CIRCLE_PROJECT_USERNAME && CIRCLE_PROJECT_REPONAME && CIRCLE_SHA1) {\n return `${githubBase}/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/commit/${CIRCLE_SHA1}`;\n }\n\n return undefined;\n}\n\nasync function resolveAuthorEmail(\n cliArgs: CLIArgs,\n env: Record<string, string | undefined>,\n): Promise<string | undefined> {\n if (cliArgs.authorEmail) {\n return cliArgs.authorEmail;\n }\n\n const { GITHUB_EVENT_PATH } = env;\n\n if (GITHUB_EVENT_PATH) {\n // const ghEvent = await resolveGithubEvent(GITHUB_EVENT_PATH);\n // TODO: do something with the github event\n }\n\n const res = spawnSync('git', ['show', '-s', '--format=%ae'], {\n encoding: 'utf8',\n });\n\n if (res.status !== 0) {\n return undefined;\n }\n\n return res.stdout.trim();\n}\n\nasync function resolveMessage(\n cliArgs: CLIArgs,\n env: Record<string, string | undefined>,\n afterSha: string,\n): Promise<string | undefined> {\n if (cliArgs.message) {\n return cliArgs.message;\n }\n\n const { GITHUB_EVENT_PATH } = env;\n\n if (GITHUB_EVENT_PATH) {\n const ghEvent = await resolveGithubEvent(GITHUB_EVENT_PATH);\n if (ghEvent.pull_request) {\n return ghEvent.pull_request.title;\n }\n }\n\n const res = spawnSync('git', ['log', '-1', '--pretty=%s', afterSha], {\n encoding: 'utf8',\n });\n\n if (res.status !== 0) {\n return undefined;\n }\n\n const message = res.stdout.split('\\n')[0];\n\n if (!message) {\n return undefined;\n }\n\n return message;\n}\n\nfunction resolveShaFromTagMatcher(tagMatcher: string): string | undefined {\n const res = spawnSync(\n 'git',\n ['tag', '--list', tagMatcher, '--sort', 'refname', '--no-contains'],\n {\n encoding: 'utf8',\n },\n );\n\n if (res.status !== 0) {\n throw new Error(\n `Failed to list git tags when matching against --beforeShaTagMatcher '${tagMatcher}'. Error: ${res.stderr}`,\n );\n }\n\n const rawAllTags = res.stdout.trim();\n if (!rawAllTags.length) {\n return undefined;\n }\n\n const allTags = rawAllTags.split('\\n');\n const tag = allTags.at(-1);\n\n if (!tag) {\n throw new Error('No tag found matching the pattern');\n }\n\n const commitRes = spawnSync('git', ['rev-list', '-n', '1', tag], {\n encoding: 'utf8',\n });\n\n if (commitRes.status !== 0) {\n throw new Error(\n `Failed to resolve commit sha from tag \"${tag}\". Error: ${res.stderr}`,\n );\n }\n\n return commitRes.stdout.trim();\n}\n\nasync function resolveBeforeSha(\n cliArgs: CLIArgs,\n env: Record<string, string | undefined>,\n afterSha: string,\n): Promise<string | undefined> {\n if (cliArgs.beforeSha) {\n return cliArgs.beforeSha;\n }\n\n if (cliArgs.beforeShaTagMatcher) {\n const resolvedSha = resolveShaFromTagMatcher(cliArgs.beforeShaTagMatcher);\n if (resolvedSha) {\n return resolvedSha;\n }\n }\n\n const { TRAVIS_COMMIT_RANGE, GITHUB_EVENT_PATH, SYSTEM_PULLREQUEST_TARGETBRANCH } =\n env;\n\n if (GITHUB_EVENT_PATH) {\n const ghEvent = await resolveGithubEvent(GITHUB_EVENT_PATH);\n if (ghEvent.pull_request) {\n return ghEvent.pull_request.base.sha;\n }\n if (ghEvent.merge_group) {\n return ghEvent.merge_group.base_sha;\n }\n return ghEvent.before;\n }\n\n if (TRAVIS_COMMIT_RANGE) {\n const [first] = TRAVIS_COMMIT_RANGE.split('...');\n return first;\n }\n\n let baseAzureBranch;\n if (SYSTEM_PULLREQUEST_TARGETBRANCH) {\n baseAzureBranch = [\n 'origin',\n SYSTEM_PULLREQUEST_TARGETBRANCH.split('/').toReversed()[0],\n ].join('/');\n }\n\n const baseBranch = cliArgs.baseBranch || baseAzureBranch || 'origin/main';\n const res = spawnSync('git', ['merge-base', baseBranch, afterSha], {\n encoding: 'utf8',\n });\n if (res.status !== 0) {\n console.error(`[HAPPO] Ignored error when resolving base commit: ${res.stderr}`);\n return undefined;\n }\n return res.stdout.split('\\n')[0];\n}\n\nfunction getHeadShaWithLocalChanges(): {\n headSha: string;\n headShaWithLocalChanges: string;\n} {\n const randomSha = randomBytes(20).toString('hex');\n // Get the HEAD sha from the git repo, or if we have local changes, add them to the sha\n const res = spawnSync('git', ['rev-parse', 'HEAD'], {\n encoding: 'utf8',\n });\n if (res.status !== 0) {\n return { headSha: randomSha, headShaWithLocalChanges: randomSha };\n }\n const headSha = res.stdout.split('\\n')[0];\n if (!headSha) {\n return { headSha: randomSha, headShaWithLocalChanges: randomSha };\n }\n\n // Check for local changes\n const diffRes = spawnSync('git', ['diff', 'HEAD'], {\n encoding: 'utf8',\n });\n\n // If git diff fails, return HEAD sha\n if (diffRes.status !== 0) {\n return { headSha, headShaWithLocalChanges: headSha };\n }\n\n const lsRes = spawnSync('git', ['ls-files', '--other', '--exclude-standard'], {\n encoding: 'utf8',\n });\n\n if (lsRes.status !== 0) {\n return { headSha, headShaWithLocalChanges: headSha };\n }\n\n const localChanges = [diffRes.stdout.trim(), lsRes.stdout.trim()];\n\n // Get contents of untracked files\n const untrackedFiles = lsRes.stdout\n .trim()\n .split('\\n')\n .filter((file) => file.trim());\n\n for (const file of untrackedFiles) {\n try {\n const content = readFileSync(file, 'utf8');\n localChanges.push(content);\n } catch {\n // If we can't read the file, include just the filename\n localChanges.push(`${file}:<unreadable>`);\n }\n }\n\n const allChanges = localChanges.join('');\n\n if (!allChanges.trim()) {\n return { headSha, headShaWithLocalChanges: headSha };\n }\n\n // If there are local changes, create a hash that includes both HEAD and the changes\n const headShaWithLocalChanges = crypto\n .createHash('sha256')\n .update(headSha)\n .update(allChanges)\n .digest('hex')\n .slice(0, 40);\n\n return { headSha, headShaWithLocalChanges };\n}\n\nasync function resolveAfterSha(\n cliArgs: CLIArgs,\n env: Record<string, string | undefined>,\n): Promise<string | { headSha: string; headShaWithLocalChanges: string }> {\n if (cliArgs.afterSha) {\n return cliArgs.afterSha;\n }\n\n const {\n CIRCLE_SHA1,\n TRAVIS_PULL_REQUEST_SHA,\n TRAVIS_COMMIT,\n GITHUB_EVENT_PATH,\n GITHUB_SHA,\n BUILD_SOURCEVERSION,\n SYSTEM_PULLREQUEST_SOURCEBRANCH,\n CI,\n } = env;\n\n const sha = CIRCLE_SHA1 || TRAVIS_PULL_REQUEST_SHA || TRAVIS_COMMIT;\n\n if (sha) {\n return sha;\n }\n\n if (SYSTEM_PULLREQUEST_SOURCEBRANCH) {\n // azure pull request\n const rawBranchName = SYSTEM_PULLREQUEST_SOURCEBRANCH.split('/').toReversed()[0];\n const res = spawnSync('git', ['rev-parse', `origin/${rawBranchName}`], {\n encoding: 'utf8',\n });\n if (res.status === 0 && res.stdout) {\n const sha = res.stdout.split('\\n')[0];\n if (sha) {\n return sha;\n }\n }\n }\n if (BUILD_SOURCEVERSION) {\n // azure master job\n return BUILD_SOURCEVERSION;\n }\n if (GITHUB_EVENT_PATH) {\n const ghEvent = await resolveGithubEvent(GITHUB_EVENT_PATH);\n if (ghEvent.pull_request) {\n return ghEvent.pull_request.head.sha;\n }\n if (ghEvent.merge_group) {\n return ghEvent.merge_group.head_sha;\n }\n if (ghEvent.after) {\n return ghEvent.after;\n }\n if (GITHUB_SHA) {\n return GITHUB_SHA;\n }\n }\n const headShaWithLocalChanges = getHeadShaWithLocalChanges();\n if (CI) {\n return headShaWithLocalChanges.headSha;\n }\n return headShaWithLocalChanges;\n}\n\nfunction resolveFallbackShas(\n cliArgs: CLIArgs,\n beforeSha: string | undefined,\n): Array<string> | undefined {\n if (cliArgs.fallbackShas) {\n return cliArgs.fallbackShas.split(/[,\\s]+/).filter(Boolean);\n }\n\n const fallbackShasCount = cliArgs.fallbackShasCount\n ? Number.parseInt(cliArgs.fallbackShasCount, 10)\n : 50;\n\n if (Number.isNaN(fallbackShasCount)) {\n throw new TypeError(\n `fallbackShasCount must be a number. Invalid value: '${cliArgs.fallbackShasCount}'`,\n );\n }\n\n const res = spawnSync(\n 'git',\n [\n 'log',\n '--format=%H',\n '--first-parent',\n `--max-count=${fallbackShasCount}`,\n `${beforeSha}^`,\n ],\n {\n encoding: 'utf8',\n },\n );\n\n if (res.status !== 0) {\n return undefined;\n }\n\n return res.stdout.split('\\n').filter(Boolean);\n}\n\nfunction getRawEnv(\n env: Record<string, string | undefined>,\n): Record<string, string | undefined> {\n const res: Record<string, string | undefined> = {};\n for (const key of envKeys) {\n res[key] = env[key];\n }\n return res;\n}\n\nexport default async function resolveEnvironment(\n cliArgs: CLIArgs,\n env: Record<string, string | undefined> = process.env,\n): Promise<EnvironmentResult> {\n const debugMode = !!env.HAPPO_DEBUG;\n const afterSha = await resolveAfterSha(cliArgs, env);\n\n const realAfterSha = typeof afterSha === 'string' ? afterSha : afterSha.headSha;\n const afterShaWithLocalChanges =\n typeof afterSha === 'string' ? afterSha : afterSha.headShaWithLocalChanges;\n\n // Resolve the before SHA with the true HEAD SHA\n const [beforeSha, link, authorEmail, message] = await Promise.all([\n resolveBeforeSha(cliArgs, env, realAfterSha),\n resolveLink(cliArgs, env),\n resolveAuthorEmail(cliArgs, env),\n\n // Resolve message with the SHA that includes local changes\n resolveMessage(cliArgs, env, afterShaWithLocalChanges),\n ]);\n\n const nonNullBeforeSha = beforeSha || afterShaWithLocalChanges;\n\n const result = {\n link,\n authorEmail,\n message,\n beforeSha: nonNullBeforeSha,\n afterSha: afterShaWithLocalChanges,\n nonce: cliArgs.nonce,\n debugMode,\n notify: cliArgs.notify,\n fallbackShas: resolveFallbackShas(cliArgs, nonNullBeforeSha),\n githubToken: cliArgs.githubToken,\n };\n\n if (debugMode) {\n console.log('[HAPPO] Raw environment', getRawEnv(env));\n console.log('[HAPPO] Resolved environment', result);\n }\n\n return result;\n}\n", "import crypto from 'node:crypto';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { createInterface } from 'node:readline';\n\nimport { up as findPackage } from 'empathic/package';\n\nimport pkg from '../../package.json' with { type: 'json' };\n\n/**\n * Happo's PUBLIC DSN. Safe to ship.\n */\nconst SENTRY_DSN =\n 'https://3a495ff2101313edb024de73b005398f@o108341.ingest.us.sentry.io/4510341337645056';\n\nconst MAX_STACK_FRAMES = 50;\nconst MAX_FUNCTION_NAME_LENGTH = 120;\n\ntype CI =\n | 'github'\n | 'circleci'\n | 'travis'\n | 'azure'\n | 'buildkite'\n | 'jenkins'\n | 'gitlab'\n | 'bitbucket'\n | 'appveyor'\n | 'drone'\n | 'ci'\n | 'unknown';\n\ntype ErrorPayload = {\n pkg: {\n name: string;\n version: string;\n };\n\n error: {\n name: string;\n message: string;\n stack?: string;\n };\n\n env: string;\n\n /** Detected CI vendor if any */\n ci: CI;\n\n nodeVersion: string;\n platform: string;\n};\n\nexport type ReporterOptions = {\n maxPerMinute?: number; // default 10\n env?: string;\n};\n\nexport interface Reporter {\n captureException(e: unknown): Promise<void>;\n}\n\nexport function detectCI(env: Record<string, string | undefined> = process.env): CI {\n if (env.GITHUB_ACTIONS) {\n return 'github';\n }\n\n if (env.CIRCLECI) {\n return 'circleci';\n }\n\n if (env.TRAVIS) {\n return 'travis';\n }\n\n if (env.TF_BUILD) {\n return 'azure';\n }\n\n if (env.BUILDKITE) {\n return 'buildkite';\n }\n\n if (env.JENKINS_URL) {\n return 'jenkins';\n }\n\n if (env.GITLAB_CI) {\n return 'gitlab';\n }\n\n if (env.BITBUCKET_BUILD_NUMBER) {\n return 'bitbucket';\n }\n\n if (env.APPVEYOR) {\n return 'appveyor';\n }\n\n if (env.DRONE) {\n return 'drone';\n }\n\n if (env.CI) {\n return 'ci';\n }\n\n return 'unknown';\n}\n\nexport function parseDsn(dsn: string): {\n host: string;\n projectId: string;\n key: string;\n protocol: string;\n} | null {\n try {\n // https://{PUBLIC_KEY}@{host}/{project_id}\n const u = new URL(dsn);\n const projectId = u.pathname.replace(/^\\//, '');\n const key = u.username; // public key\n const host = u.host; // includes subdomain + port\n return {\n host,\n projectId,\n key,\n protocol: u.protocol.replace(':', ''),\n };\n } catch {\n return null;\n }\n}\n\nasync function sendToSentry(payload: ErrorPayload) {\n const dsn = parseDsn(SENTRY_DSN);\n\n if (!dsn) {\n return;\n }\n\n // Sentry envelope: https://develop.sentry.dev/sdk/envelopes/\n const now = Date.now();\n\n // Hexadecimal string representing a uuid4 value. The length is exactly 32\n // characters. Dashes are not allowed. Has to be lowercase.\n const eventId = crypto.randomUUID().replaceAll('-', '');\n\n const url = `https://${dsn.host}/api/${dsn.projectId}/envelope/`;\n\n const httpHeaders = {\n 'content-type': 'application/x-sentry-envelope',\n 'x-sentry-auth': [\n 'Sentry sentry_version=7',\n `sentry_key=${dsn.key}`,\n `sentry_client=${pkg.name}@${pkg.version}`,\n ].join(', '),\n };\n\n const memoryInfo = process.memoryUsage();\n\n // Minimal event; we keep fields lean & sanitized\n // https://develop.sentry.dev/sdk/data-model/event-payloads/#required-attributes\n const event = {\n event_id: eventId,\n\n // RFC 3339 format\n timestamp: new Date(now).toISOString(),\n\n // A string representing the platform the SDK is submitting from. This will\n // be used by the Sentry interface to customize various components in the\n // interface.\n platform: 'node',\n\n // Possible values: fatal, error, warning, info, debug\n level: 'error',\n\n logger: 'happo.telemetry.cli',\n\n environment: payload.env ?? 'unknown',\n\n // Release versions must be unique across all projects in the organization.\n release: `${payload.pkg.name}@${payload.pkg.version}`,\n\n tags: {\n ci: payload.ci ?? '',\n },\n\n contexts: {\n runtime: {\n type: 'runtime',\n name: 'node',\n version: payload.nodeVersion ?? '',\n },\n os: {\n type: 'os',\n name: payload.platform ?? '',\n },\n memory_info: {\n type: 'memory_info',\n ...memoryInfo,\n },\n },\n\n exception: {\n values: [\n {\n type: payload.error.name || 'Error',\n value: payload.error.message,\n\n // https://develop.sentry.dev/sdk/data-model/event-payloads/stacktrace/\n stacktrace: payload.error.stack\n ? {\n frames: await parseFrames(payload.error.stack),\n }\n : undefined,\n },\n ],\n },\n };\n\n /**\n * Envelope is ndjson-like chunks\n *\n * Envelope = Headers { \"\\n\" Item } [ \"\\n\" ] ;\n * Item = Headers \"\\n\" Payload ;\n * Payload = { * } ;\n *\n * @see https://develop.sentry.dev/sdk/data-model/envelopes/#headers\n */\n const envelopeHeader = JSON.stringify({\n event_id: eventId,\n dsn: SENTRY_DSN,\n sent_at: new Date(now).toISOString(),\n });\n\n // https://develop.sentry.dev/sdk/data-model/envelopes/#items\n const item = JSON.stringify(event);\n const itemHeader = JSON.stringify({ type: 'event', length: item.length });\n\n const body = [envelopeHeader, itemHeader, item].join('\\n');\n\n try {\n await fetch(url, { method: 'POST', headers: httpHeaders, body });\n } catch {\n // swallow; never throw in library code\n }\n}\n\ninterface SentryFrame {\n function: string;\n raw_function: string;\n abs_path: string | undefined;\n filename: string | undefined;\n lineno: number | undefined;\n colno: number | undefined;\n context_line?: string;\n pre_context?: Array<string>;\n post_context?: Array<string>;\n}\n\n/**\n * Get the package root directory\n */\nfunction getPackageRoot(): string {\n const packageJsonPath = findPackage({ cwd: import.meta.dirname });\n\n if (!packageJsonPath) {\n // Fallback to relative path if empathic can't find it\n return path.resolve(import.meta.dirname, '../..');\n }\n\n return path.dirname(packageJsonPath);\n}\n\n/**\n * Check if a file path is part of this package\n */\nfunction isFileInThisPackage(filePath: string): boolean {\n // Skip node: internal modules\n if (filePath.startsWith('node:')) {\n return false;\n }\n\n try {\n const packageRoot = getPackageRoot();\n // Remove file:// prefix if present\n const cleanPath = filePath.replace(/^file:\\/\\//, '');\n const resolvedPath = path.resolve(cleanPath);\n return resolvedPath.startsWith(packageRoot + path.sep);\n } catch {\n return false;\n }\n}\n\n/**\n * Read context lines from a source file around a given line number\n * Only reads files that are part of this package\n */\nasync function readContextLines(\n filePath: string,\n lineNumber: number,\n contextLines: number = 5,\n): Promise<{\n context_line?: string;\n pre_context?: Array<string>;\n post_context?: Array<string>;\n}> {\n // Only read context for files in this package. This is to avoid reading\n // context from external files that may contain sensitive information.\n if (!isFileInThisPackage(filePath)) {\n return {};\n }\n\n try {\n // Remove file:// prefix if present\n const cleanPath = filePath.replace(/^file:\\/\\//, '');\n\n // Line numbers are 1-indexed in stack traces, but arrays are 0-indexed\n const lineIndex = lineNumber - 1;\n\n if (lineIndex < 0) {\n return {};\n }\n\n const startLine = Math.max(0, lineIndex - contextLines);\n const endLine = lineIndex + contextLines + 1;\n\n const pre_context: Array<string> = [];\n let context_line: string | undefined;\n const post_context: Array<string> = [];\n\n const fileStream = fs.createReadStream(cleanPath, { encoding: 'utf8' });\n const rl = createInterface({\n input: fileStream,\n crlfDelay: Infinity,\n });\n\n let currentLine = 0;\n\n for await (const line of rl) {\n if (currentLine < startLine) {\n // Skip lines before our context window\n currentLine++;\n continue;\n }\n\n if (currentLine === lineIndex) {\n context_line = line;\n } else if (currentLine < lineIndex) {\n pre_context.push(line);\n } else if (currentLine < endLine) {\n post_context.push(line);\n } else {\n // We've read all the lines we need\n break;\n }\n\n currentLine++;\n }\n\n // Check if we found the target line\n if (context_line === undefined) {\n return {};\n }\n\n const result: {\n context_line: string;\n pre_context?: Array<string>;\n post_context?: Array<string>;\n } = {\n context_line,\n };\n\n if (pre_context.length > 0) {\n result.pre_context = pre_context;\n }\n\n if (post_context.length > 0) {\n result.post_context = post_context;\n }\n\n return result;\n } catch {\n // File might not exist, might not be readable, etc. Best-effort only.\n return {};\n }\n}\n\n/**\n * Convert an error stack to Sentry frames (best-effort)\n */\nexport async function parseFrames(\n stack: string,\n cwd: string = process.cwd(),\n): Promise<Array<SentryFrame>> {\n // Node stack lines like: \" at func (file:///absolute/path/to/file.js:10:5)\"\n const stackLines = stack.split('\\n').slice(0, MAX_STACK_FRAMES);\n\n const frames = [];\n\n for (const stackLine of stackLines) {\n const match = stackLine.match(\n /\\s+at\\s+(?<functionName>.*?)\\s+\\((?:file:\\/\\/)?(?<absPath>.+?):(?<lineno>\\d+):(?<colno>\\d+)\\)/,\n );\n\n if (!match || !match.groups) {\n // We didn't match a stack line, so skip it. This could cause some stack\n // lines to be dropped.\n continue;\n }\n\n const rawAbsPath = match.groups.absPath ?? '';\n\n const absPath = rawAbsPath.startsWith('node:')\n ? rawAbsPath\n : path.relative(cwd, rawAbsPath);\n const filename = rawAbsPath.startsWith('node:')\n ? rawAbsPath\n : path.basename(rawAbsPath);\n\n const functionName = match.groups.functionName ?? '';\n\n const lineno = match.groups.lineno\n ? Number.parseInt(match.groups.lineno, 10)\n : undefined;\n\n // Read context lines from the source file (only for package files)\n const context =\n rawAbsPath && lineno ? await readContextLines(rawAbsPath, lineno) : {};\n\n // https://develop.sentry.dev/sdk/data-model/event-payloads/stacktrace/#frame-attributes\n const frame: SentryFrame = {\n function: functionName.slice(0, MAX_FUNCTION_NAME_LENGTH),\n raw_function: functionName,\n\n abs_path: absPath,\n filename,\n\n lineno,\n\n colno: match.groups.colno\n ? Number.parseInt(match.groups.colno, 10)\n : undefined,\n\n ...context,\n };\n\n frames.push(frame);\n }\n\n // Sentry expects most recent frame last\n return frames.toReversed();\n}\n\n/**\n * Create a reporter with rate limiting\n */\nexport function createReporter(opts: ReporterOptions = {}): Reporter {\n const maxPerMinute = Math.max(1, opts.maxPerMinute ?? 10);\n let sentThisMinute = 0;\n let minuteTick = Date.now();\n\n function isRateLimitExceeded(): boolean {\n const now = Date.now();\n\n if (now - minuteTick >= 60_000) {\n minuteTick = now;\n sentThisMinute = 0;\n }\n\n if (sentThisMinute >= maxPerMinute) {\n return true;\n }\n\n sentThisMinute++;\n\n return false;\n }\n\n const ci = detectCI(process.env);\n const nodeVersion = process.version;\n const platform = process.platform;\n\n return {\n async captureException(e: unknown) {\n if (isRateLimitExceeded()) {\n return;\n }\n\n const err = e instanceof Error ? e : new Error(String(e));\n const message = err.message ?? 'Error';\n const stack = err.stack;\n\n const payload: ErrorPayload = {\n pkg,\n env: opts.env ?? process.env.NODE_ENV ?? 'unknown',\n ci,\n nodeVersion,\n platform,\n\n error: {\n name: err.name || 'Error',\n message,\n stack: stack ?? '',\n },\n };\n\n await sendToSentry(payload);\n },\n };\n}\n", "import { main } from './index.ts';\n\nawait main();\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAEA,OAAOA,WAAU;AACjB,SAAS,iBAAiB;;;ACH1B,OAAO,QAAQ;AAEf,SAAS,OAAO,eAAe;AAO/B,IAAM,mBAAmB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAM,mBAAmB;AAElB,SAAS,iBAAyB;AACvC,MAAI,QAAQ,IAAI,mBAAmB;AACjC,WAAO,QAAQ,IAAI;AAAA,EACrB;AAEA,QAAM,iBAAiB,QAAQ,kBAAkB,EAAE,KAAK,QAAQ,IAAI,EAAE,CAAC;AAEvE,MAAI,CAAC,gBAAgB;AACnB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAEA,SAAS,iCACP,UACwC;AACxC,MAAI,OAAO,aAAa,YAAY,aAAa,QAAQ,EAAE,YAAY,WAAW;AAChF,UAAM,IAAI,UAAU,wCAAwC;AAAA,EAC9D;AACF;AAEA,eAAe,qBACb,UACA,OACA,QACiB;AACjB,QAAM,MAAM,IAAI,IAAI,2BAA2B,QAAQ;AACvD,QAAM,MAAM,MAAM;AAAA,IAChB;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM,EAAE,MAAM;AAAA,MACd,YAAY;AAAA,IACd;AAAA,IACA;AAAA,EACF;AAEA,MAAI,CAAC,OAAO,CAAC,IAAI,IAAI;AACnB,UAAM,IAA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;AACrB,YAAQ,WAAW;AACnB;AAAA,EACF;AAEA,SAAO,IAAI,wDAAwD;AACnE,SAAO,IAAI,WAAW,MAAM;AAC5B,SAAO,IAAI,gBAAgB,WAAW;AACtC,SAAO,IAAI,2BAA2B,oBAAoB;AAE1D,QAAM,kBAAkB,MAAM,OAAO,uBAAmB,GAAG;AAC3D,QAAM,WAAW,MAAM;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA,UAAQ,WAAW;AACrB;;;AInWA,MAAM,KAAK;",
|
|
6
|
+
"names": ["path", "fs", "sha", "crypto", "fs", "crypto", "fs", "path"]
|
|
7
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
makeHappoAPIRequest
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-ZAMXPRVQ.js";
|
|
4
|
+
import "./chunk-67E4ZKZT.js";
|
|
5
|
+
import "./chunk-P6FFKL3Q.js";
|
|
6
6
|
|
|
7
7
|
// src/network/prepareSnapRequests.ts
|
|
8
8
|
import fs5 from "node:fs";
|
|
@@ -732,4 +732,4 @@ async function prepareSnapRequests(config) {
|
|
|
732
732
|
export {
|
|
733
733
|
prepareSnapRequests as default
|
|
734
734
|
};
|
|
735
|
-
//# sourceMappingURL=prepareSnapRequests-
|
|
735
|
+
//# sourceMappingURL=prepareSnapRequests-6XYMUHER.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
makeHappoAPIRequest
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-ZAMXPRVQ.js";
|
|
4
|
+
import "./chunk-67E4ZKZT.js";
|
|
5
|
+
import "./chunk-P6FFKL3Q.js";
|
|
6
6
|
|
|
7
7
|
// src/network/startJob.ts
|
|
8
8
|
function assertResultIsStartJobResult(result) {
|
|
@@ -37,4 +37,4 @@ async function startJob(config, { beforeSha, afterSha, link, message }, logger)
|
|
|
37
37
|
export {
|
|
38
38
|
startJob as default
|
|
39
39
|
};
|
|
40
|
-
//# sourceMappingURL=startJob-
|
|
40
|
+
//# sourceMappingURL=startJob-H4JOASFE.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAsyncComparison
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RJHSQJGS.js";
|
|
4
4
|
import {
|
|
5
5
|
makeHappoAPIRequest
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-ZAMXPRVQ.js";
|
|
7
|
+
import "./chunk-67E4ZKZT.js";
|
|
8
|
+
import "./chunk-P6FFKL3Q.js";
|
|
9
9
|
|
|
10
10
|
// src/e2e/wrapper.ts
|
|
11
11
|
import { spawn } from "node:child_process";
|
|
@@ -373,4 +373,4 @@ export {
|
|
|
373
373
|
runWithWrapper as default,
|
|
374
374
|
finalizeAll
|
|
375
375
|
};
|
|
376
|
-
//# sourceMappingURL=wrapper-
|
|
376
|
+
//# sourceMappingURL=wrapper-KEZ4X2R6.js.map
|
package/dist/cypress/task.js
CHANGED
|
@@ -17,7 +17,7 @@ import asyncRetry from "async-retry";
|
|
|
17
17
|
// package.json
|
|
18
18
|
var package_default = {
|
|
19
19
|
name: "happo",
|
|
20
|
-
version: "6.0.
|
|
20
|
+
version: "6.0.7",
|
|
21
21
|
description: "Catch unexpected visual and accessibility changes and UI bugs",
|
|
22
22
|
license: "MIT",
|
|
23
23
|
repository: {
|
|
@@ -27,7 +27,7 @@ var package_default = {
|
|
|
27
27
|
bugs: "https://github.com/happo/happo/issues",
|
|
28
28
|
homepage: "https://happo.io",
|
|
29
29
|
bin: {
|
|
30
|
-
happo: "dist/cli/
|
|
30
|
+
happo: "dist/cli/main.js"
|
|
31
31
|
},
|
|
32
32
|
type: "module",
|
|
33
33
|
main: "./dist/config/index.js",
|
|
@@ -85,12 +85,12 @@ var package_default = {
|
|
|
85
85
|
prepublishOnly: "pnpm clean && pnpm build",
|
|
86
86
|
"storybook:dev": "storybook dev --config-dir src/storybook/__tests__/storybook-app -p ${PORT:-6007}",
|
|
87
87
|
test: "node --env-file-if-exists=.env.local ./scripts/test.ts",
|
|
88
|
-
"test:custom": "pnpm build:dist && pnpm build:custom && node --env-file-if-exists=.env.local dist/cli/
|
|
89
|
-
"test:cypress": "pnpm build:dist && node --env-file-if-exists=.env.local dist/cli/
|
|
88
|
+
"test:custom": "pnpm build:dist && pnpm build:custom && node --env-file-if-exists=.env.local dist/cli/main.js -c ./happoconfigs/happo.custom.config.ts",
|
|
89
|
+
"test:cypress": "pnpm build:dist && node --env-file-if-exists=.env.local dist/cli/main.js -c ./happoconfigs/happo.cypress.config.ts e2e -- cypress run -C src/cypress/__cypress__/cypress.config.ts",
|
|
90
90
|
"test:cypress:open": "cypress open -C src/cypress/__cypress__/cypress.config.ts",
|
|
91
|
-
"test:playwright": "pnpm build:dist && node --env-file-if-exists=.env.local dist/cli/
|
|
92
|
-
"test:storybook": "pnpm build:dist && node --env-file-if-exists=.env.local dist/cli/
|
|
93
|
-
"test:pages": "pnpm build:dist && node --env-file-if-exists=.env.local dist/cli/
|
|
91
|
+
"test:playwright": "pnpm build:dist && node --env-file-if-exists=.env.local dist/cli/main.js -c ./happoconfigs/happo.playwright.config.ts e2e -- playwright test",
|
|
92
|
+
"test:storybook": "pnpm build:dist && node --env-file-if-exists=.env.local dist/cli/main.js -c ./happoconfigs/happo.storybook.config.ts",
|
|
93
|
+
"test:pages": "pnpm build:dist && node --env-file-if-exists=.env.local dist/cli/main.js -c ./happoconfigs/happo.pages.config.ts",
|
|
94
94
|
tsc: "tsc --build tsconfig.json"
|
|
95
95
|
},
|
|
96
96
|
browserslist: {
|