@bymaksym/loadline 1.0.0 → 1.1.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 +211 -43
- package/dist/cli/cli/args.js +79 -128
- package/dist/cli/cli/gates.js +80 -14
- package/dist/cli/cli/main.js +164 -33
- package/dist/cli/cli/memory.js +40 -4
- package/dist/cli/cli/{declared.js → read/declared.js} +1 -1
- package/dist/cli/cli/read/locate.js +214 -0
- package/dist/cli/cli/{read-build.js → read/read-build.js} +149 -84
- package/dist/cli/cli/read/read-config.js +120 -0
- package/dist/cli/cli/{html-report.js → render/html-report.js} +14 -10
- package/dist/cli/cli/render/render-agent.js +114 -0
- package/dist/cli/cli/render/render-asked.js +104 -0
- package/dist/cli/cli/render/render-badge.js +140 -0
- package/dist/cli/cli/{render-json.js → render/render-json.js} +18 -5
- package/dist/cli/cli/{render-markdown.js → render/render-markdown.js} +5 -5
- package/dist/cli/cli/{render-pr.js → render/render-pr.js} +33 -13
- package/dist/cli/cli/{render-sarif.js → render/render-sarif.js} +8 -3
- package/dist/cli/cli/{render-text.js → render/render-text.js} +118 -111
- package/dist/cli/cli/render/terminal.js +55 -0
- package/dist/cli/cli/report.js +68 -27
- package/dist/cli/cli/self-check.js +19 -23
- package/dist/cli/cli/since-last.js +2 -2
- package/dist/cli/cli/text/text-errors.js +124 -0
- package/dist/cli/cli/text/text.js +343 -0
- package/dist/cli/cli/text/usage.js +240 -0
- package/dist/cli/src/app/core/analysis/analysis.js +63 -23
- package/dist/cli/src/app/core/analysis/{barrels.js → graph/barrels.js} +1 -1
- package/dist/cli/src/app/core/analysis/{blast.js → graph/blast.js} +56 -17
- package/dist/cli/src/app/core/analysis/{cycles.js → graph/cycles.js} +1 -1
- package/dist/cli/src/app/core/analysis/{importers.js → graph/importers.js} +1 -1
- package/dist/cli/src/app/core/analysis/{insights.js → graph/insights.js} +10 -4
- package/dist/cli/src/app/core/analysis/invariant.js +1 -1
- package/dist/cli/src/app/core/analysis/metafile.types.js +7 -1
- package/dist/cli/src/app/core/analysis/{delivery.js → screens/delivery.js} +1 -1
- package/dist/cli/src/app/core/analysis/{entries.js → screens/entries.js} +50 -9
- package/dist/cli/src/app/core/analysis/screens/marks.js +32 -0
- package/dist/cli/src/app/core/analysis/screens/route-files.js +116 -0
- package/dist/cli/src/app/core/analysis/{sourcemap.js → sourcemap/sourcemap.js} +106 -7
- package/dist/cli/src/app/core/analysis/{split-drift.js → sourcemap/split-drift.js} +1 -1
- package/dist/cli/src/app/core/analysis/tool.js +83 -0
- package/dist/cli/src/app/core/assets/assets.js +134 -15
- package/dist/cli/src/app/core/baseline/baseline.js +0 -0
- package/dist/cli/src/app/core/{intake → build-text}/index-html.js +168 -13
- package/dist/cli/src/app/core/build-text/route-table.js +178 -0
- package/dist/cli/src/app/core/build-text/tool-marks.js +54 -0
- package/dist/cli/src/app/core/caching/caching.js +121 -43
- package/dist/cli/src/app/core/caching/from-analysis.js +20 -4
- package/dist/cli/src/app/core/config/config-text.js +90 -0
- package/dist/cli/src/app/core/config/config-values.js +358 -0
- package/dist/cli/src/app/core/config/loadline-config.js +81 -16
- package/dist/cli/src/app/core/config/merge-config.js +98 -0
- package/dist/cli/src/app/core/deps/deps.js +104 -16
- package/dist/cli/src/app/core/export/summary.js +29 -5
- package/dist/cli/src/app/core/findings/actions.js +3 -1
- package/dist/cli/src/app/core/findings/{boot-single.js → bundle/boot-single.js} +3 -3
- package/dist/cli/src/app/core/findings/{dupes.js → bundle/dupes.js} +8 -5
- package/dist/cli/src/app/core/findings/{graph.js → bundle/graph.js} +30 -18
- package/dist/cli/src/app/core/findings/{own-in-boot.js → bundle/own-in-boot.js} +9 -5
- package/dist/cli/src/app/core/findings/{requests.js → bundle/requests.js} +3 -3
- package/dist/cli/src/app/core/findings/{shipped.js → bundle/shipped.js} +28 -14
- package/dist/cli/src/app/core/findings/compose.js +6 -1
- package/dist/cli/src/app/core/findings/effort.js +2 -0
- package/dist/cli/src/app/core/findings/finding.types.js +1 -0
- package/dist/cli/src/app/core/findings/findings.js +48 -19
- package/dist/cli/src/app/core/findings/{assets.js → folder/assets.js} +38 -14
- package/dist/cli/src/app/core/findings/{caching.js → folder/caching.js} +16 -9
- package/dist/cli/src/app/core/findings/{page.js → folder/page.js} +6 -2
- package/dist/cli/src/app/core/findings/{scan.js → folder/scan.js} +25 -11
- package/dist/cli/src/app/core/findings/kind-names.js +163 -0
- package/dist/cli/src/app/core/findings/{deps.js → supplied/deps.js} +13 -8
- package/dist/cli/src/app/core/findings/supplied/forbidden.js +71 -0
- package/dist/cli/src/app/core/findings/{situation.js → supplied/situation.js} +2 -2
- package/dist/cli/src/app/core/findings/text/causes.js +39 -0
- package/dist/cli/src/app/core/findings/{finding-html.js → text/finding-html.js} +8 -1
- package/dist/cli/src/app/core/findings/{finding-text.js → text/finding-text.js} +208 -77
- package/dist/cli/src/app/core/findings/text/tool-advice.js +97 -0
- package/dist/cli/src/app/core/format/format.utils.js +158 -11
- package/dist/cli/src/app/core/format/ownership.js +93 -0
- package/dist/cli/src/app/core/i18n/en.js +76 -17
- package/dist/cli/src/app/core/i18n/es.js +82 -22
- package/dist/cli/src/app/core/intake/bundle-graph.js +281 -43
- package/dist/cli/src/app/core/intake/dist-files.js +82 -14
- package/dist/cli/src/app/core/intake/embedded.js +11 -1
- package/dist/cli/src/app/core/intake/unreached.js +139 -0
- package/dist/cli/src/app/core/intake/webpack-modules.js +185 -0
- package/dist/cli/src/app/core/intake/webpack-stats.js +298 -0
- package/dist/cli/src/app/core/project/project-context.js +16 -4
- package/dist/cli/src/app/core/project/project-name.js +36 -0
- package/dist/cli/src/app/core/scan/scan.js +58 -19
- package/dist/cli/src/app/core/scan/secrets.js +23 -3
- package/dist/cli/src/app/core/situation/situation-text.js +23 -0
- package/dist/cli/src/app/core/situation/situation.js +6 -4
- package/dist/cli/src/app/core/timing/timing.js +5 -2
- package/dist/cli/src/app/core/whatif/defer.js +29 -4
- package/dist/cli/src/app/core/whatif/source-importers.js +58 -0
- package/dist/cli/src/app/core/whatif/why.js +102 -0
- package/docs/CONFIG-REFERENCE.md +230 -0
- package/docs/CONFIG.md +511 -0
- package/docs/HOW-IT-WORKS.md +286 -25
- package/loadline.html +24 -20
- package/loadline.schema.json +1209 -0
- package/package.json +35 -29
- package/dist/cli/cli/locate.js +0 -60
- package/dist/cli/cli/text.js +0 -215
- /package/dist/cli/cli/{read-build.types.js → read/read-build.types.js} +0 -0
- /package/dist/cli/cli/{render-json.types.js → render/render-json.types.js} +0 -0
- /package/dist/cli/cli/{text.types.js → text/text.types.js} +0 -0
- /package/dist/cli/src/app/core/analysis/{exclusive.js → graph/exclusive.js} +0 -0
- /package/dist/cli/src/app/core/analysis/{insights.types.js → graph/insights.types.js} +0 -0
- /package/dist/cli/src/app/core/analysis/{module-graph.js → graph/module-graph.js} +0 -0
- /package/dist/cli/src/app/core/analysis/{sourcemap.types.js → sourcemap/sourcemap.types.js} +0 -0
- /package/dist/cli/src/app/core/findings/{finding-plain.js → text/finding-plain.js} +0 -0
|
@@ -12,13 +12,14 @@
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.selfCheck = void 0;
|
|
14
14
|
const invariant_1 = require("../src/app/core/analysis/invariant");
|
|
15
|
+
const text_errors_1 = require("./text/text-errors");
|
|
15
16
|
const list = (chunks) => chunks.map(chunk => ` ${chunk}`).join('\n');
|
|
16
|
-
const selfCheck = (meta, analysis, announced) => {
|
|
17
|
+
const selfCheck = (meta, analysis, announced, t = text_errors_1.ERROR_TEXT.en) => {
|
|
17
18
|
if (!announced) {
|
|
18
19
|
return {
|
|
19
20
|
ok: false,
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
ran: false,
|
|
22
|
+
report: t.selfNoPage,
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
25
|
// What the analysis calls a screen's chunk, so a page that preloads its own route's chunks is
|
|
@@ -28,58 +29,53 @@ const selfCheck = (meta, analysis, announced) => {
|
|
|
28
29
|
if (!check) {
|
|
29
30
|
return {
|
|
30
31
|
ok: false,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
'nothing lines up — which is the thing this check is for.',
|
|
32
|
+
ran: false,
|
|
33
|
+
report: t.selfNoChunk,
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
if ((0, invariant_1.isSameBoot)(check)) {
|
|
37
|
-
const passed =
|
|
37
|
+
const passed = t.selfPassed(check.agreed);
|
|
38
38
|
if (check.onlyInPage.length > 0) {
|
|
39
39
|
// Said, not swallowed: these are bytes of the first load that no figure of the report
|
|
40
40
|
// accounts for, and knowing which they are is the difference between "fine" and "fine
|
|
41
41
|
// as far as anything here can tell".
|
|
42
42
|
return {
|
|
43
43
|
ok: true,
|
|
44
|
+
ran: true,
|
|
44
45
|
report: [
|
|
45
46
|
passed,
|
|
46
47
|
'',
|
|
47
|
-
|
|
48
|
+
t.selfUnplaced(check.onlyInPage.length),
|
|
48
49
|
list(check.onlyInPage),
|
|
49
|
-
|
|
50
|
-
'page — which no reader of the files can follow. Too few to be the build changing shape.',
|
|
50
|
+
t.selfUnplacedWhy,
|
|
51
51
|
].join('\n'),
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
if (check.preloadedRoutes.length === 0) {
|
|
55
|
-
return { ok: true, report: passed };
|
|
55
|
+
return { ok: true, ran: true, report: passed };
|
|
56
56
|
}
|
|
57
57
|
// Said out loud rather than dropped: these chunks really are fetched with the first load of
|
|
58
58
|
// this page, and a build that prerenders one page per route is a different kind of build.
|
|
59
59
|
return {
|
|
60
60
|
ok: true,
|
|
61
|
+
ran: true,
|
|
61
62
|
report: [
|
|
62
63
|
passed,
|
|
63
64
|
'',
|
|
64
|
-
|
|
65
|
+
t.selfPreloaded(check.preloadedRoutes.length),
|
|
65
66
|
list(check.preloadedRoutes),
|
|
66
|
-
|
|
67
|
-
'so those are preloaded route chunks and not part of what every screen pays.',
|
|
67
|
+
t.selfPreloadedWhy,
|
|
68
68
|
].join('\n'),
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
const parts = [
|
|
72
|
-
'Self-check FAILED: the two ways of working out the bootstrap disagree.',
|
|
73
|
-
'',
|
|
74
|
-
`Agreed on ${check.agreed} chunk(s).`,
|
|
75
|
-
];
|
|
71
|
+
const parts = [t.selfFailed, '', t.selfAgreed(check.agreed)];
|
|
76
72
|
if (check.onlyInGraph.length > 0) {
|
|
77
|
-
parts.push('',
|
|
73
|
+
parts.push('', t.selfOnlyGraph, list(check.onlyInGraph));
|
|
78
74
|
}
|
|
79
75
|
if (check.onlyInPage.length > 0) {
|
|
80
|
-
parts.push('',
|
|
76
|
+
parts.push('', t.selfOnlyPage, list(check.onlyInPage));
|
|
81
77
|
}
|
|
82
|
-
parts.push('',
|
|
83
|
-
return { ok: false, report: parts.join('\n') };
|
|
78
|
+
parts.push('', t.selfSuspect);
|
|
79
|
+
return { ok: false, ran: true, report: parts.join('\n') };
|
|
84
80
|
};
|
|
85
81
|
exports.selfCheck = selfCheck;
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.sinceLastLine = void 0;
|
|
8
8
|
const format_utils_1 = require("../src/app/core/format/format.utils");
|
|
9
9
|
const ui_1 = require("../src/app/core/i18n/ui");
|
|
10
|
-
const text_1 = require("./text");
|
|
10
|
+
const text_1 = require("./text/text");
|
|
11
11
|
/**
|
|
12
12
|
* What moved since the last run of this build, in one line: "bootstrap 156 kB → 129 kB (−27 kB)",
|
|
13
13
|
* then the screens that changed. `null` when there is nothing to compare against.
|
|
@@ -40,6 +40,6 @@ const sinceLastLine = (report) => {
|
|
|
40
40
|
const date = Number.isNaN(when.getTime())
|
|
41
41
|
? since.baselineDate
|
|
42
42
|
: `${when.getFullYear()}-${two(when.getMonth() + 1)}-${two(when.getDate())} ${two(when.getHours())}:${two(when.getMinutes())}`;
|
|
43
|
-
return text.sinceLast(date, parts.length > 0 ? parts.join(' · ') : text.lastRunUnchanged);
|
|
43
|
+
return text.sinceLast(date, parts.length > 0 ? parts.join(' · ') : text.lastRunUnchanged, report.sinceLastBranch);
|
|
44
44
|
};
|
|
45
45
|
exports.sinceLastLine = sinceLastLine;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* What the command says when it cannot do what it was asked, and what the self-check answers, in
|
|
4
|
+
* the language of the report.
|
|
5
|
+
*
|
|
6
|
+
* Apart from `text.ts` because none of it is a report: it is what is printed instead of one. Under
|
|
7
|
+
* `--lang es` these were the last lines left in English, and they are the ones read when something
|
|
8
|
+
* has already gone wrong. The flags and file names inside them stay as they are typed.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.ERROR_TEXT = void 0;
|
|
12
|
+
/** "chunk" is the word in both languages. */
|
|
13
|
+
const chunks = (count) => (count === 1 ? '1 chunk' : `${count} chunks`);
|
|
14
|
+
const EN = {
|
|
15
|
+
needsValue: flag => `${flag} needs a value.`,
|
|
16
|
+
badMode: value => `--mode takes raw, gzip or brotli, not "${value}".`,
|
|
17
|
+
badLang: value => `--lang takes en or es, not "${value}".`,
|
|
18
|
+
badFormat: value => `--format takes text, json, markdown, pr-comment, sarif, summary, agent or badge, not "${value}".`,
|
|
19
|
+
badFailOn: value => `--fail-on takes high, mid or none, not "${value}".`,
|
|
20
|
+
badPct: value => `--max-growth-pct takes a number, not "${value}".`,
|
|
21
|
+
badSize: (flag, value) => `${flag} takes a size like 350kB, 1.5MB or a number of bytes, not "${value}".`,
|
|
22
|
+
bareSize: (flag, typed) => `${flag} ${typed} would be ${typed} bytes. Write ${typed}kB, or ${typed}B if bytes are meant.`,
|
|
23
|
+
unknownFlag: flag => `Unknown flag: ${flag}`,
|
|
24
|
+
missingTarget: 'Missing the stats.json or the build folder to analyse.',
|
|
25
|
+
unexpected: argument => `Unexpected argument: ${argument}`,
|
|
26
|
+
openNeedsHtml: '--open opens what --html writes: add --html <file>.',
|
|
27
|
+
seeHelp: 'Run loadline --help to see the options.',
|
|
28
|
+
distTwice: '--dist is the folder already being analysed; drop one of the two.',
|
|
29
|
+
growthNeedsBaseline: '--max-growth and --max-growth-pct need a --baseline to compare against.',
|
|
30
|
+
cannotWrite: (path, why) => `Could not write ${path}: ${why}`,
|
|
31
|
+
cannotRead: path => `Could not read ${path}.`,
|
|
32
|
+
notJson: path => `${path} is not valid JSON.`,
|
|
33
|
+
extendsNotFound: (name, from) => `${from} extends "${name}", and there is no such file, nor an installed package with a loadline.json. A package has to ship that file at its root, and list it in "exports" if it has them.`,
|
|
34
|
+
extendsCycle: chain => `loadline.json extends itself: ${chain.join(' → ')}.`,
|
|
35
|
+
noConfigToPrint: 'There is no loadline.json in this folder to print. Pass one with --config <file>.',
|
|
36
|
+
cannotReadFolder: folder => `Could not read the folder ${folder}.`,
|
|
37
|
+
noAssets: folder => `No .js or .css files under ${folder}. Is that the browser/ folder of the build?`,
|
|
38
|
+
notLock: path => `${path} is not a package-lock.json, a pnpm-lock.yaml or a yarn.lock.`,
|
|
39
|
+
notAudit: path => `${path} is not the JSON output of npm audit, pnpm audit or yarn audit.`,
|
|
40
|
+
notStats: path => `${path} is neither a stats.json nor an analysis exported from Loadline.`,
|
|
41
|
+
noProject: folder => `No angular.json, package.json or pipeline file under ${folder}.`,
|
|
42
|
+
projectNotBuilt: folder => `${folder} is a project, not a build, and no build was found inside it: no folder holding an index.html with ` +
|
|
43
|
+
'scripts, nor a stats.json. Build it the way you deploy it (npm run build) and run this again, or pass the ' +
|
|
44
|
+
'output folder itself: dist/, build/, www/ or wherever your tool writes it.',
|
|
45
|
+
notThresholds: path => `${path} has to be an object of thresholds.`,
|
|
46
|
+
needsBrotli: by => `${by} needs the .js.br files of the build in --dist.`,
|
|
47
|
+
needsDist: by => `${by} needs the build folder in --dist.`,
|
|
48
|
+
modeInConfig: mode => `"mode": "${mode}" in loadline.json`,
|
|
49
|
+
htmlMissing: 'loadline.html is missing from this install, so --html has nothing to write. Run: pnpm build',
|
|
50
|
+
selfNoPage: 'Self-check needs the index.html of the build: it is the second, independent answer.\n' +
|
|
51
|
+
'Pass the build folder as the target, or add --dist pointing at it.',
|
|
52
|
+
selfNoChunk: 'Self-check could not run: the index.html of the build names no chunk of it.\n' +
|
|
53
|
+
'Either the page belongs to another build, or the output shape changed enough that\n' +
|
|
54
|
+
'nothing lines up — which is the thing this check is for.',
|
|
55
|
+
selfPassed: agreed => `Self-check passed: the import graph and index.html agree on all ${agreed} bootstrap chunks.`,
|
|
56
|
+
selfUnplaced: count => `It also announces ${chunks(count)} the import graph cannot place:`,
|
|
57
|
+
selfUnplacedWhy: 'Usually a dynamic import whose path is built at run time — VitePress writes one per\n' +
|
|
58
|
+
'page — which no reader of the files can follow. Too few to be the build changing shape.',
|
|
59
|
+
selfPreloaded: count => `This page also announces ${chunks(count)} the graph attributes to a screen:`,
|
|
60
|
+
selfPreloadedWhy: 'That is a build with one page per route — index.html is the home route, not a shell —\n' +
|
|
61
|
+
'so those are preloaded route chunks and not part of what every screen pays.',
|
|
62
|
+
selfFailed: 'Self-check FAILED: the two ways of working out the bootstrap disagree.',
|
|
63
|
+
selfAgreed: count => `Agreed on ${chunks(count)}.`,
|
|
64
|
+
selfOnlyGraph: 'Called bootstrap by the import graph, never reached from index.html:',
|
|
65
|
+
selfOnlyPage: 'Reached from index.html, not called bootstrap by the import graph:',
|
|
66
|
+
selfSuspect: 'One of the two readers is wrong about this build. Every per-screen figure is measured\n' +
|
|
67
|
+
'against the bootstrap, so they are all suspect until this passes.',
|
|
68
|
+
};
|
|
69
|
+
const ES = {
|
|
70
|
+
needsValue: flag => `${flag} necesita un valor.`,
|
|
71
|
+
badMode: value => `--mode acepta raw, gzip o brotli, no "${value}".`,
|
|
72
|
+
badLang: value => `--lang acepta en o es, no "${value}".`,
|
|
73
|
+
badFormat: value => `--format acepta text, json, markdown, pr-comment, sarif, summary, agent o badge, no "${value}".`,
|
|
74
|
+
badFailOn: value => `--fail-on acepta high, mid o none, no "${value}".`,
|
|
75
|
+
badPct: value => `--max-growth-pct acepta un número, no "${value}".`,
|
|
76
|
+
badSize: (flag, value) => `${flag} acepta un tamaño como 350kB, 1.5MB o un número de bytes, no "${value}".`,
|
|
77
|
+
bareSize: (flag, typed) => `${flag} ${typed} serían ${typed} bytes. Escribe ${typed}kB, o ${typed}B si de verdad son bytes.`,
|
|
78
|
+
unknownFlag: flag => `Opción desconocida: ${flag}`,
|
|
79
|
+
missingTarget: 'Falta el stats.json o la carpeta del build que analizar.',
|
|
80
|
+
unexpected: argument => `Argumento de más: ${argument}`,
|
|
81
|
+
openNeedsHtml: '--open abre lo que escribe --html: añade --html <fichero>.',
|
|
82
|
+
seeHelp: 'Ejecuta loadline --help para ver las opciones.',
|
|
83
|
+
distTwice: '--dist es la carpeta que ya se está analizando; quita una de las dos.',
|
|
84
|
+
growthNeedsBaseline: '--max-growth y --max-growth-pct necesitan una --baseline con la que comparar.',
|
|
85
|
+
cannotWrite: (path, why) => `No se pudo escribir ${path}: ${why}`,
|
|
86
|
+
cannotRead: path => `No se pudo leer ${path}.`,
|
|
87
|
+
notJson: path => `${path} no es un JSON válido.`,
|
|
88
|
+
extendsNotFound: (name, from) => `${from} hereda de "${name}", y no hay ningún fichero así ni un paquete instalado con un loadline.json. Un paquete tiene que llevar ese fichero en su raíz, y nombrarlo en "exports" si los tiene.`,
|
|
89
|
+
extendsCycle: chain => `loadline.json hereda de sí mismo: ${chain.join(' → ')}.`,
|
|
90
|
+
noConfigToPrint: 'No hay ningún loadline.json en esta carpeta que mostrar. Pásale uno con --config <fichero>.',
|
|
91
|
+
cannotReadFolder: folder => `No se pudo leer la carpeta ${folder}.`,
|
|
92
|
+
noAssets: folder => `No hay ficheros .js ni .css en ${folder}. ¿Es la carpeta browser/ del build?`,
|
|
93
|
+
notLock: path => `${path} no es un package-lock.json, un pnpm-lock.yaml ni un yarn.lock.`,
|
|
94
|
+
notAudit: path => `${path} no es la salida JSON de npm audit, pnpm audit ni yarn audit.`,
|
|
95
|
+
notStats: path => `${path} no es un stats.json ni un análisis exportado de Loadline.`,
|
|
96
|
+
noProject: folder => `No hay angular.json, package.json ni fichero de pipeline en ${folder}.`,
|
|
97
|
+
projectNotBuilt: folder => `${folder} es un proyecto, no un build, y dentro no hay ningún build: ninguna carpeta con un index.html y ` +
|
|
98
|
+
'scripts, ni un stats.json. Compílalo como lo despliegas (npm run build) y vuelve a lanzarlo, o pasa la ' +
|
|
99
|
+
'carpeta de salida directamente: dist/, build/, www/ o donde la escriba tu herramienta.',
|
|
100
|
+
notThresholds: path => `${path} tiene que ser un objeto de umbrales.`,
|
|
101
|
+
needsBrotli: by => `${by} necesita los ficheros .js.br del build en --dist.`,
|
|
102
|
+
needsDist: by => `${by} necesita la carpeta del build en --dist.`,
|
|
103
|
+
modeInConfig: mode => `"mode": "${mode}" de loadline.json`,
|
|
104
|
+
htmlMissing: 'Falta loadline.html en esta instalación, así que --html no tiene nada que escribir. Ejecuta: pnpm build',
|
|
105
|
+
selfNoPage: 'El self-check necesita el index.html del build: es la segunda respuesta, la independiente.\n' +
|
|
106
|
+
'Pasa la carpeta del build como objetivo, o añade --dist apuntando a ella.',
|
|
107
|
+
selfNoChunk: 'El self-check no pudo ejecutarse: el index.html del build no nombra ningún chunk suyo.\n' +
|
|
108
|
+
'O la página es de otro build, o la forma de la salida ha cambiado tanto que nada\n' +
|
|
109
|
+
'encaja, que es justo lo que esta comprobación vigila.',
|
|
110
|
+
selfPassed: agreed => `Self-check correcto: el grafo de imports y el index.html coinciden en los ${agreed} chunks del arranque.`,
|
|
111
|
+
selfUnplaced: count => `También anuncia ${chunks(count)} que el grafo de imports no sabe colocar:`,
|
|
112
|
+
selfUnplacedWhy: 'Suele ser un import dinámico cuya ruta se construye al ejecutarse (VitePress escribe uno por\n' +
|
|
113
|
+
'página), que nadie que lea los ficheros puede seguir. Son muy pocos para que el build haya cambiado de forma.',
|
|
114
|
+
selfPreloaded: count => `Esta página también anuncia ${chunks(count)} que el grafo asigna a una pantalla:`,
|
|
115
|
+
selfPreloadedWhy: 'Es un build con una página por ruta (el index.html es la ruta de inicio, no un shell),\n' +
|
|
116
|
+
'así que son chunks de ruta precargados y no forman parte de lo que paga cada pantalla.',
|
|
117
|
+
selfFailed: 'Self-check FALLIDO: las dos formas de calcular el arranque no coinciden.',
|
|
118
|
+
selfAgreed: count => `Coinciden en ${chunks(count)}.`,
|
|
119
|
+
selfOnlyGraph: 'El grafo de imports los llama arranque, pero el index.html nunca llega a ellos:',
|
|
120
|
+
selfOnlyPage: 'El index.html llega a ellos, pero el grafo de imports no los llama arranque:',
|
|
121
|
+
selfSuspect: 'Uno de los dos lectores se equivoca con este build. Cada cifra por pantalla se mide contra\n' +
|
|
122
|
+
'el arranque, así que todas son dudosas hasta que esto pase.',
|
|
123
|
+
};
|
|
124
|
+
exports.ERROR_TEXT = { en: EN, es: ES };
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/** Both languages of the command's own words. See `text.types.ts` for why they are kept apart. */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.CLI_TEXT = void 0;
|
|
5
|
+
/** "Fixing both", not "acting on all 2": the line under the ranked signals, as the page words it. */
|
|
6
|
+
const fixingEn = (count) => {
|
|
7
|
+
if (count === 1) {
|
|
8
|
+
return 'Fixing it';
|
|
9
|
+
}
|
|
10
|
+
return count === 2 ? 'Fixing both' : `Fixing all ${count}`;
|
|
11
|
+
};
|
|
12
|
+
const fixingEs = (count) => {
|
|
13
|
+
if (count === 1) {
|
|
14
|
+
return 'Arreglándola';
|
|
15
|
+
}
|
|
16
|
+
return count === 2 ? 'Arreglando las dos' : `Arreglando las ${count}`;
|
|
17
|
+
};
|
|
18
|
+
const EN = {
|
|
19
|
+
lead: (stats, unit, tool) => `${stats} · figures ${unit}${tool ? ` · ${tool}` : ''}`,
|
|
20
|
+
against: (baseline, date) => `compared against ${baseline} (${date})`,
|
|
21
|
+
pageCss: (size, files, total) => `Plus ${size} of CSS in ${files === 1 ? 'the stylesheet' : `${files} stylesheets`} the same page asks for, ` +
|
|
22
|
+
`which block the paint and are not in the figure above: ${total} really comes down first. ` +
|
|
23
|
+
'This report breaks down JavaScript only.',
|
|
24
|
+
tripInline: size => `(${size} of it inline in the page)`,
|
|
25
|
+
firstTrip: (total, files, parts) => `The whole first trip is ${total} across ${files} ${files === 1 ? 'file' : 'files'} — ${parts} — ` +
|
|
26
|
+
'counting everything index.html asks for before anything appears. The figure above is the ' +
|
|
27
|
+
'JavaScript half, which is the half this report can break down.',
|
|
28
|
+
htmlWritten: file => `The page with this build loaded: ${file}`,
|
|
29
|
+
severity: { high: 'high', mid: 'mid', ok: 'ok', info: 'info' },
|
|
30
|
+
exportWritten: file => `This build's snapshot, to be the --baseline of a later run: ${file}`,
|
|
31
|
+
htmlInsideBuild: folder => `It is inside ${folder}, which the next build empties: write it somewhere else to keep it.`,
|
|
32
|
+
located: files => `found ${files}`,
|
|
33
|
+
alsoFound: folders => `the newest build was read; also found ${folders}: pass one of them to read it instead`,
|
|
34
|
+
lastRunUnchanged: 'nothing moved',
|
|
35
|
+
tripFonts: 'fonts',
|
|
36
|
+
tripImages: 'images',
|
|
37
|
+
componentStyles: count => `${count} component ${count === 1 ? 'stylesheet' : 'stylesheets'} of the metafile ${count === 1 ? 'is' : 'are'} ` +
|
|
38
|
+
'inside the JavaScript: Angular inlines them, so they are not files in the folder and are already in the figures.',
|
|
39
|
+
offPageLeftOut: ({ legacy, serviceWorker, server, ignored }) => `${[
|
|
40
|
+
legacy > 0 &&
|
|
41
|
+
`${legacy === 1 ? '1 file is' : `${legacy} files are`} the copy for browsers without ES modules (nomodule)`,
|
|
42
|
+
serviceWorker > 0 &&
|
|
43
|
+
`${serviceWorker === 1 ? '1 file is' : `${serviceWorker} files are`} the service worker and what it imports`,
|
|
44
|
+
server > 0 && `${server === 1 ? '1 file runs' : `${server} files run`} only on the server (FastBoot)`,
|
|
45
|
+
ignored > 0 && `${ignored === 1 ? '1 file is' : `${ignored} files are`} in build.ignore of loadline.json`,
|
|
46
|
+
]
|
|
47
|
+
.filter(Boolean)
|
|
48
|
+
.join('; ')}: left out, because no screen downloads them on a current browser.`,
|
|
49
|
+
sinceLast: (date, change, branch) => `since the last run (${date}${branch ? `, on branch ${branch}` : ''}): ${change}`,
|
|
50
|
+
serverLeftOut: count => `${count === 1 ? '1 output of this build is' : `${count} outputs of this build are`} not in the browser folder ` +
|
|
51
|
+
'(the server side of a rendered build, or a file renamed after it was built, as Angular 8 does with its es5 polyfills): left out, because nobody downloads them under that name.',
|
|
52
|
+
blocked: (baseline, now) => `The baseline was measured in ${baseline} and this build in ${now}: nothing is compared. ${baseline === 'raw'
|
|
53
|
+
? 'Pass --mode raw.'
|
|
54
|
+
: `Pass --mode ${baseline}, with the build folder that has those files.`}`,
|
|
55
|
+
exactSplit: 'weight per file read from the source maps',
|
|
56
|
+
opaqueSome: (chunks, count) => `${count === 1 ? 'One bootstrap chunk carries' : `${count} bootstrap chunks carry`} no source map, so what is inside ${count === 1 ? 'it' : 'them'} is not known: ${chunks}.`,
|
|
57
|
+
opaque: 'No source maps in this folder: what each chunk weighs is known, what is inside it is not. ' +
|
|
58
|
+
'Screens carry their chunk name, and no saving per package or file can be measured.',
|
|
59
|
+
headBoot: 'Bootstrap',
|
|
60
|
+
headScreens: 'Screens',
|
|
61
|
+
headSignals: 'Signals',
|
|
62
|
+
headGates: 'Gates',
|
|
63
|
+
headActions: 'What to fix first',
|
|
64
|
+
headTime: 'Estimated time',
|
|
65
|
+
headBudget: 'Suggested budget',
|
|
66
|
+
actionsNote: 'An order over the signals below, not a selection: every one of them is still there.',
|
|
67
|
+
colAction: 'Signal',
|
|
68
|
+
colSaving: 'Off the first load',
|
|
69
|
+
colEffort: 'Effort',
|
|
70
|
+
effortLabel: {
|
|
71
|
+
config: 'configuration',
|
|
72
|
+
import: 'one import',
|
|
73
|
+
refactor: 'refactor',
|
|
74
|
+
none: '',
|
|
75
|
+
},
|
|
76
|
+
savingCell: saving => saving || '—',
|
|
77
|
+
totalSaving: (bytes, after, count, estimated) => `${fixingEn(count)} would take ${bytes} off the first load, leaving it at about ${after}. ${estimated
|
|
78
|
+
? 'Compressed figures are an estimate: the raw bytes taken out, at the ratio the bootstrap ' +
|
|
79
|
+
'compresses by, since a single module has no compressed size of its own. '
|
|
80
|
+
: 'The figures are raw minified bytes inside the chunk. '}They are not added up: the graph is walked once with every file named above taken out ` +
|
|
81
|
+
'together, so bytes reachable two ways are counted once.',
|
|
82
|
+
profileName: { slow4g: 'slow 4G', fast4g: '4G', cable: 'cable' },
|
|
83
|
+
timeNote: 'An estimate, not a measurement: a model over the bytes, the round trips and three standard ' +
|
|
84
|
+
'connection profiles. Transfer and latency go by what travels; parse and compile go by raw ' +
|
|
85
|
+
'bytes, because that is what the engine works on. Latency is editable in the criteria.',
|
|
86
|
+
timeColumns: { profile: 'Connection', transfer: 'Transfer', latency: 'Latency', script: 'Parse', total: 'Total' },
|
|
87
|
+
budgetNote: (warning, error, current) => `Nothing here writes a file. The initial load is ${current} raw (JavaScript and the CSS the page ` +
|
|
88
|
+
`asks for, which is what Angular's initial budget counts), so a warning at ${warning} and an ` +
|
|
89
|
+
`error at ${error} leaves room for a feature and still stops a pipeline.`,
|
|
90
|
+
bootSummary: (files, screens) => `${files} ${files === 1 ? 'file' : 'files'}, downloaded before anything appears · ${screens} ${screens === 1 ? 'screen' : 'screens'}`,
|
|
91
|
+
noScreens: 'No lazy screens: everything is in the bootstrap.',
|
|
92
|
+
notScreens: parts => `Loaded lazily and not counted as screens: ${parts.join('; ')}.`,
|
|
93
|
+
notScreensPart: {
|
|
94
|
+
blocks: (count, list) => `${count} ${count === 1 ? 'block' : 'blocks'} deferred inside a screen (${list})`,
|
|
95
|
+
groupers: (count, list) => `${count} route ${count === 1 ? 'file' : 'files'}, paid by the screens behind ${count === 1 ? 'it' : 'them'} (${list})`,
|
|
96
|
+
packages: (count, list) => `${count} ${count === 1 ? 'package' : 'packages'} loaded on demand (${list})`,
|
|
97
|
+
data: (count, list) => `${count} data ${count === 1 ? 'chunk' : 'chunks'} (${list})`,
|
|
98
|
+
workers: (count, list) => `${count} web ${count === 1 ? 'worker' : 'workers'} (${list})`,
|
|
99
|
+
onDemand: (count, list) => `${count} ${count === 1 ? 'chunk' : 'chunks'} of yours no route opens: components, tabs, language files (${list})`,
|
|
100
|
+
},
|
|
101
|
+
noRouteTable: 'No route table was found in the code, so every chunk loaded lazily counts as a screen: some of these may be tabs or components inside a page rather than places somebody navigates to.',
|
|
102
|
+
routeCss: (count, list) => `Screens also load ${count === 1 ? 'a stylesheet' : `${count} stylesheets`} of their own (${list}), not in their totals: the figures here are JavaScript.`,
|
|
103
|
+
fix: 'Fix',
|
|
104
|
+
passed: 'Every gate passed.',
|
|
105
|
+
failed: count => `${count} ${count === 1 ? 'gate' : 'gates'} broken.`,
|
|
106
|
+
noGates: 'No gate was asked for: this run reports and never fails.',
|
|
107
|
+
overBoot: (actual, limit) => `Bootstrap is ${actual}, over the ${limit} allowed.`,
|
|
108
|
+
overScreen: (screen, actual, limit) => `Screen ${screen} downloads ${actual}, over the ${limit} allowed.`,
|
|
109
|
+
screenLimitUnmatched: (name, screens) => `loadline.json: "gates.screens" has a limit for "${name}", and no screen has that name, so it guards nothing. ` +
|
|
110
|
+
`The screens are: ${screens.join(', ') || 'none'}.`,
|
|
111
|
+
growthUnchecked: 'The growth gates cannot run, and a gate that cannot run would pass.',
|
|
112
|
+
newPackageUnchecked: '--fail-on-new-package needs something to say what was there before: a --baseline, or a "packages" list in loadline.json.',
|
|
113
|
+
configGrowthSkipped: 'loadline.json: the growth gates need a --baseline, and this run has none, so they were not checked.',
|
|
114
|
+
configNewPackageSkipped: 'loadline.json: "gates.failOnNewPackage" needs a --baseline or a "packages" list, and this run has neither, so it was not checked.',
|
|
115
|
+
overOwn: (screen, actual, limit) => `Own code of ${screen} is ${actual}, over the ${limit} allowed.`,
|
|
116
|
+
growthBoot: (diff, limit) => `Bootstrap grew ${diff}, over the ${limit} allowed.`,
|
|
117
|
+
growthScreen: (screen, diff, limit) => `Screen ${screen} grew ${diff}, over the ${limit} allowed.`,
|
|
118
|
+
growthPctBoot: (percent, limit) => `Bootstrap grew ${percent} %, over the ${limit} % allowed.`,
|
|
119
|
+
growthPctScreen: (screen, percent, limit) => `Screen ${screen} grew ${percent} %, over the ${limit} % allowed.`,
|
|
120
|
+
signalsRaised: (count, level) => `${count} ${count === 1 ? 'signal' : 'signals'} of severity ${level === 'mid' ? 'medium' : 'high'} or above.`,
|
|
121
|
+
signalRaised: (kind, count) => `The ${kind} signal was raised${count === 1 ? '' : ` ${count} times`}, and "gates.failOnSignals" fails on it.`,
|
|
122
|
+
newPackages: names => `${names.length} ${names.length === 1 ? 'package has' : 'packages have'} entered the bootstrap: ${names.join(', ')}.`,
|
|
123
|
+
configRead: file => `thresholds and accepted signals from ${file}`,
|
|
124
|
+
configProblem: (file, problem) => `${file}: ${problem}`,
|
|
125
|
+
accepted: (kind, why, who, until) => `${kind} — ${why}${who ? ` (${who})` : ''}${until ? `, until ${until}` : ', with no end date'}`,
|
|
126
|
+
acceptedExpired: (kind, until) => `${kind} was accepted until ${until}. That date has passed, so it is raised again.`,
|
|
127
|
+
acceptedGrew: (kind, was, now) => `${kind} was accepted at ${was} and is now ${now}. What was agreed to is not what is here, so it is raised again.`,
|
|
128
|
+
headAccepted: 'Accepted, and set aside',
|
|
129
|
+
prFixed: count => `${count} fixed`,
|
|
130
|
+
prNew: count => `${count} new`,
|
|
131
|
+
prDetails: 'The whole report',
|
|
132
|
+
prCut: '(cut to fit a comment: --format text has all of it)',
|
|
133
|
+
screenBudgetNote: (warning, file, size) => 'And one per file. "anyScript" applies to every script the build emits — the bootstrap ones too — ' +
|
|
134
|
+
'which is what makes it usable when the names carry content hashes and a per-bundle budget cannot ' +
|
|
135
|
+
`name anything. So it goes above the largest script there is today, ${file} at ${size}, or it fails ` +
|
|
136
|
+
`the next build on a file nobody touched — ${warning}:`,
|
|
137
|
+
headWhatIf: 'What if it were deferred',
|
|
138
|
+
whatIfNote: 'The saving is exact: the graph is walked without those files, and what stops being ' +
|
|
139
|
+
'reachable is what stops being downloaded. What is NOT recomputed is the split — which ' +
|
|
140
|
+
'files end up in which chunk is the bundler’s decision, and a simulated one would produce ' +
|
|
141
|
+
'round trips and per-screen totals that look measured and are not. So those are unchanged ' +
|
|
142
|
+
'above, and the last column says who would be paying for it instead.',
|
|
143
|
+
whatIfNobody: 'nothing lazy uses it',
|
|
144
|
+
whatIfEstimated: 'In compressed figures those are the exact raw bytes at the ratio the bootstrap compresses by: ' +
|
|
145
|
+
'the right size, not the exact one, hence the ≈.',
|
|
146
|
+
whatIfNotHere: format => `--what-if is not part of the ${format} format: run it again with --format text, summary, json or agent to see the answer.`,
|
|
147
|
+
colWhatIf: 'Deferred',
|
|
148
|
+
headWhy: 'Why it is here',
|
|
149
|
+
whyReach: {
|
|
150
|
+
boot: 'in the first load, through',
|
|
151
|
+
lazy: 'not in the first load: it already arrives behind an import(), through',
|
|
152
|
+
unreached: 'in the build, and nothing reachable from the entry point imports it',
|
|
153
|
+
absent: 'not in this build: no package, folder or file goes by that name',
|
|
154
|
+
unknown: 'cannot be known: without source maps nothing inside a chunk has a name',
|
|
155
|
+
unchained: 'in the first load, and nothing in this build says which file brings it in: a build folder records which chunk holds what, not which file imports which, and no source of the project in its maps names it',
|
|
156
|
+
sourced: 'in the first load. A build folder does not record which file imports which, but the sources inside its maps do',
|
|
157
|
+
deferred: 'not in the first load: it arrives later, with whatever asks for it',
|
|
158
|
+
},
|
|
159
|
+
whyCutSourced: (files, what, upTo) => `${files.length === 1 ? `${files[0]} imports it` : `${files.length} files of yours in the first load import it — ${files.join(', ')}`}. ` +
|
|
160
|
+
`An import() of ${what} there would take up to ${upTo} off the first load: what it weighs in it, and less if part of it also arrives another way.`,
|
|
161
|
+
whyCut: (file, what, saved, through, payers) => `${through ? `It comes in through ${what}. ` : ''}Cut here: an import() of ${what} in ${file} would take ${saved} ` +
|
|
162
|
+
`off the first load${payers ? `, and ${payers} would pay for it instead` : ''}.`,
|
|
163
|
+
whyCutAlso: (file, others, everywhere) => `Cutting it in ${file} alone saves nothing: ${others.length === 1 ? `${others[0]} imports it too` : `${others.length} more files of the first load import it too — ${others.join(', ')}`}. ` +
|
|
164
|
+
`An import() in every one of them would take ${everywhere} off the first load.`,
|
|
165
|
+
whyCutShared: file => `Cutting it in ${file} alone saves nothing: it also arrives another way. The figure under --what-if says how much once every way is cut.`,
|
|
166
|
+
whyNoCut: 'The entry point imports it itself: the import() would go in the entry file.',
|
|
167
|
+
whyNotHere: format => `--why is not part of the ${format} format: run it again with --format text, json or agent to see the answer.`,
|
|
168
|
+
whatIfUnknown: 'cannot be measured',
|
|
169
|
+
whatIfAbsent: 'not in this build',
|
|
170
|
+
whatIfUnknownWhy: 'Where it says "cannot be measured": a build folder records which chunk holds what and not which file imports which, so what would stop being downloaded cannot be walked. The Size column is the most it could be; the stats.json of the build, or the page with it, gives the exact figure.',
|
|
171
|
+
savingUnknown: 'A dash here means "not known", not "nothing": without source maps no saving can be measured.',
|
|
172
|
+
colSize: 'In the bootstrap',
|
|
173
|
+
colAfter: 'Bootstrap after',
|
|
174
|
+
colWhoPays: 'Would then be paid by',
|
|
175
|
+
};
|
|
176
|
+
const ES = {
|
|
177
|
+
lead: (stats, unit, tool) => `${stats} · cifras ${unit}${tool ? ` · ${tool}` : ''}`,
|
|
178
|
+
against: (baseline, date) => `comparado con ${baseline} (${date})`,
|
|
179
|
+
pageCss: (size, files, total) => `Más ${size} de CSS en ${files === 1 ? 'la hoja de estilos' : `${files} hojas de estilos`} que pide la misma ` +
|
|
180
|
+
`página, que bloquean el pintado y no están en la cifra de arriba: ${total} es lo que baja de verdad antes ` +
|
|
181
|
+
'de nada. Este informe desglosa solo el JavaScript.',
|
|
182
|
+
tripInline: size => `(${size} de ello en línea en la página)`,
|
|
183
|
+
firstTrip: (total, files, parts) => `El primer viaje entero son ${total} en ${files} ${files === 1 ? 'fichero' : 'ficheros'} — ${parts} — ` +
|
|
184
|
+
'contando todo lo que pide index.html antes de que aparezca nada. La cifra de arriba es la ' +
|
|
185
|
+
'mitad de JavaScript, que es la que este informe sabe desglosar.',
|
|
186
|
+
htmlWritten: file => `La página con este build cargado: ${file}`,
|
|
187
|
+
severity: { high: 'alta', mid: 'media', ok: 'ok', info: 'info' },
|
|
188
|
+
exportWritten: file => `La foto de este build, para ser la --baseline de otra ejecución: ${file}`,
|
|
189
|
+
htmlInsideBuild: folder => `Está dentro de ${folder}, que el siguiente build vacía: guárdala en otro sitio para conservarla.`,
|
|
190
|
+
located: files => `encontrado ${files}`,
|
|
191
|
+
alsoFound: folders => `se ha leído el build más reciente; también hay ${folders}: pasa uno de ellos para leerlo`,
|
|
192
|
+
lastRunUnchanged: 'no se ha movido nada',
|
|
193
|
+
tripFonts: 'de tipografías',
|
|
194
|
+
tripImages: 'de imágenes',
|
|
195
|
+
componentStyles: count => `${count} ${count === 1 ? 'hoja de estilos de componente del metafile va' : 'hojas de estilos de componente del metafile van'} ` +
|
|
196
|
+
'dentro del JavaScript: Angular las incrusta, así que no son ficheros de la carpeta y ya están en las cifras.',
|
|
197
|
+
offPageLeftOut: ({ legacy, serviceWorker, server, ignored }) => `${[
|
|
198
|
+
legacy > 0 &&
|
|
199
|
+
`${legacy === 1 ? '1 fichero es' : `${legacy} ficheros son`} la copia para navegadores sin módulos ES (nomodule)`,
|
|
200
|
+
serviceWorker > 0 &&
|
|
201
|
+
`${serviceWorker === 1 ? '1 fichero es' : `${serviceWorker} ficheros son`} el service worker y lo que importa`,
|
|
202
|
+
server > 0 &&
|
|
203
|
+
`${server === 1 ? '1 fichero corre' : `${server} ficheros corren`} solo en el servidor (FastBoot)`,
|
|
204
|
+
ignored > 0 &&
|
|
205
|
+
`${ignored === 1 ? '1 fichero está' : `${ignored} ficheros están`} en build.ignore de loadline.json`,
|
|
206
|
+
]
|
|
207
|
+
.filter(Boolean)
|
|
208
|
+
.join('; ')}: fuera, porque ninguna pantalla los descarga en un navegador actual.`,
|
|
209
|
+
sinceLast: (date, change, branch) => `desde la última ejecución (${date}${branch ? `, en la rama ${branch}` : ''}): ${change}`,
|
|
210
|
+
serverLeftOut: count => `${count} salida${count === 1 ? '' : 's'} de este build no ${count === 1 ? 'está' : 'están'} en la carpeta ` +
|
|
211
|
+
'del navegador (el lado servidor de un build con render, o un fichero renombrado después de compilarlo, como hace Angular 8 con sus polyfills es5): fuera, porque nadie las descarga con ese nombre.',
|
|
212
|
+
blocked: (baseline, now) => `La línea base se midió en ${baseline} y este build en ${now}: no se compara nada. ${baseline === 'raw'
|
|
213
|
+
? 'Pasa --mode raw.'
|
|
214
|
+
: `Pasa --mode ${baseline}, con la carpeta de build que tiene esos ficheros.`}`,
|
|
215
|
+
exactSplit: 'peso por fichero leído de los source maps',
|
|
216
|
+
opaqueSome: (chunks, count) => `${count === 1 ? 'Un chunk del bootstrap no trae' : `${count} chunks del bootstrap no traen`} source map, así que no se sabe qué hay dentro: ${chunks}.`,
|
|
217
|
+
opaque: 'Esta carpeta no trae source maps: se sabe lo que pesa cada chunk y no lo que hay dentro. ' +
|
|
218
|
+
'Las pantallas llevan el nombre de su chunk, y no se puede medir ningún ahorro por paquete o fichero.',
|
|
219
|
+
headBoot: 'Bootstrap',
|
|
220
|
+
headScreens: 'Pantallas',
|
|
221
|
+
headSignals: 'Señales',
|
|
222
|
+
headGates: 'Gates',
|
|
223
|
+
headActions: 'Qué arreglo primero',
|
|
224
|
+
headTime: 'Tiempo estimado',
|
|
225
|
+
headBudget: 'Budget sugerido',
|
|
226
|
+
actionsNote: 'Es un orden sobre las señales de abajo, no una selección: todas siguen estando.',
|
|
227
|
+
colAction: 'Señal',
|
|
228
|
+
colSaving: 'Fuera de la primera carga',
|
|
229
|
+
colEffort: 'Esfuerzo',
|
|
230
|
+
effortLabel: {
|
|
231
|
+
config: 'configuración',
|
|
232
|
+
import: 'un import',
|
|
233
|
+
refactor: 'refactor',
|
|
234
|
+
none: '',
|
|
235
|
+
},
|
|
236
|
+
savingCell: saving => saving || '—',
|
|
237
|
+
totalSaving: (bytes, after, count, estimated) => `${fixingEs(count)} se quitarían ${bytes} de la primera carga y quedaría en unos ${after}. ${estimated
|
|
238
|
+
? 'Las cifras comprimidas son una estimación: los bytes en crudo que se quitan, a la proporción ' +
|
|
239
|
+
'en que se comprime el bootstrap, porque un módulo suelto no tiene tamaño comprimido propio. '
|
|
240
|
+
: 'Las cifras son bytes minificados en crudo dentro del chunk. '}No se suman: el grafo se recorre una vez quitando de golpe todos los ficheros nombrados arriba, ` +
|
|
241
|
+
'así que lo que se alcanza por dos caminos se cuenta una vez.',
|
|
242
|
+
profileName: { slow4g: '4G lento', fast4g: '4G', cable: 'cable' },
|
|
243
|
+
timeNote: 'Es una estimación, no una medición: un modelo sobre los bytes, las idas y vueltas y tres perfiles ' +
|
|
244
|
+
'de conexión estándar. La transferencia y la latencia van por lo que viaja; el parseo y la ' +
|
|
245
|
+
'compilación van por bytes en crudo, que es sobre lo que trabaja el motor. La latencia se edita ' +
|
|
246
|
+
'en los criterios.',
|
|
247
|
+
timeColumns: {
|
|
248
|
+
profile: 'Conexión',
|
|
249
|
+
transfer: 'Transferencia',
|
|
250
|
+
latency: 'Latencia',
|
|
251
|
+
script: 'Parseo',
|
|
252
|
+
total: 'Total',
|
|
253
|
+
},
|
|
254
|
+
budgetNote: (warning, error, current) => `Aquí no se escribe ningún fichero. La primera carga son ${current} en crudo (el JavaScript y el CSS ` +
|
|
255
|
+
'que pide la página, que es lo que cuenta el budget initial de Angular), así que un aviso en ' +
|
|
256
|
+
`${warning} y un error en ${error} deja sitio para una funcionalidad y sigue parando un pipeline.`,
|
|
257
|
+
bootSummary: (files, screens) => `${files} ${files === 1 ? 'fichero, descargado' : 'ficheros, descargados'} antes de que aparezca nada · ${screens} ${screens === 1 ? 'pantalla' : 'pantallas'}`,
|
|
258
|
+
noScreens: 'No hay pantallas lazy: todo entra en el bootstrap.',
|
|
259
|
+
notScreens: parts => `Se cargan en diferido y no cuentan como pantallas: ${parts.join('; ')}.`,
|
|
260
|
+
notScreensPart: {
|
|
261
|
+
blocks: (count, list) => `${count} ${count === 1 ? 'bloque diferido' : 'bloques diferidos'} dentro de una pantalla (${list})`,
|
|
262
|
+
groupers: (count, list) => `${count} ${count === 1 ? 'fichero de rutas, que pagan las pantallas que hay detrás' : 'ficheros de rutas, que pagan las pantallas que hay detrás'} (${list})`,
|
|
263
|
+
packages: (count, list) => `${count} ${count === 1 ? 'paquete que se carga' : 'paquetes que se cargan'} cuando hace falta (${list})`,
|
|
264
|
+
data: (count, list) => `${count} ${count === 1 ? 'chunk de datos' : 'chunks de datos'} (${list})`,
|
|
265
|
+
workers: (count, list) => `${count} web ${count === 1 ? 'worker' : 'workers'} (${list})`,
|
|
266
|
+
onDemand: (count, list) => `${count} ${count === 1 ? 'chunk tuyo que no abre' : 'chunks tuyos que no abre'} ninguna ruta: componentes, pestañas, ficheros de idioma (${list})`,
|
|
267
|
+
},
|
|
268
|
+
noRouteTable: 'No se ha encontrado una tabla de rutas en el código, así que cada chunk que se carga en diferido cuenta como pantalla: alguna puede ser una pestaña o un componente dentro de una página y no un sitio al que se navega.',
|
|
269
|
+
routeCss: (count, list) => `Las pantallas también cargan ${count === 1 ? 'una hoja de estilos propia' : `${count} hojas de estilos propias`} (${list}), que sus totales no cuentan: estas cifras son JavaScript.`,
|
|
270
|
+
fix: 'Qué hacer',
|
|
271
|
+
passed: 'No se ha superado ningún gate.',
|
|
272
|
+
failed: count => `${count} ${count === 1 ? 'gate superado' : 'gates superados'}.`,
|
|
273
|
+
noGates: 'No se ha pedido ningún gate: esta ejecución informa y nunca falla.',
|
|
274
|
+
overBoot: (actual, limit) => `El bootstrap es de ${actual} y el límite está en ${limit}.`,
|
|
275
|
+
overScreen: (screen, actual, limit) => `La pantalla ${screen} descarga ${actual} y el límite está en ${limit}.`,
|
|
276
|
+
screenLimitUnmatched: (name, screens) => `loadline.json: "gates.screens" tiene un límite para "${name}" y ninguna pantalla se llama así, así que no vigila nada. ` +
|
|
277
|
+
`Las pantallas son: ${screens.join(', ') || 'ninguna'}.`,
|
|
278
|
+
growthUnchecked: 'Los gates de crecimiento no pueden ejecutarse, y un gate que no se ejecuta pasaría.',
|
|
279
|
+
newPackageUnchecked: '--fail-on-new-package necesita algo que diga qué había antes: una --baseline, o una lista "packages" en loadline.json.',
|
|
280
|
+
configGrowthSkipped: 'loadline.json: los gates de crecimiento necesitan una --baseline y esta ejecución no tiene, así que no se han comprobado.',
|
|
281
|
+
configNewPackageSkipped: 'loadline.json: "gates.failOnNewPackage" necesita una --baseline o una lista "packages" y esta ejecución no tiene ninguna, así que no se ha comprobado.',
|
|
282
|
+
overOwn: (screen, actual, limit) => `El código propio de ${screen} es de ${actual} y el límite está en ${limit}.`,
|
|
283
|
+
growthBoot: (diff, limit) => `El bootstrap ha crecido ${diff} y el límite está en ${limit}.`,
|
|
284
|
+
growthScreen: (screen, diff, limit) => `La pantalla ${screen} ha crecido ${diff} y el límite está en ${limit}.`,
|
|
285
|
+
growthPctBoot: (percent, limit) => `El bootstrap ha crecido un ${percent} % y el límite está en el ${limit} %.`,
|
|
286
|
+
growthPctScreen: (screen, percent, limit) => `La pantalla ${screen} ha crecido un ${percent} % y el límite está en el ${limit} %.`,
|
|
287
|
+
signalsRaised: (count, level) => `${count} ${count === 1 ? 'señal' : 'señales'} de gravedad ${level === 'mid' ? 'media' : 'alta'} o superior.`,
|
|
288
|
+
signalRaised: (kind, count) => `Ha saltado la señal ${kind}${count === 1 ? '' : ` ${count} veces`}, y "gates.failOnSignals" falla con ella.`,
|
|
289
|
+
newPackages: names => `${names.length === 1 ? 'Ha entrado 1 paquete' : `Han entrado ${names.length} paquetes`} en el bootstrap: ${names.join(', ')}.`,
|
|
290
|
+
configRead: file => `umbrales y señales aceptadas desde ${file}`,
|
|
291
|
+
configProblem: (file, problem) => `${file}: ${problem}`,
|
|
292
|
+
accepted: (kind, why, who, until) => `${kind} — ${why}${who ? ` (${who})` : ''}${until ? `, hasta ${until}` : ', sin fecha de caducidad'}`,
|
|
293
|
+
acceptedExpired: (kind, until) => `${kind} se aceptó hasta ${until}. Esa fecha ya ha pasado, así que vuelve a salir.`,
|
|
294
|
+
acceptedGrew: (kind, was, now) => `${kind} se aceptó con ${was} y ahora son ${now}. Lo que se acordó no es lo que hay, así que vuelve a salir.`,
|
|
295
|
+
headAccepted: 'Aceptadas, y apartadas',
|
|
296
|
+
prFixed: count => `${count} resueltas`,
|
|
297
|
+
prNew: count => `${count} nuevas`,
|
|
298
|
+
prDetails: 'El informe entero',
|
|
299
|
+
prCut: '(recortado para caber en un comentario: --format text lo tiene entero)',
|
|
300
|
+
screenBudgetNote: (warning, file, size) => 'Y otro por fichero. «anyScript» aplica a cada script que emite el build —también a los del ' +
|
|
301
|
+
'arranque—, que es lo que lo hace usable cuando los nombres llevan hash y un budget por bundle no ' +
|
|
302
|
+
`puede nombrar nada. Por eso va por encima del script más grande de hoy, ${file} con ${size}, o ` +
|
|
303
|
+
`rompería el siguiente build por un fichero que nadie ha tocado — ${warning}:`,
|
|
304
|
+
headWhatIf: 'Y si se difiriera',
|
|
305
|
+
whatIfNote: 'El ahorro es exacto: se recorre el grafo sin esos ficheros, y lo que deja de alcanzarse es ' +
|
|
306
|
+
'lo que deja de descargarse. Lo que NO se recalcula es el troceado —qué ficheros acaban en ' +
|
|
307
|
+
'qué chunk lo decide el bundler, y simularlo daría idas y vueltas y totales por pantalla que ' +
|
|
308
|
+
'parecen medidos y no lo son—. Así que esos siguen igual arriba, y la última columna dice ' +
|
|
309
|
+
'quién lo pagaría en su lugar.',
|
|
310
|
+
whatIfNobody: 'no lo usa nada diferido',
|
|
311
|
+
whatIfEstimated: 'En cifras comprimidas son los bytes en crudo exactos a la proporción en que se comprime el ' +
|
|
312
|
+
'bootstrap: el tamaño correcto, no el exacto, y por eso el ≈.',
|
|
313
|
+
whatIfNotHere: format => `--what-if no forma parte del formato ${format}: vuelve a lanzarlo con --format text, summary, json o agent para ver la respuesta.`,
|
|
314
|
+
colWhatIf: 'Diferido',
|
|
315
|
+
headWhy: 'Por qué está aquí',
|
|
316
|
+
whyReach: {
|
|
317
|
+
boot: 'en la primera carga, por',
|
|
318
|
+
lazy: 'no está en la primera carga: ya llega detrás de un import(), por',
|
|
319
|
+
unreached: 'está en el build, y nada de lo que se alcanza desde la entrada lo importa',
|
|
320
|
+
absent: 'no está en este build: ningún paquete, carpeta ni fichero se llama así',
|
|
321
|
+
unknown: 'no se puede saber: sin source maps nada de dentro de un chunk tiene nombre',
|
|
322
|
+
unchained: 'está en la primera carga, y nada en este build dice qué fichero lo trae: una carpeta de build guarda qué chunk lleva qué, no qué fichero importa a cuál, y ninguna fuente del proyecto en sus maps lo nombra',
|
|
323
|
+
sourced: 'está en la primera carga. Una carpeta de build no guarda qué fichero importa a cuál, pero las fuentes de dentro de sus maps sí',
|
|
324
|
+
deferred: 'no está en la primera carga: llega después, con lo que lo pida',
|
|
325
|
+
},
|
|
326
|
+
whyCutSourced: (files, what, upTo) => `${files.length === 1 ? `${files[0]} lo importa` : `${files.length} ficheros tuyos de la primera carga lo importan — ${files.join(', ')}`}. ` +
|
|
327
|
+
`Un import() de ${what} ahí sacaría como mucho ${upTo} de la primera carga: lo que pesa en ella, y menos si parte llega también por otro camino.`,
|
|
328
|
+
whyCut: (file, what, saved, through, payers) => `${through ? `Llega a través de ${what}. ` : ''}Corta aquí: un import() de ${what} en ${file} sacaría ${saved} ` +
|
|
329
|
+
`de la primera carga${payers ? `, y ${payers.includes(',') ? 'lo pagarían' : 'lo pagaría'} ${payers}` : ''}.`,
|
|
330
|
+
whyCutAlso: (file, others, everywhere) => `Cortarlo solo en ${file} no ahorra nada: ${others.length === 1 ? `${others[0]} también lo importa` : `otros ${others.length} ficheros de la primera carga también lo importan — ${others.join(', ')}`}. ` +
|
|
331
|
+
`Un import() en todos ellos sacaría ${everywhere} de la primera carga.`,
|
|
332
|
+
whyCutShared: file => `Cortarlo solo en ${file} no ahorra nada: también llega por otro camino. La cifra de --what-if dice cuánto, una vez cortados todos.`,
|
|
333
|
+
whyNoCut: 'Lo importa la propia entrada: el import() iría en el fichero de entrada.',
|
|
334
|
+
whyNotHere: format => `--why no forma parte del formato ${format}: vuelve a lanzarlo con --format text, json o agent para ver la respuesta.`,
|
|
335
|
+
whatIfUnknown: 'no se puede medir',
|
|
336
|
+
whatIfAbsent: 'no está en este build',
|
|
337
|
+
whatIfUnknownWhy: 'Donde dice «no se puede medir»: una carpeta de build guarda qué chunk lleva qué y no qué fichero importa a cuál, así que no se puede recorrer qué dejaría de descargarse. La columna del tamaño es lo máximo que podría ser; el stats.json del build, o la página con él, da la cifra exacta.',
|
|
338
|
+
savingUnknown: 'Aquí «—» quiere decir «no se sabe», no «nada»: sin source maps no se puede medir ningún ahorro.',
|
|
339
|
+
colSize: 'En el bootstrap',
|
|
340
|
+
colAfter: 'Bootstrap después',
|
|
341
|
+
colWhoPays: 'Lo pagaría',
|
|
342
|
+
};
|
|
343
|
+
exports.CLI_TEXT = { es: ES, en: EN };
|