Socket
Socket
Sign inDemoInstall

@ngrx/component-store

Package Overview
Dependencies
Maintainers
4
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ngrx/component-store - npm Package Compare versions

Comparing version 13.0.0-beta.0 to 13.0.0-rc.0

esm2020/index.mjs

31

package.json
{
"name": "@ngrx/component-store",
"version": "13.0.0-beta.0",
"version": "13.0.0-rc.0",
"description": "Reactive store for component state",

@@ -25,3 +25,3 @@ "repository": {

"peerDependencies": {
"@angular/core": "^13.0.0-rc.0",
"@angular/core": "^13.0.0",
"rxjs": "^6.5.3 || ^7.4.0"

@@ -48,8 +48,21 @@ },

},
"main": "bundles/ngrx-component-store.umd.js",
"module": "fesm2015/ngrx-component-store.js",
"es2015": "fesm2015/ngrx-component-store.js",
"esm2015": "esm2015/ngrx-component-store.js",
"fesm2015": "fesm2015/ngrx-component-store.js",
"typings": "ngrx-component-store.d.ts"
}
"module": "fesm2015/ngrx-component-store.mjs",
"es2020": "fesm2020/ngrx-component-store.mjs",
"esm2020": "esm2020/ngrx-component-store.mjs",
"fesm2020": "fesm2020/ngrx-component-store.mjs",
"fesm2015": "fesm2015/ngrx-component-store.mjs",
"typings": "ngrx-component-store.d.ts",
"exports": {
"./package.json": {
"default": "./package.json"
},
".": {
"types": "./ngrx-component-store.d.ts",
"esm2020": "./esm2020/ngrx-component-store.mjs",
"es2020": "./fesm2020/ngrx-component-store.mjs",
"es2015": "./fesm2015/ngrx-component-store.mjs",
"node": "./fesm2015/ngrx-component-store.mjs",
"default": "./fesm2020/ngrx-component-store.mjs"
}
}
}

@@ -5,2 +5,3 @@ "use strict";

var core_1 = require("@angular-devkit/core");
var parser_1 = require("@angular-devkit/core/src/json/parser");
var json_utilts_1 = require("./json-utilts");

@@ -15,9 +16,9 @@ // https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/migrations/update-9/utils.ts

}
var tsCfgAst = core_1.parseJsonAst(buffer.toString(), core_1.JsonParseMode.Loose);
var tsCfgAst = (0, parser_1.parseJsonAst)(buffer.toString());
if (tsCfgAst.kind !== 'object') {
return true;
}
var ngCompilerOptions = json_utilts_1.findPropertyInAstObject(tsCfgAst, 'angularCompilerOptions');
var ngCompilerOptions = (0, json_utilts_1.findPropertyInAstObject)(tsCfgAst, 'angularCompilerOptions');
if (ngCompilerOptions && ngCompilerOptions.kind === 'object') {
var enableIvy = json_utilts_1.findPropertyInAstObject(ngCompilerOptions, 'enableIvy');
var enableIvy = (0, json_utilts_1.findPropertyInAstObject)(ngCompilerOptions, 'enableIvy');
if (enableIvy) {

@@ -27,5 +28,5 @@ return !!enableIvy.value;

}
var configExtends = json_utilts_1.findPropertyInAstObject(tsCfgAst, 'extends');
var configExtends = (0, json_utilts_1.findPropertyInAstObject)(tsCfgAst, 'extends');
if (configExtends && configExtends.kind === 'string') {
var extendedTsConfigPath = core_1.resolve(core_1.dirname(core_1.normalize(tsConfigPath)), core_1.normalize(configExtends.value));
var extendedTsConfigPath = (0, core_1.resolve)((0, core_1.dirname)((0, core_1.normalize)(tsConfigPath)), (0, core_1.normalize)(configExtends.value));
return isIvyEnabled(tree, extendedTsConfigPath);

@@ -32,0 +33,0 @@ }

@@ -29,6 +29,10 @@ "use strict";

};
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -104,3 +108,3 @@ exports.__esModule = true;

if (node.getChildCount(sourceFile) >= 0) {
nodes.unshift.apply(nodes, __spreadArray([], __read(node.getChildren())));
nodes.unshift.apply(nodes, __spreadArray([], __read(node.getChildren()), false));
}

@@ -679,3 +683,3 @@ }

if (!isAlreadyImported) {
return change_1.createReplaceChange(sourceFile, specifier, importAsIs, importToBe);
return (0, change_1.createReplaceChange)(sourceFile, specifier, importAsIs, importToBe);
}

@@ -685,6 +689,6 @@ var nextIdentifier = importSpecifiers[index + 1];

if (nextIdentifier) {
return change_1.createRemoveChange(sourceFile, specifier, specifier.getStart(sourceFile), nextIdentifier.getStart(sourceFile));
return (0, change_1.createRemoveChange)(sourceFile, specifier, specifier.getStart(sourceFile), nextIdentifier.getStart(sourceFile));
}
// there are no imports following, just remove it
return change_1.createRemoveChange(sourceFile, specifier, specifier.getStart(sourceFile), specifier.getEnd());
return (0, change_1.createRemoveChange)(sourceFile, specifier, specifier.getStart(sourceFile), specifier.getEnd());
});

@@ -691,0 +695,0 @@ return importChanges.filter(Boolean);

@@ -22,18 +22,18 @@ "use strict";

(options.flat ? '' : '/' + core_1.strings.dasherize(options.name));
return core_1.normalize(findComponent(host, pathToCheck));
return (0, core_1.normalize)(findComponent(host, pathToCheck));
}
else {
var componentPath = core_1.normalize('/' + options.path + '/' + options.component);
var componentBaseName = core_1.normalize(componentPath).split('/').pop();
var componentPath = (0, core_1.normalize)('/' + options.path + '/' + options.component);
var componentBaseName = (0, core_1.normalize)(componentPath).split('/').pop();
if (host.exists(componentPath)) {
return core_1.normalize(componentPath);
return (0, core_1.normalize)(componentPath);
}
else if (host.exists(componentPath + '.ts')) {
return core_1.normalize(componentPath + '.ts');
return (0, core_1.normalize)(componentPath + '.ts');
}
else if (host.exists(componentPath + '.component.ts')) {
return core_1.normalize(componentPath + '.component.ts');
return (0, core_1.normalize)(componentPath + '.component.ts');
}
else if (host.exists(componentPath + '/' + componentBaseName + '.component.ts')) {
return core_1.normalize(componentPath + '/' + componentBaseName + '.component.ts');
return (0, core_1.normalize)(componentPath + '/' + componentBaseName + '.component.ts');
}

@@ -55,3 +55,3 @@ else {

if (matches.length == 1) {
return core_1.join(dir.path, matches[0]);
return (0, core_1.join)(dir.path, matches[0]);
}

@@ -74,3 +74,3 @@ else if (matches.length > 1) {

var _b = parsePath(to), toPath = _b.path, toFileName = _b.filename, toDirectory = _b.directory;
var relativePath = core_1.relative(fromDirectory, toDirectory);
var relativePath = (0, core_1.relative)(fromDirectory, toDirectory);
var fixedRelativePath = relativePath.startsWith('.')

@@ -87,5 +87,5 @@ ? relativePath

function parsePath(path) {
var pathNormalized = core_1.normalize(path);
var filename = core_1.extname(pathNormalized) ? core_1.basename(pathNormalized) : '';
var directory = filename ? core_1.dirname(pathNormalized) : pathNormalized;
var pathNormalized = (0, core_1.normalize)(path);
var filename = (0, core_1.extname)(pathNormalized) ? (0, core_1.basename)(pathNormalized) : '';
var directory = filename ? (0, core_1.dirname)(pathNormalized) : pathNormalized;
return {

@@ -92,0 +92,0 @@ path: pathNormalized,

@@ -22,18 +22,18 @@ "use strict";

(options.flat ? '' : '/' + core_1.strings.dasherize(options.name));
return core_1.normalize(findModule(host, pathToCheck));
return (0, core_1.normalize)(findModule(host, pathToCheck));
}
else {
var modulePath = core_1.normalize('/' + options.path + '/' + options.module);
var moduleBaseName = core_1.normalize(modulePath).split('/').pop();
var modulePath = (0, core_1.normalize)('/' + options.path + '/' + options.module);
var moduleBaseName = (0, core_1.normalize)(modulePath).split('/').pop();
if (host.exists(modulePath)) {
return core_1.normalize(modulePath);
return (0, core_1.normalize)(modulePath);
}
else if (host.exists(modulePath + '.ts')) {
return core_1.normalize(modulePath + '.ts');
return (0, core_1.normalize)(modulePath + '.ts');
}
else if (host.exists(modulePath + '.module.ts')) {
return core_1.normalize(modulePath + '.module.ts');
return (0, core_1.normalize)(modulePath + '.module.ts');
}
else if (host.exists(modulePath + '/' + moduleBaseName + '.module.ts')) {
return core_1.normalize(modulePath + '/' + moduleBaseName + '.module.ts');
return (0, core_1.normalize)(modulePath + '/' + moduleBaseName + '.module.ts');
}

@@ -56,3 +56,3 @@ else {

if (matches.length == 1) {
return core_1.join(dir.path, matches[0]);
return (0, core_1.join)(dir.path, matches[0]);
}

@@ -75,3 +75,3 @@ else if (matches.length > 1) {

var _b = parsePath(to), toPath = _b.path, toFileName = _b.filename, toDirectory = _b.directory;
var relativePath = core_1.relative(fromDirectory, toDirectory);
var relativePath = (0, core_1.relative)(fromDirectory, toDirectory);
var fixedRelativePath = relativePath.startsWith('.')

@@ -88,5 +88,5 @@ ? relativePath

function parsePath(path) {
var pathNormalized = core_1.normalize(path);
var filename = core_1.extname(pathNormalized) ? core_1.basename(pathNormalized) : '';
var directory = filename ? core_1.dirname(pathNormalized) : pathNormalized;
var pathNormalized = (0, core_1.normalize)(path);
var filename = (0, core_1.extname)(pathNormalized) ? (0, core_1.basename)(pathNormalized) : '';
var directory = filename ? (0, core_1.dirname)(pathNormalized) : pathNormalized;
return {

@@ -93,0 +93,0 @@ path: pathNormalized,

@@ -29,6 +29,10 @@ "use strict";

};
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -50,3 +54,3 @@ exports.__esModule = true;

}
var reducersPath = core_1.normalize("/" + options.path + "/" + options.reducers);
var reducersPath = (0, core_1.normalize)("/" + options.path + "/" + options.reducers);
if (!host.exists(reducersPath)) {

@@ -66,4 +70,4 @@ throw new Error("Specified reducers path " + reducersPath + " does not exist");

'.reducer';
var relativePath = find_module_1.buildRelativePath(reducersPath, reducerPath);
var reducerImport = ast_utils_1.insertImport(source, reducersPath, "* as from" + stringUtils.classify(options.name), relativePath, true);
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 stateInterfaceInsert = addReducerToStateInterface(source, reducersPath, options);

@@ -199,3 +203,3 @@ var reducerMapInsert = addReducerToActionReducerMap(source, reducersPath, options);

var commonImports = [
ast_utils_1.insertImport(source, modulePath, 'StoreModule', '@ngrx/store'),
(0, ast_utils_1.insertImport)(source, modulePath, 'StoreModule', '@ngrx/store'),
];

@@ -207,9 +211,9 @@ var reducerPath = "/" + options.path + "/" +

'.reducer';
var relativePath = find_module_1.buildRelativePath(modulePath, reducerPath);
var reducerImport = ast_utils_1.insertImport(source, modulePath, "* as from" + stringUtils.classify(options.name), relativePath, true);
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 state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);
var _b = __read(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 changes = __spreadArray(__spreadArray([], __read(commonImports)), [reducerImport, storeNgModuleImport]);
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 changes = __spreadArray(__spreadArray([], __read(commonImports), false), [reducerImport, storeNgModuleImport], false);
var recorder = host.beginUpdate(modulePath);

@@ -216,0 +220,0 @@ try {

@@ -6,7 +6,7 @@ "use strict";

function parseName(path, name) {
var nameWithoutPath = core_1.basename(name);
var namePath = core_1.dirname((path + '/' + name));
var nameWithoutPath = (0, core_1.basename)(name);
var namePath = (0, core_1.dirname)((path + '/' + name));
return {
name: nameWithoutPath,
path: core_1.normalize('/' + namePath)
path: (0, core_1.normalize)('/' + namePath)
};

@@ -13,0 +13,0 @@ }

@@ -6,3 +6,3 @@ "use strict";

function getProject(host, options) {
var workspace = config_1.getWorkspace(host);
var workspace = (0, config_1.getWorkspace)(host);
if (!options.project) {

@@ -9,0 +9,0 @@ var defaultProject = workspace

@@ -99,4 +99,4 @@ "use strict";

ts.isStringLiteralLike(n.initializer)) {
var parts = core_1.normalize(source.fileName).split('/').slice(0, -1);
var templatePath = core_1.resolve(core_1.normalize(parts.join('/')), core_1.normalize(n.initializer.text));
var parts = (0, core_1.normalize)(source.fileName).split('/').slice(0, -1);
var templatePath = (0, core_1.resolve)((0, core_1.normalize)(parts.join('/')), (0, core_1.normalize)(n.initializer.text));
if (!tree.exists(templatePath)) {

@@ -103,0 +103,0 @@ return;

@@ -8,3 +8,3 @@ "use strict";

return function (host, context) {
schematics_core_1.addPackageToPackageJson(host, 'dependencies', '@ngrx/component-store', schematics_core_1.platformVersion);
(0, schematics_core_1.addPackageToPackageJson)(host, 'dependencies', '@ngrx/component-store', schematics_core_1.platformVersion);
context.addTask(new tasks_1.NodePackageInstallTask());

@@ -16,4 +16,4 @@ return host;

return function (host, context) {
return schematics_1.chain([
options && options.skipPackageJson ? schematics_1.noop() : addModuleToPackageJson(),
return (0, schematics_1.chain)([
options && options.skipPackageJson ? (0, schematics_1.noop)() : addModuleToPackageJson(),
])(host, context);

@@ -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

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