@ngrx/store-devtools 12.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/bundles/ngrx-store-devtools.umd.js +1318 -0
- package/bundles/ngrx-store-devtools.umd.js.map +1 -0
- package/esm2015/index.js +7 -0
- package/esm2015/ngrx-store-devtools.js +9 -0
- package/esm2015/public_api.js +2 -0
- package/esm2015/src/actions.js +97 -0
- package/esm2015/src/config.js +61 -0
- package/esm2015/src/devtools-dispatcher.js +9 -0
- package/esm2015/src/devtools.js +115 -0
- package/esm2015/src/extension.js +160 -0
- package/esm2015/src/index.js +5 -0
- package/esm2015/src/instrument.js +67 -0
- package/esm2015/src/reducer.js +365 -0
- package/esm2015/src/utils.js +106 -0
- package/fesm2015/ngrx-store-devtools.js +964 -0
- package/fesm2015/ngrx-store-devtools.js.map +1 -0
- package/index.d.ts +6 -0
- package/migrations/6_0_0/index.js +8 -0
- package/migrations/6_0_0/index.js.map +1 -0
- package/migrations/migration.json +10 -0
- package/ngrx-store-devtools.d.ts +8 -0
- package/ngrx-store-devtools.metadata.json +1 -0
- package/package.json +52 -0
- package/public_api.d.ts +1 -0
- package/schematics/collection.json +10 -0
- package/schematics/ng-add/index.js +110 -0
- package/schematics/ng-add/index.js.map +1 -0
- package/schematics/ng-add/schema.js +3 -0
- package/schematics/ng-add/schema.js.map +1 -0
- package/schematics/ng-add/schema.json +42 -0
- package/schematics-core/index.js +86 -0
- package/schematics-core/index.js.map +1 -0
- package/schematics-core/utility/angular-utils.js +33 -0
- package/schematics-core/utility/angular-utils.js.map +1 -0
- package/schematics-core/utility/ast-utils.js +701 -0
- package/schematics-core/utility/ast-utils.js.map +1 -0
- package/schematics-core/utility/change.js +162 -0
- package/schematics-core/utility/change.js.map +1 -0
- package/schematics-core/utility/config.js +21 -0
- package/schematics-core/utility/config.js.map +1 -0
- package/schematics-core/utility/find-component.js +101 -0
- package/schematics-core/utility/find-component.js.map +1 -0
- package/schematics-core/utility/find-module.js +102 -0
- package/schematics-core/utility/find-module.js.map +1 -0
- package/schematics-core/utility/json-utilts.js +37 -0
- package/schematics-core/utility/json-utilts.js.map +1 -0
- package/schematics-core/utility/libs-version.js +5 -0
- package/schematics-core/utility/libs-version.js.map +1 -0
- package/schematics-core/utility/ngrx-utils.js +246 -0
- package/schematics-core/utility/ngrx-utils.js.map +1 -0
- package/schematics-core/utility/package.js +23 -0
- package/schematics-core/utility/package.js.map +1 -0
- package/schematics-core/utility/parse-name.js +14 -0
- package/schematics-core/utility/parse-name.js.map +1 -0
- package/schematics-core/utility/project.js +35 -0
- package/schematics-core/utility/project.js.map +1 -0
- package/schematics-core/utility/strings.js +138 -0
- package/schematics-core/utility/strings.js.map +1 -0
- package/schematics-core/utility/update.js +34 -0
- package/schematics-core/utility/update.js.map +1 -0
- package/schematics-core/utility/visitors.js +250 -0
- package/schematics-core/utility/visitors.js.map +1 -0
- package/src/actions.d.ts +79 -0
- package/src/config.d.ts +113 -0
- package/src/devtools-dispatcher.d.ts +3 -0
- package/src/devtools.d.ts +31 -0
- package/src/extension.d.ts +46 -0
- package/src/index.d.ts +4 -0
- package/src/instrument.d.ts +12 -0
- package/src/reducer.d.ts +47 -0
- package/src/utils.d.ts +42 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
3
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
4
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
5
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
6
|
+
function step(op) {
|
|
7
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
8
|
+
while (_) try {
|
|
9
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
10
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
11
|
+
switch (op[0]) {
|
|
12
|
+
case 0: case 1: t = op; break;
|
|
13
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
14
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
15
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
16
|
+
default:
|
|
17
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
18
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
19
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
20
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
21
|
+
if (t[2]) _.ops.pop();
|
|
22
|
+
_.trys.pop(); continue;
|
|
23
|
+
}
|
|
24
|
+
op = body.call(thisArg, _);
|
|
25
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
26
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var __values = (this && this.__values) || function(o) {
|
|
30
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
31
|
+
if (m) return m.call(o);
|
|
32
|
+
if (o && typeof o.length === "number") return {
|
|
33
|
+
next: function () {
|
|
34
|
+
if (o && i >= o.length) o = void 0;
|
|
35
|
+
return { value: o && o[i++], done: !o };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
39
|
+
};
|
|
40
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
41
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
42
|
+
if (!m) return o;
|
|
43
|
+
var i = m.call(o), r, ar = [], e;
|
|
44
|
+
try {
|
|
45
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
46
|
+
}
|
|
47
|
+
catch (error) { e = { error: error }; }
|
|
48
|
+
finally {
|
|
49
|
+
try {
|
|
50
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
51
|
+
}
|
|
52
|
+
finally { if (e) throw e.error; }
|
|
53
|
+
}
|
|
54
|
+
return ar;
|
|
55
|
+
};
|
|
56
|
+
exports.__esModule = true;
|
|
57
|
+
exports.visitDecorator = exports.visitNgModules = exports.visitComponents = exports.visitNgModuleExports = exports.visitNgModuleImports = exports.visitTemplates = exports.visitTSSourceFiles = void 0;
|
|
58
|
+
var ts = require("typescript");
|
|
59
|
+
var core_1 = require("@angular-devkit/core");
|
|
60
|
+
function visitTSSourceFiles(tree, visitor) {
|
|
61
|
+
var e_1, _a;
|
|
62
|
+
var result = undefined;
|
|
63
|
+
try {
|
|
64
|
+
for (var _b = __values(visit(tree.root)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
65
|
+
var sourceFile = _c.value;
|
|
66
|
+
result = visitor(sourceFile, tree, result);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
70
|
+
finally {
|
|
71
|
+
try {
|
|
72
|
+
if (_c && !_c.done && (_a = _b["return"])) _a.call(_b);
|
|
73
|
+
}
|
|
74
|
+
finally { if (e_1) throw e_1.error; }
|
|
75
|
+
}
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
78
|
+
exports.visitTSSourceFiles = visitTSSourceFiles;
|
|
79
|
+
function visitTemplates(tree, visitor) {
|
|
80
|
+
visitTSSourceFiles(tree, function (source) {
|
|
81
|
+
visitComponents(source, function (_, decoratorExpressionNode) {
|
|
82
|
+
ts.forEachChild(decoratorExpressionNode, function findTemplates(n) {
|
|
83
|
+
if (ts.isPropertyAssignment(n) && ts.isIdentifier(n.name)) {
|
|
84
|
+
if (n.name.text === 'template' &&
|
|
85
|
+
ts.isStringLiteralLike(n.initializer)) {
|
|
86
|
+
// Need to add an offset of one to the start because the template quotes are
|
|
87
|
+
// not part of the template content.
|
|
88
|
+
var templateStartIdx = n.initializer.getStart() + 1;
|
|
89
|
+
visitor({
|
|
90
|
+
fileName: source.fileName,
|
|
91
|
+
content: n.initializer.text,
|
|
92
|
+
inline: true,
|
|
93
|
+
start: templateStartIdx
|
|
94
|
+
}, tree);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
else if (n.name.text === 'templateUrl' &&
|
|
98
|
+
ts.isStringLiteralLike(n.initializer)) {
|
|
99
|
+
var parts = core_1.normalize(source.fileName).split('/').slice(0, -1);
|
|
100
|
+
var templatePath = core_1.resolve(core_1.normalize(parts.join('/')), core_1.normalize(n.initializer.text));
|
|
101
|
+
if (!tree.exists(templatePath)) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
var fileContent = tree.read(templatePath);
|
|
105
|
+
if (!fileContent) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
visitor({
|
|
109
|
+
fileName: templatePath,
|
|
110
|
+
content: fileContent.toString(),
|
|
111
|
+
inline: false,
|
|
112
|
+
start: 0
|
|
113
|
+
}, tree);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
ts.forEachChild(n, findTemplates);
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
exports.visitTemplates = visitTemplates;
|
|
123
|
+
function visitNgModuleImports(sourceFile, callback) {
|
|
124
|
+
visitNgModuleProperty(sourceFile, callback, 'imports');
|
|
125
|
+
}
|
|
126
|
+
exports.visitNgModuleImports = visitNgModuleImports;
|
|
127
|
+
function visitNgModuleExports(sourceFile, callback) {
|
|
128
|
+
visitNgModuleProperty(sourceFile, callback, 'exports');
|
|
129
|
+
}
|
|
130
|
+
exports.visitNgModuleExports = visitNgModuleExports;
|
|
131
|
+
function visitNgModuleProperty(sourceFile, callback, property) {
|
|
132
|
+
visitNgModules(sourceFile, function (_, decoratorExpressionNode) {
|
|
133
|
+
ts.forEachChild(decoratorExpressionNode, function findTemplates(n) {
|
|
134
|
+
if (ts.isPropertyAssignment(n) &&
|
|
135
|
+
ts.isIdentifier(n.name) &&
|
|
136
|
+
n.name.text === property &&
|
|
137
|
+
ts.isArrayLiteralExpression(n.initializer)) {
|
|
138
|
+
callback(n, n.initializer.elements);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
ts.forEachChild(n, findTemplates);
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
function visitComponents(sourceFile, callback) {
|
|
146
|
+
visitDecorator(sourceFile, 'Component', callback);
|
|
147
|
+
}
|
|
148
|
+
exports.visitComponents = visitComponents;
|
|
149
|
+
function visitNgModules(sourceFile, callback) {
|
|
150
|
+
visitDecorator(sourceFile, 'NgModule', callback);
|
|
151
|
+
}
|
|
152
|
+
exports.visitNgModules = visitNgModules;
|
|
153
|
+
function visitDecorator(sourceFile, decoratorName, callback) {
|
|
154
|
+
ts.forEachChild(sourceFile, function findClassDeclaration(node) {
|
|
155
|
+
if (!ts.isClassDeclaration(node)) {
|
|
156
|
+
ts.forEachChild(node, findClassDeclaration);
|
|
157
|
+
}
|
|
158
|
+
var classDeclarationNode = node;
|
|
159
|
+
if (!classDeclarationNode.decorators ||
|
|
160
|
+
!classDeclarationNode.decorators.length) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
var componentDecorator = classDeclarationNode.decorators.find(function (d) {
|
|
164
|
+
return (ts.isCallExpression(d.expression) &&
|
|
165
|
+
ts.isIdentifier(d.expression.expression) &&
|
|
166
|
+
d.expression.expression.text === decoratorName);
|
|
167
|
+
});
|
|
168
|
+
if (!componentDecorator) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
var expression = componentDecorator.expression;
|
|
172
|
+
if (!ts.isCallExpression(expression)) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
var _a = __read(expression.arguments, 1), arg = _a[0];
|
|
176
|
+
if (!arg || !ts.isObjectLiteralExpression(arg)) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
callback(classDeclarationNode, arg);
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
exports.visitDecorator = visitDecorator;
|
|
183
|
+
function visit(directory) {
|
|
184
|
+
var _a, _b, path, entry, content, source, e_2_1, _c, _d, path, e_3_1;
|
|
185
|
+
var e_2, _e, e_3, _f;
|
|
186
|
+
return __generator(this, function (_g) {
|
|
187
|
+
switch (_g.label) {
|
|
188
|
+
case 0:
|
|
189
|
+
_g.trys.push([0, 5, 6, 7]);
|
|
190
|
+
_a = __values(directory.subfiles), _b = _a.next();
|
|
191
|
+
_g.label = 1;
|
|
192
|
+
case 1:
|
|
193
|
+
if (!!_b.done) return [3 /*break*/, 4];
|
|
194
|
+
path = _b.value;
|
|
195
|
+
if (!(path.endsWith('.ts') && !path.endsWith('.d.ts'))) return [3 /*break*/, 3];
|
|
196
|
+
entry = directory.file(path);
|
|
197
|
+
if (!entry) return [3 /*break*/, 3];
|
|
198
|
+
content = entry.content;
|
|
199
|
+
source = ts.createSourceFile(entry.path, content.toString().replace(/^\uFEFF/, ''), ts.ScriptTarget.Latest, true);
|
|
200
|
+
return [4 /*yield*/, source];
|
|
201
|
+
case 2:
|
|
202
|
+
_g.sent();
|
|
203
|
+
_g.label = 3;
|
|
204
|
+
case 3:
|
|
205
|
+
_b = _a.next();
|
|
206
|
+
return [3 /*break*/, 1];
|
|
207
|
+
case 4: return [3 /*break*/, 7];
|
|
208
|
+
case 5:
|
|
209
|
+
e_2_1 = _g.sent();
|
|
210
|
+
e_2 = { error: e_2_1 };
|
|
211
|
+
return [3 /*break*/, 7];
|
|
212
|
+
case 6:
|
|
213
|
+
try {
|
|
214
|
+
if (_b && !_b.done && (_e = _a["return"])) _e.call(_a);
|
|
215
|
+
}
|
|
216
|
+
finally { if (e_2) throw e_2.error; }
|
|
217
|
+
return [7 /*endfinally*/];
|
|
218
|
+
case 7:
|
|
219
|
+
_g.trys.push([7, 12, 13, 14]);
|
|
220
|
+
_c = __values(directory.subdirs), _d = _c.next();
|
|
221
|
+
_g.label = 8;
|
|
222
|
+
case 8:
|
|
223
|
+
if (!!_d.done) return [3 /*break*/, 11];
|
|
224
|
+
path = _d.value;
|
|
225
|
+
if (path === 'node_modules') {
|
|
226
|
+
return [3 /*break*/, 10];
|
|
227
|
+
}
|
|
228
|
+
return [5 /*yield**/, __values(visit(directory.dir(path)))];
|
|
229
|
+
case 9:
|
|
230
|
+
_g.sent();
|
|
231
|
+
_g.label = 10;
|
|
232
|
+
case 10:
|
|
233
|
+
_d = _c.next();
|
|
234
|
+
return [3 /*break*/, 8];
|
|
235
|
+
case 11: return [3 /*break*/, 14];
|
|
236
|
+
case 12:
|
|
237
|
+
e_3_1 = _g.sent();
|
|
238
|
+
e_3 = { error: e_3_1 };
|
|
239
|
+
return [3 /*break*/, 14];
|
|
240
|
+
case 13:
|
|
241
|
+
try {
|
|
242
|
+
if (_d && !_d.done && (_f = _c["return"])) _f.call(_c);
|
|
243
|
+
}
|
|
244
|
+
finally { if (e_3) throw e_3.error; }
|
|
245
|
+
return [7 /*endfinally*/];
|
|
246
|
+
case 14: return [2 /*return*/];
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
//# sourceMappingURL=visitors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visitors.js","sourceRoot":"","sources":["../../../../../modules/store-devtools/schematics-core/utility/visitors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAiC;AACjC,6CAA0D;AAG1D,SAAgB,kBAAkB,CACh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Z,SAAY,CAAC;;;;;;;;;;;;;;;;;;gBAKA,KAAA,SAAA,SAAS,CAAC,OAAO,CAAA;;;;gBAAzB,IAAI;gBACb,IAAI,IAAI,KAAK,cAAc,EAAE;oBAC3B,yBAAS;iBACV;gBAED,sBAAA,SAAO,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA,EAAA;;gBAAjC,SAAiC,CAAC;;;;;;;;;;;;;;;;;;;CAErC","sourcesContent":["import * as ts from 'typescript';\nimport { normalize, resolve } from '@angular-devkit/core';\nimport { Tree, DirEntry } from '@angular-devkit/schematics';\n\nexport function visitTSSourceFiles<Result = void>(\n tree: Tree,\n visitor: (\n sourceFile: ts.SourceFile,\n tree: Tree,\n result?: Result\n ) => Result | undefined\n): Result | undefined {\n let result: Result | undefined = undefined;\n for (const sourceFile of visit(tree.root)) {\n result = visitor(sourceFile, tree, result);\n }\n\n return result;\n}\n\nexport function visitTemplates(\n tree: Tree,\n visitor: (\n template: {\n fileName: string;\n content: string;\n inline: boolean;\n start: number;\n },\n tree: Tree\n ) => void\n): void {\n visitTSSourceFiles(tree, (source) => {\n visitComponents(source, (_, decoratorExpressionNode) => {\n ts.forEachChild(decoratorExpressionNode, function findTemplates(n) {\n if (ts.isPropertyAssignment(n) && ts.isIdentifier(n.name)) {\n if (\n n.name.text === 'template' &&\n ts.isStringLiteralLike(n.initializer)\n ) {\n // Need to add an offset of one to the start because the template quotes are\n // not part of the template content.\n const templateStartIdx = n.initializer.getStart() + 1;\n visitor(\n {\n fileName: source.fileName,\n content: n.initializer.text,\n inline: true,\n start: templateStartIdx,\n },\n tree\n );\n return;\n } else if (\n n.name.text === 'templateUrl' &&\n ts.isStringLiteralLike(n.initializer)\n ) {\n const parts = normalize(source.fileName).split('/').slice(0, -1);\n const templatePath = resolve(\n normalize(parts.join('/')),\n normalize(n.initializer.text)\n );\n if (!tree.exists(templatePath)) {\n return;\n }\n\n const fileContent = tree.read(templatePath);\n if (!fileContent) {\n return;\n }\n\n visitor(\n {\n fileName: templatePath,\n content: fileContent.toString(),\n inline: false,\n start: 0,\n },\n tree\n );\n return;\n }\n }\n\n ts.forEachChild(n, findTemplates);\n });\n });\n });\n}\n\nexport function visitNgModuleImports(\n sourceFile: ts.SourceFile,\n callback: (\n importNode: ts.PropertyAssignment,\n elementExpressions: ts.NodeArray<ts.Expression>\n ) => void\n) {\n visitNgModuleProperty(sourceFile, callback, 'imports');\n}\n\nexport function visitNgModuleExports(\n sourceFile: ts.SourceFile,\n callback: (\n exportNode: ts.PropertyAssignment,\n elementExpressions: ts.NodeArray<ts.Expression>\n ) => void\n) {\n visitNgModuleProperty(sourceFile, callback, 'exports');\n}\n\nfunction visitNgModuleProperty(\n sourceFile: ts.SourceFile,\n callback: (\n nodes: ts.PropertyAssignment,\n elementExpressions: ts.NodeArray<ts.Expression>\n ) => void,\n property: string\n) {\n visitNgModules(sourceFile, (_, decoratorExpressionNode) => {\n ts.forEachChild(decoratorExpressionNode, function findTemplates(n) {\n if (\n ts.isPropertyAssignment(n) &&\n ts.isIdentifier(n.name) &&\n n.name.text === property &&\n ts.isArrayLiteralExpression(n.initializer)\n ) {\n callback(n, n.initializer.elements);\n return;\n }\n\n ts.forEachChild(n, findTemplates);\n });\n });\n}\nexport function visitComponents(\n sourceFile: ts.SourceFile,\n callback: (\n classDeclarationNode: ts.ClassDeclaration,\n decoratorExpressionNode: ts.ObjectLiteralExpression\n ) => void\n) {\n visitDecorator(sourceFile, 'Component', callback);\n}\n\nexport function visitNgModules(\n sourceFile: ts.SourceFile,\n callback: (\n classDeclarationNode: ts.ClassDeclaration,\n decoratorExpressionNode: ts.ObjectLiteralExpression\n ) => void\n) {\n visitDecorator(sourceFile, 'NgModule', callback);\n}\n\nexport function visitDecorator(\n sourceFile: ts.SourceFile,\n decoratorName: string,\n callback: (\n classDeclarationNode: ts.ClassDeclaration,\n decoratorExpressionNode: ts.ObjectLiteralExpression\n ) => void\n) {\n ts.forEachChild(sourceFile, function findClassDeclaration(node) {\n if (!ts.isClassDeclaration(node)) {\n ts.forEachChild(node, findClassDeclaration);\n }\n\n const classDeclarationNode = node as ts.ClassDeclaration;\n\n if (\n !classDeclarationNode.decorators ||\n !classDeclarationNode.decorators.length\n ) {\n return;\n }\n\n const componentDecorator = classDeclarationNode.decorators.find((d) => {\n return (\n ts.isCallExpression(d.expression) &&\n ts.isIdentifier(d.expression.expression) &&\n d.expression.expression.text === decoratorName\n );\n });\n\n if (!componentDecorator) {\n return;\n }\n\n const { expression } = componentDecorator;\n if (!ts.isCallExpression(expression)) {\n return;\n }\n\n const [arg] = expression.arguments;\n if (!arg || !ts.isObjectLiteralExpression(arg)) {\n return;\n }\n\n callback(classDeclarationNode, arg);\n });\n}\n\nfunction* visit(directory: DirEntry): IterableIterator<ts.SourceFile> {\n for (const path of directory.subfiles) {\n if (path.endsWith('.ts') && !path.endsWith('.d.ts')) {\n const entry = directory.file(path);\n if (entry) {\n const content = entry.content;\n const source = ts.createSourceFile(\n entry.path,\n content.toString().replace(/^\\uFEFF/, ''),\n ts.ScriptTarget.Latest,\n true\n );\n yield source;\n }\n }\n }\n\n for (const path of directory.subdirs) {\n if (path === 'node_modules') {\n continue;\n }\n\n yield* visit(directory.dir(path));\n }\n}\n"]}
|
package/src/actions.d.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Action } from '@ngrx/store';
|
|
2
|
+
export declare const PERFORM_ACTION = "PERFORM_ACTION";
|
|
3
|
+
export declare const REFRESH = "REFRESH";
|
|
4
|
+
export declare const RESET = "RESET";
|
|
5
|
+
export declare const ROLLBACK = "ROLLBACK";
|
|
6
|
+
export declare const COMMIT = "COMMIT";
|
|
7
|
+
export declare const SWEEP = "SWEEP";
|
|
8
|
+
export declare const TOGGLE_ACTION = "TOGGLE_ACTION";
|
|
9
|
+
export declare const SET_ACTIONS_ACTIVE = "SET_ACTIONS_ACTIVE";
|
|
10
|
+
export declare const JUMP_TO_STATE = "JUMP_TO_STATE";
|
|
11
|
+
export declare const JUMP_TO_ACTION = "JUMP_TO_ACTION";
|
|
12
|
+
export declare const IMPORT_STATE = "IMPORT_STATE";
|
|
13
|
+
export declare const LOCK_CHANGES = "LOCK_CHANGES";
|
|
14
|
+
export declare const PAUSE_RECORDING = "PAUSE_RECORDING";
|
|
15
|
+
export declare class PerformAction implements Action {
|
|
16
|
+
action: Action;
|
|
17
|
+
timestamp: number;
|
|
18
|
+
readonly type = "PERFORM_ACTION";
|
|
19
|
+
constructor(action: Action, timestamp: number);
|
|
20
|
+
}
|
|
21
|
+
export declare class Refresh implements Action {
|
|
22
|
+
readonly type = "REFRESH";
|
|
23
|
+
}
|
|
24
|
+
export declare class Reset implements Action {
|
|
25
|
+
timestamp: number;
|
|
26
|
+
readonly type = "RESET";
|
|
27
|
+
constructor(timestamp: number);
|
|
28
|
+
}
|
|
29
|
+
export declare class Rollback implements Action {
|
|
30
|
+
timestamp: number;
|
|
31
|
+
readonly type = "ROLLBACK";
|
|
32
|
+
constructor(timestamp: number);
|
|
33
|
+
}
|
|
34
|
+
export declare class Commit implements Action {
|
|
35
|
+
timestamp: number;
|
|
36
|
+
readonly type = "COMMIT";
|
|
37
|
+
constructor(timestamp: number);
|
|
38
|
+
}
|
|
39
|
+
export declare class Sweep implements Action {
|
|
40
|
+
readonly type = "SWEEP";
|
|
41
|
+
}
|
|
42
|
+
export declare class ToggleAction implements Action {
|
|
43
|
+
id: number;
|
|
44
|
+
readonly type = "TOGGLE_ACTION";
|
|
45
|
+
constructor(id: number);
|
|
46
|
+
}
|
|
47
|
+
export declare class SetActionsActive implements Action {
|
|
48
|
+
start: number;
|
|
49
|
+
end: number;
|
|
50
|
+
active: boolean;
|
|
51
|
+
readonly type = "SET_ACTIONS_ACTIVE";
|
|
52
|
+
constructor(start: number, end: number, active?: boolean);
|
|
53
|
+
}
|
|
54
|
+
export declare class JumpToState implements Action {
|
|
55
|
+
index: number;
|
|
56
|
+
readonly type = "JUMP_TO_STATE";
|
|
57
|
+
constructor(index: number);
|
|
58
|
+
}
|
|
59
|
+
export declare class JumpToAction implements Action {
|
|
60
|
+
actionId: number;
|
|
61
|
+
readonly type = "JUMP_TO_ACTION";
|
|
62
|
+
constructor(actionId: number);
|
|
63
|
+
}
|
|
64
|
+
export declare class ImportState implements Action {
|
|
65
|
+
nextLiftedState: any;
|
|
66
|
+
readonly type = "IMPORT_STATE";
|
|
67
|
+
constructor(nextLiftedState: any);
|
|
68
|
+
}
|
|
69
|
+
export declare class LockChanges implements Action {
|
|
70
|
+
status: boolean;
|
|
71
|
+
readonly type = "LOCK_CHANGES";
|
|
72
|
+
constructor(status: boolean);
|
|
73
|
+
}
|
|
74
|
+
export declare class PauseRecording implements Action {
|
|
75
|
+
status: boolean;
|
|
76
|
+
readonly type = "PAUSE_RECORDING";
|
|
77
|
+
constructor(status: boolean);
|
|
78
|
+
}
|
|
79
|
+
export declare type All = PerformAction | Refresh | Reset | Rollback | Commit | Sweep | ToggleAction | SetActionsActive | JumpToState | JumpToAction | ImportState | LockChanges | PauseRecording;
|
package/src/config.d.ts
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { ActionReducer, Action } from '@ngrx/store';
|
|
2
|
+
import { InjectionToken } from '@angular/core';
|
|
3
|
+
export declare type ActionSanitizer = (action: Action, id: number) => Action;
|
|
4
|
+
export declare type StateSanitizer = (state: any, index: number) => any;
|
|
5
|
+
export declare type SerializationOptions = {
|
|
6
|
+
options?: boolean | any;
|
|
7
|
+
replacer?: (key: any, value: any) => {};
|
|
8
|
+
reviver?: (key: any, value: any) => {};
|
|
9
|
+
immutable?: any;
|
|
10
|
+
refs?: Array<any>;
|
|
11
|
+
};
|
|
12
|
+
export declare type Predicate = (state: any, action: Action) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Chrome extension documentation
|
|
15
|
+
* @see https://github.com/reduxjs/redux-devtools/blob/main/extension/docs/API/Arguments.md#features
|
|
16
|
+
* Firefox extension documentation
|
|
17
|
+
* @see https://github.com/zalmoxisus/redux-devtools-extension/blob/master/docs/API/Arguments.md#features
|
|
18
|
+
*/
|
|
19
|
+
export interface DevToolsFeatureOptions {
|
|
20
|
+
/**
|
|
21
|
+
* Start/pause recording of dispatched actions
|
|
22
|
+
*/
|
|
23
|
+
pause?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Lock/unlock dispatching actions and side effects
|
|
26
|
+
*/
|
|
27
|
+
lock?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Persist states on page reloading
|
|
30
|
+
*/
|
|
31
|
+
persist?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Export history of actions in a file
|
|
34
|
+
*/
|
|
35
|
+
export?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Import history of actions from a file
|
|
38
|
+
*/
|
|
39
|
+
import?: 'custom' | boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Jump back and forth (time travelling)
|
|
42
|
+
*/
|
|
43
|
+
jump?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Skip (cancel) actions
|
|
46
|
+
*/
|
|
47
|
+
skip?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Drag and drop actions in the history list
|
|
50
|
+
*/
|
|
51
|
+
reorder?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Dispatch custom actions or action creators
|
|
54
|
+
*/
|
|
55
|
+
dispatch?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Generate tests for the selected actions
|
|
58
|
+
*/
|
|
59
|
+
test?: boolean;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Chrome extension documentation
|
|
63
|
+
* @see https://github.com/reduxjs/redux-devtools/blob/main/extension/docs/API/Arguments.md
|
|
64
|
+
* Firefox extension documentation
|
|
65
|
+
* @see https://github.com/zalmoxisus/redux-devtools-extension/blob/master/docs/API/Arguments.md
|
|
66
|
+
*/
|
|
67
|
+
export declare class StoreDevtoolsConfig {
|
|
68
|
+
/**
|
|
69
|
+
* Maximum allowed actions to be stored in the history tree (default: `false`)
|
|
70
|
+
*/
|
|
71
|
+
maxAge: number | false;
|
|
72
|
+
monitor?: ActionReducer<any, any>;
|
|
73
|
+
/**
|
|
74
|
+
* Function which takes `action` object and id number as arguments, and should return `action` object back.
|
|
75
|
+
*/
|
|
76
|
+
actionSanitizer?: ActionSanitizer;
|
|
77
|
+
/**
|
|
78
|
+
* Function which takes `state` object and index as arguments, and should return `state` object back.
|
|
79
|
+
*/
|
|
80
|
+
stateSanitizer?: StateSanitizer;
|
|
81
|
+
/**
|
|
82
|
+
* The instance name to be shown on the monitor page (default: `document.title`)
|
|
83
|
+
*/
|
|
84
|
+
name?: string;
|
|
85
|
+
serialize?: boolean | SerializationOptions;
|
|
86
|
+
logOnly?: boolean;
|
|
87
|
+
features?: DevToolsFeatureOptions;
|
|
88
|
+
/**
|
|
89
|
+
* Action types to be hidden in the monitors. If `actionsSafelist` specified, `actionsBlocklist` is ignored.
|
|
90
|
+
*/
|
|
91
|
+
actionsBlocklist?: string[];
|
|
92
|
+
/**
|
|
93
|
+
* Action types to be shown in the monitors
|
|
94
|
+
*/
|
|
95
|
+
actionsSafelist?: string[];
|
|
96
|
+
/**
|
|
97
|
+
* Called for every action before sending, takes state and action object, and returns true in case it allows sending the current data to the monitor.
|
|
98
|
+
*/
|
|
99
|
+
predicate?: Predicate;
|
|
100
|
+
/**
|
|
101
|
+
* Auto pauses when the extension’s window is not opened, and so has zero impact on your app when not in use.
|
|
102
|
+
*/
|
|
103
|
+
autoPause?: boolean;
|
|
104
|
+
}
|
|
105
|
+
export declare const STORE_DEVTOOLS_CONFIG: InjectionToken<StoreDevtoolsConfig>;
|
|
106
|
+
/**
|
|
107
|
+
* Used to provide a `StoreDevtoolsConfig` for the store-devtools.
|
|
108
|
+
*/
|
|
109
|
+
export declare const INITIAL_OPTIONS: InjectionToken<StoreDevtoolsConfig>;
|
|
110
|
+
export declare type StoreDevtoolsOptions = Partial<StoreDevtoolsConfig> | (() => Partial<StoreDevtoolsConfig>);
|
|
111
|
+
export declare function noMonitor(): null;
|
|
112
|
+
export declare const DEFAULT_NAME = "NgRx Store DevTools";
|
|
113
|
+
export declare function createConfig(optionsInput: StoreDevtoolsOptions): StoreDevtoolsConfig;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ErrorHandler } from '@angular/core';
|
|
2
|
+
import { Action, ActionsSubject, ReducerObservable, ScannedActionsSubject } from '@ngrx/store';
|
|
3
|
+
import { Observable, Observer } from 'rxjs';
|
|
4
|
+
import { StoreDevtoolsConfig } from './config';
|
|
5
|
+
import { DevtoolsExtension } from './extension';
|
|
6
|
+
import { LiftedState } from './reducer';
|
|
7
|
+
import { DevtoolsDispatcher } from './devtools-dispatcher';
|
|
8
|
+
export declare class StoreDevtools implements Observer<any> {
|
|
9
|
+
private stateSubscription;
|
|
10
|
+
private extensionStartSubscription;
|
|
11
|
+
dispatcher: ActionsSubject;
|
|
12
|
+
liftedState: Observable<LiftedState>;
|
|
13
|
+
state: Observable<any>;
|
|
14
|
+
constructor(dispatcher: DevtoolsDispatcher, actions$: ActionsSubject, reducers$: ReducerObservable, extension: DevtoolsExtension, scannedActions: ScannedActionsSubject, errorHandler: ErrorHandler, initialState: any, config: StoreDevtoolsConfig);
|
|
15
|
+
dispatch(action: Action): void;
|
|
16
|
+
next(action: any): void;
|
|
17
|
+
error(error: any): void;
|
|
18
|
+
complete(): void;
|
|
19
|
+
performAction(action: any): void;
|
|
20
|
+
refresh(): void;
|
|
21
|
+
reset(): void;
|
|
22
|
+
rollback(): void;
|
|
23
|
+
commit(): void;
|
|
24
|
+
sweep(): void;
|
|
25
|
+
toggleAction(id: number): void;
|
|
26
|
+
jumpToAction(actionId: number): void;
|
|
27
|
+
jumpToState(index: number): void;
|
|
28
|
+
importState(nextLiftedState: any): void;
|
|
29
|
+
lockChanges(status: boolean): void;
|
|
30
|
+
pauseRecording(status: boolean): void;
|
|
31
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { SerializationOptions, StoreDevtoolsConfig } from './config';
|
|
4
|
+
import { DevtoolsDispatcher } from './devtools-dispatcher';
|
|
5
|
+
import { LiftedAction, LiftedState } from './reducer';
|
|
6
|
+
export declare const ExtensionActionTypes: {
|
|
7
|
+
START: string;
|
|
8
|
+
DISPATCH: string;
|
|
9
|
+
STOP: string;
|
|
10
|
+
ACTION: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const REDUX_DEVTOOLS_EXTENSION: InjectionToken<ReduxDevtoolsExtension>;
|
|
13
|
+
export interface ReduxDevtoolsExtensionConnection {
|
|
14
|
+
subscribe(listener: (change: any) => void): void;
|
|
15
|
+
unsubscribe(): void;
|
|
16
|
+
send(action: any, state: any): void;
|
|
17
|
+
init(state?: any): void;
|
|
18
|
+
error(anyErr: any): void;
|
|
19
|
+
}
|
|
20
|
+
export interface ReduxDevtoolsExtensionConfig {
|
|
21
|
+
features?: object | boolean;
|
|
22
|
+
name: string | undefined;
|
|
23
|
+
maxAge?: number;
|
|
24
|
+
autoPause?: boolean;
|
|
25
|
+
serialize?: boolean | SerializationOptions;
|
|
26
|
+
}
|
|
27
|
+
export interface ReduxDevtoolsExtension {
|
|
28
|
+
connect(options: ReduxDevtoolsExtensionConfig): ReduxDevtoolsExtensionConnection;
|
|
29
|
+
send(action: any, state: any, options: ReduxDevtoolsExtensionConfig): void;
|
|
30
|
+
}
|
|
31
|
+
export declare class DevtoolsExtension {
|
|
32
|
+
private config;
|
|
33
|
+
private dispatcher;
|
|
34
|
+
private devtoolsExtension;
|
|
35
|
+
private extensionConnection;
|
|
36
|
+
liftedActions$: Observable<any>;
|
|
37
|
+
actions$: Observable<any>;
|
|
38
|
+
start$: Observable<any>;
|
|
39
|
+
constructor(devtoolsExtension: ReduxDevtoolsExtension, config: StoreDevtoolsConfig, dispatcher: DevtoolsDispatcher);
|
|
40
|
+
notify(action: LiftedAction, state: LiftedState): void;
|
|
41
|
+
private createChangesObservable;
|
|
42
|
+
private createActionStreams;
|
|
43
|
+
private unwrapAction;
|
|
44
|
+
private getExtensionConfig;
|
|
45
|
+
private sendToReduxDevtools;
|
|
46
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InjectionToken, ModuleWithProviders } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { StoreDevtoolsConfig, StoreDevtoolsOptions } from './config';
|
|
4
|
+
import { StoreDevtools } from './devtools';
|
|
5
|
+
import { ReduxDevtoolsExtension } from './extension';
|
|
6
|
+
export declare const IS_EXTENSION_OR_MONITOR_PRESENT: InjectionToken<boolean>;
|
|
7
|
+
export declare function createIsExtensionOrMonitorPresent(extension: ReduxDevtoolsExtension | null, config: StoreDevtoolsConfig): boolean;
|
|
8
|
+
export declare function createReduxDevtoolsExtension(): any;
|
|
9
|
+
export declare function createStateObservable(devtools: StoreDevtools): Observable<any>;
|
|
10
|
+
export declare class StoreDevtoolsModule {
|
|
11
|
+
static instrument(options?: StoreDevtoolsOptions): ModuleWithProviders<StoreDevtoolsModule>;
|
|
12
|
+
}
|
package/src/reducer.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ErrorHandler } from '@angular/core';
|
|
2
|
+
import { Action, ActionReducer, UPDATE, INIT } from '@ngrx/store';
|
|
3
|
+
import * as DevtoolsActions from './actions';
|
|
4
|
+
import { StoreDevtoolsConfig } from './config';
|
|
5
|
+
export declare type InitAction = {
|
|
6
|
+
readonly type: typeof INIT;
|
|
7
|
+
};
|
|
8
|
+
export declare type UpdateReducerAction = {
|
|
9
|
+
readonly type: typeof UPDATE;
|
|
10
|
+
};
|
|
11
|
+
export declare type CoreActions = InitAction | UpdateReducerAction;
|
|
12
|
+
export declare type Actions = DevtoolsActions.All | CoreActions;
|
|
13
|
+
export declare const INIT_ACTION: {
|
|
14
|
+
type: "@ngrx/store/init";
|
|
15
|
+
};
|
|
16
|
+
export declare const RECOMPUTE: "@ngrx/store-devtools/recompute";
|
|
17
|
+
export declare const RECOMPUTE_ACTION: {
|
|
18
|
+
type: "@ngrx/store-devtools/recompute";
|
|
19
|
+
};
|
|
20
|
+
export interface ComputedState {
|
|
21
|
+
state: any;
|
|
22
|
+
error: any;
|
|
23
|
+
}
|
|
24
|
+
export interface LiftedAction {
|
|
25
|
+
type: string;
|
|
26
|
+
action: Action;
|
|
27
|
+
}
|
|
28
|
+
export interface LiftedActions {
|
|
29
|
+
[id: number]: LiftedAction;
|
|
30
|
+
}
|
|
31
|
+
export interface LiftedState {
|
|
32
|
+
monitorState: any;
|
|
33
|
+
nextActionId: number;
|
|
34
|
+
actionsById: LiftedActions;
|
|
35
|
+
stagedActionIds: number[];
|
|
36
|
+
skippedActionIds: number[];
|
|
37
|
+
committedState: any;
|
|
38
|
+
currentStateIndex: number;
|
|
39
|
+
computedStates: ComputedState[];
|
|
40
|
+
isLocked: boolean;
|
|
41
|
+
isPaused: boolean;
|
|
42
|
+
}
|
|
43
|
+
export declare function liftInitialState(initialCommittedState?: any, monitorReducer?: any): LiftedState;
|
|
44
|
+
/**
|
|
45
|
+
* Creates a history state reducer from an app's reducer.
|
|
46
|
+
*/
|
|
47
|
+
export declare function liftReducerWith(initialCommittedState: any, initialLiftedState: LiftedState, errorHandler: ErrorHandler, monitorReducer?: any, options?: Partial<StoreDevtoolsConfig>): (reducer: ActionReducer<any, any>) => ActionReducer<LiftedState, Actions>;
|
package/src/utils.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Action } from '@ngrx/store';
|
|
2
|
+
import * as Actions from './actions';
|
|
3
|
+
import { ActionSanitizer, StateSanitizer, Predicate, StoreDevtoolsConfig } from './config';
|
|
4
|
+
import { ComputedState, LiftedAction, LiftedActions, LiftedState } from './reducer';
|
|
5
|
+
export declare function difference(first: any[], second: any[]): any[];
|
|
6
|
+
/**
|
|
7
|
+
* Provides an app's view into the state of the lifted store.
|
|
8
|
+
*/
|
|
9
|
+
export declare function unliftState(liftedState: LiftedState): any;
|
|
10
|
+
export declare function unliftAction(liftedState: LiftedState): LiftedAction;
|
|
11
|
+
/**
|
|
12
|
+
* Lifts an app's action into an action on the lifted store.
|
|
13
|
+
*/
|
|
14
|
+
export declare function liftAction(action: Action): Actions.PerformAction;
|
|
15
|
+
/**
|
|
16
|
+
* Sanitizes given actions with given function.
|
|
17
|
+
*/
|
|
18
|
+
export declare function sanitizeActions(actionSanitizer: ActionSanitizer, actions: LiftedActions): LiftedActions;
|
|
19
|
+
/**
|
|
20
|
+
* Sanitizes given action with given function.
|
|
21
|
+
*/
|
|
22
|
+
export declare function sanitizeAction(actionSanitizer: ActionSanitizer, action: LiftedAction, actionIdx: number): LiftedAction;
|
|
23
|
+
/**
|
|
24
|
+
* Sanitizes given states with given function.
|
|
25
|
+
*/
|
|
26
|
+
export declare function sanitizeStates(stateSanitizer: StateSanitizer, states: ComputedState[]): ComputedState[];
|
|
27
|
+
/**
|
|
28
|
+
* Sanitizes given state with given function.
|
|
29
|
+
*/
|
|
30
|
+
export declare function sanitizeState(stateSanitizer: StateSanitizer, state: any, stateIdx: number): any;
|
|
31
|
+
/**
|
|
32
|
+
* Read the config and tell if actions should be filtered
|
|
33
|
+
*/
|
|
34
|
+
export declare function shouldFilterActions(config: StoreDevtoolsConfig): string[] | Predicate;
|
|
35
|
+
/**
|
|
36
|
+
* Return a full filtered lifted state
|
|
37
|
+
*/
|
|
38
|
+
export declare function filterLiftedState(liftedState: LiftedState, predicate?: Predicate, safelist?: string[], blocklist?: string[]): LiftedState;
|
|
39
|
+
/**
|
|
40
|
+
* Return true is the action should be ignored
|
|
41
|
+
*/
|
|
42
|
+
export declare function isActionFiltered(state: any, action: LiftedAction, predicate?: Predicate, safelist?: string[], blockedlist?: string[]): true | RegExpMatchArray;
|