react-native-bundle-discovery 1.3.1 → 2.0.0-rc.1

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 CHANGED
@@ -30,7 +30,7 @@ There are two ways to install the package:
30
30
  #### 1. Install (independent tool)
31
31
 
32
32
  ```bash
33
- yarn add -D react-native-bundle-discovery
33
+ yarn add -D react-native-bundle-discovery react-native-bundle-discovery-ui
34
34
  ```
35
35
 
36
36
  Add to your `metro.config.js`:
@@ -117,7 +117,7 @@ npx react-native bundle \
117
117
  Run webserver to view the report:
118
118
 
119
119
  ```bash
120
- npx react-native-bundle-discovery server metro-stats.json [--port <port>]
120
+ npx react-native-bundle-discovery-ui server metro-stats.json [--port <port>]
121
121
  ```
122
122
 
123
123
  ##### 4.2 Build the HTML report
@@ -125,7 +125,7 @@ npx react-native-bundle-discovery server metro-stats.json [--port <port>]
125
125
  Run the following command to generate an HTML report from the JSON file:
126
126
 
127
127
  ```bash
128
- npx react-native-bundle-discovery build metro-stats.json
128
+ npx react-native-bundle-discovery-ui build metro-stats.json
129
129
  ```
130
130
 
131
131
 
package/index.js CHANGED
@@ -1 +1,195 @@
1
- module.exports = require("./lib/customSerializer");
1
+ const { parse, resolve } = require("path");
2
+ const { writeFileSync, existsSync } = require("fs");
3
+ const { Buffer } = require("buffer");
4
+ const chalk = require("chalk");
5
+
6
+ const NAME = require("./package.json").name;
7
+
8
+ function getDefault(module) {
9
+ return module.__esModule ? module.default : module;
10
+ }
11
+
12
+ function getDefaultSerializer() {
13
+ const metroPath = parse(require.resolve("metro/package.json")).dir;
14
+ const bundleToString = getDefault(
15
+ require(`${metroPath}/src/lib/bundleToString.js`),
16
+ );
17
+ const baseJSBundle = getDefault(
18
+ require(`${metroPath}/src/DeltaBundler/Serializers/baseJSBundle.js`),
19
+ );
20
+
21
+ return function defaultSerializer(entryPoint, preModules, graph, options) {
22
+ let bundle = baseJSBundle(entryPoint, preModules, graph, options);
23
+
24
+ // Sentry support
25
+ // https://docs.sentry.io/platforms/react-native/manual-setup/metro/#wrap-your-custom-serializer
26
+ if (typeof options?.sentryBundleCallback === "function") {
27
+ bundle = options.sentryBundleCallback(bundle);
28
+ }
29
+
30
+ return bundleToString(bundle).code;
31
+ };
32
+ }
33
+
34
+ function getStringSizeInBytes(str) {
35
+ return Buffer.byteLength(str, "utf8");
36
+ }
37
+
38
+ /**
39
+ * `/Users/i/app/node_modules/metro/node_modules/@babel/runtime/helpers/createClass.js` -> `@babel/runtime`
40
+ * `/Users/i/app/node_modules/react/jsx-runtime.js` -> `react`
41
+ */
42
+ function getPackageNameFromPath(path) {
43
+ const parts = path.split("node_modules/");
44
+ const lastPart = parts[parts.length - 1];
45
+ if (lastPart.startsWith("@")) {
46
+ return lastPart.split("/").slice(0, 2).join("/");
47
+ }
48
+ return lastPart.split("/")[0];
49
+ }
50
+
51
+ /**
52
+ * `/Users/i/app/node_modules/metro/node_modules/@babel/runtime/helpers/createClass.js` -> `/Users/i/app/node_modules/metro/node_modules/@babel/runtime`
53
+ * `/Users/i/app/node_modules/react/jsx-runtime.js` -> `/Users/i/app/node_modules/react`
54
+ */
55
+ function getPackageAbsolutePath(path, pkgName) {
56
+ const parts = path.split("node_modules/");
57
+ parts[parts.length - 1] = pkgName;
58
+ return parts.join("node_modules/");
59
+ }
60
+
61
+ function toPackages(modules) {
62
+ const packages = new Map();
63
+ modules.forEach((module) => {
64
+ if (!module.path.includes("node_modules/")) {
65
+ return;
66
+ }
67
+
68
+ const pkgName = getPackageNameFromPath(module.path);
69
+ const absolutePkgPath = getPackageAbsolutePath(module.path, pkgName);
70
+
71
+ if (!packages.has(absolutePkgPath)) {
72
+ packages.set(absolutePkgPath, {
73
+ name: pkgName,
74
+ absolutePath: absolutePkgPath,
75
+ version: require(resolve(absolutePkgPath, "package.json")).version,
76
+ });
77
+ }
78
+ });
79
+
80
+ return Array.from(packages.values()).sort((a, b) =>
81
+ a.name.localeCompare(b.name),
82
+ );
83
+ }
84
+
85
+ function toModuleStruct(m, includeCode) {
86
+ const sourceCode = m.getSource().toString("utf8");
87
+ const outputCode = m.output[0].data.code;
88
+ return {
89
+ path: m.path,
90
+ source: {
91
+ code: includeCode ? sourceCode : "",
92
+ lineCount: sourceCode.split("\n").length,
93
+ sizeInBytes: getStringSizeInBytes(sourceCode),
94
+ },
95
+ output: {
96
+ code: includeCode ? outputCode : "",
97
+ lineCount: m.output[0].data.lineCount,
98
+ sizeInBytes: getStringSizeInBytes(outputCode),
99
+ },
100
+ dependencies: Array.from(m?.dependencies?.values?.() ?? [])
101
+ .filter((e) => e.absolutePath)
102
+ .map((e) => ({
103
+ absolutePath: e.absolutePath,
104
+ name: e.data.name,
105
+ })),
106
+ };
107
+ }
108
+
109
+ function createJsonReport({
110
+ graph,
111
+ entryPoint,
112
+ includeEnvs,
113
+ preModules,
114
+ includeCode,
115
+ outputJsonPath,
116
+ rootFolder,
117
+ silent,
118
+ }) {
119
+ const dependencies = Array.from(graph.dependencies.values());
120
+
121
+ const stats = {
122
+ date: Date.now(),
123
+ entryPoint,
124
+ transformOptions: graph.transformOptions,
125
+ envs: includeEnvs.reduce((acc, envName) => {
126
+ acc[envName] = process.env[envName];
127
+ return acc;
128
+ }, {}),
129
+ rootFolder,
130
+ packages: toPackages(preModules).concat(toPackages(dependencies)),
131
+ modules: preModules
132
+ .map((m) => toModuleStruct(m, includeCode))
133
+ .concat(dependencies.map((m) => toModuleStruct(m, includeCode))),
134
+ };
135
+
136
+ writeFileSync(outputJsonPath, JSON.stringify(stats));
137
+
138
+ if (!silent) {
139
+ console.log(
140
+ `${chalk.yellow(`[${NAME}]`)}: Saved stats to ${chalk.green(outputJsonPath)}`,
141
+ );
142
+ }
143
+ }
144
+
145
+ /**
146
+ * Creates a custom serializer function for Metro bundler, which generates a JSON report
147
+ * and optionally modifies the serialization process.
148
+ *
149
+ * @param {Object} options - Configuration options for the serializer.
150
+ * @param {Function} [options.serializer] - A custom serializer function. If not provided, a default serializer is used.
151
+ * @param {string} options.projectRoot - The root directory of the project. Must exist.
152
+ * @param {string} [options.outputJsonPath] - The path where the JSON report will be saved. Defaults to "metro-stats.json" in the project root.
153
+ * @param {boolean} [options.includeCode=true] - Whether to include the source and output code in the JSON report.
154
+ * @param {string[]} [options.includeEnvs=[]] - A list of environment variable names to include in the JSON report.
155
+ * @returns {Function} - A custom serializer function to be used by Metro.
156
+ * @throws {Error} - Throws an error if the project root does not exist.
157
+ */
158
+ function createSerializer({
159
+ serializer,
160
+ projectRoot,
161
+ outputJsonPath,
162
+ includeCode = true,
163
+ silent = false,
164
+ includeEnvs = [],
165
+ } = {}) {
166
+ const mySerializer = serializer || getDefaultSerializer();
167
+
168
+ if (!existsSync(projectRoot)) {
169
+ throw new Error(`[${NAME}]: Project root does not exist: ${projectRoot}`);
170
+ }
171
+
172
+ const myOutputJsonPath =
173
+ outputJsonPath ?? resolve(projectRoot, "metro-stats.json");
174
+
175
+ function customSerializer(entryPoint, preModules, graph, options) {
176
+ const code = mySerializer(entryPoint, preModules, graph, options);
177
+
178
+ createJsonReport({
179
+ graph,
180
+ entryPoint,
181
+ includeEnvs,
182
+ preModules,
183
+ includeCode,
184
+ outputJsonPath: myOutputJsonPath,
185
+ rootFolder: projectRoot,
186
+ silent,
187
+ });
188
+
189
+ return code;
190
+ }
191
+
192
+ return customSerializer;
193
+ }
194
+
195
+ module.exports = { createSerializer };
package/package.json CHANGED
@@ -1,22 +1,15 @@
1
1
  {
2
2
  "name": "react-native-bundle-discovery",
3
- "version": "1.3.1",
3
+ "version": "2.0.0-rc.1",
4
4
  "main": "index.js",
5
- "bin": "lib/bin.js",
6
5
  "repository": "git@github.com:retyui/react-native-bundle-discovery.git",
7
6
  "author": "David <4661784+retyui@users.noreply.github.com>",
8
7
  "license": "MIT",
9
8
  "scripts": {
10
- "format": "prettier --write .",
11
- "start": "NODE_ENV=development npx discovery --config .discoveryrc.js",
12
- "build": "npx discovery-build --config .discoveryrc.js --output build --serve-only-assets --single-file"
9
+ "prepublishOnly": "cp ../README.md README.md"
13
10
  },
14
11
  "dependencies": {
15
- "@discoveryjs/cli": "2.14.7",
16
- "@discoveryjs/discovery": "1.0.0-beta.99",
17
- "chalk": "^4.1.2",
18
- "minimist": "^1.2.8",
19
- "prettier": "^3.8.1"
12
+ "chalk": "^4.1.2"
20
13
  },
21
14
  "peerDependencies": {
22
15
  "metro": "*"
@@ -27,15 +20,6 @@
27
20
  }
28
21
  },
29
22
  "files": [
30
- "vendors",
31
- "lib",
32
- "views",
33
- "pages",
34
- "index.js",
35
- "setup.js",
36
- "prepare.js",
37
- "queryHelpers.js",
38
- ".discoveryrc.js"
39
- ],
40
- "packageManager": "yarn@4.13.0"
23
+ "index.js"
24
+ ]
41
25
  }
package/.discoveryrc.js DELETED
@@ -1,22 +0,0 @@
1
- const path = require("path");
2
-
3
- module.exports = {
4
- name: "react-native-bundle-discovery",
5
- data: () => require("./tmp/metro-stats.json"),
6
- setup: path.resolve(__dirname, "setup.js"),
7
- view: {
8
- assets: [
9
- // Global styles
10
- path.resolve(__dirname, "views/global.css"),
11
- // Pages
12
- path.resolve(__dirname, "pages/default.js"),
13
- path.resolve(__dirname, "pages/module.js"),
14
- path.resolve(__dirname, "pages/package.js"),
15
- // Custom views
16
- path.resolve(__dirname, "views/highcharts.css"),
17
- path.resolve(__dirname, "views/prettify.js"),
18
- path.resolve(__dirname, "views/highcharts.js"),
19
- path.resolve(__dirname, "views/foamtree.js"),
20
- ],
21
- },
22
- };
package/lib/bin.js DELETED
@@ -1,87 +0,0 @@
1
- #!/usr/bin/env node
2
- const minimist = require("minimist");
3
-
4
- function printHelp() {
5
- console.log(`react-native-bundle-discovery
6
-
7
- Usage:
8
- react-native-bundle-discovery server <file> [port] [--verbose]
9
- react-native-bundle-discovery build <file> [--output <path>] [--clean] [--single-file] [--verbose]
10
-
11
- Commands:
12
- server <file> [port] Run a web server to show a Metro bundler stat report
13
- build <file> Build a HTML report from the Metro bundler stat file
14
-
15
- Options:
16
- -v, --verbose Run with verbose logging
17
- -o, --output <path> Path for a build result (default: .bundle-discovery)
18
- -c, --clean Clean output directory before writing build files (default: true)
19
- -s, --single-file Output report build as a single HTML file (default: true)
20
- -p, --port <port> Port for server command (same as [port], default: 8079)
21
- -h, --help Show help
22
- `);
23
- }
24
-
25
- function fail(message) {
26
- console.error(message);
27
- console.error("Use --help to see usage.");
28
- process.exit(1);
29
- }
30
-
31
- const argv = minimist(process.argv.slice(2), {
32
- alias: {
33
- v: "verbose",
34
- h: "help",
35
- o: "output",
36
- c: "clean",
37
- s: "single-file",
38
- p: "port",
39
- },
40
- boolean: ["verbose", "help", "clean", "single-file"],
41
- string: ["output"],
42
- default: {
43
- clean: true,
44
- "single-file": true,
45
- },
46
- });
47
-
48
- const command = argv._[0];
49
-
50
- if (argv.help || !command) {
51
- printHelp();
52
- process.exit(0);
53
- }
54
-
55
- if (command === "server") {
56
- const file = argv._[1];
57
- if (!file) {
58
- fail("Missing required argument: <file>");
59
- }
60
-
61
- const rawPort = argv.port ?? argv._[2] ?? 8079;
62
- const port = Number(rawPort);
63
- if (!Number.isFinite(port)) {
64
- fail(`Invalid port: ${rawPort}`);
65
- }
66
-
67
- const { serve } = require("./server.js");
68
- return serve(file, port, Boolean(argv.verbose));
69
- }
70
-
71
- if (command === "build") {
72
- const file = argv._[1];
73
- if (!file) {
74
- fail("Missing required argument: <file>");
75
- }
76
-
77
- const { buildHtmlPage } = require("./build.js");
78
- return buildHtmlPage(
79
- file,
80
- argv.output,
81
- argv.clean,
82
- argv["single-file"],
83
- Boolean(argv.verbose),
84
- );
85
- }
86
-
87
- fail(`Unknown command: ${command}`);
package/lib/build.js DELETED
@@ -1,115 +0,0 @@
1
- const fs = require("fs");
2
- const path = require("path");
3
- const chalk = require("chalk");
4
- const { build } = require("@discoveryjs/cli");
5
- const config = require("../.discoveryrc.js");
6
-
7
- function buildHtmlPage(filePath, output, clean, singleFile, verbose) {
8
- if (verbose) {
9
- console.info(
10
- `Building HTML page from file: ${chalk.green(filePath)} options: ${JSON.stringify(
11
- { output, clean, singleFile },
12
- null,
13
- 2,
14
- )}`,
15
- );
16
- }
17
-
18
- if (!filePath) {
19
- console.error(
20
- `Usage: '${chalk.green("npx react-native-bundle-discovery build <path-to-file>")}', Please provide a path to a JSON file.`,
21
- );
22
- process.exit(1);
23
- }
24
-
25
- const jsonFilePath = path.resolve(process.cwd(), filePath);
26
- if (verbose) {
27
- console.info(
28
- `Loading JSON file from: ${chalk.green(jsonFilePath)}, base directory: ${chalk.green(process.cwd())}`,
29
- );
30
- }
31
-
32
- let fullJsonPath;
33
-
34
- try {
35
- fullJsonPath = require.resolve(jsonFilePath);
36
- } catch (err) {
37
- console.error(`❌Error loading file: ${chalk.red(jsonFilePath)}\n\n`);
38
- console.error(err.message);
39
- process.exit(1);
40
- }
41
-
42
- const configFile = path.resolve(__dirname, "./.tmp.js");
43
-
44
- if (verbose) {
45
- console.info(
46
- `Creating temporary config file at: ${chalk.green(configFile)}, for discovery.js`,
47
- );
48
- }
49
- fs.writeFileSync(
50
- configFile,
51
- `module.exports = ${JSON.stringify(
52
- { ...config, data: "<tmp>" },
53
- null,
54
- 1,
55
- ).replace(`"<tmp>"`, `() => require("${fullJsonPath}")`)};`,
56
- );
57
-
58
- if (verbose) {
59
- console.info(`Building HTML page with options:`, {
60
- output,
61
- clean,
62
- singleFile,
63
- });
64
- }
65
-
66
- const _config = {
67
- name: "Bundle Discovery",
68
- mode: "single",
69
- // models: [ [Object] ],
70
- colorScheme: "auto",
71
- download: true,
72
- upload: false,
73
- embed: false,
74
- encodings: false,
75
- };
76
- const _options = {
77
- singleFile,
78
- clean,
79
- output,
80
- //
81
- cache: true,
82
- cachedir: path.resolve(__dirname, "./.discoveryjs-cache"),
83
- checkCacheTtl: false,
84
- minify: true,
85
- dataCompression: true,
86
- sourcemap: false,
87
- embed: "by-config",
88
- experimentalJsonxl: false,
89
- scriptFormat: "esm",
90
- scriptExternal: [],
91
- data: true,
92
- excludeModelOnDataFail: false,
93
- prettyData: false,
94
- modelDownload: false,
95
- modelDataUpload: true,
96
- modelResetCache: false,
97
- serveOnlyAssets: true,
98
- dev: true,
99
- config: configFile,
100
- configFile: configFile,
101
- };
102
- return build(_options, _config, configFile).then((result) => {
103
- console.log(`========================================`);
104
- console.log(
105
- `✅ HTML page built successfully at: ${chalk.green(
106
- path.resolve(output, "index.html").replace(process.cwd() + "/", ""),
107
- )}`,
108
- );
109
- console.log(`========================================`);
110
- });
111
- }
112
-
113
- module.exports = {
114
- buildHtmlPage,
115
- };
@@ -1,196 +0,0 @@
1
- const { parse } = require("path");
2
- const { writeFileSync, existsSync } = require("fs");
3
- const { resolve } = require("path");
4
- const { Buffer } = require("buffer");
5
- const chalk = require("chalk");
6
-
7
- const NAME = require("../package.json").name;
8
-
9
- function getDefault(module) {
10
- return module.__esModule ? module.default : module;
11
- }
12
-
13
- function getDefaultSerializer() {
14
- const metroPath = parse(require.resolve("metro/package.json")).dir;
15
- const bundleToString = getDefault(
16
- require(`${metroPath}/src/lib/bundleToString.js`),
17
- );
18
- const baseJSBundle = getDefault(
19
- require(`${metroPath}/src/DeltaBundler/Serializers/baseJSBundle.js`),
20
- );
21
-
22
- return function defaultSerializer(entryPoint, preModules, graph, options) {
23
- let bundle = baseJSBundle(entryPoint, preModules, graph, options);
24
-
25
- // Sentry support
26
- // https://docs.sentry.io/platforms/react-native/manual-setup/metro/#wrap-your-custom-serializer
27
- if (typeof options?.sentryBundleCallback === "function") {
28
- bundle = options.sentryBundleCallback(bundle);
29
- }
30
-
31
- return bundleToString(bundle).code;
32
- };
33
- }
34
-
35
- function getStringSizeInBytes(str) {
36
- return Buffer.byteLength(str, "utf8");
37
- }
38
-
39
- /**
40
- * `/Users/i/app/node_modules/metro/node_modules/@babel/runtime/helpers/createClass.js` -> `@babel/runtime`
41
- * `/Users/i/app/node_modules/react/jsx-runtime.js` -> `react`
42
- */
43
- function getPackageNameFromPath(path) {
44
- const parts = path.split("node_modules/");
45
- const lastPart = parts[parts.length - 1];
46
- if (lastPart.startsWith("@")) {
47
- return lastPart.split("/").slice(0, 2).join("/");
48
- }
49
- return lastPart.split("/")[0];
50
- }
51
-
52
- /**
53
- * `/Users/i/app/node_modules/metro/node_modules/@babel/runtime/helpers/createClass.js` -> `/Users/i/app/node_modules/metro/node_modules/@babel/runtime`
54
- * `/Users/i/app/node_modules/react/jsx-runtime.js` -> `/Users/i/app/node_modules/react`
55
- */
56
- function getPackageAbsolutePath(path, pkgName) {
57
- const parts = path.split("node_modules/");
58
- parts[parts.length - 1] = pkgName;
59
- return parts.join("node_modules/");
60
- }
61
-
62
- function toPackages(modules) {
63
- const packages = new Map();
64
- modules.forEach((module) => {
65
- if (!module.path.includes("node_modules/")) {
66
- return;
67
- }
68
-
69
- const pkgName = getPackageNameFromPath(module.path);
70
- const absolutePkgPath = getPackageAbsolutePath(module.path, pkgName);
71
-
72
- if (!packages.has(absolutePkgPath)) {
73
- packages.set(absolutePkgPath, {
74
- name: pkgName,
75
- absolutePath: absolutePkgPath,
76
- version: require(resolve(absolutePkgPath, "package.json")).version,
77
- });
78
- }
79
- });
80
-
81
- return Array.from(packages.values()).sort((a, b) =>
82
- a.name.localeCompare(b.name),
83
- );
84
- }
85
-
86
- function toModuleStruct(m, includeCode) {
87
- const sourceCode = m.getSource().toString("utf8");
88
- const outputCode = m.output[0].data.code;
89
- return {
90
- path: m.path,
91
- source: {
92
- code: includeCode ? sourceCode : "",
93
- lineCount: sourceCode.split("\n").length,
94
- sizeInBytes: getStringSizeInBytes(sourceCode),
95
- },
96
- output: {
97
- code: includeCode ? outputCode : "",
98
- lineCount: m.output[0].data.lineCount,
99
- sizeInBytes: getStringSizeInBytes(outputCode),
100
- },
101
- dependencies: Array.from(m?.dependencies?.values?.() ?? [])
102
- .filter((e) => e.absolutePath)
103
- .map((e) => ({
104
- absolutePath: e.absolutePath,
105
- name: e.data.name,
106
- })),
107
- };
108
- }
109
-
110
- function createJsonReport({
111
- graph,
112
- entryPoint,
113
- includeEnvs,
114
- preModules,
115
- includeCode,
116
- outputJsonPath,
117
- rootFolder,
118
- silent,
119
- }) {
120
- const dependencies = Array.from(graph.dependencies.values());
121
-
122
- const stats = {
123
- date: Date.now(),
124
- entryPoint,
125
- transformOptions: graph.transformOptions,
126
- envs: includeEnvs.reduce((acc, envName) => {
127
- acc[envName] = process.env[envName];
128
- return acc;
129
- }, {}),
130
- rootFolder,
131
- packages: toPackages(preModules).concat(toPackages(dependencies)),
132
- modules: preModules
133
- .map((m) => toModuleStruct(m, includeCode))
134
- .concat(dependencies.map((m) => toModuleStruct(m, includeCode))),
135
- };
136
-
137
- writeFileSync(outputJsonPath, JSON.stringify(stats));
138
-
139
- if (!silent) {
140
- console.log(
141
- `${chalk.yellow(`[${NAME}]`)}: Saved stats to ${chalk.green(outputJsonPath)}`,
142
- );
143
- }
144
- }
145
-
146
- /**
147
- * Creates a custom serializer function for Metro bundler, which generates a JSON report
148
- * and optionally modifies the serialization process.
149
- *
150
- * @param {Object} options - Configuration options for the serializer.
151
- * @param {Function} [options.serializer] - A custom serializer function. If not provided, a default serializer is used.
152
- * @param {string} options.projectRoot - The root directory of the project. Must exist.
153
- * @param {string} [options.outputJsonPath] - The path where the JSON report will be saved. Defaults to "metro-stats.json" in the project root.
154
- * @param {boolean} [options.includeCode=true] - Whether to include the source and output code in the JSON report.
155
- * @param {string[]} [options.includeEnvs=[]] - A list of environment variable names to include in the JSON report.
156
- * @returns {Function} - A custom serializer function to be used by Metro.
157
- * @throws {Error} - Throws an error if the project root does not exist.
158
- */
159
- function createSerializer({
160
- serializer,
161
- projectRoot,
162
- outputJsonPath,
163
- includeCode = true,
164
- silent = false,
165
- includeEnvs = [],
166
- } = {}) {
167
- const mySerializer = serializer || getDefaultSerializer();
168
-
169
- if (!existsSync(projectRoot)) {
170
- throw new Error(`[${NAME}]: Project root does not exist: ${projectRoot}`);
171
- }
172
-
173
- const myOutputJsonPath =
174
- outputJsonPath ?? resolve(projectRoot, "metro-stats.json");
175
-
176
- function customSerializer(entryPoint, preModules, graph, options) {
177
- const code = mySerializer(entryPoint, preModules, graph, options);
178
-
179
- createJsonReport({
180
- graph,
181
- entryPoint,
182
- includeEnvs,
183
- preModules,
184
- includeCode,
185
- outputJsonPath: myOutputJsonPath,
186
- rootFolder: projectRoot,
187
- silent,
188
- });
189
-
190
- return code;
191
- }
192
-
193
- return customSerializer;
194
- }
195
-
196
- module.exports = { createSerializer };