vue3-gettext
Advanced tools
Comparing version 3.0.0-beta.4 to 3.0.0-beta.5
#!/usr/bin/env node | ||
'use strict'; | ||
var tslib = require('tslib'); | ||
var tslib_es6_js = require('/home/leo/projects/vue3-gettext/node_modules/tslib/tslib.es6.js'); | ||
var chalk = require('chalk'); | ||
@@ -11,9 +11,2 @@ var commandLineArgs = require('command-line-args'); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var chalk__default = /*#__PURE__*/_interopDefaultLegacy(chalk); | ||
var commandLineArgs__default = /*#__PURE__*/_interopDefaultLegacy(commandLineArgs); | ||
var fsPromises__default = /*#__PURE__*/_interopDefaultLegacy(fsPromises); | ||
var path__default = /*#__PURE__*/_interopDefaultLegacy(path); | ||
// Based on https://github.com/Polyconseil/easygettext/blob/master/src/compile.js | ||
@@ -60,13 +53,13 @@ var Pofile = require("pofile"); | ||
}; | ||
var compilePoFiles = function (localesPaths) { return tslib.__awaiter(void 0, void 0, void 0, function () { | ||
var compilePoFiles = function (localesPaths) { return tslib_es6_js.__awaiter(void 0, void 0, void 0, function () { | ||
var translations; | ||
return tslib.__generator(this, function (_a) { | ||
return tslib_es6_js.__generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
translations = {}; | ||
return [4 /*yield*/, Promise.all(localesPaths.map(function (lp) { return tslib.__awaiter(void 0, void 0, void 0, function () { | ||
return [4 /*yield*/, Promise.all(localesPaths.map(function (lp) { return tslib_es6_js.__awaiter(void 0, void 0, void 0, function () { | ||
var fileContent, data, lang; | ||
return tslib.__generator(this, function (_a) { | ||
return tslib_es6_js.__generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, fsPromises__default["default"].readFile(lp, { encoding: "utf-8" })]; | ||
case 0: return [4 /*yield*/, fsPromises.readFile(lp, { encoding: "utf-8" })]; | ||
case 1: | ||
@@ -93,6 +86,6 @@ fileContent = _a.sent(); | ||
var loadConfig = function (cliArgs) { return tslib.__awaiter(void 0, void 0, void 0, function () { | ||
var loadConfig = function (cliArgs) { return tslib_es6_js.__awaiter(void 0, void 0, void 0, function () { | ||
var moduleName, explorer, configRes, config, languagePath, joinPath, joinPathIfRelative; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o; | ||
return tslib.__generator(this, function (_p) { | ||
return tslib_es6_js.__generator(this, function (_p) { | ||
switch (_p.label) { | ||
@@ -117,3 +110,3 @@ case 0: | ||
languagePath = ((_a = config.output) === null || _a === void 0 ? void 0 : _a.path) || "./src/language"; | ||
joinPath = function (inputPath) { return path__default["default"].join(languagePath, inputPath); }; | ||
joinPath = function (inputPath) { return path.join(languagePath, inputPath); }; | ||
joinPathIfRelative = function (inputPath) { | ||
@@ -123,3 +116,3 @@ if (!inputPath) { | ||
} | ||
return path__default["default"].isAbsolute(inputPath) ? inputPath : path__default["default"].join(languagePath, inputPath); | ||
return path.isAbsolute(inputPath) ? inputPath : path.join(languagePath, inputPath); | ||
}; | ||
@@ -152,3 +145,3 @@ return [2 /*return*/, { | ||
try { | ||
options = commandLineArgs__default["default"](optionDefinitions); | ||
options = commandLineArgs(optionDefinitions); | ||
} | ||
@@ -159,5 +152,5 @@ catch (e) { | ||
} | ||
(function () { return tslib.__awaiter(void 0, void 0, void 0, function () { | ||
(function () { return tslib_es6_js.__awaiter(void 0, void 0, void 0, function () { | ||
var config, localesPaths, jsonRes, outputPath; | ||
return tslib.__generator(this, function (_a) { | ||
return tslib_es6_js.__generator(this, function (_a) { | ||
switch (_a.label) { | ||
@@ -167,9 +160,9 @@ case 0: return [4 /*yield*/, loadConfig(options)]; | ||
config = _a.sent(); | ||
console.info("Language directory: ".concat(chalk__default["default"].blueBright(config.output.path))); | ||
console.info("Locales: ".concat(chalk__default["default"].blueBright(config.output.locales))); | ||
console.info("Language directory: ".concat(chalk.blueBright(config.output.path))); | ||
console.info("Locales: ".concat(chalk.blueBright(config.output.locales))); | ||
console.info(); | ||
localesPaths = config.output.locales.map(function (loc) { | ||
return config.output.flat ? path__default["default"].join(config.output.path, "".concat(loc, ".po")) : path__default["default"].join(config.output.path, "".concat(loc, "/app.po")); | ||
return config.output.flat ? path.join(config.output.path, "".concat(loc, ".po")) : path.join(config.output.path, "".concat(loc, "/app.po")); | ||
}); | ||
return [4 /*yield*/, fsPromises__default["default"].mkdir(config.output.path, { recursive: true })]; | ||
return [4 /*yield*/, fsPromises.mkdir(config.output.path, { recursive: true })]; | ||
case 2: | ||
@@ -180,13 +173,13 @@ _a.sent(); | ||
jsonRes = _a.sent(); | ||
console.info("".concat(chalk__default["default"].green("Compiled json"), ": ").concat(chalk__default["default"].grey(JSON.stringify(jsonRes)))); | ||
console.info("".concat(chalk.green("Compiled json"), ": ").concat(chalk.grey(JSON.stringify(jsonRes)))); | ||
console.info(); | ||
if (!config.output.splitJson) return [3 /*break*/, 5]; | ||
return [4 /*yield*/, Promise.all(config.output.locales.map(function (locale) { return tslib.__awaiter(void 0, void 0, void 0, function () { | ||
return [4 /*yield*/, Promise.all(config.output.locales.map(function (locale) { return tslib_es6_js.__awaiter(void 0, void 0, void 0, function () { | ||
var outputPath; | ||
var _a; | ||
return tslib.__generator(this, function (_b) { | ||
return tslib_es6_js.__generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
outputPath = path__default["default"].join(config.output.jsonPath, "".concat(locale, ".json")); | ||
return [4 /*yield*/, fsPromises__default["default"].writeFile(outputPath, JSON.stringify((_a = {}, | ||
outputPath = path.join(config.output.jsonPath, "".concat(locale, ".json")); | ||
return [4 /*yield*/, fsPromises.writeFile(outputPath, JSON.stringify((_a = {}, | ||
_a[locale] = jsonRes[locale], | ||
@@ -196,3 +189,3 @@ _a)))]; | ||
_b.sent(); | ||
console.info("".concat(chalk__default["default"].green("Created"), ": ").concat(chalk__default["default"].blueBright(outputPath))); | ||
console.info("".concat(chalk.green("Created"), ": ").concat(chalk.blueBright(outputPath))); | ||
return [2 /*return*/]; | ||
@@ -207,6 +200,6 @@ } | ||
outputPath = config.output.jsonPath; | ||
return [4 /*yield*/, fsPromises__default["default"].writeFile(outputPath, JSON.stringify(jsonRes))]; | ||
return [4 /*yield*/, fsPromises.writeFile(outputPath, JSON.stringify(jsonRes))]; | ||
case 6: | ||
_a.sent(); | ||
console.info("".concat(chalk__default["default"].green("Created"), ": ").concat(chalk__default["default"].blueBright(outputPath))); | ||
console.info("".concat(chalk.green("Created"), ": ").concat(chalk.blueBright(outputPath))); | ||
_a.label = 7; | ||
@@ -213,0 +206,0 @@ case 7: return [2 /*return*/]; |
#!/usr/bin/env node | ||
'use strict'; | ||
var tslib = require('tslib'); | ||
var tslib_es6_js = require('/home/leo/projects/vue3-gettext/node_modules/tslib/tslib.es6.js'); | ||
var chalk = require('chalk'); | ||
var commandLineArgs = require('command-line-args'); | ||
var fs = require('fs'); | ||
var fs$1 = require('node:fs'); | ||
var glob = require('glob'); | ||
var path$1 = require('node:path'); | ||
var cosmiconfig = require('cosmiconfig'); | ||
var path = require('path'); | ||
var cosmiconfig = require('cosmiconfig'); | ||
var compilerSfc = require('@vue/compiler-sfc'); | ||
var fs = require('fs'); | ||
var gettextExtractor = require('gettext-extractor'); | ||
@@ -18,14 +20,6 @@ var validate = require('gettext-extractor/dist/utils/validate'); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var chalk__default = /*#__PURE__*/_interopDefaultLegacy(chalk); | ||
var commandLineArgs__default = /*#__PURE__*/_interopDefaultLegacy(commandLineArgs); | ||
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); | ||
var glob__default = /*#__PURE__*/_interopDefaultLegacy(glob); | ||
var path__default = /*#__PURE__*/_interopDefaultLegacy(path); | ||
var loadConfig = function (cliArgs) { return tslib.__awaiter(void 0, void 0, void 0, function () { | ||
var loadConfig = function (cliArgs) { return tslib_es6_js.__awaiter(void 0, void 0, void 0, function () { | ||
var moduleName, explorer, configRes, config, languagePath, joinPath, joinPathIfRelative; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o; | ||
return tslib.__generator(this, function (_p) { | ||
return tslib_es6_js.__generator(this, function (_p) { | ||
switch (_p.label) { | ||
@@ -50,3 +44,3 @@ case 0: | ||
languagePath = ((_a = config.output) === null || _a === void 0 ? void 0 : _a.path) || "./src/language"; | ||
joinPath = function (inputPath) { return path__default["default"].join(languagePath, inputPath); }; | ||
joinPath = function (inputPath) { return path.join(languagePath, inputPath); }; | ||
joinPathIfRelative = function (inputPath) { | ||
@@ -56,3 +50,3 @@ if (!inputPath) { | ||
} | ||
return path__default["default"].isAbsolute(inputPath) ? inputPath : path__default["default"].join(languagePath, inputPath); | ||
return path.isAbsolute(inputPath) ? inputPath : path.join(languagePath, inputPath); | ||
}; | ||
@@ -131,6 +125,6 @@ return [2 /*return*/, { | ||
var extractFromFiles = function (filePaths, potPath, config) { return tslib.__awaiter(void 0, void 0, void 0, function () { | ||
var extractFromFiles = function (filePaths, potPath, config) { return tslib_es6_js.__awaiter(void 0, void 0, void 0, function () { | ||
var extr, emptyExtractors, extractors, jsParser, htmlParser; | ||
var _a, _b; | ||
return tslib.__generator(this, function (_c) { | ||
return tslib_es6_js.__generator(this, function (_c) { | ||
switch (_c.label) { | ||
@@ -141,7 +135,7 @@ case 0: | ||
extractors = ((_b = (_a = config === null || config === void 0 ? void 0 : config.input) === null || _a === void 0 ? void 0 : _a.jsExtractorOpts) === null || _b === void 0 ? void 0 : _b.reduce(function (acc, item, index, array) { | ||
console.log("custom keyword: ".concat(chalk__default["default"].blueBright(item.keyword))); | ||
console.log("custom keyword: ".concat(chalk.blueBright(item.keyword))); | ||
acc.push(gettextExtractor.JsExtractors.callExpression([item.keyword, "[this].".concat(item.keyword)], item.options)); | ||
return acc; | ||
}, emptyExtractors)) || emptyExtractors; | ||
jsParser = extr.createJsParser(tslib.__spreadArray([ | ||
jsParser = extr.createJsParser(tslib_es6_js.__spreadArray([ | ||
gettextExtractor.JsExtractors.callExpression(["$gettext", "[this].$gettext"], { | ||
@@ -200,8 +194,8 @@ content: { | ||
]); | ||
return [4 /*yield*/, Promise.all(filePaths.map(function (fp) { return tslib.__awaiter(void 0, void 0, void 0, function () { | ||
return [4 /*yield*/, Promise.all(filePaths.map(function (fp) { return tslib_es6_js.__awaiter(void 0, void 0, void 0, function () { | ||
var buffer, _a, descriptor_1, errors; | ||
return tslib.__generator(this, function (_b) { | ||
return tslib_es6_js.__generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: return [4 /*yield*/, new Promise(function (res, rej) { | ||
return fs__default["default"].readFile(fp, "utf-8", function (err, data) { | ||
return fs.readFile(fp, "utf-8", function (err, data) { | ||
if (err) { | ||
@@ -271,3 +265,3 @@ rej(err); | ||
extr.savePotFile(potPath); | ||
console.info("".concat(chalk__default["default"].green("Extraction successful"), ", ").concat(chalk__default["default"].blueBright(potPath), " created.")); | ||
console.info("".concat(chalk.green("Extraction successful"), ", ").concat(chalk.blueBright(potPath), " created.")); | ||
extr.printStats(); | ||
@@ -293,3 +287,3 @@ return [2 /*return*/]; | ||
try { | ||
options = commandLineArgs__default["default"](optionDefinitions); | ||
options = commandLineArgs(optionDefinitions); | ||
} | ||
@@ -300,23 +294,11 @@ catch (e) { | ||
} | ||
var globPromise = function (pattern) { | ||
return new Promise(function (resolve, reject) { | ||
try { | ||
glob__default["default"](pattern, {}, function (er, res) { | ||
resolve(res); | ||
}); | ||
} | ||
catch (e) { | ||
reject(e); | ||
} | ||
}); | ||
}; | ||
var getFiles = function (config) { return tslib.__awaiter(void 0, void 0, void 0, function () { | ||
var getFiles = function (config) { return tslib_es6_js.__awaiter(void 0, void 0, void 0, function () { | ||
var allFiles, excludeFiles, filesFlat, excludeFlat; | ||
var _a; | ||
return tslib.__generator(this, function (_b) { | ||
return tslib_es6_js.__generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: return [4 /*yield*/, Promise.all((_a = config.input) === null || _a === void 0 ? void 0 : _a.include.map(function (pattern) { | ||
var searchPath = path__default["default"].join(config.input.path, pattern); | ||
console.info("Searching: ".concat(chalk__default["default"].blueBright(searchPath))); | ||
return globPromise(searchPath); | ||
var searchPath = path$1.join(config.input.path, pattern); | ||
console.info("Searching: ".concat(chalk.blueBright(searchPath))); | ||
return glob.glob(searchPath); | ||
}))]; | ||
@@ -326,10 +308,10 @@ case 1: | ||
return [4 /*yield*/, Promise.all(config.input.exclude.map(function (pattern) { | ||
var searchPath = path__default["default"].join(config.input.path, pattern); | ||
console.info("Excluding: ".concat(chalk__default["default"].blueBright(searchPath))); | ||
return globPromise(searchPath); | ||
var searchPath = path$1.join(config.input.path, pattern); | ||
console.info("Excluding: ".concat(chalk.blueBright(searchPath))); | ||
return glob.glob(searchPath); | ||
}))]; | ||
case 2: | ||
excludeFiles = _b.sent(); | ||
filesFlat = allFiles.reduce(function (prev, curr) { return tslib.__spreadArray(tslib.__spreadArray([], prev, true), curr, true); }, []); | ||
excludeFlat = excludeFiles.reduce(function (prev, curr) { return tslib.__spreadArray(tslib.__spreadArray([], prev, true), curr, true); }, []); | ||
filesFlat = allFiles.reduce(function (prev, curr) { return tslib_es6_js.__spreadArray(tslib_es6_js.__spreadArray([], prev, true), curr, true); }, []); | ||
excludeFlat = excludeFiles.reduce(function (prev, curr) { return tslib_es6_js.__spreadArray(tslib_es6_js.__spreadArray([], prev, true), curr, true); }, []); | ||
excludeFlat.forEach(function (file) { | ||
@@ -345,5 +327,5 @@ var index = filesFlat.indexOf(file); | ||
}); }; | ||
(function () { return tslib.__awaiter(void 0, void 0, void 0, function () { | ||
(function () { return tslib_es6_js.__awaiter(void 0, void 0, void 0, function () { | ||
var config, files, _i, _a, loc, poDir, poFile, isFile, linguasPath; | ||
return tslib.__generator(this, function (_b) { | ||
return tslib_es6_js.__generator(this, function (_b) { | ||
switch (_b.label) { | ||
@@ -353,6 +335,6 @@ case 0: return [4 /*yield*/, loadConfig(options)]; | ||
config = _b.sent(); | ||
console.info("Input directory: ".concat(chalk__default["default"].blueBright(config.input.path))); | ||
console.info("Output directory: ".concat(chalk__default["default"].blueBright(config.output.path))); | ||
console.info("Output POT file: ".concat(chalk__default["default"].blueBright(config.output.potPath))); | ||
console.info("Locales: ".concat(chalk__default["default"].blueBright(config.output.locales))); | ||
console.info("Input directory: ".concat(chalk.blueBright(config.input.path))); | ||
console.info("Output directory: ".concat(chalk.blueBright(config.output.path))); | ||
console.info("Output POT file: ".concat(chalk.blueBright(config.output.potPath))); | ||
console.info("Locales: ".concat(chalk.blueBright(config.output.locales))); | ||
console.info(); | ||
@@ -363,3 +345,3 @@ return [4 /*yield*/, getFiles(config)]; | ||
console.info(); | ||
files.forEach(function (f) { return console.info(chalk__default["default"].grey(f)); }); | ||
files.forEach(function (f) { return console.info(chalk.grey(f)); }); | ||
console.info(); | ||
@@ -374,6 +356,6 @@ return [4 /*yield*/, extractFromFiles(files, config.output.potPath, config)]; | ||
loc = _a[_i]; | ||
poDir = config.output.flat ? config.output.path : path__default["default"].join(config.output.path, loc); | ||
poFile = config.output.flat ? path__default["default"].join(poDir, "".concat(loc, ".po")) : path__default["default"].join(poDir, "app.po"); | ||
fs__default["default"].mkdirSync(poDir, { recursive: true }); | ||
isFile = fs__default["default"].existsSync(poFile) && fs__default["default"].lstatSync(poFile).isFile(); | ||
poDir = config.output.flat ? config.output.path : path$1.join(config.output.path, loc); | ||
poFile = config.output.flat ? path$1.join(poDir, "".concat(loc, ".po")) : path$1.join(poDir, "app.po"); | ||
fs$1.mkdirSync(poDir, { recursive: true }); | ||
isFile = fs$1.existsSync(poFile) && fs$1.lstatSync(poFile).isFile(); | ||
if (!isFile) return [3 /*break*/, 6]; | ||
@@ -383,3 +365,3 @@ return [4 /*yield*/, execShellCommand("msgmerge --lang=".concat(loc, " --update ").concat(poFile, " ").concat(config.output.potPath, " --backup=off"))]; | ||
_b.sent(); | ||
console.info("".concat(chalk__default["default"].green("Merged"), ": ").concat(chalk__default["default"].blueBright(poFile))); | ||
console.info("".concat(chalk.green("Merged"), ": ").concat(chalk.blueBright(poFile))); | ||
return [3 /*break*/, 9]; | ||
@@ -400,7 +382,7 @@ case 6: | ||
_b.sent(); | ||
fs__default["default"].chmodSync(poFile, 438); | ||
fs$1.chmodSync(poFile, 438); | ||
return [4 /*yield*/, execShellCommand("msgattrib --no-wrap --no-obsolete -o ".concat(poFile, " ").concat(poFile))]; | ||
case 8: | ||
_b.sent(); | ||
console.info("".concat(chalk__default["default"].green("Created"), ": ").concat(chalk__default["default"].blueBright(poFile))); | ||
console.info("".concat(chalk.green("Created"), ": ").concat(chalk.blueBright(poFile))); | ||
_b.label = 9; | ||
@@ -412,6 +394,6 @@ case 9: | ||
if (config.output.linguas === true) { | ||
linguasPath = path__default["default"].join(config.output.path, "LINGUAS"); | ||
fs__default["default"].writeFileSync(linguasPath, config.output.locales.join(" ")); | ||
linguasPath = path$1.join(config.output.path, "LINGUAS"); | ||
fs$1.writeFileSync(linguasPath, config.output.locales.join(" ")); | ||
console.info(); | ||
console.info("".concat(chalk__default["default"].green("Created"), ": ").concat(chalk__default["default"].blueBright(linguasPath))); | ||
console.info("".concat(chalk.green("Created"), ": ").concat(chalk.blueBright(linguasPath))); | ||
} | ||
@@ -418,0 +400,0 @@ return [2 /*return*/]; |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var vue = require('vue'); | ||
@@ -21,3 +19,5 @@ | ||
***************************************************************************** */ | ||
/* global Reflect, Promise, SuppressedError, Symbol */ | ||
var __assign = function() { | ||
@@ -34,2 +34,7 @@ __assign = Object.assign || function __assign(t) { | ||
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { | ||
var e = new Error(message); | ||
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; | ||
}; | ||
var EVALUATION_RE = /[[\].]{1,2}/g; | ||
@@ -36,0 +41,0 @@ /* Interpolation RegExp. |
@@ -36,3 +36,3 @@ import * as vue from 'vue'; | ||
[key: string]: any; | ||
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{ | ||
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{ | ||
tag: { | ||
@@ -69,3 +69,3 @@ type: StringConstructor; | ||
translateComment: string; | ||
}>; | ||
}, {}>; | ||
@@ -123,2 +123,4 @@ /** | ||
} | ||
type ParameterKeys<TString extends string> = TString extends `${infer _}%{${infer Key}}${infer Rest}` ? Key | ParameterKeys<Rest> : never; | ||
type Parameters<TString extends string> = Record<ParameterKeys<TString>, string>; | ||
type Language = UnwrapRef<{ | ||
@@ -131,14 +133,6 @@ available: GetTextOptions["availableLanguages"]; | ||
sourceCodeLanguage?: string; | ||
$gettext: (msgid: string, parameters?: { | ||
[key: string]: string; | ||
}, disableHtmlEscaping?: boolean) => string; | ||
$pgettext: (context: string, msgid: string, parameters?: { | ||
[key: string]: string; | ||
}, disableHtmlEscaping?: boolean) => string; | ||
$ngettext: (msgid: string, plural: string, n: number, parameters?: { | ||
[key: string]: string; | ||
}, disableHtmlEscaping?: boolean) => string; | ||
$npgettext: (context: string, msgid: string, plural: string, n: number, parameters?: { | ||
[key: string]: string; | ||
}, disableHtmlEscaping?: boolean) => string; | ||
$gettext: <TString extends string>(msgid: TString, parameters?: Parameters<TString>, disableHtmlEscaping?: boolean) => string; | ||
$pgettext: <TString extends string>(context: string, msgid: TString, parameters?: Parameters<TString>, disableHtmlEscaping?: boolean) => string; | ||
$ngettext: <TSingular extends string, TPlural extends string>(msgid: TSingular, plural: TPlural, n: number, parameters?: Parameters<TSingular> & Parameters<TPlural>, disableHtmlEscaping?: boolean) => string; | ||
$npgettext: <TSingular extends string, TPlural extends string>(context: string, msgid: TSingular, plural: TPlural, n: number, parameters?: Parameters<TSingular> & Parameters<TPlural>, disableHtmlEscaping?: boolean) => string; | ||
interpolate: (msgid: string, context: object, disableHtmlEscaping?: boolean) => string; | ||
@@ -178,3 +172,3 @@ install: (app: App) => void; | ||
} | ||
declare module "vue" { | ||
declare module "@vue/runtime-core" { | ||
interface ComponentCustomProperties extends Pick<Language, "$gettext" | "$pgettext" | "$ngettext" | "$npgettext"> { | ||
@@ -203,14 +197,6 @@ $language: Language; | ||
sourceCodeLanguage?: string | undefined; | ||
$gettext: (msgid: string, parameters?: { | ||
[key: string]: string; | ||
} | undefined, disableHtmlEscaping?: boolean | undefined) => string; | ||
$pgettext: (context: string, msgid: string, parameters?: { | ||
[key: string]: string; | ||
} | undefined, disableHtmlEscaping?: boolean | undefined) => string; | ||
$ngettext: (msgid: string, plural: string, n: number, parameters?: { | ||
[key: string]: string; | ||
} | undefined, disableHtmlEscaping?: boolean | undefined) => string; | ||
$npgettext: (context: string, msgid: string, plural: string, n: number, parameters?: { | ||
[key: string]: string; | ||
} | undefined, disableHtmlEscaping?: boolean | undefined) => string; | ||
$gettext: <TString extends string>(msgid: TString, parameters?: Parameters<TString> | undefined, disableHtmlEscaping?: boolean | undefined) => string; | ||
$pgettext: <TString_1 extends string>(context: string, msgid: TString_1, parameters?: Parameters<TString_1> | undefined, disableHtmlEscaping?: boolean | undefined) => string; | ||
$ngettext: <TSingular extends string, TPlural extends string>(msgid: TSingular, plural: TPlural, n: number, parameters?: (Parameters<TSingular> & Parameters<TPlural>) | undefined, disableHtmlEscaping?: boolean | undefined) => string; | ||
$npgettext: <TSingular_1 extends string, TPlural_1 extends string>(context: string, msgid: TSingular_1, plural: TPlural_1, n: number, parameters?: (Parameters<TSingular_1> & Parameters<TPlural_1>) | undefined, disableHtmlEscaping?: boolean | undefined) => string; | ||
interpolate: (msgid: string, context: object, disableHtmlEscaping?: boolean | undefined) => string; | ||
@@ -264,3 +250,3 @@ install: (app: App<any>) => void; | ||
[key: string]: any; | ||
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{ | ||
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{ | ||
tag: { | ||
@@ -297,6 +283,6 @@ type: StringConstructor; | ||
translateComment: string; | ||
}>; | ||
}, {}>; | ||
}; | ||
declare const defineGettextConfig: (config: GettextConfigOptions) => GettextConfigOptions; | ||
export { GetTextOptions, GettextConfig, GettextConfigOptions, Language, LanguageData, Message, Translations, createGettext, defineGettextConfig, useGettext }; | ||
export { type GetTextOptions, type GettextConfig, type GettextConfigOptions, type Language, type LanguageData, type Message, type Translations, createGettext, defineGettextConfig, useGettext }; |
{ | ||
"name": "vue3-gettext", | ||
"version": "3.0.0-beta.4", | ||
"version": "3.0.0-beta.5", | ||
"description": "Translate Vue 3 applications with gettext", | ||
@@ -35,3 +35,3 @@ "homepage": "https://jshmrtn.github.io/vue3-gettext/", | ||
"start": "vite serve dev", | ||
"build": "rm -rf dist && rollup -c", | ||
"build": "rm -rf dist && rollup -c rollup.config.ts --configPlugin typescript", | ||
"test": "npm run test:types && npm run test:lint && npm run test:unit", | ||
@@ -48,3 +48,3 @@ "test:types": "tsc --noEmit", | ||
"engines": { | ||
"node": ">= 12.0.0" | ||
"node": ">= 18.0.0" | ||
}, | ||
@@ -59,21 +59,23 @@ "peerDependencies": { | ||
"cosmiconfig": "^9.0.0", | ||
"gettext-extractor": "^3.6.2", | ||
"glob": "^7.2.0", | ||
"gettext-extractor": "^3.8.0", | ||
"glob": "^10.4.1", | ||
"parse5": "^6.0.1", | ||
"parse5-htmlparser2-tree-adapter": "^6.0.1", | ||
"pofile": "^1.1.3", | ||
"tslib": "^2.4.0" | ||
"pofile": "^1.1.4", | ||
"tslib": "^2.6.2" | ||
}, | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^21.0.3", | ||
"@rollup/plugin-node-resolve": "^13.3.0", | ||
"@rollup/plugin-typescript": "^8.3.4", | ||
"@types/command-line-args": "^5.2.0", | ||
"@types/glob": "^7.2.0", | ||
"@types/node": "^17.0.23", | ||
"@rollup/plugin-commonjs": "^25.0.8", | ||
"@rollup/plugin-node-resolve": "^15.2.3", | ||
"@rollup/plugin-typescript": "^11.1.6", | ||
"@types/command-line-args": "^5.2.3", | ||
"@types/glob": "^8.1.0", | ||
"@types/node": "^20.14.0", | ||
"@types/parse5": "^6.0.3", | ||
"@types/parse5-htmlparser2-tree-adapter": "^6.0.1", | ||
"@typescript-eslint/parser": "^5.33.1", | ||
"@vitejs/plugin-vue": "^2.3.4", | ||
"@vue/test-utils": "^2.0.2", | ||
"@vuepress/plugin-search": "^2.0.0-beta.49", | ||
"@vitejs/plugin-vue": "^5.0.5", | ||
"@vue/test-utils": "^2.4.6", | ||
"@vuepress/bundler-vite": "^2.0.0-rc.12", | ||
"@vuepress/theme-default": "^2.0.0-rc.33", | ||
"date-fns": "^2.29.1", | ||
@@ -86,12 +88,11 @@ "eslint": "^8.22.0", | ||
"markdown-it-fence": "^0.1.3", | ||
"prettier": "^2.7.1", | ||
"rollup": "^2.78.0", | ||
"rollup-plugin-dts": "^4.2.2", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.7.4", | ||
"vite": "^2.9.15", | ||
"vitest": "^0.20.2", | ||
"vue": "^3.2.29", | ||
"vuepress": "^2.0.0-beta.49" | ||
"prettier": "^3.3.0", | ||
"rollup": "^4.18.0", | ||
"rollup-plugin-dts": "^6.1.1", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.4.5", | ||
"vite": "^5.2.12", | ||
"vitest": "^1.6.0", | ||
"vue": "^3.4.27", | ||
"vuepress": "^2.0.0-rc.12" | ||
}, | ||
@@ -98,0 +99,0 @@ "exports": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
107762
29
2178
+ Added@isaacs/cliui@8.0.2(transitive)
+ Added@pkgjs/parseargs@0.11.0(transitive)
+ Addedansi-regex@5.0.16.1.0(transitive)
+ Addedansi-styles@6.2.1(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedcross-spawn@7.0.6(transitive)
+ Addedeastasianwidth@0.2.0(transitive)
+ Addedemoji-regex@8.0.09.2.2(transitive)
+ Addedforeground-child@3.3.0(transitive)
+ Addedglob@10.4.5(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedjackspeak@3.4.3(transitive)
+ Addedlru-cache@10.4.3(transitive)
+ Addedminimatch@9.0.5(transitive)
+ Addedminipass@7.1.2(transitive)
+ Addedpackage-json-from-dist@1.0.1(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpath-scurry@1.11.1(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@4.1.0(transitive)
+ Addedstring-width@4.2.35.1.2(transitive)
+ Addedstrip-ansi@6.0.17.1.0(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwrap-ansi@7.0.08.1.0(transitive)
Updatedgettext-extractor@^3.8.0
Updatedglob@^10.4.1
Updatedpofile@^1.1.4
Updatedtslib@^2.6.2