@yannosay/sinth 4.1.0 → 5.1.1
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/CHANGELOG.md +89 -0
- package/DOCS.md +1359 -0
- package/README.md +83 -74
- package/bin/sinth.js +2 -1
- package/dist/cli/args.d.ts +11 -0
- package/dist/cli/args.js +74 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +437 -0
- package/dist/cli/templates.d.ts +10 -0
- package/dist/cli/templates.js +193 -0
- package/dist/cli/ui.d.ts +28 -0
- package/dist/cli/ui.js +61 -0
- package/dist/cli/update-check.d.ts +2 -0
- package/dist/cli/update-check.js +124 -0
- package/dist/compiler/ast.d.ts +315 -0
- package/dist/compiler/ast.js +4 -0
- package/dist/compiler/codegen.d.ts +143 -0
- package/dist/compiler/codegen.js +1326 -0
- package/dist/compiler/diagnostics.d.ts +36 -0
- package/dist/compiler/diagnostics.js +142 -0
- package/dist/compiler/elements.d.ts +14 -0
- package/dist/compiler/elements.js +78 -0
- package/dist/compiler/globals.d.ts +2 -0
- package/dist/compiler/globals.js +27 -0
- package/dist/compiler/html.d.ts +37 -0
- package/dist/compiler/html.js +152 -0
- package/dist/compiler/lexer.d.ts +42 -0
- package/dist/compiler/lexer.js +404 -0
- package/dist/compiler/parser.d.ts +95 -0
- package/dist/compiler/parser.js +1374 -0
- package/dist/compiler/prerender.d.ts +72 -0
- package/dist/compiler/prerender.js +910 -0
- package/dist/compiler/script-analysis.d.ts +6 -0
- package/dist/compiler/script-analysis.js +106 -0
- package/dist/compiler/style.d.ts +39 -0
- package/dist/compiler/style.js +463 -0
- package/dist/deploy/cloudflare.d.ts +9 -0
- package/dist/deploy/cloudflare.js +111 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +23 -0
- package/dist/project/build.d.ts +31 -0
- package/dist/project/build.js +425 -0
- package/dist/project/config.d.ts +33 -0
- package/dist/project/config.js +142 -0
- package/dist/project/project.d.ts +74 -0
- package/dist/project/project.js +555 -0
- package/dist/runtime/index.d.ts +68 -0
- package/dist/runtime/index.js +912 -0
- package/dist/server/client.d.ts +1 -0
- package/dist/server/client.js +112 -0
- package/dist/server/dev.d.ts +8 -0
- package/dist/server/dev.js +244 -0
- package/dist/server/preview.d.ts +6 -0
- package/dist/server/preview.js +106 -0
- package/dist/server/static.d.ts +10 -0
- package/dist/server/static.js +136 -0
- package/lib/ui/index.sinth +436 -0
- package/package.json +33 -15
- package/schema/sinth.config.schema.json +54 -0
- package/dist/browser/compile.js +0 -63
- package/dist/cli.js +0 -509
- package/dist/core/builtins.js +0 -117
- package/dist/core/cli-compiler.js +0 -705
- package/dist/core/compiler.js +0 -1489
- package/dist/core/expr.js +0 -129
- package/dist/core/head-builder.js +0 -130
- package/dist/core/lexer.js +0 -410
- package/dist/core/parser.js +0 -1646
- package/dist/core/runtime/custom-element.js +0 -81
- package/dist/core/runtime/functions.js +0 -99
- package/dist/core/runtime/helpers.js +0 -347
- package/dist/core/runtime/render.js +0 -136
- package/dist/core/style-processor.js +0 -317
- package/dist/core/types.js +0 -93
- package/dist/resolver.js +0 -175
- package/dist/server.js +0 -174
- package/dist/update-check.js +0 -109
- package/dist/utils.js +0 -80
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Expr, MetaEntry, SinthFile } from "./ast";
|
|
2
|
+
import { ResolvedImport } from "./codegen";
|
|
3
|
+
type Value = unknown;
|
|
4
|
+
declare class Cell {
|
|
5
|
+
value: Value;
|
|
6
|
+
constructor(value: Value);
|
|
7
|
+
}
|
|
8
|
+
declare class Env {
|
|
9
|
+
readonly parent: Env | null;
|
|
10
|
+
private readonly vars;
|
|
11
|
+
constructor(parent: Env | null);
|
|
12
|
+
define(name: string, value: Value): void;
|
|
13
|
+
find(name: string): Cell | undefined;
|
|
14
|
+
}
|
|
15
|
+
export interface PrerenderHost {
|
|
16
|
+
getFile(path: string): SinthFile;
|
|
17
|
+
getImports(file: SinthFile): ResolvedImport[];
|
|
18
|
+
}
|
|
19
|
+
export declare class Prerenderer {
|
|
20
|
+
private readonly host;
|
|
21
|
+
complete: boolean;
|
|
22
|
+
private steps;
|
|
23
|
+
private readonly moduleEnvs;
|
|
24
|
+
private readonly componentTables;
|
|
25
|
+
private depth;
|
|
26
|
+
constructor(host: PrerenderHost);
|
|
27
|
+
renderPage(file: SinthFile, params?: Record<string, string>): string;
|
|
28
|
+
/** Evaluates metadata in the page's module scope. Values that need the browser come back as `undefined` with `known: false`. */
|
|
29
|
+
evalMeta(file: SinthFile, params?: Record<string, string>): {
|
|
30
|
+
key: string;
|
|
31
|
+
value: Value;
|
|
32
|
+
known: boolean;
|
|
33
|
+
loc: MetaEntry["loc"];
|
|
34
|
+
}[];
|
|
35
|
+
/** Evaluates `paths` for a dynamic route. Route params are unknown at this point. */
|
|
36
|
+
evalPaths(file: SinthFile, paramNames: string[]): {
|
|
37
|
+
value: Value;
|
|
38
|
+
known: boolean;
|
|
39
|
+
};
|
|
40
|
+
private tick;
|
|
41
|
+
private moduleEnv;
|
|
42
|
+
private declare;
|
|
43
|
+
private makeFunction;
|
|
44
|
+
private execAll;
|
|
45
|
+
private exec;
|
|
46
|
+
eval(e: Expr, env: Env, file: SinthFile): Value;
|
|
47
|
+
private components;
|
|
48
|
+
private renderNodes;
|
|
49
|
+
private renderNode;
|
|
50
|
+
private renderUiFunction;
|
|
51
|
+
private attrValue;
|
|
52
|
+
private renderElement;
|
|
53
|
+
private renderComponent;
|
|
54
|
+
private styleVars;
|
|
55
|
+
}
|
|
56
|
+
export declare function toText(value: Value): string;
|
|
57
|
+
export interface PrerenderResult {
|
|
58
|
+
html: string;
|
|
59
|
+
complete: boolean;
|
|
60
|
+
meta: {
|
|
61
|
+
key: string;
|
|
62
|
+
value: unknown;
|
|
63
|
+
known: boolean;
|
|
64
|
+
loc: MetaEntry["loc"];
|
|
65
|
+
}[];
|
|
66
|
+
}
|
|
67
|
+
export declare function prerenderPage(file: SinthFile, host: PrerenderHost, params?: Record<string, string>): PrerenderResult;
|
|
68
|
+
export declare function evaluatePaths(file: SinthFile, host: PrerenderHost, paramNames: string[]): {
|
|
69
|
+
value: unknown;
|
|
70
|
+
known: boolean;
|
|
71
|
+
};
|
|
72
|
+
export {};
|