@linaria/preeval
Advanced tools
Comparing version 3.0.0-beta.18 to 3.0.0-beta.19
@@ -6,2 +6,15 @@ # Change Log | ||
# [3.0.0-beta.19](https://github.com/callstack/linaria/compare/v3.0.0-beta.18...v3.0.0-beta.19) (2022-06-03) | ||
### Features | ||
* **babel:** api for custom tags ([#976](https://github.com/callstack/linaria/issues/976)) ([3285ccc](https://github.com/callstack/linaria/commit/3285ccc1d00449b78b3fc74087528cd38cbdd116)) | ||
* **babel:** new way for detecting tag imports ([#974](https://github.com/callstack/linaria/issues/974)) ([3305cfb](https://github.com/callstack/linaria/commit/3305cfb0c0f65abdacceeb7e6bad118c59f7d551)) | ||
* **core:** allow renaming of css template literals ([#973](https://github.com/callstack/linaria/issues/973)) ([8f59a82](https://github.com/callstack/linaria/commit/8f59a82400143ef35b6ffc7f024ad5e6a16552d8)) | ||
# [3.0.0-beta.18](https://github.com/callstack/linaria/compare/v3.0.0-beta.17...v3.0.0-beta.18) (2022-04-01) | ||
@@ -8,0 +21,0 @@ |
@@ -0,1 +1,3 @@ | ||
/* eslint-disable no-param-reassign */ | ||
/** | ||
@@ -5,3 +7,3 @@ * This file is a babel preset used to transform files inside evaluators. | ||
*/ | ||
import { GenerateClassNames, DetectStyledImportName, JSXElement, ProcessStyled, ProcessCSS } from '@linaria/babel-preset'; | ||
import { JSXElement, replaceTagWithValue, processTemplateExpression } from '@linaria/babel-preset'; | ||
@@ -42,4 +44,6 @@ const isHoistableExport = node => { | ||
path.traverse({ | ||
ImportDeclaration: p => DetectStyledImportName(babel, p, state), | ||
TaggedTemplateExpression: p => GenerateClassNames(babel, p, state, options), | ||
TaggedTemplateExpression: p => { | ||
processTemplateExpression(babel, 'preeval', p, state, options); | ||
replaceTagWithValue(p, state, options); | ||
}, | ||
JSXElement | ||
@@ -56,3 +60,5 @@ }); | ||
path.get('body').filter(isHoistableExport).forEach(p => { | ||
const node = p.node; | ||
const { | ||
node | ||
} = p; | ||
p.remove(); | ||
@@ -63,6 +69,3 @@ path.unshiftContainer('body', node); | ||
}, | ||
CallExpression: ProcessStyled, | ||
TaggedTemplateExpression: ProcessCSS // TaggedTemplateExpression is processed before CallExpression | ||
} | ||
} | ||
@@ -69,0 +72,0 @@ }; |
@@ -10,2 +10,4 @@ "use strict"; | ||
/* eslint-disable no-param-reassign */ | ||
/** | ||
@@ -49,4 +51,6 @@ * This file is a babel preset used to transform files inside evaluators. | ||
path.traverse({ | ||
ImportDeclaration: p => (0, _babelPreset.DetectStyledImportName)(babel, p, state), | ||
TaggedTemplateExpression: p => (0, _babelPreset.GenerateClassNames)(babel, p, state, options), | ||
TaggedTemplateExpression: p => { | ||
(0, _babelPreset.processTemplateExpression)(babel, 'preeval', p, state, options); | ||
(0, _babelPreset.replaceTagWithValue)(p, state, options); | ||
}, | ||
JSXElement: _babelPreset.JSXElement | ||
@@ -63,3 +67,5 @@ }); | ||
path.get('body').filter(isHoistableExport).forEach(p => { | ||
const node = p.node; | ||
const { | ||
node | ||
} = p; | ||
p.remove(); | ||
@@ -70,6 +76,3 @@ path.unshiftContainer('body', node); | ||
}, | ||
CallExpression: _babelPreset.ProcessStyled, | ||
TaggedTemplateExpression: _babelPreset.ProcessCSS // TaggedTemplateExpression is processed before CallExpression | ||
} | ||
} | ||
@@ -76,0 +79,0 @@ }; |
{ | ||
"name": "@linaria/preeval", | ||
"version": "3.0.0-beta.18", | ||
"version": "3.0.0-beta.19", | ||
"publishConfig": { | ||
@@ -18,2 +18,5 @@ "access": "public" | ||
"repository": "git@github.com:callstack/linaria.git", | ||
"engines": { | ||
"node": "^12.16.0 || >=13.7.0" | ||
}, | ||
"bugs": { | ||
@@ -42,3 +45,3 @@ "url": "https://github.com/callstack/linaria/issues" | ||
"dependencies": { | ||
"@linaria/babel-preset": "^3.0.0-beta.18" | ||
"@linaria/babel-preset": "^3.0.0-beta.19" | ||
}, | ||
@@ -48,3 +51,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "c3f093a3a7fb4e7c82d23e44adb19a94438da68c" | ||
"gitHead": "73aab0a3908325333e452b9cbd5e438a0f1de463" | ||
} |
@@ -8,4 +8,3 @@ /** | ||
import type { State, StrictOptions } from '@linaria/babel-preset'; | ||
import { ProcessStyled, ProcessCSS } from '@linaria/babel-preset'; | ||
import { Core } from './babel'; | ||
import type { Core } from './babel'; | ||
declare function index(babel: Core, options: StrictOptions): { | ||
@@ -17,9 +16,7 @@ visitor: { | ||
}; | ||
CallExpression: typeof ProcessStyled; | ||
TaggedTemplateExpression: typeof ProcessCSS; | ||
}; | ||
}; | ||
export default function preset(context: any, options: StrictOptions): { | ||
export default function preset(context: unknown, options: StrictOptions): { | ||
plugins: (StrictOptions | typeof index)[][]; | ||
}; | ||
export {}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
157
24083