本文整理汇总了TypeScript中broccoli-merge-trees.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: destCopy
module.exports = function makeDartTree(destinationPath) {
var sourceTree = mergeTrees([getSourceTree(), getHtmlSourcesTree()]);
sourceTree = fixDartFolderLayout(sourceTree);
var dartTree = mergeTrees([sourceTree, getTemplatedPubspecsTree(), getDocsTree()]);
return destCopy(dartTree, destinationPath);
};
示例2: makeDartTree
module.exports = function makeDartTree() {
var sourceTree = mergeTrees([getSourceTree(), getHtmlSourcesTree()]);
sourceTree = fixDartFolderLayout(sourceTree);
var mergedResult = mergeTrees([sourceTree, getTemplatedPubspecsTree(), getDocsTree()]);
// Move the tree under the 'dart' folder.
return stew.mv(mergedResult, 'dart');
};
示例3: destCopy
module.exports = function makeDartTree(options: AngularBuilderOptions) {
var dartSources = dartfmt(getSourceTree(), {dartSDK: options.dartSDK, logs: options.logs});
var sourceTree = mergeTrees([dartSources, getHtmlSourcesTree()]);
sourceTree = fixDartFolderLayout(sourceTree);
var dartTree = mergeTrees([sourceTree, getTemplatedPubspecsTree(), getDocsTree()]);
return destCopy(dartTree, options.outputPath);
};
示例4: destCopy
module.exports = function makeDartTree(destinationPath) {
var sourceTree = mergeTrees([getSourceTree(), getHtmlSourcesTree()]);
sourceTree = fixDartFolderLayout(sourceTree);
var dartTree = mergeTrees([sourceTree, getTemplatedPubspecsTree(), getDocsTree()]);
// TODO(iminar): tree differ seems to have issues with trees created by mergeTrees, investigate!
// ENOENT error is thrown while doing fs.readdirSync on inputRoot
// in the meantime, we just do noop mv to create a new tree
dartTree = stew.mv(dartTree, '');
return destCopy(dartTree, destinationPath);
};
示例5: getSourceTree
function getSourceTree() {
// Transpile everything in 'modules' except for rtts_assertions.
var tsInputTree = modulesFunnel(['**/*.js', '**/*.ts', '**/*.dart'], ['rtts_assert/**/*']);
var transpiled = ts2dart.transpile(tsInputTree);
// Native sources, dart only examples, etc.
var dartSrcs = modulesFunnel(['**/*.dart']);
return mergeTrees([transpiled, dartSrcs]);
}
示例6: getSourceTree
function getSourceTree() {
// Transpile everything in 'modules' except for rtts_assertions.
var tsInputTree = modulesFunnel(['**/*.js', '**/*.ts', '**/*.dart'], ['rtts_assert/**/*']);
var transpiled = ts2dart(tsInputTree, {generateLibraryName: true, generateSourceMap: false});
// Native sources, dart only examples, etc.
var dartSrcs = modulesFunnel(['**/*.dart', '**/*.ng_meta.json', '**/css/**']);
return mergeTrees([transpiled, dartSrcs]);
}
示例7: getHtmlSourcesTree
function getHtmlSourcesTree() {
// Replace $SCRIPT$ markers in HTML files.
var htmlSrcsTree = stew.map(modulesFunnel(['*/src/**/*.html']), replaceScriptTagInHtml);
// Copy a url_params_to_form.js for each benchmark html file.
var urlParamsToFormTree = new MultiCopy('', {
srcPath: 'tools/build/snippets/url_params_to_form.js',
targetPatterns: ['modules/benchmarks*/src/*', 'modules/benchmarks*/src/*/*'],
});
urlParamsToFormTree = stew.rename(urlParamsToFormTree, stripModulePrefix);
return mergeTrees([htmlSrcsTree, urlParamsToFormTree]);
}
示例8: getDocsTree
function getDocsTree() {
// LICENSE files
var licenses = new MultiCopy('', {
srcPath: 'LICENSE',
targetPatterns: ['modules/*'],
exclude: ['*/rtts_assert'], // Not in dart.
});
licenses = stew.rename(licenses, stripModulePrefix);
// Documentation.
// Rename *.dart.md -> *.dart.
var mdTree = stew.rename(modulesFunnel(['**/*.dart.md']),
relativePath => relativePath.replace(/\.dart\.md$/, '.md'));
// Copy all assets, ignore .js. and .dart. (handled above).
var docs = modulesFunnel(['**/*.md', '**/*.png', '**/*.html', '**/*.css', '**/*.scss'],
['**/*.js.md', '**/*.dart.md']);
return mergeTrees([licenses, mdTree, docs]);
}
示例9: Funnel
outputPackages.forEach(function(destDir) {
var license = new Funnel('.', {files: ['LICENSE'], destDir: destDir});
nodeTree = mergeTrees([nodeTree, license]);
});
示例10: destCopy
module.exports = function makeNodeTree(destinationPath) {
// list of npm packages that this build will create
var outputPackages = ['angular2', 'benchpress', 'rtts_assert'];
var modulesTree = new Funnel('modules', {
include: ['angular2/**', 'benchpress/**', 'rtts_assert/**', '**/e2e_test/**'],
exclude: [
// the following code and tests are not compatible with CJS/node environment
'angular2/test/core/zone/**',
'angular2/test/test_lib/fake_async_spec.ts',
'angular2/test/services/xhr_impl_spec.ts',
'angular2/test/forms/**'
]
});
var nodeTree = transpileWithTraceur(modulesTree, {
destExtension: '.js',
destSourceMapExtension: '.map',
traceurOptions: {
sourceMaps: true,
annotations: true, // parse annotations
types: true, // parse types
script: false, // parse as a module
memberVariables: true, // parse class fields
typeAssertionModule: 'rtts_assert/rtts_assert',
// Don't use type assertions since this is partly transpiled by typescript
typeAssertions: false,
modules: 'commonjs'
}
});
// Now we add the LICENSE file into all the folders that will become npm packages
outputPackages.forEach(function(destDir) {
var license = new Funnel('.', {files: ['LICENSE'], destDir: destDir});
nodeTree = mergeTrees([nodeTree, license]);
});
// Get all docs and related assets and prepare them for js build
var docs = new Funnel(modulesTree, {include: ['**/*.md', '**/*.png'], exclude: ['**/*.dart.md']});
docs = stew.rename(docs, 'README.js.md', 'README.md');
// Generate shared package.json info
var BASE_PACKAGE_JSON = require(path.join(projectRootDir, 'package.json'));
var COMMON_PACKAGE_JSON = {
version: BASE_PACKAGE_JSON.version,
homepage: BASE_PACKAGE_JSON.homepage,
bugs: BASE_PACKAGE_JSON.bugs,
license: BASE_PACKAGE_JSON.license,
contributors: BASE_PACKAGE_JSON.contributors,
dependencies: BASE_PACKAGE_JSON.dependencies,
devDependencies: {
"yargs": BASE_PACKAGE_JSON.devDependencies['yargs'],
"gulp-sourcemaps": BASE_PACKAGE_JSON.devDependencies['gulp-sourcemaps'],
"gulp-traceur": BASE_PACKAGE_JSON.devDependencies['gulp-traceur'],
"gulp": BASE_PACKAGE_JSON.devDependencies['gulp'],
"gulp-rename": BASE_PACKAGE_JSON.devDependencies['gulp-rename'],
"through2": BASE_PACKAGE_JSON.devDependencies['through2']
}
};
// Add a .template extension since renderLodashTemplate strips one extension
var packageJsons = stew.rename(new Funnel(modulesTree, {include: ['**/package.json']}), '.json',
'.json.template');
packageJsons = renderLodashTemplate(
packageJsons, {files: ["**/**"], context: {'packageJson': COMMON_PACKAGE_JSON}});
// HACK: workaround for Traceur behavior.
// It expects all transpiled modules to contain this marker.
// TODO: remove this when we no longer use traceur
var traceurCompatibleTsModulesTree = replace(modulesTree, {
files: ['**/*.ts'],
patterns: [{
// Empty replacement needed so that replaceWithPath gets triggered...
match: /$/g,
replacement: ""
}],
replaceWithPath: function(path, content) {
if (!path.endsWith('.d.ts')) {
content += '\r\nexport var __esModule = true;\n';
}
return content;
}
});
var typescriptTree = compileWithTypescript(traceurCompatibleTsModulesTree, {
allowNonTsExtensions: false,
emitDecoratorMetadata: true,
declaration: true,
mapRoot: '', /* force sourcemaps to use relative path */
module: 'commonjs',
noEmitOnError: true,
rootDir: '.',
rootFilePaths: ['angular2/traceur-runtime.d.ts', 'angular2/globals.d.ts'],
sourceMap: true,
sourceRoot: '.',
target: 'ES5'
});
nodeTree = mergeTrees([nodeTree, typescriptTree, docs, packageJsons]);
//.........这里部分代码省略.........