Skip to content

Add withoutManifest() option to skip manifest file generation#153

Open
pawell67 wants to merge 1 commit into
spatie:mainfrom
pawell67:feature/optional-manifest-generation
Open

Add withoutManifest() option to skip manifest file generation#153
pawell67 wants to merge 1 commit into
spatie:mainfrom
pawell67:feature/optional-manifest-generation

Conversation

@pawell67

Copy link
Copy Markdown

What this does

Adds a withoutManifest() method to TypeScriptTransformerConfigFactory that allows opting out of manifest file generation.

Why

The typescript-transformer-manifest.json file is useful for caching (it prevents rewriting unchanged output files), but it can be undesirable in some workflows:

  • When the output directory is a committed git submodule — the manifest shows up as an unexpected new tracked file
  • When the output directory is version-controlled and a clean diff is preferred
  • When manifest-based caching is not needed (e.g. in CI)

Usage

$config
    ->outputDirectory(resource_path('frontend/types'))
    ->writer(new GlobalNamespaceWriter('generated.d.ts'))
    ->withoutManifest();

Changes

  • TypeScriptTransformerConfig — added bool $generateManifest = true property
  • TypeScriptTransformerConfigFactory — added withoutManifest() method and bool $generateManifest = true field, passed through to config
  • WriteFilesAction — when generateManifest is false, skips manifest read/write and writes all files directly

Some projects prefer not to have the typescript-transformer-manifest.json
file written to the output directory (e.g. when the output is a committed
submodule or when manifest-based caching is not desired).

This adds a `withoutManifest()` method to `TypeScriptTransformerConfigFactory`
that skips both reading and writing the manifest, causing all output files
to be written on every run.
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