Repository navigation
feat: prepare cf 1.0 release candidate #634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a2d82d2
feat: prepare cf 1.0 release candidate
petebacondarwin b577c90
fix: start new prerelease channels at zero
petebacondarwin d60e258
docs: simplify release candidate changeset
petebacondarwin a92d0c6
docs: clarify first release candidate changeset
petebacondarwin 7daaff3
Apply suggestion from @edmundhung
petebacondarwin 831eb60
docs: update remaining release candidate references
petebacondarwin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| "cf": minor | ||
| --- | ||
|
|
||
| Release the first cf 1.0 release candidate. | ||
|
|
||
| Publish 1.0.0-rc.0 and update the installation and publishing guidance | ||
| for the release candidate channel. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| # Security Policy | ||
|
|
||
| > [!IMPORTANT] | ||
| > Cloudflare cf is in a beta state and is under active, rapid development. | ||
| > Cloudflare cf is a release candidate and is under active, rapid development. | ||
| > Please treat any deployment as experimental and do not rely on it for production security guarantees. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| Hi @{author}. Thanks for contributing to `cf`! | ||
|
|
||
| During the open beta, we’re being very intentional about the changes we accept so that we can prioritise stability for GA. We’re limiting pull requests to contributions coordinated with the team in advance, so this PR has been automatically closed. | ||
| During the release candidate phase, we’re being very intentional about the changes we accept so that we can prioritise stability for GA. We’re limiting pull requests to contributions coordinated with the team in advance, so this PR has been automatically closed. | ||
|
|
||
| We’d still love to hear about your use case, so please make sure it’s captured in a [`cf` issue](https://github.com/cloudflare/cf/issues). If the proposed change fits our priorities, we’d be happy to take another look at this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import { existsSync, readFileSync, writeFileSync } from "node:fs"; | ||
|
|
||
| const preStatePath = ".changeset/pre.json"; | ||
| if (!existsSync(preStatePath)) { | ||
| process.exit(0); | ||
| } | ||
|
|
||
| const preState = JSON.parse(readFileSync(preStatePath, "utf8")); | ||
| if (preState.mode !== "pre") { | ||
| process.exit(0); | ||
| } | ||
|
|
||
| const packagePath = "packages/cli/package.json"; | ||
| const packageJson = JSON.parse(readFileSync(packagePath, "utf8")); | ||
| const separator = packageJson.version.indexOf("-"); | ||
| if (separator === -1) { | ||
| process.exit(0); | ||
| } | ||
|
|
||
| const prerelease = packageJson.version.slice(separator + 1).split("+")[0]; | ||
| if (prerelease.replace(/\.\d+$/, "") === preState.tag) { | ||
| process.exit(0); | ||
| } | ||
|
|
||
| // Changesets increments the numeric suffix even when the channel changes. | ||
| // An unnumbered prerelease makes its next version start at zero. | ||
| packageJson.version = `${packageJson.version.slice(0, separator)}-${preState.tag}`; | ||
| writeFileSync(packagePath, `${JSON.stringify(packageJson, null, "\t")}\n`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| import assert from "node:assert/strict"; | ||
| import { execFileSync } from "node:child_process"; | ||
| import { | ||
| mkdirSync, | ||
| mkdtempSync, | ||
| readFileSync, | ||
| rmSync, | ||
| writeFileSync, | ||
| } from "node:fs"; | ||
| import { tmpdir } from "node:os"; | ||
| import { join } from "node:path"; | ||
| import { test } from "node:test"; | ||
| import { fileURLToPath } from "node:url"; | ||
|
|
||
| const prepareScript = fileURLToPath( | ||
| new URL("./prepare-prerelease.mjs", import.meta.url) | ||
| ); | ||
| const changesetCli = fileURLToPath( | ||
| new URL("../bin.js", import.meta.resolve("@changesets/cli")) | ||
| ); | ||
|
|
||
| for (const { version, tag, expected } of [ | ||
| { version: "1.0.0-beta.32", tag: "rc", expected: "1.0.0-rc.0" }, | ||
| { version: "1.0.0-rc.0", tag: "rc", expected: "1.0.0-rc.1" }, | ||
| { version: "1.0.0-rc.33", tag: "rc", expected: "1.0.0-rc.34" }, | ||
| { version: "1.0.0-beta.32", tag: "beta", expected: "1.0.0-beta.33" }, | ||
| { version: "0.14.0", tag: "rc", expected: "0.15.0-rc.0" }, | ||
| ]) { | ||
| await test(`versions ${version} on ${tag} as ${expected}`, (context) => { | ||
| const cwd = mkdtempSync(join(tmpdir(), "cf-prerelease-")); | ||
| context.after(() => rmSync(cwd, { recursive: true, force: true })); | ||
| mkdirSync(join(cwd, ".changeset")); | ||
| mkdirSync(join(cwd, "packages/cli"), { recursive: true }); | ||
| const writeJson = (path: string, value: unknown) => | ||
| writeFileSync(join(cwd, path), `${JSON.stringify(value)}\n`); | ||
| writeJson("package.json", { | ||
| name: "cf-release-test", | ||
| private: true, | ||
| workspaces: ["packages/*"], | ||
| }); | ||
| writeJson("packages/cli/package.json", { name: "cf", version }); | ||
| writeJson(".changeset/config.json", { changelog: false }); | ||
| writeJson(".changeset/pre.json", { | ||
| mode: "pre", | ||
| tag, | ||
| initialVersions: { cf: "0.14.0" }, | ||
| changesets: [], | ||
| }); | ||
| writeFileSync( | ||
| join(cwd, ".changeset/release.md"), | ||
| '---\n"cf": minor\n---\n\nPrepare the release\n' | ||
| ); | ||
|
|
||
| execFileSync(process.execPath, [prepareScript], { cwd }); | ||
| execFileSync(process.execPath, [changesetCli, "version"], { | ||
| cwd, | ||
| stdio: "pipe", | ||
| }); | ||
|
|
||
| const updated = JSON.parse( | ||
| readFileSync(join(cwd, "packages/cli/package.json"), "utf8") | ||
| ); | ||
| assert.equal(updated.version, expected); | ||
| }); | ||
| } | ||
|
|
||
| for (const preState of [undefined, { mode: "exit", tag: "rc" }]) { | ||
| await test(`leaves versions alone with prerelease state ${JSON.stringify(preState)}`, (context) => { | ||
| const cwd = mkdtempSync(join(tmpdir(), "cf-prerelease-")); | ||
| context.after(() => rmSync(cwd, { recursive: true, force: true })); | ||
| mkdirSync(join(cwd, "packages/cli"), { recursive: true }); | ||
| const manifest = '{"name":"cf","version":"1.0.0-beta.32"}\n'; | ||
| writeFileSync(join(cwd, "packages/cli/package.json"), manifest); | ||
| if (preState) { | ||
| mkdirSync(join(cwd, ".changeset")); | ||
| writeFileSync(join(cwd, ".changeset/pre.json"), JSON.stringify(preState)); | ||
| } | ||
|
|
||
| execFileSync(process.execPath, [prepareScript], { cwd }); | ||
|
|
||
| assert.equal( | ||
| readFileSync(join(cwd, "packages/cli/package.json"), "utf8"), | ||
| manifest | ||
| ); | ||
| }); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.