Open History to see the last commit
1# Scripts
2
3## generate-checksums.js
4
5This script generates checksums for the `react-cra` and `solid` frameworks to ensure version bumps when content changes.
6
7### Purpose
8
9The checksum system ensures that when any files in the following directories change, the framework package will have a different build output, triggering proper version bumping:
10
11- `add-ons/`
12- `examples/`
13- `hosts/`
14- `project/`
15- `toolchains/`
16
17### How It Works
18
191. The script recursively scans all files in the specified directories
202. Calculates a SHA-256 hash of all file contents and paths
213. Generates `src/checksum.ts` in each framework with the exported checksum value
224. The checksum is exported from `src/index.ts` and included in the built output
23
24### Integration
25
26The checksum generation runs automatically before each build via the `prebuild` script in:
27
28- `frameworks/react-cra/package.json`
29- `frameworks/solid/package.json`
30
31When running `pnpm build` at the root level, the checksums are automatically regenerated for both frameworks before TypeScript compilation.
32
33### Generated Files
34
35- `frameworks/react-cra/src/checksum.ts`
36- `frameworks/solid/src/checksum.ts`
37
38**Note:** These generated files should be committed to git as they are part of the package's public API and need to be tracked for proper version management.