actionview-svelte-handler 0.3.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.forgejo/workflows/javascript_police.yml +22 -0
- data/.forgejo/workflows/ruby_police.yml +27 -0
- data/.gitignore +14 -0
- data/.ruby-version +1 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +284 -0
- data/README.md +90 -15
- data/Steepfile +12 -0
- data/actionview-svelte-handler.gemspec +21 -0
- data/bin/test +5 -0
- data/build.esbuild.js +22 -0
- data/lib/generators/svelte/install_generator.rb +13 -0
- data/lib/generators/svelte/templates/install/initializer.rb +17 -0
- data/lib/svelte/errors.rb +151 -0
- data/lib/svelte/handler.rb +49 -21
- data/lib/svelte/helpers.rb +13 -3
- data/lib/svelte/js/.DO_NOT_MODIFY.md +2 -0
- data/lib/svelte/js/builder.js +122 -0
- data/lib/svelte/railtie.rb +7 -5
- data/lib/svelte/templates/assembler.js.erb +16 -0
- data/lib/svelte/templates/island.html.erb +20 -0
- data/lib/svelte/variabilization.rb +11 -0
- data/lib/svelte/version.rb +1 -1
- data/lib/svelte.rb +27 -4
- data/lib/tasks/svelte_tasks.rake +4 -0
- data/lib/ts/builder.ts +174 -0
- data/lib/ts/types/.DO_NOT_MODIFY.md +2 -0
- data/lib/ts/types/builder.d.ts +42 -0
- data/package-lock.json +6643 -0
- data/package.json +39 -0
- data/rbs_collection.lock.yaml +344 -0
- data/rbs_collection.yaml +18 -0
- data/sig/lib/svelte/errors.rbs +38 -0
- data/sig/lib/svelte/handler.rbs +9 -0
- data/sig/lib/svelte/helpers.rbs +7 -0
- data/sig/lib/svelte/version.rbs +3 -0
- data/sig/lib/svelte.rbs +19 -0
- data/svelte-on-rails.png +0 -0
- data/tsconfig.json +15 -0
- data/watch.esbuild.js +4 -0
- metadata +37 -3
@@ -0,0 +1,42 @@
|
|
1
|
+
import { Stores } from 'svelte/store';
|
2
|
+
export interface BuildSuccess {
|
3
|
+
client: string;
|
4
|
+
server: {
|
5
|
+
html: string;
|
6
|
+
css: string;
|
7
|
+
} | null;
|
8
|
+
compiled: {
|
9
|
+
client: string;
|
10
|
+
server: string | undefined;
|
11
|
+
};
|
12
|
+
}
|
13
|
+
export interface BuildError {
|
14
|
+
error: any;
|
15
|
+
}
|
16
|
+
export type BuildResult = BuildSuccess | BuildError;
|
17
|
+
/**
|
18
|
+
* Builder is a class that builds, compiles and bundles Svelte components into a nice object for the template handler
|
19
|
+
*/
|
20
|
+
declare class Builder {
|
21
|
+
path: string;
|
22
|
+
props: Stores;
|
23
|
+
locals: object;
|
24
|
+
compiled: {
|
25
|
+
client: string | null;
|
26
|
+
server: string | null;
|
27
|
+
};
|
28
|
+
ssr: boolean;
|
29
|
+
workingDir: string;
|
30
|
+
preprocess: object;
|
31
|
+
constructor(path: string, props: object, locals: object, client: string | null, server: string | null, ssr: boolean, workingDir: string, preprocess: object);
|
32
|
+
bundle(generate: 'ssr' | 'dom', sveltePath?: string): Promise<string>;
|
33
|
+
client(): Promise<string>;
|
34
|
+
standardizeClient(code: string): string;
|
35
|
+
server(): Promise<{
|
36
|
+
output: string;
|
37
|
+
html: string;
|
38
|
+
css: string;
|
39
|
+
}>;
|
40
|
+
build(): Promise<BuildResult>;
|
41
|
+
}
|
42
|
+
export default Builder;
|