@vanilla-extract/jest-transform
Advanced tools
Comparing version 0.0.0-inline-prototype-202342012537 to 0.0.0-jest-transform-identifiers-20241289814
import { Transformer } from '@jest/transform'; | ||
import { IdentifierOption } from '@vanilla-extract/integration'; | ||
declare const vanillaTransformer: Transformer; | ||
interface TransformerConfig { | ||
identifiers: IdentifierOption; | ||
} | ||
declare function createTransformer(config: TransformerConfig): Transformer; | ||
declare const _default: { | ||
createTransformer: typeof createTransformer; | ||
}; | ||
export { vanillaTransformer as default }; | ||
export { _default as default }; |
@@ -32,32 +32,40 @@ 'use strict'; | ||
const vanillaTransformer = { | ||
canInstrument: false, | ||
process(source, filePath, options) { | ||
if (!integration.cssFileFilter.test(filePath)) { | ||
// If the file that passes through to the transformer is not a VE file, | ||
// then it's likely a vanilla .css file (because Jest can't differentiate | ||
// between them) | ||
return { | ||
code: `module.exports = ${JSON.stringify(path__default["default"].basename(filePath))};` | ||
}; | ||
function createTransformer(config) { | ||
const { | ||
identifiers = 'debug' | ||
} = config; | ||
return { | ||
canInstrument: false, | ||
process(source, filePath, options) { | ||
if (!integration.cssFileFilter.test(filePath)) { | ||
// If the file that passes through to the transformer is not a VE file, | ||
// then it's likely a vanilla .css file (because Jest can't differentiate | ||
// between them) | ||
return { | ||
code: `module.exports = ${JSON.stringify(path__default["default"].basename(filePath))};` | ||
}; | ||
} | ||
const { | ||
name: packageName | ||
} = integration.getPackageInfo(options.config.rootDir); | ||
const code = integration.transformSync({ | ||
source, | ||
filePath, | ||
rootPath: options.config.rootDir, | ||
packageName: packageName, | ||
identOption: identifiers | ||
}); | ||
const result = esbuild__namespace.transformSync(code, { | ||
format: options.supportsStaticESM ? 'esm' : 'cjs', | ||
target: 'es2018', | ||
loader: 'ts' | ||
}); | ||
return result; | ||
} | ||
const { | ||
name: packageName | ||
} = integration.getPackageInfo(options.config.rootDir); | ||
const code = integration.transformSync({ | ||
source, | ||
filePath, | ||
rootPath: options.config.rootDir, | ||
packageName: packageName, | ||
identOption: 'debug' | ||
}); | ||
const result = esbuild__namespace.transformSync(code, { | ||
format: options.supportsStaticESM ? 'esm' : 'cjs', | ||
target: 'es2018', | ||
loader: 'ts' | ||
}); | ||
return result; | ||
} | ||
}; | ||
} | ||
var index = { | ||
createTransformer | ||
}; | ||
exports["default"] = vanillaTransformer; | ||
exports["default"] = index; |
@@ -32,32 +32,40 @@ 'use strict'; | ||
const vanillaTransformer = { | ||
canInstrument: false, | ||
process(source, filePath, options) { | ||
if (!integration.cssFileFilter.test(filePath)) { | ||
// If the file that passes through to the transformer is not a VE file, | ||
// then it's likely a vanilla .css file (because Jest can't differentiate | ||
// between them) | ||
return { | ||
code: `module.exports = ${JSON.stringify(path__default["default"].basename(filePath))};` | ||
}; | ||
function createTransformer(config) { | ||
const { | ||
identifiers = 'debug' | ||
} = config; | ||
return { | ||
canInstrument: false, | ||
process(source, filePath, options) { | ||
if (!integration.cssFileFilter.test(filePath)) { | ||
// If the file that passes through to the transformer is not a VE file, | ||
// then it's likely a vanilla .css file (because Jest can't differentiate | ||
// between them) | ||
return { | ||
code: `module.exports = ${JSON.stringify(path__default["default"].basename(filePath))};` | ||
}; | ||
} | ||
const { | ||
name: packageName | ||
} = integration.getPackageInfo(options.config.rootDir); | ||
const code = integration.transformSync({ | ||
source, | ||
filePath, | ||
rootPath: options.config.rootDir, | ||
packageName: packageName, | ||
identOption: identifiers | ||
}); | ||
const result = esbuild__namespace.transformSync(code, { | ||
format: options.supportsStaticESM ? 'esm' : 'cjs', | ||
target: 'es2018', | ||
loader: 'ts' | ||
}); | ||
return result; | ||
} | ||
const { | ||
name: packageName | ||
} = integration.getPackageInfo(options.config.rootDir); | ||
const code = integration.transformSync({ | ||
source, | ||
filePath, | ||
rootPath: options.config.rootDir, | ||
packageName: packageName, | ||
identOption: 'debug' | ||
}); | ||
const result = esbuild__namespace.transformSync(code, { | ||
format: options.supportsStaticESM ? 'esm' : 'cjs', | ||
target: 'es2018', | ||
loader: 'ts' | ||
}); | ||
return result; | ||
} | ||
}; | ||
} | ||
var index = { | ||
createTransformer | ||
}; | ||
exports["default"] = vanillaTransformer; | ||
exports["default"] = index; |
@@ -5,32 +5,40 @@ import path from 'path'; | ||
const vanillaTransformer = { | ||
canInstrument: false, | ||
process(source, filePath, options) { | ||
if (!cssFileFilter.test(filePath)) { | ||
// If the file that passes through to the transformer is not a VE file, | ||
// then it's likely a vanilla .css file (because Jest can't differentiate | ||
// between them) | ||
return { | ||
code: `module.exports = ${JSON.stringify(path.basename(filePath))};` | ||
}; | ||
function createTransformer(config) { | ||
const { | ||
identifiers = 'debug' | ||
} = config; | ||
return { | ||
canInstrument: false, | ||
process(source, filePath, options) { | ||
if (!cssFileFilter.test(filePath)) { | ||
// If the file that passes through to the transformer is not a VE file, | ||
// then it's likely a vanilla .css file (because Jest can't differentiate | ||
// between them) | ||
return { | ||
code: `module.exports = ${JSON.stringify(path.basename(filePath))};` | ||
}; | ||
} | ||
const { | ||
name: packageName | ||
} = getPackageInfo(options.config.rootDir); | ||
const code = transformSync({ | ||
source, | ||
filePath, | ||
rootPath: options.config.rootDir, | ||
packageName: packageName, | ||
identOption: identifiers | ||
}); | ||
const result = esbuild.transformSync(code, { | ||
format: options.supportsStaticESM ? 'esm' : 'cjs', | ||
target: 'es2018', | ||
loader: 'ts' | ||
}); | ||
return result; | ||
} | ||
const { | ||
name: packageName | ||
} = getPackageInfo(options.config.rootDir); | ||
const code = transformSync({ | ||
source, | ||
filePath, | ||
rootPath: options.config.rootDir, | ||
packageName: packageName, | ||
identOption: 'debug' | ||
}); | ||
const result = esbuild.transformSync(code, { | ||
format: options.supportsStaticESM ? 'esm' : 'cjs', | ||
target: 'es2018', | ||
loader: 'ts' | ||
}); | ||
return result; | ||
} | ||
}; | ||
} | ||
var index = { | ||
createTransformer | ||
}; | ||
export { vanillaTransformer as default }; | ||
export { index as default }; |
{ | ||
"name": "@vanilla-extract/jest-transform", | ||
"version": "0.0.0-inline-prototype-202342012537", | ||
"version": "0.0.0-jest-transform-identifiers-20241289814", | ||
"description": "Jest transformer for vanilla-extract", | ||
@@ -23,3 +23,3 @@ "main": "dist/vanilla-extract-jest-transform.cjs.js", | ||
"dependencies": { | ||
"@vanilla-extract/integration": "^0.0.0-inline-prototype-202342012537", | ||
"@vanilla-extract/integration": "^6.2.0", | ||
"esbuild": "0.17.6" | ||
@@ -26,0 +26,0 @@ }, |
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
10730
183
+ Added@vanilla-extract/integration@6.5.0(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedoutdent@0.8.0(transitive)
- Removed@vanilla-extract/integration@0.0.0-webpack-vite-compiler-wip-20240609024920(transitive)