Add validation to the name field in configuration.#829
Conversation
🦋 Changeset detectedLatest commit: 7f82664 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/2229453510/npm-package-wrangler-829You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/829/npm-package-wrangler-829Or you can use npx https://prerelease-registry.developers.workers.dev/runs/2229453510/npm-package-wrangler-829 dev path/to/script.js |
|
Something to consider, environment names will be attached to worker names, in those cases we need to either validate the environment name in the same way or modify it programmatically. |
threepointone
left a comment
There was a problem hiding this comment.
Could you add a couple of tests for invalid worker names? With special characters, etc.
e503c09 to
613f527
Compare
613f527 to
bd26b23
Compare
|
|
||
| it("should error on invalid `name` value with special characters", () => { | ||
| const expectedConfig: RawEnvironment = { | ||
| name: "Thy'lek-Shran", |
e813633 to
088b2c1
Compare
088b2c1 to
7f82664
Compare
The validation will warn users that the field can only be "type string,
alphanumeric and lowercase with dashes only" using the same RegEx as the backend
resolves #795 #775