Skip to content

Commit

Permalink
fix(wrangler): broken link in cli (#5616)
Browse files Browse the repository at this point in the history
* fix: broken link

* chore: add changeset

* fixup! fix: broken link

* lock down locale for rendering lists

This potentially causes CI failures if the job runs in a different locale

---------

Co-authored-by: Peter Bacon Darwin <pbacondarwin@cloudflare.com>
  • Loading branch information
webbertakken and petebacondarwin committed Apr 19, 2024
1 parent e39e9ff commit c6312b5
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 28 deletions.
5 changes: 5 additions & 0 deletions .changeset/rare-papayas-divide.md
@@ -0,0 +1,5 @@
---
"wrangler": patch
---

fix: broken link to durable object migrations docs
2 changes: 1 addition & 1 deletion packages/wrangler/src/__tests__/configuration.test.ts
Expand Up @@ -994,7 +994,7 @@ describe("normalizeAndValidateConfig()", () => {
new_classes = [\\"CLASS1\\"]
\`\`\`
Refer to https://developers.cloudflare.com/workers/learning/using-durable-objects/#durable-object-migrations-in-wranglertoml for more details."
Refer to https://developers.cloudflare.com/durable-objects/reference/durable-objects-migrations/ for more details."
`);
});

Expand Down
4 changes: 2 additions & 2 deletions packages/wrangler/src/__tests__/deploy.test.ts
Expand Up @@ -5080,8 +5080,8 @@ addEventListener('fetch', event => {});`
\`\`\`
Refer to
[4mhttps://developers.cloudflare.com/workers/learning/using-durable-objects/#durable-object-migrations-in-wranglertoml[0m
for more details.
[4mhttps://developers.cloudflare.com/durable-objects/reference/durable-objects-migrations/[0m for more
details.
"
`);
Expand Down
40 changes: 20 additions & 20 deletions packages/wrangler/src/__tests__/dev.test.tsx
Expand Up @@ -1087,33 +1087,33 @@ describe("wrangler dev", () => {
- NAME_4: CLASS_4 (defined in SCRIPT_B)"
`);
expect(std.warn).toMatchInlineSnapshot(`
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mProcessing wrangler.toml configuration:[0m
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mProcessing wrangler.toml configuration:[0m
- In wrangler.toml, you have configured [durable_objects] exported by this Worker (CLASS_1,
CLASS_3), but no [migrations] for them. This may not work as expected until you add a [migrations]
section to your wrangler.toml. Add this configuration to your wrangler.toml:
- In wrangler.toml, you have configured [durable_objects] exported by this Worker (CLASS_1,
CLASS_3), but no [migrations] for them. This may not work as expected until you add a [migrations]
section to your wrangler.toml. Add this configuration to your wrangler.toml:
\`\`\`
[[migrations]]
tag = \\"v1\\" # Should be unique for each entry
new_classes = [\\"CLASS_1\\", \\"CLASS_3\\"]
\`\`\`
\`\`\`
[[migrations]]
tag = \\"v1\\" # Should be unique for each entry
new_classes = [\\"CLASS_1\\", \\"CLASS_3\\"]
\`\`\`
Refer to
[4mhttps://developers.cloudflare.com/workers/learning/using-durable-objects/#durable-object-migrations-in-wranglertoml[0m
for more details.
Refer to
[4mhttps://developers.cloudflare.com/durable-objects/reference/durable-objects-migrations/[0m for more
details.
[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mWARNING: You have Durable Object bindings that are not defined locally in the worker being developed.[0m
[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mWARNING: You have Durable Object bindings that are not defined locally in the worker being developed.[0m
Be aware that changes to the data stored in these Durable Objects will be permanent and affect the
live instances.
Remote Durable Objects that are affected:
- {\\"name\\":\\"NAME_2\\",\\"class_name\\":\\"CLASS_2\\",\\"script_name\\":\\"SCRIPT_A\\"}
- {\\"name\\":\\"NAME_4\\",\\"class_name\\":\\"CLASS_4\\",\\"script_name\\":\\"SCRIPT_B\\"}
Be aware that changes to the data stored in these Durable Objects will be permanent and affect the
live instances.
Remote Durable Objects that are affected:
- {\\"name\\":\\"NAME_2\\",\\"class_name\\":\\"CLASS_2\\",\\"script_name\\":\\"SCRIPT_A\\"}
- {\\"name\\":\\"NAME_4\\",\\"class_name\\":\\"CLASS_4\\",\\"script_name\\":\\"SCRIPT_B\\"}
"
`);
"
`);
expect(std.err).toMatchInlineSnapshot(`""`);
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/config-cache.ts
Expand Up @@ -24,7 +24,7 @@ function getCacheFolder() {
return __cacheFolder;
}

const arrayFormatter = new Intl.ListFormat("en", {
const arrayFormatter = new Intl.ListFormat("en-US", {
style: "long",
type: "conjunction",
});
Expand Down
4 changes: 2 additions & 2 deletions packages/wrangler/src/config/validation.ts
Expand Up @@ -39,7 +39,7 @@ import type {
} from "./environment";
import type { ValidatorFn } from "./validation-helpers";

const ENGLISH = new Intl.ListFormat("en");
const ENGLISH = new Intl.ListFormat("en-US");

export function isPagesConfig(rawConfig: RawConfig): boolean {
return rawConfig.pages_build_output_dir !== undefined;
Expand Down Expand Up @@ -625,7 +625,7 @@ function normalizeAndValidateMigrations(
.join(", ")}]
\`\`\`
Refer to https://developers.cloudflare.com/workers/learning/using-durable-objects/#durable-object-migrations-in-wranglertoml for more details.`
Refer to https://developers.cloudflare.com/durable-objects/reference/durable-objects-migrations/ for more details.`
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/init.ts
Expand Up @@ -779,7 +779,7 @@ async function installPackages(
//lets install the devDeps they asked for
//and run their package manager's install command if needed
if (depsToInstall.length > 0) {
const formatter = new Intl.ListFormat("en", {
const formatter = new Intl.ListFormat("en-US", {
style: "long",
type: "conjunction",
});
Expand Down
4 changes: 3 additions & 1 deletion packages/wrangler/src/versions/deploy.ts
Expand Up @@ -186,7 +186,9 @@ export async function versionsDeployHandler(args: VersionsDeployArgs) {
const trafficSummaryList = Array.from(confirmedVersionTraffic).map(
([versionId, percentage]) => `version ${versionId} at ${percentage}%`
);
const trafficSummaryString = new Intl.ListFormat().format(trafficSummaryList);
const trafficSummaryString = new Intl.ListFormat("en-US").format(
trafficSummaryList
);

cli.success(
`Deployed ${workerName} ${trafficSummaryString} (${elapsedString})`
Expand Down

0 comments on commit c6312b5

Please sign in to comment.