@siteimprove/alfa-formatter 0.72.2
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/CHANGELOG.md +253 -0
- package/dist/formatter.d.ts +15 -0
- package/dist/formatter.js +43 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/package.json +40 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
# @siteimprove/alfa-formatter
|
|
2
|
+
|
|
3
|
+
## 0.72.2
|
|
4
|
+
|
|
5
|
+
## 0.72.1
|
|
6
|
+
|
|
7
|
+
## 0.72.0
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- **Changed:** Dummy minor version to experiment with publish flow, use the previous or next minor version instead. ([`4daf29d`](https://github.com/Siteimprove/alfa-integrations/commit/4daf29d55745310b6ac845f963b306a4f0e57b08))
|
|
12
|
+
|
|
13
|
+
## 0.71.2
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- **Changed:** Update Alfa to ^0.92.0 ([#78](https://github.com/Siteimprove/alfa-integrations/pull/78))
|
|
18
|
+
|
|
19
|
+
## 0.71.1
|
|
20
|
+
|
|
21
|
+
## 0.71.0
|
|
22
|
+
|
|
23
|
+
## 0.70.1
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- **Changed:** Update Alfa ([#75](https://github.com/Siteimprove/alfa-integrations/pull/75))
|
|
28
|
+
|
|
29
|
+
## 0.70.0
|
|
30
|
+
|
|
31
|
+
### Minor Changes
|
|
32
|
+
|
|
33
|
+
- **Changed:** Update Alfa ([#68](https://github.com/Siteimprove/alfa-integrations/pull/68))
|
|
34
|
+
|
|
35
|
+
## 0.69.1
|
|
36
|
+
|
|
37
|
+
## 0.69.0
|
|
38
|
+
|
|
39
|
+
## 0.68.4
|
|
40
|
+
|
|
41
|
+
## 0.68.3
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- **Changed:** Update Alfa ([#54](https://github.com/Siteimprove/alfa-integrations/pull/54))
|
|
46
|
+
|
|
47
|
+
## 0.68.2
|
|
48
|
+
|
|
49
|
+
### Patch Changes
|
|
50
|
+
|
|
51
|
+
- **Changed:** Update Alfa. ([#53](https://github.com/Siteimprove/alfa-integrations/pull/53))
|
|
52
|
+
|
|
53
|
+
## 0.68.1
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- **Changed:** Update Alfa ([#52](https://github.com/Siteimprove/alfa-integrations/pull/52))
|
|
58
|
+
|
|
59
|
+
## 0.68.0
|
|
60
|
+
|
|
61
|
+
### Minor Changes
|
|
62
|
+
|
|
63
|
+
- - **Breaking:** TS resolution has been changed to `Node16`, target to `es2022`. ([#50](https://github.com/Siteimprove/alfa-integrations/pull/50))
|
|
64
|
+
|
|
65
|
+
- - **Breaking:** Alfa is now distributed as ESM rather than CJS modules; projects using it must be ESM or use dynamic `import()`. ([#50](https://github.com/Siteimprove/alfa-integrations/pull/50))
|
|
66
|
+
|
|
67
|
+
⚠️ This is the last of a series of changes on the internal structure and build process of distributed packages that was started with v0.67.0.
|
|
68
|
+
|
|
69
|
+
## 0.67.0
|
|
70
|
+
|
|
71
|
+
### Minor Changes
|
|
72
|
+
|
|
73
|
+
- **Breaking:** The .js files are now built in the dist folder rather than in src. ([#49](https://github.com/Siteimprove/alfa-integrations/pull/49))
|
|
74
|
+
|
|
75
|
+
⚠️ This is the first of a series of changes on the internal structure and build process of distributed packages. It is probably better to not use this version and wait until more of these internal changes have been done to jump directly to the final result. We are internally releasing these changes for validation purpose only.
|
|
76
|
+
|
|
77
|
+
This should not impact consumers, the package.json files should be set correctly to consume these files.
|
|
78
|
+
|
|
79
|
+
## 0.66.3
|
|
80
|
+
|
|
81
|
+
### Patch Changes
|
|
82
|
+
|
|
83
|
+
- **Changed:** Update Alfa. ([#47](https://github.com/Siteimprove/alfa-integrations/pull/47))
|
|
84
|
+
|
|
85
|
+
## 0.66.2
|
|
86
|
+
|
|
87
|
+
### Patch Changes
|
|
88
|
+
|
|
89
|
+
- **Changed:** Update Alfa ([#46](https://github.com/Siteimprove/alfa-integrations/pull/46))
|
|
90
|
+
|
|
91
|
+
## 0.66.1
|
|
92
|
+
|
|
93
|
+
### Patch Changes
|
|
94
|
+
|
|
95
|
+
- **Changed:** Update Alfa to ^0.83.1 ([#45](https://github.com/Siteimprove/alfa-integrations/pull/45))
|
|
96
|
+
|
|
97
|
+
## 0.66.0
|
|
98
|
+
|
|
99
|
+
### Minor Changes
|
|
100
|
+
|
|
101
|
+
- **Added:** Package dependency graphs are now included in the documentation. ([#43](https://github.com/Siteimprove/alfa-integrations/pull/43))
|
|
102
|
+
|
|
103
|
+
### Patch Changes
|
|
104
|
+
|
|
105
|
+
- **Changed:** Update Alfa. ([#44](https://github.com/Siteimprove/alfa-integrations/pull/44))
|
|
106
|
+
|
|
107
|
+
## 0.65.2
|
|
108
|
+
|
|
109
|
+
### Patch Changes
|
|
110
|
+
|
|
111
|
+
- **Changed:** Update Alfa ([#42](https://github.com/Siteimprove/alfa-integrations/pull/42))
|
|
112
|
+
|
|
113
|
+
## 0.65.1
|
|
114
|
+
|
|
115
|
+
### Patch Changes
|
|
116
|
+
|
|
117
|
+
- **Changed:** Update Alfa. ([#41](https://github.com/Siteimprove/alfa-integrations/pull/41))
|
|
118
|
+
|
|
119
|
+
## 0.65.0
|
|
120
|
+
|
|
121
|
+
### Patch Changes
|
|
122
|
+
|
|
123
|
+
- **Changed:** Update Alfa to ^0.79.1 ([#40](https://github.com/Siteimprove/alfa-integrations/pull/40))
|
|
124
|
+
|
|
125
|
+
## 0.64.11
|
|
126
|
+
|
|
127
|
+
### Patch Changes
|
|
128
|
+
|
|
129
|
+
- **Changed:** Update Alfa to ^0.77.0 ([#38](https://github.com/Siteimprove/alfa-integrations/pull/38))
|
|
130
|
+
|
|
131
|
+
- **Changed:** Updated Alfa. ([#39](https://github.com/Siteimprove/alfa-integrations/pull/39))
|
|
132
|
+
|
|
133
|
+
## 0.64.10
|
|
134
|
+
|
|
135
|
+
### Patch Changes
|
|
136
|
+
|
|
137
|
+
- **Changed:** Update Alfa to ^0.76.0 ([#37](https://github.com/Siteimprove/alfa-integrations/pull/37))
|
|
138
|
+
|
|
139
|
+
## 0.64.9
|
|
140
|
+
|
|
141
|
+
### Patch Changes
|
|
142
|
+
|
|
143
|
+
- **Changed:** Update Alfa to ^0.75.0 ([#36](https://github.com/Siteimprove/alfa-integrations/pull/36))
|
|
144
|
+
|
|
145
|
+
## 0.64.8
|
|
146
|
+
|
|
147
|
+
### Patch Changes
|
|
148
|
+
|
|
149
|
+
- **Changed:** Update Alfa to ^0.74.0 ([#34](https://github.com/Siteimprove/alfa-integrations/pull/34))
|
|
150
|
+
|
|
151
|
+
## 0.64.7
|
|
152
|
+
|
|
153
|
+
### Patch Changes
|
|
154
|
+
|
|
155
|
+
- **Changed:** Update Alfa ([#33](https://github.com/Siteimprove/alfa-integrations/pull/33))
|
|
156
|
+
|
|
157
|
+
## 0.64.6
|
|
158
|
+
|
|
159
|
+
### Patch Changes
|
|
160
|
+
|
|
161
|
+
- **Changed:** Update to Alfa v0.73.0 ([#32](https://github.com/Siteimprove/alfa-integrations/pull/32))
|
|
162
|
+
|
|
163
|
+
## 0.64.5
|
|
164
|
+
|
|
165
|
+
### Patch Changes
|
|
166
|
+
|
|
167
|
+
- **Changed:** Update Alfa to v0.72.0 ([#31](https://github.com/Siteimprove/alfa-integrations/pull/31))
|
|
168
|
+
|
|
169
|
+
## 0.64.4
|
|
170
|
+
|
|
171
|
+
### Patch Changes
|
|
172
|
+
|
|
173
|
+
- **Changed:** Each package now has peer dependencies to the main Alfa packages it uses. ([#30](https://github.com/Siteimprove/alfa-integrations/pull/30))
|
|
174
|
+
|
|
175
|
+
This should ease problem with code downstream that tries to Ix, e.g., `Option` from different versions of the package and fail to build.
|
|
176
|
+
|
|
177
|
+
- **Changed:** Update Alfa to version 0.71.0. ([#30](https://github.com/Siteimprove/alfa-integrations/pull/30))
|
|
178
|
+
|
|
179
|
+
## 0.64.3
|
|
180
|
+
|
|
181
|
+
### Patch Changes
|
|
182
|
+
|
|
183
|
+
- **Changed:** Update Alfa. ([#29](https://github.com/Siteimprove/alfa-integrations/pull/29))
|
|
184
|
+
|
|
185
|
+
## 0.64.2
|
|
186
|
+
|
|
187
|
+
## 0.64.1
|
|
188
|
+
|
|
189
|
+
### Patch Changes
|
|
190
|
+
|
|
191
|
+
- **Changed:** Update Alfa. ([`c8699c0`](https://github.com/Siteimprove/alfa-integrations/commit/c8699c081dfa36b407dbecc51baf1e11739e2537))
|
|
192
|
+
|
|
193
|
+
## 0.64.0
|
|
194
|
+
|
|
195
|
+
### Patch Changes
|
|
196
|
+
|
|
197
|
+
- **Changed:** Update to Alfa v0.68.0 ([#26](https://github.com/Siteimprove/alfa-integrations/pull/26))
|
|
198
|
+
|
|
199
|
+
## 0.63.1
|
|
200
|
+
|
|
201
|
+
### Patch Changes
|
|
202
|
+
|
|
203
|
+
- **Fixed:** Set up correct permissions in the release workflow ([`c47b1c9`](https://github.com/Siteimprove/alfa-integrations/commit/c47b1c9b3eb79ded5c872f3e31d0b33c9140c039))
|
|
204
|
+
|
|
205
|
+
## 0.63.0
|
|
206
|
+
|
|
207
|
+
### Minor Changes
|
|
208
|
+
|
|
209
|
+
- **Changed:** Update release flow to newer version ([#24](https://github.com/Siteimprove/alfa-integrations/pull/24))
|
|
210
|
+
|
|
211
|
+
### Patch Changes
|
|
212
|
+
|
|
213
|
+
- **Changed:** Update Alfa to version 0.67.0 ([#24](https://github.com/Siteimprove/alfa-integrations/pull/24))
|
|
214
|
+
|
|
215
|
+
## 0.62.11
|
|
216
|
+
|
|
217
|
+
### Patch Changes
|
|
218
|
+
|
|
219
|
+
- **Changes:** Updated Alfa to v0.66.0 ([`f8c0275`](https://github.com/Siteimprove/alfa-integrations/commit/f8c0275d9eadc6e98ad9aa9f2a17bb95b12d4859))
|
|
220
|
+
|
|
221
|
+
## 0.62.10
|
|
222
|
+
|
|
223
|
+
### Patch Changes
|
|
224
|
+
|
|
225
|
+
- **Added:** Updated Alfa to v0.65.0 ([#19](https://github.com/Siteimprove/alfa-integrations/pull/19))
|
|
226
|
+
|
|
227
|
+
Functions that are building `Element` directly now add an empty box to them.
|
|
228
|
+
|
|
229
|
+
## 0.62.9
|
|
230
|
+
|
|
231
|
+
### Patch Changes
|
|
232
|
+
|
|
233
|
+
- **Changed:** Update Alfa to 0.64.0 ([#17](https://github.com/Siteimprove/alfa-integrations/pull/17))
|
|
234
|
+
|
|
235
|
+
## 0.62.8
|
|
236
|
+
|
|
237
|
+
### Patch Changes
|
|
238
|
+
|
|
239
|
+
- Update Alfa to 0.63.1 ([#10](https://github.com/Siteimprove/alfa-integrations/pull/10))
|
|
240
|
+
|
|
241
|
+
## 0.62.7
|
|
242
|
+
|
|
243
|
+
### Patch Changes
|
|
244
|
+
|
|
245
|
+
- **Updated:** Adapt to latest Alfa ([#9](https://github.com/Siteimprove/alfa-integrations/pull/9))
|
|
246
|
+
|
|
247
|
+
Replace the `Result#get`/`Result#getErr` with the new `Unsafe` versions.
|
|
248
|
+
|
|
249
|
+
## 0.62.6
|
|
250
|
+
|
|
251
|
+
## 0.62.5
|
|
252
|
+
|
|
253
|
+
## 0.62.4
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Outcome, Question, Rule } from "@siteimprove/alfa-act";
|
|
2
|
+
import type { Future } from "@siteimprove/alfa-future";
|
|
3
|
+
import type { Hashable } from "@siteimprove/alfa-hash";
|
|
4
|
+
import { Result } from "@siteimprove/alfa-result";
|
|
5
|
+
/**
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export type Formatter<I, T extends Hashable, Q extends Question.Metadata = {}, S = T> = (input: I, rules: Iterable<Rule<I, T, Q, S>>, outcomes: Iterable<Outcome<I, T, Q, S>>) => Future.Maybe<string>;
|
|
9
|
+
/**
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export declare namespace Formatter {
|
|
13
|
+
function load<I, T extends Hashable, Q extends Question.Metadata = {}, S = T>(name: string, defaultScope?: string): Promise<Result<Formatter<I, T, Q, S>, string>>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=formatter.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Result, Err } from "@siteimprove/alfa-result";
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
5
|
+
export var Formatter;
|
|
6
|
+
(function (Formatter) {
|
|
7
|
+
async function load(name, defaultScope = "@siteimprove") {
|
|
8
|
+
let scope;
|
|
9
|
+
if (name.startsWith("@")) {
|
|
10
|
+
const match = name.match(/^(@[^/]+)\/(.+)$/);
|
|
11
|
+
if (match !== null) {
|
|
12
|
+
scope = match[1];
|
|
13
|
+
name = match[2];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
const patterns = [...candidates(name, scope)];
|
|
17
|
+
if (scope === undefined) {
|
|
18
|
+
patterns.push(...candidates(name, defaultScope));
|
|
19
|
+
}
|
|
20
|
+
for (const pattern of patterns) {
|
|
21
|
+
try {
|
|
22
|
+
const module = await import(pattern);
|
|
23
|
+
return Result.of(module.default());
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return Err.of(`No formatter named "${name}" was found at:\n\n${patterns
|
|
30
|
+
.map((pattern) => " " + pattern)
|
|
31
|
+
.join("\n")}`);
|
|
32
|
+
}
|
|
33
|
+
Formatter.load = load;
|
|
34
|
+
})(Formatter || (Formatter = {}));
|
|
35
|
+
const prefix = "alfa-formatter-";
|
|
36
|
+
function* candidates(name, scope) {
|
|
37
|
+
scope = scope === undefined ? "" : scope + "/";
|
|
38
|
+
if (!name.startsWith(prefix)) {
|
|
39
|
+
yield scope + prefix + name;
|
|
40
|
+
}
|
|
41
|
+
yield scope + name;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=formatter.js.map
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json.schemastore.org/package",
|
|
3
|
+
"name": "@siteimprove/alfa-formatter",
|
|
4
|
+
"homepage": "https://alfa.siteimprove.com",
|
|
5
|
+
"version": "0.72.2",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"description": "Types for modelling ACT outcome formatters",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "github:Siteimprove/alfa-integrations",
|
|
11
|
+
"directory": "packages/alfa-formatter"
|
|
12
|
+
},
|
|
13
|
+
"bugs": "https://github.com/siteimprove/alfa/issues",
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=20.0.0"
|
|
16
|
+
},
|
|
17
|
+
"type": "module",
|
|
18
|
+
"main": "dist/index.js",
|
|
19
|
+
"types": "dist/index.d.ts",
|
|
20
|
+
"files": [
|
|
21
|
+
"dist/**/*.js",
|
|
22
|
+
"dist/**/*.d.ts"
|
|
23
|
+
],
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@siteimprove/alfa-act": "^0.92.0",
|
|
26
|
+
"@siteimprove/alfa-future": "^0.92.0",
|
|
27
|
+
"@siteimprove/alfa-hash": "^0.92.0",
|
|
28
|
+
"@siteimprove/alfa-result": "^0.92.0"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"@siteimprove/alfa-act": "^0.92.0",
|
|
32
|
+
"@siteimprove/alfa-future": "^0.92.0",
|
|
33
|
+
"@siteimprove/alfa-hash": "^0.92.0",
|
|
34
|
+
"@siteimprove/alfa-result": "^0.92.0"
|
|
35
|
+
},
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public",
|
|
38
|
+
"registry": "https://npm.pkg.github.com/"
|
|
39
|
+
}
|
|
40
|
+
}
|