Skip to content

chore: migrate internal schemas package to npm-hosted package#472

Draft
JoshMock wants to merge 4 commits into
mainfrom
schemas-pkg
Draft

chore: migrate internal schemas package to npm-hosted package#472
JoshMock wants to merge 4 commits into
mainfrom
schemas-pkg

Conversation

@JoshMock

@JoshMock JoshMock commented Jul 10, 2026

Copy link
Copy Markdown
Member

I'm working on a standalone package for storing all Zod schemas. This removes the bundled package and depends on that package. Not ready to merge until @elastic/schemas is published to npm.

Major changes:

  • packages/es-schemas/ no longer exists; imports @elastic/schemas instead
  • Zod dependency is removed in favor of ajv

Results:

  • npm pack (gzip of compiled source) size reduced from 26MB to 18MB
  • speed benchmarks: equivalent
  • heap usage benchmarks: equivalent

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Error

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 1 0 0 0.24s
❌ COPYPASTE jscpd yes 54 no 0.71s
✅ REPOSITORY gitleaks yes no no 55.57s
✅ REPOSITORY git_diff yes no no 0.09s
✅ REPOSITORY secretlint yes no no 2.1s
✅ REPOSITORY trivy yes no no 17.36s
❌ TYPESCRIPT eslint 46 5 0 7.94s
✅ YAML yamllint 2 0 0 0.89s

Detailed Issues

❌ TYPESCRIPT / eslint - 5 errors
src/config/schema.ts
  29:5  warning  Unused eslint-disable directive (no problems were reported from '@typescript-eslint/no-require-imports')

src/factory.ts
  41:7  error  '_require' is assigned a value but never used  @typescript-eslint/no-unused-vars

src/kb/register.ts
  111:12  error  'e' is defined but never used  @typescript-eslint/no-unused-vars

src/lib/ajv-validate.ts
  51:5  warning  Unused eslint-disable directive (no problems were reported from '@typescript-eslint/no-explicit-any')

src/lib/json-schema-args.ts
  159:51  error  '_prop' is defined but never used  @typescript-eslint/no-unused-vars

✖ 5 problems (3 errors, 2 warnings)
  0 errors and 2 warnings potentially fixable with the `--fix` option.
❌ COPYPASTE / jscpd - 54 errors
Using config from .jscpd.json
Clone found (bash)
 - .buildkite/run-cloud-tests.sh [10:1 - 24:5] (15 lines, 75 tokens)
   .buildkite/run-es-tests.sh [24:1 - 38:5]
Clone found (bash)
 - .buildkite/run-es-tests.sh [26:1 - 51:78] (26 lines, 118 tokens)
   .buildkite/run-kb-tests.sh [107:1 - 132:7]
Clone found (bash)
 - .buildkite/run-es-tests.sh [63:1 - 94:30] (32 lines, 167 tokens)
   scripts/run-es-tests-local.sh [62:1 - 93:30]
Clone found (txt)
 - NOTICE.txt [11:1 - 40:54] (30 lines, 357 tokens)
   NOTICE.txt [218:1 - 232:7]
Clone found (txt)
 - NOTICE.txt [27:1 - 46:73] (20 lines, 263 tokens)
   NOTICE.txt [77:1 - 84:73]
Clone found (txt)
 - NOTICE.txt [27:1 - 46:73] (20 lines, 263 tokens)
   NOTICE.txt [95:1 - 114:73]
Clone found (txt)
 - NOTICE.txt [27:1 - 47:16] (21 lines, 267 tokens)
   NOTICE.txt [143:1 - 151:12]
Clone found (txt)
 - NOTICE.txt [27:1 - 46:73] (20 lines, 263 tokens)
   NOTICE.txt [195:1 - 214:73]
Clone found (txt)
 - NOTICE.txt [27:1 - 46:73] (20 lines, 263 tokens)
   NOTICE.txt [259:1 - 278:73]
Clone found (txt)
 - NOTICE.txt [27:1 - 46:73] (20 lines, 263 tokens)
   NOTICE.txt [313:1 - 332:73]
Clone found (txt)
 - NOTICE.txt [27:1 - 46:73] (20 lines, 263 tokens)
   NOTICE.txt [394:1 - 401:73]
Clone found (txt)
 - NOTICE.txt [27:1 - 46:73] (20 lines, 263 tokens)
   NOTICE.txt [443:1 - 462:73]
Clone found (txt)
 - NOTICE.txt [27:1 - 46:73] (20 lines, 263 tokens)
   NOTICE.txt [471:1 - 491:73]
Clone found (txt)
 - NOTICE.txt [27:1 - 46:73] (20 lines, 263 tokens)
   NOTICE.txt [502:1 - 521:73]
Clone found (txt)
 - NOTICE.txt [27:1 - 46:73] (20 lines, 263 tokens)
   NOTICE.txt [599:1 - 617:73]
Clone found (txt)
 - NOTICE.txt [27:1 - 47:2] (21 lines, 264 tokens)
   NOTICE.txt [747:1 - 767:7]
Clone found (txt)
 - NOTICE.txt [27:1 - 43:14] (17 lines, 191 tokens)
   NOTICE.txt [786:1 - 802:14]
Clone found (txt)
 - NOTICE.txt [27:1 - 46:73] (20 lines, 263 tokens)
   NOTICE.txt [831:1 - 850:73]
Clone found (txt)
 - NOTICE.txt [27:1 - 47:2] (21 lines, 264 tokens)
   NOTICE.txt [920:1 - 940:7]
Clone found (txt)
 - NOTICE.txt [27:1 - 46:73] (20 lines, 263 tokens)
   NOTICE.txt [1138:1 - 1145:73]
Clone found (txt)
 - NOTICE.txt [27:1 - 47:2] (21 lines, 264 tokens)
   NOTICE.txt [1157:1 - 1177:8]
Clone found (txt)
 - NOTICE.txt [27:1 - 46:73] (20 lines, 263 tokens)
   NOTICE.txt [1188:1 - 1207:73]
Clone found (txt)
 - NOTICE.txt [70:1 - 85:5] (16 lines, 371 tokens)
   NOTICE.txt [118:1 - 133:6]
Clone found (txt)
 - NOTICE.txt [70:1 - 85:5] (16 lines, 371 tokens)
   NOTICE.txt [154:1 - 169:6]
Clone found (txt)
 - NOTICE.txt [70:1 - 84:73] (15 lines, 369 tokens)
   NOTICE.txt [525:1 - 539:73]
Clone found (txt)
 - NOTICE.txt [70:1 - 84:73] (15 lines, 369 tokens)
   NOTICE.txt [1260:1 - 1274:73]
Clone found (txt)
 - NOTICE.txt [88:1 - 114:67] (27 lines, 348 tokens)
   NOTICE.txt [710:1 - 736:73]
Clone found (txt)
 - NOTICE.txt [93:20 - 115:6] (23 lines, 268 tokens)
   NOTICE.txt [566:15 - 588:6]
Clone found (txt)
 - NOTICE.txt [136:1 - 150:73] (15 lines, 371 tokens)
   NOTICE.txt [172:1 - 186:73]
Clone found (txt)
 - NOTICE.txt [136:1 - 150:73] (15 lines, 371 tokens)
   NOTICE.txt [636:1 - 650:73]
Clone found (txt)
 - NOTICE.txt [136:1 - 150:73] (15 lines, 371 tokens)
   NOTICE.txt [692:1 - 706:73]
Clone found (txt)
 - NOTICE.txt [136:1 - 150:73] (15 lines, 371 tokens)
   NOTICE.txt [1059:1 - 1073:73]
Clone found (txt)
 - NOTICE.txt [136:1 - 150:73] (15 lines, 371 tokens)
   NOTICE.txt [1077:1 - 1091:73]
Clone found (txt)
 - NOTICE.txt [136:1 - 150:73] (15 lines, 371 tokens)
   NOTICE.txt [1095:1 - 1109:73]
Clone found (txt)
 - NOTICE.txt [136:1 - 151:6] (16 lines, 373 tokens)
   NOTICE.txt [1113:1 - 1128:10]
Clone found (txt)
 - NOTICE.txt [216:1 - 231:72] (16 lines, 362 tokens)
   NOTICE.txt [233:1 - 248:73]
Clone found (txt)
 - NOTICE.txt [252:41 - 278:6] (27 lines, 282 tokens)
   NOTICE.txt [1278:27 - 1296:73]
Clone found (txt)
 - NOTICE.txt [289:1 - 302:73] (14 lines, 198 tokens)
   NOTICE.txt [341:1 - 355:73]
Clone found (txt)
 - NOTICE.txt [289:1 - 302:73] (14 lines, 198 tokens)
   NOTICE.txt [627:1 - 632:73]
Clone found (txt)
 - NOTICE.txt [289:1 - 302:73] (14 lines, 198 tokens)
   NOTICE.txt [1305:1 - 1318:73]
Clone found (txt)
 - NOTICE.txt [311:60 - 333:7] (23 lines, 268 tokens)
   NOTICE.txt [362:57 - 385:7]
Clone found (txt)
 - NOTICE.txt [339:19 - 356:6] (18 lines, 201 tokens)
   NOTICE.txt [1325:19 - 1342:6]
Clone found (txt)
 - NOTICE.txt [362:51 - 384:73] (23 lines, 268 tokens)
   NOTICE.txt [1033:41 - 1055:73]
Clone found (txt)
 - NOTICE.txt [412:1 - 432:73] (21 lines, 263 tokens)
   NOTICE.txt [861:1 - 881:73]
Clone found (txt)
 - NOTICE.txt [466:1 - 491:73] (26 lines, 350 tokens)
   NOTICE.txt [999:1 - 1024:73]
Clone found (txt)
 - NOTICE.txt [466:1 - 491:73] (26 lines, 350 tokens)
   NOTICE.txt [1211:1 - 1236:73]
Clone found (txt)
 - NOTICE.txt [660:1 - 672:19] (13 lines, 86 tokens)
   NOTICE.txt [808:1 - 814:19]
Clone found (txt)
 - NOTICE.txt [912:32 - 939:73] (28 lines, 379 tokens)
   NOTICE.txt [968:7 - 995:73]
Clone found (txt)
 - NOTICE.txt [913:1 - 940:8] (28 lines, 379 tokens)
   NOTICE.txt [941:1 - 968:8]
Clone found (typescript)
 - src/cli-schema.ts [328:24 - 340:4] (13 lines, 101 tokens)
   src/cli-schema.ts [343:36 - 355:4]
Clone found (typescript)
 - src/config/secret-store.ts [96:1 - 111:2] (16 lines, 78 tokens)
   src/config/writer.ts [42:1 - 57:2]
Clone found (typescript)
 - src/es/register.ts [85:56 - 98:71] (14 lines, 81 tokens)
   src/kb/register.ts [37:37 - 50:71]
Clone found (typescript)
 - src/lib/sanitize.ts [79:35 - 103:17] (25 lines, 125 tokens)
   src/lib/sanitize.ts [134:38 - 158:17]
Clone found (typescript)
 - src/lib/sanitize.ts [104:80 - 120:48] (17 lines, 85 tokens)
   src/lib/sanitize.ts [159:71 - 175:48]
┌────────────┬────────────────┬─────────────┬──────────────┬──────────────┬──────────────────┬───────────────────┐
│ Format     │ Files analyzed │ Total lines │ Total tokens │ Clones found │ Duplicated lines │ Duplicated tokens │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ bash       │ 15             │ 1311        │ 4858         │ 3            │ 70 (5.34%)       │ 360 (7.41%)       │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ javascript │ 8              │ 696         │ 3585         │ 0            │ 0 (0.00%)        │ 0 (0.00%)         │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ perl       │ 1              │ 168         │ 662          │ 0            │ 0 (0.00%)        │ 0 (0.00%)         │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ txt        │ 1              │ 1367        │ 20426        │ 46           │ 854 (62.47%)     │ 13503 (66.11%)    │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ typescript │ 72             │ 12369       │ 63477        │ 5            │ 80 (0.65%)       │ 470 (0.74%)       │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ Total:     │ 97             │ 15911       │ 93008        │ 54           │ 1004 (6.31%)     │ 14333 (15.41%)    │
└────────────┴────────────────┴─────────────┴──────────────┴──────────────┴──────────────────┴───────────────────┘
Found 54 clones.
HTML report saved to megalinter-reports/copy-paste/jscpd-report.html
ERROR: jscpd found too many duplicates (6.3%) over threshold (5.0%)
time: 188.341ms

Notices

📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)

See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant