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

Move rollup to root package.json #5962

Merged
merged 6 commits into from
May 27, 2022
Merged

Move rollup to root package.json #5962

merged 6 commits into from
May 27, 2022

Conversation

alex-page
Copy link
Member

@alex-page alex-page commented May 27, 2022

Co-Authored-By: Ben Scott [email protected]

Added a skip changelog as I don't think that consumers would be affected by this change.

@alex-page alex-page added the 🤖Skip Changelog Causes CI to ignore changelog update check. label May 27, 2022
@github-actions
Copy link
Contributor

github-actions bot commented May 27, 2022

size-limit report 📦

Path Size
cjs 153.26 KB (0%)
esm 89.64 KB (0%)
esnext 144.64 KB (0%)
css 41.54 KB (0%)

Copy link
Member

@BPScott BPScott left a comment

Choose a reason for hiding this comment

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

Looking good. Happy to see this stuff be pulled up.

I see a few other rollup build related things that could be pulled up:

We should also pull up the dependencies on rollup (present in polaris-for-vscode, polaris-icons, polaris-tokens), @svgr/core (from polaris-icons), @shopify/browserslist-config (from polaris-tokens). Basically anything that gets mentioned from a rollup.config.js

We should also pull up and deduplicate the typescript dependency

polaris-react/package.json Show resolved Hide resolved
.eslintrc.js Outdated
@@ -53,6 +53,7 @@ module.exports = {
'@babel/no-unused-expressions': 'off',
'import/named': 'off',
'import/no-default-export': ['error'],
'import/no-extraneous-dependencies': ['error', {packageDir: ['../', './']}],
Copy link
Member Author

@alex-page alex-page May 27, 2022

Choose a reason for hiding this comment

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

@BPScott @aaronccasanova what do you think about this? It is working locally.

Copy link
Member

@BPScott BPScott May 27, 2022

Choose a reason for hiding this comment

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

I think this is ok but is is pretty brittle. It relies upon eslint being ran in the specific package folders.

If you don't do that, e.g. running yarn eslint ./polaris-react in the root of the repo, causes thousands of errors for me. It also means I see errors in vscode, as that doesn't run with the cwd you're assuming. Sample:

/Users/ben/src/github.com/Shopify/polaris/polaris-react/tests/utilities/react-testing.tsx
0:1  error  The package.json file could not be found                                                                                  import/no-extraneous-dependencies
  1:1  error  'react' should be listed in the project's dependencies. Run 'npm i -S react' to add it                                    import/no-extraneous-dependencies
  2:1  error  '@shopify/react-testing' should be listed in the project's dependencies. Run 'npm i -S @shopify/react-testing' to add it  import/no-extraneous-dependencies

I suspect:

  • These paths should be absolute so they don't depend upon the cwd
  • We'd need to add overrides for each package to reference the correct package.json for each package.

@alex-page alex-page removed the 🤖Skip Changelog Causes CI to ignore changelog update check. label May 27, 2022
Copy link
Member

@BPScott BPScott left a comment

Choose a reason for hiding this comment

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

🎉

@alex-page alex-page merged commit 3a64ee7 into main May 27, 2022
@alex-page alex-page deleted the mv-rollup-root branch May 27, 2022 22:41
This was referenced May 27, 2022
bernbecht pushed a commit that referenced this pull request May 30, 2022
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.

3 participants