Repository navigation
#1 Migrate to Deno - #14
Conversation
|
/review AI review started. |
| # AGENTS.md | ||
|
|
||
| This file provides guidance to AI coding agents when working with code in this repository. |
There was a problem hiding this comment.
Noticed this project doesn't have AGENTS.md yet, so created one using /init command in Claude Code. But please feel free to rewrite/amend this in the future if needed.
Advanced AI Review
Click to expand reviewCode ReviewBase: Scope note: 1. 🟡 Unused
|
Advanced AI Review
Click to expand review1. 🟡 The permission flags don't provide the sandbox the docs claim
"dev": "ASTRO_TELEMETRY_DISABLED=1 ASTRO_DISABLE_UPDATE_CHECK=true deno run --allow-read --allow-write=. --allow-env --allow-sys --allow-ffi --allow-run --allow-net=localhost,127.0.0.1,0.0.0.0,[::] astro dev",
"build": "ASTRO_TELEMETRY_DISABLED=1 deno run --allow-read --allow-write=. --allow-env --allow-sys --allow-ffi --allow-run --allow-net=localhost,127.0.0.1 astro build",Note what these flags actually allow:
So "Network access is limited to localhost" — as - Tasks run Astro with restricted permissions (the `--allow-*` flags in `deno.json`) rather than `--allow-all`. Network access is limited to localhost.Both {
"tasks": {
"dev": "ASTRO_TELEMETRY_DISABLED=1 ASTRO_DISABLE_UPDATE_CHECK=true deno run --no-prompt --allow-read=. --allow-write=. --allow-env --allow-sys --allow-ffi --allow-run --allow-net=localhost,127.0.0.1,0.0.0.0,[::] astro dev",
"build": "ASTRO_TELEMETRY_DISABLED=1 deno run --no-prompt --allow-read=. --allow-write=. --allow-env --allow-sys --allow-ffi --allow-run --allow-net=localhost,127.0.0.1 astro build",
"preview": "ASTRO_TELEMETRY_DISABLED=1 deno run --no-prompt --allow-read=. --allow-write=. --allow-env --allow-sys --allow-ffi --allow-run --allow-net=localhost,127.0.0.1,0.0.0.0,[::] astro preview",
"stop-preview": "ASTRO_TELEMETRY_DISABLED=1 deno run --no-prompt --allow-read=. --allow-write=. --allow-env --allow-sys --allow-ffi --allow-run --allow-net=localhost,127.0.0.1 astro preview stop"
}
}If a task then fails with a - Tasks run Astro without `--allow-all`, but note this is a convenience restriction, not a sandbox: `--allow-ffi` and `--allow-run` are required by the toolchain (native addons and binaries like esbuild) and each permits arbitrary code execution, and child processes are unrestricted. Reads are scoped to the project directory. The primary supply-chain protection is `deno.lock`, which pins every dependency with integrity hashes.2. 🟡
|
|
/review Hmm, ignore those two reviews above, looks like I forgot to update the review model for this repo. AI review started. |
Advanced AI Review
Click to expand reviewCode ReviewBase: Coverage: all 11 changed files were reviewed (slice-01: 1. 🟡 Task permission flags are effectively unrestricted, undercutting the PR's security goal
Issue #1 motivates this migration with npm supply-chain security, and "build": "ASTRO_TELEMETRY_DISABLED=1 deno run --allow-read --allow-write=. --allow-env --allow-sys --allow-ffi --allow-run --allow-net=localhost,127.0.0.1 astro build",
Some of this is probably load-bearing (esbuild spawns its binary; Rollup/lightningcss load native "build": "ASTRO_TELEMETRY_DISABLED=1 deno run --allow-read=.,$HOME/.cache/deno --allow-write=. --allow-env --allow-sys --allow-ffi --allow-run=astro,esbuild,node astro build",If 2. 🟡
|
Advanced AI Review
Click to expand review1. 🟡 Unrestricted
|
Code ReviewBase: Scope note: The permission flags ( 1. 🟡 Unclosed code block in
|
|
The PR is ready. @taoeffect Thanks. |
taoeffect
left a comment
There was a problem hiding this comment.
Nicely done @SebinSong ! One change request (that was my mistake for forgetting!)
|
Thank you @SebinSong, note that this is taking me a bit of time merge/test because of sysadmin reasons (the latest version of Deno isn't available for Alpine Linux). I'm figuring this out and will get back to you. |
taoeffect
left a comment
There was a problem hiding this comment.
Excellent work @SebinSong! 👏
Thankfully it seems that Alpine has a sufficiently new version of deno to build this.
However, I ran into an error building:
$ deno install
[ ...snip... ]
$ deno task build
Task build ASTRO_TELEMETRY_DISABLED=1 deno run --allow-read --allow-write=. --allow-env --allow-sys --allow-ffi --allow-run --allow-net=localhost,127.0.0.1 astro build
09:35:37 [vite] Re-optimizing dependencies because vite config has changed
09:35:38 [types] Generated 546ms
09:35:38 [build] output: "static"
09:35:38 [build] mode: "static"
09:35:38 [build] directory: /path/to/podcast.okturtles.org/dist/
09:35:38 [build] Collecting build info...
09:35:38 [build] ✓ Completed in 615ms.
09:35:38 [build] Building static entrypoints...
09:35:42 [vite] ✓ built in 3.64s
09:35:42 [vite] ✓ built in 731ms
09:35:42 [build] Rearranging server assets...
Import "devalue" not a dependency and not in import map from "file:///path/to/podcast.okturtles.org/dist/.prerender/prerender-entry.rzG97g91.mjs"
hint: If you want to use the npm package, try running `deno add npm:devalue`
at file:///path/to/podcast.okturtles.org/dist/.prerender/prerender-entry.rzG97g91.mjs:7:34
Location:
/path/to/podcast.okturtles.org/node_modules/.deno/astro@7.3.5/node_modules/astro/dist/core/build/default-prerenderer.js:19:30
Stack trace:
at file:///path/to/podcast.okturtles.org/dist/.prerender/prerender-entry.rzG97g91.mjs:7:34
at async generatePages (file:///path/to/podcast.okturtles.org/node_modules/.deno/astro@7.3.5/node_modules/astro/dist/core/build/generate.js:67:3)
at async Object.buildApp (file:///path/to/podcast.okturtles.org/node_modules/.deno/vite@8.3.2/node_modules/vite/dist/node/chunks/node.js:34905:5)
at async viteBuild (file:///path/to/podcast.okturtles.org/node_modules/.deno/astro@7.3.5/node_modules/astro/dist/core/build/static-build.js:63:3)
at async AstroBuilder.run (file:///path/to/podcast.okturtles.org/node_modules/.deno/astro@7.3.5/node_modules/astro/dist/core/build/index.js:202:7)
at async build (file:///path/to/podcast.okturtles.org/node_modules/.deno/astro@7.3.5/node_modules/astro/dist/cli/build/index.js:29:3)
|
@SebinSong if you're not able to figure out why deno is breaking like that, it's not the end of the world. We can stick with nodejs in that case. But this should be fixable according the error message. |
|
@taoeffect Updated per your requests. Regarding the build failure on your Linux, this is the answer from The PM's build fails because his Why it happens: deno install adds its own packages to an existing How I confirmed it: my own |
taoeffect
left a comment
There was a problem hiding this comment.
Great work @SebinSong! 👏 👏 👏
closes #1
package.json,package-lock.jsonand.npmrcwithdeno.jsonanddeno.lock.@astrojs/mdx,@astrojs/vue,@astrojs/rssandvue.astro.config.mjsthat the build needs without apackage.json.README.md, and anAGENTS.mdfor AI coding agents.[
deno task buildcommand works in my machine ]AI disclosure
This PR was generated with assistance of
Opus 5.5under my supervision(reviewed/modified).