Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Jym77 committed Oct 11, 2023
1 parent d14c34f commit 4e31274
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

- [@siteimprove/alfa-aria](packages/alfa-aria/CHANGELOG.md), [@siteimprove/alfa-css](packages/alfa-css/CHANGELOG.md), [@siteimprove/alfa-dom](packages/alfa-dom/CHANGELOG.md), [@siteimprove/alfa-http](packages/alfa-http/CHANGELOG.md), [@siteimprove/alfa-rules](packages/alfa-rules/CHANGELOG.md), [@siteimprove/alfa-style](packages/alfa-style/CHANGELOG.md), [@siteimprove/alfa-web](packages/alfa-web/CHANGELOG.md): Many pieces of code are no longer exported. These were mostly internal exports that are no longer used in other files and should not impact intended usage of the packages. ([#1437](https://github.com/Siteimprove/alfa/pull/1437))

- [@siteimprove/alfa-css](packages/alfa-css/CHANGELOG.md): The `Index.parseItem` helper has been removed as it wasn't used. ([#1447](https://github.com/Siteimprove/alfa/pull/1447))
- [@siteimprove/alfa-css](packages/alfa-css/CHANGELOG.md): The `Gradient.parseItem` helper has been removed as it wasn't used. ([#1447](https://github.com/Siteimprove/alfa/pull/1447))

- [@siteimprove/alfa-rules](packages/alfa-rules/CHANGELOG.md): The `@siteimprove/alfa-rules/FlattenedRules` export is no longer available. ([#1437](https://github.com/Siteimprove/alfa/pull/1437))

Expand Down Expand Up @@ -1198,7 +1198,7 @@ In addition to the changes listed below, this release adjusts the compile target

- [@siteimprove/alfa-thenable](packages/alfa-thenable): A new package is now available with types for modelling values that can be used in `await` expressions.

- [@siteimprove/alfa-css](packages/alfa-css): Radial gradients are now available as a type of `Index`. ([#438](../../pull/438))
- [@siteimprove/alfa-css](packages/alfa-css): Radial gradients are now available as a type of `Gradient`. ([#438](../../pull/438))

### Changed

Expand Down
6 changes: 3 additions & 3 deletions packages/alfa-css/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@

It is mostly `Length | Percentage`, plus the mixed calculations (e.g. `calc(1em + 2px)`). It comes with the usual helper functions to parse and resolve it.

- **Removed:** The `Index.parseItem` helper has been removed as it wasn't used. ([#1447](https://github.com/Siteimprove/alfa/pull/1447))
- **Removed:** The `Gradient.parseItem` helper has been removed as it wasn't used. ([#1447](https://github.com/Siteimprove/alfa/pull/1447))

If need be, use `Parser.either(Index.parseHint, Index.parseStop)` instead.
If need be, use `Parser.either(Gradient.parseHint, Gradient.parseStop)` instead.

- **Added:** `Function.parse` now also accepts a predicate instead of just a name to compare to. ([#1448](https://github.com/Siteimprove/alfa/pull/1448))

Expand Down Expand Up @@ -125,7 +125,7 @@

- **Breaking:** `Linear.parse` and `Radial.parse` now require an item parser. ([#1412](https://github.com/Siteimprove/alfa/pull/1412))

Both gradient parsing functions where using `Index.parseItemList`, which created a circular dependency between the files. The circle has been broken by injecting the item list parser in the individual parser. To migrate, simply call `Linear.parse(Index.parseItemList)` instead of `Linear.parse` (same with `Radial`).
Both gradient parsing functions where using `Gradient.parseItemList`, which created a circular dependency between the files. The circle has been broken by injecting the item list parser in the individual parser. To migrate, simply call `Linear.parse(Gradient.parseItemList)` instead of `Linear.parse` (same with `Radial`).

- **Breaking:** `Math.resolve` now returns a `Result<Numeric, string>` instead of an `Option`. ([#1406](https://github.com/Siteimprove/alfa/pull/1406))

Expand Down
2 changes: 1 addition & 1 deletion packages/alfa-css/src/value/image/gradient/item/item.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Parser } from "@siteimprove/alfa-parser";

import { Comma, Parser as CSSParser } from "../../../../syntax/index";
import { Comma, Parser as CSSParser } from "../../../../syntax";

import { Hint } from "./hint";
import { Stop } from "./stop";
Expand Down
2 changes: 1 addition & 1 deletion packages/alfa-css/src/value/image/gradient/item/stop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Hash } from "@siteimprove/alfa-hash";
import { None, Option } from "@siteimprove/alfa-option";
import { Parser } from "@siteimprove/alfa-parser";

import { Parser as CSSParser, Token } from "../../../../syntax/index";
import { Parser as CSSParser, Token } from "../../../../syntax";

import { Color } from "../../../color";
import { LengthPercentage } from "../../../numeric";
Expand Down
6 changes: 1 addition & 5 deletions packages/alfa-css/src/value/image/gradient/linear/linear.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ import { Hash } from "@siteimprove/alfa-hash";
import { Iterable } from "@siteimprove/alfa-iterable";
import { Parser } from "@siteimprove/alfa-parser";

import {
Comma,
Function,
type Parser as CSSParser,
} from "../../../../syntax/index";
import { Comma, Function, type Parser as CSSParser } from "../../../../syntax";

import { Value } from "../../../value";

Expand Down
3 changes: 1 addition & 2 deletions packages/alfa-css/src/value/image/gradient/radial/radial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ import {
Function,
type Parser as CSSParser,
Token,
} from "../../../../syntax/index";
} from "../../../../syntax";

import { Keyword } from "../../../keyword";
import { Position } from "../../../position";
import { Value } from "../../../value";
import { Gradient } from "../gradient";

import { Item } from "../item";

Expand Down
7 changes: 7 additions & 0 deletions packages/alfa-css/src/value/image/gradient/radial/shape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ const { either } = Parser;
export type Shape = Circle | Ellipse | Extent;

/**
* Radial gradient shapes
*
* @remarks
* The syntax inside a radial-gradient() function is significantly different
* from the basic shape functions circle() and ellipse(), so we cannot easily
* reuse the code.
*
* @internal
*/
export namespace Shape {
Expand Down

0 comments on commit 4e31274

Please sign in to comment.