-
Notifications
You must be signed in to change notification settings - Fork 0
Rename packages/ to crates/ and svelte-test/ to packages/ui/ #26
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
base: main
Are you sure you want to change the base?
Conversation
- Rename packages/ to crates/ for Rust workspace crates - Move svelte-test/ to packages/ui/ - Rename UI package from "svelte-test" to "ui" - Update all path references in build scripts and configs
WalkthroughRepository layout updated: Rust workspace members moved from Changes
Sequence Diagram(s)(Skipped — changes are repository reorganization, not a new multi-component control flow.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom Pre-merge checks in the settings. Comment |
packages/ to crates/ and svelte-test/ to packages/ui/
packages/ to crates/ and svelte-test/ to packages/ui/Resolved version conflicts (0.0.1-alpha.10) in: - Cargo.lock - packages/ui/package.json - packages/ui/package-lock.json
There was a problem hiding this 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
🤖 Fix all issues with AI agents
In @packages/ui/package.json:
- Line 44: The dependency entry for "@rainlanguage/sqlite-web" is using the
wrong tarball name (missing the leading '@'); update the dependency value in
package.json to either reference the packed tarball with the correct name
"file:../../pkg/@rainlanguage-sqlite-web-0.0.1-alpha.10.tgz" or point to the
package directory "file:../../pkg/" so npm can resolve it; ensure the string for
the dependency key "@rainlanguage/sqlite-web" is preserved and run the build
(npm pack or the existing local-bundle.sh) to confirm the referenced tarball
name matches the file generated.
📜 Review details
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (2)
Cargo.lockis excluded by!**/*.lockpackages/ui/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (10)
crates/sqlite-web-core/Cargo.tomlcrates/sqlite-web-core/src/coordination.rscrates/sqlite-web-core/src/messages.rscrates/sqlite-web-core/src/worker.rscrates/sqlite-web/Cargo.tomlcrates/sqlite-web/src/tests.rscrates/sqlite-web/src/worker_template.rspackages/ui/package.jsonpackages/ui/src/routes/sql/+page.sveltepkg/package.json
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-09-17T06:55:20.178Z
Learnt from: CR
Repo: rainlanguage/sqlite-web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-09-17T06:55:20.178Z
Learning: Applies to svelte-test/package.json : In the Svelte test app, depend on the sqlite-web package via the locally packed tarball produced by npm pack
Applied to files:
packages/ui/package.json
📚 Learning: 2025-08-21T15:09:22.737Z
Learnt from: findolor
Repo: rainlanguage/sqlite-web PR: 2
File: flake.nix:59-68
Timestamp: 2025-08-21T15:09:22.737Z
Learning: In the sqlite-web project, the build-submodules task in flake.nix successfully builds the lib/rain.math.float submodule with `forge build` even if foundry.toml is not immediately visible in the expected location. The build process works as intended according to the project maintainer.
Applied to files:
packages/ui/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: test
- GitHub Check: test
🔇 Additional comments (2)
pkg/package.json (1)
15-15: LGTM! Formatting improvement.This trailing newline addition follows standard JSON formatting conventions with no functional impact.
packages/ui/package.json (1)
2-2: LGTM! Package name updated correctly.The package name change from "svelte-test" to "ui" aligns with the PR objectives and directory restructure.
| "dependencies": { | ||
| "@rainlanguage/float": "^0.0.0-alpha.22", | ||
| "@rainlanguage/sqlite-web": "file:../pkg/rainlanguage-sqlite-web-0.0.1-alpha.9.tgz" | ||
| "@rainlanguage/sqlite-web": "file:../../pkg/rainlanguage-sqlite-web-0.0.1-alpha.10.tgz" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify the tarball exists at the expected location
echo "=== Checking for tarball ==="
if [ -f "pkg/rainlanguage-sqlite-web-0.0.1-alpha.10.tgz" ]; then
echo "✓ Tarball exists at pkg/rainlanguage-sqlite-web-0.0.1-alpha.10.tgz"
ls -lh "pkg/rainlanguage-sqlite-web-0.0.1-alpha.10.tgz"
else
echo "✗ Tarball NOT found at pkg/rainlanguage-sqlite-web-0.0.1-alpha.10.tgz"
echo "Available files in pkg/:"
ls -la pkg/ 2>/dev/null || echo "pkg/ directory does not exist"
fi
# Search for any remaining references to "svelte-test" package name
echo -e "\n=== Checking for remaining 'svelte-test' references ==="
rg -n 'svelte-test' --type-list | head -20 2>/dev/null || echo "rg type list check"
rg -n 'svelte-test' -g '!CHANGELOG*' -g '!*.lock' -g '!node_modules' 2>/dev/null | head -50 || echo "No references found"
# Also check if svelte-test/package.json exists and what it depends on
echo -e "\n=== Checking svelte-test/package.json ==="
if [ -f "svelte-test/package.json" ]; then
echo "Found svelte-test/package.json"
grep -A2 -B2 "@rainlanguage/sqlite-web" svelte-test/package.json || echo "No @rainlanguage/sqlite-web dependency found"
else
echo "svelte-test/package.json not found"
fi
# Check packages/ui/package.json to confirm the path
echo -e "\n=== Checking packages/ui/package.json ==="
if [ -f "packages/ui/package.json" ]; then
grep -A2 -B2 "@rainlanguage/sqlite-web" packages/ui/package.json
fiRepository: rainlanguage/sqlite-web
Length of output: 1106
🏁 Script executed:
#!/bin/bash
# Check what's in pkg/package.json
echo "=== Content of pkg/package.json ==="
cat pkg/package.json
# Search for any .tgz files in the repository
echo -e "\n=== Searching for .tgz files ==="
fd -e tgz -type f
# Check if there's a build output or dist directory
echo -e "\n=== Checking for build artifacts ==="
ls -la packages/ui/ 2>/dev/null | head -20
echo "---"
ls -la packages/ 2>/dev/null | grep -v node_modules
# Check git status or recent changes
echo -e "\n=== Checking what's in packages/ui ==="
fd . packages/ui -type f -name "*.json" -o -name "*.tgz" | head -20Repository: rainlanguage/sqlite-web
Length of output: 2079
🏁 Script executed:
#!/bin/bash
# List all files in pkg/ directory recursively
echo "=== All files in pkg/ directory ==="
find pkg -type f -o -type d | sort
# Check if the built files exist
echo -e "\n=== Checking for built files in pkg/ ==="
ls -la pkg/*.wasm pkg/*.js pkg/*.d.ts 2>&1
# Look at the learning note - check if there are any scripts that should create the tarball
echo -e "\n=== Checking root and scripts ==="
head -50 package.json
# Check if there's a build or pack script
echo -e "\n=== Package scripts ==="
grep -A 10 '"scripts"' package.jsonRepository: rainlanguage/sqlite-web
Length of output: 532
🏁 Script executed:
#!/bin/bash
# Find all package.json files to understand the structure
echo "=== All package.json files ==="
find . -name "package.json" -type f | sort
# Check if there's a top-level configuration
echo -e "\n=== Top-level files ==="
ls -la | head -20
# Look at packages/ui/package.json to see all dependencies
echo -e "\n=== packages/ui/package.json full content ==="
cat packages/ui/package.json
# Check packages/ui/.npmrc or other configs
echo -e "\n=== npm/workspace configs ==="
ls -la packages/ui/Repository: rainlanguage/sqlite-web
Length of output: 3815
🏁 Script executed:
#!/bin/bash
# Check CLAUDE.md for context
echo "=== Content of CLAUDE.md ==="
cat CLAUDE.mdRepository: rainlanguage/sqlite-web
Length of output: 3822
🏁 Script executed:
#!/bin/bash
# Check if bundle.sh exists and what it does
echo "=== Content of bundle.sh ==="
cat bundle.sh 2>/dev/null || echo "bundle.sh not found"
# Also check for any other scripts
echo -e "\n=== Scripts directory ==="
ls -la scripts/
# Check git log to see if bundle.sh was recently changed
echo -e "\n=== Recent git changes to understand this PR ==="
git log --oneline -20Repository: rainlanguage/sqlite-web
Length of output: 421
🏁 Script executed:
#!/bin/bash
# Check local-bundle.sh
echo "=== Content of local-bundle.sh ==="
cat scripts/local-bundle.sh
# Check git diff to see what changed in this PR
echo -e "\n=== Recent git changes ==="
git log --oneline -5
git show --stat HEAD
# Check if there's any reference to the tarball name
echo -e "\n=== Searching for tarball references ==="
rg "rainlanguage-sqlite-web-0.0.1-alpha.10.tgz" -g "!.git"Repository: rainlanguage/sqlite-web
Length of output: 11452
🏁 Script executed:
#!/bin/bash
# Check how npm pack names scoped packages
# Look at pkg/package.json to see the actual name
echo "=== Package name in pkg/package.json ==="
jq '.name' pkg/package.json
# Simulate what npm pack would create
echo -e "\n=== Expected npm pack filename for scoped packages ==="
PKG_NAME=$(jq -r '.name' pkg/package.json)
PKG_VERSION=$(jq -r '.version' pkg/package.json)
echo "Package name: $PKG_NAME"
echo "Version: $PKG_VERSION"
echo "Expected npm pack filename: ${PKG_NAME#@}-${PKG_VERSION}.tgz"
echo "Which would be: @rainlanguage-sqlite-web-0.0.1-alpha.10.tgz"
# Check what's in git to see if bundle was run
echo -e "\n=== Check if pkg directory is tracked ==="
git ls-files pkg/ 2>/dev/null || echo "pkg/ not in git"
# See what's in git status
echo -e "\n=== Git status ==="
git status --short 2>/dev/null | head -20Repository: rainlanguage/sqlite-web
Length of output: 153
🏁 Script executed:
#!/bin/bash
# Just check the package name in pkg/package.json
echo "=== Package name ==="
grep '"name"' pkg/package.json
# Check git info
echo -e "\n=== Git status of packages/ui/package.json ==="
git diff packages/ui/package.json | head -30Repository: rainlanguage/sqlite-web
Length of output: 173
Fix incorrect tarball filename in dependency reference.
The dependency path references rainlanguage-sqlite-web-0.0.1-alpha.10.tgz, but this tarball does not exist and cannot be created with this filename. When npm pack runs on the scoped package @rainlanguage/sqlite-web, it generates @rainlanguage-sqlite-web-0.0.1-alpha.10.tgz (note the @ prefix). The current reference is missing the @ and will cause npm install to fail.
Either:
- Update the path to
file:../../pkg/@rainlanguage-sqlite-web-0.0.1-alpha.10.tgz, or - Reference the directory directly with
file:../../pkg/and let npm resolve the package.json
The local-bundle.sh script already handles this correctly by using npm pkg set dependencies."@rainlanguage/sqlite-web"="file:../../pkg/${PACK_FILE}" to dynamically set the correct filename. Run the build script to generate the tarball and update the reference properly.
🤖 Prompt for AI Agents
In @packages/ui/package.json at line 44, The dependency entry for
"@rainlanguage/sqlite-web" is using the wrong tarball name (missing the leading
'@'); update the dependency value in package.json to either reference the packed
tarball with the correct name
"file:../../pkg/@rainlanguage-sqlite-web-0.0.1-alpha.10.tgz" or point to the
package directory "file:../../pkg/" so npm can resolve it; ensure the string for
the dependency key "@rainlanguage/sqlite-web" is preserved and run the build
(npm pack or the existing local-bundle.sh) to confirm the referenced tarball
name matches the file generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a false positive. The tarball naming convention (without the @ prefix) has been this way since the project started and works correctly.
On main branch, the reference was:
"file:../pkg/rainlanguage-sqlite-web-0.0.1-alpha.9.tgz"
The only changes in this PR are:
- Path depth:
../pkg/→../../pkg/(due tosvelte-test/→packages/ui/move) - Version bump from the merge
The local-bundle.sh script produces rainlanguage-sqlite-web-*.tgz (without @), and npm install succeeds. No changes needed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@findolor, thank you for the clarification! You're absolutely right—I apologize for the false positive.
The tarball naming convention without the @ prefix has been working correctly in your project, and the changes in this PR (path depth adjustment from ../pkg/ to ../../pkg/ and the version bump) are appropriate given the directory restructuring from svelte-test/ to packages/ui/.
Since local-bundle.sh produces rainlanguage-sqlite-web-*.tgz and npm install succeeds with this naming, no changes are needed here. Thanks for taking the time to explain the existing behavior!
🧠 Learnings used
Learnt from: CR
Repo: rainlanguage/sqlite-web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-09-17T06:55:20.178Z
Learning: Applies to svelte-test/package.json : In the Svelte test app, depend on the sqlite-web package via the locally packed tarball produced by npm pack
Learnt from: CR
Repo: rainlanguage/sqlite-web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-09-17T06:55:20.178Z
Learning: Applies to packages/sqlite-web/embedded_worker.js : Do not manually edit embedded_worker.js; it is generated by the build and should be treated as read-only
Learnt from: CR
Repo: rainlanguage/sqlite-web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-09-17T06:55:20.178Z
Learning: Applies to packages/sqlite-web-core/src/database_functions.rs : Integrate and expose rain.math.float-backed custom database functions for SQLite queries
Learnt from: CR
Repo: rainlanguage/sqlite-web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-09-17T06:55:20.178Z
Learning: Applies to packages/sqlite-web/worker_template.rs : Ensure the worker JavaScript generated by worker_template.rs embeds the WASM (base64) and does not fetch external WASM files
Learnt from: findolor
Repo: rainlanguage/sqlite-web PR: 5
File: svelte-test/tests/database-functions/bigint-sum.test.ts:2-7
Timestamp: 2025-08-27T05:59:04.254Z
Learning: In the sqlite-web repository, the user prefers to keep .js extensions when importing TypeScript files in test files, even in Vitest environments. This is acceptable and should not be flagged as an issue.
Learnt from: findolor
Repo: rainlanguage/sqlite-web PR: 2
File: .github/workflows/npm-release.yaml:79-85
Timestamp: 2025-08-21T12:24:24.620Z
Learning: The rainlanguage organization uses workflows that commit pkg/package.json as part of their NPM release process across multiple repositories, and this pattern works fine for their setup.
Motivation
See issues:
/cratesand typescript logic to/packages#3The current directory structure does not align with our standard repository conventions. In our other Rust workspace repositories, we use
crates/for Rust workspace crates andpackages/for non-Rust packages (like frontend applications). This PR brings sqlite-web in line with that convention.Solution
Restructure the repository directories:
packages/tocrates/(contains Rust workspace crates: sqlite-web-core, sqlite-web)svelte-test/topackages/ui/and rename the package from "svelte-test" to "ui"Updated all path references in:
Cargo.toml(workspace members)scripts/local-bundle.sh,flake.nix)npm-release.yaml,test-ui.yaml).vscode/settings.json).gitignoreCLAUDE.md)Checks
By submitting this for review, I'm confirming I've done the following:
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.