@madojs/mado 0.11.1 → 0.13.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/AGENTS.md +116 -32
- package/CHANGELOG.md +216 -1
- package/README.md +158 -173
- package/dist/src/component.d.ts +6 -3
- package/dist/src/component.d.ts.map +1 -0
- package/dist/src/component.js +163 -36
- package/dist/src/component.js.map +1 -1
- package/dist/src/context.d.ts +13 -32
- package/dist/src/context.d.ts.map +1 -0
- package/dist/src/context.js +73 -48
- package/dist/src/context.js.map +1 -1
- package/dist/src/css.d.ts +1 -0
- package/dist/src/css.d.ts.map +1 -0
- package/dist/src/css.js +34 -5
- package/dist/src/css.js.map +1 -1
- package/dist/src/devtools-hook.d.ts +14 -0
- package/dist/src/devtools-hook.d.ts.map +1 -0
- package/dist/src/devtools-hook.js +27 -0
- package/dist/src/devtools-hook.js.map +1 -0
- package/dist/src/devtools.d.ts +24 -22
- package/dist/src/devtools.d.ts.map +1 -0
- package/dist/src/devtools.js +230 -58
- package/dist/src/devtools.js.map +1 -1
- package/dist/src/diagnostics.d.ts +12 -0
- package/dist/src/diagnostics.d.ts.map +1 -0
- package/dist/src/diagnostics.js +68 -8
- package/dist/src/diagnostics.js.map +1 -1
- package/dist/src/each.d.ts +1 -5
- package/dist/src/each.d.ts.map +1 -0
- package/dist/src/each.js +0 -8
- package/dist/src/each.js.map +1 -1
- package/dist/src/forms.d.ts +27 -96
- package/dist/src/forms.d.ts.map +1 -0
- package/dist/src/forms.js +184 -394
- package/dist/src/forms.js.map +1 -1
- package/dist/src/head.d.ts +7 -6
- package/dist/src/head.d.ts.map +1 -0
- package/dist/src/head.js +8 -7
- package/dist/src/head.js.map +1 -1
- package/dist/src/html/bindings.d.ts +1 -0
- package/dist/src/html/bindings.d.ts.map +1 -0
- package/dist/src/html/bindings.js.map +1 -1
- package/dist/src/html/parser.d.ts +4 -5
- package/dist/src/html/parser.d.ts.map +1 -0
- package/dist/src/html/parser.js +64 -15
- package/dist/src/html/parser.js.map +1 -1
- package/dist/src/html/template-types.d.ts +1 -0
- package/dist/src/html/template-types.d.ts.map +1 -0
- package/dist/src/html/template-types.js.map +1 -1
- package/dist/src/html/template.d.ts +5 -1
- package/dist/src/html/template.d.ts.map +1 -0
- package/dist/src/html/template.js +102 -13
- package/dist/src/html/template.js.map +1 -1
- package/dist/src/index.d.ts +15 -12
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +18 -10
- package/dist/src/index.js.map +1 -1
- package/dist/src/json.d.ts +3 -0
- package/dist/src/json.d.ts.map +1 -0
- package/dist/src/json.js +14 -0
- package/dist/src/json.js.map +1 -0
- package/dist/src/lifecycle.d.ts +1 -0
- package/dist/src/lifecycle.d.ts.map +1 -0
- package/dist/src/lifecycle.js +3 -2
- package/dist/src/lifecycle.js.map +1 -1
- package/dist/src/page.d.ts +63 -28
- package/dist/src/page.d.ts.map +1 -0
- package/dist/src/page.js +5 -0
- package/dist/src/page.js.map +1 -1
- package/dist/src/persisted.d.ts +6 -1
- package/dist/src/persisted.d.ts.map +1 -0
- package/dist/src/persisted.js +17 -11
- package/dist/src/persisted.js.map +1 -1
- package/dist/src/resource.d.ts +2 -1
- package/dist/src/resource.d.ts.map +1 -0
- package/dist/src/resource.js +128 -50
- package/dist/src/resource.js.map +1 -1
- package/dist/src/router/base.d.ts +66 -0
- package/dist/src/router/base.d.ts.map +1 -0
- package/dist/src/router/base.js +168 -0
- package/dist/src/router/base.js.map +1 -0
- package/dist/src/router/manifest.d.ts +1 -0
- package/dist/src/router/manifest.d.ts.map +1 -0
- package/dist/src/router/manifest.js +156 -171
- package/dist/src/router/manifest.js.map +1 -1
- package/dist/src/router/match.d.ts +17 -2
- package/dist/src/router/match.d.ts.map +1 -0
- package/dist/src/router/match.js +60 -6
- package/dist/src/router/match.js.map +1 -1
- package/dist/src/router/navigation.d.ts +1 -0
- package/dist/src/router/navigation.d.ts.map +1 -0
- package/dist/src/router/navigation.js +58 -9
- package/dist/src/router/navigation.js.map +1 -1
- package/dist/src/signal.d.ts +1 -0
- package/dist/src/signal.d.ts.map +1 -0
- package/dist/src/signal.js +46 -17
- package/dist/src/signal.js.map +1 -1
- package/dist/src/static-runtime.d.ts +82 -0
- package/dist/src/static-runtime.d.ts.map +1 -0
- package/dist/src/static-runtime.js +209 -0
- package/dist/src/static-runtime.js.map +1 -0
- package/dist/src/vite/index.d.ts +32 -3
- package/dist/src/vite/index.d.ts.map +1 -0
- package/dist/src/vite/index.js +49 -17
- package/dist/src/vite/index.js.map +1 -1
- package/docs/README.md +5 -8
- package/docs/architecture/adr/0001-browser-static-snapshots.md +132 -0
- package/docs/architecture/v1-roadmap.md +19 -0
- package/docs/en/00-the-mado-way.md +1 -1
- package/docs/en/01-quickstart.md +183 -0
- package/docs/en/10-pages-and-components.md +279 -0
- package/docs/en/11-templates-and-signals.md +211 -0
- package/docs/en/12-routing.md +229 -0
- package/docs/en/13-data.md +227 -0
- package/docs/en/14-forms.md +91 -0
- package/docs/en/15-static-snapshots.md +181 -0
- package/docs/en/{10-app-architecture.md → 16-app-architecture.md} +56 -4
- package/docs/en/{13-deployment.md → 20-deployment.md} +79 -17
- package/docs/en/{15-error-handling.md → 21-error-handling.md} +9 -6
- package/docs/en/{14-testing.md → 22-testing.md} +6 -5
- package/docs/en/23-cookbook.md +292 -0
- package/docs/en/24-devtools-and-diagnostics.md +45 -0
- package/docs/en/{18-api-freeze-map.md → 30-api-freeze-map.md} +17 -9
- package/docs/en/{20-v1-stability.md → 32-v1-stability.md} +5 -5
- package/docs/en/33-migration-0.12-0.13.md +56 -0
- package/docs/en/40-llm-guide.md +774 -0
- package/docs/en/{06-for-backenders.md → 41-for-backenders.md} +28 -25
- package/docs/en/{05-why-mado.md → 42-why-mado.md} +3 -3
- package/docs/en/README.md +99 -27
- package/docs/recipes/nginx/Containerfile +26 -0
- package/docs/recipes/nginx/nginx.conf +42 -0
- package/llms.txt +263 -210
- package/package.json +51 -23
- package/scripts/clean.mjs +8 -0
- package/scripts/cli/generate.mjs +57 -10
- package/scripts/cli/help.mjs +13 -5
- package/scripts/cli/index.mjs +31 -7
- package/scripts/cli/init.mjs +19 -19
- package/scripts/cli/release.mjs +38 -83
- package/scripts/cli/run.mjs +5 -3
- package/scripts/logger.mjs +117 -0
- package/scripts/output-guard.mjs +128 -0
- package/scripts/preview.mjs +105 -24
- package/scripts/static/browser.mjs +695 -0
- package/scripts/static/discover.mjs +284 -0
- package/scripts/static/output.mjs +141 -0
- package/scripts/static/serialize.mjs +212 -0
- package/scripts/static/server.mjs +167 -0
- package/scripts/static.mjs +205 -0
- package/starters/default/README.md +57 -55
- package/starters/default/package.json +6 -12
- package/starters/default/src/app.routes.ts +20 -33
- package/starters/default/src/components/feature-card.component.ts +40 -0
- package/starters/default/src/components/live-counter.component.ts +57 -0
- package/starters/default/src/content/guides.ts +55 -0
- package/starters/default/src/main.ts +9 -13
- package/starters/default/src/pages/app.page.ts +41 -0
- package/starters/default/src/pages/guide.page.ts +40 -0
- package/starters/default/src/pages/home.page.ts +49 -0
- package/starters/default/src/pages/not-found.page.ts +18 -0
- package/starters/default/src/styles/document.css +39 -0
- package/starters/default/src/styles/reset.css +37 -0
- package/starters/default/src/styles/tokens.css +30 -0
- package/starters/default/src/styles.d.ts +3 -1
- package/starters/default/src/vite-env.d.ts +1 -1
- package/starters/default/tsconfig.node.json +13 -0
- package/starters/default/vite.config.ts +14 -4
- package/starters/modular/README.md +142 -0
- package/starters/modular/index.html +13 -0
- package/starters/modular/package.json +30 -0
- package/starters/modular/src/app.routes.ts +39 -0
- package/starters/{default → modular}/src/layouts/app-shell.layout.ts +9 -7
- package/starters/{default → modular}/src/layouts/auth-shell.layout.ts +3 -3
- package/starters/modular/src/main.ts +16 -0
- package/starters/{default → modular}/src/modules/auth/login.page.ts +5 -12
- package/starters/{default → modular}/src/modules/billing/pages/invoice-detail.page.ts +3 -4
- package/starters/{default → modular}/src/modules/billing/pages/invoices-list.page.ts +4 -4
- package/starters/{default → modular}/src/modules/home/home.page.ts +5 -7
- package/starters/modular/src/modules/home/not-found.page.ts +14 -0
- package/starters/{default → modular}/src/shared/styles/reset.css +21 -1
- package/starters/modular/src/styles.d.ts +1 -0
- package/starters/modular/src/vite-env.d.ts +1 -0
- package/starters/modular/tsconfig.json +33 -0
- package/starters/modular/tsconfig.node.json +13 -0
- package/starters/modular/vite.config.ts +132 -0
- package/TODO.md +0 -79
- package/dist/src/lazy.d.ts +0 -38
- package/dist/src/lazy.js +0 -73
- package/dist/src/lazy.js.map +0 -1
- package/docs/en/01-routing.md +0 -152
- package/docs/en/02-project-layout.md +0 -124
- package/docs/en/03-static-bake.md +0 -249
- package/docs/en/04-ide-setup.md +0 -162
- package/docs/en/07-llm-pitfalls.md +0 -724
- package/docs/en/08-llm-zero-history-test.md +0 -56
- package/docs/en/09-shadow-vs-light-dom.md +0 -174
- package/docs/en/11-layouts.md +0 -113
- package/docs/en/12-auth-and-api.md +0 -124
- package/docs/en/16-bake-cookbook.md +0 -100
- package/docs/en/17-shadow-dom-forms.md +0 -192
- package/docs/fr/00-the-mado-way.md +0 -85
- package/docs/fr/01-routing.md +0 -120
- package/docs/fr/02-project-layout.md +0 -84
- package/docs/fr/03-static-bake.md +0 -289
- package/docs/fr/04-ide-setup.md +0 -162
- package/docs/fr/05-why-mado.md +0 -193
- package/docs/fr/06-for-backenders.md +0 -438
- package/docs/fr/07-llm-pitfalls.md +0 -625
- package/docs/fr/08-llm-zero-history-test.md +0 -38
- package/docs/fr/09-shadow-vs-light-dom.md +0 -65
- package/docs/fr/10-app-architecture.md +0 -138
- package/docs/fr/11-layouts.md +0 -47
- package/docs/fr/12-auth-and-api.md +0 -76
- package/docs/fr/13-deployment.md +0 -57
- package/docs/fr/14-testing.md +0 -41
- package/docs/fr/15-error-handling.md +0 -50
- package/docs/fr/16-bake-cookbook.md +0 -88
- package/docs/fr/17-shadow-dom-forms.md +0 -196
- package/docs/fr/18-api-freeze-map.md +0 -63
- package/docs/fr/19-reactivity-ordering.md +0 -97
- package/docs/fr/20-v1-stability.md +0 -88
- package/docs/fr/README.md +0 -27
- package/docs/ru/00-the-mado-way.md +0 -84
- package/docs/ru/01-routing.md +0 -119
- package/docs/ru/02-project-layout.md +0 -84
- package/docs/ru/03-static-bake.md +0 -250
- package/docs/ru/04-ide-setup.md +0 -144
- package/docs/ru/05-why-mado.md +0 -193
- package/docs/ru/06-for-backenders.md +0 -428
- package/docs/ru/07-llm-pitfalls.md +0 -624
- package/docs/ru/08-llm-zero-history-test.md +0 -57
- package/docs/ru/09-shadow-vs-light-dom.md +0 -63
- package/docs/ru/10-app-architecture.md +0 -152
- package/docs/ru/11-layouts.md +0 -47
- package/docs/ru/12-auth-and-api.md +0 -75
- package/docs/ru/13-deployment.md +0 -66
- package/docs/ru/14-testing.md +0 -50
- package/docs/ru/15-error-handling.md +0 -56
- package/docs/ru/16-bake-cookbook.md +0 -95
- package/docs/ru/17-shadow-dom-forms.md +0 -193
- package/docs/ru/18-api-freeze-map.md +0 -64
- package/docs/ru/19-reactivity-ordering.md +0 -95
- package/docs/ru/20-v1-stability.md +0 -82
- package/docs/ru/README.md +0 -25
- package/docs/uk/00-the-mado-way.md +0 -82
- package/docs/uk/01-routing.md +0 -76
- package/docs/uk/02-project-layout.md +0 -73
- package/docs/uk/03-static-bake.md +0 -48
- package/docs/uk/04-ide-setup.md +0 -26
- package/docs/uk/05-why-mado.md +0 -34
- package/docs/uk/06-for-backenders.md +0 -55
- package/docs/uk/07-llm-pitfalls.md +0 -145
- package/docs/uk/08-llm-zero-history-test.md +0 -34
- package/docs/uk/09-shadow-vs-light-dom.md +0 -58
- package/docs/uk/10-app-architecture.md +0 -97
- package/docs/uk/11-layouts.md +0 -47
- package/docs/uk/12-auth-and-api.md +0 -70
- package/docs/uk/13-deployment.md +0 -40
- package/docs/uk/14-testing.md +0 -34
- package/docs/uk/15-error-handling.md +0 -32
- package/docs/uk/16-bake-cookbook.md +0 -36
- package/docs/uk/17-shadow-dom-forms.md +0 -193
- package/docs/uk/18-api-freeze-map.md +0 -61
- package/docs/uk/19-reactivity-ordering.md +0 -95
- package/docs/uk/20-v1-stability.md +0 -83
- package/docs/uk/README.md +0 -27
- package/scripts/bake.mjs +0 -570
- package/scripts/package-smoke.mjs +0 -77
- package/scripts/release-notes.mjs +0 -66
- package/scripts/size-budget.mjs +0 -91
- package/starters/default/src/modules/home/not-found.page.ts +0 -11
- package/starters/default/src/shared/ui/x-button.component.ts +0 -49
- /package/docs/en/{19-reactivity-ordering.md → 31-reactivity-ordering.md} +0 -0
- /package/starters/{default → modular}/.editorconfig +0 -0
- /package/starters/{default → modular}/eslint.config.mjs +0 -0
- /package/starters/{default → modular}/public/favicon.svg +0 -0
- /package/starters/{default → modular}/src/modules/auth/_contracts/auth-api.types.ts +0 -0
- /package/starters/{default → modular}/src/modules/auth/auth.connector.ts +0 -0
- /package/starters/{default → modular}/src/modules/auth/auth.guard.ts +0 -0
- /package/starters/{default → modular}/src/modules/auth/auth.public.ts +0 -0
- /package/starters/{default → modular}/src/modules/auth/auth.routes.ts +0 -0
- /package/starters/{default → modular}/src/modules/auth/auth.service.ts +0 -0
- /package/starters/{default → modular}/src/modules/auth/auth.types.ts +0 -0
- /package/starters/{default → modular}/src/modules/billing/_contracts/stripe.types.ts +0 -0
- /package/starters/{default → modular}/src/modules/billing/api/stripe.connector.ts +0 -0
- /package/starters/{default → modular}/src/modules/billing/billing.public.ts +0 -0
- /package/starters/{default → modular}/src/modules/billing/billing.routes.ts +0 -0
- /package/starters/{default → modular}/src/modules/billing/billing.types.ts +0 -0
- /package/starters/{default → modular}/src/modules/billing/components/invoice-status-badge.component.ts +0 -0
- /package/starters/{default → modular}/src/modules/billing/data/invoices.resource.ts +0 -0
- /package/starters/{default → modular}/src/shared/http/http-client.ts +0 -0
- /package/starters/{default → modular}/src/shared/http/http-error.ts +0 -0
- /package/starters/{default → modular}/src/shared/http/interceptors.ts +0 -0
- /package/starters/{default → modular}/src/shared/lib/format-date.ts +0 -0
- /package/starters/{default → modular}/src/shared/styles/content.css +0 -0
- /package/starters/{default → modular}/src/shared/styles/shell.css +0 -0
- /package/starters/{default → modular}/src/shared/styles/tokens.css +0 -0
- /package/starters/{default → modular}/src/shared/ui/x-spinner.component.ts +0 -0
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { execSync } from "node:child_process";
|
|
3
|
-
|
|
4
|
-
function sh(command) {
|
|
5
|
-
return execSync(command, { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
function safe(command) {
|
|
9
|
-
try {
|
|
10
|
-
return sh(command);
|
|
11
|
-
} catch {
|
|
12
|
-
return "";
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const tag = process.env.GITHUB_REF_NAME || safe("git describe --tags --exact-match") || "HEAD";
|
|
17
|
-
const previous = safe(`git describe --tags --abbrev=0 ${tag}^`);
|
|
18
|
-
const range = previous ? `${previous}..${tag}` : tag;
|
|
19
|
-
const log = safe(`git log --format=%s ${range}`);
|
|
20
|
-
|
|
21
|
-
const groups = [
|
|
22
|
-
["Features", /^feat(?:\(.+\))?:\s+(.+)/],
|
|
23
|
-
["Fixes", /^fix(?:\(.+\))?:\s+(.+)/],
|
|
24
|
-
["Documentation", /^docs(?:\(.+\))?:\s+(.+)/],
|
|
25
|
-
["Tests", /^test(?:\(.+\))?:\s+(.+)/],
|
|
26
|
-
["CI", /^ci(?:\(.+\))?:\s+(.+)/],
|
|
27
|
-
["Maintenance", /^(?:chore|refactor)(?:\(.+\))?:\s+(.+)/],
|
|
28
|
-
];
|
|
29
|
-
|
|
30
|
-
const notes = new Map(groups.map(([name]) => [name, []]));
|
|
31
|
-
const other = [];
|
|
32
|
-
|
|
33
|
-
for (const line of log.split("\n").map((item) => item.trim()).filter(Boolean)) {
|
|
34
|
-
let matched = false;
|
|
35
|
-
for (const [name, pattern] of groups) {
|
|
36
|
-
const match = line.match(pattern);
|
|
37
|
-
if (match) {
|
|
38
|
-
notes.get(name).push(match[1]);
|
|
39
|
-
matched = true;
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
if (!matched) other.push(line);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
console.log(`# ${tag}`);
|
|
47
|
-
console.log("");
|
|
48
|
-
if (previous) console.log(`Changes since ${previous}.`);
|
|
49
|
-
else console.log("First public release.");
|
|
50
|
-
console.log("");
|
|
51
|
-
|
|
52
|
-
for (const [name] of groups) {
|
|
53
|
-
const items = notes.get(name);
|
|
54
|
-
if (!items.length) continue;
|
|
55
|
-
console.log(`## ${name}`);
|
|
56
|
-
console.log("");
|
|
57
|
-
for (const item of items) console.log(`- ${item}`);
|
|
58
|
-
console.log("");
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (other.length) {
|
|
62
|
-
console.log("## Other");
|
|
63
|
-
console.log("");
|
|
64
|
-
for (const item of other) console.log(`- ${item}`);
|
|
65
|
-
console.log("");
|
|
66
|
-
}
|
package/scripts/size-budget.mjs
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { build } from "esbuild";
|
|
4
|
-
import { mkdtemp, readdir, readFile, rm } from "node:fs/promises";
|
|
5
|
-
import { tmpdir } from "node:os";
|
|
6
|
-
import { join } from "node:path";
|
|
7
|
-
import { gzipSync } from "node:zlib";
|
|
8
|
-
|
|
9
|
-
const API_ENTRY = "src/index.ts";
|
|
10
|
-
const SAMPLE_ENTRY = "starters/default/src/main.ts";
|
|
11
|
-
const API_GZIP_LIMIT = readLimit("MADO_SIZE_API_GZIP_LIMIT", 16 * 1024);
|
|
12
|
-
const SAMPLE_GZIP_LIMIT = readLimit("MADO_SIZE_SAMPLE_GZIP_LIMIT", 42 * 1024);
|
|
13
|
-
|
|
14
|
-
let failed = false;
|
|
15
|
-
|
|
16
|
-
const api = await bundlePublicApi();
|
|
17
|
-
report("public API", api.gzip, API_GZIP_LIMIT);
|
|
18
|
-
|
|
19
|
-
const sample = await bundleSampleApp();
|
|
20
|
-
report("starter app", sample.gzip, SAMPLE_GZIP_LIMIT);
|
|
21
|
-
|
|
22
|
-
if (failed) process.exit(1);
|
|
23
|
-
|
|
24
|
-
async function bundlePublicApi() {
|
|
25
|
-
const result = await build({
|
|
26
|
-
entryPoints: [API_ENTRY],
|
|
27
|
-
bundle: true,
|
|
28
|
-
minify: true,
|
|
29
|
-
format: "esm",
|
|
30
|
-
target: "es2022",
|
|
31
|
-
platform: "browser",
|
|
32
|
-
legalComments: "none",
|
|
33
|
-
write: false,
|
|
34
|
-
});
|
|
35
|
-
const js = result.outputFiles[0]?.contents;
|
|
36
|
-
if (!js) throw new Error("[size] esbuild produced no public API output");
|
|
37
|
-
return { gzip: gzipSync(js, { level: 9 }).length };
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
async function bundleSampleApp() {
|
|
41
|
-
const outdir = await mkdtemp(join(tmpdir(), "mado-size-"));
|
|
42
|
-
try {
|
|
43
|
-
await build({
|
|
44
|
-
entryPoints: [SAMPLE_ENTRY],
|
|
45
|
-
bundle: true,
|
|
46
|
-
minify: true,
|
|
47
|
-
format: "esm",
|
|
48
|
-
target: "es2022",
|
|
49
|
-
platform: "browser",
|
|
50
|
-
splitting: true,
|
|
51
|
-
outdir,
|
|
52
|
-
alias: {
|
|
53
|
-
"@madojs/mado": "./src/index.ts",
|
|
54
|
-
},
|
|
55
|
-
legalComments: "none",
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
let gzip = 0;
|
|
59
|
-
for (const file of await readdir(outdir)) {
|
|
60
|
-
if (!file.endsWith(".js")) continue;
|
|
61
|
-
const js = await readFile(join(outdir, file));
|
|
62
|
-
gzip += gzipSync(js, { level: 9 }).length;
|
|
63
|
-
}
|
|
64
|
-
return { gzip };
|
|
65
|
-
} finally {
|
|
66
|
-
await rm(outdir, { recursive: true, force: true });
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function report(label, actual, limit) {
|
|
71
|
-
const ok = actual < limit;
|
|
72
|
-
const mark = ok ? "ok" : "FAIL";
|
|
73
|
-
console.log(
|
|
74
|
-
`[size] ${label.padEnd(12)} ${mark} ${kib(actual)} KiB gzip < ${kib(limit)} KiB`,
|
|
75
|
-
);
|
|
76
|
-
if (!ok) failed = true;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function readLimit(name, fallback) {
|
|
80
|
-
const raw = process.env[name];
|
|
81
|
-
if (!raw) return fallback;
|
|
82
|
-
const n = Number(raw);
|
|
83
|
-
if (!Number.isFinite(n) || n <= 0) {
|
|
84
|
-
throw new Error(`[size] ${name} must be a positive byte count`);
|
|
85
|
-
}
|
|
86
|
-
return n;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function kib(bytes) {
|
|
90
|
-
return (bytes / 1024).toFixed(2);
|
|
91
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// Reusable UI brick. Pure presentation: no business state, no signals
|
|
2
|
-
// reaching out to services. Token-driven look, themable via tokens.css.
|
|
3
|
-
//
|
|
4
|
-
// Reactive attributes via ctx.attr(name, default?) — no MutationObserver
|
|
5
|
-
// boilerplate.
|
|
6
|
-
|
|
7
|
-
import { component, css, html } from "@madojs/mado";
|
|
8
|
-
|
|
9
|
-
component(
|
|
10
|
-
"x-button",
|
|
11
|
-
({ attr }) => {
|
|
12
|
-
const variant = attr("variant", "primary"); // "primary" | "ghost"
|
|
13
|
-
const disabled = attr("disabled", "false");
|
|
14
|
-
return () => html`
|
|
15
|
-
<button
|
|
16
|
-
class=${() => `btn btn--${variant()}`}
|
|
17
|
-
?disabled=${() => disabled() !== "false"}
|
|
18
|
-
>
|
|
19
|
-
<slot></slot>
|
|
20
|
-
</button>
|
|
21
|
-
`;
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
styles: css`
|
|
25
|
-
:host {
|
|
26
|
-
display: inline-block;
|
|
27
|
-
}
|
|
28
|
-
.btn {
|
|
29
|
-
padding: var(--space-2) var(--space-4);
|
|
30
|
-
border-radius: var(--radius-md);
|
|
31
|
-
border: 1px solid transparent;
|
|
32
|
-
cursor: pointer;
|
|
33
|
-
}
|
|
34
|
-
.btn--primary {
|
|
35
|
-
background: var(--color-primary);
|
|
36
|
-
color: var(--color-primary-contrast);
|
|
37
|
-
}
|
|
38
|
-
.btn--ghost {
|
|
39
|
-
background: transparent;
|
|
40
|
-
border-color: var(--color-border);
|
|
41
|
-
color: var(--color-text);
|
|
42
|
-
}
|
|
43
|
-
.btn[disabled] {
|
|
44
|
-
opacity: 0.55;
|
|
45
|
-
cursor: not-allowed;
|
|
46
|
-
}
|
|
47
|
-
`,
|
|
48
|
-
},
|
|
49
|
-
);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|