Skip to content

Group read+build+upload into one linkable block; rename script#2

Merged
socksy merged 1 commit into
mainfrom
readme-improvements
Apr 23, 2026
Merged

Group read+build+upload into one linkable block; rename script#2
socksy merged 1 commit into
mainfrom
readme-improvements

Conversation

@socksy
Copy link
Copy Markdown
Contributor

@socksy socksy commented Apr 23, 2026

Reorders the script so reading the files, building the bundle, and uploading sit together as a single block a reader can link to — so the README can point at one contiguous demonstration of using tower-package-wasm end-to-end.

Also renames the npm script to deploy-and-run (it runs the app and streams logs, not just deploys) and retitles the README to match the repo name.

Summary by CodeRabbit

  • Documentation
    • Reframed README as an "example-typescript-packaging" guide covering packaging, deployment, running, and log streaming
    • Condensed client-generation and run instructions; added expected console output examples
  • Refactor
    • Reordered runtime flow so app existence is validated earlier in the process
  • Chores
    • Renamed npm script deploydeploy-and-run (command behavior unchanged)

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 833c0606-5623-4823-8312-8e3acf97fd05

📥 Commits

Reviewing files that changed from the base of the PR and between e9b5677 and 0becec1.

📒 Files selected for processing (3)
  • README.md
  • package.json
  • src/index.ts
✅ Files skipped from review due to trivial changes (1)
  • package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/index.ts

📝 Walkthrough

Walkthrough

Documentation refocused as an "example-typescript-packaging" guide describing packaging with tower-package-wasm, generating an OpenAPI client, deploying and running the packaged Python app, and streaming logs. The script src/index.ts now checks app existence (GET /apps/{name} → conditional POST) immediately after creating the typed API client, before reading files and building the package.

Changes

Cohort / File(s) Summary
Documentation
README.md
Reframed project as an example packaging workflow; condensed client-generation section (keeps npm run generate and src/generated/api.ts); replaced deploy run instructions with deploy-and-run, updated run steps and expected output block.
Control Flow
src/index.ts
Moved "ensure app exists" logic (GET /apps/{name} with runs=0, timezone=UTC; POST /apps if 404) to immediately after API client creation; removed prior duplicate check after package build; adjusted step-numbering comments.
NPM scripts
package.json
Renamed scripts.deploy → removed and added scripts.deploy-and-run with the same command (uses node --experimental-wasm-modules ... --import tsx ./src/index.ts).

Sequence Diagram(s)

sequenceDiagram
    participant CLI as CLI Script (src/index.ts)
    participant API as App API Server
    participant FS as Local FS / Packager
    participant Runner as Remote Runner / Logs

    CLI->>API: create typed OpenAPI client
    CLI->>API: GET /apps/{name}?runs=0&timezone=UTC
    alt 404 Not Found
        CLI->>API: POST /apps { is_externally_accessible: false }
        API-->>CLI: 201 Created
    else 200 OK
        API-->>CLI: 200 App metadata
    end
    CLI->>FS: read files, build deterministic tar.gz
    CLI->>API: POST /deploy (upload package)
    API-->>CLI: 200 Deployment accepted
    CLI->>API: POST /runs (start run)
    API-->>Runner: stream logs
    Runner-->>CLI: streamed logs output
Loading

Possibly related PRs

Suggested reviewers

  • bradhe

Poem

A rabbit hops through docs with glee,
Moves the check up, before the tree,
It packages, posts, then starts the run,
Streams the logs in lines of fun 🐇
Tiny hops, big tidy flow—what a spree!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'Group read+build+upload into one linkable block; rename script' is only tangentially related to the actual changes. The PR focuses on aligning README documentation with rewritten script behavior and renaming the example project, but the title emphasizes internal implementation details ('read+build+upload') that are not primary. Revise the title to highlight the main change: e.g., 'Align README with rewritten script behavior and rename example' or 'Update README to document packaging, deployment, and run workflow'.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch readme-improvements

Comment @coderabbitai help to get the list of available commands and usage tips.

@socksy socksy force-pushed the readme-improvements branch from 83fc4f6 to 0b27ba8 Compare April 23, 2026 16:36
@socksy socksy changed the base branch from simplify-as-tutorial to main April 23, 2026 16:36
@socksy socksy force-pushed the readme-improvements branch from 0b27ba8 to e9b5677 Compare April 23, 2026 16:41
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
README.md (1)

49-50: Prefer a stable link over line-number anchors.

The src/index.ts#L49-L97 anchor is brittle and can break on future edits. Linking to the file (or a section heading) is more durable.

Suggested fix
-exists, [read the files, build the bundle with `tower-package-wasm`, and
-upload them to the deploy endpoint](src/index.ts#L49-L97), then run the
+exists, [read the files, build the bundle with `tower-package-wasm`, and
+upload it to the deploy endpoint](src/index.ts), then run the
 app and stream its output.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 49 - 50, Replace the brittle line-number anchor in
the README link (currently pointing to src/index.ts#L49-L97) with a stable link
to the file or to a specific section heading in src/index.ts; update the link
text to point to src/index.ts (or a named heading/identifier in that file)
instead of using L49-L97 so future edits won't break the reference.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@README.md`:
- Around line 39-46: The fenced output block in README.md is missing a language
specifier and triggers MD040; update the triple-backtick fence for the shown
block (the multiline output starting with Created app "test-typescript-deploys".
and ending with Run `#1` complete.) to include a language token such as text
(e.g., ```text) so the code fence becomes a labeled block and resolves the lint
warning.

---

Nitpick comments:
In `@README.md`:
- Around line 49-50: Replace the brittle line-number anchor in the README link
(currently pointing to src/index.ts#L49-L97) with a stable link to the file or
to a specific section heading in src/index.ts; update the link text to point to
src/index.ts (or a named heading/identifier in that file) instead of using
L49-L97 so future edits won't break the reference.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 56096d46-c531-448a-9f22-7d4603385cba

📥 Commits

Reviewing files that changed from the base of the PR and between 1d1d82c and e9b5677.

📒 Files selected for processing (2)
  • README.md
  • src/index.ts

Comment thread README.md
Comment on lines +39 to +46
```
Created app "test-typescript-deploys".
Built package: 360 bytes, 1 app file(s).
Deployed app "test-typescript-deploys" version v1.
Started run #1.
hello from test-typescript-deploys
Run #1 complete.
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add a language to the fenced output block.

At Line 39, the fence has no language and triggers MD040.

Suggested fix
-```
+```text
 Created app "test-typescript-deploys".
 Built package: 360 bytes, 1 app file(s).
 Deployed app "test-typescript-deploys" version v1.
 Started run `#1`.
   hello from test-typescript-deploys
 Run `#1` complete.
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 39-39: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 39 - 46, The fenced output block in README.md is
missing a language specifier and triggers MD040; update the triple-backtick
fence for the shown block (the multiline output starting with Created app
"test-typescript-deploys". and ending with Run `#1` complete.) to include a
language token such as text (e.g., ```text) so the code fence becomes a labeled
block and resolves the lint warning.

@socksy socksy force-pushed the readme-improvements branch from e9b5677 to 0becec1 Compare April 23, 2026 16:47
@socksy socksy changed the title Align README with the rewritten script; rename title to repo Group read+build+upload into one linkable block; rename script Apr 23, 2026
@socksy socksy merged commit b5fb1e6 into main Apr 23, 2026
1 check passed
@socksy socksy deleted the readme-improvements branch April 23, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants