diff --git a/.changeset/quiet-moles-live.md b/.changeset/quiet-moles-live.md new file mode 100644 index 00000000..a07cd5bf --- /dev/null +++ b/.changeset/quiet-moles-live.md @@ -0,0 +1,10 @@ +--- +"@siteimprove/alfa-test-utils": patch +"@siteimprove/alfa-frontier": patch +"@siteimprove/alfa-command": patch +"@siteimprove/alfa-crawler": patch +"@siteimprove/alfa-scraper": patch +"@siteimprove/alfa-assert": patch +--- + +**hanged:** Classes that do not implement the Singleton pattern now have `protected` constructor and can be extended. diff --git a/packages/alfa-assert/src/asserter.ts b/packages/alfa-assert/src/asserter.ts index 588748d6..fc5d985b 100644 --- a/packages/alfa-assert/src/asserter.ts +++ b/packages/alfa-assert/src/asserter.ts @@ -20,7 +20,7 @@ export class Asserter { private readonly _handlers: Array>; private readonly _options: Asserter.Options; - private constructor( + protected constructor( rules: Array>, handlers: Array>, options: Asserter.Options diff --git a/packages/alfa-assert/src/assertion.ts b/packages/alfa-assert/src/assertion.ts index b062b5f9..0aecfd90 100644 --- a/packages/alfa-assert/src/assertion.ts +++ b/packages/alfa-assert/src/assertion.ts @@ -35,7 +35,7 @@ export class Assertion { private readonly _handlers: Array>; private readonly _options: Assertion.Options; - private constructor( + protected constructor( input: I, rules: Array>, handlers: Array>, diff --git a/packages/alfa-command/src/argument.ts b/packages/alfa-command/src/argument.ts index 43cb7d98..c77b749c 100644 --- a/packages/alfa-command/src/argument.ts +++ b/packages/alfa-command/src/argument.ts @@ -40,7 +40,7 @@ export class Argument private readonly _options: Argument.Options; private readonly _parse: Argument.Parser; - private constructor( + protected constructor( name: string, description: string, options: Argument.Options, diff --git a/packages/alfa-command/src/command.ts b/packages/alfa-command/src/command.ts index 0a319f77..81fb5561 100644 --- a/packages/alfa-command/src/command.ts +++ b/packages/alfa-command/src/command.ts @@ -78,7 +78,7 @@ export class Command< private readonly _parent: Option; private readonly _run: Command.Runner; - private constructor( + protected constructor( name: string, version: string, description: string, diff --git a/packages/alfa-command/src/flag.ts b/packages/alfa-command/src/flag.ts index f59ae89a..8b040a1d 100644 --- a/packages/alfa-command/src/flag.ts +++ b/packages/alfa-command/src/flag.ts @@ -42,7 +42,7 @@ export class Flag implements Functor, Serializable { private readonly _options: Flag.Options; private readonly _parse: Flag.Parser]>; - private constructor( + protected constructor( name: string, description: string, options: Flag.Options, @@ -393,7 +393,7 @@ export namespace Flag { private readonly _value: T; private readonly _parse: Flag.Parser; - private constructor(value: T, parse: Flag.Parser) { + protected constructor(value: T, parse: Flag.Parser) { this._value = value; this._parse = parse; } diff --git a/packages/alfa-crawler/src/crawler.ts b/packages/alfa-crawler/src/crawler.ts index 291620ff..7596d088 100644 --- a/packages/alfa-crawler/src/crawler.ts +++ b/packages/alfa-crawler/src/crawler.ts @@ -34,7 +34,7 @@ export class Crawler { private readonly _scraper: Scraper; - private constructor(scraper: Scraper) { + protected constructor(scraper: Scraper) { this._scraper = scraper; } diff --git a/packages/alfa-frontier/src/frontier.ts b/packages/alfa-frontier/src/frontier.ts index d7530b0c..2d2fc993 100644 --- a/packages/alfa-frontier/src/frontier.ts +++ b/packages/alfa-frontier/src/frontier.ts @@ -29,7 +29,7 @@ export class Frontier implements Equatable, Serializable { private readonly _scope: URL; private readonly _items: Array; - private constructor(scope: URL, items: Array) { + protected constructor(scope: URL, items: Array) { this._scope = scope; this._items = items; } @@ -243,7 +243,7 @@ class Item implements Equatable, Serializable { private readonly _aliases: Array; private _state: State; - private constructor(url: URL, aliases: Array, state: State) { + protected constructor(url: URL, aliases: Array, state: State) { this._url = url; this._aliases = aliases; this._state = state; diff --git a/packages/alfa-scraper/src/archive.ts b/packages/alfa-scraper/src/archive.ts index 5fdc5a1e..5bc68ef6 100644 --- a/packages/alfa-scraper/src/archive.ts +++ b/packages/alfa-scraper/src/archive.ts @@ -17,7 +17,7 @@ export class Archive implements Equatable, Serializable { private readonly _path: string; private readonly _format: Archive.Format; - private constructor(path: string, format: Archive.Format) { + protected constructor(path: string, format: Archive.Format) { this._path = path; this._format = format; } diff --git a/packages/alfa-scraper/src/credentials.ts b/packages/alfa-scraper/src/credentials.ts index 85ac62c6..b094c351 100644 --- a/packages/alfa-scraper/src/credentials.ts +++ b/packages/alfa-scraper/src/credentials.ts @@ -14,7 +14,7 @@ export class Credentials implements Equatable, Serializable { private readonly _username: string; private readonly _password: string; - private constructor(username: string, password: string) { + protected constructor(username: string, password: string) { this._username = username; this._password = password; } diff --git a/packages/alfa-scraper/src/scraper.ts b/packages/alfa-scraper/src/scraper.ts index 3d500430..a9326d34 100644 --- a/packages/alfa-scraper/src/scraper.ts +++ b/packages/alfa-scraper/src/scraper.ts @@ -63,7 +63,7 @@ export class Scraper { private readonly _browser: puppeteer.Browser; - private constructor(browser: puppeteer.Browser) { + protected constructor(browser: puppeteer.Browser) { this._browser = browser; } diff --git a/packages/alfa-scraper/src/screenshot.ts b/packages/alfa-scraper/src/screenshot.ts index 2bb250d9..6d03409a 100644 --- a/packages/alfa-scraper/src/screenshot.ts +++ b/packages/alfa-scraper/src/screenshot.ts @@ -17,7 +17,7 @@ export class Screenshot implements Equatable, Serializable { private readonly _path: string; private readonly _type: Screenshot.Type; - private constructor(path: string, type: Screenshot.Type) { + protected constructor(path: string, type: Screenshot.Type) { this._path = path; this._type = type; } @@ -68,7 +68,7 @@ export namespace Screenshot { private readonly _background: boolean; - private constructor(background: boolean) { + protected constructor(background: boolean) { this._background = background; } @@ -107,7 +107,7 @@ export namespace Screenshot { private readonly _quality: number; - private constructor(quality: number) { + protected constructor(quality: number) { this._quality = quality; } diff --git a/packages/alfa-test-utils/src/audit/audit.ts b/packages/alfa-test-utils/src/audit/audit.ts index 0bd74f9b..36d0b821 100644 --- a/packages/alfa-test-utils/src/audit/audit.ts +++ b/packages/alfa-test-utils/src/audit/audit.ts @@ -37,7 +37,7 @@ export class Audit implements json.Serializable { private readonly _resultAggregates: Audit.ResultAggregates; private readonly _durations: Performance.Durations; - private constructor( + protected constructor( page: Page, outcomes: Map>, resultAggregates: Audit.ResultAggregates, diff --git a/packages/alfa-test-utils/src/report/logging.ts b/packages/alfa-test-utils/src/report/logging.ts index fffa76a1..af644588 100644 --- a/packages/alfa-test-utils/src/report/logging.ts +++ b/packages/alfa-test-utils/src/report/logging.ts @@ -26,7 +26,7 @@ export class Logging implements Equatable, json.Serializable { private readonly _title: string; private readonly _logs: Sequence; - private constructor(title: string, logs: Sequence) { + protected constructor(title: string, logs: Sequence) { this._title = title; this._logs = logs; }