alchemy 0.2.5 → 0.3.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/README.md +3 -3
- package/lib/ai/approve.d.ts +99 -0
- package/lib/ai/approve.js +76 -0
- package/lib/ai/astro-file.d.ts +137 -0
- package/lib/ai/astro-file.js +156 -0
- package/lib/ai/client.d.ts +7 -8
- package/lib/ai/client.js +48 -19
- package/lib/ai/css-file.d.ts +131 -0
- package/lib/ai/css-file.js +141 -0
- package/lib/ai/data.d.ts +51 -6
- package/lib/ai/data.js +58 -12
- package/lib/ai/document.d.ts +108 -24
- package/lib/ai/document.js +166 -52
- package/lib/ai/html-file.d.ts +128 -0
- package/lib/ai/html-file.js +138 -0
- package/lib/ai/index.d.ts +9 -0
- package/lib/ai/index.js +9 -0
- package/lib/ai/json-file.d.ts +160 -0
- package/lib/ai/json-file.js +187 -0
- package/lib/ai/review.d.ts +122 -0
- package/lib/ai/review.js +101 -0
- package/lib/ai/typescript-file.d.ts +139 -0
- package/lib/ai/typescript-file.js +145 -0
- package/lib/ai/vue-file.d.ts +126 -0
- package/lib/ai/vue-file.js +136 -0
- package/lib/ai/yaml-file.d.ts +169 -0
- package/lib/ai/yaml-file.js +200 -0
- package/lib/alchemy.js +17 -2
- package/lib/apply.js +1 -1
- package/lib/cloudflare/dns.d.ts +88 -0
- package/lib/cloudflare/dns.js +192 -0
- package/lib/cloudflare/generate-asset-manifest.js +1 -1
- package/lib/cloudflare/index.d.ts +2 -1
- package/lib/cloudflare/index.js +2 -1
- package/lib/cloudflare/r2-rest-state-store.d.ts +125 -0
- package/lib/cloudflare/r2-rest-state-store.js +254 -0
- package/lib/cloudflare/response.d.ts +12 -0
- package/lib/cloudflare/response.js +0 -0
- package/lib/cloudflare/static-site-router.js +16 -7
- package/lib/cloudflare/static-site.js +3 -0
- package/lib/cloudflare/upload-asset-manifest.js +4 -2
- package/lib/cloudflare/zone.d.ts +18 -0
- package/lib/cloudflare/zone.js +17 -4
- package/lib/dns/godaddy.d.ts +7 -0
- package/lib/dns/godaddy.js +21 -0
- package/lib/dns/import-dns.d.ts +82 -0
- package/lib/dns/import-dns.js +114 -0
- package/lib/dns/index.d.ts +2 -0
- package/lib/dns/index.js +2 -0
- package/lib/dns/record.d.ts +88 -0
- package/lib/dns/record.js +13 -0
- package/lib/fs/copy-file.d.ts +54 -0
- package/lib/fs/copy-file.js +63 -0
- package/lib/fs/file-system-state-store.d.ts +17 -0
- package/lib/fs/file-system-state-store.js +87 -0
- package/lib/fs/file.d.ts +13 -0
- package/lib/fs/file.js +24 -5
- package/lib/fs/folder.d.ts +10 -0
- package/lib/fs/folder.js +2 -2
- package/lib/fs/index.d.ts +10 -4
- package/lib/fs/index.js +10 -4
- package/lib/fs/static-astro-file.d.ts +34 -0
- package/lib/fs/static-astro-file.js +39 -0
- package/lib/fs/static-css-file.d.ts +24 -0
- package/lib/fs/static-css-file.js +29 -0
- package/lib/fs/static-html-file.d.ts +31 -0
- package/lib/fs/static-html-file.js +36 -0
- package/lib/fs/{json-file.d.ts → static-json-file.d.ts} +3 -3
- package/lib/fs/static-json-file.js +15 -0
- package/lib/fs/{text-file.d.ts → static-text-file.d.ts} +2 -2
- package/lib/fs/static-text-file.js +8 -0
- package/lib/fs/{typescript-file.d.ts → static-typescript-file.d.ts} +3 -3
- package/lib/fs/{typescript-file.js → static-typescript-file.js} +3 -2
- package/lib/fs/static-vue-file.d.ts +28 -0
- package/lib/fs/static-vue-file.js +33 -0
- package/lib/fs/static-yaml-file.d.ts +22 -0
- package/lib/fs/{yaml-file.js → static-yaml-file.js} +3 -2
- package/lib/internal/getting-started.d.ts +21 -0
- package/lib/internal/getting-started.js +87 -0
- package/lib/internal/index.d.ts +3 -0
- package/lib/internal/index.js +3 -0
- package/lib/internal/providers.d.ts +27 -0
- package/lib/internal/providers.js +172 -0
- package/lib/internal/tutorial.d.ts +104 -0
- package/lib/internal/tutorial.js +251 -0
- package/lib/resource.js +8 -1
- package/lib/scope.d.ts +1 -1
- package/lib/scope.js +4 -2
- package/lib/state.d.ts +1 -16
- package/lib/state.js +0 -87
- package/lib/test/bun.d.ts +11 -0
- package/lib/test/bun.js +36 -8
- package/lib/web/astro.d.ts +147 -0
- package/lib/web/astro.js +414 -0
- package/lib/{shadcn/component.js → web/shadcn-component.js} +2 -9
- package/lib/web/shadcn.d.ts +97 -0
- package/lib/web/shadcn.js +99 -0
- package/lib/web/tailwind.d.ts +64 -0
- package/lib/web/tailwind.js +97 -0
- package/lib/{vite → web}/vite.d.ts +5 -0
- package/lib/{vite → web}/vite.js +44 -44
- package/lib/web/vitepress/config.d.ts +10 -0
- package/lib/web/vitepress/config.js +31 -0
- package/lib/web/vitepress/custom-theme.d.ts +173 -0
- package/lib/web/vitepress/custom-theme.js +336 -0
- package/lib/{vitepress → web/vitepress}/dependencies.d.ts +2 -2
- package/lib/{vitepress → web/vitepress}/dependencies.js +1 -1
- package/lib/web/vitepress/home-page.d.ts +246 -0
- package/lib/web/vitepress/home-page.js +147 -0
- package/lib/{vitepress → web/vitepress}/index.d.ts +2 -0
- package/lib/{vitepress → web/vitepress}/index.js +2 -0
- package/lib/{vitepress → web/vitepress}/vitepress.d.ts +15 -12
- package/lib/{vitepress → web/vitepress}/vitepress.js +26 -44
- package/package.json +6 -2
- package/src/ai/approve.ts +163 -0
- package/src/ai/astro-file.ts +269 -0
- package/src/ai/client.ts +60 -21
- package/src/ai/css-file.ts +247 -0
- package/src/ai/data.ts +81 -19
- package/src/ai/document.ts +240 -62
- package/src/ai/html-file.ts +244 -0
- package/src/ai/index.ts +9 -0
- package/src/ai/json-file.ts +325 -0
- package/src/ai/review.ts +213 -0
- package/src/ai/typescript-file.ts +259 -0
- package/src/ai/vue-file.ts +242 -0
- package/src/ai/yaml-file.ts +328 -0
- package/src/alchemy.ts +18 -7
- package/src/apply.ts +8 -9
- package/src/cloudflare/dns.ts +344 -0
- package/src/cloudflare/generate-asset-manifest.ts +4 -4
- package/src/cloudflare/index.ts +2 -1
- package/src/cloudflare/r2-rest-state-store.ts +353 -0
- package/src/cloudflare/response.ts +9 -0
- package/src/cloudflare/static-site-router.ts +18 -8
- package/src/cloudflare/static-site.ts +11 -7
- package/src/cloudflare/upload-asset-manifest.ts +6 -4
- package/src/cloudflare/worker.ts +44 -43
- package/src/cloudflare/zone.ts +39 -23
- package/src/dns/godaddy.ts +29 -0
- package/src/dns/import-dns.ts +213 -0
- package/src/dns/index.ts +2 -0
- package/src/dns/record.ts +121 -0
- package/src/fs/copy-file.ts +115 -0
- package/src/fs/file-system-state-store.ts +109 -0
- package/src/fs/file.ts +35 -9
- package/src/fs/folder.ts +14 -2
- package/src/fs/index.ts +10 -4
- package/src/fs/static-astro-file.ts +45 -0
- package/src/fs/static-css-file.ts +35 -0
- package/src/fs/static-html-file.ts +42 -0
- package/src/fs/static-json-file.ts +34 -0
- package/src/fs/{text-file.ts → static-text-file.ts} +9 -3
- package/src/fs/{typescript-file.ts → static-typescript-file.ts} +7 -6
- package/src/fs/static-vue-file.ts +39 -0
- package/src/fs/static-yaml-file.ts +33 -0
- package/src/internal/getting-started.ts +115 -0
- package/src/internal/index.ts +3 -0
- package/src/internal/providers.ts +241 -0
- package/src/internal/tutorial.ts +392 -0
- package/src/resource.ts +10 -1
- package/src/scope.ts +5 -6
- package/src/state.ts +1 -111
- package/src/test/bun.ts +60 -10
- package/src/web/astro.ts +644 -0
- package/src/{shadcn/component.ts → web/shadcn-component.ts} +5 -13
- package/src/web/shadcn.ts +219 -0
- package/src/web/tailwind.ts +167 -0
- package/src/{vite → web}/vite.ts +54 -56
- package/src/web/vitepress/config.ts +48 -0
- package/src/web/vitepress/custom-theme.ts +514 -0
- package/src/{vitepress → web/vitepress}/dependencies.ts +2 -2
- package/src/web/vitepress/home-page.ts +375 -0
- package/src/{vitepress → web/vitepress}/index.ts +2 -0
- package/src/{vitepress → web/vitepress}/vitepress.ts +62 -72
- package/lib/cloudflare/state.d.ts +0 -82
- package/lib/cloudflare/state.js +0 -108
- package/lib/fs/json-file.js +0 -7
- package/lib/fs/text-file.js +0 -7
- package/lib/fs/yaml-file.d.ts +0 -19
- package/lib/internal/docs.d.ts +0 -5
- package/lib/internal/docs.js +0 -287
- package/lib/shadcn/index.d.ts +0 -1
- package/lib/shadcn/index.js +0 -1
- package/lib/vite/index.d.ts +0 -1
- package/lib/vite/index.js +0 -1
- package/lib/vitepress/home-page.d.ts +0 -133
- package/lib/vitepress/home-page.js +0 -11
- package/src/cloudflare/state.ts +0 -138
- package/src/fs/json-file.ts +0 -23
- package/src/fs/yaml-file.ts +0 -26
- package/src/internal/docs.ts +0 -338
- package/src/shadcn/index.ts +0 -1
- package/src/vite/index.ts +0 -1
- package/src/vitepress/home-page.ts +0 -166
- /package/lib/{shadcn/component.d.ts → web/shadcn-component.d.ts} +0 -0
- /package/src/{vitepress → web/vitepress}/index.md +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { File } from "./file";
|
|
2
|
+
export type StaticAstroFile = File;
|
|
3
|
+
/**
|
|
4
|
+
* Creates a static Astro component file
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* // Create an Astro component file with content
|
|
8
|
+
* const header = await StaticAstroFile("Header.astro",
|
|
9
|
+
* `---
|
|
10
|
+
* import Logo from '../components/Logo.astro';
|
|
11
|
+
* const navItems = ['Home', 'About', 'Contact'];
|
|
12
|
+
* ---
|
|
13
|
+
*
|
|
14
|
+
* <header class="header">
|
|
15
|
+
* <Logo />
|
|
16
|
+
* <nav>
|
|
17
|
+
* <ul>
|
|
18
|
+
* {navItems.map(item => (
|
|
19
|
+
* <li><a href={`/${item.toLowerCase()}`}>{item}</a></li>
|
|
20
|
+
* ))}
|
|
21
|
+
* </ul>
|
|
22
|
+
* </nav>
|
|
23
|
+
* </header>
|
|
24
|
+
*
|
|
25
|
+
* <style>
|
|
26
|
+
* .header {
|
|
27
|
+
* display: flex;
|
|
28
|
+
* justify-content: space-between;
|
|
29
|
+
* padding: 1rem;
|
|
30
|
+
* }
|
|
31
|
+
* </style>`
|
|
32
|
+
* );
|
|
33
|
+
*/
|
|
34
|
+
export declare function StaticAstroFile(id: string, ...args: [content: string] | [path: string, content: string]): Promise<StaticAstroFile>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { File } from "./file";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a static Astro component file
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* // Create an Astro component file with content
|
|
7
|
+
* const header = await StaticAstroFile("Header.astro",
|
|
8
|
+
* `---
|
|
9
|
+
* import Logo from '../components/Logo.astro';
|
|
10
|
+
* const navItems = ['Home', 'About', 'Contact'];
|
|
11
|
+
* ---
|
|
12
|
+
*
|
|
13
|
+
* <header class="header">
|
|
14
|
+
* <Logo />
|
|
15
|
+
* <nav>
|
|
16
|
+
* <ul>
|
|
17
|
+
* {navItems.map(item => (
|
|
18
|
+
* <li><a href={`/${item.toLowerCase()}`}>{item}</a></li>
|
|
19
|
+
* ))}
|
|
20
|
+
* </ul>
|
|
21
|
+
* </nav>
|
|
22
|
+
* </header>
|
|
23
|
+
*
|
|
24
|
+
* <style>
|
|
25
|
+
* .header {
|
|
26
|
+
* display: flex;
|
|
27
|
+
* justify-content: space-between;
|
|
28
|
+
* padding: 1rem;
|
|
29
|
+
* }
|
|
30
|
+
* </style>`
|
|
31
|
+
* );
|
|
32
|
+
*/
|
|
33
|
+
export function StaticAstroFile(id, ...args) {
|
|
34
|
+
const [path, content] = args.length === 1 ? [id, args[0]] : args;
|
|
35
|
+
return File(id, {
|
|
36
|
+
path,
|
|
37
|
+
content,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { File } from "./file";
|
|
2
|
+
export type StaticCSSFile = File;
|
|
3
|
+
/**
|
|
4
|
+
* Creates a static CSS file
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* // Create a CSS file with styles
|
|
8
|
+
* const styles = await StaticCSSFile("styles.css",
|
|
9
|
+
* `.container {
|
|
10
|
+
* max-width: 1200px;
|
|
11
|
+
* margin: 0 auto;
|
|
12
|
+
* padding: 0 1rem;
|
|
13
|
+
* }
|
|
14
|
+
*
|
|
15
|
+
* .button {
|
|
16
|
+
* background-color: #0062ff;
|
|
17
|
+
* color: white;
|
|
18
|
+
* border: none;
|
|
19
|
+
* padding: 0.5rem 1rem;
|
|
20
|
+
* border-radius: 4px;
|
|
21
|
+
* }`
|
|
22
|
+
* );
|
|
23
|
+
*/
|
|
24
|
+
export declare function StaticCSSFile(id: string, ...args: [content: string] | [path: string, content: string]): Promise<StaticCSSFile>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { File } from "./file";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a static CSS file
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* // Create a CSS file with styles
|
|
7
|
+
* const styles = await StaticCSSFile("styles.css",
|
|
8
|
+
* `.container {
|
|
9
|
+
* max-width: 1200px;
|
|
10
|
+
* margin: 0 auto;
|
|
11
|
+
* padding: 0 1rem;
|
|
12
|
+
* }
|
|
13
|
+
*
|
|
14
|
+
* .button {
|
|
15
|
+
* background-color: #0062ff;
|
|
16
|
+
* color: white;
|
|
17
|
+
* border: none;
|
|
18
|
+
* padding: 0.5rem 1rem;
|
|
19
|
+
* border-radius: 4px;
|
|
20
|
+
* }`
|
|
21
|
+
* );
|
|
22
|
+
*/
|
|
23
|
+
export function StaticCSSFile(id, ...args) {
|
|
24
|
+
const [path, content] = args.length === 1 ? [id, args[0]] : args;
|
|
25
|
+
return File(id, {
|
|
26
|
+
path,
|
|
27
|
+
content,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { File } from "./file";
|
|
2
|
+
export type StaticHTMLFile = File;
|
|
3
|
+
/**
|
|
4
|
+
* Creates a static HTML file
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* // Create an HTML file with content
|
|
8
|
+
* const page = await StaticHTMLFile("index.html",
|
|
9
|
+
* `<!DOCTYPE html>
|
|
10
|
+
* <html lang="en">
|
|
11
|
+
* <head>
|
|
12
|
+
* <meta charset="UTF-8">
|
|
13
|
+
* <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
14
|
+
* <title>My Website</title>
|
|
15
|
+
* <link rel="stylesheet" href="styles.css">
|
|
16
|
+
* </head>
|
|
17
|
+
* <body>
|
|
18
|
+
* <header>
|
|
19
|
+
* <h1>Welcome to My Website</h1>
|
|
20
|
+
* </header>
|
|
21
|
+
* <main>
|
|
22
|
+
* <p>This is the main content of the page.</p>
|
|
23
|
+
* </main>
|
|
24
|
+
* <footer>
|
|
25
|
+
* <p>© 2024 My Company</p>
|
|
26
|
+
* </footer>
|
|
27
|
+
* </body>
|
|
28
|
+
* </html>`
|
|
29
|
+
* );
|
|
30
|
+
*/
|
|
31
|
+
export declare function StaticHTMLFile(id: string, ...args: [content: string] | [path: string, content: string]): Promise<StaticHTMLFile>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { File } from "./file";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a static HTML file
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* // Create an HTML file with content
|
|
7
|
+
* const page = await StaticHTMLFile("index.html",
|
|
8
|
+
* `<!DOCTYPE html>
|
|
9
|
+
* <html lang="en">
|
|
10
|
+
* <head>
|
|
11
|
+
* <meta charset="UTF-8">
|
|
12
|
+
* <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
13
|
+
* <title>My Website</title>
|
|
14
|
+
* <link rel="stylesheet" href="styles.css">
|
|
15
|
+
* </head>
|
|
16
|
+
* <body>
|
|
17
|
+
* <header>
|
|
18
|
+
* <h1>Welcome to My Website</h1>
|
|
19
|
+
* </header>
|
|
20
|
+
* <main>
|
|
21
|
+
* <p>This is the main content of the page.</p>
|
|
22
|
+
* </main>
|
|
23
|
+
* <footer>
|
|
24
|
+
* <p>© 2024 My Company</p>
|
|
25
|
+
* </footer>
|
|
26
|
+
* </body>
|
|
27
|
+
* </html>`
|
|
28
|
+
* );
|
|
29
|
+
*/
|
|
30
|
+
export function StaticHTMLFile(id, ...args) {
|
|
31
|
+
const [path, content] = args.length === 1 ? [id, args[0]] : args;
|
|
32
|
+
return File(id, {
|
|
33
|
+
path,
|
|
34
|
+
content,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -4,7 +4,7 @@ import { File } from "./file";
|
|
|
4
4
|
*
|
|
5
5
|
* @example
|
|
6
6
|
* // Create a JSON configuration file
|
|
7
|
-
* const config = await
|
|
7
|
+
* const config = await StaticJsonFile("config.json", {
|
|
8
8
|
* api: {
|
|
9
9
|
* endpoint: "https://api.example.com",
|
|
10
10
|
* version: "v1"
|
|
@@ -12,5 +12,5 @@ import { File } from "./file";
|
|
|
12
12
|
* features: ["auth", "logging"]
|
|
13
13
|
* });
|
|
14
14
|
*/
|
|
15
|
-
export type
|
|
16
|
-
export declare function
|
|
15
|
+
export type StaticJsonFile = File;
|
|
16
|
+
export declare function StaticJsonFile(id: string, ...args: [content: any] | [path: string, content: any]): Promise<StaticJsonFile>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { File } from "./file";
|
|
2
|
+
export async function StaticJsonFile(id, ...args) {
|
|
3
|
+
const [path, content] = args.length === 1 ? [id, args[0]] : args;
|
|
4
|
+
const prettier = await import("prettier");
|
|
5
|
+
return File(id, {
|
|
6
|
+
path,
|
|
7
|
+
content: await prettier.format(JSON.stringify(content), {
|
|
8
|
+
parser: "json",
|
|
9
|
+
editor: {
|
|
10
|
+
tabWidth: 2,
|
|
11
|
+
indentWidth: 2,
|
|
12
|
+
},
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -8,5 +8,5 @@ import { File } from "./file";
|
|
|
8
8
|
* "# Project Name\n\nProject description goes here."
|
|
9
9
|
* );
|
|
10
10
|
*/
|
|
11
|
-
export type
|
|
12
|
-
export declare function
|
|
11
|
+
export type StaticTextFile = File;
|
|
12
|
+
export declare function StaticTextFile(id: string, ...args: [content: string] | [path: string, content: string]): Promise<StaticTextFile>;
|
|
@@ -4,7 +4,7 @@ import { File } from "./file";
|
|
|
4
4
|
*
|
|
5
5
|
* @example
|
|
6
6
|
* // Create a TypeScript file
|
|
7
|
-
* const component = await
|
|
7
|
+
* const component = await StaticTypeScriptFile("Component.ts", `
|
|
8
8
|
* interface Props {
|
|
9
9
|
* name: string;
|
|
10
10
|
* age: number;
|
|
@@ -15,5 +15,5 @@ import { File } from "./file";
|
|
|
15
15
|
* }
|
|
16
16
|
* `);
|
|
17
17
|
*/
|
|
18
|
-
export type
|
|
19
|
-
export declare function
|
|
18
|
+
export type StaticTypeScriptFile = File;
|
|
19
|
+
export declare function StaticTypeScriptFile(id: string, ...args: [content: string] | [path: string, content: string]): Promise<StaticTypeScriptFile>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { File } from "./file";
|
|
2
|
-
export async function
|
|
2
|
+
export async function StaticTypeScriptFile(id, ...args) {
|
|
3
|
+
const [path, content] = args.length === 1 ? [id, args[0]] : args;
|
|
3
4
|
const prettier = await import("prettier");
|
|
4
5
|
return File(id, {
|
|
5
|
-
path
|
|
6
|
+
path,
|
|
6
7
|
content: await prettier.format(content, {
|
|
7
8
|
parser: "typescript",
|
|
8
9
|
editor: {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { File } from "./file";
|
|
2
|
+
export type StaticVueFile = File;
|
|
3
|
+
/**
|
|
4
|
+
* Creates a static Vue component file
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* // Create a Vue component file with content
|
|
8
|
+
* const button = await StaticVueFile("Button.vue",
|
|
9
|
+
* `<template>
|
|
10
|
+
* <button class="btn">{{ text }}</button>
|
|
11
|
+
* </template>
|
|
12
|
+
*
|
|
13
|
+
* <script>
|
|
14
|
+
* export default {
|
|
15
|
+
* props: {
|
|
16
|
+
* text: String
|
|
17
|
+
* }
|
|
18
|
+
* }
|
|
19
|
+
* </script>
|
|
20
|
+
*
|
|
21
|
+
* <style>
|
|
22
|
+
* .btn {
|
|
23
|
+
* padding: 0.5rem 1rem;
|
|
24
|
+
* }
|
|
25
|
+
* </style>`
|
|
26
|
+
* );
|
|
27
|
+
*/
|
|
28
|
+
export declare function StaticVueFile(id: string, ...args: [content: string] | [path: string, content: string]): Promise<StaticVueFile>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { File } from "./file";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a static Vue component file
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* // Create a Vue component file with content
|
|
7
|
+
* const button = await StaticVueFile("Button.vue",
|
|
8
|
+
* `<template>
|
|
9
|
+
* <button class="btn">{{ text }}</button>
|
|
10
|
+
* </template>
|
|
11
|
+
*
|
|
12
|
+
* <script>
|
|
13
|
+
* export default {
|
|
14
|
+
* props: {
|
|
15
|
+
* text: String
|
|
16
|
+
* }
|
|
17
|
+
* }
|
|
18
|
+
* </script>
|
|
19
|
+
*
|
|
20
|
+
* <style>
|
|
21
|
+
* .btn {
|
|
22
|
+
* padding: 0.5rem 1rem;
|
|
23
|
+
* }
|
|
24
|
+
* </style>`
|
|
25
|
+
* );
|
|
26
|
+
*/
|
|
27
|
+
export function StaticVueFile(id, ...args) {
|
|
28
|
+
const [path, content] = args.length === 1 ? [id, args[0]] : args;
|
|
29
|
+
return File(id, {
|
|
30
|
+
path,
|
|
31
|
+
content,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { File } from "./file";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a YAML file with formatted content
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* // Create a YAML configuration file
|
|
7
|
+
* const config = await StaticYamlFile("config.yaml", {
|
|
8
|
+
* server: {
|
|
9
|
+
* host: "localhost",
|
|
10
|
+
* port: 3000
|
|
11
|
+
* },
|
|
12
|
+
* database: {
|
|
13
|
+
* url: "postgresql://localhost:5432/db",
|
|
14
|
+
* pool: {
|
|
15
|
+
* min: 1,
|
|
16
|
+
* max: 10
|
|
17
|
+
* }
|
|
18
|
+
* }
|
|
19
|
+
* });
|
|
20
|
+
*/
|
|
21
|
+
export type StaticYamlFile = File;
|
|
22
|
+
export declare function StaticYamlFile(id: string, ...args: [content: any] | [path: string, content: any]): Promise<StaticYamlFile>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { File } from "./file";
|
|
2
|
-
export async function
|
|
2
|
+
export async function StaticYamlFile(id, ...args) {
|
|
3
|
+
const [path, content] = args.length === 1 ? [id, args[0]] : args;
|
|
3
4
|
const yaml = await import("yaml");
|
|
4
5
|
return File(id, {
|
|
5
|
-
path
|
|
6
|
+
path,
|
|
6
7
|
content: yaml.stringify(content),
|
|
7
8
|
});
|
|
8
9
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Document } from "../ai";
|
|
2
|
+
import type { ModelConfig } from "../ai/client";
|
|
3
|
+
import type { Folder } from "../fs";
|
|
4
|
+
export interface GettingStartedProps {
|
|
5
|
+
/**
|
|
6
|
+
* The output directory for the getting started document.
|
|
7
|
+
*/
|
|
8
|
+
path: string | Folder;
|
|
9
|
+
/**
|
|
10
|
+
* The prompt to use for generating the getting started guide.
|
|
11
|
+
* This should include specific details about the product or framework.
|
|
12
|
+
*/
|
|
13
|
+
prompt: string;
|
|
14
|
+
/**
|
|
15
|
+
* Optional model configuration for generating the getting started guide.
|
|
16
|
+
* Defaults to Claude 3.5 Sonnet.
|
|
17
|
+
*/
|
|
18
|
+
model?: ModelConfig;
|
|
19
|
+
}
|
|
20
|
+
export type GettingStarted = Document;
|
|
21
|
+
export declare function GettingStarted({ path: outFile, prompt, model, }: GettingStartedProps): Promise<Document>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Document } from "../ai";
|
|
2
|
+
import { alchemy } from "../alchemy";
|
|
3
|
+
export async function GettingStarted({ path: outFile, prompt, model = {
|
|
4
|
+
id: "claude-3-5-sonnet-latest",
|
|
5
|
+
provider: "anthropic",
|
|
6
|
+
}, }) {
|
|
7
|
+
return Document(`docs/getting-started`, {
|
|
8
|
+
title: "Getting Started Guide",
|
|
9
|
+
path: typeof outFile === "string" ? outFile : outFile.path,
|
|
10
|
+
model,
|
|
11
|
+
prompt: await alchemy `
|
|
12
|
+
You are a technical writer creating a getting started guide.
|
|
13
|
+
|
|
14
|
+
${prompt}
|
|
15
|
+
|
|
16
|
+
If you need a template structure to follow, use this format:
|
|
17
|
+
|
|
18
|
+
# Getting Started with [Product/Framework Name]
|
|
19
|
+
|
|
20
|
+
(Brief introduction to the product/framework)
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
\`\`\`bash
|
|
25
|
+
# Installation command
|
|
26
|
+
\`\`\`
|
|
27
|
+
|
|
28
|
+
## Creating Your First Project
|
|
29
|
+
|
|
30
|
+
(Step-by-step guide to creating a basic project)
|
|
31
|
+
|
|
32
|
+
\`\`\`ts
|
|
33
|
+
// Example of a simple project
|
|
34
|
+
\`\`\`
|
|
35
|
+
|
|
36
|
+
## Core Concepts
|
|
37
|
+
|
|
38
|
+
### [Concept 1]
|
|
39
|
+
|
|
40
|
+
(Explanation of the first core concept)
|
|
41
|
+
|
|
42
|
+
\`\`\`ts
|
|
43
|
+
// Example of using the concept
|
|
44
|
+
\`\`\`
|
|
45
|
+
|
|
46
|
+
### [Concept 2]
|
|
47
|
+
|
|
48
|
+
(Explanation of the second core concept)
|
|
49
|
+
|
|
50
|
+
\`\`\`ts
|
|
51
|
+
// Example of using the concept
|
|
52
|
+
\`\`\`
|
|
53
|
+
|
|
54
|
+
## Working with [Feature]
|
|
55
|
+
|
|
56
|
+
(How to use a specific feature)
|
|
57
|
+
|
|
58
|
+
\`\`\`ts
|
|
59
|
+
// Example of using the feature
|
|
60
|
+
\`\`\`
|
|
61
|
+
|
|
62
|
+
## Testing
|
|
63
|
+
|
|
64
|
+
(How to test your project)
|
|
65
|
+
|
|
66
|
+
\`\`\`ts
|
|
67
|
+
// Example of testing
|
|
68
|
+
\`\`\`
|
|
69
|
+
|
|
70
|
+
## Deployment
|
|
71
|
+
|
|
72
|
+
(How to deploy your project)
|
|
73
|
+
|
|
74
|
+
\`\`\`ts
|
|
75
|
+
// Example of deployment
|
|
76
|
+
\`\`\`
|
|
77
|
+
|
|
78
|
+
## Next Steps
|
|
79
|
+
|
|
80
|
+
(Where to go next to learn more)
|
|
81
|
+
|
|
82
|
+
> [!TIP]
|
|
83
|
+
> Make sure the examples follow a natural progression from minimal examples to more complex use cases.
|
|
84
|
+
> Keep explanations concise and focused on high-value information.
|
|
85
|
+
`,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Document } from "../ai";
|
|
2
|
+
import { Folder } from "../fs";
|
|
3
|
+
export interface DocsProps {
|
|
4
|
+
/**
|
|
5
|
+
* The output directory for the docs.
|
|
6
|
+
*/
|
|
7
|
+
outDir: string | Folder;
|
|
8
|
+
/**
|
|
9
|
+
* The source directory for the docs.
|
|
10
|
+
*/
|
|
11
|
+
srcDir: string;
|
|
12
|
+
/**
|
|
13
|
+
* Whether to filter the docs.
|
|
14
|
+
* If true, include all docs.
|
|
15
|
+
* If false, include none.
|
|
16
|
+
* If a number, include that many providers.
|
|
17
|
+
*
|
|
18
|
+
* @default true (all docs)
|
|
19
|
+
*/
|
|
20
|
+
filter?: boolean | number;
|
|
21
|
+
}
|
|
22
|
+
export type AlchemyProviderDocs = {
|
|
23
|
+
dir: string;
|
|
24
|
+
provider: string;
|
|
25
|
+
documents: Document[];
|
|
26
|
+
}[];
|
|
27
|
+
export declare function AlchemyProviderDocs({ srcDir, outDir, filter, }: DocsProps): Promise<AlchemyProviderDocs>;
|