Commit 516b2b8
committed
refactor: convert validate-npm-package-name to wrapper
Adds validate-npm-package-name to npm-core bundle and converts the standalone module to a thin wrapper that re-exports from npm-core for better deduplication.
Changes:
- Add validate-npm-package-name to src/external/npm-core.js and .d.ts
- Convert src/external/validate-npm-package-name.js to wrapper
- Update build-externals config to set validate-npm-package-name bundle: false
Bundle size impact:
- Before: 3.6KB standalone
- After: 171B wrapper (validate-npm-package-name now bundled in npm-core)
- Savings: ~3.4KB (94% reduction in wrapper overhead)1 parent 19b3362 commit 516b2b8
4 files changed
Lines changed: 10 additions & 4 deletions
File tree
- scripts/build-externals
- src/external
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| 15 | + | |
14 | 16 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments