Skip to content

Commit

Permalink
build: manually add references to styled-jsx for rollup ecosystem (#681)
Browse files Browse the repository at this point in the history
* build: manually add references to styled-jsx for rollup ecosystem

* chore: release v2.2.4

* chore: remove unused files in package
  • Loading branch information
unix committed Jan 22, 2022
1 parent 890d083 commit fe6baec
Show file tree
Hide file tree
Showing 10 changed files with 1,551 additions and 75 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ esm
examples/**/yarn.lock
examples/**/out
examples/**/.next
examples/**/node_modules
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@geist-ui/core",
"version": "2.2.3",
"version": "2.2.4",
"main": "dist/index.js",
"module": "esm/index.js",
"types": "esm/index.d.ts",
Expand Down Expand Up @@ -38,10 +38,11 @@
"now-build": "yarn run docs-build",
"build:rollup": "rollup -c scripts/rollup.config.js",
"build:webpack": "webpack --config scripts/webpack.config.js",
"build:after": "node scripts/fix-styled-jsx.js",
"build:babel": "babel --config-file ./scripts/babel.config.js --extensions \".js,.ts,.tsx\" ./components --out-dir ./esm --ignore \"**/__tests__/**/*,**/*.d.ts\"",
"build:after": "node scripts/move-built-in.js",
"build:types": "ttsc -p ./scripts & ttsc -p ./scripts --outDir ./esm",
"build:esm-entry": "babel --config-file ./scripts/babel.config.js ./components/index.ts -o ./esm/index.js",
"build": "yarn clear && yarn build:rollup && yarn build:esm-entry && yarn build:types && yarn build:after",
"build": "yarn clear && yarn build:rollup && yarn build:babel && yarn build:types && yarn build:after",
"release": "yarn build && yarn publish --access public --non-interactive"
},
"files": [
Expand All @@ -50,13 +51,12 @@
],
"devDependencies": {
"@babel/cli": "^7.14.5",
"@babel/runtime": "^7.16.7",
"@babel/plugin-transform-runtime": "^7.14.5",
"@babel/preset-env": "^7.14.7",
"@babel/preset-react": "^7.14.5",
"@babel/preset-typescript": "^7.14.5",
"@geist-ui/prettier-config": "^1.0.1",
"@geist-ui/icons": "^1.0.1",
"@geist-ui/prettier-config": "^1.0.1",
"@mapbox/rehype-prism": "^0.6.0",
"@mdx-js/loader": "^1.6.22",
"@next/mdx": "^12.0.8",
Expand All @@ -71,15 +71,14 @@
"@types/react": "^17.0.38",
"@types/react-color": "^3.0.4",
"@types/react-dom": "^17.0.11",
"@types/styled-jsx": "^3.4.4",
"@typescript-eslint/eslint-plugin": "^4.27.0",
"@typescript-eslint/parser": "^4.27.0",
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.2",
"babel-jest": "^27.0.5",
"babel-plugin-transform-rename-import": "^2.3.0",
"css-mediaquery": "^0.1.2",
"enzyme": "^3.11.0",
"eslint": "^7.29.0",
"styled-jsx": "^4.0.1",
"eslint-config-prettier": "^6.11.0",
"eslint-config-ts-lambdas": "^1.2.3",
"eslint-plugin-react": "^7.22.0",
Expand All @@ -103,6 +102,8 @@
"typescript-transform-paths": "^3.3.1"
},
"dependencies": {
"@babel/runtime": "^7.16.7",
"styled-jsx": "4.0.1"
},
"peerDependencies": {
"react": ">=16.9.0",
Expand Down
10 changes: 10 additions & 0 deletions scripts/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ module.exports = {
'styled-jsx/babel',
['@babel/plugin-proposal-object-rest-spread', { loose: true }],
['@babel/plugin-transform-runtime', { useESModules: true }],
[
'transform-rename-import',
{
replacements: [
{ original: 'styled-jsx/style', replacement: '../styled-jsx.es.js' },
{ original: 'styled-jsx/server', replacement: '../styled-jsx-server.es.js' },
],
},
],
],

ignore: [/@babel[\\|/]runtime/],
}
4 changes: 4 additions & 0 deletions scripts/built-in/styled-jsx-server.es.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { server } from './styled-jsx.es'

export { server }
export default server

0 comments on commit fe6baec

Please sign in to comment.