ngx-i18n-combine
Version:
Merge i18n files from components and merge to common locale files
95 lines • 3.17 kB
JavaScript
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.cli = void 0;
const yargs_1 = __importDefault(require("yargs"));
const yargsHelpers = __importStar(require("yargs/helpers"));
const index_1 = require("../index");
const process = __importStar(require("process"));
exports.cli = (0, yargs_1.default)(yargsHelpers.hideBin(process.argv))
.usage('Extract and merge locale files.\nUsage: $0 [options]')
.version(require(`${__dirname}/../../package.json`).version)
.alias('version', 'v')
.help('help')
.alias('help', 'h')
.option('input', {
alias: 'i',
describe: 'Paths you would like to extract files from. You can use path expansion, glob patterns and multiple paths',
default: [process.env.PWD || process.cwd()],
type: 'array',
normalize: true
})
.option('output', {
alias: 'o',
describe: 'Paths where you would like to save merged files. You can use path expansion, glob patterns and multiple paths',
type: 'array',
normalize: true,
required: true
})
.option('indent', {
alias: 'it',
describe: 'Output format indentation',
default: '\t',
type: 'string'
})
.option('sort', {
alias: 's',
describe: 'Sort strings in alphabetical order when saving',
default: false,
type: 'boolean'
})
.option('minify', {
alias: 'm',
describe: 'Minify strings in output files',
default: false,
type: 'boolean'
})
.option('verbose', {
alias: 'vb',
describe: 'Log all output to console',
default: true,
type: 'boolean'
})
.option('watch', {
alias: 'w',
describe: 'Watch changes',
default: false,
type: 'boolean'
})
.exitProcess(true)
.parseSync();
const options = {
input: exports.cli.input,
output: exports.cli.output,
indent: exports.cli.indent,
sort: exports.cli.sort,
minify: exports.cli.minify,
verbose: exports.cli.verbose,
watch: exports.cli.watch
};
const parser = new index_1.Parser(options);
const compiller = new index_1.Compiller(options);
const combine = new index_1.Combine(options, parser, compiller);
combine.run();
//# sourceMappingURL=cli.js.map