Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat: publishing flow for alpha #124

Closedt3dotgg(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromtheo/publish-alphaopened View on GitHub

Add alpha publishing flow and update CodexAppServerManager.startSession to send version from apps/server/package.json

Introduce version:alpha and publish:alpha scripts with a new scripts/publish-alpha.mjs and scripts/version-alpha.mjs; bump server to 0.1.0-alpha.1; read server version in CodexAppServerManager.startSession via serverPackage.version in apps/server/src/codexAppServerManager.ts.

📍Where to Start

Start with the alpha versioning logic in scripts/version-alpha.mjs, then the publish flow in scripts/publish-alpha.mjs, and finally the version read in CodexAppServerManager.startSession in apps/server/src/codexAppServerManager.ts.

📊 Macroscope summarized 67ea600. 3 files reviewed, 2 issues evaluated, 0 issues filtered, 1 comment posted

🗂️ Filtered Issues

    1. Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Post copyable unit tests in a comment
      • Commit unit tests in branch `theo/publish-alpha`

      Comment `@coderabbitai help` to get the list of available commands and usage tips.
    2. @@ -0,0 +1,16 @@
      1+import { readFileSync, writeFileSync } from "node:fs";
      2+import { fileURLToPath } from "node:url";
      3+
      4+const packageJsonPath = fileURLToPath(new URL("../apps/server/package.json", import.meta.url));
      5+const args = process.argv.slice(2);
      6+const dryRun = args.includes("--dry-run");
      7+const versionArg = args.find((arg) => arg !== "--dry-run");
      8+
      9+const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
      10+const currentVersion = packageJson.version;
      11+
      12+const alphaVersionPattern = /^\d+\.\d+\.\d+-alpha\.\d+$/;
      13+const alphaCounterPattern = /^(?<base>\d+\.\d+\.\d+)-alpha\.(?<counter>\d+)$/;
      14+
      15+function nextAlphaVersion(version) {
      16+ const alphaMatch = version.match(alphaCounterPattern);
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟢 Low scripts/version-alpha.mjs:15

      If version is undefined (missing from package.json), calling version.match() throws a TypeError. Consider adding a guard at the start of the function to check for this.

       function nextAlphaVersion(version) {
      +  if (typeof version !== "string") {
      +    throw new Error("Missing or invalid version field in package.json.");
      +  }
         const alphaMatch = version.match(alphaCounterPattern);
      🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
      In file scripts/version-alpha.mjs around lines 15-16:
      
      If `version` is `undefined` (missing from `package.json`), calling `version.match()` throws a `TypeError`. Consider adding a guard at the start of the function to check for this.
      
      Evidence trail:
      scripts/version-alpha.mjs lines 10, 15-16, 31 at REVIEWED_COMMIT - `currentVersion = packageJson.version` (line 10), `nextAlphaVersion(version)` function calls `version.match(alphaCounterPattern)` (line 16), and `nextAlphaVersion(currentVersion)` is called via nullish coalescing (line 31). If package.json lacks a version field, currentVersion is undefined, and undefined.match() throws TypeError.
    3. juliusmarminge closed this

Sign in to join this conversation.