Skip to content

Commit b1eff3f

Browse files
PurpleReverieclaude
andcommitted
Release 0.1.1: fix consumer install/build
0.1.0 shipped three regressions that broke `npm install` + `npm run build` from a fresh consumer project: 1. `workspace:*` strings leaked into every template's published package.json. The first publish bypassed `pnpm changeset version`, so pnpm's workspace-protocol rewrite never ran. New CI job `pack-leak` packs every publishable workspace package and greps for `workspace:` to prevent regression. 2. Five templates imported Bibliography via a deep relative path (`../../reactwright/src/userland/Bibliography.js`) that only resolves inside the monorepo. Switched to the public package entry `reactwright/userland`. 3. tsx's default JSX transform is classic (`React.createElement`), and the consumer-side tsx runtime does not apply the host's tsconfig to files in node_modules. Every published template.tsx and the scaffolder-generated .tsx now `import React from "react"` explicitly. The scaffolder also writes a sibling tsconfig.json with `"jsx": "react-jsx"` so consumer .tsx files build cleanly. While verifying the fix, also corrected the scaffolder's default template to use `<link>` instead of `<a>` (not a registered content intrinsic). New CI job `scaffold-build` runs the full scaffold + npm install + npm run build loop for all six templates against local tarballs. Defers the `remove-deprecated-compounds` changeset (parked at `.deferred`) so this release stays a clean 0.1.1 patch. Restore the extension when cutting the next minor. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c067643 commit b1eff3f

28 files changed

Lines changed: 618 additions & 24 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"reactwright": minor
3+
---
4+
5+
Remove the engine compound intrinsics (`<bibliography>`, `<toc>`,
6+
`<list-of>`, and the template-side `<index>`). Authors should use the
7+
userland helpers `<Bibliography>`, `<Toc>`, `<ListOf>`, and `<Index>`
8+
from `reactwright/userland`, which compose the data-source primitives
9+
(`<bib-data>`, `<toc-data>`, `<list-of-data>`, `<index-data>`) to
10+
produce equivalent output. The content-side `<index term="...">`
11+
inline marker is unchanged.

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,45 @@ jobs:
2929

3030
- name: Typecheck
3131
run: pnpm check
32+
33+
pack-leak:
34+
name: Pack — no workspace:* leak
35+
needs: test
36+
runs-on: ubuntu-latest
37+
timeout-minutes: 10
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
- uses: pnpm/action-setup@v4
42+
43+
- uses: actions/setup-node@v4
44+
with:
45+
node-version: 22
46+
cache: pnpm
47+
48+
- name: Install
49+
run: pnpm install --frozen-lockfile
50+
51+
- name: Check pack tarballs for workspace:* leaks
52+
run: pnpm test:pack-leak
53+
54+
scaffold-build:
55+
name: Scaffold + npm install + build (html)
56+
needs: test
57+
runs-on: ubuntu-latest
58+
timeout-minutes: 20
59+
steps:
60+
- uses: actions/checkout@v4
61+
62+
- uses: pnpm/action-setup@v4
63+
64+
- uses: actions/setup-node@v4
65+
with:
66+
node-version: 22
67+
cache: pnpm
68+
69+
- name: Install (workspace, for pnpm pack)
70+
run: pnpm install --frozen-lockfile
71+
72+
- name: Scaffold each template + npm install + build to HTML
73+
run: pnpm test:scaffold

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
"build": "turbo build",
1111
"test": "turbo test",
1212
"check": "turbo check",
13-
"mockup:all": "turbo mockup --filter='./examples/*'"
13+
"mockup:all": "turbo mockup --filter='./examples/*'",
14+
"test:pack-leak": "node scripts/check-pack-no-workspace-leak.mjs",
15+
"test:scaffold": "node scripts/check-scaffold-build.mjs"
1416
},
1517
"engines": {
1618
"node": ">=20",
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# create-reactwright-doc
2+
3+
## 0.1.1
4+
5+
### Patch Changes
6+
7+
- Fix consumer install/build failure introduced in 0.1.0.
8+
9+
- Templates with bibliography support (`book`, `essay`, `ieee`, `ieee-report`,
10+
`report`) imported `Bibliography` via a deep relative path that only
11+
resolved inside the monorepo, breaking once installed from npm. The
12+
import now uses the `reactwright/userland` package entry.
13+
- Every template `template.tsx` now imports `React` explicitly. The
14+
consumer-side `tsx` runtime does not apply the host project's tsconfig
15+
to files in `node_modules`, so it defaults to the classic JSX transform
16+
(`React.createElement(...)`) and fails with "React is not defined"
17+
without an explicit React import.
18+
- `create-reactwright-doc` now writes a `tsconfig.json` next to the
19+
generated `.tsx` and emits an explicit `import React from "react";`, so
20+
the scaffolded build works end-to-end against published packages.
21+
- `@reactwright/markdown` and the templates are republished so their
22+
tarballs carry concrete dependency versions rather than the unresolved
23+
`workspace:*` strings shipped in 0.1.0.

packages/create-reactwright-doc/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-reactwright-doc",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Scaffolder for new Reactwright documents.",
55
"license": "MIT",
66
"author": "Reactwright contributors",
@@ -13,7 +13,11 @@
1313
"bugs": {
1414
"url": "https://github.com/PurpleReverie/reactwright/issues"
1515
},
16-
"keywords": ["reactwright", "scaffolder", "create-app"],
16+
"keywords": [
17+
"reactwright",
18+
"scaffolder",
19+
"create-app"
20+
],
1721
"type": "module",
1822
"bin": {
1923
"create-reactwright-doc": "./src/index.js"

packages/create-reactwright-doc/src/index.js

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const TEMPLATES = {
4141
}
4242
};
4343

44-
const REACTWRIGHT_VERSION = "^0.2.0";
44+
const REACTWRIGHT_VERSION = "^0.1.0";
4545
const TEMPLATE_VERSION = "^0.1.0";
4646

4747
function parseArgs(argv) {
@@ -129,6 +129,11 @@ function main() {
129129
starterTsx(args.template, args.name)
130130
);
131131

132+
fs.writeFileSync(
133+
path.join(targetDir, "tsconfig.json"),
134+
starterTsconfig()
135+
);
136+
132137
fs.writeFileSync(
133138
path.join(targetDir, "README.md"),
134139
starterReadme(args.name, args.template, entryFile)
@@ -138,6 +143,7 @@ function main() {
138143
139144
${args.name}/
140145
├── package.json
146+
├── tsconfig.json
141147
├── ${entryFile}
142148
└── README.md
143149
@@ -154,6 +160,7 @@ function starterTsx(templateKey, name) {
154160
const template = TEMPLATES[templateKey];
155161
if (templateKey === "letter") {
156162
return `import "reactwright/jsx";
163+
import React from "react";
157164
import { Template } from "${template.pkg}";
158165
159166
export { Template };
@@ -202,6 +209,7 @@ export default function Document() {
202209
}
203210
if (templateKey === "book") {
204211
return `import "reactwright/jsx";
212+
import React from "react";
205213
import { Template } from "${template.pkg}";
206214
207215
export { Template };
@@ -235,6 +243,7 @@ export default function Document() {
235243
`;
236244
}
237245
return `import "reactwright/jsx";
246+
import React from "react";
238247
import { Template } from "${template.pkg}";
239248
240249
export { Template };
@@ -249,8 +258,8 @@ export default function Document() {
249258
flows through the engine to paginated HTML and PDF.
250259
</p>
251260
<p>
252-
See <a href="https://github.com/PurpleReverie/reactwright">the
253-
documentation</a> for the full primitive vocabulary.
261+
See <link href="https://github.com/PurpleReverie/reactwright">the
262+
documentation</link> for the full primitive vocabulary.
254263
</p>
255264
</section>
256265
@@ -273,6 +282,24 @@ export default function Document() {
273282
`;
274283
}
275284

285+
function starterTsconfig() {
286+
return `{
287+
"compilerOptions": {
288+
"target": "ES2022",
289+
"module": "NodeNext",
290+
"moduleResolution": "NodeNext",
291+
"jsx": "react-jsx",
292+
"esModuleInterop": true,
293+
"skipLibCheck": true,
294+
"allowSyntheticDefaultImports": true,
295+
"strict": false,
296+
"noEmit": true
297+
},
298+
"include": ["*.tsx", "*.ts"]
299+
}
300+
`;
301+
}
302+
276303
function starterReadme(name, templateKey, entryFile) {
277304
return `# ${name}
278305

packages/markdown/CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# @reactwright/markdown
2+
3+
## 0.1.1
4+
5+
### Patch Changes
6+
7+
- Fix consumer install/build failure introduced in 0.1.0.
8+
9+
- Templates with bibliography support (`book`, `essay`, `ieee`, `ieee-report`,
10+
`report`) imported `Bibliography` via a deep relative path that only
11+
resolved inside the monorepo, breaking once installed from npm. The
12+
import now uses the `reactwright/userland` package entry.
13+
- Every template `template.tsx` now imports `React` explicitly. The
14+
consumer-side `tsx` runtime does not apply the host project's tsconfig
15+
to files in `node_modules`, so it defaults to the classic JSX transform
16+
(`React.createElement(...)`) and fails with "React is not defined"
17+
without an explicit React import.
18+
- `create-reactwright-doc` now writes a `tsconfig.json` next to the
19+
generated `.tsx` and emits an explicit `import React from "react";`, so
20+
the scaffolded build works end-to-end against published packages.
21+
- `@reactwright/markdown` and the templates are republished so their
22+
tarballs carry concrete dependency versions rather than the unresolved
23+
`workspace:*` strings shipped in 0.1.0.

packages/markdown/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@reactwright/markdown",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Author Reactwright documents in Markdown. Parses CommonMark + YAML frontmatter into Reactwright content JSX so any template (essay, IEEE, report) can render `.md` files to HTML and PDF.",
55
"keywords": [
66
"reactwright",
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# @reactwright/template-book
2+
3+
## 0.1.1
4+
5+
### Patch Changes
6+
7+
- Fix consumer install/build failure introduced in 0.1.0.
8+
9+
- Templates with bibliography support (`book`, `essay`, `ieee`, `ieee-report`,
10+
`report`) imported `Bibliography` via a deep relative path that only
11+
resolved inside the monorepo, breaking once installed from npm. The
12+
import now uses the `reactwright/userland` package entry.
13+
- Every template `template.tsx` now imports `React` explicitly. The
14+
consumer-side `tsx` runtime does not apply the host project's tsconfig
15+
to files in `node_modules`, so it defaults to the classic JSX transform
16+
(`React.createElement(...)`) and fails with "React is not defined"
17+
without an explicit React import.
18+
- `create-reactwright-doc` now writes a `tsconfig.json` next to the
19+
generated `.tsx` and emits an explicit `import React from "react";`, so
20+
the scaffolded build works end-to-end against published packages.
21+
- `@reactwright/markdown` and the templates are republished so their
22+
tarballs carry concrete dependency versions rather than the unresolved
23+
`workspace:*` strings shipped in 0.1.0.

packages/template-book/package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@reactwright/template-book",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Long-form chaptered book template (trade paperback) for the Reactwright document engine.",
55
"license": "MIT",
66
"author": "Reactwright contributors",
@@ -13,7 +13,13 @@
1313
"bugs": {
1414
"url": "https://github.com/PurpleReverie/reactwright/issues"
1515
},
16-
"keywords": ["reactwright", "template", "book", "novel", "trade-paperback"],
16+
"keywords": [
17+
"reactwright",
18+
"template",
19+
"book",
20+
"novel",
21+
"trade-paperback"
22+
],
1723
"type": "module",
1824
"exports": {
1925
".": {

0 commit comments

Comments
 (0)