Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-intl-translations-manager

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-intl-translations-manager - npm Package Compare versions

Comparing version 1.0.3 to 2.0.0

5

dist/core.js

@@ -7,7 +7,7 @@ 'use strict';

var _getDefaultMessages = require('./getDefaultMessages');
var _getDefaultMessages = require('/home/travis/build/GertjanReynaert/react-intl-translations-manager/src/getDefaultMessages');
var _getDefaultMessages2 = _interopRequireDefault(_getDefaultMessages);
var _getLanguageReport = require('./getLanguageReport');
var _getLanguageReport = require('/home/travis/build/GertjanReynaert/react-intl-translations-manager/src/getLanguageReport');

@@ -29,2 +29,3 @@ var _getLanguageReport2 = _interopRequireDefault(_getLanguageReport);

var extractedMessages = provideExtractedMessages();

@@ -31,0 +32,0 @@

2

dist/createSingleMessagesFile.js

@@ -29,5 +29,5 @@ 'use strict';

var DIR = _path2.default.join('./', directory, fileName);
var DIR = _path2.default.join(directory, fileName);
(0, _fs.writeFileSync)(DIR, JSON.stringify(messages, null, jsonSpaceIndentation));
};
'use strict';
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
Object.defineProperty(exports, "__esModule", {

@@ -9,2 +7,4 @@ value: true

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -11,0 +11,0 @@

@@ -7,3 +7,3 @@ 'use strict';

var _manageTranslations = require('./manageTranslations');
var _manageTranslations = require('~/src/manageTranslations');

@@ -13,7 +13,7 @@ Object.defineProperty(exports, 'default', {

get: function get() {
return _manageTranslations.default;
return _interopRequireDefault(_manageTranslations).default;
}
});
var _core = require('./core');
var _core = require('~/src/core');

@@ -23,7 +23,7 @@ Object.defineProperty(exports, 'core', {

get: function get() {
return _core.default;
return _interopRequireDefault(_core).default;
}
});
var _readMessageFiles = require('./readMessageFiles');
var _readMessageFiles = require('~/src/readMessageFiles');

@@ -33,7 +33,7 @@ Object.defineProperty(exports, 'readMessageFiles', {

get: function get() {
return _readMessageFiles.default;
return _interopRequireDefault(_readMessageFiles).default;
}
});
var _createSingleMessagesFile = require('./createSingleMessagesFile');
var _createSingleMessagesFile = require('~/src/createSingleMessagesFile');

@@ -43,7 +43,7 @@ Object.defineProperty(exports, 'createSingleMessagesFile', {

get: function get() {
return _createSingleMessagesFile.default;
return _interopRequireDefault(_createSingleMessagesFile).default;
}
});
var _getDefaultMessages = require('./getDefaultMessages');
var _getDefaultMessages = require('~/src/getDefaultMessages');

@@ -53,4 +53,6 @@ Object.defineProperty(exports, 'getDefaultMessages', {

get: function get() {
return _getDefaultMessages.default;
return _interopRequireDefault(_getDefaultMessages).default;
}
});
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _templateObject = _taggedTemplateLiteral([''], ['']),

@@ -7,6 +11,2 @@ _templateObject2 = _taggedTemplateLiteral(['\n No existing ', ' translation file found.\n A new one is created.\n '], ['\n No existing ', ' translation file found.\n A new one is created.\n ']),

Object.defineProperty(exports, "__esModule", {
value: true
});
var _fs = require('fs');

@@ -22,21 +22,21 @@

var _readFile = require('./readFile');
var _readFile = require('/home/travis/build/GertjanReynaert/react-intl-translations-manager/src/readFile');
var _readFile2 = _interopRequireDefault(_readFile);
var _printer = require('./printer');
var _printer = require('/home/travis/build/GertjanReynaert/react-intl-translations-manager/src/printer');
var _readMessageFiles = require('./readMessageFiles');
var _readMessageFiles = require('/home/travis/build/GertjanReynaert/react-intl-translations-manager/src/readMessageFiles');
var _readMessageFiles2 = _interopRequireDefault(_readMessageFiles);
var _createSingleMessagesFile = require('./createSingleMessagesFile');
var _createSingleMessagesFile = require('/home/travis/build/GertjanReynaert/react-intl-translations-manager/src/createSingleMessagesFile');
var _createSingleMessagesFile2 = _interopRequireDefault(_createSingleMessagesFile);
var _printResults = require('./printResults');
var _printResults = require('/home/travis/build/GertjanReynaert/react-intl-translations-manager/src/printResults');
var _printResults2 = _interopRequireDefault(_printResults);
var _core = require('./core');
var _core = require('/home/travis/build/GertjanReynaert/react-intl-translations-manager/src/core');

@@ -72,3 +72,8 @@ var _core2 = _interopRequireDefault(_core);

outputSingleFile: function outputSingleFile(combinedFiles) {
if (singleMessagesFile) (0, _createSingleMessagesFile2.default)({ messages: combinedFiles, directory: translationsDirectory });
if (singleMessagesFile) {
(0, _createSingleMessagesFile2.default)({
messages: combinedFiles,
directory: translationsDirectory
});
}
},

@@ -89,4 +94,4 @@ outputDuplicateKeys: function outputDuplicateKeys(duplicateIds) {

beforeReporting: function beforeReporting() {
(0, _mkdirp.sync)(_path2.default.join('./', translationsDirectory));
(0, _mkdirp.sync)(_path2.default.join('./', whitelistsDirectory));
(0, _mkdirp.sync)(translationsDirectory);
(0, _mkdirp.sync)(whitelistsDirectory);
},

@@ -93,0 +98,0 @@ provideLangTemplate: function provideLangTemplate(lang) {

@@ -22,3 +22,3 @@ 'use strict';

var EXTRACTED_MESSAGES_DIR = _path2.default.join('./', messagesDirectory, '/');
var EXTRACTED_MESSAGES_DIR = _path2.default.join(messagesDirectory, '/');
var EXTRACTED_MESSAGES = _path2.default.join(EXTRACTED_MESSAGES_DIR, '**/*.json');

@@ -25,0 +25,0 @@

@@ -36,3 +36,3 @@ {

"chalk": "^1.1.1",
"glob": "^6.0.1",
"glob": "^7.0.0",
"mkdirp": "^0.5.1"

@@ -46,3 +46,2 @@ },

"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babel-preset-stage-2": "^6.3.13",

@@ -53,5 +52,5 @@ "babel-root-import": "^3.1.0",

"cz-conventional-changelog": "^1.1.5",
"eslint": "^1.10.3",
"eslint-config-airbnb": "^2.1.1",
"eslint-plugin-react": "^3.15.0",
"eslint": "^2.2.0",
"eslint-config-airbnb": "^6.0.1",
"eslint-plugin-react": "^4.0.0",
"mocha": "^2.3.4",

@@ -65,3 +64,3 @@ "semantic-release": "^4.3.5"

},
"version": "1.0.3"
"version": "2.0.0"
}

@@ -1,3 +0,3 @@

import getDefaultMessages from './getDefaultMessages';
import getLanguageReport from './getLanguageReport';
import getDefaultMessages from '~/src/getDefaultMessages';
import getLanguageReport from '~/src/getLanguageReport';

@@ -4,0 +4,0 @@ export default (languages, hooks) => {

@@ -16,5 +16,5 @@ import Path from 'path';

const DIR = Path.join('./', directory, fileName);
const DIR = Path.join(directory, fileName);
writeFileSync(DIR, JSON.stringify(messages, null, jsonSpaceIndentation));
};

@@ -1,6 +0,6 @@

export { default } from './manageTranslations';
export { default } from '~/src/manageTranslations';
export { default as core } from './core';
export { default as readMessageFiles } from './readMessageFiles';
export { default as createSingleMessagesFile } from './createSingleMessagesFile';
export { default as getDefaultMessages } from './getDefaultMessages';
export { default as core } from '~/src/core';
export { default as readMessageFiles } from '~/src/readMessageFiles';
export { default as createSingleMessagesFile } from '~/src/createSingleMessagesFile';
export { default as getDefaultMessages } from '~/src/getDefaultMessages';

@@ -6,9 +6,9 @@ import { writeFileSync } from 'fs';

import readFile from './readFile';
import { header, subheader, footer } from './printer';
import readMessageFiles from './readMessageFiles';
import createSingleMessagesFile from './createSingleMessagesFile';
import printResults from './printResults';
import readFile from '~/src/readFile';
import { header, subheader, footer } from '~/src/printer';
import readMessageFiles from '~/src/readMessageFiles';
import createSingleMessagesFile from '~/src/createSingleMessagesFile';
import printResults from '~/src/printResults';
import core from './core';
import core from '~/src/core';

@@ -31,3 +31,8 @@ export default ({

outputSingleFile: combinedFiles => {
if (singleMessagesFile) createSingleMessagesFile({ messages: combinedFiles, directory: translationsDirectory });
if (singleMessagesFile) {
createSingleMessagesFile({
messages: combinedFiles,
directory: translationsDirectory,
});
}
},

@@ -48,7 +53,7 @@ outputDuplicateKeys: duplicateIds => {

beforeReporting: () => {
mkdirpSync(Path.join('./', translationsDirectory));
mkdirpSync(Path.join('./', whitelistsDirectory));
mkdirpSync(translationsDirectory);
mkdirpSync(whitelistsDirectory);
},
provideLangTemplate: lang => {
const languageFilename = lang + '.json';
const languageFilename = `${lang}.json`;
const languageFilepath = Path.join(translationsDirectory, languageFilename);

@@ -67,3 +72,3 @@ const whitelistFilename = `whitelist_${lang}.json`;

provideTranslationsFile: lang => {
const filePath = Path.join(translationsDirectory, lang + '.json');
const filePath = Path.join(translationsDirectory, `${lang}.json`);
const jsonFile = readFile(filePath);

@@ -70,0 +75,0 @@ return jsonFile ? JSON.parse(jsonFile) : undefined;

import { green, yellow, red, cyan } from 'chalk';
import { newLine, subheader, header } from './printer';
import { newLine, subheader } from './printer';

@@ -5,0 +5,0 @@ export default ({

@@ -14,13 +14,11 @@ import { readFileSync } from 'fs';

const EXTRACTED_MESSAGES_DIR = Path.join('./', messagesDirectory, '/');
const EXTRACTED_MESSAGES_DIR = Path.join(messagesDirectory, '/');
const EXTRACTED_MESSAGES = Path.join(EXTRACTED_MESSAGES_DIR, '**/*.json');
return globSync(EXTRACTED_MESSAGES)
.map(filename => {
return {
path: filename.substring(EXTRACTED_MESSAGES_DIR.length),
descriptors: JSON.parse(readFileSync(filename, 'utf8')),
};
})
.map(filename => ({
path: filename.substring(EXTRACTED_MESSAGES_DIR.length),
descriptors: JSON.parse(readFileSync(filename, 'utf8')),
}))
.filter(file => file.descriptors.length > 0);
};

@@ -81,3 +81,3 @@ import { expect } from 'chai';

expect(result).to.deep.equal(expected);
})
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc