Skip to content

Commit

Permalink
Bump to 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
karellm committed May 17, 2021
1 parent 16e13fd commit 394aed1
Show file tree
Hide file tree
Showing 13 changed files with 79 additions and 66 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Changelog

# 3.11.0 - latest
# 4.0.0 - latest

- Drop support for Node 10
- Update all dependencies
- Fix an error that was causing empty namespace catalogs to be created as `""` instead of `{}` #273

# 3.11.0

- Add a pluralSeparator option #300 #302

Expand Down
12 changes: 6 additions & 6 deletions dist/broccoli.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
"use strict";function _typeof(obj) {"@babel/helpers - typeof";if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {_typeof = function _typeof(obj) {return typeof obj;};} else {_typeof = function _typeof(obj) {return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;};}return _typeof(obj);}Object.defineProperty(exports, "__esModule", { value: true });exports["default"] = void 0;var _colors = _interopRequireDefault(require("colors"));
"use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports, "__esModule", { value: true });exports["default"] = void 0;var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _colors = _interopRequireDefault(require("colors"));
var _fsExtra = _interopRequireDefault(require("fs-extra"));
var _path = _interopRequireDefault(require("path"));
var _broccoliPlugin = _interopRequireDefault(require("broccoli-plugin"));
var _transform = _interopRequireDefault(require("../dist/transform"));
var _rsvp = _interopRequireDefault(require("rsvp"));
var _gulpSort = _interopRequireDefault(require("gulp-sort"));
var _vinylFs = _interopRequireDefault(require("vinyl-fs"));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { "default": obj };}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}function _inherits(subClass, superClass) {if (typeof superClass !== "function" && superClass !== null) {throw new TypeError("Super expression must either be null or a function");}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });if (superClass) _setPrototypeOf(subClass, superClass);}function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}function _createSuper(Derived) {var hasNativeReflectConstruct = _isNativeReflectConstruct();return function _createSuperInternal() {var Super = _getPrototypeOf(Derived),result;if (hasNativeReflectConstruct) {var NewTarget = _getPrototypeOf(this).constructor;result = Reflect.construct(Super, arguments, NewTarget);} else {result = Super.apply(this, arguments);}return _possibleConstructorReturn(this, result);};}function _possibleConstructorReturn(self, call) {if (call && (_typeof(call) === "object" || typeof call === "function")) {return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct() {if (typeof Reflect === "undefined" || !Reflect.construct) return false;if (Reflect.construct.sham) return false;if (typeof Proxy === "function") return true;try {Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));return true;} catch (e) {return false;}}function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}
var _vinylFs = _interopRequireDefault(require("vinyl-fs"));function _createSuper(Derived) {var hasNativeReflectConstruct = _isNativeReflectConstruct();return function _createSuperInternal() {var Super = (0, _getPrototypeOf2["default"])(Derived),result;if (hasNativeReflectConstruct) {var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor;result = Reflect.construct(Super, arguments, NewTarget);} else {result = Super.apply(this, arguments);}return (0, _possibleConstructorReturn2["default"])(this, result);};}function _isNativeReflectConstruct() {if (typeof Reflect === "undefined" || !Reflect.construct) return false;if (Reflect.construct.sham) return false;if (typeof Proxy === "function") return true;try {Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));return true;} catch (e) {return false;}}

var Promise = _rsvp["default"].Promise;var

i18nextParser = /*#__PURE__*/function (_Plugin) {_inherits(i18nextParser, _Plugin);var _super = _createSuper(i18nextParser);
function i18nextParser(inputNodes) {var _this;var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};_classCallCheck(this, i18nextParser);
i18nextParser = /*#__PURE__*/function (_Plugin) {(0, _inherits2["default"])(i18nextParser, _Plugin);var _super = _createSuper(i18nextParser);
function i18nextParser(inputNodes) {var _this;var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};(0, _classCallCheck2["default"])(this, i18nextParser);
_this = _super.apply(this, arguments);
_this.options = options;return _this;
}_createClass(i18nextParser, [{ key: "build", value:
}(0, _createClass2["default"])(i18nextParser, [{ key: "build", value:

function build() {var _this2 = this;
var outputPath = this.outputPath;
Expand Down Expand Up @@ -56,4 +56,4 @@ i18nextParser = /*#__PURE__*/function (_Plugin) {_inherits(i18nextParser, _Plugi
}));

});
} }]);return i18nextParser;}(_broccoliPlugin["default"]);exports["default"] = i18nextParser;module.exports = exports.default;
} }]);return i18nextParser;}(_broccoliPlugin["default"]);exports["default"] = i18nextParser;
21 changes: 14 additions & 7 deletions dist/helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.dotPathToHash = dotPathToHash;exports.mergeHashes = mergeHashes;exports.transferValues = transferValues;function _typeof(obj) {"@babel/helpers - typeof";if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {_typeof = function _typeof(obj) {return typeof obj;};} else {_typeof = function _typeof(obj) {return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;};}return _typeof(obj);} /**
"use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports, "__esModule", { value: true });exports.dotPathToHash = dotPathToHash;exports.mergeHashes = mergeHashes;exports.transferValues = transferValues;var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); /**
* Take an entry for the Parser and turn it into a hash,
* turning the key path 'foo.bar' into an hash {foo: {bar: ""}}
* The generated hash can be merged with an optional `target`.
Expand All @@ -12,6 +12,8 @@
* different value, or `false`.
*/
function dotPathToHash(entry) {var target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var conflict = false;
var duplicate = false;
var path = entry.keyWithNamespace;
if (options.suffix || options.suffix === 0) {
path += "".concat(options.pluralSeparator).concat(options.suffix);
Expand All @@ -24,6 +26,12 @@ function dotPathToHash(entry) {var target = arguments.length > 1 && arguments[1]
entry.keyWithNamespace.length);


// There is no key to process so we return an empty object
if (!key) {
target[entry.namespace] = {};
return { target: target, duplicate: duplicate, conflict: conflict };
}

var defaultValue =
typeof options.value === 'function' ?
options.value(options.locale, entry.namespace, key) :
Expand Down Expand Up @@ -59,7 +67,6 @@ function dotPathToHash(entry) {var target = arguments.length > 1 && arguments[1]

var segments = path.split(separator);
var inner = target;
var conflict = false;
for (var i = 0; i < segments.length - 1; i += 1) {
var segment = segments[i];
if (segment) {
Expand All @@ -76,9 +83,9 @@ function dotPathToHash(entry) {var target = arguments.length > 1 && arguments[1]
var lastSegment = segments[segments.length - 1];
var oldValue = inner[lastSegment];
if (oldValue !== undefined && oldValue !== newValue) {
conflict = _typeof(oldValue) !== _typeof(newValue) ? 'key' : 'value';
conflict = (0, _typeof2["default"])(oldValue) !== (0, _typeof2["default"])(newValue) ? 'key' : 'value';
}
var duplicate = oldValue !== undefined || conflict !== false;
duplicate = oldValue !== undefined || conflict !== false;

if (options.customValueTemplate) {
inner[lastSegment] = {};
Expand Down Expand Up @@ -118,7 +125,7 @@ function mergeHashes(source, target) {var keepRemoved = arguments.length > 2 &&
var oldCount = 0;
for (var key in source) {
var hasNestedEntries =
_typeof(target[key]) === 'object' && !Array.isArray(target[key]);
(0, _typeof2["default"])(target[key]) === 'object' && !Array.isArray(target[key]);

if (hasNestedEntries) {
var nested = mergeHashes(source[key], target[key], keepRemoved);
Expand Down Expand Up @@ -177,8 +184,8 @@ function transferValues(source, target) {
var sourceValue = source[key];
var targetValue = target[key];
if (
_typeof(sourceValue) === 'object' &&
_typeof(targetValue) === 'object' &&
(0, _typeof2["default"])(sourceValue) === 'object' &&
(0, _typeof2["default"])(targetValue) === 'object' &&
!Array.isArray(sourceValue))
{
transferValues(sourceValue, targetValue);
Expand Down
4 changes: 2 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions dist/lexers/base-lexer.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"use strict";function _typeof(obj) {"@babel/helpers - typeof";if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {_typeof = function _typeof(obj) {return typeof obj;};} else {_typeof = function _typeof(obj) {return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;};}return _typeof(obj);}Object.defineProperty(exports, "__esModule", { value: true });exports["default"] = void 0;var _events = _interopRequireDefault(require("events"));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { "default": obj };}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}function _inherits(subClass, superClass) {if (typeof superClass !== "function" && superClass !== null) {throw new TypeError("Super expression must either be null or a function");}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });if (superClass) _setPrototypeOf(subClass, superClass);}function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}function _createSuper(Derived) {var hasNativeReflectConstruct = _isNativeReflectConstruct();return function _createSuperInternal() {var Super = _getPrototypeOf(Derived),result;if (hasNativeReflectConstruct) {var NewTarget = _getPrototypeOf(this).constructor;result = Reflect.construct(Super, arguments, NewTarget);} else {result = Super.apply(this, arguments);}return _possibleConstructorReturn(this, result);};}function _possibleConstructorReturn(self, call) {if (call && (_typeof(call) === "object" || typeof call === "function")) {return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct() {if (typeof Reflect === "undefined" || !Reflect.construct) return false;if (Reflect.construct.sham) return false;if (typeof Proxy === "function") return true;try {Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));return true;} catch (e) {return false;}}function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}var
"use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports, "__esModule", { value: true });exports["default"] = void 0;var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _events = _interopRequireDefault(require("events"));function _createSuper(Derived) {var hasNativeReflectConstruct = _isNativeReflectConstruct();return function _createSuperInternal() {var Super = (0, _getPrototypeOf2["default"])(Derived),result;if (hasNativeReflectConstruct) {var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor;result = Reflect.construct(Super, arguments, NewTarget);} else {result = Super.apply(this, arguments);}return (0, _possibleConstructorReturn2["default"])(this, result);};}function _isNativeReflectConstruct() {if (typeof Reflect === "undefined" || !Reflect.construct) return false;if (Reflect.construct.sham) return false;if (typeof Proxy === "function") return true;try {Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));return true;} catch (e) {return false;}}var

BaseLexer = /*#__PURE__*/function (_EventEmitter) {_inherits(BaseLexer, _EventEmitter);var _super = _createSuper(BaseLexer);
function BaseLexer() {var _this;var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};_classCallCheck(this, BaseLexer);
BaseLexer = /*#__PURE__*/function (_EventEmitter) {(0, _inherits2["default"])(BaseLexer, _EventEmitter);var _super = _createSuper(BaseLexer);
function BaseLexer() {var _this;var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};(0, _classCallCheck2["default"])(this, BaseLexer);
_this = _super.call(this);
_this.keys = [];
_this.functions = options.functions || ['t'];return _this;
}_createClass(BaseLexer, [{ key: "validateString", value:
}(0, _createClass2["default"])(BaseLexer, [{ key: "validateString", value:

function validateString(string) {
var regex = new RegExp('^' + BaseLexer.stringPattern + '$', 'i');
Expand Down Expand Up @@ -50,4 +50,4 @@ BaseLexer = /*#__PURE__*/function (_EventEmitter) {_inherits(BaseLexer, _EventEm
join('|') +
')');

} }]);return BaseLexer;}(_events["default"]);exports["default"] = BaseLexer;module.exports = exports.default;
} }]);return BaseLexer;}(_events["default"]);exports["default"] = BaseLexer;
Loading

0 comments on commit 394aed1

Please sign in to comment.