@bymaksym/loadline 0.1.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.
Files changed (115) hide show
  1. package/README.md +272 -45
  2. package/dist/cli/cli/args.js +97 -116
  3. package/dist/cli/cli/gates.js +80 -14
  4. package/dist/cli/cli/main.js +275 -31
  5. package/dist/cli/cli/memory.js +114 -0
  6. package/dist/cli/cli/read/declared.js +52 -0
  7. package/dist/cli/cli/read/locate.js +214 -0
  8. package/dist/cli/cli/{read-build.js → read/read-build.js} +156 -87
  9. package/dist/cli/cli/read/read-config.js +120 -0
  10. package/dist/cli/cli/render/html-report.js +111 -0
  11. package/dist/cli/cli/render/render-agent.js +114 -0
  12. package/dist/cli/cli/render/render-asked.js +104 -0
  13. package/dist/cli/cli/render/render-badge.js +140 -0
  14. package/dist/cli/cli/{render-json.js → render/render-json.js} +26 -10
  15. package/dist/cli/cli/{render-markdown.js → render/render-markdown.js} +6 -6
  16. package/dist/cli/cli/{render-pr.js → render/render-pr.js} +37 -15
  17. package/dist/cli/cli/{render-sarif.js → render/render-sarif.js} +11 -6
  18. package/dist/cli/cli/{render-text.js → render/render-text.js} +169 -127
  19. package/dist/cli/cli/render/terminal.js +55 -0
  20. package/dist/cli/cli/report.js +76 -29
  21. package/dist/cli/cli/self-check.js +19 -23
  22. package/dist/cli/cli/since-last.js +45 -0
  23. package/dist/cli/cli/text/text-errors.js +124 -0
  24. package/dist/cli/cli/text/text.js +343 -0
  25. package/dist/cli/cli/text/usage.js +240 -0
  26. package/dist/cli/src/app/core/analysis/analysis.js +68 -24
  27. package/dist/cli/src/app/core/analysis/{barrels.js → graph/barrels.js} +10 -3
  28. package/dist/cli/src/app/core/analysis/{blast.js → graph/blast.js} +56 -17
  29. package/dist/cli/src/app/core/analysis/{cycles.js → graph/cycles.js} +1 -1
  30. package/dist/cli/src/app/core/analysis/{importers.js → graph/importers.js} +1 -1
  31. package/dist/cli/src/app/core/analysis/{insights.js → graph/insights.js} +10 -4
  32. package/dist/cli/src/app/core/analysis/invariant.js +1 -1
  33. package/dist/cli/src/app/core/analysis/metafile.types.js +21 -7
  34. package/dist/cli/src/app/core/analysis/{delivery.js → screens/delivery.js} +1 -1
  35. package/dist/cli/src/app/core/analysis/{entries.js → screens/entries.js} +87 -11
  36. package/dist/cli/src/app/core/analysis/screens/marks.js +32 -0
  37. package/dist/cli/src/app/core/analysis/screens/route-files.js +116 -0
  38. package/dist/cli/src/app/core/analysis/{sourcemap.js → sourcemap/sourcemap.js} +106 -7
  39. package/dist/cli/src/app/core/analysis/{split-drift.js → sourcemap/split-drift.js} +13 -7
  40. package/dist/cli/src/app/core/analysis/tool.js +83 -0
  41. package/dist/cli/src/app/core/assets/assets.js +137 -16
  42. package/dist/cli/src/app/core/baseline/baseline.js +0 -0
  43. package/dist/cli/src/app/core/{intake → build-text}/index-html.js +234 -29
  44. package/dist/cli/src/app/core/build-text/route-table.js +178 -0
  45. package/dist/cli/src/app/core/build-text/tool-marks.js +54 -0
  46. package/dist/cli/src/app/core/caching/caching.js +123 -45
  47. package/dist/cli/src/app/core/caching/from-analysis.js +20 -4
  48. package/dist/cli/src/app/core/config/config-text.js +90 -0
  49. package/dist/cli/src/app/core/config/config-values.js +358 -0
  50. package/dist/cli/src/app/core/config/loadline-config.js +81 -16
  51. package/dist/cli/src/app/core/config/merge-config.js +98 -0
  52. package/dist/cli/src/app/core/deps/deps.js +141 -23
  53. package/dist/cli/src/app/core/deps/pins.js +63 -0
  54. package/dist/cli/src/app/core/export/summary.js +54 -12
  55. package/dist/cli/src/app/core/findings/actions.js +65 -6
  56. package/dist/cli/src/app/core/findings/bundle/boot-single.js +76 -0
  57. package/dist/cli/src/app/core/findings/bundle/dupes.js +68 -0
  58. package/dist/cli/src/app/core/findings/{graph.js → bundle/graph.js} +32 -20
  59. package/dist/cli/src/app/core/findings/{own-in-boot.js → bundle/own-in-boot.js} +9 -5
  60. package/dist/cli/src/app/core/findings/{requests.js → bundle/requests.js} +3 -3
  61. package/dist/cli/src/app/core/findings/{shipped.js → bundle/shipped.js} +30 -18
  62. package/dist/cli/src/app/core/findings/compose.js +6 -1
  63. package/dist/cli/src/app/core/findings/effort.js +4 -0
  64. package/dist/cli/src/app/core/findings/finding.types.js +2 -0
  65. package/dist/cli/src/app/core/findings/findings.js +68 -55
  66. package/dist/cli/src/app/core/findings/{assets.js → folder/assets.js} +65 -16
  67. package/dist/cli/src/app/core/findings/{caching.js → folder/caching.js} +17 -10
  68. package/dist/cli/src/app/core/findings/{page.js → folder/page.js} +6 -2
  69. package/dist/cli/src/app/core/findings/{scan.js → folder/scan.js} +37 -13
  70. package/dist/cli/src/app/core/findings/kind-names.js +163 -0
  71. package/dist/cli/src/app/core/findings/{deps.js → supplied/deps.js} +13 -8
  72. package/dist/cli/src/app/core/findings/supplied/forbidden.js +71 -0
  73. package/dist/cli/src/app/core/findings/{situation.js → supplied/situation.js} +2 -2
  74. package/dist/cli/src/app/core/findings/text/causes.js +39 -0
  75. package/dist/cli/src/app/core/findings/text/finding-html.js +33 -0
  76. package/dist/cli/src/app/core/findings/{finding-text.js → text/finding-text.js} +307 -103
  77. package/dist/cli/src/app/core/findings/text/tool-advice.js +97 -0
  78. package/dist/cli/src/app/core/format/format.utils.js +172 -18
  79. package/dist/cli/src/app/core/format/ownership.js +93 -0
  80. package/dist/cli/src/app/core/i18n/en.js +180 -61
  81. package/dist/cli/src/app/core/i18n/es.js +192 -68
  82. package/dist/cli/src/app/core/intake/bundle-graph.js +285 -46
  83. package/dist/cli/src/app/core/intake/dist-files.js +87 -16
  84. package/dist/cli/src/app/core/intake/embedded.js +56 -0
  85. package/dist/cli/src/app/core/intake/unreached.js +139 -0
  86. package/dist/cli/src/app/core/intake/webpack-modules.js +185 -0
  87. package/dist/cli/src/app/core/intake/webpack-stats.js +298 -0
  88. package/dist/cli/src/app/core/project/budget-advice.js +14 -10
  89. package/dist/cli/src/app/core/project/project-context.js +89 -19
  90. package/dist/cli/src/app/core/project/project-name.js +36 -0
  91. package/dist/cli/src/app/core/scan/scan.js +116 -39
  92. package/dist/cli/src/app/core/scan/secrets.js +0 -0
  93. package/dist/cli/src/app/core/situation/situation-text.js +23 -0
  94. package/dist/cli/src/app/core/situation/situation.js +9 -8
  95. package/dist/cli/src/app/core/timing/timing.js +5 -2
  96. package/dist/cli/src/app/core/whatif/defer.js +29 -4
  97. package/dist/cli/src/app/core/whatif/source-importers.js +58 -0
  98. package/dist/cli/src/app/core/whatif/why.js +102 -0
  99. package/dist/cli/src/app/state/report-messages.utils.js +1 -4
  100. package/docs/CONFIG-REFERENCE.md +230 -0
  101. package/docs/CONFIG.md +511 -0
  102. package/docs/HOW-IT-WORKS.md +286 -25
  103. package/loadline.html +26 -24
  104. package/loadline.schema.json +1209 -0
  105. package/package.json +71 -35
  106. package/dist/cli/cli/text.js +0 -180
  107. package/dist/cli/src/app/core/findings/finding-html.js +0 -13
  108. /package/dist/cli/cli/{read-build.types.js → read/read-build.types.js} +0 -0
  109. /package/dist/cli/cli/{render-json.types.js → render/render-json.types.js} +0 -0
  110. /package/dist/cli/cli/{text.types.js → text/text.types.js} +0 -0
  111. /package/dist/cli/src/app/core/analysis/{exclusive.js → graph/exclusive.js} +0 -0
  112. /package/dist/cli/src/app/core/analysis/{insights.types.js → graph/insights.types.js} +0 -0
  113. /package/dist/cli/src/app/core/analysis/{module-graph.js → graph/module-graph.js} +0 -0
  114. /package/dist/cli/src/app/core/analysis/{sourcemap.types.js → sourcemap/sourcemap.types.js} +0 -0
  115. /package/dist/cli/src/app/core/findings/{finding-plain.js → text/finding-plain.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bymaksym/loadline",
3
- "version": "0.1.0",
3
+ "version": "1.1.0",
4
4
  "description": "Weight per screen: what each screen of your app actually downloads.",
5
5
  "keywords": [
6
6
  "bundle-size",
@@ -34,7 +34,10 @@
34
34
  "bin/",
35
35
  "dist/cli/",
36
36
  "loadline.html",
37
+ "loadline.schema.json",
37
38
  "docs/HOW-IT-WORKS.md",
39
+ "docs/CONFIG.md",
40
+ "docs/CONFIG-REFERENCE.md",
38
41
  "README.md",
39
42
  "LICENSE"
40
43
  ],
@@ -67,11 +70,12 @@
67
70
  },
68
71
  "lint-staged": {
69
72
  "*.ts": [
70
- "eslint --fix",
73
+ "eslint --config eslint.typed.config.js --fix",
71
74
  "prettier --write"
72
75
  ],
73
76
  "*.html": [
74
77
  "eslint --fix",
78
+ "html-validate",
75
79
  "prettier --write"
76
80
  ],
77
81
  "*.scss": [
@@ -80,43 +84,62 @@
80
84
  ],
81
85
  "*.{json,md,mjs,js}": [
82
86
  "prettier --write"
87
+ ],
88
+ "{*.md,src/app/core/i18n/*.ts,src/app/core/findings/text/finding-text.ts}": [
89
+ "cspell lint --no-progress --no-must-find-files"
83
90
  ]
84
91
  },
85
92
  "devDependencies": {
86
- "@angular/build": "^22.1.8",
87
- "@angular/cli": "^22.1.8",
88
- "@angular/common": "^22.1.6",
89
- "@angular/compiler": "^22.1.6",
90
- "@angular/compiler-cli": "^22.1.6",
91
- "@angular/core": "^22.1.6",
92
- "@angular/platform-browser": "^22.1.6",
93
- "@commitlint/cli": "^21.2.2",
94
- "@commitlint/config-conventional": "^21.2.2",
93
+ "@angular/build": "^22.2.1",
94
+ "@angular/cli": "^22.2.1",
95
+ "@angular/common": "^22.2.1",
96
+ "@angular/compiler": "^22.2.1",
97
+ "@angular/compiler-cli": "^22.2.1",
98
+ "@angular/core": "^22.2.1",
99
+ "@angular/platform-browser": "^22.2.1",
100
+ "@commitlint/cli": "^21.2.3",
101
+ "@commitlint/config-conventional": "^21.2.3",
102
+ "@cspell/dict-es-es": "^3.0.9",
103
+ "@eslint-community/eslint-plugin-eslint-comments": "^4.8.1",
95
104
  "@eslint/js": "^10.0.1",
96
- "@secretlint/secretlint-rule-preset-recommend": "^13.0.5",
97
- "@types/node": "^26.5.1",
105
+ "@secretlint/secretlint-rule-preset-recommend": "^13.0.7",
106
+ "@types/node": "^26.6.4",
107
+ "@vitest/eslint-plugin": "^1.6.27",
98
108
  "angular-eslint": "^22.5.0",
99
- "eslint": "^10.10.0",
109
+ "cspell": "^10.3.6",
110
+ "eslint": "^10.12.0",
100
111
  "eslint-config-prettier": "^10.1.8",
112
+ "eslint-import-resolver-typescript": "^4.4.5",
113
+ "eslint-plugin-angular-modern": "^1.9.0",
114
+ "eslint-plugin-baseline-js": "^0.7.4",
101
115
  "eslint-plugin-import-x": "^4.17.1",
116
+ "eslint-plugin-regexp": "^3.3.1",
102
117
  "eslint-plugin-simple-import-sort": "^14.0.0",
103
- "eslint-plugin-unicorn": "^74.0.0",
118
+ "eslint-plugin-unicorn": "^77.0.0",
104
119
  "eslint-plugin-unused-imports": "^4.4.1",
120
+ "html-validate": "^11.16.2",
121
+ "html-validate-angular": "^9.0.0",
105
122
  "husky": "^9.1.7",
106
- "jsdom": "^30.0.1",
107
- "knip": "^6.35.1",
108
- "lint-staged": "^17.5.1",
123
+ "jscpd": "^5.4.0",
124
+ "jsdom": "^30.1.2",
125
+ "knip": "^6.39.0",
126
+ "lint-staged": "^17.6.0",
109
127
  "npm-check-updates": "^23.1.0",
110
- "prettier": "^3.9.6",
128
+ "prettier": "^3.9.9",
111
129
  "rxjs": "~7.8.2",
112
- "secretlint": "^13.0.5",
113
- "stylelint": "^17.15.0",
130
+ "secretlint": "^13.0.7",
131
+ "stylelint": "^17.16.0",
114
132
  "stylelint-config-clean-order": "^10.0.0",
115
133
  "stylelint-config-standard-scss": "^17.0.0",
116
- "stylelint-scss": "^7.2.0",
134
+ "stylelint-declaration-block-no-ignored-properties": "^3.0.0",
135
+ "stylelint-declaration-strict-value": "^1.12.1",
136
+ "stylelint-high-performance-animation": "^2.0.0",
137
+ "stylelint-plugin-use-baseline": "^1.4.6",
138
+ "stylelint-scss": "^7.3.0",
139
+ "stylelint-value-no-unknown-custom-properties": "^6.1.1",
117
140
  "tslib": "^2.8.1",
118
141
  "typescript": "~6.0.3",
119
- "typescript-eslint": "^8.70.0",
142
+ "typescript-eslint": "^8.71.1",
120
143
  "vitest": "^4.1.11"
121
144
  },
122
145
  "scripts": {
@@ -134,21 +157,34 @@
134
157
  "format:check": "prettier --check .",
135
158
  "lint": "eslint --fix",
136
159
  "lint:ci": "eslint",
137
- "lint-styles:ci": "stylelint src/**/*.scss",
138
- "lint-styles:scope": "node scripts/check-styles.mjs",
139
- "lint-styles": "stylelint --fix src/**/*.scss",
140
- "fix-all": "pnpm run lint & pnpm run lint-styles & pnpm run format",
160
+ "lint:types": "eslint --config eslint.typed.config.js",
161
+ "lint:inspect": "pnpm dlx @eslint/config-inspector@3 --config eslint.typed.config.js",
162
+ "lint:config": "node tooling/check-eslint-config.mjs",
163
+ "config:check": "node tooling/check-config-found.mjs",
164
+ "lint:prettier": "eslint-config-prettier src/main.ts src/app/app.html cli/main.ts tooling/check.mjs",
165
+ "lint-styles:ci": "stylelint \"src/**/*.scss\"",
166
+ "lint-styles:scope": "node tooling/check-styles.mjs",
167
+ "lint:folders": "node tooling/check-folders.mjs",
168
+ "lint-styles": "stylelint --fix \"src/**/*.scss\"",
169
+ "fix-all": "node tooling/check.mjs --fix",
170
+ "check": "node tooling/check.mjs",
171
+ "check:all": "node tooling/check.mjs --all",
141
172
  "lint:all": "lint-staged",
142
- "typecheck": "tsc --noEmit --skipLibCheck --project tsconfig.app.json && tsc --noEmit --skipLibCheck --project tsconfig.cli.json && tsc --noEmit --skipLibCheck --project tsconfig.scripts.json",
143
- "knip": "knip",
144
- "knip:deps": "knip --include dependencies,unlisted,duplicates",
173
+ "typecheck": "tsc --noEmit --skipLibCheck --project tsconfig.app.json && tsc --noEmit --skipLibCheck --project tsconfig.cli.json && tsc --noEmit --skipLibCheck --project tsconfig.cli.spec.json && tsc --noEmit --skipLibCheck --project tsconfig.scripts.json",
174
+ "knip": "node tooling/knip.mjs",
175
+ "knip:deps": "node tooling/knip.mjs --include dependencies,unlisted,duplicates",
176
+ "a11y:audit": "html-validate \"src/**/*.html\"",
177
+ "spell:audit": "cspell lint --no-progress",
178
+ "i18n:audit": "node tooling/validate-i18n.mjs",
179
+ "duplicates:audit": "node tooling/validate-duplicates.mjs",
145
180
  "deps:check": "ncu",
146
181
  "deps:update": "ncu --interactive",
147
182
  "deps:update:deep": "pnpm update --depth 9999",
148
- "deps:audit": "pnpm audit",
149
- "deps:upgrade": "pnpm run deps:update && pnpm install && pnpm run deps:update:deep && pnpm dedupe && pnpm run fix-all && pnpm run typecheck && pnpm test && pnpm run self:check && pnpm run deps:audit && pnpm install",
150
- "secrets:scan": "secretlint --maskSecrets \"**/*\"",
151
- "self:check": "pnpm run build:ci && node scripts/inline-build.mjs && node bin/loadline.js dist/loadline-app/stats.json --dist dist/loadline-app/browser --self-check && node bin/loadline.js dist/loadline-app/stats.json --dist dist/loadline-app/browser --project . && node bin/loadline.js dist/loadline-app/browser --format summary",
152
- "loadline": "node bin/loadline.js"
183
+ "deps:audit": "pnpm audit --audit-level high",
184
+ "deps:upgrade": "pnpm run deps:update && pnpm install && pnpm run deps:update:deep && pnpm dedupe && (pnpm run fix-all || exit 0) && node tooling/check.mjs --all",
185
+ "secrets:scan": "secretlint --secretlintrc .config/secretlintrc.json --secretlintignore .config/secretlintignore --maskSecrets \"**/*\"",
186
+ "self:check": "pnpm run build:ci && node scripts/inline-build.mjs && node bin/loadline.js dist/loadline-app/browser-stats.json --dist dist/loadline-app/browser --self-check && node bin/loadline.js dist/loadline-app/browser-stats.json --dist dist/loadline-app/browser --project . && node bin/loadline.js dist/loadline-app/browser --format summary",
187
+ "loadline": "node bin/loadline.js",
188
+ "rounds": "node tooling/rounds/rounds.mjs"
153
189
  }
154
190
  }
@@ -1,180 +0,0 @@
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
- const EN = {
6
- lead: (stats, unit) => `${stats} · figures ${unit}`,
7
- against: (baseline, date) => `compared against ${baseline} (${date})`,
8
- pageCss: (size, files, total) => `Plus ${size} of CSS in ${files === 1 ? 'the stylesheet' : `${files} stylesheets`} the same page asks for, ` +
9
- `which block the paint and are not in the figure above: ${total} really comes down first. ` +
10
- 'This report breaks down JavaScript only.',
11
- firstTrip: (total, files, parts) => `The whole first trip is ${total} across ${files} ${files === 1 ? 'file' : 'files'} — ${parts} — ` +
12
- 'counting everything index.html asks for before anything appears. The figure above is the ' +
13
- 'JavaScript half, which is the half this report can break down.',
14
- serverLeftOut: count => `${count} output${count === 1 ? '' : 's'} of this build are not in the browser folder ` +
15
- '(the server side of a rendered build): left out, because nobody downloads them.',
16
- blocked: 'The baseline was measured in another unit: nothing is compared. Pass --dist, or --mode raw.',
17
- exactSplit: 'weight per file read from the source maps',
18
- headBoot: 'Bootstrap',
19
- headScreens: 'Screens',
20
- headSignals: 'Signals',
21
- headGates: 'Gates',
22
- headActions: 'What to fix first',
23
- headTime: 'Estimated time',
24
- headBudget: 'Suggested budget',
25
- actionsNote: 'An order over the signals below, not a selection: every one of them is still there.',
26
- colAction: 'Signal',
27
- colSaving: 'Off the first load',
28
- colEffort: 'Effort',
29
- effortLabel: {
30
- config: 'configuration',
31
- import: 'one import',
32
- refactor: 'refactor',
33
- none: '',
34
- },
35
- savingCell: saving => saving || '—',
36
- totalSaving: (bytes, after, count) => `Acting on all ${count} would take ${bytes} off the first load, leaving it at about ${after}. ` +
37
- 'The figures are raw minified bytes inside the chunk, and they are not added up: the graph is ' +
38
- 'walked once with every file named above taken out together, so bytes reachable two ways are ' +
39
- 'counted once.',
40
- nothingToSave: 'No signal here names a saving that can be measured.',
41
- profileName: { slow4g: 'slow 4G', fast4g: '4G', cable: 'cable' },
42
- timeNote: 'An estimate, not a measurement: a model over the bytes, the round trips and three standard ' +
43
- 'connection profiles. Transfer and latency go by what travels; parse and compile go by raw ' +
44
- 'bytes, because that is what the engine works on. Latency is editable in the criteria.',
45
- timeColumns: { profile: 'Connection', transfer: 'Transfer', latency: 'Latency', script: 'Parse', total: 'Total' },
46
- budgetNote: (warning, error, current) => `Nothing here writes a file. The initial load is ${current} raw (JavaScript and the CSS the page ` +
47
- `asks for, which is what Angular's initial budget counts), so a warning at ${warning} and an ` +
48
- `error at ${error} leaves room for a feature and still stops a pipeline.`,
49
- bootSummary: (files, screens) => `${files} ${files === 1 ? 'file' : 'files'}, downloaded before anything appears · ${screens} ${screens === 1 ? 'screen' : 'screens'}`,
50
- noScreens: 'No lazy screens: everything is in the bootstrap.',
51
- fix: 'Fix',
52
- passed: 'Every gate passed.',
53
- failed: count => `${count} ${count === 1 ? 'gate' : 'gates'} broken.`,
54
- noGates: 'No gate was asked for: this run reports and never fails.',
55
- overBoot: (actual, limit) => `Bootstrap is ${actual}, over the ${limit} allowed.`,
56
- overScreen: (screen, actual, limit) => `Screen ${screen} downloads ${actual}, over the ${limit} allowed.`,
57
- overOwn: (screen, actual, limit) => `Own code of ${screen} is ${actual}, over the ${limit} allowed.`,
58
- growthBoot: (diff, limit) => `Bootstrap grew ${diff}, over the ${limit} allowed.`,
59
- growthScreen: (screen, diff, limit) => `Screen ${screen} grew ${diff}, over the ${limit} allowed.`,
60
- growthPctBoot: (percent, limit) => `Bootstrap grew ${percent} %, over the ${limit} % allowed.`,
61
- growthPctScreen: (screen, percent, limit) => `Screen ${screen} grew ${percent} %, over the ${limit} % allowed.`,
62
- signalsRaised: (count, level) => `${count} ${count === 1 ? 'signal' : 'signals'} of severity ${level === 'mid' ? 'medium' : 'high'} or above.`,
63
- newPackages: names => `${names.length} ${names.length === 1 ? 'package has' : 'packages have'} entered the bootstrap: ${names.join(', ')}.`,
64
- configRead: file => `thresholds and accepted signals from ${file}`,
65
- configProblem: problem => `loadline.json: ${problem}`,
66
- accepted: (kind, why, who, until) => `${kind} — ${why}${who ? ` (${who})` : ''}${until ? `, until ${until}` : ', with no end date'}`,
67
- acceptedExpired: (kind, until) => `${kind} was accepted until ${until}. That date has passed, so it is raised again.`,
68
- 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.`,
69
- headAccepted: 'Accepted, and set aside',
70
- prFixed: count => `${count} fixed`,
71
- prNew: count => `${count} new`,
72
- prDetails: 'The whole report',
73
- screenBudgetNote: warning => 'And one for the screens. "anyScript" applies to every file the build emits, which is what ' +
74
- 'makes it usable when the names carry content hashes and a per-bundle budget cannot name ' +
75
- "anything. It is based on the heaviest screen's own code rather than the average, or it " +
76
- `fires on the screen that was already the largest the day it was written — ${warning}:`,
77
- headWhatIf: 'What if it were deferred',
78
- whatIfNote: 'The saving is exact: the graph is walked without those files, and what stops being ' +
79
- 'reachable is what stops being downloaded. What is NOT recomputed is the split — which ' +
80
- 'files end up in which chunk is the bundler’s decision, and a simulated one would produce ' +
81
- 'round trips and per-screen totals that look measured and are not. So those are unchanged ' +
82
- 'above, and the last column says who would be paying for it instead.',
83
- whatIfNobody: 'nothing lazy uses it',
84
- colWhatIf: 'Deferred',
85
- colSize: 'In the bootstrap',
86
- colAfter: 'Bootstrap after',
87
- colWhoPays: 'Would then be paid by',
88
- };
89
- const ES = {
90
- lead: (stats, unit) => `${stats} · cifras ${unit}`,
91
- against: (baseline, date) => `comparado con ${baseline} (${date})`,
92
- pageCss: (size, files, total) => `Más ${size} de CSS en ${files === 1 ? 'la hoja de estilos' : `${files} hojas de estilos`} que pide la misma ` +
93
- `página, que bloquean el pintado y no están en la cifra de arriba: ${total} es lo que baja de verdad antes ` +
94
- 'de nada. Este informe desglosa solo el JavaScript.',
95
- firstTrip: (total, files, parts) => `El primer viaje entero son ${total} en ${files} ${files === 1 ? 'fichero' : 'ficheros'} — ${parts} — ` +
96
- 'contando todo lo que pide index.html antes de que aparezca nada. La cifra de arriba es la ' +
97
- 'mitad de JavaScript, que es la que este informe sabe desglosar.',
98
- serverLeftOut: count => `${count} salida${count === 1 ? '' : 's'} de este build no ${count === 1 ? 'está' : 'están'} en la carpeta ` +
99
- 'del navegador (el lado servidor de un build con render): fuera, porque nadie las descarga.',
100
- blocked: 'La línea base se midió en otra unidad: no se compara nada. Pasa --dist, o bien --mode raw.',
101
- exactSplit: 'peso por fichero leído de los source maps',
102
- headBoot: 'Bootstrap',
103
- headScreens: 'Pantallas',
104
- headSignals: 'Señales',
105
- headGates: 'Gates',
106
- headActions: 'Qué arreglo primero',
107
- headTime: 'Tiempo estimado',
108
- headBudget: 'Budget sugerido',
109
- actionsNote: 'Es un orden sobre las señales de abajo, no una selección: todas siguen estando.',
110
- colAction: 'Señal',
111
- colSaving: 'Fuera de la primera carga',
112
- colEffort: 'Esfuerzo',
113
- effortLabel: {
114
- config: 'configuración',
115
- import: 'un import',
116
- refactor: 'refactor',
117
- none: '',
118
- },
119
- savingCell: saving => saving || '—',
120
- totalSaving: (bytes, after, count) => `Aplicando las ${count} se quitarían ${bytes} de la primera carga y quedaría en unos ${after}. ` +
121
- 'Las cifras son bytes minificados en crudo dentro del chunk, y no se suman: el grafo se recorre ' +
122
- 'una vez quitando de golpe todos los ficheros nombrados arriba, así que lo que se alcanza por dos ' +
123
- 'caminos se cuenta una vez.',
124
- nothingToSave: 'Ninguna señal de aquí nombra un ahorro que se pueda medir.',
125
- profileName: { slow4g: '4G lento', fast4g: '4G', cable: 'cable' },
126
- timeNote: 'Es una estimación, no una medición: un modelo sobre los bytes, las idas y vueltas y tres perfiles ' +
127
- 'de conexión estándar. La transferencia y la latencia van por lo que viaja; el parseo y la ' +
128
- 'compilación van por bytes en crudo, que es sobre lo que trabaja el motor. La latencia se edita ' +
129
- 'en los criterios.',
130
- timeColumns: {
131
- profile: 'Conexión',
132
- transfer: 'Transferencia',
133
- latency: 'Latencia',
134
- script: 'Parseo',
135
- total: 'Total',
136
- },
137
- budgetNote: (warning, error, current) => `Aquí no se escribe ningún fichero. La primera carga son ${current} en crudo (el JavaScript y el CSS ` +
138
- 'que pide la página, que es lo que cuenta el budget initial de Angular), así que un aviso en ' +
139
- `${warning} y un error en ${error} deja sitio para una funcionalidad y sigue parando un pipeline.`,
140
- bootSummary: (files, screens) => `${files} ${files === 1 ? 'fichero' : 'ficheros'}, descargados antes de que aparezca nada · ${screens} ${screens === 1 ? 'pantalla' : 'pantallas'}`,
141
- noScreens: 'No hay pantallas lazy: todo entra en el bootstrap.',
142
- fix: 'Qué hacer',
143
- passed: 'No se ha superado ningún gate.',
144
- failed: count => `${count} ${count === 1 ? 'gate superado' : 'gates superados'}.`,
145
- noGates: 'No se ha pedido ningún gate: esta ejecución informa y nunca falla.',
146
- overBoot: (actual, limit) => `El bootstrap es de ${actual} y el límite está en ${limit}.`,
147
- overScreen: (screen, actual, limit) => `La pantalla ${screen} descarga ${actual} y el límite está en ${limit}.`,
148
- overOwn: (screen, actual, limit) => `El código propio de ${screen} es de ${actual} y el límite está en ${limit}.`,
149
- growthBoot: (diff, limit) => `El bootstrap ha crecido ${diff} y el límite está en ${limit}.`,
150
- growthScreen: (screen, diff, limit) => `La pantalla ${screen} ha crecido ${diff} y el límite está en ${limit}.`,
151
- growthPctBoot: (percent, limit) => `El bootstrap ha crecido un ${percent} % y el límite está en el ${limit} %.`,
152
- growthPctScreen: (screen, percent, limit) => `La pantalla ${screen} ha crecido un ${percent} % y el límite está en el ${limit} %.`,
153
- signalsRaised: (count, level) => `${count} ${count === 1 ? 'señal' : 'señales'} de gravedad ${level === 'mid' ? 'media' : 'alta'} o superior.`,
154
- newPackages: names => `${names.length === 1 ? 'Ha entrado 1 paquete' : `Han entrado ${names.length} paquetes`} en el bootstrap: ${names.join(', ')}.`,
155
- configRead: file => `umbrales y señales aceptadas desde ${file}`,
156
- configProblem: problem => `loadline.json: ${problem}`,
157
- accepted: (kind, why, who, until) => `${kind} — ${why}${who ? ` (${who})` : ''}${until ? `, hasta ${until}` : ', sin fecha de caducidad'}`,
158
- acceptedExpired: (kind, until) => `${kind} se aceptó hasta ${until}. Esa fecha ya ha pasado, así que vuelve a salir.`,
159
- 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.`,
160
- headAccepted: 'Aceptadas, y apartadas',
161
- prFixed: count => `${count} resueltas`,
162
- prNew: count => `${count} nuevas`,
163
- prDetails: 'El informe entero',
164
- screenBudgetNote: warning => 'Y otro para las pantallas. «anyScript» aplica a cada fichero que emite el build, que es lo ' +
165
- 'que lo hace usable cuando los nombres llevan hash y un budget por bundle no puede nombrar ' +
166
- 'nada. Va sobre el código propio de la pantalla más pesada y no sobre la media, o saltaría ' +
167
- `con la que ya era la mayor el día que se escribió — ${warning}:`,
168
- headWhatIf: 'Y si se difiriera',
169
- whatIfNote: 'El ahorro es exacto: se recorre el grafo sin esos ficheros, y lo que deja de alcanzarse es ' +
170
- 'lo que deja de descargarse. Lo que NO se recalcula es el troceado —qué ficheros acaban en ' +
171
- 'qué chunk lo decide el bundler, y simularlo daría idas y vueltas y totales por pantalla que ' +
172
- 'parecen medidos y no lo son—. Así que esos siguen igual arriba, y la última columna dice ' +
173
- 'quién lo pagaría en su lugar.',
174
- whatIfNobody: 'no lo usa nada diferido',
175
- colWhatIf: 'Diferido',
176
- colSize: 'En el bootstrap',
177
- colAfter: 'Bootstrap después',
178
- colWhoPays: 'Lo pagaría',
179
- };
180
- exports.CLI_TEXT = { es: ES, en: EN };
@@ -1,13 +0,0 @@
1
- "use strict";
2
- /**
3
- * The two bits of markup every signal is written with. Signal text carries HTML on purpose: a file
4
- * name or a version number set apart from the sentence is what makes it findable at a glance.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.chainHtml = exports.mono = void 0;
8
- /** A name as code: a file, a package, a configuration key. */
9
- const mono = (text) => `<span class="mono">${text}</span>`;
10
- exports.mono = mono;
11
- /** An import chain as HTML: each step in monospace, joined by a separator. */
12
- const chainHtml = (steps) => steps.map(step => (0, exports.mono)(step)).join(' › ');
13
- exports.chainHtml = chainHtml;