Files
cypress/tooling/packherd
Adam Stone-Lord 28189fb577 chore: remove check-ts from Gulp (#27492)
* chore: update build-npm-modules script

* chore: update build-npm-modules script

* chore: update build-npm-modules script

* chore: update build-npm-modules script

* [run ci]

* we can't clean without building after

* update commands

* add config for data-context build step

* fix output configurations for npm packages, add gitignores

* revert changes to config and data-context build steps

* run with cache

* fix outputs for cli

* actually fix outputs

* test with cache

* chore: remove check-ts from Gulp and use Nx

* try limiting concurrency

* try concurrency 1

* add check-ts to packages where it is missing

---------

Co-authored-by: jordanpowell88 <jordan@jpdesigning.com>
2023-08-10 16:04:25 -04:00
..

@tooling/packherd

Herds all dependencies reachable from an entry and packs them.

Table of Contents

Summary

packherd has three main tasks:

  1. bundling application files and providing related metadata
  2. loading modules that have been bundled previously and are provided via fully instantiated module exports or definition functions that return a module export when invoked
  3. transpiling TypeScript modules on demand and maintaining a cache of them

1. is provided by this package. 2. and 3. are provided by @packages/packherd-require. While 1. and 2. are very related and work hand in hand, 3. is unrelated to them and was just added here since it is another feature that requires to intercept module loads.

Creating a Bundle with Packherd

Calling the packherd function and providing the desired packherd opts will return the Buffer of the bundle, a meta esbuild metafile, a Buffer containing the sourceMap if it was generated as well as any warnings that esbuild emitted.

The caller can then store this data or use it for further operations, i.e. to generate a snapshot as is the case for the v8-snapshot module.