@bigbinary/neeto-commons-frontend 4.13.79 → 4.13.81
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/configs/esbuild/utils.js
CHANGED
|
@@ -3,6 +3,7 @@ const path = require("path");
|
|
|
3
3
|
const fs = require("fs");
|
|
4
4
|
const { execSync, spawn } = require("child_process");
|
|
5
5
|
const { pick } = require("ramda");
|
|
6
|
+
const { DEFAULT_VISUALIZER_TEMPLATE } = require("./constants");
|
|
6
7
|
|
|
7
8
|
// colors for console output
|
|
8
9
|
const consoleColors = {
|
|
@@ -28,7 +29,7 @@ const writeMetafile = (metafile, outdir) => {
|
|
|
28
29
|
return metaFilePath;
|
|
29
30
|
};
|
|
30
31
|
|
|
31
|
-
const generateBundleReport = async (metaFilePath, outdir) => {
|
|
32
|
+
const generateBundleReport = async ({ metaFilePath, outdir, template }) => {
|
|
32
33
|
try {
|
|
33
34
|
console.info(
|
|
34
35
|
`${consoleColors.info}[bundle-analyzer]${consoleColors.reset} Generating bundle report...`
|
|
@@ -36,7 +37,7 @@ const generateBundleReport = async (metaFilePath, outdir) => {
|
|
|
36
37
|
|
|
37
38
|
const htmlFilePath = path.join(outdir, "bundle-report.html");
|
|
38
39
|
execSync(
|
|
39
|
-
`npx esbuild-visualizer --metadata ${metaFilePath} --filename ${htmlFilePath}`,
|
|
40
|
+
`npx esbuild-visualizer --metadata ${metaFilePath} --filename ${htmlFilePath} --template ${template}`,
|
|
40
41
|
{ stdio: "inherit" }
|
|
41
42
|
);
|
|
42
43
|
|
|
@@ -69,6 +70,10 @@ const build = async config => {
|
|
|
69
70
|
? process.argv[process.argv.indexOf("--entrypoint") + 1]
|
|
70
71
|
: null;
|
|
71
72
|
|
|
73
|
+
const template = process.argv.includes("--template")
|
|
74
|
+
? process.argv[process.argv.indexOf("--template") + 1]
|
|
75
|
+
: DEFAULT_VISUALIZER_TEMPLATE;
|
|
76
|
+
|
|
72
77
|
const buildConfig = entrypoint
|
|
73
78
|
? { ...config, entryPoints: pick([entrypoint], config.entryPoints) }
|
|
74
79
|
: config;
|
|
@@ -77,7 +82,11 @@ const build = async config => {
|
|
|
77
82
|
|
|
78
83
|
if (result.metafile) {
|
|
79
84
|
const metaFilePath = writeMetafile(result.metafile, buildConfig.outdir);
|
|
80
|
-
await generateBundleReport(
|
|
85
|
+
await generateBundleReport({
|
|
86
|
+
metaFilePath,
|
|
87
|
+
outdir: buildConfig.outdir,
|
|
88
|
+
template,
|
|
89
|
+
});
|
|
81
90
|
}
|
|
82
91
|
|
|
83
92
|
console.info(
|
package/configs/eslint/index.mjs
CHANGED
|
@@ -222,8 +222,6 @@ export default defineConfig([
|
|
|
222
222
|
"sonarjs/no-identical-conditions": "error",
|
|
223
223
|
// not-auto-fixable: This rule prevents using a function with no return as output, passing it to another function, or assigning its result to a variable.
|
|
224
224
|
"sonarjs/no-use-of-empty-return-value": "error",
|
|
225
|
-
// not-auto-fixable: This rule prevents using loops with at most one iteration.
|
|
226
|
-
"sonarjs/no-one-iteration-loop": "error",
|
|
227
225
|
// not-auto-fixable: This rule prevents using catch clause that only throws an error.
|
|
228
226
|
"sonarjs/no-useless-catch": "error",
|
|
229
227
|
// not-auto-fixable: This rule warns against "eval(variable)" which can allow an attacker to run arbitrary code inside your process.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-commons-frontend",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.81",
|
|
4
4
|
"description": "A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.",
|
|
5
5
|
"repository": "git@github.com:bigbinary/neeto-commons-frontend.git",
|
|
6
6
|
"author": "Amaljith K <amaljith.k@bigbinary.com>",
|