ferrovue 0.1.0 → 0.2.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 +206 -20
- package/dist/attrs.d.ts +51 -0
- package/dist/attrs.js +488 -0
- package/dist/cli.js +68 -10
- package/dist/client.d.ts +27 -0
- package/dist/client.js +44 -0
- package/dist/compiler.d.ts +16 -53
- package/dist/compiler.js +87 -3178
- package/dist/component.d.ts +6 -0
- package/dist/component.js +251 -0
- package/dist/context.d.ts +151 -0
- package/dist/context.js +84 -0
- package/dist/emitter.d.ts +23 -0
- package/dist/emitter.js +58 -0
- package/dist/expr.d.ts +76 -0
- package/dist/expr.js +1267 -0
- package/dist/fixture.d.ts +38 -0
- package/dist/fixture.js +78 -0
- package/dist/i18n.d.ts +27 -0
- package/dist/i18n.js +175 -0
- package/dist/lists.d.ts +19 -0
- package/dist/lists.js +253 -0
- package/dist/model.d.ts +248 -0
- package/dist/model.js +102 -0
- package/dist/parens.d.ts +51 -0
- package/dist/parens.js +239 -0
- package/dist/router.d.ts +17 -0
- package/dist/router.js +272 -0
- package/dist/rust.d.ts +14 -0
- package/dist/rust.js +496 -0
- package/dist/scoped.d.ts +10 -0
- package/dist/scoped.js +90 -0
- package/dist/script.d.ts +16 -0
- package/dist/script.js +316 -0
- package/dist/stores.d.ts +6 -0
- package/dist/stores.js +227 -0
- package/dist/template.d.ts +45 -0
- package/dist/template.js +939 -0
- package/dist/testing.d.ts +2 -22
- package/dist/testing.js +11 -55
- package/dist/types.d.ts +1 -0
- package/dist/typescript.d.ts +31 -0
- package/dist/typescript.js +310 -0
- package/dist/vite.d.ts +23 -0
- package/dist/vite.js +114 -0
- package/package.json +26 -8
package/dist/compiler.d.ts
CHANGED
|
@@ -1,56 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
export type TypeName = "string" | "string?" | "int" | "int?" | "bool";
|
|
3
|
-
/** A function a template may call, and the Rust function that is its twin. */
|
|
4
|
-
export interface HelperSpec {
|
|
5
|
-
/** The Rust path the generated code calls, e.g. `crate::helpers::format_count`. */
|
|
6
|
-
rust: string;
|
|
7
|
-
params: TypeName[];
|
|
8
|
-
returns: TypeName;
|
|
9
|
-
/** The longest string it returns, which is what a call adds to the buffer reservation. */
|
|
10
|
-
maxLen?: number;
|
|
11
|
-
}
|
|
12
|
-
/** What `ferrovue.config.json` holds. Paths are relative to the project root. */
|
|
13
|
-
export interface Config {
|
|
14
|
-
/** The directory of `.vue` files to compile. */
|
|
15
|
-
components: string;
|
|
16
|
-
/** The directory the Rust modules are written to. Everything in it is replaced. */
|
|
17
|
-
out: string;
|
|
18
|
-
/** The module components import their helpers from, and the Rust twin of each export. */
|
|
19
|
-
helpers?: {
|
|
20
|
-
module: string;
|
|
21
|
-
functions: Record<string, HelperSpec>;
|
|
22
|
-
};
|
|
23
|
-
/** The Rust type a `TrustedHtml` prop is, which must implement `ferrovue::TrustedHtml`, e.g.
|
|
24
|
-
* `crate::sanitize::SafeHtml`. A type that borrows names the props' lifetime, `'a`:
|
|
25
|
-
* `crate::render::Trusted<'a>`. Without it, a component cannot use `v-html` at all. */
|
|
26
|
-
trustedHtml?: string;
|
|
27
|
-
/** A JSON file listing the app's routes as vue-router paths (`/users/:id`), which `<RouterLink>`
|
|
28
|
-
* resolves against. Without it, a component cannot use `<RouterLink>`. */
|
|
29
|
-
routes?: string;
|
|
30
|
-
/** The router, in full: its routes file, the history's base, and the class names
|
|
31
|
-
* `createRouter` gives active links. `routes` alone is shorthand for `{ routes }`. */
|
|
32
|
-
router?: {
|
|
33
|
-
routes: string;
|
|
34
|
-
base?: string;
|
|
35
|
-
linkActiveClass?: string;
|
|
36
|
-
linkExactActiveClass?: string;
|
|
37
|
-
};
|
|
38
|
-
/** The directory of Pinia stores (`.ts` files), whose state a component may read while it renders
|
|
39
|
-
* on the server. */
|
|
40
|
-
stores?: string;
|
|
41
|
-
/** Custom directives that render nothing on the server — no `getSSRProps` — by name, without
|
|
42
|
-
* `v-`: `["focus", "click-outside"]`. Any other custom directive is refused, since the server
|
|
43
|
-
* cannot know what its `getSSRProps` would add. */
|
|
44
|
-
clientDirectives?: string[];
|
|
45
|
-
}
|
|
46
|
-
export declare const CONFIG_FILE = "ferrovue.config.json";
|
|
47
|
-
/** Read the project's configuration. */
|
|
48
|
-
export declare function loadConfig(root: string): Config;
|
|
49
|
-
/** Where `TrustedHtml` comes from. Only that import names the type `v-html` will write raw. */
|
|
50
|
-
export declare const TYPES_MODULE = "ferrovue/types";
|
|
51
|
-
export declare class GenError extends Error {
|
|
52
|
-
}
|
|
1
|
+
import { type Config } from "./context.ts";
|
|
53
2
|
/** Every generated file, keyed by its name in the output directory. */
|
|
54
3
|
export declare function generate(root: string, config?: Config): Map<string, string>;
|
|
55
4
|
/** Write what `generate` produces to the configured directory, replacing what is there. */
|
|
56
|
-
|
|
5
|
+
/** What \`write\` changed in the output directory. */
|
|
6
|
+
export interface Written {
|
|
7
|
+
/** Every file the output directory now holds. */
|
|
8
|
+
files: string[];
|
|
9
|
+
/** The files whose text changed, or that are new. */
|
|
10
|
+
changed: string[];
|
|
11
|
+
/** The files removed, which the components no longer produce. */
|
|
12
|
+
removed: string[];
|
|
13
|
+
}
|
|
14
|
+
/** Write what \`generate\` produces to the configured directory: only the files whose text changed,
|
|
15
|
+
* so a Rust build that watches them rebuilds no more than it must, and removing what no component
|
|
16
|
+
* produces any more. */
|
|
17
|
+
export declare function write(root: string, config?: Config): Written;
|
|
18
|
+
export { CONFIG_FILE, loadConfig, TYPES_MODULE, type Config, type HelperSpec, type TypeName } from "./context.ts";
|
|
19
|
+
export { GenError } from "./model.ts";
|