From d3fbcd77b45d38dd0a8263bcdaa6e56f64295572 Mon Sep 17 00:00:00 2001 From: Kasper Isager Date: Wed, 10 Feb 2021 20:43:13 +0100 Subject: [PATCH 01/18] Add missing package references --- packages/alfa-css/package.json | 1 + packages/alfa-css/tsconfig.json | 3 +++ packages/alfa-performance/package.json | 3 ++- packages/alfa-performance/tsconfig.json | 3 +++ packages/alfa-react/package.json | 2 +- packages/alfa-rules/package.json | 3 +++ packages/alfa-rules/tsconfig.json | 9 +++++++++ 7 files changed, 22 insertions(+), 2 deletions(-) diff --git a/packages/alfa-css/package.json b/packages/alfa-css/package.json index 332a59fceb..2480aeeb4e 100644 --- a/packages/alfa-css/package.json +++ b/packages/alfa-css/package.json @@ -18,6 +18,7 @@ "src/**/*.d.ts" ], "dependencies": { + "@siteimprove/alfa-array": "^0.10.0", "@siteimprove/alfa-device": "^0.10.0", "@siteimprove/alfa-equatable": "^0.10.0", "@siteimprove/alfa-hash": "^0.10.0", diff --git a/packages/alfa-css/tsconfig.json b/packages/alfa-css/tsconfig.json index b9a845f82a..b14828b3a2 100644 --- a/packages/alfa-css/tsconfig.json +++ b/packages/alfa-css/tsconfig.json @@ -65,6 +65,9 @@ "test/value/shape/rectangle.spec.ts" ], "references": [ + { + "path": "../alfa-array" + }, { "path": "../alfa-device" }, diff --git a/packages/alfa-performance/package.json b/packages/alfa-performance/package.json index 878558f5fc..1076d6a38a 100644 --- a/packages/alfa-performance/package.json +++ b/packages/alfa-performance/package.json @@ -20,7 +20,8 @@ "dependencies": { "@siteimprove/alfa-callback": "^0.10.0", "@siteimprove/alfa-emitter": "^0.10.0", - "@siteimprove/alfa-json": "^0.10.0" + "@siteimprove/alfa-json": "^0.10.0", + "@siteimprove/alfa-thunk": "^0.10.0" }, "devDependencies": { "@siteimprove/alfa-test": "^0.10.0" diff --git a/packages/alfa-performance/tsconfig.json b/packages/alfa-performance/tsconfig.json index a845449ddd..adfffaf854 100644 --- a/packages/alfa-performance/tsconfig.json +++ b/packages/alfa-performance/tsconfig.json @@ -14,6 +14,9 @@ }, { "path": "../alfa-test" + }, + { + "path": "../alfa-thunk" } ] } diff --git a/packages/alfa-react/package.json b/packages/alfa-react/package.json index 1cec43c51d..64d59dfeaa 100644 --- a/packages/alfa-react/package.json +++ b/packages/alfa-react/package.json @@ -22,7 +22,7 @@ "@siteimprove/alfa-dom": "^0.10.0", "@siteimprove/alfa-http": "^0.10.0", "@siteimprove/alfa-option": "^0.10.0", - "@siteimprove/alfa-predicate": "^0.10.0", + "@siteimprove/alfa-refinement": "^0.10.0", "@siteimprove/alfa-web": "^0.10.0", "@types/react": "^17.0.0", "@types/react-test-renderer": "^17.0.0", diff --git a/packages/alfa-rules/package.json b/packages/alfa-rules/package.json index 289a805af4..99d92bfd5f 100644 --- a/packages/alfa-rules/package.json +++ b/packages/alfa-rules/package.json @@ -21,12 +21,14 @@ "@siteimprove/alfa-act": "^0.10.0", "@siteimprove/alfa-affine": "^0.10.0", "@siteimprove/alfa-aria": "^0.10.0", + "@siteimprove/alfa-array": "^0.10.0", "@siteimprove/alfa-branched": "^0.10.0", "@siteimprove/alfa-cache": "^0.10.0", "@siteimprove/alfa-compatibility": "^0.10.0", "@siteimprove/alfa-css": "^0.10.0", "@siteimprove/alfa-device": "^0.10.0", "@siteimprove/alfa-dom": "^0.10.0", + "@siteimprove/alfa-earl": "^0.10.0", "@siteimprove/alfa-equatable": "^0.10.0", "@siteimprove/alfa-future": "^0.10.0", "@siteimprove/alfa-http": "^0.10.0", @@ -42,6 +44,7 @@ "@siteimprove/alfa-record": "^0.10.0", "@siteimprove/alfa-refinement": "^0.10.0", "@siteimprove/alfa-result": "^0.10.0", + "@siteimprove/alfa-sarif": "^0.10.0", "@siteimprove/alfa-selector": "^0.10.0", "@siteimprove/alfa-sequence": "^0.10.0", "@siteimprove/alfa-set": "^0.10.0", diff --git a/packages/alfa-rules/tsconfig.json b/packages/alfa-rules/tsconfig.json index 28dd5fc379..b1800f69db 100644 --- a/packages/alfa-rules/tsconfig.json +++ b/packages/alfa-rules/tsconfig.json @@ -199,6 +199,9 @@ { "path": "../alfa-aria" }, + { + "path": "../alfa-array" + }, { "path": "../alfa-branched" }, @@ -217,6 +220,9 @@ { "path": "../alfa-dom" }, + { + "path": "../alfa-earl" + }, { "path": "../alfa-equatable" }, @@ -262,6 +268,9 @@ { "path": "../alfa-result" }, + { + "path": "../alfa-sarif" + }, { "path": "../alfa-selector" }, From 9c921cd712d5e5c92e5463e90b25400d5318e14a Mon Sep 17 00:00:00 2001 From: Kasper Isager Date: Wed, 10 Feb 2021 21:00:55 +0100 Subject: [PATCH 02/18] Add missing package references --- packages/alfa-aria/package.json | 1 + packages/alfa-aria/tsconfig.json | 3 +++ packages/alfa-assert/package.json | 3 ++- packages/alfa-cypress/package.json | 3 ++- packages/alfa-cypress/tsconfig.json | 9 ++++++--- packages/alfa-jasmine/package.json | 1 + packages/alfa-jasmine/tsconfig.json | 6 ++++++ packages/alfa-jest/package.json | 1 + packages/alfa-jest/tsconfig.json | 3 +++ 9 files changed, 25 insertions(+), 5 deletions(-) diff --git a/packages/alfa-aria/package.json b/packages/alfa-aria/package.json index 763cf0bc9b..8232f2a515 100644 --- a/packages/alfa-aria/package.json +++ b/packages/alfa-aria/package.json @@ -21,6 +21,7 @@ "generate": "node scripts/attributes.js && node scripts/roles.js" }, "dependencies": { + "@siteimprove/alfa-array": "^0.10.0", "@siteimprove/alfa-branched": "^0.10.0", "@siteimprove/alfa-cache": "^0.10.0", "@siteimprove/alfa-compatibility": "^0.10.0", diff --git a/packages/alfa-aria/tsconfig.json b/packages/alfa-aria/tsconfig.json index 5108beb871..eb95ce9596 100644 --- a/packages/alfa-aria/tsconfig.json +++ b/packages/alfa-aria/tsconfig.json @@ -25,6 +25,9 @@ "test/node.spec.tsx" ], "references": [ + { + "path": "../alfa-array" + }, { "path": "../alfa-branched" }, diff --git a/packages/alfa-assert/package.json b/packages/alfa-assert/package.json index 5d9edf8029..b9a2c60ed8 100644 --- a/packages/alfa-assert/package.json +++ b/packages/alfa-assert/package.json @@ -23,7 +23,8 @@ "@siteimprove/alfa-formatter-earl": "^0.10.0", "@siteimprove/alfa-future": "^0.10.0", "@siteimprove/alfa-mapper": "^0.10.0", - "@siteimprove/alfa-result": "^0.10.0" + "@siteimprove/alfa-result": "^0.10.0", + "@types/node": "^14.14.25" }, "devDependencies": { "@siteimprove/alfa-test": "^0.10.0" diff --git a/packages/alfa-cypress/package.json b/packages/alfa-cypress/package.json index 9aab7aa154..2afbf2cd33 100644 --- a/packages/alfa-cypress/package.json +++ b/packages/alfa-cypress/package.json @@ -18,6 +18,8 @@ "src/**/*.d.ts" ], "dependencies": { + "@siteimprove/alfa-act": "^0.10.0", + "@siteimprove/alfa-assert": "^0.10.0", "@siteimprove/alfa-device": "^0.10.0", "@siteimprove/alfa-dom": "^0.10.0", "@siteimprove/alfa-formatter": "^0.10.0", @@ -25,7 +27,6 @@ "@siteimprove/alfa-http": "^0.10.0", "@siteimprove/alfa-jquery": "^0.10.0", "@siteimprove/alfa-mapper": "^0.10.0", - "@siteimprove/alfa-option": "^0.10.0", "@siteimprove/alfa-web": "^0.10.0", "cypress": "^6.0.1" }, diff --git a/packages/alfa-cypress/tsconfig.json b/packages/alfa-cypress/tsconfig.json index c1d6f6d26e..a2e622d220 100644 --- a/packages/alfa-cypress/tsconfig.json +++ b/packages/alfa-cypress/tsconfig.json @@ -3,6 +3,12 @@ "extends": "../tsconfig.json", "files": ["src/cypress.ts", "src/cypress/add-command.ts", "src/index.ts"], "references": [ + { + "path": "../alfa-act" + }, + { + "path": "../alfa-assert" + }, { "path": "../alfa-device" }, @@ -24,9 +30,6 @@ { "path": "../alfa-mapper" }, - { - "path": "../alfa-option" - }, { "path": "../alfa-test" }, diff --git a/packages/alfa-jasmine/package.json b/packages/alfa-jasmine/package.json index e685c8c691..cf326b9472 100644 --- a/packages/alfa-jasmine/package.json +++ b/packages/alfa-jasmine/package.json @@ -18,6 +18,7 @@ "src/**/*.d.ts" ], "dependencies": { + "@siteimprove/alfa-act": "^0.10.0", "@siteimprove/alfa-assert": "^0.10.0", "@siteimprove/alfa-future": "^0.10.0", "@siteimprove/alfa-mapper": "^0.10.0", diff --git a/packages/alfa-jasmine/tsconfig.json b/packages/alfa-jasmine/tsconfig.json index ac0d9f07d1..5e693995b9 100644 --- a/packages/alfa-jasmine/tsconfig.json +++ b/packages/alfa-jasmine/tsconfig.json @@ -7,9 +7,15 @@ "src/jasmine/add-async-matcher.ts" ], "references": [ + { + "path": "../alfa-act" + }, { "path": "../alfa-assert" }, + { + "path": "../alfa-future" + }, { "path": "../alfa-mapper" }, diff --git a/packages/alfa-jest/package.json b/packages/alfa-jest/package.json index 1f42b63ee2..dcf5673a5c 100644 --- a/packages/alfa-jest/package.json +++ b/packages/alfa-jest/package.json @@ -20,6 +20,7 @@ "src/**/*.d.ts" ], "dependencies": { + "@siteimprove/alfa-act": "^0.10.0", "@siteimprove/alfa-assert": "^0.10.0", "@siteimprove/alfa-future": "^0.10.0", "@siteimprove/alfa-mapper": "^0.10.0", diff --git a/packages/alfa-jest/tsconfig.json b/packages/alfa-jest/tsconfig.json index 3657fd7d5c..1b23d30d78 100644 --- a/packages/alfa-jest/tsconfig.json +++ b/packages/alfa-jest/tsconfig.json @@ -3,6 +3,9 @@ "extends": "../tsconfig.json", "files": ["src/index.ts", "src/jest.ts"], "references": [ + { + "path": "../alfa-act" + }, { "path": "../alfa-assert" }, From 7b4aeff57d9186851e2f17711dbae691f3ebdff3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Feb 2021 07:56:16 +0100 Subject: [PATCH 03/18] Bump @types/chai from 4.2.14 to 4.2.15 (#703) Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.2.14 to 4.2.15. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index aa6dcd42a7..14936f080d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1661,9 +1661,9 @@ "@types/responselike" "*" "@types/chai@^4.1.7": - version "4.2.14" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.14.tgz#44d2dd0b5de6185089375d976b4ec5caf6861193" - integrity sha512-G+ITQPXkwTrslfG5L/BksmbLUA0M1iybEsmCWPqzSxsRRhJZimBKJkoMi8fr/CPygPTj4zO5pJH7I2/cm9M7SQ== + version "4.2.15" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.15.tgz#b7a6d263c2cecf44b6de9a051cf496249b154553" + integrity sha512-rYff6FI+ZTKAPkJUoyz7Udq3GaoDZnxYDEvdEdFZASiA7PoErltHezDishqQiSDWrGxvxmplH304jyzQmjp0AQ== "@types/cheerio@*": version "0.22.23" @@ -1767,7 +1767,7 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== -"@types/node@*", "@types/node@>= 8", "@types/node@^14.0.12", "@types/node@^14.6.2": +"@types/node@*", "@types/node@>= 8", "@types/node@^14.0.12", "@types/node@^14.14.25", "@types/node@^14.6.2": version "14.14.25" resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.25.tgz#15967a7b577ff81383f9b888aa6705d43fbbae93" integrity sha512-EPpXLOVqDvisVxtlbvzfyqSsFeQxltFbluZNRndIb8tr9KiBnYNLzrc1N3pyKUCww2RNrfHDViqDWWE1LCJQtQ== From fe9f8a7a0110089ed394b3b7ab2a154e69a4cdf8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Feb 2021 07:56:29 +0100 Subject: [PATCH 04/18] Bump typescript from 4.1.4 to 4.1.5 (#704) Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.1.4 to 4.1.5. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v4.1.4...v4.1.5) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 14936f080d..a885af20f2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8930,9 +8930,9 @@ typedarray@^0.0.6: integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= typescript@^4.0.2: - version "4.1.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.4.tgz#f058636e2f4f83f94ddaae07b20fd5e14598432f" - integrity sha512-+Uru0t8qIRgjuCpiSPpfGuhHecMllk5Zsazj5LZvVsEStEjmIRRBZe+jHjGQvsgS7M1wONy2PQXd67EMyV6acg== + version "4.1.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.5.tgz#123a3b214aaff3be32926f0d8f1f6e704eb89a72" + integrity sha512-6OSu9PTIzmn9TCDiovULTnET6BgXtDYL4Gg4szY+cGsc3JP1dQL8qvE8kShTRx1NIw4Q9IBHlwODjkjWEtMUyA== ua-parser-js@^0.7.21: version "0.7.21" From 4a1848a2eef2bda63bb6e53a6c48daa26aa86478 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Feb 2021 07:56:38 +0100 Subject: [PATCH 05/18] Bump @angular/core from 11.1.2 to 11.2.0 (#705) Bumps [@angular/core](https://github.com/angular/angular/tree/HEAD/packages/core) from 11.1.2 to 11.2.0. - [Release notes](https://github.com/angular/angular/releases) - [Changelog](https://github.com/angular/angular/blob/master/CHANGELOG.md) - [Commits](https://github.com/angular/angular/commits/11.2.0/packages/core) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index a885af20f2..536a31c75e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3,9 +3,9 @@ "@angular/core@^11.0.0": - version "11.1.2" - resolved "https://registry.yarnpkg.com/@angular/core/-/core-11.1.2.tgz#8aa910860309886090d66cce45dd166b1082eb05" - integrity sha512-5urIQTcRZ2hd9Q2JE0KQocjlIvuRdlrSGzxjf9OZbOuapXDNF0Sb3uEcVnt980NS7vw0Am5thVP9gDspS45c7Q== + version "11.2.0" + resolved "https://registry.yarnpkg.com/@angular/core/-/core-11.2.0.tgz#309ae61d55b21fca0b644a6571109741d64b2467" + integrity sha512-jnbnJTW2GwfkRoXG8J4zs5FMcahMZwo6jrZGe9FiXjCYG9cLEuOXy4h99Z1s/o0vc/VXyWgym7SmeEgv+urf8g== dependencies: tslib "^2.0.0" From 698981eb5b04069ad97e1b72e6980219927c0876 Mon Sep 17 00:00:00 2001 From: Kasper Isager Date: Thu, 11 Feb 2021 09:22:03 +0100 Subject: [PATCH 06/18] Switch to native Node.js source map support (#267) --- .github/workflows/integrate.yml | 2 +- package.json | 2 - packages/alfa-test/package.json | 3 +- packages/alfa-test/src/format.ts | 18 ++++++--- packages/alfa-test/src/index.ts | 1 + packages/alfa-test/src/stack.ts | 69 ++++++++++++++++++++++++++++++++ packages/alfa-test/tsconfig.json | 1 + scripts/common/tester.js | 27 +++++++------ yarn.lock | 47 +++------------------- 9 files changed, 105 insertions(+), 65 deletions(-) create mode 100644 packages/alfa-test/src/stack.ts diff --git a/.github/workflows/integrate.yml b/.github/workflows/integrate.yml index 546d01c659..beb861139b 100644 --- a/.github/workflows/integrate.yml +++ b/.github/workflows/integrate.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [10, 12, 14] + node-version: [12, 14] name: Build steps: - uses: actions/checkout@v2 diff --git a/package.json b/package.json index 2e4b7e916c..74e49d0334 100644 --- a/package.json +++ b/package.json @@ -23,11 +23,9 @@ "devDependencies": { "@types/node": "^14.6.2", "axios": "^0.21.0", - "execa": "^5.0.0", "lerna": "^3.19.0", "minimist": "^1.2.0", "prettier": "2.2.1", - "source-map-support": "^0.5.16", "typescript": "^4.0.2" } } diff --git a/packages/alfa-test/package.json b/packages/alfa-test/package.json index eb1206ef40..c470914f2a 100644 --- a/packages/alfa-test/package.json +++ b/packages/alfa-test/package.json @@ -19,8 +19,7 @@ ], "dependencies": { "@siteimprove/alfa-highlight": "^0.10.0", - "@types/node": "^14.6.2", - "error-stack-parser": "^2.0.2" + "@types/node": "^14.6.2" }, "publishConfig": { "access": "public", diff --git a/packages/alfa-test/src/format.ts b/packages/alfa-test/src/format.ts index 350cb741f7..ec4b788a0a 100644 --- a/packages/alfa-test/src/format.ts +++ b/packages/alfa-test/src/format.ts @@ -3,18 +3,24 @@ import * as assert from "assert"; import * as path from "path"; -import * as stack from "error-stack-parser"; - import { mark } from "@siteimprove/alfa-highlight"; +import { stack } from "./stack"; + /** * @internal */ export function format(name: string, error: Error): string { - const [{ fileName, lineNumber, columnNumber }] = stack.parse(error); + const [callsite] = stack(error); - const filePath = - fileName === undefined ? "unknown" : path.relative(process.cwd(), fileName); + const [file, line, column] = + callsite.type === "native" + ? ["native", -1, -1] + : [ + path.relative(process.cwd(), callsite.file), + callsite.line, + callsite.column, + ]; let message: string; @@ -41,7 +47,7 @@ export function format(name: string, error: Error): string { } const output = ` -${mark.underline(`${filePath}(${lineNumber},${columnNumber}):`)} ${mark.bold( +${mark.underline(`${file}(${line},${column}):`)} ${mark.bold( name.trim().replace(/\s+/g, " ") )} ${message} diff --git a/packages/alfa-test/src/index.ts b/packages/alfa-test/src/index.ts index 04efde9d84..81524479d4 100644 --- a/packages/alfa-test/src/index.ts +++ b/packages/alfa-test/src/index.ts @@ -1,3 +1,4 @@ export * from "./format"; +export * from "./stack"; export * from "./test"; export * from "./types"; diff --git a/packages/alfa-test/src/stack.ts b/packages/alfa-test/src/stack.ts new file mode 100644 index 0000000000..31de6274c0 --- /dev/null +++ b/packages/alfa-test/src/stack.ts @@ -0,0 +1,69 @@ +/** + * @internal + */ +export function* stack(error: Error): Iterable { + const frames = error + .stack!.split("\n") + .slice(1) + .map((frame) => frame.trim()); + + for (let i = 0, n = frames.length; i < n; i++) { + const frame = frames[i]; + + // If the frame doesn't contain a location reference, skip the frame. + if (!/(\d+:\d+)/.test(frame)) { + continue; + } + + // If the next frame contains a source mapping for the current frame as + // indicated by an arrow, skip the frame. + if (i + 1 < n && frames[i + 1].startsWith("->")) { + continue; + } + + // Sanitize the frame and split it on colons. This will group the frame into + // 3 separate parts: The file, the line, and the column. + const parts = frame + .replace("(", "") + .replace(")", "") + .replace("->", "") + .split(":") + .map((part) => part.trim()); + + // The part containing the file may contain other things as well that we + // need to remove so we grab everything from the last space character and + // cut off the rest. + parts[0] = parts[0].substring(parts[0].lastIndexOf(" ") + 1); + + const [file, line, column] = parts; + + yield { + type: file.startsWith("internal") ? "internal" : "user", + file, + line: +line, + column: +column, + }; + } +} + +type Frame = Frame.Native | Frame.Internal | Frame.User; + +namespace Frame { + export interface Native { + type: "native"; + } + + export interface Internal { + type: "internal"; + file: string; + line: number; + column: number; + } + + export interface User { + type: "user"; + file: string; + line: number; + column: number; + } +} diff --git a/packages/alfa-test/tsconfig.json b/packages/alfa-test/tsconfig.json index a670135cd3..3a1eb83777 100644 --- a/packages/alfa-test/tsconfig.json +++ b/packages/alfa-test/tsconfig.json @@ -4,6 +4,7 @@ "files": [ "src/format.ts", "src/index.ts", + "src/stack.ts", "src/test.ts", "src/types.ts", "test/test.spec.ts" diff --git a/scripts/common/tester.js b/scripts/common/tester.js index bef02ddb7b..1c9df901d7 100644 --- a/scripts/common/tester.js +++ b/scripts/common/tester.js @@ -1,5 +1,5 @@ const os = require("os"); -const execa = require("execa"); +const child_process = require("child_process"); const { system } = require("./system"); @@ -14,17 +14,20 @@ exports.tester = { while (queue.length > 0) { const fileName = queue.shift().replace(/\.tsx?$/, ".js"); - try { - await execa.node(fileName, [], { - nodeOptions: [ - ...process.execArgv, - ...["--require", require.resolve("source-map-support/register")], - ], - stdio: "inherit", - }); - } catch { - system.exit(1); - } + const child = child_process.fork(fileName, [], { + execArgv: [...process.execArgv, "--enable-source-maps"], + stdio: "inherit", + }); + + await new Promise((resolve) => + child.on("close", (code) => { + if (code !== 0) { + system.exit(1); + } else { + resolve(); + } + }) + ); } }); }, diff --git a/yarn.lock b/yarn.lock index 536a31c75e..f398ff4fd3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3192,7 +3192,7 @@ cross-spawn@^6.0.0: shebang-command "^1.2.0" which "^1.2.9" -cross-spawn@^7.0.0, cross-spawn@^7.0.3: +cross-spawn@^7.0.0: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -3794,13 +3794,6 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -error-stack-parser@^2.0.2: - version "2.0.6" - resolved "https://registry.yarnpkg.com/error-stack-parser/-/error-stack-parser-2.0.6.tgz#5a99a707bd7a4c58a797902d48d82803ede6aad8" - integrity sha512-d51brTeqC+BHlwF0BhPtcYgF5nlzf9ZZ0ZIUQNZpc9ZB9qw5IJ2diTrBY9jlCJkTLITYPjmiX6OWCwH+fuyNgQ== - dependencies: - stackframe "^1.1.1" - es-abstract@^1.17.0-next.1, es-abstract@^1.17.5: version "1.17.5" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.5.tgz#d8c9d1d66c8981fb9200e2251d799eee92774ae9" @@ -3924,21 +3917,6 @@ execa@^4.0.0, execa@^4.0.2: signal-exit "^3.0.2" strip-final-newline "^2.0.0" -execa@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-5.0.0.tgz#4029b0007998a841fbd1032e5f4de86a3c1e3376" - integrity sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ== - dependencies: - cross-spawn "^7.0.3" - get-stream "^6.0.0" - human-signals "^2.1.0" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.1" - onetime "^5.1.2" - signal-exit "^3.0.3" - strip-final-newline "^2.0.0" - executable@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/executable/-/executable-4.1.1.tgz#41532bff361d3e57af4d763b70582db18f5d133c" @@ -4376,11 +4354,6 @@ get-stream@^5.0.0, get-stream@^5.1.0: dependencies: pump "^3.0.0" -get-stream@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.0.tgz#3e0012cb6827319da2706e601a1583e8629a6718" - integrity sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg== - get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" @@ -4764,11 +4737,6 @@ human-signals@^1.1.1: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== -human-signals@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" - integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== - humanize-ms@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" @@ -6828,7 +6796,7 @@ npm-run-path@^2.0.0: dependencies: path-key "^2.0.0" -npm-run-path@^4.0.0, npm-run-path@^4.0.1: +npm-run-path@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== @@ -6975,7 +6943,7 @@ onetime@^2.0.0: dependencies: mimic-fn "^1.0.0" -onetime@^5.1.0, onetime@^5.1.2: +onetime@^5.1.0: version "5.1.2" resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== @@ -8173,7 +8141,7 @@ sigmund@^1.0.1: resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590" integrity sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA= -signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3: +signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== @@ -8272,7 +8240,7 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.5.16, source-map-support@^0.5.6: +source-map-support@^0.5.6: version "0.5.19" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== @@ -8388,11 +8356,6 @@ stack-utils@^2.0.2: dependencies: escape-string-regexp "^2.0.0" -stackframe@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-1.1.1.tgz#ffef0a3318b1b60c3b58564989aca5660729ec71" - integrity sha512-0PlYhdKh6AfFxRyK/v+6/k+/mMfyiEBbTM5L94D0ZytQnJ166wuwoTYLHFWGbs2dpA8Rgq763KGWmN1EQEYHRQ== - static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" From f15c6a592a47512567bb7db9db49222c5ad11ac7 Mon Sep 17 00:00:00 2001 From: Kasper Isager Date: Thu, 11 Feb 2021 10:29:58 +0100 Subject: [PATCH 07/18] Add user agent styles for form controls --- CHANGELOG.md | 2 ++ packages/alfa-cascade/src/user-agent.ts | 46 +++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 728f2a313c..edc5cc4a05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,8 @@ Items that are related, such as breaking changes, new features, or changes to ex - [@siteimprove/alfa-aria](packages/alfa-aria): `Node.from()` now correctly handles children of elements with roles that designate their children as presentational. +- [@siteimprove/alfa-cascade](packages/alfa-cascade): The user agent styles now include previously missing definitions for form controls. + ## [0.10.0](../../compare/v0.9.0...v0.10.0) (2021-01-29) ### Breaking diff --git a/packages/alfa-cascade/src/user-agent.ts b/packages/alfa-cascade/src/user-agent.ts index 9001b2548c..7965c9e546 100644 --- a/packages/alfa-cascade/src/user-agent.ts +++ b/packages/alfa-cascade/src/user-agent.ts @@ -152,6 +152,52 @@ export const UserAgent = h.sheet([ display: "none !important", }), + /** + * @see https://html.spec.whatwg.org/#form-controls + */ + + h.rule.style("input, select, button, textarea", { + letterSpacing: "initial", + wordSpacing: "initial", + lineHeight: "initial", + textTransform: "initial", + textIndent: "initial", + textShadow: "initial", + }), + + h.rule.style("input, select, textarea", { + textAlign: "initial", + }), + + h.rule.style( + "input:is([type=reset i], [type=button i], [type=submit i]), button", + { + textAlign: "center", + } + ), + + h.rule.style( + "input:is([type=reset i], [type=button i], [type=submit i], [type=color i]), button", + { + display: "inline-block", + } + ), + + h.rule.style( + "input:is([type=radio i], [type=checkbox i], [type=reset i], [type=button i], [type=submit i], [type=color i], [type=search i]), select, button", + { + boxSizing: "border-box", + } + ), + + h.rule.style("textarea", { whiteSpace: "pre-wrap" }), + + //