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

feat: add vite import massager plugin #114

Merged
merged 1 commit into from
Sep 12, 2024
Merged

Conversation

SimeonC
Copy link
Contributor

@SimeonC SimeonC commented Sep 12, 2024

This should improve eslint performance for negligable vite performance as the straight string transforms are faster than the TS parsing needed for the eslint-plugin rule

BREAKING CHANGE: eslint-plugin has ‘forbidden imports’ replaced with vite plugin

To Migrate, add the vite plugin as in the README

new ImportMassagerPlugin([
'lodash',
'@fortawesome/pro-regular-svg-icons',
'@fortawesome/pro-solid-svg-icons',
'@fortawesome/free-regular-svg-icons',
'@fortawesome/free-brands-svg-icons',
{
transformPackages: ['@tablecheck/tablekit'],
packageName: '@carbon/icons-react',
importTransform: (importName) => {
if (importName.startsWith('WatsonHealth'))
return `/es/watson-health/${importName.replace(
'WatsonHealth',
'',
)}`;
if (importName.startsWith('Q') && importName.match(/^Q[A-Z]/g))
return `/es/Q/${importName.slice(1)}`;
return `/es/${importName}`;
},
},
]),

📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @tablecheck/[email protected]
npm install @tablecheck/[email protected]
npm install @tablecheck/[email protected]
# or 
yarn add @tablecheck/[email protected]
yarn add @tablecheck/[email protected]
yarn add @tablecheck/[email protected]

Copy link

github-actions bot commented Sep 12, 2024

Unit Test Results

    2 files      3 suites   19s ⏱️
247 tests 247 ✔️ 0 💤 0
267 runs  267 ✔️ 0 💤 0

Results for commit 6c0c2f9.

♻️ This comment has been updated with latest results.

@SimeonC SimeonC added the major Increment the major version when merged label Sep 12, 2024
@SimeonC SimeonC force-pushed the add-vite-imports-plugin branch 2 times, most recently from ab307b6 to 053f30b Compare September 12, 2024 04:57
This should improve eslint performance for negligable vite performance as the straight string transforms are faster than the TS parsing needed for the eslint-plugin rule

BREAKING CHANGE: eslint-plugin has ‘forbidden imports’ replaced with vite plugin
@SimeonC SimeonC force-pushed the add-vite-imports-plugin branch from 053f30b to 6c0c2f9 Compare September 12, 2024 05:01
@SimeonC SimeonC enabled auto-merge (rebase) September 12, 2024 05:56
@SimeonC SimeonC merged commit ae8809f into main Sep 12, 2024
5 checks passed
@SimeonC SimeonC deleted the add-vite-imports-plugin branch September 12, 2024 06:23
@tablecheck-public-automation

@tablecheck-public-automation tablecheck-public-automation added the released This issue/pull request has been released. label Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major Increment the major version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants