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

Rename packages #1675

Merged
merged 70 commits into from
Jan 5, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
a92d0d0
WIP codemod for renaming
emmatown Dec 2, 2019
d0adefe
Lockfile changes
emmatown Dec 2, 2019
b3c687a
emotion -> @emotion/css
emmatown Dec 2, 2019
b9e065a
core -> react
emmatown Dec 2, 2019
2c29b38
Server stuff
emmatown Dec 2, 2019
088e2f3
Move removed packages to another directory
emmatown Dec 2, 2019
235cf6b
More things
emmatown Dec 2, 2019
f9c87ff
More things
emmatown Dec 2, 2019
5b9f62d
Some more things
emmatown Dec 2, 2019
834466d
Rename ESLint plugin
emmatown Dec 3, 2019
8fefbaa
Change name in @emotion/eslint-plugin CHANGELOG.md
emmatown Dec 5, 2019
a27ce89
Jest package and Babel plugin renmaes
emmatown Dec 5, 2019
97ac00f
Things
emmatown Dec 5, 2019
1bb0cdb
Update eslint plugin migration error message
emmatown Dec 5, 2019
de5f309
Formatting things
emmatown Dec 5, 2019
fd4af57
Fix some things
emmatown Dec 5, 2019
d907bc5
Upgrade babel-eslint
emmatown Dec 5, 2019
9d0cd2c
Add @emotion/pkg-renaming rule to ESLint config and run it
emmatown Dec 5, 2019
f531e7b
Update existing changesets
emmatown Dec 5, 2019
37fce68
Add some changesets
emmatown Dec 5, 2019
ecd0d92
Update removed-packages/create-emotion/src/index.js
emmatown Dec 9, 2019
53cefda
Update removed-packages/emotion/macro.js
emmatown Dec 9, 2019
0ada779
Update removed-packages/eslint-plugin-emotion/src/index.js
emmatown Dec 9, 2019
151d259
Merge branch 'next' into rename-packages
emmatown Dec 12, 2019
c5daf31
Update CodeSandbox CI config
emmatown Dec 12, 2019
aeef9e3
Fix some things
emmatown Dec 12, 2019
df06722
Fix more things
emmatown Dec 12, 2019
43f588d
Fix some stuff
emmatown Dec 12, 2019
e1456e6
Fix some more things
emmatown Dec 12, 2019
e7b6c20
More fixes
emmatown Dec 13, 2019
1eee2fc
Some things
emmatown Dec 13, 2019
6b186ae
Various updates for babel plugin
emmatown Dec 13, 2019
a0da5b6
Fix more things
emmatown Dec 13, 2019
af96613
Fix another thing
emmatown Dec 13, 2019
cbac45d
Things
emmatown Dec 13, 2019
8e3a1dd
More stuff
emmatown Dec 13, 2019
e8ac467
Bad linting rules.
emmatown Dec 13, 2019
c810b00
More things
emmatown Dec 13, 2019
586a10e
More changes
emmatown Dec 13, 2019
a5c3f02
Fix all the babel plugin stuff
emmatown Dec 13, 2019
217ccaf
Test the Babel plugin in dist tests because it's built now
emmatown Dec 13, 2019
208f0af
Fix docs site building maybe
emmatown Dec 13, 2019
08d2870
Update some snapshots
emmatown Dec 13, 2019
10b2423
Fix some more things
emmatown Dec 13, 2019
2e5d767
Hopefully actually fix it this time
emmatown Dec 13, 2019
09f2294
Replace @emotion/core with @emotion/react in a bunch of places
emmatown Dec 13, 2019
7a10f27
Fix TS types for @emotion/server/create-instance
emmatown Dec 16, 2019
3777dcd
Update snapshots
emmatown Dec 16, 2019
a53038b
Disable a TSLint rule
emmatown Dec 16, 2019
c5fac22
More changesets
emmatown Dec 17, 2019
14e8a65
Docs and things
emmatown Dec 17, 2019
1ff9c95
Fix more things
emmatown Dec 17, 2019
2f40e19
Fix a thing
emmatown Dec 17, 2019
fa7fe4b
Add a test:typescript script
emmatown Dec 18, 2019
567ab68
Merge branch 'next' into rename-packages
emmatown Dec 24, 2019
21a75c9
Use glob in CodeSandbox CI config
emmatown Dec 24, 2019
fe2d34b
Fix a thing
emmatown Dec 24, 2019
8b5d402
Fix TS things
emmatown Dec 24, 2019
0a8d700
ESLint plugin things
emmatown Dec 24, 2019
0937f45
Fix some things
emmatown Dec 24, 2019
6aa370f
Merge branch 'next' into rename-packages
emmatown Dec 31, 2019
575e6bb
Fix @emotion/server pkg.json syntax error
Andarist Jan 1, 2020
a68be5a
Update docs/package-summary.mdx
emmatown Jan 3, 2020
c9be621
Fix some things
emmatown Jan 3, 2020
431cf2d
Add docs for creating instances of @emotion/css
emmatown Jan 3, 2020
5bddee5
Fix some little things
emmatown Jan 4, 2020
26b5e96
Comment out a test
emmatown Jan 5, 2020
c5417de
Merge branch 'next' into rename-packages
emmatown Jan 5, 2020
1d44469
Fix some little things
emmatown Jan 5, 2020
efa8fae
ts@next..........
emmatown Jan 5, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
],
"plugins": [
"prettier",
"flowtype"
"flowtype",
"emotion"
],
"parser": "babel-eslint",
"rules": {
Expand All @@ -74,7 +75,8 @@
"no-template-curly-in-string": 0,
"camelcase": 0,
"import/no-duplicates": 0,
"flowtype/define-flow-type": 2
"flowtype/define-flow-type": 2,
"emotion/pkg-renaming": 2
},
"env": {
"browser": true
Expand Down
4 changes: 3 additions & 1 deletion packages/eslint-plugin-emotion/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import noVanilla from './rules/no-vanilla'
import syntaxPreference from './rules/syntax-preference'
import styledImport from './rules/styled-import'
import jsxImport from './rules/jsx-import'
import pkgRenaming from './rules/pkg-renaming'

export let rules = {
'import-from-emotion': importFromEmotion,
'no-vanilla': noVanilla,
'syntax-preference': syntaxPreference,
'styled-import': styledImport,
'jsx-import': jsxImport
'jsx-import': jsxImport,
'pkg-renaming': pkgRenaming
}
32 changes: 32 additions & 0 deletions packages/eslint-plugin-emotion/src/rules/pkg-renaming.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
let simpleMappings = {
Andarist marked this conversation as resolved.
Show resolved Hide resolved
'@emotion/core': '@emotion/react',
emotion: '@emotion/css',
'@emotion/styled-base': '@emotion/styled/base',
'jest-emotion': '@emotion/jest',
'babel-plugin-emotion': '@emotion/babel-plugin',
'create-emotion-server': '@emotion/server/create-instance',
'create-emotion': '@emotion/css/create-instance',
'emotion-server': '@emotion/server'
}

export default {
meta: {
fixable: 'code'
},
create(context) {
return {
ImportDeclaration(node) {
let maybeMapping = simpleMappings[node.source.value]
if (maybeMapping !== undefined) {
context.report({
node: node.source,
message: `${JSON.stringify(
node.source.value
)} should be imported from ${JSON.stringify(maybeMapping)}`,
fix: fixer => fixer.replaceText(node.source, `'${maybeMapping}'`)
})
}
}
}
}
}
19 changes: 13 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1788,6 +1788,11 @@
"@emotion/babel-plugin-jsx-pragmatic" "^0.1.4"
babel-plugin-emotion "^10.0.23"

"@emotion/css@^11.0.0-next.6":
version "11.0.0-next.6"
resolved "https://registry.yarnpkg.com/@emotion/css/-/css-11.0.0-next.6.tgz#776fae8b5c9e9cb21751f56e9b9a631fe3cfd327"
integrity sha512-+5M5ZDfErWIf8R37TeEjbBxneOond5W/PF/1UccNJYMNHjn3glH5RiCd65ysKJawwMGKv7U4TX+ehLEJb3zyNg==

"@emotion/serialize@^0.11.14":
version "0.11.14"
resolved "https://registry.yarnpkg.com/@emotion/serialize/-/serialize-0.11.14.tgz#56a6d8d04d837cc5b0126788b2134c51353c6488"
Expand Down Expand Up @@ -8549,6 +8554,14 @@ emojis-list@^2.0.0:
resolved "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389"
integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k=

emotion@^11.0.0-next.0:
version "11.0.0-next.0"
resolved "https://registry.yarnpkg.com/emotion/-/emotion-11.0.0-next.0.tgz#215f35a5c634a9cc50325e35181a6e37e0540d74"
integrity sha512-UNwPLbPXkUW/PP9WPXE6Qu6mWGHb9NHAXdvwc4r2feqfS2Q7BTJJk0Ynvs0zQmwvEJ0L344UF/Hs00NbFSub3w==
dependencies:
babel-plugin-emotion "^11.0.0-next.0"
create-emotion "^11.0.0-next.0"

encodeurl@~1.0.2:
version "1.0.2"
resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59"
Expand Down Expand Up @@ -11309,12 +11322,6 @@ global-prefix@^1.0.1:
version "1.0.2"
resolved "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz#dbf743c6c14992593c655568cb66ed32c0122ebe"
integrity sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=
dependencies:
expand-tilde "^2.0.2"
homedir-polyfill "^1.0.1"
ini "^1.3.4"
is-windows "^1.0.1"
which "^1.2.14"

global@^4.3.0:
version "4.4.0"
Expand Down