当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript m2e-build-tools.sequenceTask函数代码示例

本文整理汇总了TypeScript中m2e-build-tools.sequenceTask函数的典型用法代码示例。如果您正苦于以下问题:TypeScript sequenceTask函数的具体用法?TypeScript sequenceTask怎么用?TypeScript sequenceTask使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了sequenceTask函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: join

/** Path to the compiled prerender file. Running this file just dumps the HTML output for now. */
const prerenderOutFile = join(outDir, 'prerender.js');

/** Task that builds the universal-app and runs the prerender script. */
task('universal:test-prerender', ['universal:build'], execTask(
  // Runs node with the tsconfig-paths module to alias the @angular/material dependency.
  'node', ['-r', 'tsconfig-paths/register', prerenderOutFile], {
    env: {TS_NODE_PROJECT: tsconfigPrerenderPath}
  }
));

task('universal:build', sequenceTask(
  'clean',
  ['material:build-release', 'cdk:build-release'],
  ['universal:copy-release', 'universal:copy-files'],
  'universal:build-app-ts',
  'universal:build-prerender-ts'
));

/** Task that builds the universal app in the output directory. */
task('universal:build-app-ts', ngcBuildTask(tsconfigAppPath));

/** Task that copies all files to the output directory. */
task('universal:copy-files', copyTask(appDir, outDir));

/** Task that builds the prerender script in the output directory. */
task('universal:build-prerender-ts', tsBuildTask(tsconfigPrerenderPath));

// As a workaround for https://github.com/angular/angular/issues/12249, we need to
// copy the Material and CDK ESM output inside of the universal-app output.
开发者ID:gnucoop,项目名称:material2-extra,代码行数:30,代码来源:universal.ts

示例2: join

const {outputDir} = buildConfig;

/** Path to the directory where all releases are living. */
const releasesDir = join(outputDir, 'releases');

/** Path to the demo-app output directory. */
const demoAppOut = join(outputDir, 'packages', 'demo-app');

/** Path to the tsconfig file that builds the AOT files. */
const tsconfigFile = join(demoAppOut, 'tsconfig-aot.json');

/** Builds the demo-app and m2e. To be able to run NGC, apply the metadata workaround. */
task('aot:deps', sequenceTask(
  'build:devapp',
  ['m2e:build-release'],
  'aot:copy-release'
));

// As a workaround for https://github.com/angular/angular/issues/12249, we need to
// copy the Material and CDK ESM output inside of the demo-app output.
task('aot:copy-release', () => {
  m2ePackages.forEach((p) => {
    copySync(join(releasesDir, `${p}`), join(demoAppOut, `${p}`));
  });
});

/** Build the demo-app and a release to confirm that the library is AOT-compatible. */
task('aot:build', sequenceTask('aot:deps', 'aot:compiler-cli'));

/** Build the demo-app and a release to confirm that the library is AOT-compatible. */
开发者ID:gnucoop,项目名称:material2-extra,代码行数:30,代码来源:aot.ts

示例3: minimist

import * as minimist from 'minimist';

const yellow = chalk.yellow, green = chalk.green, red = chalk.red, grey = chalk.grey;

/** Packages that will be published to NPM by the release task. */
export const releasePackages = [
  'calendar',
  'masonry',
];

/** Parse command-line arguments for release task. */
const argv = minimist(process.argv.slice(3));

/** Task that builds all releases that will be published. */
task(':publish:build-releases', sequenceTask(
  'clean',
  releasePackages.map(packageName => `${packageName}:build-release`)
));

/** Make sure we're logged in. */
task(':publish:whoami', execTask('npm', ['whoami'], {
  silent: true,
  errMessage: 'You must be logged in to publish.'
}));

task(':publish:logout', execTask('npm', ['logout']));


function _execNpmPublish(label: string, packageName: string): Promise<{}> | undefined {
  const packageDir = join(buildConfig.outputDir, 'releases', packageName);

  if (!statSync(packageDir).isDirectory()) {
开发者ID:gnucoop,项目名称:material2-extra,代码行数:32,代码来源:publish.ts

示例4: watch

  // copied over. Rebuilt the theme CSS using the updated SCSS mixins.
  watch(join(materialOutPath, '**/*.css'), [':build:devapp:scss', triggerLivereload]);
});

/** Path to the demo-app tsconfig file. */
const tsconfigPath = join(appDir, 'tsconfig-build.json');

task(':build:devapp:ts', tsBuildTask(tsconfigPath));
task(':build:devapp:scss', buildScssTask(outDir, appDir));
task(':build:devapp:assets', copyTask(appDir, outDir));
task('build:devapp', buildAppTask('devapp'));

task(':serve:devapp', serverTask(outDir, true));

task('serve:devapp', ['build:devapp'], sequenceTask(
  [':serve:devapp', 'calendar:watch', 'masonry:watch', ':watch:devapp']
));

/** Task that copies all vendors into the demo-app package. Allows hosting the app on firebase. */
task('stage-deploy:devapp', ['build:devapp'], () => {
  copyFiles(join(projectDir, 'node_modules'), vendorGlob, join(outDir, 'node_modules'));
  copyFiles(bundlesDir, '*.+(js|map)', join(outDir, 'dist/bundles'));
  copyFiles(materialOutPath, '**/prebuilt/*.+(css|map)', join(outDir, 'dist/packages/material'));
});

/**
 * Task that deploys the demo-app to Firebase. Firebase project will be the one that is
 * set for project directory using the Firebase CLI.
 */
task('deploy:devapp', ['stage-deploy:devapp'], () => {
  return firebaseTools.deploy({cwd: projectDir, only: 'hosting'})
开发者ID:gnucoop,项目名称:material2-extra,代码行数:31,代码来源:development.ts

示例5: require

import {join} from 'path';
import {task, watch} from 'gulp';
import {m2ePackages, buildConfig, sequenceTask} from 'm2e-build-tools';

// There are no type definitions available for these imports.
const runSequence = require('run-sequence');

const {packagesDir, projectDir} = buildConfig;

/** Builds everything that is necessary for karma. */
task(':test:build', sequenceTask(
  'clean',
  // Build ESM output of M2E that also includes all test files.
  ...m2ePackages.map((p) => `${p}:build-tests`),
));

/**
 * Runs the unit tests. Does not watch for changes.
 * This task should be used when running tests on the CI server.
 */
task('test:single-run', [':test:build'], (done: () => void) => {
  // Load karma not outside. Karma pollutes Promise with a different implementation.
  let karma = require('karma');

  new karma.Server({
    configFile: join(projectDir, 'test/karma.conf.js'),
    singleRun: true
  }, (exitCode: number) => {
    // Immediately exit the process if Karma reported errors, because due to
    // potential still running tunnel-browsers gulp won't exit properly.
    exitCode === 0 ? done() : process.exit(exitCode);
开发者ID:gnucoop,项目名称:material2-extra,代码行数:31,代码来源:unit-test.ts

示例6: join

// Path to the sources of the Ajf package.
const m2ePaths = m2ePackages.map((p) => join(packagesDir, `${p}`));
// Path to the release output of m2e.
const releasePaths = m2ePackages.map((p) => join(releasesDir, `${p}`));
// Matches all SCSS files in the library.
const allScssGlobs = m2ePaths.map((p) => join(p, '**/*.scss'));

[calendarPackage, masonryPackage].forEach((p) => {
  task(`m2e-${p.name}:build-release`, () => composeRelease(p));
});
/**
 * Overwrite the release task for the m2e package.
 */
task('m2e:build-release', ['m2e:prepare-release'], sequenceTask(
  ...m2ePackages.map((p) => `${p}:build-release`)
));

/**
 * Task that will build the material package. It will also copy all prebuilt themes and build
 * a bundled SCSS file for theming
 */
task('m2e:prepare-release', sequenceTask(
  ...m2ePackages.map((p) => `${p}:build`)
));


m2ePackages.forEach((m) => {
  task(`update-package-version:${m}`,
    execTask(join(packagesDir, '..', 'publish.sh'), ['-v', `-p ${m}`]));
});
开发者ID:gnucoop,项目名称:material2-extra,代码行数:30,代码来源:material2-extra-release.ts

示例7: join

import {join} from 'path';
import {default as chalk} from 'chalk';
import {releasePackages} from './publish';
import {sync as glob} from 'glob';
import {buildConfig, sequenceTask} from 'm2e-build-tools';

/** Path to the directory where all releases are created. */
const releasesDir = join(buildConfig.outputDir, 'releases');

/** RegExp that matches Angular component inline styles that contain a sourcemap reference. */
const inlineStylesSourcemapRegex = /styles: ?\[["'].*sourceMappingURL=.*["']/;

/** RegExp that matches Angular component metadata properties that refer to external resources. */
const externalReferencesRegex = /(templateUrl|styleUrls): *["'[]/;

task('validate-release', sequenceTask(':publish:build-releases', 'validate-release:check-bundles'));

/** Task that checks the release bundles for any common mistakes before releasing to the public. */
task('validate-release:check-bundles', () => {
  const releaseFailures = releasePackages
    .map(packageName => checkReleasePackage(packageName))
    .map((failures, index) => ({failures, packageName: releasePackages[index]}));

  releaseFailures.forEach(({failures, packageName}) => {
    failures.forEach(failure => console.error(chalk.red(`Failure (${packageName}): ${failure}`)));
  });

  if (releaseFailures.some(({failures}) => failures.length > 0)) {
    // Throw an error to notify Gulp about the failures that have been detected.
    throw 'Release output is not valid and not ready for being released.';
  } else {
开发者ID:gnucoop,项目名称:material2-extra,代码行数:31,代码来源:validate-release.ts

示例8: join

const appDir = join(packagesDir, 'e2e-app');
const outDir = join(outputDir, 'packages', 'e2e-app');

const PROTRACTOR_CONFIG_PATH = join(projectDir, 'test/protractor.conf.js');
const tsconfigPath = join(outDir, 'tsconfig-build.json');

/** Glob that matches all files that need to be copied to the output folder. */
const assetsGlob = join(appDir, '**/*.+(html|css|json|ts)');

/**
 * Builds and serves the e2e-app and runs protractor once the e2e-app is ready.
 */
task('e2e', sequenceTask(
  [':test:protractor:setup', 'serve:e2eapp'],
  ':test:protractor',
  ':serve:e2eapp:stop',
  'screenshots',
));

/** Task that builds the e2e-app in AOT mode. */
task('e2e-app:build', sequenceTask(
  'clean',
  ['material:build-release', 'cdk:build-release'],
  ['e2e-app:copy-release', 'e2e-app:copy-assets'],
  'e2e-app:build-ts'
));

/** Task that copies all required assets to the output folder. */
task('e2e-app:copy-assets', copyTask(assetsGlob, outDir));

/** Task that builds the TypeScript sources. Those are compiled inside of the dist folder. */
开发者ID:gnucoop,项目名称:material2-extra,代码行数:31,代码来源:e2e.ts


注:本文中的m2e-build-tools.sequenceTask函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。