@t09tanaka/stoneage 0.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 (47) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/LICENSE +21 -0
  3. package/README.md +768 -0
  4. package/dist/agent-skill.d.ts +1 -0
  5. package/dist/agent-skill.js +140 -0
  6. package/dist/assets.d.ts +125 -0
  7. package/dist/assets.js +341 -0
  8. package/dist/cli.d.ts +236 -0
  9. package/dist/cli.js +3077 -0
  10. package/dist/core.d.ts +473 -0
  11. package/dist/core.js +2897 -0
  12. package/dist/data.d.ts +121 -0
  13. package/dist/data.js +358 -0
  14. package/dist/deploy.d.ts +34 -0
  15. package/dist/deploy.js +203 -0
  16. package/dist/dev.d.ts +36 -0
  17. package/dist/dev.js +313 -0
  18. package/dist/example.d.ts +134 -0
  19. package/dist/example.js +1272 -0
  20. package/dist/fragment/client.d.ts +13 -0
  21. package/dist/fragment/client.js +150 -0
  22. package/dist/fragment.d.ts +15 -0
  23. package/dist/fragment.js +27 -0
  24. package/dist/html.d.ts +57 -0
  25. package/dist/html.js +208 -0
  26. package/dist/images.d.ts +95 -0
  27. package/dist/images.js +292 -0
  28. package/dist/index.d.ts +1 -0
  29. package/dist/index.js +1 -0
  30. package/dist/migration.d.ts +157 -0
  31. package/dist/migration.js +983 -0
  32. package/dist/optimize.d.ts +15 -0
  33. package/dist/optimize.js +215 -0
  34. package/dist/pagination.d.ts +26 -0
  35. package/dist/pagination.js +62 -0
  36. package/dist/paths.d.ts +1 -0
  37. package/dist/paths.js +10 -0
  38. package/dist/search.d.ts +32 -0
  39. package/dist/search.js +55 -0
  40. package/dist/testing.d.ts +66 -0
  41. package/dist/testing.js +97 -0
  42. package/dist/validate.d.ts +2 -0
  43. package/dist/validate.js +1 -0
  44. package/jsx-loader.mjs +52 -0
  45. package/jsx-register.mjs +7 -0
  46. package/package.json +135 -0
  47. package/tsconfig.base.json +16 -0
package/dist/cli.d.ts ADDED
@@ -0,0 +1,236 @@
1
+ #!/usr/bin/env node
2
+ import { type BuildConfig, type BuildReport, type DataFlowFamilySummary, type DataFlowReport, type DataFlowDependencySummary, type SizeBudgetConfig, type ValidationIssue } from "./core.js";
3
+ import { type ExampleBenchmark, type ExampleCounts } from "./example.js";
4
+ import { type DeployProvider } from "./deploy.js";
5
+ import { type ImageFormat } from "./images.js";
6
+ export type CliCommand = {
7
+ command: "help";
8
+ } | {
9
+ command: "benchmark";
10
+ outDir: string;
11
+ counts: Partial<ExampleCounts>;
12
+ trailingSlash?: BuildConfig["trailingSlash"];
13
+ includePublicDataExports?: boolean;
14
+ compareTo?: string;
15
+ maxSizeRegressionPercent?: number;
16
+ comparisonReportPath?: string;
17
+ } | {
18
+ command: "validate";
19
+ outDir: string;
20
+ budgets?: SizeBudgetConfig;
21
+ requirePrecompressed?: boolean;
22
+ validationConfigPath?: string;
23
+ writeValidationConfigPath?: string;
24
+ json?: boolean;
25
+ reportPath?: string;
26
+ provider?: DeployProvider;
27
+ } | {
28
+ command: "inspect";
29
+ outDir: string;
30
+ dependency: string;
31
+ json?: boolean;
32
+ } | {
33
+ command: "plan";
34
+ outDir: string;
35
+ dependencies: string[];
36
+ json?: boolean;
37
+ } | {
38
+ command: "optimize";
39
+ outDir: string;
40
+ } | {
41
+ command: "optimize-images";
42
+ outDir: string;
43
+ sourceDir: string;
44
+ widths: number[];
45
+ formats: ImageFormat[];
46
+ } | {
47
+ command: "deploy";
48
+ outDir: string;
49
+ provider: DeployProvider;
50
+ cname?: string;
51
+ } | {
52
+ command: "dev";
53
+ outDir: string;
54
+ host?: string;
55
+ port?: number;
56
+ watchPaths?: string[];
57
+ buildCommand?: string;
58
+ debounceMs?: number;
59
+ } | {
60
+ command: "agent-skill";
61
+ print: true;
62
+ } | {
63
+ command: "audit-sveltekit";
64
+ routesDir: string;
65
+ paramsDir?: string;
66
+ json?: boolean;
67
+ reportPath?: string;
68
+ migrationPlan?: boolean;
69
+ emitStubsDir?: string;
70
+ } | {
71
+ command: "build";
72
+ entry: string;
73
+ forwardedArgs: string[];
74
+ } | {
75
+ command: "test";
76
+ forwardedArgs: string[];
77
+ };
78
+ export type ValidationSummary = {
79
+ ok: boolean;
80
+ pageCount: number;
81
+ artifactCount: number;
82
+ publicAssetCount: number;
83
+ publicAssetsCopied: number;
84
+ publicAssetsSkipped: number;
85
+ staleOutputsRemoved: number;
86
+ publicFileCount: number;
87
+ publicFileBytes: number;
88
+ transferSidecars: TransferSidecarSummary;
89
+ stylesheetAssetCount: number;
90
+ stylesheetAssetBytes: number;
91
+ publicCssFileCount: number;
92
+ publicCssFileBytes: number;
93
+ publicJavaScriptFileCount: number;
94
+ publicJavaScriptFileBytes: number;
95
+ imageAssetCount: number;
96
+ imageAssetBytes: number;
97
+ missingLinks: string[];
98
+ sitemapUrls: number;
99
+ sitemapFiles: string[];
100
+ sitemapFileIssues: ValidationIssue[];
101
+ publicDataExports: number;
102
+ publicDataExportIssues: ValidationIssue[];
103
+ headersManifestIssues: ValidationIssue[];
104
+ redirectManifestIssues: ValidationIssue[];
105
+ robotsTxtIssues: ValidationIssue[];
106
+ deployArtifactIssues: ValidationIssue[];
107
+ htmlMetadataIssues: ValidationIssue[];
108
+ hydrationPayloadIssues: ValidationIssue[];
109
+ missingAssetReferences: ValidationIssue[];
110
+ prefetchReferenceIssues: ValidationIssue[];
111
+ manifestOutputIssues: ValidationIssue[];
112
+ orphanHtmlIssues: ValidationIssue[];
113
+ largestHtml: BuildReport["largestHtml"];
114
+ largestArtifacts: BuildReport["largestArtifacts"];
115
+ largestPublicFiles: PublicFileSummary[];
116
+ publicFileTypes: PublicFileTypeSummary[];
117
+ largestStylesheets: StylesheetAssetSummary[];
118
+ largestPublicCssFiles: PublicFileSummary[];
119
+ largestPublicJavaScriptFiles: PublicFileSummary[];
120
+ largestImages: PublicFileSummary[];
121
+ routeFamilies: Record<string, number>;
122
+ routeWrites: Record<string, number>;
123
+ artifactFamilies: Record<string, number>;
124
+ artifactWrites: Record<string, number>;
125
+ dataFlow?: ValidationDataFlowSummary;
126
+ validationOptions?: ValidationOptionsSummary;
127
+ validationIssues: ValidationIssue[];
128
+ budgetFailures: ValidationBudgetFailure[];
129
+ sitemapDrift: {
130
+ missing: string[];
131
+ extra: string[];
132
+ };
133
+ };
134
+ export type PublicFileSummary = {
135
+ path: string;
136
+ bytes: number;
137
+ type: string;
138
+ };
139
+ export type PublicFileTypeSummary = {
140
+ type: string;
141
+ files: number;
142
+ bytes: number;
143
+ };
144
+ export type TransferSidecarSummary = {
145
+ compressibleFiles: number;
146
+ brotliFiles: number;
147
+ gzipFiles: number;
148
+ originalBytes: number;
149
+ brotliBytes: number;
150
+ gzipBytes: number;
151
+ missingBrotliFiles: string[];
152
+ missingGzipFiles: string[];
153
+ };
154
+ export type StylesheetAssetSummary = {
155
+ path: string;
156
+ bytes: number;
157
+ references: number;
158
+ };
159
+ export type ValidationBudgetFailure = {
160
+ kind: "pages" | "artifacts" | "route-family-pages" | "artifact-family-outputs" | "html" | "css" | "js" | "public-file" | "total-public" | "image-total" | "brotli" | "gzip" | "dependency-fanout";
161
+ path: string;
162
+ bytes: number;
163
+ limit: number;
164
+ dependency?: string;
165
+ outputs?: number;
166
+ };
167
+ export type ValidationDataFlowSummary = {
168
+ outputs: DataFlowReport["outputs"];
169
+ dependencyCount: number;
170
+ largestDependencyFanout: DataFlowDependencySummary[];
171
+ routeFamilies: DataFlowFamilySummary[];
172
+ artifactFamilies: DataFlowFamilySummary[];
173
+ };
174
+ export type ValidationOptionsSummary = {
175
+ configPath?: string;
176
+ configHash?: string;
177
+ budgets?: SizeBudgetConfig;
178
+ requirePrecompressed?: boolean;
179
+ provider?: DeployProvider;
180
+ };
181
+ export type ValidationOutputOptions = ValidationOptionsSummary;
182
+ export type DependencyInspectSummary = {
183
+ dependency: string;
184
+ pageCount: number;
185
+ artifactCount: number;
186
+ pages: Array<{
187
+ route: string;
188
+ path: string;
189
+ outputPath: string;
190
+ hash: string;
191
+ }>;
192
+ artifacts: Array<{
193
+ route: string;
194
+ path: string;
195
+ outputPath: string;
196
+ hash: string;
197
+ }>;
198
+ };
199
+ export type DependencyPlanSummary = {
200
+ dependencies: string[];
201
+ outputCount: number;
202
+ pageCount: number;
203
+ artifactCount: number;
204
+ outputs: DependencyPlanOutput[];
205
+ };
206
+ export type DependencyPlanOutput = {
207
+ kind: "page" | "artifact";
208
+ route: string;
209
+ path: string;
210
+ outputPath: string;
211
+ dependencies: Record<string, string>;
212
+ };
213
+ export type BenchmarkComparison = {
214
+ ok: boolean;
215
+ baselinePath?: string;
216
+ currentReportPath?: string;
217
+ maxSizeRegressionPercent: number;
218
+ comparedMetrics: number;
219
+ regressions: BenchmarkRegression[];
220
+ };
221
+ export type BenchmarkRegression = {
222
+ metric: string;
223
+ baseline: number;
224
+ current: number;
225
+ delta: number;
226
+ regressionPercent: number | null;
227
+ limitPercent: number;
228
+ };
229
+ export declare function parseArgs(args: string[]): CliCommand;
230
+ export declare function runCli(args?: string[]): Promise<void>;
231
+ export declare function compareBenchmarkMetrics(current: ExampleBenchmark, baseline: unknown, options?: {
232
+ maxSizeRegressionPercent?: number;
233
+ }): BenchmarkComparison;
234
+ export declare function inspectDependency(outDir: string, dependency: string): Promise<DependencyInspectSummary>;
235
+ export declare function planDependencyRebuilds(outDir: string, dependencies: string[]): Promise<DependencyPlanSummary>;
236
+ export declare function validateOutput(outDir: string, options?: ValidationOutputOptions): Promise<ValidationSummary>;