Skip to content

Commit e0241c9

Browse files
committed
v0.21.10: add consumer smoke tests (SOP-012/013) + bump all packages
- SOP-012: CI pre-publish consumer smoke (test.yml) - Generates project via jsr:@lessjs/create outside monorepo - Builds and verifies dist/index.html exists - Depends on test-core + test-adapter-vite only (fast feedback) - SOP-013: Post-publish consumer smoke (publish.yml) - Runs after all packages are published to JSR - No checkout — pure JSR consumption test - 30s propagation delay + build + output verification - Bump all 16 packages: 0.21.9 → 0.21.10
1 parent dd2890e commit e0241c9

20 files changed

Lines changed: 280 additions & 16 deletions

File tree

.github/workflows/publish.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,36 @@ jobs:
7676
publish_if_missing "@lessjs/app" "packages/app"
7777
publish_if_missing "@lessjs/create" "packages/create"
7878
publish_if_missing "@lessjs/hub" "packages/hub"
79+
80+
# SOP-013: Post-Publish Consumer Smoke Test
81+
# Verifies that freshly published JSR packages form a complete, buildable
82+
# consumer project. This is the final release gate — it catches problems that
83+
# pre-publish testing cannot because the new version does not yet exist on JSR.
84+
consumer-smoke:
85+
runs-on: ubuntu-latest
86+
needs: [publish]
87+
steps:
88+
- uses: denoland/setup-deno@v2
89+
with:
90+
deno-version: '2'
91+
- name: Wait for JSR propagation
92+
run: sleep 30
93+
- name: Generate consumer project from JSR
94+
run: |
95+
CONSUMER_DIR="${{ runner.temp }}/lessjs-post-publish-smoke"
96+
rm -rf "$CONSUMER_DIR"
97+
mkdir -p "$CONSUMER_DIR"
98+
cd "$CONSUMER_DIR"
99+
deno run -A jsr:@lessjs/create test-blog
100+
- name: Build consumer project
101+
run: |
102+
CONSUMER_DIR="${{ runner.temp }}/lessjs-post-publish-smoke"
103+
cd "$CONSUMER_DIR/test-blog"
104+
deno task build
105+
- name: Verify output
106+
run: |
107+
CONSUMER_DIR="${{ runner.temp }}/lessjs-post-publish-smoke"
108+
test -f "$CONSUMER_DIR/test-blog/dist/index.html" || {
109+
echo "::error::dist/index.html not found — post-publish consumer build failed"
110+
exit 1
111+
}

.github/workflows/test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,3 +276,33 @@ jobs:
276276
run: deno task build:docs
277277
- name: Run E2E tests
278278
run: deno task test:e2e
279+
280+
# SOP-012: CI Pre-Publish Consumer Smoke Test
281+
# Validates that a generated consumer project can build from JSR-published packages.
282+
# Runs outside the monorepo to match real consumer experience.
283+
consumer-smoke:
284+
runs-on: ubuntu-latest
285+
needs: [test-core, test-adapter-vite]
286+
steps:
287+
- uses: denoland/setup-deno@v2
288+
with:
289+
deno-version: '2'
290+
- name: Generate consumer project from JSR
291+
run: |
292+
CONSUMER_DIR="${{ runner.temp }}/lessjs-consumer-smoke"
293+
rm -rf "$CONSUMER_DIR"
294+
mkdir -p "$CONSUMER_DIR"
295+
cd "$CONSUMER_DIR"
296+
deno run -A jsr:@lessjs/create test-blog
297+
- name: Build consumer project
298+
run: |
299+
CONSUMER_DIR="${{ runner.temp }}/lessjs-consumer-smoke"
300+
cd "$CONSUMER_DIR/test-blog"
301+
deno task build
302+
- name: Verify output
303+
run: |
304+
CONSUMER_DIR="${{ runner.temp }}/lessjs-consumer-smoke"
305+
test -f "$CONSUMER_DIR/test-blog/dist/index.html" || {
306+
echo "::error::dist/index.html not found — consumer build failed"
307+
exit 1
308+
}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# SOP-012: CI Pre-Publish Consumer Smoke Test
2+
3+
Status: active\
4+
Target version: v0.21.10+\
5+
Owner: CI + release owner\
6+
Related: SOP-011, ADR-0041
7+
8+
## Objective
9+
10+
Prevent ESM module graph boundary leaks before they reach JSR consumers.
11+
12+
SOP-011 item 4 requires a "generated consumer smoke test" that runs outside the
13+
monorepo. This SOP defines the CI implementation of that requirement.
14+
15+
## Problem
16+
17+
The v0.21.9 consumer 404 bug (adapter-vanilla, adapter-react intercepted by
18+
`ssg-package-resolver` instead of `optionalPackageStubsPlugin`) was caught by
19+
manual testing, not CI. The existing `ssg-smoke.test.ts` runs inside the
20+
workspace and cannot detect JSR-specific resolution failures.
21+
22+
## Implementation
23+
24+
Add a `consumer-smoke` job to `.github/workflows/test.yml` that:
25+
26+
1. Creates a temp directory outside the repository checkout
27+
2. Runs `deno run -A jsr:@lessjs/create test-blog`
28+
3. Enters the generated project and runs `deno task build`
29+
4. Fails the CI if any step errors
30+
31+
### Job Definition
32+
33+
```yaml
34+
consumer-smoke:
35+
runs-on: ubuntu-latest
36+
needs: [test-core, test-adapter-vite]
37+
steps:
38+
- uses: actions/checkout@v4
39+
- uses: denoland/setup-deno@v2
40+
with:
41+
deno-version: '2'
42+
- name: Generate consumer project from JSR
43+
env:
44+
TEMP_DIR: ${{ runner.temp }}/lessjs-consumer-smoke
45+
run: |
46+
rm -rf "$TEMP_DIR"
47+
mkdir -p "$TEMP_DIR"
48+
cd "$TEMP_DIR"
49+
deno run -A jsr:@lessjs/create test-blog
50+
- name: Build consumer project
51+
env:
52+
TEMP_DIR: ${{ runner.temp }}/lessjs-consumer-smoke
53+
run: |
54+
cd "$TEMP_DIR/test-blog"
55+
deno task build
56+
```
57+
58+
### Key Constraints
59+
60+
- The generated project **must** be outside the repository checkout to avoid
61+
Deno workspace member detection.
62+
- The job should depend on `test-core` and `test-adapter-vite` (not gate on the
63+
full matrix) to keep feedback fast.
64+
- No special permissions needed — `deno run` and `deno task` are standard.
65+
66+
## Acceptance Criteria
67+
68+
- [ ] `consumer-smoke` job exists in `test.yml`
69+
- [ ] Job creates project outside the checkout directory
70+
- [ ] Job runs `deno task build` on the generated project
71+
- [ ] CI green on a version that is already published to JSR
72+
- [ ] Job fails if a required package is missing from JSR or has a resolution bug
73+
74+
## Known Limitation
75+
76+
This test only validates against **already-published** JSR versions. It cannot
77+
detect issues in a version that has not yet been published. For that, see
78+
SOP-013 (Post-Publish Consumer Smoke).
79+
80+
## Validation
81+
82+
```powershell
83+
# Local validation (requires published version on JSR)
84+
$tmp = Join-Path $env:TEMP "lessjs-consumer-smoke"
85+
Remove-Item -LiteralPath $tmp -Recurse -Force -ErrorAction SilentlyContinue
86+
New-Item -ItemType Directory -Path $tmp | Out-Null
87+
Set-Location $tmp
88+
deno run -A jsr:@lessjs/create test-blog
89+
Set-Location test-blog
90+
deno task build
91+
```
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# SOP-013: Post-Publish Consumer Smoke Test
2+
3+
Status: active\
4+
Target version: v0.21.10+\
5+
Owner: CI + release owner\
6+
Related: SOP-011, SOP-012, ADR-0041
7+
8+
## Objective
9+
10+
Verify that freshly published JSR packages form a complete, buildable consumer
11+
project. This is the final release gate — it catches problems that pre-publish
12+
testing cannot because the new version does not yet exist on JSR.
13+
14+
## Problem
15+
16+
SOP-012 tests against already-published JSR versions. It validates the last
17+
release, not the current one. The publish workflow (`publish.yml`) currently
18+
publishes all packages and then stops — there is no verification that the
19+
published packages actually work together.
20+
21+
The v0.21.9 hotfix (removing optional packages from the resolver) would have
22+
been caught immediately if a post-publish smoke had existed.
23+
24+
## Implementation
25+
26+
Add a `consumer-smoke` job to `.github/workflows/publish.yml` that runs after
27+
all packages are published.
28+
29+
### Job Definition
30+
31+
```yaml
32+
consumer-smoke:
33+
runs-on: ubuntu-latest
34+
needs: [publish]
35+
steps:
36+
- uses: denoland/setup-deno@v2
37+
with:
38+
deno-version: '2'
39+
- name: Wait for JSR propagation
40+
run: sleep 30
41+
- name: Generate consumer project from JSR
42+
env:
43+
TEMP_DIR: ${{ runner.temp }}/lessjs-post-publish-smoke
44+
run: |
45+
rm -rf "$TEMP_DIR"
46+
mkdir -p "$TEMP_DIR"
47+
cd "$TEMP_DIR"
48+
deno run -A jsr:@lessjs/create test-blog
49+
- name: Build consumer project
50+
env:
51+
TEMP_DIR: ${{ runner.temp }}/lessjs-post-publish-smoke
52+
run: |
53+
cd "$TEMP_DIR/test-blog"
54+
deno task build
55+
- name: Verify output
56+
env:
57+
TEMP_DIR: ${{ runner.temp }}/lessjs-post-publish-smoke
58+
run: |
59+
test -f "$TEMP_DIR/test-blog/dist/index.html" || {
60+
echo "::error::dist/index.html not found — build failed silently"
61+
exit 1
62+
}
63+
```
64+
65+
### Key Constraints
66+
67+
- **No checkout needed** — this test runs against the JSR-published packages,
68+
not the local source. This is the whole point: it tests what the consumer
69+
actually receives.
70+
- A 30-second wait allows JSR to propagate the newly published versions. This
71+
may need adjustment based on JSR's actual propagation delay.
72+
- The job must depend on `publish` (all packages published first).
73+
- If any package failed to publish, this job will naturally fail because
74+
`deno run -A jsr:@lessjs/create` will pull a version mismatch.
75+
76+
## Acceptance Criteria
77+
78+
- [ ] `consumer-smoke` job exists in `publish.yml` after the publish step
79+
- [ ] Job does NOT checkout the repository (tests pure JSR consumption)
80+
- [ ] Job verifies `dist/index.html` exists after build
81+
- [ ] A broken publish (e.g., missing package) causes this job to fail
82+
83+
## Relationship to SOP-012
84+
85+
| | SOP-012 (CI Pre-Publish) | SOP-013 (Post-Publish) |
86+
|---|---|---|
87+
| **When** | Every push to dev/main | After publish completes |
88+
| **Tests against** | Last published JSR version | Freshly published JSR version |
89+
| **Catches** | Regressions in already-shipped code | New-version integration bugs |
90+
| **Needs checkout** | Yes (for create scaffolding) | No (pure JSR consumption) |
91+
92+
Both are needed. SOP-012 catches regressions early in PR CI. SOP-013 is the
93+
final gate that proves the release is actually shippable.
94+
95+
## Validation
96+
97+
This can only be validated during an actual publish cycle. Manual test:
98+
99+
```powershell
100+
# After publishing a new version
101+
Start-Sleep -Seconds 30
102+
$tmp = Join-Path $env:TEMP "lessjs-post-publish-smoke"
103+
Remove-Item -LiteralPath $tmp -Recurse -Force -ErrorAction SilentlyContinue
104+
New-Item -ItemType Directory -Path $tmp | Out-Null
105+
Set-Location $tmp
106+
deno run -A jsr:@lessjs/create test-blog
107+
Set-Location test-blog
108+
deno task build
109+
Test-Path dist/index.html
110+
```

packages/adapter-lit/deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lessjs/adapter-lit",
3-
"version": "0.21.9",
3+
"version": "0.21.10",
44
"exports": {
55
".": "./src/index.ts",
66
"./ssr": "./src/ssr.ts",

packages/adapter-react/deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lessjs/adapter-react",
3-
"version": "0.21.9",
3+
"version": "0.21.10",
44
"exports": {
55
".": "./src/index.ts",
66
"./ssr": "./src/ssr.ts",

packages/adapter-vanilla/deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lessjs/adapter-vanilla",
3-
"version": "0.21.9",
3+
"version": "0.21.10",
44
"exports": {
55
".": "./src/index.ts",
66
"./ssr": "./src/ssr.ts",

packages/adapter-vite/deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lessjs/adapter-vite",
3-
"version": "0.21.9",
3+
"version": "0.21.10",
44
"exports": {
55
".": "./src/index.ts",
66
"./build-context": "./src/build-context.ts",

packages/app/deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lessjs/app",
3-
"version": "0.21.9",
3+
"version": "0.21.10",
44
"exports": {
55
".": "./src/index.ts"
66
},

packages/cem/deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lessjs/cem",
3-
"version": "0.21.9",
3+
"version": "0.21.10",
44
"exports": {
55
".": "./src/index.ts"
66
},

0 commit comments

Comments
 (0)