react-native-builder-bob
Version:
CLI to build JavaScript files for React Native libraries
45 lines • 1.55 kB
JavaScript
import { type } from 'arktype';
const module = {
name: '"module"',
options: type({
esm: type('boolean').default(false),
babelrc: type('boolean').default(false),
configFile: type('boolean | string').default(false),
sourceMaps: type('boolean').default(true),
copyFlow: type('boolean').default(false),
jsxRuntime: type('"automatic" | "classic"').default('automatic'),
}),
};
const commonjs = {
name: '"commonjs"',
options: module.options,
};
const typescript = {
name: '"typescript"',
options: type({
project: 'string?',
tsc: 'string?',
}),
};
const codegen = {
name: '"codegen"',
};
const custom = {
name: '"custom"',
options: type({
script: 'string',
clean: 'string?',
}),
};
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const target = type.or(commonjs.name, module.name, typescript.name, codegen.name, custom.name);
export const config = type({
source: 'string',
output: 'string',
targets: type
.or(type.or(module.name, [module.name], [module.name, module.options]), type.or(commonjs.name, [commonjs.name], [commonjs.name, commonjs.options]), type.or(typescript.name, [typescript.name], [typescript.name, typescript.options]), type.or(codegen.name, [codegen.name]), [custom.name, custom.options])
.array()
.moreThanLength(0),
exclude: type.string.default('**/{__tests__,__fixtures__,__mocks__}/**'),
}).onDeepUndeclaredKey('reject');
//# sourceMappingURL=schema.js.map