Dive into secure and efficient coding practices with our curated list of the top 10 examples showcasing 'kcd-scripts' in functional components in JavaScript. Our advanced machine learning engine meticulously scans each line of code, cross-referencing millions of open source libraries to ensure your implementation is not just functional, but also robust and secure. Elevate your React applications to new heights by mastering the art of handling side effects, API calls, and asynchronous operations with confidence and precision.
const jestConfig = require('kcd-scripts/config').jest
const babelHelpersList = require('@babel/helpers').list
module.exports = Object.assign(jestConfig, {
roots: ['.'],
testEnvironment: 'jsdom',
moduleNameMapper: babelHelpersList.reduce((aliasMap, helper) => {
aliasMap[
`@babel/runtime/helpers/esm/${helper}`
] = `@babel/runtime/helpers/${helper}`
return aliasMap
}, {}),
})
const jestConfig = require('kcd-scripts/config').jest
module.exports = Object.assign(jestConfig, {
displayName: 'react-render-callback',
roots: ['.'],
testEnvironment: 'jsdom',
transformIgnorePatterns: [],
})
const path = require('path')
const baseConfig = require('kcd-scripts/jest')
module.exports = {
...baseConfig,
rootDir: path.join(__dirname, '..'),
displayName: 'node',
testEnvironment: 'jest-environment-node',
coveragePathIgnorePatterns: [
...baseConfig.coveragePathIgnorePatterns,
'/__tests__/',
'/__node_tests__/',
],
testMatch: ['**/__node_tests__/**.js'],
}
const path = require('path')
const baseConfig = require('kcd-scripts/jest')
module.exports = {
...baseConfig,
rootDir: path.join(__dirname, '..'),
displayName: 'dom',
coveragePathIgnorePatterns: [
...baseConfig.coveragePathIgnorePatterns,
'/__tests__/',
'/__node_tests__/',
],
testEnvironment: 'jest-environment-jsdom',
}
const {jest: jestConfig} = require('kcd-scripts/config')
const config = Object.assign(jestConfig, {
roots: ['tests'],
testMatch: ['/**/*.spec.js'],
transform: {
...jestConfig.transform,
'^.+\\.svelte$': 'jest-transform-svelte',
'^.+\\.html$': 'svelte-test/transform',
},
transformIgnorePatterns: [
...jestConfig.transformIgnorePatterns,
'/node_modules/(?!svelte).+\\.js$',
],
moduleFileExtensions: [...jestConfig.moduleFileExtensions, 'svelte'],
})
module.exports = config
const {jest: jestConfig} = require('kcd-scripts/config')
const config = Object.assign(jestConfig, {
roots: ['tests'],
testMatch: ['/**/*.spec.js'],
transform: {
...jestConfig.transform,
'^.+\\.svelte$': 'jest-transform-svelte',
'^.+\\.html$': 'svelte-test/transform',
},
transformIgnorePatterns: [
...jestConfig.transformIgnorePatterns,
'/node_modules/(?!svelte).+\\.js$',
],
moduleFileExtensions: [...jestConfig.moduleFileExtensions, 'svelte'],
})
module.exports = config
const {jest: jestConfig} = require('kcd-scripts/config')
const config = Object.assign(jestConfig, {
roots: ['tests'],
testMatch: ['/**/*.spec.js'],
transform: {
...jestConfig.transform,
'^.+\\.svelte$': 'jest-transform-svelte',
'^.+\\.html$': 'svelte-test/transform',
},
transformIgnorePatterns: [
...jestConfig.transformIgnorePatterns,
'/node_modules/(?!svelte).+\\.js$',
],
moduleFileExtensions: [...jestConfig.moduleFileExtensions, 'svelte'],
})
module.exports = config
const rollupConfig = require('kcd-scripts/config').getRollupConfig()
const tiny = process.env.TINY
const esm = process.env.BUILD_FORMAT === 'esm'
Object.assign(rollupConfig, {
external: ['preact', 'react', 'glamor', 'prop-types'],
output: [
Object.assign(rollupConfig.output[0], {
exports: tiny || !esm ? 'default' : 'named',
name: 'glamorous',
globals: {
react: 'React',
preact: 'preact',
glamor: 'Glamor',
'prop-types': 'PropTypes',
},
const rollupConfig = require('kcd-scripts/config').getRollupConfig();
Object.assign(rollupConfig, {
external: ['preact', 'react', 'prop-types'],
output: [
Object.assign(rollupConfig.output[0], {
globals: {
react: 'React',
preact: 'preact',
'prop-types': 'PropTypes'
}
})
]
});
module.exports = rollupConfig;
module.exports = () => {
const getRollupConfig = require('kcd-scripts/config').getRollupConfig
const rollupConfig = getRollupConfig()
replace(rollupConfig.plugins, 'babel', () => {
const babel = require('rollup-plugin-babel')
return babel({
exclude: 'node_modules/**',
babelrc: true,
runtimeHelpers: true,
})
})
return rollupConfig
}