@atlaskit/css 0.10.5 → 0.10.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/css
2
2
 
3
+ ## 0.10.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#137715](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/137715)
8
+ [`40696be85b10e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/40696be85b10e) -
9
+ Improvements to `primitives-emotion-to-compiled` codemod: remove unnecessary `tokens` import.
10
+
3
11
  ## 0.10.5
4
12
 
5
13
  ### Patch Changes
@@ -570,11 +570,26 @@ function updateImports(j: core.JSCodeshift, source: ReturnType<typeof j>) {
570
570
 
571
571
  // add token import
572
572
  if (!importsNeeded.token) {
573
- const tokenImport = j.importDeclaration(
574
- [j.importSpecifier(j.identifier('token'))],
575
- j.literal('@atlaskit/tokens'),
576
- );
577
- newImports.push(tokenImport);
573
+ let tokenUsed = false;
574
+ // check if token is used in the transformed code
575
+ source
576
+ .find(j.CallExpression, {
577
+ callee: {
578
+ type: 'Identifier',
579
+ name: 'token',
580
+ },
581
+ })
582
+ .forEach(() => {
583
+ tokenUsed = true;
584
+ });
585
+
586
+ if (tokenUsed) {
587
+ const tokenImport = j.importDeclaration(
588
+ [j.importSpecifier(j.identifier('token'))],
589
+ j.literal('@atlaskit/tokens'),
590
+ );
591
+ newImports.push(tokenImport);
592
+ }
578
593
  }
579
594
 
580
595
  // add new imports after any existing comments
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/css",
3
- "version": "0.10.5",
3
+ "version": "0.10.6",
4
4
  "description": "Style components backed by Atlassian Design System design tokens powered by Compiled CSS-in-JS.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -48,7 +48,7 @@
48
48
  "./test-utils": "./src/test-utils/index.tsx"
49
49
  },
50
50
  "dependencies": {
51
- "@atlaskit/tokens": "^4.6.0",
51
+ "@atlaskit/tokens": "^4.7.0",
52
52
  "@babel/runtime": "^7.0.0",
53
53
  "@compiled/react": "^0.18.3"
54
54
  },
@@ -59,7 +59,7 @@
59
59
  "@af/visual-regression": "^1.3.0",
60
60
  "@atlaskit/button": "^23.0.0",
61
61
  "@atlaskit/ds-lib": "^4.0.0",
62
- "@atlaskit/primitives": "^14.3.0",
62
+ "@atlaskit/primitives": "^14.4.0",
63
63
  "@emotion/react": "^11.7.1",
64
64
  "@testing-library/react": "^13.4.0",
65
65
  "@types/jscodeshift": "^0.11.0",