Skip to content

Do not pretty print item-metadata.js in production#432

Merged
Gaurav0 merged 1 commit into
LiberatedPixelCup:masterfrom
Gaurav0:do_not_pretty_print_item_metadata
Apr 21, 2026
Merged

Do not pretty print item-metadata.js in production#432
Gaurav0 merged 1 commit into
LiberatedPixelCup:masterfrom
Gaurav0:do_not_pretty_print_item_metadata

Conversation

@Gaurav0

@Gaurav0 Gaurav0 commented Apr 20, 2026

Copy link
Copy Markdown
Member

File Generation

The runtime UI loads dist/item-metadata.js, which Vite generates from the sheet JSON under sheet_definitions/ (and related inputs) when you run npm run dev or npm run build. Do not edit that file by hand.

The JSON embedded in each const assignment is pretty-printed when Vite runs in development (npm run dev) and compact (no indentation inside those objects) when Vite runs a production build (npm run build). Inspecting dist/item-metadata.js after a dev run is easier; CI and release artifacts use the compact form.

@Gaurav0
Gaurav0 requested review from cdvv7788 and jrconway3 April 20, 2026 11:45
@Gaurav0 Gaurav0 self-assigned this Apr 20, 2026
@Gaurav0 Gaurav0 added refactor changes internal implementation documentation labels Apr 20, 2026
@netlify

netlify Bot commented Apr 20, 2026

Copy link
Copy Markdown

Deploy Preview for liberatedpixelcup ready!

Name Link
🔨 Latest commit e98997c
🔍 Latest deploy log https://app.netlify.com/projects/liberatedpixelcup/deploys/69e611c5f87c6b00082d44fb
😎 Deploy Preview https://deploy-preview-432--liberatedpixelcup.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@argos-ci

argos-ci Bot commented Apr 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Apr 20, 2026, 5:11 PM

@Gaurav0 Gaurav0 added the enhancement New feature or request label Apr 20, 2026

@jrconway3 jrconway3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had a weird thing happen where I generated it, it minified properly... then I ran dev and it STAYED minified for some reason.

I deleted the file, re-built, and it worked...

But then I tried it again after I re-built:

  • Ran build (changed the existing "prettier" to minified)
  • Ran dev (changed the existing minified to "prettier")

@Gaurav0
Gaurav0 merged commit c688bb8 into LiberatedPixelCup:master Apr 21, 2026
12 checks passed
@Gaurav0
Gaurav0 deleted the do_not_pretty_print_item_metadata branch April 21, 2026 13:06
Gaurav0 added a commit that referenced this pull request Apr 22, 2026
Split generateSources metadata output into index-metadata.js (aliasMetadata,
categoryTree, metadataIndexes with byTypeName and hashMatch.itemsByTypeName),
palette-metadata.js, lite item-metadata.js, credits-metadata.js, and
layers-metadata.js. Use the same dev/prod JSON indent as PR #432.

Thread deps.env into generateSources so Vite dev uses pretty-printed JSON.
Wire resolve.alias and Rolldown code-splitting groups for all chunks; merge
lite + layers + credits in install-item-metadata and static HTML runners.
Node tests merge captured writes via mergeMetadataForTests.

Made-with: Cursor
Gaurav0 added a commit that referenced this pull request Apr 22, 2026
Expand CONTRIBUTING File Generation: five dist/*-metadata.js files, Vite plugin, catalog getters, catalogReady promises, PR #432 formatting for all modules, and clarify that validate-site-sources does not write dist/ (Vite does).

Update README Development generated-files blurb: five modules, catalog registration, dev vs build indentation, link to PR #432.

Fix tests glob line and validate-site-sources workflow placement after Prettier.

Made-with: Cursor
Gaurav0 added a commit that referenced this pull request Apr 23, 2026
Split generateSources metadata output into index-metadata.js (aliasMetadata,
categoryTree, metadataIndexes with byTypeName and hashMatch.itemsByTypeName),
palette-metadata.js, lite item-metadata.js, credits-metadata.js, and
layers-metadata.js. Use the same dev/prod JSON indent as PR #432.

Thread deps.env into generateSources so Vite dev uses pretty-printed JSON.
Wire resolve.alias and Rolldown code-splitting groups for all chunks; merge
lite + layers + credits in install-item-metadata and static HTML runners.
Node tests merge captured writes via mergeMetadataForTests.

Made-with: Cursor
Gaurav0 added a commit that referenced this pull request Apr 23, 2026
Expand CONTRIBUTING File Generation: five dist/*-metadata.js files, Vite plugin, catalog getters, catalogReady promises, PR #432 formatting for all modules, and clarify that validate-site-sources does not write dist/ (Vite does).

Update README Development generated-files blurb: five modules, catalog registration, dev vs build indentation, link to PR #432.

Fix tests glob line and validate-site-sources workflow placement after Prettier.

Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation enhancement New feature or request refactor changes internal implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants