Commit 19b3362
committed
refactor: create spdx-pack bundle to eliminate duplication
Consolidates spdx-correct and spdx-expression-parse into a single spdx-pack bundle to eliminate duplicate code. Individual spdx modules now re-export from spdx-pack as thin wrappers (~160 bytes each).
Changes:
- Add src/external/spdx-pack.js and .d.ts with spdx-correct and spdx-expression-parse
- Convert spdx-correct.js and spdx-expression-parse.js to wrappers
- Update build-externals config to bundle spdx-pack and copy wrappers
Bundle size impact:
- Before: 61KB total (36KB + 25KB)
- After: 44KB spdx-pack + 2 × ~160B wrappers = ~44.3KB total
- Savings: ~17KB (28% reduction)1 parent d382b78 commit 19b3362
5 files changed
Lines changed: 32 additions & 4 deletions
File tree
- scripts/build-externals
- src/external
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
0 commit comments