easygettext
Advanced tools
Comparing version 2.15.0 to 2.16.0
{ | ||
"name": "easygettext", | ||
"version": "2.15.0", | ||
"version": "2.16.0", | ||
"description": "Simple tools to extract gettext strings", | ||
@@ -36,3 +36,2 @@ "main": "src/extract-cli.js", | ||
"@babel/core": "^7.11.6", | ||
"@vue/compiler-sfc": "^3.0.0", | ||
"acorn": "^6.4.2", | ||
@@ -46,3 +45,6 @@ "acorn-stage3": "^4.0.0", | ||
"minimist": "^1.2.5", | ||
"pofile": "^1.1.0", | ||
"pofile": "^1.1.0" | ||
}, | ||
"optionalDependencies": { | ||
"@vue/compiler-sfc": "^3.0.0", | ||
"pug": "^3.0.0" | ||
@@ -49,0 +51,0 @@ }, |
@@ -72,3 +72,3 @@ #!/usr/bin/env node | ||
let data = fs.readFileSync(file, {encoding: 'utf-8'}).toString(); | ||
extractor.extract(file, ext, data, jsParser) | ||
extractor.extract(file, ext, data, jsParser); | ||
} catch (e) { | ||
@@ -75,0 +75,0 @@ console.error(`[${PROGRAM_NAME}] could not read: '${filename}' using ${jsParser === 'auto' ? 'acorn' : jsParser} as parser`); |
@@ -35,3 +35,3 @@ const Pofile = require('pofile'); | ||
}, | ||
entry.data | ||
entry.data, | ||
); | ||
@@ -38,0 +38,0 @@ }); |
const cheerio = require('cheerio'); | ||
const cheerioUtils = require('cheerio/lib/utils'); | ||
const Pofile = require('pofile'); | ||
const pug = require('pug'); | ||
const {parse, compileTemplate} = require('@vue/compiler-sfc'); | ||
const acorn = require('acorn'); | ||
@@ -58,2 +56,3 @@ const walk = require('acorn-walk'); | ||
if (type === 'vue') { | ||
const {parse, compileTemplate} = require('@vue/compiler-sfc'); | ||
const vueFile = parse(data).descriptor; | ||
@@ -91,2 +90,3 @@ | ||
if (type === 'jade' || type === 'pug') { | ||
const pug = require('pug'); | ||
templateData = pug.render(data, { | ||
@@ -284,3 +284,3 @@ filename: 'source.html', | ||
} | ||
} | ||
}, | ||
); | ||
@@ -287,0 +287,0 @@ } |
@@ -119,3 +119,3 @@ const extract = require('./extract.js'); | ||
expect(extractor.toString()).toEqual(fixtures.POT_OUTPUT_VUE_COMPONENT_WITH_GETTEXT_IN_TEXT_AND_DATA); | ||
}) | ||
}); | ||
@@ -144,5 +144,5 @@ it('should output a correct POT file for vue component extracted from javascript', ()=> { | ||
expect(extract.preprocessTemplate( | ||
'<template web><h1>hello</h1></template><template native><Page class="page"><Label text="World"/></Page></template>', 'vue' | ||
'<template web><h1>hello</h1></template><template native><Page class="page"><Label text="World"/></Page></template>', 'vue', | ||
)).toEqual( | ||
['<h1>hello</h1>', '<Page class="page"><Label text="World"/></Page>'] | ||
['<h1>hello</h1>', '<Page class="page"><Label text="World"/></Page>'], | ||
); | ||
@@ -149,0 +149,0 @@ }); |
@@ -12,3 +12,3 @@ const fixtures = require('./test-fixtures.js'); | ||
filename, | ||
fixtures.VUE_COMPONENT_EXPECTED_PROCESSED_SCRIPT_TAG | ||
fixtures.VUE_COMPONENT_EXPECTED_PROCESSED_SCRIPT_TAG, | ||
); | ||
@@ -42,3 +42,3 @@ | ||
filename, | ||
fixtures.SCRIPT_USING_NGETTEXT | ||
fixtures.SCRIPT_USING_NGETTEXT, | ||
); | ||
@@ -60,3 +60,3 @@ | ||
filename, | ||
fixtures.SCRIPT_GETTEXT_SEQUENCE | ||
fixtures.SCRIPT_GETTEXT_SEQUENCE, | ||
); | ||
@@ -82,3 +82,3 @@ expect(extractedStrings.length).toBe(3); | ||
filename, | ||
fixtures.SCRIPT_USING_PGETTEXT | ||
fixtures.SCRIPT_USING_PGETTEXT, | ||
); | ||
@@ -106,3 +106,3 @@ | ||
filename, | ||
fixtures.SCRIPT_CONTAINING_DECOYS | ||
fixtures.SCRIPT_CONTAINING_DECOYS, | ||
); | ||
@@ -118,3 +118,3 @@ | ||
filename, | ||
fixtures.SCRIPT_WITH_ES_STAGE3_FEATURES | ||
fixtures.SCRIPT_WITH_ES_STAGE3_FEATURES, | ||
); | ||
@@ -130,3 +130,3 @@ | ||
filename, | ||
fixtures.SCRIPT_WITH_STRING_CONCAT | ||
fixtures.SCRIPT_WITH_STRING_CONCAT, | ||
); | ||
@@ -141,3 +141,3 @@ expect(extractedStrings.length).toBe(3); | ||
filename, | ||
fixtures.SCRIPT_WITH_TEMPLATE_LITERALS | ||
fixtures.SCRIPT_WITH_TEMPLATE_LITERALS, | ||
); | ||
@@ -157,3 +157,3 @@ expect(extractedStrings.length).toBe(3); | ||
fixtures.SCRIPT_WITH_TEMPLATE_LITERALS_WITH_VARIABLES, | ||
'acorn' | ||
'acorn', | ||
); | ||
@@ -170,3 +170,3 @@ }).toThrow(); | ||
fixtures.VUE_COMPONENT_EXPECTED_PROCESSED_SCRIPT_TAG, | ||
'acorn' | ||
'acorn', | ||
); | ||
@@ -183,3 +183,3 @@ | ||
fixtures.VUE_COMPONENT_EXPECTED_PROCESSED_SCRIPT_TAG, | ||
'babel' | ||
'babel', | ||
); | ||
@@ -195,3 +195,3 @@ | ||
filename, | ||
fixtures.VUE_COMPONENT_EXPECTED_PROCESSED_SCRIPT_TAG | ||
fixtures.VUE_COMPONENT_EXPECTED_PROCESSED_SCRIPT_TAG, | ||
); | ||
@@ -198,0 +198,0 @@ |
@@ -358,3 +358,3 @@ exports.FILENAME_0 = 'foo.htm'; | ||
msgstr "" | ||
` | ||
`; | ||
@@ -377,3 +377,3 @@ exports.CLI_OUTPUT_VUE_COMPONENT_WITH_GETTEXT_IN_TEXT_AND_DATA = `[easygettext] extracting: '{path}' | ||
` | ||
`; | ||
@@ -996,3 +996,2 @@ exports.VUE_COMPONENT_EXPECTED_PROCESSED_SCRIPT_TAG = `export default { | ||
exports.VUE_COMPONENT_FROM_JAVASCRIPT = ` | ||
@@ -1020,3 +1019,3 @@ import Vue from 'vue' | ||
msgstr "" | ||
` | ||
`; | ||
@@ -1023,0 +1022,0 @@ exports.SCRIPT_GETTEXT_SEQUENCE_FILENAME = 'gettext_sequence.vue'; |
@@ -12,3 +12,3 @@ const fixtures = require('./test-fixtures.js'); | ||
filename, | ||
fixtures.VUE_COMPONENT_EXPECTED_PROCESSED_TS_SCRIPT_TAG | ||
fixtures.VUE_COMPONENT_EXPECTED_PROCESSED_TS_SCRIPT_TAG, | ||
); | ||
@@ -42,3 +42,3 @@ | ||
filename, | ||
fixtures.SCRIPT_USING_NGETTEXT_TS | ||
fixtures.SCRIPT_USING_NGETTEXT_TS, | ||
); | ||
@@ -60,3 +60,3 @@ | ||
filename, | ||
fixtures.SCRIPT_GETTEXT_SEQUENCE_TS | ||
fixtures.SCRIPT_GETTEXT_SEQUENCE_TS, | ||
); | ||
@@ -85,3 +85,3 @@ expect(extractedStrings.length).toBe(4); | ||
filename, | ||
fixtures.SCRIPT_USING_PGETTEXT_TS | ||
fixtures.SCRIPT_USING_PGETTEXT_TS, | ||
); | ||
@@ -109,3 +109,3 @@ | ||
filename, | ||
fixtures.SCRIPT_CONTAINING_DECOYS | ||
fixtures.SCRIPT_CONTAINING_DECOYS, | ||
); | ||
@@ -121,3 +121,3 @@ | ||
filename, | ||
fixtures.SCRIPT_WITH_ES_STAGE3_FEATURES | ||
fixtures.SCRIPT_WITH_ES_STAGE3_FEATURES, | ||
); | ||
@@ -133,3 +133,3 @@ | ||
filename, | ||
fixtures.SCRIPT_WITH_STRING_CONCAT | ||
fixtures.SCRIPT_WITH_STRING_CONCAT, | ||
); | ||
@@ -144,3 +144,3 @@ expect(extractedStrings.length).toBe(3); | ||
filename, | ||
fixtures.SCRIPT_WITH_TEMPLATE_LITERALS | ||
fixtures.SCRIPT_WITH_TEMPLATE_LITERALS, | ||
); | ||
@@ -159,3 +159,3 @@ expect(extractedStrings.length).toBe(3); | ||
filename, | ||
fixtures.SCRIPT_WITH_TEMPLATE_LITERALS_WITH_VARIABLES | ||
fixtures.SCRIPT_WITH_TEMPLATE_LITERALS_WITH_VARIABLES, | ||
); | ||
@@ -162,0 +162,0 @@ }).toThrow(); |
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
112910
- Removed@vue/compiler-sfc@^3.0.0
- Removedpug@^3.0.0