How to use the just-scripts.task function in just-scripts

To help you get started, we’ve selected a few just-scripts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / react-native-windows / packages / playground / just-task.js View on Github external
series,
  option,
  argv,
  tscTask,
  eslintTask,
} = require('just-scripts');
const libPath = path.resolve(process.cwd(), 'lib');
const srcPath = path.resolve(process.cwd(), 'src');

option('production');
option('clean');

task('eslint', () => {
  return eslintTask();
});
task('ts', () => {
  return tscTask({
    pretty: true,
    noEmit: true,
    ...(argv().production && {
      inlineSources: true,
      sourceRoot: path.relative(libPath, srcPath),
    }),
    target: 'es6',
    module: 'commonjs',
  });
});

task('build', series('eslint', 'ts'));
github microsoft / react-native-windows / vnext / just-task.js View on Github external
task('apiExtractorVerify', apiExtractorVerifyTask());
task('apiExtractorUpdate', apiExtractorUpdateTask());

task('apiDocumenter', () => {
  require('child_process').execSync(
    'npx @microsoft/api-documenter markdown -i temp -o docs/api',
    {stdio: 'inherit'},
  );
});

task('flow-check', () => {
  require('child_process').execSync('npx flow check', {stdio: 'inherit'});
});

task('eslint', () => {
  return eslintTask();
});
task('copyFlowFiles', () => {
  return copyTask(['src/**/*.js'], '.');
});
task('initRNLibraries', () => {
  require('./Scripts/copyRNLibraries').copyRNLibraries();
});

task('ts', () => {
  return tscTask({
    pretty: true,
    ...(argv().production && {
      inlineSources: true,
      sourceRoot: path.relative(libPath, srcPath),
    }),
github OfficeDev / office-ui-fabric-react / packages / codepen-loader / just.config.js View on Github external
task('ts', tscTask({ module: 'commonjs', outDir: './lib' }));

task(
  'copy',
  copyTask(
    [
      '../office-ui-fabric-react/src/utilities/exampleData.ts',
      '../office-ui-fabric-react/src/components/ExtendedPicker/examples/PeopleExampleData.ts',
      '../office-ui-fabric-react/src/common/TestImages.ts'
    ],
    'lib'
  )
);

task(
  'build',
  series('clean', 'copy', parallel('ts', condition('jest', () => !argv().min)))
).cached();
github OfficeDev / office-ui-fabric-react / scripts / just.config.js View on Github external
task('generate-version-files', generateVersionFiles);
  task('generate-package-manifest', generatePackageManifestTask);
  task('ts', () => {
    return argv().commonjs
      ? 'ts:commonjs-only'
      : parallel('ts:commonjs', 'ts:esm', condition('ts:amd', () => argv().production && !argv().min));
  });

  task('validate', fs.existsSync(path.join(process.cwd(), 'jest.config.js')) ? series('tslint', 'jest') : 'tslint');
  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'));

  task('build:node-lib', series('clean', 'copy', series(condition('validate', () => !argv().min), 'ts:commonjs-only'))).cached();

  task(
    'build',
    series(
      'clean',
      'copy',
      'sass',
      parallel(
        condition('validate', () => !argv().min),
        series(
          'ts',
          parallel(
            condition('webpack', () => !argv().min && !!resolveCwd('webpack.config.js')),
            condition('lint-imports', () => !argv().min)
          )
        )
      )
    )
github microsoft / react-native-windows / packages / E2ETest / just-task.js View on Github external
task,
  series,
  option,
  argv,
  tscTask,
  eslintTask,
} = require('just-scripts');
const fs = require('fs');

option('production');
option('clean');

task('eslint', () => {
  return eslintTask();
});
task('ts', () => {
  return tscTask({
    pretty: true,
    ...(argv().production && {
      inlineSources: true,
    }),
    target: 'es6',
    module: 'commonjs',
  });
});

task('prepareBundle', () => {
  const file = 'windows/ReactUWPTestApp/Bundle';
  if (!fs.existsSync(file)) {
    fs.mkdirSync(file);
  }
});
github OfficeDev / office-ui-fabric-react / scripts / just.config.js View on Github external
'copy',
      'sass',
      parallel(
        condition('validate', () => !argv().min),
        series(
          'ts',
          parallel(
            condition('webpack', () => !argv().min && !!resolveCwd('webpack.config.js')),
            condition('lint-imports', () => !argv().min)
          )
        )
      )
    )
  ).cached();

  task('no-op', () => {}).cached();
};