Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: build with typescript #438

Merged
merged 1 commit into from
Jul 20, 2022
Merged

chore: build with typescript #438

merged 1 commit into from
Jul 20, 2022

Conversation

bennypowers
Copy link
Member

@bennypowers bennypowers commented Jul 20, 2022

esbuild has difficulty with cases like "bundle these entry points, but don't bundle these specific files, treat them as separate imports, and don't bundle them into any other files that import them". This makes it hard to load rh-gllobal-footer.js separately.

Closes #429
See #420 (reply in thread) (nice)
cc @eyevana

What I did

  1. This commit replaces the per-element esbuild builds with a typescript build that uses a
    typescript transform to replace import specifiers ending with css with css.js,
  2. uses the node filesystem api to directly build shadow DOM css into their own javascript modules.

Testing Instructions

npm run build

check that the build is sane, try copying it into a separate node project and see that it works as expected. check that 11ty builds as expected

esbuild has difficulty with cases like "bundle these entry points, but
don't bundle these specific files, treat them as separate imports, and
don't bundle them into any other files that import them". This makes it
hard to load rh-global-footer separately.

This commit replaces the esbuild with a typescript build that uses a
typescript transform to replace import specifiers ending with `css` with
`css.js`, and uses the node filesystem api to directly build shadow DOM
css into their own javascript modules.
@changeset-bot
Copy link

changeset-bot bot commented Jul 20, 2022

🦋 Changeset detected

Latest commit: b5130a9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@rhds/elements Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link

netlify bot commented Jul 20, 2022

Deploy Preview for red-hat-design-system ready!

Name Link
🔨 Latest commit b5130a9
🔍 Latest deploy log https://app.netlify.com/sites/red-hat-design-system/deploys/62d7f68587c16c00098c7bd4
😎 Deploy Preview https://deploy-preview-438--red-hat-design-system.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 site settings.

@zhawkins
Copy link
Collaborator

Ship it 🚢

Copy link
Collaborator

@zeroedin zeroedin left a comment

Choose a reason for hiding this comment

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

Linux Gnu Torvalds Makefile

@bennypowers bennypowers merged commit bdc1121 into main Jul 20, 2022
@bennypowers bennypowers deleted the fix/unbundled branch July 20, 2022 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done ☑️
Development

Successfully merging this pull request may close these issues.

[bug] include global footer in npm package
3 participants