Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("reflect-metadata");
var tsc = require("@angular/tsc-wrapped");
var extractor_1 = require("./extractor");
function extract(ngOptions, cliOptions, program, host) {
return extractor_1.Extractor.create(ngOptions, program, host, cliOptions.locale)
.extract(cliOptions.i18nFormat, cliOptions.outFile);
}
// Entry point
if (require.main === module) {
var args = require('minimist')(process.argv.slice(2));
var project = args.p || args.project || '.';
var cliOptions = new tsc.I18nExtractionCliOptions(args);
tsc.main(project, cliOptions, extract, { noEmit: true })
.then(function (exitCode) { return process.exit(exitCode); })
.catch(function (e) {
console.error(e.stack);
console.error('Extraction failed');
process.exit(1);
});
}
//# sourceMappingURL=extract_i18n.js.map
var tmplParser = new private_import_compiler_1.TemplateParser(expressionParser, elementSchemaRegistry, htmlParser, console, []);
var resolver = new private_import_compiler_1.CompileMetadataResolver(new compiler.NgModuleResolver(staticReflector), new compiler.DirectiveResolver(staticReflector), new compiler.PipeResolver(staticReflector), elementSchemaRegistry, staticReflector);
var offlineCompiler = new compiler.OfflineCompiler(resolver, normalizer, tmplParser, new private_import_compiler_1.StyleCompiler(urlResolver), new private_import_compiler_1.ViewCompiler(config), new private_import_compiler_1.NgModuleCompiler(), new private_import_compiler_1.TypeScriptEmitter(reflectorHost), null, null);
// TODO(vicb): implicit tags & attributes
var messageBundle = new compiler.MessageBundle(htmlParser, [], {});
return new Extractor(program, compilerHost, staticReflector, messageBundle, reflectorHost, resolver, normalizer, offlineCompiler);
};
return Extractor;
}());
exports.Extractor = Extractor;
// Entry point
if (require.main === module) {
var args = require('minimist')(process.argv.slice(2));
var project = args.p || args.project || '.';
var cliOptions = new tsc.I18nExtractionCliOptions(args);
tsc.main(project, cliOptions, extract)
.then(function (exitCode) { return process.exit(exitCode); })
.catch(function (e) {
console.error(e.stack);
console.error('Extraction failed');
process.exit(1);
});
}
//# sourceMappingURL=extract_i18n.js.map
#!/usr/bin/env node
"use strict";
require('reflect-metadata');
var tsc = require('@angular/tsc-wrapped');
var codegen_1 = require('./codegen');
function codegen(ngOptions, cliOptions, program, host) {
return codegen_1.CodeGenerator.create(ngOptions, cliOptions, program, host).codegen();
}
// CLI entry point
if (require.main === module) {
var args = require('minimist')(process.argv.slice(2));
var project = args.p || args.project || '.';
var cliOptions = new tsc.NgcCliOptions(args);
tsc.main(project, cliOptions, codegen).then(function (exitCode) { return process.exit(exitCode); }).catch(function (e) {
console.error(e.stack);
console.error('Compilation failed');
process.exit(1);
});
}
//# sourceMappingURL=main.js.map
import * as tsc from '@angular/tsc-wrapped';
import {CodeGenerator} from './codegen';
function codegen(
ngOptions: tsc.AngularCompilerOptions, cliOptions: tsc.NgcCliOptions, program: ts.Program,
host: ts.CompilerHost) {
return CodeGenerator.create(ngOptions, cliOptions, program, host).codegen();
}
// CLI entry point
if (require.main === module) {
const args = require('minimist')(process.argv.slice(2));
const project = args.p || args.project || '.';
const cliOptions = new tsc.NgcCliOptions(args);
tsc.main(project, cliOptions, codegen).then(exitCode => process.exit(exitCode)).catch(e => {
console.error(e.stack);
console.error('Compilation failed');
process.exit(1);
});
}
default:
var htmlParser = new compiler.I18NHtmlParser(new compiler.HtmlParser());
ext = 'xlf';
serializer = new compiler.Xliff(htmlParser, compiler.DEFAULT_INTERPOLATION_CONFIG);
break;
}
var dstPath = path.join(ngOptions.genDir, "messages." + ext);
host.writeFile(dstPath, messageBundle.write(serializer), false);
});
}
// Entry point
if (require.main === module) {
var args = require('minimist')(process.argv.slice(2));
var project = args.p || args.project || '.';
var cliOptions = new tsc.I18nExtractionCliOptions(args);
tsc.main(project, cliOptions, extract)
.then(function (exitCode) { return process.exit(exitCode); })
.catch(function (e) {
console.error(e.stack);
console.error('Extraction failed');
process.exit(1);
});
}
//# sourceMappingURL=extract_i18n.js.map
function main(args, consoleError) {
if (consoleError === void 0) { consoleError = console.error; }
var project = args.p || args.project || '.';
var cliOptions = new tsc.NgcCliOptions(args);
return tsc.main(project, cliOptions, codegen).then(function () { return 0; }).catch(function (e) {
if (e instanceof tsc.UserError || e instanceof compiler_1.SyntaxError) {
consoleError(e.message);
return Promise.resolve(1);
}
else {
consoleError(e.stack);
consoleError('Compilation failed');
return Promise.resolve(1);
}
});
}
exports.main = main;
function buildNgc(moduleConf) {
const project = moduleConf.root;
const cliOptions = new tsc.NgcCliOptions({});
const test = tsc.main(project, cliOptions, codegen);
return test;
}
task(`${packageName}:build:esm:tests`, () => tsc(tsconfigTests, {basePath: packageRoot}));
task('library:build:esm:tests', () => tsc(tsconfigTests, {basePath: libraryRoot}));
task('library:build:esm', () => tsc(tsconfigBuild, {basePath: libraryRoot}));
task('library:build:bundles', () => buildPackageBundles(esmMainFile, 'material'));