@bookipi/htmlgenerator 1.9.5-alpha.1 → 1.11.0-pnpm-migration.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,46 +1,87 @@
1
- # @bookipi/bookipi-core
1
+ # @bookipi/htmlgenerator
2
2
 
3
- > Made with create-react-library
3
+ > Turns invoice/contract/presentation data objects into self-contained HTML strings (rendered to PDF downstream).
4
4
 
5
- [![NPM](https://img.shields.io/npm/v/@bookipi/htmlgenerator.svg)](https://www.npmjs.com/package/@bookipi/htmlgenerator) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
5
+ [![NPM](https://img.shields.io/npm/v/@bookipi/htmlgenerator.svg)](https://www.npmjs.com/package/@bookipi/htmlgenerator)
6
6
 
7
- ## Install
7
+ ## Prerequisites
8
+
9
+ This repo pins its toolchain so every contributor uses the same versions:
10
+
11
+ - **Node `24.14.0`** — pinned in [`.node-version`](./.node-version) and auto-switched on `cd` by [fnm](https://github.com/Schniz/fnm).
12
+ - **pnpm 11** — pinned via the `packageManager` field in `package.json` and enforced by [Corepack](https://nodejs.org/api/corepack.html) (bundled with Node).
13
+
14
+ One-time setup:
8
15
 
9
16
  ```bash
10
- yarn install
17
+ # 1. Install fnm (https://github.com/Schniz/fnm#installation), e.g. on macOS:
18
+ brew install fnm
19
+ # 2. Enable auto-switch-on-cd in your shell profile (~/.zshrc):
20
+ # eval "$(fnm env --use-on-cd)"
21
+ # 3. From the project folder, install the pinned Node and enable pnpm:
22
+ fnm install # installs the version from .node-version (24.14.0)
23
+ corepack enable # lets Corepack run the pinned pnpm version
11
24
  ```
12
25
 
13
- ## Pack
26
+ ## Install
14
27
 
15
- Package for bookipi-accounting
28
+ ```bash
29
+ pnpm install
30
+ ```
31
+
32
+ ## Build / Develop
16
33
 
17
34
  ```bash
18
- yarn pack
35
+ pnpm build # one-off build to dist/ (modern + cjs, plus utils bundle)
36
+ pnpm start # watch-build during development
19
37
  ```
20
38
 
21
- ## Publish
39
+ ### Visual / PDF preview
22
40
 
23
- in latest channel
24
41
  ```bash
25
- yarn publish
42
+ pnpm test:pages # old layout
43
+ pnpm test:pages-new-layout # new layout
44
+ pnpm test:pages-japan # Japan layout
45
+ pnpm test:pages-v2 # v2 data shape
46
+ pnpm test:proposal # proposals
47
+ pnpm test:pages-presentation # presentations
26
48
  ```
27
49
 
28
- in alpha channel
50
+ The non-`-v2` page generators POST the HTML to a local PDF service at `http://localhost:3001` (must be running for PDF output); `out.html` is written regardless.
51
+
52
+ ## Test
53
+
29
54
  ```bash
30
- yarn publish --tag alpha
55
+ pnpm test # unit (snapshot) tests + lint + build
56
+ pnpm test:unit # snapshot tests only
57
+ pnpm test:unit -u # update snapshots
58
+ pnpm test:lint # eslint
31
59
  ```
32
60
 
33
- ## Usage
61
+ ## Pack
34
62
 
35
- For local development, pls run
63
+ Package for bookipi-accounting:
36
64
 
37
65
  ```bash
38
- yarn link
39
- yarn start
66
+ pnpm pack
40
67
  ```
41
68
 
42
- and in the project where you want to use this package, pls run
69
+ ## Publish
43
70
 
44
71
  ```bash
45
- yarn link @bookipi/htmlgenerator
72
+ # testing prerelease channel — downstream installs via @bookipi/htmlgenerator@<tag>
73
+ pnpm publish --tag pnpm-migration --no-git-checks
74
+
75
+ # latest channel
76
+ pnpm publish
77
+ ```
78
+
79
+ ## Local linking (consume from another project)
80
+
81
+ ```bash
82
+ pnpm link --global # in this repo
83
+ pnpm start # keep rebuilding on change
84
+
85
+ # in the consuming project:
86
+ pnpm link --global @bookipi/htmlgenerator
46
87
  ```