Skip to content

Commit eb4dad5

Browse files
hi-ogawaclaude
andauthored
chore: initial migration (#1)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent af48923 commit eb4dad5

7 files changed

Lines changed: 108 additions & 579 deletions

File tree

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
concurrency:
9+
group: ci-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v6
17+
- uses: actions/setup-node@v6
18+
with:
19+
node-version: "lts/*"
20+
- run: corepack enable
21+
- run: pnpm i
22+
- run: pnpm lint-check

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
# zipview
2-
3-
> [!NOTE]
4-
> experiment for https://github.com/vitest-dev/vitest/issues/9971
1+
# Vitest Viewer
52

63
View any static site from a zip file — entirely in the browser, no server needed.
74

8-
A service worker intercepts fetch requests and serves files from the unzipped content via Cache API. The viewer is generic — it doesn't know or care what's inside the zip. Works with Vitest HTML reports, Storybook builds, Vitepress sites, or any static site.
5+
Available at [viewer.vitest.dev](https://viewer.vitest.dev/).
6+
7+
A service worker intercepts fetch requests and serves files from the unzipped content via Cache API. The viewer is generic — it doesn't know or care what's inside the zip. Works with Vitest HTML reports, Storybook builds, VitePress sites, or any static site.
98

109
## Usage
1110

@@ -23,13 +22,13 @@ Then drag-and-drop a zip file onto the page. If the zip contains an `index.html`
2322
## How it works
2423

2524
1. `index.html` — drop zone UI, unzips with [fflate](https://github.com/101arrowz/fflate) (CDN), stores files in Cache API, registers service worker, loads content in iframe
26-
2. `sw.js` — intercepts fetch under `/zipview/site/`, serves from Cache API, generates directory listings when no index.html is found
25+
2. `sw.js` — intercepts fetch under `/zipview/site/`, serves from Cache API, generates directory listings when no `index.html` is found
2726

2827
That's it. Two files, no build step, no dependencies to install.
2928

3029
## Motivation
3130

32-
CI produces static site artifacts (e.g. Vitest HTML reports via `--reporter=html`). On GitHub Actions, viewing them requires: download zip -> unzip -> run local static server -> open browser.
31+
CI produces static site artifacts (e.g. Vitest HTML reports via `--reporter=html`). On GitHub Actions, viewing them requires: download zip unzip run local static server open browser.
3332

3433
GitLab CI can [preview HTML artifacts directly in the browser](https://docs.gitlab.com/ee/ci/jobs/job_artifacts.html) (powered by GitLab Pages). GitHub Actions does not.
3534

netlify.toml

Lines changed: 0 additions & 2 deletions
This file was deleted.

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
{
2+
"name": "@vitest/viewer",
3+
"private": true,
24
"type": "module",
35
"scripts": {
46
"prepare": "vp config",
5-
"dev": "wrangler dev",
6-
"release": "wrangler deploy",
7+
"dev": " sirv ./src --dev --single",
78
"lint": "vp fmt",
89
"lint-check": "vp fmt --check"
910
},
10-
"dependencies": {
11-
"vite-plus": "latest",
12-
"wrangler": "^4.77.0"
11+
"dependencies": {},
12+
"devDependencies": {
13+
"sirv-cli": "^3.0.1",
14+
"vite-plus": "latest"
1315
},
1416
"packageManager": "pnpm@10.33.0+sha512.10568bb4a6afb58c9eb3630da90cc9516417abebd3fabbe6739f0ae795728da1491e9db5a544c76ad8eb7570f5c4bb3d6c637b2cb41bfdcdb47fa823c8649319"
1517
}

0 commit comments

Comments
 (0)