@johnmorrisdotca/taisen-brackets 0.0.0-stage → 0.1.0
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 +25 -0
- package/LICENSE +21 -0
- package/NOTICE.md +19 -0
- package/README.md +392 -2
- package/dist/index.d.ts +12 -0
- package/dist/index.js +9 -0
- package/dist/layout-entry.d.ts +6 -0
- package/dist/layout-entry.js +5 -0
- package/dist/layout.d.ts +8 -0
- package/dist/layout.js +261 -0
- package/dist/marks.d.ts +31 -0
- package/dist/marks.js +84 -0
- package/dist/matchup.d.ts +11 -0
- package/dist/matchup.js +147 -0
- package/dist/presets-entry.d.ts +3 -0
- package/dist/presets-entry.js +2 -0
- package/dist/presets.d.ts +43 -0
- package/dist/presets.js +81 -0
- package/dist/render.d.ts +13 -0
- package/dist/render.js +478 -0
- package/dist/rounds.d.ts +8 -0
- package/dist/rounds.js +26 -0
- package/dist/seeding.d.ts +60 -0
- package/dist/seeding.js +141 -0
- package/dist/table.d.ts +14 -0
- package/dist/table.js +35 -0
- package/dist/text.d.ts +16 -0
- package/dist/text.js +62 -0
- package/dist/theme.d.ts +21 -0
- package/dist/theme.js +53 -0
- package/dist/types.d.ts +281 -0
- package/dist/types.js +5 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +1 -0
- package/dist/words.d.ts +7 -0
- package/dist/words.js +33 -0
- package/package.json +100 -4
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The types of Taisen: what goes in (teams and matchups), what the layout works out (ties, rounds, halves) and what
|
|
3
|
+
* the drawing takes as options. Nothing here runs; the functions are in `matchup.ts`, `layout.ts` and `render.ts`.
|
|
4
|
+
*/
|
|
5
|
+
/** A side's key: a team code, a franchise id, anything that is unique within one bracket. */
|
|
6
|
+
export type SideId = string | number;
|
|
7
|
+
/** A side of a tie: a team, with the marks and labels a drawing needs. Only `id` and `name` are required. */
|
|
8
|
+
export interface Team {
|
|
9
|
+
id: SideId;
|
|
10
|
+
name: string;
|
|
11
|
+
/** A short name for a small box (three letters is usual). Left out, one is made from the name. */
|
|
12
|
+
abbr?: string;
|
|
13
|
+
/** The seed, shown beside the name when `seeds` is on. */
|
|
14
|
+
seed?: number;
|
|
15
|
+
/**
|
|
16
|
+
* The team's mark: a logo or a flag. Either the address of an image (`https://`, `data:image/…`, or a relative
|
|
17
|
+
* path) or inline SVG markup (`<svg …>`; a round flag from `@johnmorrisdotca/hata` goes here as it is).
|
|
18
|
+
*/
|
|
19
|
+
mark?: string;
|
|
20
|
+
/** The half this team belongs to when the halves are named: a conference, a region, a group. */
|
|
21
|
+
group?: string;
|
|
22
|
+
/** A colour for the team's initials when it has no mark, any CSS colour. */
|
|
23
|
+
color?: string;
|
|
24
|
+
}
|
|
25
|
+
/** One game of a tie: a match of a knockout, a game of a series, a leg of an aggregate, a replay. */
|
|
26
|
+
export interface Game {
|
|
27
|
+
/** The score, in the order of the tie's `sides`. */
|
|
28
|
+
score: readonly [number, number];
|
|
29
|
+
date?: string;
|
|
30
|
+
/** The game went to extra time (a.e.t.). */
|
|
31
|
+
extraTime?: boolean;
|
|
32
|
+
/** The penalty shoot-out's score, in the order of the tie's `sides`. */
|
|
33
|
+
pens?: readonly [number, number];
|
|
34
|
+
/** This game replays a drawn one (the World Cup of 1934 and 1938). */
|
|
35
|
+
replay?: boolean;
|
|
36
|
+
note?: string;
|
|
37
|
+
}
|
|
38
|
+
/** How a tie is contested. Left out, it is read from the other fields. */
|
|
39
|
+
export type MatchupKind =
|
|
40
|
+
/** One game. */
|
|
41
|
+
"game"
|
|
42
|
+
/** A best-of-N series: the first side to win most of N games goes on. */
|
|
43
|
+
| "series"
|
|
44
|
+
/** Two (or more) legs added up: the higher total goes on, a shoot-out settles a level one. */
|
|
45
|
+
| "aggregate"
|
|
46
|
+
/** A drawn game and the game replayed: the last one decides. */
|
|
47
|
+
| "replay";
|
|
48
|
+
/**
|
|
49
|
+
* One tie: two sides and who went through. Everything but `sides` is optional, so that a bracket can be drawn from
|
|
50
|
+
* what is known (the sides of a first round, a few results) and fill in as the games are played.
|
|
51
|
+
*/
|
|
52
|
+
export interface Matchup {
|
|
53
|
+
/** Names the tie for `feeds` of another and for the table. Left out, `m1`, `m2`… by position. */
|
|
54
|
+
id?: string;
|
|
55
|
+
/** The two sides: a team's `id`, or a whole `Team`. `null` is a side that is not known yet (To be decided). */
|
|
56
|
+
sides: readonly [SideId | Team | null, SideId | Team | null];
|
|
57
|
+
/** The side that went through, by id. Left out, it is worked out from the games when they settle it. */
|
|
58
|
+
winner?: SideId | null;
|
|
59
|
+
/**
|
|
60
|
+
* The round, from 1 (the first of the tree) to the final. `0` is a round-robin game, kept out of the tree.
|
|
61
|
+
* Left out, a tie is one round after the latest tie that feeds it.
|
|
62
|
+
*/
|
|
63
|
+
round?: number;
|
|
64
|
+
/** A sortable date (`2022-12-18`, or with a time), which orders the ties of one round and tells which feeds which. */
|
|
65
|
+
date?: string;
|
|
66
|
+
/** A number that orders the ties of a round before the date does (a World Cup's match numbers). */
|
|
67
|
+
no?: number;
|
|
68
|
+
/**
|
|
69
|
+
* Which ties feed this one: `feeds[0]` the one whose winner takes the first side, `feeds[1]` the second. Names the
|
|
70
|
+
* tree outright, for a bracket whose sides are not known yet. Left out, a winner goes on to the next tie its team plays.
|
|
71
|
+
*/
|
|
72
|
+
feeds?: readonly [string | null, string | null];
|
|
73
|
+
/** How the tie is contested. Left out: replay if a game replays, series if there is a `bestOf` or several games, else game. */
|
|
74
|
+
kind?: MatchupKind;
|
|
75
|
+
/** The length of the series (7 for a best-of-seven). */
|
|
76
|
+
bestOf?: number;
|
|
77
|
+
/** The games, oldest first. */
|
|
78
|
+
games?: readonly Game[];
|
|
79
|
+
/** The legs of an aggregate tie: the same as `games`, with `kind` "aggregate". */
|
|
80
|
+
legs?: readonly Game[];
|
|
81
|
+
/**
|
|
82
|
+
* The result, without the games: the score of a game, the games won of a series (`[4, 2]`), the total of an aggregate.
|
|
83
|
+
*/
|
|
84
|
+
score?: readonly [number, number];
|
|
85
|
+
/** The shoot-out of a game with no `games` list. */
|
|
86
|
+
pens?: readonly [number, number];
|
|
87
|
+
/** The game with no `games` list went to extra time. */
|
|
88
|
+
extraTime?: boolean;
|
|
89
|
+
/** This is the third-place match: it leads nowhere and is drawn apart. */
|
|
90
|
+
third?: boolean;
|
|
91
|
+
note?: string;
|
|
92
|
+
}
|
|
93
|
+
/** What a tie came to, worked out from its games. */
|
|
94
|
+
export interface Result {
|
|
95
|
+
kind: MatchupKind;
|
|
96
|
+
/** The number drawn for each side: goals in a game, games won in a series, the total of an aggregate. `null` when nothing was played. */
|
|
97
|
+
score: readonly [number, number] | null;
|
|
98
|
+
/** The games played. */
|
|
99
|
+
played: number;
|
|
100
|
+
bestOf: number | null;
|
|
101
|
+
pens: readonly [number, number] | null;
|
|
102
|
+
extraTime: boolean;
|
|
103
|
+
/** Replays played. */
|
|
104
|
+
replays: number;
|
|
105
|
+
/** The scores of the games, for a series or an aggregate, in the order of `sides`. */
|
|
106
|
+
games: readonly (readonly [number, number])[];
|
|
107
|
+
/** Whether one side has gone through. */
|
|
108
|
+
decided: boolean;
|
|
109
|
+
}
|
|
110
|
+
/** A tie as the layout knows it. `index` is the position of its matchup in the list given. */
|
|
111
|
+
export interface Tie {
|
|
112
|
+
index: number;
|
|
113
|
+
id: string;
|
|
114
|
+
/** The round (1 for the first round of the tree); the final round for a third-place match; 0 for a round-robin game. */
|
|
115
|
+
round: number;
|
|
116
|
+
/** The two sides; `null` where not known yet. */
|
|
117
|
+
sides: readonly [Team | null, Team | null];
|
|
118
|
+
/** 0 or 1: the side that went through, or `null`. */
|
|
119
|
+
winner: 0 | 1 | null;
|
|
120
|
+
result: Result;
|
|
121
|
+
date: string;
|
|
122
|
+
no: number | null;
|
|
123
|
+
third: boolean;
|
|
124
|
+
note: string | null;
|
|
125
|
+
}
|
|
126
|
+
/** Where the layout put a tie. */
|
|
127
|
+
export type Place = "l" | "r" | "f" | "o";
|
|
128
|
+
/** A tie's place in the tree. */
|
|
129
|
+
export interface LayoutBox {
|
|
130
|
+
/** The tie's index. */
|
|
131
|
+
i: number;
|
|
132
|
+
round: number;
|
|
133
|
+
/** The row, 0 at the top; fractional where a tie sits between two. */
|
|
134
|
+
y: number;
|
|
135
|
+
/** The row of the tie this one feeds, or `null`. */
|
|
136
|
+
to: number | null;
|
|
137
|
+
/** Whether a tie feeds this one. */
|
|
138
|
+
fed: boolean;
|
|
139
|
+
/** Which side is drawn on top, then which below: `[0, 1]`, or `[1, 0]` when the top feeder's team is the second side. */
|
|
140
|
+
order: readonly [0 | 1, 0 | 1];
|
|
141
|
+
/** The side that had a bye (it came from no tie, though the other did), or `null`. */
|
|
142
|
+
bye: 0 | 1 | null;
|
|
143
|
+
}
|
|
144
|
+
export interface LayoutSide {
|
|
145
|
+
/** `l` the left half (the top half on a phone), `r` the right. */
|
|
146
|
+
key: "l" | "r";
|
|
147
|
+
/** The group's name when the half is one group (a conference). */
|
|
148
|
+
label: string | null;
|
|
149
|
+
boxes: LayoutBox[];
|
|
150
|
+
rows: number;
|
|
151
|
+
}
|
|
152
|
+
export interface BracketLayout {
|
|
153
|
+
/** Every tie, in the order given. */
|
|
154
|
+
ties: Tie[];
|
|
155
|
+
/** How the tree is drawn: two halves that meet at the final, one tree left to right, or several (no single final). */
|
|
156
|
+
shape: "halves" | "ltr" | "forest";
|
|
157
|
+
sides: LayoutSide[];
|
|
158
|
+
/** The final, when the halves meet at it: its row and the order of its sides (the first is the left half's). */
|
|
159
|
+
final: {
|
|
160
|
+
i: number;
|
|
161
|
+
y: number;
|
|
162
|
+
order: readonly [0 | 1, 0 | 1];
|
|
163
|
+
} | null;
|
|
164
|
+
/** The tie that is the final, when the last round holds one, in any shape. */
|
|
165
|
+
finalIndex: number | null;
|
|
166
|
+
/** The rounds drawn on the sides, in order (the final's own round is left out when the halves meet at it). */
|
|
167
|
+
columns: number[];
|
|
168
|
+
/** The number of rounds of the tree, the final's included. */
|
|
169
|
+
rounds: number;
|
|
170
|
+
rows: number;
|
|
171
|
+
/** Ties that lead nowhere near the final, and round-robin games. */
|
|
172
|
+
other: number[];
|
|
173
|
+
robin: number[];
|
|
174
|
+
/** The third-place match, when there is one. */
|
|
175
|
+
third: number | null;
|
|
176
|
+
/** Where each tie is: a half, the final, or elsewhere; by tie index. */
|
|
177
|
+
place: Place[];
|
|
178
|
+
/** The tie each tie feeds, by index; -1 for none. */
|
|
179
|
+
parent: number[];
|
|
180
|
+
/** The team that won the final, when it has been played. */
|
|
181
|
+
champion: Team | null;
|
|
182
|
+
/** Every team that appears, by id. */
|
|
183
|
+
teams: Team[];
|
|
184
|
+
}
|
|
185
|
+
export interface BracketInput {
|
|
186
|
+
matchups: readonly Matchup[];
|
|
187
|
+
/** The teams: names, marks, groups. A side named by an id that is not here is a team of that name. */
|
|
188
|
+
teams?: readonly Team[];
|
|
189
|
+
}
|
|
190
|
+
export interface LayoutOptions {
|
|
191
|
+
/** `halves` (the default when two ties feed the final) draws two halves meeting at the final; `ltr` one tree left to right. */
|
|
192
|
+
shape?: "auto" | "halves" | "ltr";
|
|
193
|
+
/** The order of the halves' groups, first on the left: `["West", "East"]`. Left out, a name with "west" goes left and one with "east" right. */
|
|
194
|
+
groupOrder?: readonly string[];
|
|
195
|
+
}
|
|
196
|
+
/** The words a drawing and a table use. Every one can be replaced (`words`). */
|
|
197
|
+
export interface Words {
|
|
198
|
+
tbd: string;
|
|
199
|
+
bye: string;
|
|
200
|
+
champion: string;
|
|
201
|
+
thirdPlace: string;
|
|
202
|
+
/** The heading over ties that lead nowhere near the final. */
|
|
203
|
+
other: string;
|
|
204
|
+
final: string;
|
|
205
|
+
aet: string;
|
|
206
|
+
pens: string;
|
|
207
|
+
aggregate: string;
|
|
208
|
+
replay: string;
|
|
209
|
+
/** `{n}` is the number of games: "in 7". */
|
|
210
|
+
inGames: string;
|
|
211
|
+
/** `{n}`: "Best of 7". */
|
|
212
|
+
bestOf: string;
|
|
213
|
+
/** `{n}`: "Round 3" for a round with no name. */
|
|
214
|
+
round: string;
|
|
215
|
+
winner: string;
|
|
216
|
+
versus: string;
|
|
217
|
+
/** The table's column titles. */
|
|
218
|
+
columnRound: string;
|
|
219
|
+
columnTie: string;
|
|
220
|
+
columnResult: string;
|
|
221
|
+
columnNote: string;
|
|
222
|
+
/** `{n}` teams, `{r}` rounds. */
|
|
223
|
+
summary: string;
|
|
224
|
+
/** The same for a bracket of one round. */
|
|
225
|
+
summaryOne: string;
|
|
226
|
+
title: string;
|
|
227
|
+
}
|
|
228
|
+
export type ThemeName = "auto" | "light" | "dark" | "poster" | "none";
|
|
229
|
+
export type SizeName = "wide" | "square" | "phone";
|
|
230
|
+
export interface Size {
|
|
231
|
+
/** The width of the drawing, in pixels. */
|
|
232
|
+
width: number;
|
|
233
|
+
/** Its height. `null` is as tall as the bracket needs (a phone's). */
|
|
234
|
+
height: number | null;
|
|
235
|
+
}
|
|
236
|
+
/** How much a box shows: both names and scores, an abbreviation and the score, or only the marks. */
|
|
237
|
+
export type Detail = "auto" | "full" | "compact" | "mark";
|
|
238
|
+
export interface DrawOptions extends LayoutOptions {
|
|
239
|
+
/** `wide` 1200 by 675, `square` 1080 by 1080, `phone` 390 wide and as tall as it needs; or a size of your own. Default `wide`. */
|
|
240
|
+
size?: SizeName | {
|
|
241
|
+
width: number;
|
|
242
|
+
height?: number | null;
|
|
243
|
+
};
|
|
244
|
+
/** `horizontal`: the rounds are columns. `vertical`: the rounds are rows, for a tall page. Default horizontal; the phone's is vertical. */
|
|
245
|
+
orientation?: "auto" | "horizontal" | "vertical";
|
|
246
|
+
detail?: Detail;
|
|
247
|
+
/** `auto` follows the page's light or dark; `poster` is dark with gold lines; `none` writes no style, for your own CSS. Default `auto`. */
|
|
248
|
+
theme?: ThemeName;
|
|
249
|
+
/** Draw a background. Default true; false for a transparent drawing. */
|
|
250
|
+
background?: boolean;
|
|
251
|
+
title?: string;
|
|
252
|
+
subtitle?: string;
|
|
253
|
+
/** Names of the rounds, first round first (or just the last ones). Default: Final, Semi-finals, Quarter-finals, Round of 16… */
|
|
254
|
+
roundNames?: readonly string[] | {
|
|
255
|
+
rounds: readonly {
|
|
256
|
+
name: string;
|
|
257
|
+
}[];
|
|
258
|
+
};
|
|
259
|
+
/** Show the round names over the columns. Default true; false in the flag-only look. */
|
|
260
|
+
roundLabels?: boolean;
|
|
261
|
+
/** Show the scores. Default true. */
|
|
262
|
+
scores?: boolean;
|
|
263
|
+
/** Show seeds before names. Default false. */
|
|
264
|
+
seeds?: boolean;
|
|
265
|
+
/** `round` (the default), `square`, or `none` (names only). */
|
|
266
|
+
markShape?: "round" | "square" | "none";
|
|
267
|
+
/** Show the champion in the centre once the final is played. Default true. */
|
|
268
|
+
champion?: boolean;
|
|
269
|
+
/** A trophy for the centre: inline SVG or an image address. Drawn above the champion. */
|
|
270
|
+
trophy?: string;
|
|
271
|
+
/** Where the third-place match goes: `below` the final (the default) or `hide`. */
|
|
272
|
+
thirdPlace?: "below" | "hide";
|
|
273
|
+
/** Highlight the side that went through. Default true. */
|
|
274
|
+
winnerHighlight?: boolean;
|
|
275
|
+
/** The words, in another language or your own. */
|
|
276
|
+
words?: Partial<Words>;
|
|
277
|
+
/** Prefix for the drawing's ids. Default: a hash of the bracket and the options. */
|
|
278
|
+
id?: string;
|
|
279
|
+
/** Extra class names for the root `<svg>`. */
|
|
280
|
+
className?: string;
|
|
281
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VERSION = "0.1.0";
|
package/dist/version.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const VERSION = "0.1.0";
|
package/dist/words.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Words } from "./types.ts";
|
|
2
|
+
/** The English words of a drawing and a table. Pass `words` to replace any of them. */
|
|
3
|
+
export declare const WORDS: Readonly<Words>;
|
|
4
|
+
/** The words with any replacements applied. */
|
|
5
|
+
export declare function wordsWith(over?: Partial<Words>): Words;
|
|
6
|
+
/** Fills `{n}`-style holes in a phrase. */
|
|
7
|
+
export declare function fill(phrase: string, values: Record<string, string | number>): string;
|
package/dist/words.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** The English words of a drawing and a table. Pass `words` to replace any of them. */
|
|
2
|
+
export const WORDS = Object.freeze({
|
|
3
|
+
tbd: "TBD",
|
|
4
|
+
bye: "bye",
|
|
5
|
+
champion: "Champion",
|
|
6
|
+
thirdPlace: "Third place",
|
|
7
|
+
other: "Other ties",
|
|
8
|
+
final: "Final",
|
|
9
|
+
aet: "a.e.t.",
|
|
10
|
+
pens: "pens",
|
|
11
|
+
aggregate: "agg.",
|
|
12
|
+
replay: "replay",
|
|
13
|
+
inGames: "in {n}",
|
|
14
|
+
bestOf: "best of {n}",
|
|
15
|
+
round: "Round {n}",
|
|
16
|
+
winner: "Winner",
|
|
17
|
+
versus: "v",
|
|
18
|
+
columnRound: "Round",
|
|
19
|
+
columnTie: "Tie",
|
|
20
|
+
columnResult: "Result",
|
|
21
|
+
columnNote: "Note",
|
|
22
|
+
summary: "{n} teams, {r} rounds",
|
|
23
|
+
summaryOne: "{n} teams, 1 round",
|
|
24
|
+
title: "Knockout bracket",
|
|
25
|
+
});
|
|
26
|
+
/** The words with any replacements applied. */
|
|
27
|
+
export function wordsWith(over) {
|
|
28
|
+
return { ...WORDS, ...over };
|
|
29
|
+
}
|
|
30
|
+
/** Fills `{n}`-style holes in a phrase. */
|
|
31
|
+
export function fill(phrase, values) {
|
|
32
|
+
return phrase.replace(/\{(\w+)\}/g, (hole, key) => (key in values ? String(values[key]) : hole));
|
|
33
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,102 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@johnmorrisdotca/taisen-brackets",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Taisen \u5bfe\u6226, knockout brackets as SVG: from a list of ties (games, best-of series, two legs, replays, byes, a third-place match) it works out the rounds and halves and draws the bracket with the halves meeting at the final, or left to right, wide, square or for a phone, in light, dark or a gold-on-navy poster look, with each team's logo or round flag, the champion in the centre, and an accessible table. NHL, NBA, MLB, NFL, CFL and World Cup formats by era. Zero dependencies.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"bracket",
|
|
7
|
+
"tournament",
|
|
8
|
+
"knockout",
|
|
9
|
+
"playoffs",
|
|
10
|
+
"single-elimination",
|
|
11
|
+
"tournament-bracket",
|
|
12
|
+
"svg",
|
|
13
|
+
"world-cup",
|
|
14
|
+
"stanley-cup",
|
|
15
|
+
"nhl",
|
|
16
|
+
"nba",
|
|
17
|
+
"mlb",
|
|
18
|
+
"nfl",
|
|
19
|
+
"cfl",
|
|
20
|
+
"soccer",
|
|
21
|
+
"sports",
|
|
22
|
+
"visualization",
|
|
23
|
+
"accessible",
|
|
24
|
+
"dark-mode",
|
|
25
|
+
"typescript",
|
|
26
|
+
"javascript",
|
|
27
|
+
"zero-dependencies",
|
|
28
|
+
"browser",
|
|
29
|
+
"node",
|
|
30
|
+
"itsutsu"
|
|
31
|
+
],
|
|
32
|
+
"homepage": "https://johnmorrisdotca.github.io/taisen-brackets/",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/johnmorrisdotca/taisen-brackets.git"
|
|
36
|
+
},
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/johnmorrisdotca/taisen-brackets/issues"
|
|
39
|
+
},
|
|
40
|
+
"author": "John Morris",
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"type": "module",
|
|
43
|
+
"sideEffects": false,
|
|
44
|
+
"main": "./dist/index.js",
|
|
45
|
+
"module": "./dist/index.js",
|
|
46
|
+
"types": "./dist/index.d.ts",
|
|
47
|
+
"exports": {
|
|
48
|
+
".": {
|
|
49
|
+
"types": "./dist/index.d.ts",
|
|
50
|
+
"import": "./dist/index.js",
|
|
51
|
+
"default": "./dist/index.js"
|
|
52
|
+
},
|
|
53
|
+
"./layout": {
|
|
54
|
+
"types": "./dist/layout-entry.d.ts",
|
|
55
|
+
"import": "./dist/layout-entry.js",
|
|
56
|
+
"default": "./dist/layout-entry.js"
|
|
57
|
+
},
|
|
58
|
+
"./presets": {
|
|
59
|
+
"types": "./dist/presets-entry.d.ts",
|
|
60
|
+
"import": "./dist/presets-entry.js",
|
|
61
|
+
"default": "./dist/presets-entry.js"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"files": [
|
|
65
|
+
"dist",
|
|
66
|
+
"README.md",
|
|
67
|
+
"LICENSE",
|
|
68
|
+
"NOTICE.md",
|
|
69
|
+
"CHANGELOG.md"
|
|
70
|
+
],
|
|
71
|
+
"engines": {
|
|
72
|
+
"node": ">=22"
|
|
73
|
+
},
|
|
74
|
+
"scripts": {
|
|
75
|
+
"build": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && tsc -p tsconfig.json",
|
|
76
|
+
"lint": "eslint .",
|
|
77
|
+
"typecheck": "tsc -p tsconfig.check.json",
|
|
78
|
+
"test": "node --test test/*.test.ts",
|
|
79
|
+
"test:package": "pnpm build && node scripts/check-package.mjs",
|
|
80
|
+
"test:readme": "pnpm build && node scripts/make-formats-doc.mjs --check && node scripts/check-readme-examples.mjs",
|
|
81
|
+
"check": "pnpm lint && pnpm typecheck && pnpm test && pnpm build && node scripts/check-package.mjs",
|
|
82
|
+
"prepublishOnly": "pnpm check",
|
|
83
|
+
"dev": "pnpm build && node scripts/dev.mjs",
|
|
84
|
+
"flags": "node scripts/make-flags.mjs",
|
|
85
|
+
"site": "pnpm build && node scripts/site.mjs",
|
|
86
|
+
"test:demo": "pnpm site && playwright test",
|
|
87
|
+
"screenshots": "pnpm site && node scripts/screenshots.mjs"
|
|
88
|
+
},
|
|
89
|
+
"devDependencies": {
|
|
90
|
+
"@eslint/js": "^9.0.0",
|
|
91
|
+
"@johnmorrisdotca/hata": "1.5.0",
|
|
92
|
+
"@playwright/test": "^1.63.0",
|
|
93
|
+
"@types/node": "^24.0.0",
|
|
94
|
+
"eslint": "^9.0.0",
|
|
95
|
+
"typescript": "^5.9.0",
|
|
96
|
+
"typescript-eslint": "^8.0.0"
|
|
97
|
+
},
|
|
98
|
+
"publishConfig": {
|
|
99
|
+
"access": "public"
|
|
100
|
+
},
|
|
101
|
+
"packageManager": "pnpm@10.11.0"
|
|
102
|
+
}
|