react-native-bundle-discovery 1.3.1 → 2.0.0-rc.2
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 +3 -3
- package/index.js +240 -1
- package/package.json +5 -21
- package/.discoveryrc.js +0 -22
- package/lib/bin.js +0 -87
- package/lib/build.js +0 -115
- package/lib/customSerializer.js +0 -196
- package/lib/server.js +0 -82
- package/pages/_common.js +0 -267
- package/pages/default.js +0 -211
- package/pages/module.js +0 -314
- package/pages/package.js +0 -161
- package/prepare.js +0 -102
- package/queryHelpers.js +0 -354
- package/setup.js +0 -12
- package/vendors/foamtree.js +0 -9008
- package/vendors/high-contrast-dark.js +0 -1
- package/vendors/highcharts-exporting.js +0 -13
- package/vendors/highcharts-networkgraph.js +0 -1
- package/vendors/highcharts.js +0 -10
- package/views/_theme.js +0 -35
- package/views/foamtree.js +0 -135
- package/views/global.css +0 -169
- package/views/highcharts.css +0 -1
- package/views/highcharts.js +0 -43
- package/views/prettify.js +0 -17
package/prepare.js
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
function getDuplicateId(path) {
|
|
2
|
-
const uniqueNodeModulePath = path.split("node_modules/").pop();
|
|
3
|
-
const ids = [uniqueNodeModulePath];
|
|
4
|
-
|
|
5
|
-
// Special case for lodash
|
|
6
|
-
if (
|
|
7
|
-
uniqueNodeModulePath.startsWith("lodash.") ||
|
|
8
|
-
uniqueNodeModulePath.startsWith("lodash-es/")
|
|
9
|
-
) {
|
|
10
|
-
// node_modules/lodash.debounce/index.js => node_modules/lodash/debounce.js
|
|
11
|
-
// node_modules/lodash-es/get.js => node_modules/lodash/get.js
|
|
12
|
-
const uniqueLodashPath = uniqueNodeModulePath
|
|
13
|
-
.replace("lodash-es/", "lodash/")
|
|
14
|
-
.replace("lodash.", "lodash/")
|
|
15
|
-
.replace("/index.js", ".js");
|
|
16
|
-
|
|
17
|
-
ids.push(uniqueLodashPath);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return ids;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function prepare(data) {
|
|
24
|
-
// data.modules = data.modules.slice(875, 880); TODO for debugging a formtree chart
|
|
25
|
-
let moduleMap = new Map();
|
|
26
|
-
let duplicatesMap = new Map();
|
|
27
|
-
let allLodashModules = new Set();
|
|
28
|
-
|
|
29
|
-
data.packages.forEach((pkg) => {
|
|
30
|
-
pkg.path = pkg.absolutePath.replace(data.rootFolder + "/", "");
|
|
31
|
-
});
|
|
32
|
-
data.modules.forEach((m) => {
|
|
33
|
-
// 0. Data transformation
|
|
34
|
-
m.absolutePath = m.path;
|
|
35
|
-
if (m.absolutePath === data.entryPoint) {
|
|
36
|
-
m.isEntry = true;
|
|
37
|
-
}
|
|
38
|
-
m.path = m.path.replace(data.rootFolder + "/", "");
|
|
39
|
-
m.dependencies.forEach((d) => {
|
|
40
|
-
d.path = d.absolutePath.replace(data.rootFolder + "/", "");
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
// 1. Duplicates
|
|
44
|
-
m._tmp_ids = getDuplicateId(m.path);
|
|
45
|
-
m.duplicates = [];
|
|
46
|
-
m._tmp_ids.forEach((id) => {
|
|
47
|
-
if (!duplicatesMap.has(id)) {
|
|
48
|
-
duplicatesMap.set(id, []);
|
|
49
|
-
}
|
|
50
|
-
duplicatesMap.get(id).push(m);
|
|
51
|
-
});
|
|
52
|
-
// lodash/*
|
|
53
|
-
// lodash-es/*
|
|
54
|
-
// lodash.*
|
|
55
|
-
if (m.path.includes("node_modules/lodash")) {
|
|
56
|
-
allLodashModules.add(m);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// 2. Dependencies
|
|
60
|
-
m.dependents = [];
|
|
61
|
-
moduleMap.set(m.absolutePath, m);
|
|
62
|
-
|
|
63
|
-
// 3. Other
|
|
64
|
-
// 3.1 Format prelude
|
|
65
|
-
if (m.path === "__prelude__") {
|
|
66
|
-
m.source.code = m.source.code
|
|
67
|
-
.replaceAll(";", ";\n\n")
|
|
68
|
-
.replaceAll(",", ",\n ");
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
data.modules.forEach((m) => {
|
|
73
|
-
// 1. Duplicates
|
|
74
|
-
m._tmp_ids.forEach((id) => {
|
|
75
|
-
const duplicates = duplicatesMap.get(id);
|
|
76
|
-
if (duplicates.length > 1) {
|
|
77
|
-
m.duplicates.push(...duplicates.filter((d) => d !== m));
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
// lodash/index.js is a special case (as index.js includes all lodash functions)
|
|
82
|
-
if (m.path.endsWith("node_modules/lodash/index.js")) {
|
|
83
|
-
m.duplicates.push(...allLodashModules);
|
|
84
|
-
}
|
|
85
|
-
delete m._tmp_ids;
|
|
86
|
-
|
|
87
|
-
// 2. Dependencies
|
|
88
|
-
m.dependencies.forEach((dependency) => {
|
|
89
|
-
const dependentModule = moduleMap.get(dependency.absolutePath);
|
|
90
|
-
if (dependentModule) {
|
|
91
|
-
dependentModule.dependents.push(m); //add to the dependent module directly
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
allLodashModules = null;
|
|
97
|
-
moduleMap = null;
|
|
98
|
-
duplicatesMap = null;
|
|
99
|
-
return data;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
module.exports = prepare;
|
package/queryHelpers.js
DELETED
|
@@ -1,354 +0,0 @@
|
|
|
1
|
-
const helpers = {
|
|
2
|
-
prettifyMap: new Map(),
|
|
3
|
-
prettifyJS(sourceStr) {
|
|
4
|
-
if (helpers.prettifyMap.has(sourceStr)) {
|
|
5
|
-
return helpers.prettifyMap.get(sourceStr);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const prettier = require("prettier/standalone");
|
|
9
|
-
const prettierPluginBabel = require("prettier/plugins/babel");
|
|
10
|
-
const prettierPluginEstree = require("prettier/plugins/estree");
|
|
11
|
-
|
|
12
|
-
return prettier
|
|
13
|
-
.format(sourceStr, {
|
|
14
|
-
parser: "babel",
|
|
15
|
-
plugins: [prettierPluginBabel, prettierPluginEstree],
|
|
16
|
-
})
|
|
17
|
-
.then((formatted) => {
|
|
18
|
-
helpers.prettifyMap.set(sourceStr, formatted);
|
|
19
|
-
return formatted;
|
|
20
|
-
});
|
|
21
|
-
},
|
|
22
|
-
askChatGPTAboutPackages() {
|
|
23
|
-
const prompt = `I have a list of JavaScript packages from my React Native bundle (see below). I want to optimize bundle size by identifying similar or redundant packages — such as multiple versions of similar libraries (e.g., lodash, lodash-es, underscore, etc.), duplicate utilities, or overlapping functionality (e.g., date libraries like moment, dayjs, date-fns).
|
|
24
|
-
|
|
25
|
-
Please do the following:
|
|
26
|
-
|
|
27
|
-
1. Group similar or overlapping packages together.
|
|
28
|
-
2. For each group, suggest which one to keep and which ones to consider removing.
|
|
29
|
-
3. For each group, provide a regex string that can be used to filter those packages from the list (e.g., in grep, find, or search tools).
|
|
30
|
-
4. Keep the output concise and copy-paste friendly.`;
|
|
31
|
-
return `https://chat.openai.com/?prompt=${encodeURIComponent(prompt)}`;
|
|
32
|
-
},
|
|
33
|
-
plural(count, [singular, plural]) {
|
|
34
|
-
return count === 1 ? singular : plural;
|
|
35
|
-
},
|
|
36
|
-
pluralWithCount(count, [singular, plural]) {
|
|
37
|
-
return `${count} ${helpers.plural(count, [singular, plural])}`;
|
|
38
|
-
},
|
|
39
|
-
pluralBadge(count, [singular, plural], prefix = "") {
|
|
40
|
-
return {
|
|
41
|
-
text: prefix + count,
|
|
42
|
-
postfix: helpers.plural(count, [singular, plural]),
|
|
43
|
-
};
|
|
44
|
-
},
|
|
45
|
-
getModulesName(path) {
|
|
46
|
-
const modules = path.split("node_modules/");
|
|
47
|
-
const lastModule = modules[modules.length - 1];
|
|
48
|
-
const [folder, subFolder] = lastModule.split("/");
|
|
49
|
-
if (folder.startsWith("@")) {
|
|
50
|
-
return `${folder}/${subFolder}`;
|
|
51
|
-
}
|
|
52
|
-
return folder;
|
|
53
|
-
},
|
|
54
|
-
getBestNetworkGraphSize(module, params) {
|
|
55
|
-
let maxParentDepth = 0;
|
|
56
|
-
let itemsCount = 0;
|
|
57
|
-
do {
|
|
58
|
-
maxParentDepth++;
|
|
59
|
-
itemsCount = helpers.getNetworkGraph(module, {
|
|
60
|
-
...params,
|
|
61
|
-
maxParentDepth,
|
|
62
|
-
}).data.length;
|
|
63
|
-
if (itemsCount < 10) {
|
|
64
|
-
const limit = itemsCount - 1;
|
|
65
|
-
return limit > 2 ? limit : 2;
|
|
66
|
-
}
|
|
67
|
-
} while (maxParentDepth < 6);
|
|
68
|
-
return maxParentDepth;
|
|
69
|
-
},
|
|
70
|
-
getNetworkGraph(
|
|
71
|
-
module,
|
|
72
|
-
{ maxParentDepth = 2, omitVisitedModules = true } = {},
|
|
73
|
-
) {
|
|
74
|
-
const queue = [{ module, parentId: "", level: 0 }];
|
|
75
|
-
const visited = new Set();
|
|
76
|
-
const result = [];
|
|
77
|
-
let entryPointPath = null;
|
|
78
|
-
const data = [];
|
|
79
|
-
|
|
80
|
-
while (queue.length > 0) {
|
|
81
|
-
const { module: currentModule, parentId, level } = queue.shift();
|
|
82
|
-
|
|
83
|
-
if (level >= Number(maxParentDepth)) {
|
|
84
|
-
break;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const id = currentModule.path;
|
|
88
|
-
|
|
89
|
-
if (omitVisitedModules) {
|
|
90
|
-
if (visited.has(id)) {
|
|
91
|
-
continue;
|
|
92
|
-
}
|
|
93
|
-
visited.add(id);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
if (parentId) {
|
|
97
|
-
const isEntryPoint = currentModule.dependents.length === 0;
|
|
98
|
-
result.push({ isEntryPoint, id, parentId });
|
|
99
|
-
data.push([parentId, id]);
|
|
100
|
-
if (isEntryPoint) {
|
|
101
|
-
entryPointPath = id;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
if (Array.isArray(currentModule.dependents)) {
|
|
106
|
-
for (const dependentModule of currentModule.dependents) {
|
|
107
|
-
queue.push({
|
|
108
|
-
module: dependentModule,
|
|
109
|
-
parentId: id,
|
|
110
|
-
level: level + 1,
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
if (!entryPointPath) {
|
|
117
|
-
for (const item of result) {
|
|
118
|
-
if (item.isEntryPoint) {
|
|
119
|
-
entryPointPath = item.id;
|
|
120
|
-
break;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return { entryPointPath, data };
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
getExtColor(extName) {
|
|
129
|
-
const colors = {
|
|
130
|
-
js: "#f1e05a50",
|
|
131
|
-
ts: "#2b748950",
|
|
132
|
-
tsx: "#2b748950",
|
|
133
|
-
json: "#e34c2650",
|
|
134
|
-
svg: "#e69f0d50",
|
|
135
|
-
css: "#563d7c50",
|
|
136
|
-
png: "#e44b2350",
|
|
137
|
-
};
|
|
138
|
-
return colors[extName] ?? colors["js"];
|
|
139
|
-
},
|
|
140
|
-
getFileExtension(filename) {
|
|
141
|
-
const idx = filename.lastIndexOf(".");
|
|
142
|
-
return idx === -1 ? "js" : filename.slice(idx + 1);
|
|
143
|
-
},
|
|
144
|
-
toFixed(value, fractionDigits = 2) {
|
|
145
|
-
return Number(value).toFixed(fractionDigits);
|
|
146
|
-
},
|
|
147
|
-
percent(value, fractionDigits = 2) {
|
|
148
|
-
return (100 * value).toFixed(fractionDigits) + "%";
|
|
149
|
-
},
|
|
150
|
-
formatBytes(bytes, decimals) {
|
|
151
|
-
if (bytes == 0) return "0 Bytes";
|
|
152
|
-
const k = 1024,
|
|
153
|
-
dm = decimals || 2,
|
|
154
|
-
sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"],
|
|
155
|
-
i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
156
|
-
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
|
|
157
|
-
},
|
|
158
|
-
isPackageImport(moduleName) {
|
|
159
|
-
return moduleName?.[0] !== ".";
|
|
160
|
-
},
|
|
161
|
-
// isRuntimeCode(moduleName) {
|
|
162
|
-
// return (
|
|
163
|
-
// moduleName === "__prelude__" ||
|
|
164
|
-
// moduleName.includes("@babel/runtime") ||
|
|
165
|
-
// moduleName.includes("metro-runtime") ||
|
|
166
|
-
// moduleName.includes("@react-native/js-polyfills")
|
|
167
|
-
// );
|
|
168
|
-
// },
|
|
169
|
-
transformFilesList(files, rootFolder, type) {
|
|
170
|
-
const nodeModulesMap = { children: {}, size: 0 };
|
|
171
|
-
const sourceCodeMap = { children: {}, size: 0 };
|
|
172
|
-
|
|
173
|
-
files.forEach(({ path, size }) => {
|
|
174
|
-
if (path === "__prelude__") {
|
|
175
|
-
path = "node_modules/__prelude__";
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
const shortPath = path.replace(rootFolder + "/", "");
|
|
179
|
-
const isNodeModule = shortPath.includes("node_modules/");
|
|
180
|
-
const parts = shortenPath(shortPath, nodeModulesMap).split("/");
|
|
181
|
-
let current = (isNodeModule ? nodeModulesMap : sourceCodeMap).children;
|
|
182
|
-
|
|
183
|
-
parts.forEach((part, index) => {
|
|
184
|
-
// console.log((" --- xdebug " + index + " ".repeat(50)).substr(0, 40), {
|
|
185
|
-
// part,
|
|
186
|
-
// parts,
|
|
187
|
-
// });
|
|
188
|
-
if (!current[part]) {
|
|
189
|
-
current[part] = { size: 0, children: {} };
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
if (index === parts.length - 1) {
|
|
193
|
-
current[part].size = size;
|
|
194
|
-
current[part].path = shortPath;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
current = current[part].children;
|
|
198
|
-
});
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
if (type === "foamtree") {
|
|
202
|
-
sumSizes(nodeModulesMap);
|
|
203
|
-
sumSizes(sourceCodeMap);
|
|
204
|
-
|
|
205
|
-
const sourceCodeGroup = toGroups(sourceCodeMap, "Source Code");
|
|
206
|
-
const nodeModulesGroup = nodeModulesMap?.children?.node_modules
|
|
207
|
-
? toGroups(nodeModulesMap.children.node_modules, "node_modules")
|
|
208
|
-
: {};
|
|
209
|
-
|
|
210
|
-
if (!sourceCodeGroup.groups) {
|
|
211
|
-
return nodeModulesGroup;
|
|
212
|
-
}
|
|
213
|
-
if (!nodeModulesGroup.groups) {
|
|
214
|
-
return nodeModulesGroup;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
const topLevelNode = { groups: [sourceCodeGroup, nodeModulesGroup] };
|
|
218
|
-
topLevelNode.weight = topLevelNode.groups.reduce(
|
|
219
|
-
(acc, group) => acc + group.weight,
|
|
220
|
-
0,
|
|
221
|
-
);
|
|
222
|
-
|
|
223
|
-
return topLevelNode;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
if (type === "highcharts-treemap") {
|
|
227
|
-
const ROOT_ID_1 = "~";
|
|
228
|
-
const ROOT_ID_2 = ".";
|
|
229
|
-
return [
|
|
230
|
-
{ id: ROOT_ID_1, name: "node_modules" },
|
|
231
|
-
{ id: ROOT_ID_2, name: "Source Code" },
|
|
232
|
-
]
|
|
233
|
-
.concat(flattenTree(nodeModulesMap.children.node_modules, ROOT_ID_1))
|
|
234
|
-
.concat(flattenTree(sourceCodeMap, ROOT_ID_2));
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
throw new Error("Unsupported type: " + type);
|
|
238
|
-
},
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
function flattenTree(
|
|
242
|
-
node,
|
|
243
|
-
parentId,
|
|
244
|
-
prevWasSkipped = false,
|
|
245
|
-
lvl = 0,
|
|
246
|
-
result = [],
|
|
247
|
-
overrideParentId,
|
|
248
|
-
) {
|
|
249
|
-
const nodeChildrenCount = Object.keys(node.children);
|
|
250
|
-
|
|
251
|
-
for (const key of nodeChildrenCount) {
|
|
252
|
-
const childNode = node.children[key];
|
|
253
|
-
const childId = parentId + "/" + key;
|
|
254
|
-
const childrenCount = Object.keys(childNode.children).length;
|
|
255
|
-
const hasChildren = childrenCount > 0;
|
|
256
|
-
const item = {
|
|
257
|
-
id: childId,
|
|
258
|
-
name: prevWasSkipped ? parentId : key,
|
|
259
|
-
parent: overrideParentId ?? parentId,
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
if (!hasChildren) {
|
|
263
|
-
item.value = childNode.size;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
if (lvl === 0) {
|
|
267
|
-
item.color = Highcharts.getOptions().colors[randomInt(0, 9)];
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
const skipThisNode = nodeChildrenCount.length === 1 && childrenCount === 1;
|
|
271
|
-
|
|
272
|
-
if (!skipThisNode) {
|
|
273
|
-
result.push(item);
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
flattenTree(
|
|
277
|
-
childNode,
|
|
278
|
-
childId,
|
|
279
|
-
skipThisNode,
|
|
280
|
-
lvl + 1,
|
|
281
|
-
result,
|
|
282
|
-
skipThisNode ? (overrideParentId ?? parentId) : undefined,
|
|
283
|
-
);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
return result;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
function sumSizes(node) {
|
|
290
|
-
const isFile = Object.keys(node.children).length === 0;
|
|
291
|
-
let totalFiles = isFile ? 1 : 0;
|
|
292
|
-
let totalSize = node.size || 0;
|
|
293
|
-
for (const key in node.children) {
|
|
294
|
-
const result = sumSizes(node.children[key]);
|
|
295
|
-
totalSize += result.totalSize;
|
|
296
|
-
totalFiles += result.totalFiles;
|
|
297
|
-
}
|
|
298
|
-
node.type = isFile ? "file" : "folder";
|
|
299
|
-
node.size = totalSize;
|
|
300
|
-
node.files = totalFiles;
|
|
301
|
-
return { totalSize, totalFiles };
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
function toGroups(node, label) {
|
|
305
|
-
const keys = Object.keys(node.children);
|
|
306
|
-
|
|
307
|
-
const common = {
|
|
308
|
-
label,
|
|
309
|
-
weight: node.size,
|
|
310
|
-
files: node.files,
|
|
311
|
-
type: node.type,
|
|
312
|
-
size: helpers.formatBytes(node.size),
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
if (keys.length === 0) {
|
|
316
|
-
// File
|
|
317
|
-
return common;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
// Folder
|
|
321
|
-
return Object.assign(common, {
|
|
322
|
-
groups: keys.map((key) => toGroups(node.children[key], key)),
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
function randomInt(min, max) {
|
|
327
|
-
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
const nm = "node_modules/";
|
|
331
|
-
function shortenPath(path, nodeModulesMap) {
|
|
332
|
-
let index = path.lastIndexOf(nm);
|
|
333
|
-
|
|
334
|
-
if (index > 0) {
|
|
335
|
-
const pathWithoutNestedNM = path.slice(index);
|
|
336
|
-
// Find the package name after "node_modules/"
|
|
337
|
-
const firstSlash = pathWithoutNestedNM.indexOf("/");
|
|
338
|
-
const secondSlash = pathWithoutNestedNM.indexOf("/", firstSlash + 1);
|
|
339
|
-
const pkgName =
|
|
340
|
-
secondSlash === -1
|
|
341
|
-
? pathWithoutNestedNM.slice(firstSlash + 1)
|
|
342
|
-
: pathWithoutNestedNM.slice(firstSlash + 1, secondSlash);
|
|
343
|
-
|
|
344
|
-
if (nodeModulesMap?.children?.node_modules?.children?.[pkgName]) {
|
|
345
|
-
const parentPackage = helpers.getModulesName(path.slice(0, index));
|
|
346
|
-
return nm + parentPackage + " ~ " + pathWithoutNestedNM.slice(nm.length);
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
return pathWithoutNestedNM;
|
|
350
|
-
}
|
|
351
|
-
return path;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
module.exports = helpers;
|
package/setup.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const prepare = require("./prepare");
|
|
2
|
-
const queryHelpers = require("./queryHelpers");
|
|
3
|
-
|
|
4
|
-
module.exports = function setup({
|
|
5
|
-
defineObjectMarker,
|
|
6
|
-
addQueryHelpers,
|
|
7
|
-
setPrepare,
|
|
8
|
-
}) {
|
|
9
|
-
// extend queries with custom methods
|
|
10
|
-
addQueryHelpers(queryHelpers);
|
|
11
|
-
setPrepare(prepare);
|
|
12
|
-
};
|