How to use just-scripts - 10 common examples

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 OfficeDev / office-ui-fabric-react / scripts / tasks / copy.js View on Github external
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);
  }
}
github OfficeDev / office-ui-fabric-react / scripts / just.config.js View on Github external
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 });
}
github OfficeDev / office-ui-fabric-react / scripts / just.config.js View on Github external
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 });
}
github OfficeDev / office-ui-fabric-react / scripts / just.config.js View on Github external
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 });
}
github OfficeDev / office-ui-fabric-react / scripts / just.config.js View on Github external
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 });
}
github microsoft / react-native-windows / packages / react-native-win32 / just-task.js View on Github external
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',
  ),
);
github microsoft / react-native-windows / packages / react-native-win32 / just-task.js View on Github external
);
});

task(
  'build',
  series(
    condition('clean', () => argv().clean),
    'eslint',
    'initRNLibraries',
    'copyFlowFiles',
    'copyPngFiles',
    // native-bundle:filtered
    // trickle
    // react-test
    'ts',
    condition('apiExtractorVerify', () => argv().ci),
    'apiExtractorUpdate',
    'apiDocumenter',
  ),
);
github OfficeDev / office-ui-fabric-react / scripts / tasks / clean.js View on Github external
// @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))
);
github OfficeDev / office-ui-fabric-react / scripts / tasks / api-extractor.js View on Github external
// @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);
github OfficeDev / office-ui-fabric-react / scripts / tasks / api-extractor.js View on Github external
// @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);