Developer-DAO / web3-ui

A React UI library for Web3
https://web3-ui.vercel.app/
MIT License
763 stars 152 forks source link

`yarn release` is failing bc of missing Rollup CSS plugin #338

Closed Dhaiwat10 closed 2 years ago

Dhaiwat10 commented 2 years ago

Output when running yarn release on the next branch:

❯ nr release
yarn run v1.22.18
$ yarn build && changeset publish
$ preconstruct build
🎁 info building bundles!
🎁 error @web3-ui/components Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
🎁 error @web3-ui/components     at error (/Users/dhaiwat/code/web3-ui/node_modules/rollup/dist/shared/rollup.js:158:30)
🎁 error @web3-ui/components     at Module.error (/Users/dhaiwat/code/web3-ui/node_modules/rollup/dist/shared/rollup.js:12382:16)
🎁 error @web3-ui/components     at Module.tryParse (/Users/dhaiwat/code/web3-ui/node_modules/rollup/dist/shared/rollup.js:12785:25)
🎁 error @web3-ui/components     at Module.setSource (/Users/dhaiwat/code/web3-ui/node_modules/rollup/dist/shared/rollup.js:12688:24)
🎁 error @web3-ui/components     at ModuleLoader.addModuleSource (/Users/dhaiwat/code/web3-ui/node_modules/rollup/dist/shared/rollup.js:22161:20) {
🎁 error @web3-ui/components   code: 'PARSE_ERROR',
🎁 error @web3-ui/components   parserError: SyntaxError: Unexpected token (1:0)
🎁 error @web3-ui/components       at Parser.pp$5.raise (/Users/dhaiwat/code/web3-ui/node_modules/rollup/dist/shared/rollup.js:19547:13)
🎁 error @web3-ui/components       at Parser.pp.unexpected (/Users/dhaiwat/code/web3-ui/node_modules/rollup/dist/shared/rollup.js:16872:8)
🎁 error @web3-ui/components       at Parser.pp$4.parseExprAtom (/Users/dhaiwat/code/web3-ui/node_modules/rollup/dist/shared/rollup.js:18922:10)
🎁 error @web3-ui/components       at Parser.pp$4.parseExprSubscripts (/Users/dhaiwat/code/web3-ui/node_modules/rollup/dist/shared/rollup.js:18714:19)
🎁 error @web3-ui/components       at Parser.pp$4.parseMaybeUnary (/Users/dhaiwat/code/web3-ui/node_modules/rollup/dist/shared/rollup.js:18680:17)
🎁 error @web3-ui/components       at Parser.pp$4.parseExprOps (/Users/dhaiwat/code/web3-ui/node_modules/rollup/dist/shared/rollup.js:18613:19)
🎁 error @web3-ui/components       at Parser.pp$4.parseMaybeConditional (/Users/dhaiwat/code/web3-ui/node_modules/rollup/dist/shared/rollup.js:18596:19)
🎁 error @web3-ui/components       at Parser.pp$4.parseMaybeAssign (/Users/dhaiwat/code/web3-ui/node_modules/rollup/dist/shared/rollup.js:18564:19)
🎁 error @web3-ui/components       at Parser.pp$4.parseExpression (/Users/dhaiwat/code/web3-ui/node_modules/rollup/dist/shared/rollup.js:18528:19)
🎁 error @web3-ui/components       at Parser.pp$1.parseStatement (/Users/dhaiwat/code/web3-ui/node_modules/rollup/dist/shared/rollup.js:17062:45) {
🎁 error @web3-ui/components     pos: 0,
🎁 error @web3-ui/components     loc: Position { line: 1, column: 0 },
🎁 error @web3-ui/components     raisedAt: 1
🎁 error @web3-ui/components   },
🎁 error @web3-ui/components   id: '/Users/dhaiwat/code/web3-ui/packages/components/src/components/Address/Address.css',
🎁 error @web3-ui/components   pos: 0,
🎁 error @web3-ui/components   loc: {
🎁 error @web3-ui/components     column: 0,
🎁 error @web3-ui/components     file: '/Users/dhaiwat/code/web3-ui/packages/components/src/components/Address/Address.css',
🎁 error @web3-ui/components     line: 1
🎁 error @web3-ui/components   },
🎁 error @web3-ui/components   frame: '1: .Web3UI_Address__Container {\n' +
🎁 error @web3-ui/components     '   ^\n' +
🎁 error @web3-ui/components     '2:   display: flex;\n' +
🎁 error @web3-ui/components     '3:   align-items: center;',
🎁 error @web3-ui/components   watchFiles: [
🎁 error @web3-ui/components     '/Users/dhaiwat/code/web3-ui/packages/components/src/index.ts',
🎁 error @web3-ui/components     '/Users/dhaiwat/code/web3-ui/packages/components/src/components/index.ts',
🎁 error @web3-ui/components     '/Users/dhaiwat/code/web3-ui/packages/components/src/components/AddressInput/index.ts',
🎁 error @web3-ui/components     '/Users/dhaiwat/code/web3-ui/packages/components/src/components/Address/index.ts',
🎁 error @web3-ui/components     '/Users/dhaiwat/code/web3-ui/packages/components/src/components/EtherInput/index.ts',
🎁 error @web3-ui/components     '/Users/dhaiwat/code/web3-ui/packages/components/src/components/Provider/index.ts',
🎁 error @web3-ui/components     '/Users/dhaiwat/code/web3-ui/packages/components/src/components/TokenBalance/index.ts',
🎁 error @web3-ui/components     '/Users/dhaiwat/code/web3-ui/packages/components/src/components/NFTGallery/index.ts',
🎁 error @web3-ui/components     '/Users/dhaiwat/code/web3-ui/packages/components/src/components/NFT/index.ts',
🎁 error @web3-ui/components     '/Users/dhaiwat/code/web3-ui/packages/components/src/components/MultiAddressInput/index.ts',
🎁 error @web3-ui/components     '/Users/dhaiwat/code/web3-ui/packages/components/src/components/Address/Address.tsx',
🎁 error @web3-ui/components     '/Users/dhaiwat/code/web3-ui/packages/components/src/components/EtherInput/EtherInput.tsx',
🎁 error @web3-ui/components     '/Users/dhaiwat/code/web3-ui/packages/components/src/components/NFTGallery/NFTGallery.tsx',
🎁 error @web3-ui/components     '/Users/dhaiwat/code/web3-ui/packages/components/src/components/AddressInput/AddressInput.tsx',
🎁 error @web3-ui/components     '/Users/dhaiwat/code/web3-ui/packages/components/src/components/Provider/Provider.tsx',
🎁 error @web3-ui/components     '/Users/dhaiwat/code/web3-ui/packages/components/src/components/TokenBalance/TokenBalance.tsx',
🎁 error @web3-ui/components     '/Users/dhaiwat/code/web3-ui/packages/components/src/components/NFT/NFT.tsx',
🎁 error @web3-ui/components     '/Users/dhaiwat/code/web3-ui/packages/components/src/components/MultiAddressInput/MultiAddressInput.tsx',
🎁 error @web3-ui/components     '/Users/dhaiwat/code/web3-ui/packages/components/src/components/Address/Address.css'
🎁 error @web3-ui/components   ]
🎁 error @web3-ui/components }
🎁 info If want to learn more about the above error, check https://preconstruct.tools/errors
🎁 info If the error is not there and you want to learn more about it, open an issue at https://github.com/preconstruct/preconstruct/issues/new
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

We're missing a Rollup CSS plugin.

Dhaiwat10 commented 2 years ago

To test you can also run yarn build

revmischa commented 2 years ago

Does preconstruct even support CSS? I found this issue: https://github.com/preconstruct/preconstruct/issues/417

I can't find any mention of custom rollup config in the docs https://preconstruct.tools/configuration

BTW this is why I much prefer JSS to CSS... bundling CSS is always extremely cumbersome

Dhaiwat10 commented 2 years ago

@revmischa I see. Do you suggest we use something like stitches?

Dhaiwat10 commented 2 years ago

Fixed via #341