Skip to content

Commit

Permalink
build: manually add references to styled-jsx for rollup ecosystem
Browse files Browse the repository at this point in the history
  • Loading branch information
unix committed Jan 22, 2022
1 parent 890d083 commit 18f37db
Show file tree
Hide file tree
Showing 10 changed files with 1,554 additions and 70 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
20 changes: 11 additions & 9 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-dev.0",
"main": "dist/index.js",
"module": "esm/index.js",
"types": "esm/index.d.ts",
Expand Down Expand Up @@ -38,25 +38,27 @@
"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": [
"/dist",
"/esm"
"/esm",
"/scripts/npm"
],
"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",
"@babel/runtime": "^7.16.7",
"@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 @@ -76,10 +78,10 @@
"@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 @@ -97,13 +99,13 @@
"rollup": "^2.64.0",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-local-resolve": "^1.0.7",
"styled-jsx": "4.0.1",
"ts-jest": "^27.0.3",
"ttypescript": "^1.5.13",
"typescript": "^4.5.4",
"typescript-transform-paths": "^3.3.1"
},
"dependencies": {
},
"dependencies": {},
"peerDependencies": {
"react": ">=16.9.0",
"react-dom": ">=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
Loading

0 comments on commit 18f37db

Please sign in to comment.