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);
}
}
condition('jest', () => !argv().min),
series(
argv().commonjs ? 'ts:commonjs-only' : 'ts',
condition('lint-imports', () => !argv().min),
parallel(condition('webpack', () => !argv().min), condition('verify-api-extractor', () => !argv().min))
)
)
)
);
// Special case build for the serializer, which needs to absolutely run typescript and jest serially.
task('build-jest-serializer-merge-styles', series('ts', 'jest'));
task('build-commonjs-only', series('clean', 'ts:commonjs-only'));
task('code-style', series('prettier', 'tslint'));
task('update-api', series('clean', 'copy', 'sass', 'ts', 'update-api-extractor'));
task('dev', series('clean', 'copy', 'sass', 'webpack-dev-server'));
// Utility functions
function getPackage() {
if (packageJson) {
return packageJson;
}
let packagePath = path.resolve(process.cwd(), 'package.json');
if (fs.existsSync(packagePath)) {
packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
return packageJson;
}
// @ts-check
const { task, parallel } = require('just-task');
const { tscTask, copyTask, jestTask, outdatedTask, selfUpdateTask } = require('../lib/index');
//task('build', parallel(tscTask(), tscTask()));
task('ts', tscTask({}));
task(
'build',
parallel(() => {
return copyTask([], '');
})
);
task('test', jestTask());
task('start-test', jestTask({ watch: true }));
const spec = {
versionSpec: {
'just-task': 'latest',
'office-ui-fabric-react': '>=6.0.0 <7.0.0'
}
// @ts-check
const path = require('path');
const { task, series, condition, option, argv } = require('just-task');
const { tscTask, tslintTask, cleanTask } = require('just-scripts');
const libPath = path.resolve(process.cwd(), 'lib');
const srcPath = path.resolve(process.cwd(), 'src');
if (require('fs').existsSync(path.resolve(__dirname, '../../../scripts/just-task.js'))) {
require('../../../scripts/just-task')
} else {
option('production');
option('clean');
task('tslint', () => {
return tslintTask();
});
task('ts', () => {
return tscTask({
pretty: true,
...(argv().production && { inlineSources: true, sourceRoot: path.relative(libPath, srcPath) }),
target: 'es5',
outDir: 'lib',
module: 'commonjs',
});
});
task('clean', () => {
return cleanTask(['lib', 'temp', 'dist', 'coverage'].map(p => path.join(process.cwd(), p)));
});
task(
const download = require('./scripts/download')
const cleanup = require('./scripts/cleanup')
const {getArgvFromNpmEnv, getArgvFromPkgJson} = require('./scripts/npm_argv')
option('electron_version', {default: '5.0.8'});
option('runtime', {default: 'electron', choices: ['electron', 'node']});
option('platform', {default: process.platform, choices: ['darwin', 'win32']});
// option('packageVersion');
option('debug', {default: false, boolean: true});
option('silent', {default: false, boolean: true});
option('msvs_version', {default: '2015'});
const packageVersion = require('./package.json').version;
// npm run build:electron --
task('build:electron', () => {
build({
electronVersion: argv().electron_version,
runtime: argv().runtime,
platform: argv().platform,
packageVersion,
debug: argv().debug,
silent: argv().silent,
msvsVersion: argv().msvs_version
})
})
// npm run build:node --
task('build:node', () => {
build({
electronVersion: argv().electron_version,
runtime: 'node',
packageVersion,
condition('tslint', () => !argv().min),
condition('jest', () => !argv().min),
series(
argv().commonjs ? 'ts:commonjs-only' : 'ts',
condition('lint-imports', () => !argv().min),
parallel(condition('webpack', () => !argv().min), condition('verify-api-extractor', () => !argv().min))
)
)
)
);
// Special case build for the serializer, which needs to absolutely run typescript and jest serially.
task('build-jest-serializer-merge-styles', series('ts', 'jest'));
task('build-commonjs-only', series('clean', 'ts:commonjs-only'));
task('code-style', series('prettier', 'tslint'));
task('update-api', series('clean', 'copy', 'sass', 'ts', 'update-api-extractor'));
task('dev', series('clean', 'copy', 'sass', 'webpack-dev-server'));
// Utility functions
function getPackage() {
if (packageJson) {
return packageJson;
}
let packagePath = path.resolve(process.cwd(), 'package.json');
if (fs.existsSync(packagePath)) {
packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
return packageJson;
}
series(
argv().commonjs ? 'ts:commonjs-only' : 'ts',
condition('lint-imports', () => !argv().min),
parallel(condition('webpack', () => !argv().min), condition('verify-api-extractor', () => !argv().min))
)
)
)
);
// Special case build for the serializer, which needs to absolutely run typescript and jest serially.
task('build-jest-serializer-merge-styles', series('ts', 'jest'));
task('build-commonjs-only', series('clean', 'ts:commonjs-only'));
task('code-style', series('prettier', 'tslint'));
task('update-api', series('clean', 'copy', 'sass', 'ts', 'update-api-extractor'));
task('dev', series('clean', 'copy', 'sass', 'webpack-dev-server'));
// Utility functions
function getPackage() {
if (packageJson) {
return packageJson;
}
let packagePath = path.resolve(process.cwd(), 'package.json');
if (fs.existsSync(packagePath)) {
packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
return packageJson;
}
return undefined;
task('build:electron', () => {
build({
electronVersion: argv().electron_version,
runtime: argv().runtime,
platform: argv().platform,
packageVersion,
debug: argv().debug,
silent: argv().silent,
msvsVersion: argv().msvs_version
})
})
// npm run build:node --
task('build:electron', () => {
build({
electronVersion: argv().electron_version,
runtime: argv().runtime,
platform: argv().platform,
packageVersion,
debug: argv().debug,
silent: argv().silent,
msvsVersion: argv().msvs_version
})
})
// npm run build:node --
task('build:node', () => {
build({
electronVersion: argv().electron_version,
runtime: 'node',
packageVersion,
platform: argv().platform,
debug: argv().debug,
silent: argv().silent,
msvsVersion: argv().msvs_version
})
})
// npm run download --