@ngrx/store
Advanced tools
Comparing version 13.2.0 to 14.0.0-beta.0
@@ -53,3 +53,3 @@ "use strict"; | ||
return Array.isArray(arg) | ||
? "[" + arg.map(function (a) { return a.getText(sourceFile); }).join(',') + "]" | ||
? "[".concat(arg.map(function (a) { return a.getText(sourceFile); }).join(','), "]") | ||
: arg.getText(sourceFile); | ||
@@ -56,0 +56,0 @@ }) |
@@ -110,3 +110,3 @@ "use strict"; | ||
changes.push(new schematics_core_1.RemoveChange(sourceFile.fileName, node.getStart(sourceFile), node.getEnd())); | ||
changes.push(new schematics_core_1.InsertChange(sourceFile.fileName, node.getStart(sourceFile), "[" + elementsWithoutStoreFreeze.join(', ') + "]")); | ||
changes.push(new schematics_core_1.InsertChange(sourceFile.fileName, node.getStart(sourceFile), "[".concat(elementsWithoutStoreFreeze.join(', '), "]"))); | ||
} | ||
@@ -132,3 +132,3 @@ } | ||
if (node.arguments.length === 1) { | ||
changes.push(new schematics_core_1.InsertChange(sourceFile.fileName, node.arguments[0].getEnd(), ", { " + runtimeChecks + "}")); | ||
changes.push(new schematics_core_1.InsertChange(sourceFile.fileName, node.arguments[0].getEnd(), ", { ".concat(runtimeChecks, "}"))); | ||
} | ||
@@ -140,3 +140,3 @@ else if (node.arguments.length === 2) { | ||
if (storeConfig.properties.length === 0) { | ||
changes.push(new schematics_core_1.InsertChange(sourceFile.fileName, storeConfig.getEnd() - 1, runtimeChecks + " ")); | ||
changes.push(new schematics_core_1.InsertChange(sourceFile.fileName, storeConfig.getEnd() - 1, "".concat(runtimeChecks, " "))); | ||
} | ||
@@ -146,3 +146,3 @@ else { | ||
var lastProperty = storeConfig.properties[storeConfig.properties.length - 1]; | ||
changes.push(new schematics_core_1.InsertChange(sourceFile.fileName, lastProperty.getEnd(), ", " + runtimeChecks)); | ||
changes.push(new schematics_core_1.InsertChange(sourceFile.fileName, lastProperty.getEnd(), ", ".concat(runtimeChecks))); | ||
} | ||
@@ -149,0 +149,0 @@ } |
{ | ||
"name": "@ngrx/store", | ||
"version": "13.2.0", | ||
"version": "14.0.0-beta.0", | ||
"description": "RxJS powered Redux for Angular apps", | ||
@@ -24,4 +24,4 @@ "repository": { | ||
"peerDependencies": { | ||
"@angular/core": "^13.0.0", | ||
"rxjs": "^6.5.3 || ^7.4.0" | ||
"@angular/core": "^14.0.0-rc.0", | ||
"rxjs": "^6.5.3 || ^7.5.0" | ||
}, | ||
@@ -39,3 +39,4 @@ "schematics": "./schematics/collection.json", | ||
"@ngrx/component-store", | ||
"@ngrx/component" | ||
"@ngrx/component", | ||
"@ngrx/eslint-plugin" | ||
], | ||
@@ -53,3 +54,3 @@ "migrations": "./migrations/migration.json" | ||
"fesm2015": "fesm2015/ngrx-store.mjs", | ||
"typings": "ngrx-store.d.ts", | ||
"typings": "index.d.ts", | ||
"exports": { | ||
@@ -60,3 +61,3 @@ "./package.json": { | ||
".": { | ||
"types": "./ngrx-store.d.ts", | ||
"types": "./index.d.ts", | ||
"esm2020": "./esm2020/ngrx-store.mjs", | ||
@@ -69,3 +70,3 @@ "es2020": "./fesm2020/ngrx-store.mjs", | ||
"./testing": { | ||
"types": "./testing/ngrx-store-testing.d.ts", | ||
"types": "./testing/index.d.ts", | ||
"esm2020": "./esm2020/testing/ngrx-store-testing.mjs", | ||
@@ -72,0 +73,0 @@ "es2020": "./fesm2020/ngrx-store-testing.mjs", |
"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]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k; |
@@ -143,3 +143,3 @@ "use strict"; | ||
if (!lastItem && fallbackPos == undefined) { | ||
throw new Error("tried to insert " + toInsert + " as first occurence with no fallback position"); | ||
throw new Error("tried to insert ".concat(toInsert, " as first occurence with no fallback position")); | ||
} | ||
@@ -296,3 +296,3 @@ var lastItemPosition = lastItem ? lastItem.end : fallbackPos; | ||
position_1 = expr.getEnd() - 1; | ||
toInsert_1 = " " + metadataField + ": [" + symbolName + "]\n"; | ||
toInsert_1 = " ".concat(metadataField, ": [").concat(symbolName, "]\n"); | ||
} | ||
@@ -306,6 +306,6 @@ else { | ||
if (matches.length > 0) { | ||
toInsert_1 = "," + matches[0] + metadataField + ": [" + symbolName + "]"; | ||
toInsert_1 = ",".concat(matches[0]).concat(metadataField, ": [").concat(symbolName, "]"); | ||
} | ||
else { | ||
toInsert_1 = ", " + metadataField + ": [" + symbolName + "]"; | ||
toInsert_1 = ", ".concat(metadataField, ": [").concat(symbolName, "]"); | ||
} | ||
@@ -366,6 +366,6 @@ } | ||
if (text.match('^\r?\r?\n')) { | ||
effectInsert = "," + text.match(/^\r?\n\s+/)[0] + effectsSymbol; | ||
effectInsert = ",".concat(text.match(/^\r?\n\s+/)[0]).concat(effectsSymbol); | ||
} | ||
else { | ||
effectInsert = ", " + effectsSymbol; | ||
effectInsert = ", ".concat(effectsSymbol); | ||
} | ||
@@ -388,3 +388,3 @@ return [new change_1.InsertChange(ngModulePath, epos, effectInsert)]; | ||
position = expr.getEnd() - 1; | ||
toInsert = " " + metadataField + ": [" + symbolName + "]\n"; | ||
toInsert = " ".concat(metadataField, ": [").concat(symbolName, "]\n"); | ||
} | ||
@@ -397,6 +397,6 @@ else { | ||
if (text.match('^\r?\r?\n')) { | ||
toInsert = "," + text.match(/^\r?\n\s+/)[0] + metadataField + ": [" + symbolName + "]"; | ||
toInsert = ",".concat(text.match(/^\r?\n\s+/)[0]).concat(metadataField, ": [").concat(symbolName, "]"); | ||
} | ||
else { | ||
toInsert = ", " + metadataField + ": [" + symbolName + "]"; | ||
toInsert = ", ".concat(metadataField, ": [").concat(symbolName, "]"); | ||
} | ||
@@ -408,3 +408,3 @@ } | ||
position--; | ||
toInsert = "" + symbolName; | ||
toInsert = "".concat(symbolName); | ||
} | ||
@@ -415,6 +415,6 @@ else { | ||
if (text.match(/^\r?\n/)) { | ||
toInsert = "," + text.match(/^\r?\n(\r?)\s+/)[0] + symbolName; | ||
toInsert = ",".concat(text.match(/^\r?\n(\r?)\s+/)[0]).concat(symbolName); | ||
} | ||
else { | ||
toInsert = ", " + symbolName; | ||
toInsert = ", ".concat(symbolName); | ||
} | ||
@@ -459,3 +459,3 @@ } | ||
position_2 = expr.getEnd() - 1; | ||
toInsert_2 = " " + metadataField + ": [" + symbolName + "]\n"; | ||
toInsert_2 = " ".concat(metadataField, ": [").concat(symbolName, "]\n"); | ||
} | ||
@@ -469,6 +469,6 @@ else { | ||
if (matches.length > 0) { | ||
toInsert_2 = "," + matches[0] + metadataField + ": [" + symbolName + "]"; | ||
toInsert_2 = ",".concat(matches[0]).concat(metadataField, ": [").concat(symbolName, "]"); | ||
} | ||
else { | ||
toInsert_2 = ", " + metadataField + ": [" + symbolName + "]"; | ||
toInsert_2 = ", ".concat(metadataField, ": [").concat(symbolName, "]"); | ||
} | ||
@@ -513,3 +513,3 @@ } | ||
position = expr.getEnd() - 1; | ||
toInsert = " " + metadataField + ": [" + symbolName + "]\n"; | ||
toInsert = " ".concat(metadataField, ": [").concat(symbolName, "]\n"); | ||
} | ||
@@ -522,6 +522,6 @@ else { | ||
if (text.match('^\r?\r?\n')) { | ||
toInsert = "," + text.match(/^\r?\n\s+/)[0] + metadataField + ": [" + symbolName + "]"; | ||
toInsert = ",".concat(text.match(/^\r?\n\s+/)[0]).concat(metadataField, ": [").concat(symbolName, "]"); | ||
} | ||
else { | ||
toInsert = ", " + metadataField + ": [" + symbolName + "]"; | ||
toInsert = ", ".concat(metadataField, ": [").concat(symbolName, "]"); | ||
} | ||
@@ -533,3 +533,3 @@ } | ||
position--; | ||
toInsert = "" + symbolName; | ||
toInsert = "".concat(symbolName); | ||
} | ||
@@ -540,6 +540,6 @@ else { | ||
if (text.match(/^\r?\n/)) { | ||
toInsert = "," + text.match(/^\r?\n(\r?)\s+/)[0] + symbolName; | ||
toInsert = ",".concat(text.match(/^\r?\n(\r?)\s+/)[0]).concat(symbolName); | ||
} | ||
else { | ||
toInsert = ", " + symbolName; | ||
toInsert = ", ".concat(symbolName); | ||
} | ||
@@ -636,3 +636,3 @@ } | ||
findNodes(relevantImports[0], ts.SyntaxKind.FromKeyword)[0].getStart(); | ||
return insertAfterLastOccurrence(imports_1, ", " + symbolName, fileToEdit, fallbackPos_1); | ||
return insertAfterLastOccurrence(imports_1, ", ".concat(symbolName), fileToEdit, fallbackPos_1); | ||
} | ||
@@ -652,4 +652,4 @@ return new change_1.NoopChange(); | ||
var separator = insertAtBeginning ? '' : ';\n'; | ||
var toInsert = separator + "import " + open + symbolName + close + | ||
(" from '" + fileName + "'" + (insertAtBeginning ? ';\n' : '')); | ||
var toInsert = "".concat(separator, "import ").concat(open).concat(symbolName).concat(close) + | ||
" from '".concat(fileName, "'").concat(insertAtBeginning ? ';\n' : ''); | ||
return insertAfterLastOccurrence(allImports, toInsert, fileToEdit, fallbackPos, ts.SyntaxKind.StringLiteral); | ||
@@ -663,4 +663,4 @@ } | ||
var moduleSpecifier = _a.moduleSpecifier; | ||
return moduleSpecifier.getText(sourceFile) === "'" + importFrom + "'" || | ||
moduleSpecifier.getText(sourceFile) === "\"" + importFrom + "\""; | ||
return moduleSpecifier.getText(sourceFile) === "'".concat(importFrom, "'") || | ||
moduleSpecifier.getText(sourceFile) === "\"".concat(importFrom, "\""); | ||
}); | ||
@@ -667,0 +667,0 @@ if (imports.length === 0) { |
@@ -41,3 +41,3 @@ "use strict"; | ||
} | ||
this.description = "Inserted " + toAdd + " into position " + pos + " of " + path; | ||
this.description = "Inserted ".concat(toAdd, " into position ").concat(pos, " of ").concat(path); | ||
this.order = pos; | ||
@@ -53,3 +53,3 @@ } | ||
var suffix = content.substring(_this.pos); | ||
return host.write(_this.path, "" + prefix + _this.toAdd + suffix); | ||
return host.write(_this.path, "".concat(prefix).concat(_this.toAdd).concat(suffix)); | ||
}); | ||
@@ -71,3 +71,3 @@ }; | ||
} | ||
this.description = "Removed text in position " + pos + " to " + end + " of " + path; | ||
this.description = "Removed text in position ".concat(pos, " to ").concat(end, " of ").concat(path); | ||
this.order = pos; | ||
@@ -81,3 +81,3 @@ } | ||
// TODO: throw error if toRemove doesn't match removed string. | ||
return host.write(_this.path, "" + prefix + suffix); | ||
return host.write(_this.path, "".concat(prefix).concat(suffix)); | ||
}); | ||
@@ -100,3 +100,3 @@ }; | ||
} | ||
this.description = "Replaced " + oldText + " into position " + pos + " of " + path + " with " + newText; | ||
this.description = "Replaced ".concat(oldText, " into position ").concat(pos, " of ").concat(path, " with ").concat(newText); | ||
this.order = pos; | ||
@@ -111,6 +111,6 @@ } | ||
if (text !== _this.oldText) { | ||
return Promise.reject(new Error("Invalid replace: \"" + text + "\" != \"" + _this.oldText + "\".")); | ||
return Promise.reject(new Error("Invalid replace: \"".concat(text, "\" != \"").concat(_this.oldText, "\"."))); | ||
} | ||
// TODO: throw error if oldText doesn't match removed string. | ||
return host.write(_this.path, "" + prefix + _this.newText + suffix); | ||
return host.write(_this.path, "".concat(prefix).concat(_this.newText).concat(suffix)); | ||
}); | ||
@@ -117,0 +117,0 @@ }; |
@@ -15,3 +15,3 @@ "use strict"; | ||
if (configBuffer === null) { | ||
throw new schematics_1.SchematicsException("Could not find (" + path + ")"); | ||
throw new schematics_1.SchematicsException("Could not find (".concat(path, ")")); | ||
} | ||
@@ -18,0 +18,0 @@ var config = configBuffer.toString(); |
@@ -40,3 +40,3 @@ "use strict"; | ||
else { | ||
throw new Error("Specified component path " + componentPath + " does not exist"); | ||
throw new Error("Specified component path ".concat(componentPath, " does not exist")); | ||
} | ||
@@ -76,8 +76,8 @@ } | ||
? relativePath | ||
: "./" + relativePath; | ||
: "./".concat(relativePath); | ||
return !toFileName || toFileName === 'index.ts' | ||
? fixedRelativePath | ||
: "" + (fixedRelativePath.endsWith('/') | ||
: "".concat(fixedRelativePath.endsWith('/') | ||
? fixedRelativePath | ||
: fixedRelativePath + '/') + convertToTypeScriptFileName(toFileName); | ||
: fixedRelativePath + '/').concat(convertToTypeScriptFileName(toFileName)); | ||
} | ||
@@ -84,0 +84,0 @@ exports.buildRelativePath = buildRelativePath; |
@@ -40,3 +40,3 @@ "use strict"; | ||
else { | ||
throw new Error("Specified module path " + modulePath + " does not exist"); | ||
throw new Error("Specified module path ".concat(modulePath, " does not exist")); | ||
} | ||
@@ -77,8 +77,8 @@ } | ||
? relativePath | ||
: "./" + relativePath; | ||
: "./".concat(relativePath); | ||
return !toFileName || toFileName === 'index.ts' | ||
? fixedRelativePath | ||
: "" + (fixedRelativePath.endsWith('/') | ||
: "".concat(fixedRelativePath.endsWith('/') | ||
? fixedRelativePath | ||
: fixedRelativePath + '/') + convertToTypeScriptFileName(toFileName); | ||
: fixedRelativePath + '/').concat(convertToTypeScriptFileName(toFileName)); | ||
} | ||
@@ -85,0 +85,0 @@ exports.buildRelativePath = buildRelativePath; |
"use strict"; | ||
exports.__esModule = true; | ||
exports.platformVersion = void 0; | ||
exports.platformVersion = '^13.2.0'; | ||
exports.platformVersion = '^14.0.0-beta.0'; | ||
//# sourceMappingURL=libs-version.js.map |
@@ -53,13 +53,13 @@ "use strict"; | ||
} | ||
var reducersPath = (0, core_1.normalize)("/" + options.path + "/" + options.reducers); | ||
var reducersPath = (0, core_1.normalize)("/".concat(options.path, "/").concat(options.reducers)); | ||
if (!host.exists(reducersPath)) { | ||
throw new Error("Specified reducers path " + reducersPath + " does not exist"); | ||
throw new Error("Specified reducers path ".concat(reducersPath, " does not exist")); | ||
} | ||
var text = host.read(reducersPath); | ||
if (text === null) { | ||
throw new schematics_1.SchematicsException("File " + reducersPath + " does not exist."); | ||
throw new schematics_1.SchematicsException("File ".concat(reducersPath, " does not exist.")); | ||
} | ||
var sourceText = text.toString('utf-8'); | ||
var source = ts.createSourceFile(reducersPath, sourceText, ts.ScriptTarget.Latest, true); | ||
var reducerPath = "/" + options.path + "/" + | ||
var reducerPath = "/".concat(options.path, "/") + | ||
(options.flat ? '' : stringUtils.dasherize(options.name) + '/') + | ||
@@ -70,3 +70,3 @@ (options.group ? 'reducers/' : '') + | ||
var relativePath = (0, find_module_1.buildRelativePath)(reducersPath, reducerPath); | ||
var reducerImport = (0, ast_utils_1.insertImport)(source, reducersPath, "* as from" + stringUtils.classify(options.name), relativePath, true); | ||
var reducerImport = (0, ast_utils_1.insertImport)(source, reducersPath, "* as from".concat(stringUtils.classify(options.name)), relativePath, true); | ||
var stateInterfaceInsert = addReducerToStateInterface(source, reducersPath, options); | ||
@@ -108,3 +108,3 @@ var reducerMapInsert = addReducerToActionReducerMap(source, reducersPath, options); | ||
: stringUtils.camelize(options.name); | ||
var keyInsert = "[from" + stringUtils.classify(options.name) + "." + stringUtils.camelize(state) + "FeatureKey]: from" + stringUtils.classify(options.name) + ".State;"; | ||
var keyInsert = "[from".concat(stringUtils.classify(options.name), ".").concat(stringUtils.camelize(state), "FeatureKey]: from").concat(stringUtils.classify(options.name), ".State;"); | ||
var expr = node; | ||
@@ -115,3 +115,3 @@ var position; | ||
position = expr.getEnd() - 1; | ||
toInsert = " " + keyInsert + "\n"; | ||
toInsert = " ".concat(keyInsert, "\n"); | ||
} | ||
@@ -125,6 +125,6 @@ else { | ||
if (matches && matches.length > 0) { | ||
toInsert = "" + matches[1] + keyInsert + "\n"; | ||
toInsert = "".concat(matches[1]).concat(keyInsert, "\n"); | ||
} | ||
else { | ||
toInsert = "\n" + keyInsert; | ||
toInsert = "\n".concat(keyInsert); | ||
} | ||
@@ -161,3 +161,3 @@ } | ||
: stringUtils.camelize(options.name); | ||
var keyInsert = "[from" + stringUtils.classify(options.name) + "." + stringUtils.camelize(state) + "FeatureKey]: from" + stringUtils.classify(options.name) + ".reducer,"; | ||
var keyInsert = "[from".concat(stringUtils.classify(options.name), ".").concat(stringUtils.camelize(state), "FeatureKey]: from").concat(stringUtils.classify(options.name), ".reducer,"); | ||
var expr = node; | ||
@@ -168,3 +168,3 @@ var position; | ||
position = expr.getEnd() - 1; | ||
toInsert = " " + keyInsert + "\n"; | ||
toInsert = " ".concat(keyInsert, "\n"); | ||
} | ||
@@ -178,6 +178,6 @@ else { | ||
if (matches && matches.length > 0) { | ||
toInsert = "\n" + matches[1] + keyInsert; | ||
toInsert = "\n".concat(matches[1]).concat(keyInsert); | ||
} | ||
else { | ||
toInsert = "\n" + keyInsert; | ||
toInsert = "\n".concat(keyInsert); | ||
} | ||
@@ -199,7 +199,7 @@ } | ||
if (!host.exists(options.module)) { | ||
throw new Error("Specified module path " + modulePath + " does not exist"); | ||
throw new Error("Specified module path ".concat(modulePath, " does not exist")); | ||
} | ||
var text = host.read(modulePath); | ||
if (text === null) { | ||
throw new schematics_1.SchematicsException("File " + modulePath + " does not exist."); | ||
throw new schematics_1.SchematicsException("File ".concat(modulePath, " does not exist.")); | ||
} | ||
@@ -211,3 +211,3 @@ var sourceText = text.toString('utf-8'); | ||
]; | ||
var reducerPath = "/" + options.path + "/" + | ||
var reducerPath = "/".concat(options.path, "/") + | ||
(options.flat ? '' : stringUtils.dasherize(options.name) + '/') + | ||
@@ -218,7 +218,7 @@ (options.group ? 'reducers/' : '') + | ||
var relativePath = (0, find_module_1.buildRelativePath)(modulePath, reducerPath); | ||
var reducerImport = (0, ast_utils_1.insertImport)(source, modulePath, "* as from" + stringUtils.classify(options.name), relativePath, true); | ||
var reducerImport = (0, ast_utils_1.insertImport)(source, modulePath, "* as from".concat(stringUtils.classify(options.name)), relativePath, true); | ||
var state = options.plural | ||
? stringUtils.pluralize(options.name) | ||
: stringUtils.camelize(options.name); | ||
var _b = __read((0, ast_utils_1.addImportToModule)(source, modulePath, "StoreModule.forFeature(from" + stringUtils.classify(options.name) + "." + state + "FeatureKey, from" + stringUtils.classify(options.name) + ".reducer)", relativePath), 1), storeNgModuleImport = _b[0]; | ||
var _b = __read((0, ast_utils_1.addImportToModule)(source, modulePath, "StoreModule.forFeature(from".concat(stringUtils.classify(options.name), ".").concat(state, "FeatureKey, from").concat(stringUtils.classify(options.name), ".reducer)"), relativePath), 1), storeNgModuleImport = _b[0]; | ||
var changes = __spreadArray(__spreadArray([], __read(commonImports), false), [reducerImport, storeNgModuleImport], false); | ||
@@ -256,7 +256,5 @@ var recorder = host.beginUpdate(modulePath); | ||
function getPrefix(options) { | ||
return options.creators | ||
? stringUtils.camelize(options.prefix || 'load') | ||
: stringUtils.capitalize(options.prefix || 'load'); | ||
return stringUtils.camelize(options.prefix || 'load'); | ||
} | ||
exports.getPrefix = getPrefix; | ||
//# sourceMappingURL=ngrx-utils.js.map |
@@ -20,8 +20,8 @@ "use strict"; | ||
var project = getProject(host, options); | ||
if (project.root.substr(-1) === '/') { | ||
project.root = project.root.substr(0, project.root.length - 1); | ||
if (project.root.slice(-1) === '/') { | ||
project.root = project.root.substring(0, project.root.length - 1); | ||
} | ||
if (options.path === undefined) { | ||
var projectDirName = project.projectType === 'application' ? 'app' : 'lib'; | ||
return (project.root ? "/" + project.root : '') + "/src/" + projectDirName; | ||
return "".concat(project.root ? "/".concat(project.root) : '', "/src/").concat(projectDirName); | ||
} | ||
@@ -28,0 +28,0 @@ return options.path; |
@@ -109,3 +109,3 @@ "use strict"; | ||
function capitalize(str) { | ||
return str.charAt(0).toUpperCase() + str.substr(1); | ||
return str.charAt(0).toUpperCase() + str.substring(1); | ||
} | ||
@@ -125,7 +125,7 @@ exports.capitalize = capitalize; | ||
function pluralize(str) { | ||
return camelize([/([^aeiou])y$/, /()fe?$/, /([^aeiou]o|[sxz]|[cs]h)$/].map(function (c, i) { return (str = str.replace(c, "$1" + ('iv'[i] || '') + "e")); }) && str + 's'); | ||
return camelize([/([^aeiou])y$/, /()fe?$/, /([^aeiou]o|[sxz]|[cs]h)$/].map(function (c, i) { return (str = str.replace(c, "$1".concat('iv'[i] || '', "e"))); }) && str + 's'); | ||
} | ||
exports.pluralize = pluralize; | ||
function group(name, group) { | ||
return group ? group + "/" + name : name; | ||
return group ? "".concat(group, "/").concat(name) : name; | ||
} | ||
@@ -135,7 +135,7 @@ exports.group = group; | ||
if (group && !flat) { | ||
return "../../" + path + "/" + name + "/"; | ||
return "../../".concat(path, "/").concat(name, "/"); | ||
} | ||
return group ? "../" + path + "/" : './'; | ||
return group ? "../".concat(path, "/") : './'; | ||
} | ||
exports.featurePath = featurePath; | ||
//# sourceMappingURL=strings.js.map |
@@ -19,7 +19,7 @@ "use strict"; | ||
dependencyCategories.forEach(function (category) { | ||
var packageName = "@ngrx/" + name; | ||
var packageName = "@ngrx/".concat(name); | ||
if (pkg[category] && pkg[category][packageName]) { | ||
var firstChar = pkg[category][packageName][0]; | ||
var suffix = match(firstChar, '^') || match(firstChar, '~'); | ||
pkg[category][packageName] = suffix + "6.0.0"; | ||
pkg[category][packageName] = "".concat(suffix, "6.0.0"); | ||
} | ||
@@ -26,0 +26,0 @@ }); |
@@ -58,3 +58,3 @@ "use strict"; | ||
if (text === null) { | ||
throw new schematics_1.SchematicsException("File " + modulePath + " does not exist."); | ||
throw new schematics_1.SchematicsException("File ".concat(modulePath, " does not exist.")); | ||
} | ||
@@ -67,4 +67,4 @@ var sourceText = text.toString('utf-8'); | ||
: "{\n metaReducers\n }"; | ||
var storeModuleSetup = "StoreModule.forRoot(" + storeModuleReducers + ", " + storeModuleConfig + ")"; | ||
var statePath = "/" + options.path + "/" + options.statePath; | ||
var storeModuleSetup = "StoreModule.forRoot(".concat(storeModuleReducers, ", ").concat(storeModuleConfig, ")"); | ||
var statePath = "/".concat(options.path, "/").concat(options.statePath); | ||
var relativePath = (0, schematics_core_1.buildRelativePath)(modulePath, statePath); | ||
@@ -110,42 +110,10 @@ var _b = __read((0, schematics_core_1.addImportToModule)(source, modulePath, storeModuleSetup, relativePath), 1), storeNgModuleImport = _b[0]; | ||
return function (host, context) { | ||
var _a, _b; | ||
var eslintConfigPath = '.eslintrc.json'; | ||
var docs = 'https://github.com/timdeschryver/eslint-plugin-ngrx/#eslint-plugin-ngrx'; | ||
var eslint = (_a = host.read(eslintConfigPath)) === null || _a === void 0 ? void 0 : _a.toString('utf-8'); | ||
if (!eslint) { | ||
return host; | ||
} | ||
(0, schematics_core_1.addPackageToPackageJson)(host, 'devDependencies', 'eslint-plugin-ngrx', '^2.0.0'); | ||
context.addTask(new tasks_1.NodePackageInstallTask()); | ||
try { | ||
var json = JSON.parse(eslint); | ||
if (json.overrides) { | ||
if (!json.overrides.some(function (override) { | ||
var _a; | ||
return (_a = override["extends"]) === null || _a === void 0 ? void 0 : _a.some(function (extend) { | ||
return extend.startsWith('plugin:ngrx'); | ||
}); | ||
})) { | ||
json.overrides.push(configureESLintPlugin()); | ||
} | ||
} | ||
else if (!((_b = json["extends"]) === null || _b === void 0 ? void 0 : _b.some(function (extend) { return extend.startsWith('plugin:ngrx'); }))) { | ||
json.overrides = [configureESLintPlugin()]; | ||
} | ||
host.overwrite(eslintConfigPath, JSON.stringify(json, null, 2)); | ||
context.logger.info("\nThe NgRx ESLint Plugin is installed and configured with the recommended config.\n\nIf you want to change the configuration, please see " + docs + ".\n"); | ||
return host; | ||
} | ||
catch (err) { | ||
context.logger.warn("\nSomething went wrong while adding the NgRx ESLint Plugin.\nThe NgRx ESLint Plugin is installed but not configured.\n\nPlease see " + docs + " to configure the NgRx ESLint Plugin.\n\nDetails:\n" + err.message + "\n"); | ||
} | ||
(0, schematics_core_1.addPackageToPackageJson)(host, 'devDependencies', '@ngrx/eslint-plugin', schematics_core_1.platformVersion); | ||
var installTaskId = context.addTask(new tasks_1.NodePackageInstallTask()); | ||
context.addTask(new tasks_1.RunSchematicTask('@ngrx/eslint-plugin', 'ng-add', {}), [ | ||
installTaskId, | ||
]); | ||
return host; | ||
}; | ||
} | ||
function configureESLintPlugin() { | ||
return { | ||
files: ['*.ts'], | ||
"extends": ["plugin:ngrx/recommended"] | ||
}; | ||
} | ||
function default_1(options) { | ||
@@ -156,5 +124,5 @@ return function (host, context) { | ||
options.path = parsedPath.path; | ||
var statePath = "/" + options.path + "/" + options.statePath + "/index.ts"; | ||
var statePath = "/".concat(options.path, "/").concat(options.statePath, "/index.ts"); | ||
var srcPath = (0, core_1.dirname)(options.path); | ||
var environmentsPath = (0, schematics_core_1.buildRelativePath)(statePath, "/" + srcPath + "/environments/environment"); | ||
var environmentsPath = (0, schematics_core_1.buildRelativePath)(statePath, "/".concat(srcPath, "/environments/environment")); | ||
if (options.module) { | ||
@@ -161,0 +129,0 @@ options.module = (0, schematics_core_1.findModuleFromOptions)(host, { |
@@ -8,3 +8,3 @@ import { ActionCreator, ActionCreatorProps, Creator, FunctionWithParametersType, NotAllowedCheck, TypedAction } from './models'; | ||
declare type EmptyStringCheck<Str extends string, Name extends string> = Trim<Str> extends '' ? `${Name} cannot be an empty string or contain only spaces` : unknown; | ||
declare type TemplateLiteralCheck<Str extends string, Name extends string> = string extends Str ? `${Name} must be a template literal type` : unknown; | ||
declare type StringLiteralCheck<Str extends string, Name extends string> = string extends Str ? `${Name} must be a string literal type` : unknown; | ||
declare type UniqueEventNameCheck<EventNames extends string, EventName extends string> = ActionName<EventName> extends ActionName<Exclude<EventNames, EventName>> ? `${ActionName<EventName>} action is already defined` : unknown; | ||
@@ -15,5 +15,5 @@ declare type NotAllowedEventPropsCheck<PropsCreator extends ActionCreatorProps<unknown> | Creator> = PropsCreator extends ActionCreatorProps<infer Props> ? Props extends void ? unknown : NotAllowedCheck<Props & object> : PropsCreator extends Creator<any, infer Result> ? NotAllowedCheck<Result> : unknown; | ||
export interface ActionGroupConfig<Source extends string, Events extends Record<string, ActionCreatorProps<unknown> | Creator>> { | ||
source: Source & TemplateLiteralCheck<Source, 'source'>; | ||
source: Source & StringLiteralCheck<Source, 'source'>; | ||
events: { | ||
[EventName in keyof Events]: Events[EventName] & EmptyStringCheck<EventName & string, 'event name'> & TemplateLiteralCheck<EventName & string, 'event name'> & ForbiddenCharactersCheck<EventName & string, 'event name'> & UniqueEventNameCheck<keyof Events & string, EventName & string> & NotAllowedEventPropsCheck<Events[EventName]>; | ||
[EventName in keyof Events]: Events[EventName] & EmptyStringCheck<EventName & string, 'event name'> & StringLiteralCheck<EventName & string, 'event name'> & ForbiddenCharactersCheck<EventName & string, 'event name'> & UniqueEventNameCheck<keyof Events & string, EventName & string> & NotAllowedEventPropsCheck<Events[EventName]>; | ||
}; | ||
@@ -20,0 +20,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
976392
131
8545
1