Files
sweet/www/deno.json
T
d68b5ecd5b refactor: replace puppeteer with astral for screenshot and close #2919 (#2920)
due to resolves the `NotFound: No such file or directory` error in the
`www/utils/screenshot.ts` script, which was caused by improper file path
construction. This error prevented screenshots from being saved
correctly. close #2919

-- update --patch1
## Current Status
- Using npm:puppeteer for webpage screenshots
- npm lifecycle script warnings present
- deno-puppeteer is no longer maintained
- npm:puppeteer still has compatibility issues

## References
- [astral](https://github.com/lino-levan/astral): Browser automation
library designed for Deno
-
[deno-puppeteer#92](https://github.com/lucacasonato/deno-puppeteer/issues/92):
Recent discussion about deno-puppeteer

## Changes Made
1. Dependency Replacement
   - Replaced npm:puppeteer with jsr:@astral/astral
   - Removed npm lifecycle script warnings

2. Dependency Management Optimization
   - Centralized all imports in deno.json
   - Using jsr: and URL imports

## Testing Steps
1. Run screenshot command:
```bash
deno task screenshot https://google.com google
```

2. Check output:
   - Verify no npm warnings
   - Validate generated image files:
     - ./www/static/showcase/google2x.jpg
     - ./www/static/showcase/google1x.jpg
   - Confirm image quality

3. Run complete test suite:
```bash
deno task ok
```
- Ensure all tests pass

4. Verify functionality:
   - Screenshot feature works correctly
   - Image processing (2x/1x) functions properly

---------

Co-authored-by: 李嘉图·M·路 <146103794+Ricardo-M-Zheng@users.noreply.github.com>
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2025-05-12 20:02:15 +02:00

44 lines
1.7 KiB
JSON

{
"tasks": {
"start": "deno run -A --watch=static/,routes/,../src,../docs dev.ts",
"build": "deno run -A dev.ts build",
"preview": "deno run -A main.ts"
},
"imports": {
"$ga4": "https://raw.githubusercontent.com/denoland/ga4/main/mod.ts",
"@fresh/plugin-tailwind": "../plugin-tailwindcss/src/mod.ts",
"@luca/esbuild-deno-loader": "jsr:@luca/esbuild-deno-loader@^0.11.0",
"@preact/signals": "npm:@preact/signals@^1.3.0",
"@std/crypto": "jsr:@std/crypto@1",
"@std/datetime": "jsr:@std/datetime@0.225.0",
"@std/encoding": "jsr:@std/encoding@1",
"@std/fmt": "jsr:@std/fmt@1",
"@std/front-matter": "jsr:@std/front-matter@^1.0.5",
"@std/fs": "jsr:@std/fs@1",
"@std/html": "jsr:@std/html@1",
"@std/jsonc": "jsr:@std/jsonc@1",
"@std/media-types": "jsr:@std/media-types@1",
"@std/path": "jsr:@std/path@1",
"@std/semver": "jsr:@std/semver@1",
"@opentelemetry/api": "npm:@opentelemetry/api@^1.9.0",
"astral": "jsr:@astral/astral",
"autoprefixer": "npm:autoprefixer@10.4.17",
"cssnano": "npm:cssnano@6.0.3",
"esbuild": "npm:esbuild@0.23.1",
"esbuild-wasm": "npm:esbuild-wasm@0.23.1",
"fresh": "../src/mod.ts",
"fresh/compat": "../src/compat/mod.ts",
"fresh/dev": "../src/dev/mod.ts",
"fresh/runtime": "../src/runtime/shared.ts",
"github-slugger": "npm:github-slugger@^2.0.0",
"imagescript": "https://deno.land/x/imagescript@1.3.0/mod.ts",
"marked": "npm:marked@^14.1.2",
"marked-mangle": "npm:marked-mangle@^1.1.9",
"postcss": "npm:postcss@8.4.35",
"preact": "npm:preact@^10.24.1",
"preact-render-to-string": "npm:preact-render-to-string@^6.5.11",
"prismjs": "npm:prismjs@^1.29.0",
"tailwindcss": "npm:tailwindcss@^3.4.1"
}
}