Skip to content

fix CDN build#244

Merged
ngxson merged 3 commits into
masterfrom
xsn/fix_cdn
May 30, 2026
Merged

fix CDN build#244
ngxson merged 3 commits into
masterfrom
xsn/fix_cdn

Conversation

@ngxson

@ngxson ngxson commented May 30, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Chores
    • Bumped package version to 3.4.1
    • Updated tracked native subproject to a newer revision
    • Added a publish-time package size check to enforce a 20 MB / 90-entry limit
    • Updated CDN asset references to 3.4.1
    • Expanded ignore rules to exclude additional build, tooling, and temporary artifacts

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ffcfadbb-8858-48a8-95b1-cd31c9974a30

📥 Commits

Reviewing files that changed from the base of the PR and between bebf2fe and d519c7d.

📒 Files selected for processing (2)
  • .npmignore
  • scripts/check_package_size.js

📝 Walkthrough

Walkthrough

Release v3.4.1 bumps package versions, updates the llama.cpp submodule and propagates the new build version through CDN URLs and generated constants. A new package size validation script enforces a 20 MB unpacked limit before publishing. Build artifact exclusions are updated in .gitignore and .npmignore.

Changes

Release 3.4.1

Layer / File(s) Summary
Version and CDN asset updates
package.json, compat/package.json, llama.cpp, src/workers-code/generated.ts, src/wasm-from-cdn.ts
Versions bumped to 3.4.1 in package manifests; llama.cpp submodule SHA advanced; LIBLLAMA_VERSION and CDN URL constants updated to match the new release.
Package size validation on publish
scripts/check_package_size.js, package.json, compat/package.json
New scripts/check_package_size.js runs npm pack --dry-run --json, logs unpacked size and entry count, and exits with status 1 if >20 MB or >90 entries; prepublishOnly hooks added to run this check.
Build artifact and cache exclusions
.gitignore, .npmignore
.gitignore adds .claude. .npmignore expands ignored build artifacts to include /build-*, a.out.js, a.out.wasm, /compat, and dot-directories /.github, /.vscode, /.claude, plus existing cache entries.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • ngxson/wllama#192: Updates CDN URL mappings and LIBLLAMA_VERSION in the same areas (CDN/version propagation and generated worker constants).
  • ngxson/wllama#171: Also advances the llama.cpp submodule and propagates the build/version updates to CDN constants.
  • ngxson/wllama#189: Modifies src/workers-code/generated.ts LIBLLAMA_VERSION driven by an upstream llama.cpp sync.

Poem

🐰 I hop through versions, nibble bytes so small,
A tiny check to keep the package tall.
CDN strings align, the submodule hums,
Ignores sweep crumbs and tidy build drums.
Publish light — the rabbit pounds a celebratory prance!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The pull request title 'fix CDN build' is vague and does not clearly convey what specific CDN build issue was fixed or what changes were made. Consider a more descriptive title like 'Bump version to 3.4.1 and update CDN URLs' or 'Update package version and add size check script' to better indicate the nature of the fix.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 xsn/fix_cdn

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/check_package_size.js`:
- Around line 7-8: The script uses a shell-only redirection ('2>/dev/null') in
the execSync call which breaks on Windows; change the execSync call in
scripts/check_package_size.js to run 'npm pack --dry-run --json' without inline
redirection and capture stdout via execSync(..., { encoding: 'utf8', stdio:
['pipe','pipe','ignore'] }) (or at minimum { encoding: 'utf8' }) then JSON.parse
the returned string into result and keep using result[0].unpackedSize for size;
update the execSync usage so result and size are derived from captured stdout
instead of relying on shell redirection.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7d6ea8bf-8c8b-45ea-b83d-02924a30d041

📥 Commits

Reviewing files that changed from the base of the PR and between 35e53a8 and bebf2fe.

⛔ Files ignored due to path filters (1)
  • src/wasm/wllama.wasm is excluded by !**/*.wasm
📒 Files selected for processing (8)
  • .gitignore
  • .npmignore
  • compat/package.json
  • llama.cpp
  • package.json
  • scripts/check_package_size.js
  • src/wasm-from-cdn.ts
  • src/workers-code/generated.ts

Comment thread scripts/check_package_size.js Outdated
Comment on lines +7 to +8
const result = JSON.parse(execSync('npm pack --dry-run --json 2>/dev/null'));
const size = result[0].unpackedSize;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
ls -la
git ls-files "scripts/check_package_size.js" || true
sed -n '1,200p' scripts/check_package_size.js || true
rg -n "check_package_size\.js" -S . || true
rg -n "npm pack --dry-run --json" -S . || true
rg -n "MAX_SIZE" -S scripts/check_package_size.js || true
rg -n "execSync\\(" scripts/check_package_size.js -n || true

Repository: ngxson/wllama

Length of output: 3035


🏁 Script executed:

#!/bin/bash
set -euo pipefail
ls -la
git ls-files "scripts/check_package_size.js" || true
sed -n '1,200p' scripts/check_package_size.js || true
rg -n "check_package_size\.js" -S . || true
rg -n "npm pack --dry-run --json" -S . || true
rg -n "MAX_SIZE" -S scripts/check_package_size.js || true
rg -n "execSync\\(" scripts/check_package_size.js -n || true

Repository: ngxson/wllama

Length of output: 3035


Make the npm pack size check cross-platform

2>/dev/null is shell-dependent and can break the prepublishOnly size check on Windows. Capture stdout from execSync instead of using inline redirection.

💡 Proposed fix
-const result = JSON.parse(execSync('npm pack --dry-run --json 2>/dev/null'));
+const output = execSync('npm pack --dry-run --json', {
+  encoding: 'utf8',
+  stdio: ['ignore', 'pipe', 'ignore'],
+});
+const result = JSON.parse(output);
📝 Committable suggestion

‼️ 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.

Suggested change
const result = JSON.parse(execSync('npm pack --dry-run --json 2>/dev/null'));
const size = result[0].unpackedSize;
const output = execSync('npm pack --dry-run --json', {
encoding: 'utf8',
stdio: ['ignore', 'pipe', 'ignore'],
});
const result = JSON.parse(output);
const size = result[0].unpackedSize;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/check_package_size.js` around lines 7 - 8, The script uses a
shell-only redirection ('2>/dev/null') in the execSync call which breaks on
Windows; change the execSync call in scripts/check_package_size.js to run 'npm
pack --dry-run --json' without inline redirection and capture stdout via
execSync(..., { encoding: 'utf8', stdio: ['pipe','pipe','ignore'] }) (or at
minimum { encoding: 'utf8' }) then JSON.parse the returned string into result
and keep using result[0].unpackedSize for size; update the execSync usage so
result and size are derived from captured stdout instead of relying on shell
redirection.

@ngxson ngxson merged commit b11537b into master May 30, 2026
6 checks passed
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.

1 participant