Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function expandSourcePath(pattern) {
if (!pattern) {
return null;
}
// just returns the relative paths
if (pattern.startsWith('.')) {
return pattern;
}
// tries to resolve the packages, handling scoped packages
const splitPattern = pattern.split('/');
const packageName = pattern[0] == '@' ? `${splitPattern[0]}/${splitPattern[1]}` : splitPattern[0];
try {
const resolvedPackageJson = resolveCwd(`${packageName}/package.json`);
if (!resolvedPackageJson) {
// returns pattern if the packageName didn't contain a package.json (not really a package)
return pattern;
}
return pattern.replace(packageName, path.dirname(resolvedPackageJson));
} catch (e) {
console.error(e);
}
}
function basicPreset() {
// this adds a resolve path for the build tooling deps like TS from the scripts folder
addResolvePath(__dirname);
option('production');
// Adds an alias for 'npm-install-mode' for backwards compatibility
option('min', { alias: 'npm-install-mode' });
option('webpackConfig', { alias: 'w' });
// Build only commonjs (not other TS variants) but still run other tasks
option('commonjs');
option('cached', { default: false });
}
function basicPreset() {
// this adds a resolve path for the build tooling deps like TS from the scripts folder
addResolvePath(__dirname);
option('production');
// Adds an alias for 'npm-install-mode' for backwards compatibility
option('min', { alias: 'npm-install-mode' });
option('webpackConfig', { alias: 'w' });
// Build only commonjs (not other TS variants) but still run other tasks
option('commonjs');
option('cached', { default: false });
}
function basicPreset() {
// this adds a resolve path for the build tooling deps like TS from the scripts folder
addResolvePath(__dirname);
option('production');
// Adds an alias for 'npm-install-mode' for backwards compatibility
option('min', { alias: 'npm-install-mode' });
option('webpackConfig', { alias: 'w' });
// Build only commonjs (not other TS variants) but still run other tasks
option('commonjs');
option('cached', { default: false });
}
function basicPreset() {
// this adds a resolve path for the build tooling deps like TS from the scripts folder
addResolvePath(__dirname);
option('production');
// Adds an alias for 'npm-install-mode' for backwards compatibility
option('min', { alias: 'npm-install-mode' });
option('webpackConfig', { alias: 'w' });
// Build only commonjs (not other TS variants) but still run other tasks
option('commonjs');
option('cached', { default: false });
}
const dir = path.dirname(filePath);
if (!fs.existsSync(dir)) {
ensureDirectoryExists(dir);
fs.mkdirSync(dir);
}
}
task('prepareBundle', () => {
ensureDirectoryExists(
path.resolve(__dirname, 'dist/win32/dev/index.win32.bundle'),
);
});
task(
'build',
series(
condition('clean', () => argv().clean),
'eslint',
'initRNLibraries',
'copyFlowFiles',
'copyPngFiles',
// native-bundle:filtered
// trickle
// react-test
'ts',
condition('apiExtractorVerify', () => argv().ci),
'apiExtractorUpdate',
'apiDocumenter',
),
);
);
});
task(
'build',
series(
condition('clean', () => argv().clean),
'eslint',
'initRNLibraries',
'copyFlowFiles',
'copyPngFiles',
// native-bundle:filtered
// trickle
// react-test
'ts',
condition('apiExtractorVerify', () => argv().ci),
'apiExtractorUpdate',
'apiDocumenter',
),
);
// @ts-check
const path = require('path');
const { cleanTask } = require('just-scripts');
exports.clean = cleanTask(
[
'lib',
'temp',
'dist',
'lib-amd',
'lib-commonjs',
'lib-es2015', // Keep this in clean for actually cleaning up legacy content.
'coverage',
'src/**/*.scss.ts'
].map(p => path.join(process.cwd(), p))
);
// @ts-check
const path = require('path');
const { apiExtractorVerifyTask, apiExtractorUpdateTask } = require('just-scripts');
const configPath = path.resolve(process.cwd(), 'config/api-extractor.json');
exports.verifyApiExtractor = apiExtractorVerifyTask(configPath, undefined);
exports.updateApiExtractor = apiExtractorUpdateTask(configPath, undefined);
// @ts-check
const path = require('path');
const { apiExtractorVerifyTask, apiExtractorUpdateTask } = require('just-scripts');
const configPath = path.resolve(process.cwd(), 'config/api-extractor.json');
exports.verifyApiExtractor = apiExtractorVerifyTask(configPath, undefined);
exports.updateApiExtractor = apiExtractorUpdateTask(configPath, undefined);