fairy-ring 0.2.0 → 0.2.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/README.md CHANGED
@@ -36,12 +36,31 @@ use bleeding-edge web tooling to deliver a simple and fun developer and user exp
36
36
 
37
37
  ## development
38
38
 
39
- Install:
39
+ Install [nvm](https://github.com/nvm-sh/nvm), then (in a new shell) the node version from `.nvmrc`:
40
+
41
+ ```bash
42
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.41.0/install.sh | bash
43
+ nvm install
44
+ ```
45
+
46
+ Install pnpm with corepack (uses the version in `package.json`'s `packageManager`):
47
+
48
+ ```bash
49
+ corepack enable pnpm
50
+ ```
51
+
52
+ Install dependencies:
40
53
 
41
54
  ```bash
42
55
  pnpm i
43
56
  ```
44
57
 
58
+ Check changes before opening a PR (build, typecheck, lint, format):
59
+
60
+ ```bash
61
+ pnpm pr-check
62
+ ```
63
+
45
64
  Run storybook:
46
65
 
47
66
  ```bash
@@ -0,0 +1,171 @@
1
+ {
2
+ "title": "fairy-ring config",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "configVersion": {
7
+ "anyOf": [
8
+ {
9
+ "type": "number",
10
+ "const": 1
11
+ }
12
+ ],
13
+ "description": "config schema version"
14
+ },
15
+ "name": {
16
+ "description": "name of this webring. include in a string with {{name}}.",
17
+ "$ref": "#/$defs/LocString"
18
+ },
19
+ "homeText": {
20
+ "default": {
21
+ "und": "{{name}}"
22
+ },
23
+ "description": "text that links to the homepage. defaults to \"{{name}}\".",
24
+ "$ref": "#/$defs/LocString"
25
+ },
26
+ "homeUrl": {
27
+ "description": "a homepage for the webring, if one exists",
28
+ "type": "string",
29
+ "format": "uri"
30
+ },
31
+ "sites": {
32
+ "type": "array",
33
+ "items": {
34
+ "$ref": "#/$defs/Site"
35
+ },
36
+ "description": "list sites in the webring"
37
+ },
38
+ "strings": {
39
+ "description": "overrides for built-in translations",
40
+ "default": {},
41
+ "$ref": "#/$defs/Strings"
42
+ }
43
+ },
44
+ "required": [
45
+ "configVersion",
46
+ "name",
47
+ "sites"
48
+ ],
49
+ "$defs": {
50
+ "LocString": {
51
+ "type": "object",
52
+ "propertyNames": {
53
+ "type": "string",
54
+ "title": "language"
55
+ },
56
+ "additionalProperties": {
57
+ "type": "string",
58
+ "description": "translation for a BCP 47 language tag, e.g. \"en\", \"en-US\""
59
+ },
60
+ "description": "maps language tag -> translation"
61
+ },
62
+ "Site": {
63
+ "type": "object",
64
+ "properties": {
65
+ "url": {
66
+ "type": "string",
67
+ "format": "uri",
68
+ "description": "where to link to"
69
+ },
70
+ "scope": {
71
+ "type": "string",
72
+ "enum": [
73
+ "host",
74
+ "path"
75
+ ],
76
+ "description": "what part of this link does the site own? \"host\": all of my.example.com. \"path\": just sub-paths of my.example.com/path, not my.example.com/other"
77
+ }
78
+ },
79
+ "required": [
80
+ "url",
81
+ "scope"
82
+ ]
83
+ },
84
+ "Strings": {
85
+ "type": "object",
86
+ "properties": {
87
+ "next": {
88
+ "default": {
89
+ "en": "next",
90
+ "es": "siguiente",
91
+ "pt": "próximo",
92
+ "fr": "suivant",
93
+ "de": "weiter",
94
+ "it": "successivo",
95
+ "nl": "volgende",
96
+ "pl": "następna",
97
+ "ru": "следующий",
98
+ "uk": "наступний",
99
+ "tr": "sonraki",
100
+ "ar": "التالي",
101
+ "hi": "अगला",
102
+ "bn": "পরবর্তী",
103
+ "id": "berikutnya",
104
+ "vi": "tiếp theo",
105
+ "th": "ถัดไป",
106
+ "ja": "次へ",
107
+ "ko": "다음",
108
+ "zh": "下一个",
109
+ "zh-TW": "下一個"
110
+ },
111
+ "description": "link to the next site",
112
+ "$ref": "#/$defs/LocString"
113
+ },
114
+ "previous": {
115
+ "default": {
116
+ "en": "previous",
117
+ "es": "anterior",
118
+ "pt": "anterior",
119
+ "fr": "précédent",
120
+ "de": "zurück",
121
+ "it": "precedente",
122
+ "nl": "vorige",
123
+ "pl": "poprzednia",
124
+ "ru": "предыдущий",
125
+ "uk": "попередній",
126
+ "tr": "önceki",
127
+ "ar": "السابق",
128
+ "hi": "पिछला",
129
+ "bn": "পূর্ববর্তী",
130
+ "id": "sebelumnya",
131
+ "vi": "trước",
132
+ "th": "ก่อนหน้า",
133
+ "ja": "前へ",
134
+ "ko": "이전",
135
+ "zh": "上一个",
136
+ "zh-TW": "上一個"
137
+ },
138
+ "description": "link to the previous site",
139
+ "$ref": "#/$defs/LocString"
140
+ },
141
+ "random": {
142
+ "default": {
143
+ "en": "random",
144
+ "es": "aleatorio",
145
+ "pt": "aleatório",
146
+ "fr": "aléatoire",
147
+ "de": "zufällig",
148
+ "it": "casuale",
149
+ "nl": "willekeurig",
150
+ "pl": "losowa",
151
+ "ru": "случайный",
152
+ "uk": "випадковий",
153
+ "tr": "rastgele",
154
+ "ar": "عشوائي",
155
+ "hi": "रैंडम",
156
+ "bn": "এলোমেলো",
157
+ "id": "acak",
158
+ "vi": "ngẫu nhiên",
159
+ "th": "สุ่ม",
160
+ "ja": "ランダム",
161
+ "ko": "무작위",
162
+ "zh": "随机",
163
+ "zh-TW": "隨機"
164
+ },
165
+ "description": "link to a random site",
166
+ "$ref": "#/$defs/LocString"
167
+ }
168
+ }
169
+ }
170
+ }
171
+ }
package/dist/lib.d.ts CHANGED
@@ -37,7 +37,10 @@ export type GetConfigOptions = {
37
37
  init?: RequestInit | undefined;
38
38
  };
39
39
  export declare function fetchConfig({ url, init }: GetConfigOptions): Promise<Config>;
40
- export declare function logConfigErrors(promise: Promise<Config>, log?: (...data: any[]) => void): Promise<Config>;
40
+ export declare function logConfigErrors(promise: Promise<Config>, log?: {
41
+ (...data: any[]): void;
42
+ (message?: any, ...optionalParams: any[]): void;
43
+ }): Promise<Config>;
41
44
  /** match against the configured sites; if this is one of them, return [Site, index]; else, return null */
42
45
  export declare function getCurrent(config: Config): [Site, number] | null;
43
46
  export declare function getNext(config: Config): Site | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fairy-ring",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "repository": {
@@ -40,6 +40,7 @@
40
40
  "types": "./dist/solid.d.ts",
41
41
  "default": "./dist/solid.js"
42
42
  },
43
+ "./config.schema.json": "./dist/config.schema.json",
43
44
  "./package.json": "./package.json"
44
45
  },
45
46
  "dependencies": {
@@ -53,6 +54,7 @@
53
54
  "@storybook/addon-docs": "10.6.7",
54
55
  "@storybook/addon-vitest": "^10.6.7",
55
56
  "@storybook/web-components-vite": "^10.6.7",
57
+ "@types/node": "^24.19.2",
56
58
  "@types/react": "^19.3.0",
57
59
  "@vitest/browser-playwright": "^5.1.1",
58
60
  "highlight.js": "^11.12.0",
@@ -85,9 +87,9 @@
85
87
  }
86
88
  },
87
89
  "scripts": {
88
- "build": "tsdown",
90
+ "build": "tsdown && node scripts/schema.ts",
89
91
  "dev": "storybook dev -p 6006",
90
- "pr-check": "pnpm typecheck && pnpm lint && pnpm format:check && pnpm build",
92
+ "pr-check": "pnpm build && pnpm typecheck && pnpm lint && pnpm format:check",
91
93
  "typecheck": "tsc --noEmit",
92
94
  "lint": "oxlint",
93
95
  "format": "oxfmt",