Skip to content

Commit f52843e

Browse files
committed
fix: use a user plugin schema redirect that makes more sense
1 parent 8399bc7 commit f52843e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Then your redirect urls will look like:
1717

1818
```
1919
https://plugins.dprint.dev/<username>/<repo_name>-<tag_name>.wasm
20-
https://plugins.dprint.dev/schemas/<username>/<repo_name>-<tag_name>.json
20+
https://plugins.dprint.dev/<username>/<repo_name>-<tag_name>/schema.json
2121
```
2222

2323
Restrictions and recommendations:

plugins.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,28 +177,28 @@ Deno.test("tryResolveSchemaUrl", async () => {
177177

178178
assertEquals(
179179
await tryResolveSchemaUrl(
180-
new URL("https://plugins.dprint.dev/schemas/dprint/typescript-1.2.3.json"),
180+
new URL("https://plugins.dprint.dev/dprint/typescript-1.2.3/schema.json"),
181181
),
182182
"https://github.com/dprint/dprint-plugin-typescript/releases/download/1.2.3/schema.json",
183183
);
184184

185185
assertEquals(
186186
await tryResolveSchemaUrl(
187-
new URL("https://plugins.dprint.dev/schemas/dprint/dprint-plugin-typescript-1.2.3.json"),
187+
new URL("https://plugins.dprint.dev/dprint/dprint-plugin-typescript-1.2.3/schema.json"),
188188
),
189189
"https://github.com/dprint/dprint-plugin-typescript/releases/download/1.2.3/schema.json",
190190
);
191191

192192
assertEquals(
193193
await tryResolveSchemaUrl(
194-
new URL("https://plugins.dprint.dev/schemas/dprint/dprint-plugin-typescript-latest.json"),
194+
new URL("https://plugins.dprint.dev/dprint/dprint-plugin-typescript-latest/schema.json"),
195195
),
196196
"https://github.com/dprint/dprint-plugin-typescript/releases/latest/download/schema.json",
197197
);
198198

199199
assertEquals(
200200
await tryResolveSchemaUrl(
201-
new URL("https://plugins.dprint.dev/schemas/dprint/non-existent-1.2.3.json"),
201+
new URL("https://plugins.dprint.dev/dprint/non-existent-1.2.3/schema.json"),
202202
),
203203
"https://github.com/dprint/non-existent/releases/download/1.2.3/schema.json",
204204
);

plugins.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ const userWasmPluginPattern = new URLPattern({
132132
pathname: `/${userRepoTagPattern}.wasm`,
133133
});
134134
const userSchemaPattern = new URLPattern({
135-
pathname: `/schemas/${userRepoTagPattern}.json`,
135+
pathname: `/${userRepoTagPattern}/schema.json`,
136136
});
137137

138138
function tryResolveUserWasmPlugin(url: URL) {

0 commit comments

Comments
 (0)