alchemy 0.12.21 → 0.14.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/lib/ai/client.d.ts.map +1 -1
- package/lib/ai/client.js +3 -5
- package/lib/ai/client.js.map +1 -1
- package/lib/alchemy.d.ts +2 -1
- package/lib/alchemy.d.ts.map +1 -1
- package/lib/alchemy.js +87 -92
- package/lib/alchemy.js.map +1 -1
- package/lib/apply.d.ts.map +1 -1
- package/lib/apply.js +6 -1
- package/lib/apply.js.map +1 -1
- package/lib/aws/bucket.d.ts.map +1 -1
- package/lib/aws/bucket.js +55 -57
- package/lib/aws/bucket.js.map +1 -1
- package/lib/aws/function.d.ts.map +1 -1
- package/lib/aws/function.js +250 -252
- package/lib/aws/function.js.map +1 -1
- package/lib/aws/policy-attachment.d.ts.map +1 -1
- package/lib/aws/policy-attachment.js +4 -6
- package/lib/aws/policy-attachment.js.map +1 -1
- package/lib/aws/policy.d.ts.map +1 -1
- package/lib/aws/policy.js +63 -65
- package/lib/aws/policy.js.map +1 -1
- package/lib/aws/queue.js +88 -90
- package/lib/aws/queue.js.map +1 -1
- package/lib/aws/table.d.ts.map +1 -1
- package/lib/aws/table.js +95 -99
- package/lib/aws/table.js.map +1 -1
- package/lib/cloudflare/account-api-token.d.ts +1 -1
- package/lib/cloudflare/account-api-token.d.ts.map +1 -1
- package/lib/cloudflare/account-api-token.js +0 -1
- package/lib/cloudflare/account-api-token.js.map +1 -1
- package/lib/cloudflare/ai-gateway.js.map +1 -1
- package/lib/cloudflare/ai.d.ts +1 -1
- package/lib/cloudflare/ai.d.ts.map +1 -1
- package/lib/cloudflare/ai.js.map +1 -1
- package/lib/cloudflare/api.d.ts +5 -5
- package/lib/cloudflare/api.d.ts.map +1 -1
- package/lib/cloudflare/api.js +52 -15
- package/lib/cloudflare/api.js.map +1 -1
- package/lib/cloudflare/auth.d.ts +24 -55
- package/lib/cloudflare/auth.d.ts.map +1 -1
- package/lib/cloudflare/auth.js +15 -72
- package/lib/cloudflare/auth.js.map +1 -1
- package/lib/cloudflare/bucket.d.ts +2 -2
- package/lib/cloudflare/bucket.d.ts.map +1 -1
- package/lib/cloudflare/bucket.js +22 -24
- package/lib/cloudflare/bucket.js.map +1 -1
- package/lib/cloudflare/bundle/alias-plugin.d.ts +6 -0
- package/lib/cloudflare/bundle/alias-plugin.d.ts.map +1 -0
- package/lib/cloudflare/bundle/alias-plugin.js +36 -0
- package/lib/cloudflare/bundle/alias-plugin.js.map +1 -0
- package/lib/cloudflare/bundle/build-failures.d.ts +12 -0
- package/lib/cloudflare/bundle/build-failures.d.ts.map +1 -0
- package/lib/cloudflare/bundle/build-failures.js +45 -0
- package/lib/cloudflare/bundle/build-failures.js.map +1 -0
- package/lib/cloudflare/bundle/bundle-worker.d.ts +7 -0
- package/lib/cloudflare/bundle/bundle-worker.d.ts.map +1 -0
- package/lib/cloudflare/bundle/bundle-worker.js +69 -0
- package/lib/cloudflare/bundle/bundle-worker.js.map +1 -0
- package/lib/cloudflare/bundle/external.d.ts +1 -0
- package/lib/cloudflare/bundle/external.d.ts.map +1 -1
- package/lib/cloudflare/bundle/external.js +8 -1
- package/lib/cloudflare/bundle/external.js.map +1 -1
- package/lib/cloudflare/bundle/local-dev-cloudflare-shim.d.ts +1 -1
- package/lib/cloudflare/bundle/local-dev-cloudflare-shim.d.ts.map +1 -1
- package/lib/cloudflare/bundle/local-dev-cloudflare-shim.js +6 -6
- package/lib/cloudflare/bundle/local-dev-cloudflare-shim.js.map +1 -1
- package/lib/cloudflare/bundle/nodejs-compat-mode.d.ts +17 -0
- package/lib/cloudflare/bundle/nodejs-compat-mode.d.ts.map +1 -0
- package/lib/cloudflare/bundle/nodejs-compat-mode.js +27 -0
- package/lib/cloudflare/bundle/nodejs-compat-mode.js.map +1 -0
- package/lib/cloudflare/bundle/{hybrid-nodejs-compat.d.ts → nodejs-compat.d.ts} +2 -2
- package/lib/cloudflare/bundle/nodejs-compat.d.ts.map +1 -0
- package/lib/cloudflare/bundle/{hybrid-nodejs-compat.js → nodejs-compat.js} +2 -2
- package/lib/cloudflare/bundle/nodejs-compat.js.map +1 -0
- package/lib/cloudflare/custom-domain.d.ts.map +1 -1
- package/lib/cloudflare/custom-domain.js +3 -5
- package/lib/cloudflare/custom-domain.js.map +1 -1
- package/lib/cloudflare/d1-database.d.ts +1 -1
- package/lib/cloudflare/d1-database.d.ts.map +1 -1
- package/lib/cloudflare/d1-database.js +70 -72
- package/lib/cloudflare/d1-database.js.map +1 -1
- package/lib/cloudflare/d1-migrations.d.ts +1 -1
- package/lib/cloudflare/d1-migrations.d.ts.map +1 -1
- package/lib/cloudflare/d1-migrations.js +2 -3
- package/lib/cloudflare/d1-migrations.js.map +1 -1
- package/lib/cloudflare/dns-records.d.ts.map +1 -1
- package/lib/cloudflare/dns-records.js +2 -4
- package/lib/cloudflare/dns-records.js.map +1 -1
- package/lib/cloudflare/kv-namespace.d.ts +1 -1
- package/lib/cloudflare/kv-namespace.d.ts.map +1 -1
- package/lib/cloudflare/kv-namespace.js +24 -27
- package/lib/cloudflare/kv-namespace.js.map +1 -1
- package/lib/cloudflare/pipeline.d.ts +1 -1
- package/lib/cloudflare/pipeline.d.ts.map +1 -1
- package/lib/cloudflare/pipeline.js +32 -34
- package/lib/cloudflare/pipeline.js.map +1 -1
- package/lib/cloudflare/queue-consumer.d.ts +1 -1
- package/lib/cloudflare/queue-consumer.d.ts.map +1 -1
- package/lib/cloudflare/queue-consumer.js +27 -33
- package/lib/cloudflare/queue-consumer.js.map +1 -1
- package/lib/cloudflare/queue.d.ts +1 -1
- package/lib/cloudflare/queue.d.ts.map +1 -1
- package/lib/cloudflare/queue.js +36 -38
- package/lib/cloudflare/queue.js.map +1 -1
- package/lib/cloudflare/r2-rest-state-store.js +4 -8
- package/lib/cloudflare/r2-rest-state-store.js.map +1 -1
- package/lib/cloudflare/types.d.ts.map +1 -1
- package/lib/cloudflare/types.js +1 -3
- package/lib/cloudflare/types.js.map +1 -1
- package/lib/cloudflare/user.d.ts +51 -0
- package/lib/cloudflare/user.d.ts.map +1 -0
- package/lib/cloudflare/user.js +62 -0
- package/lib/cloudflare/user.js.map +1 -0
- package/lib/cloudflare/vectorize-index.d.ts.map +1 -1
- package/lib/cloudflare/vectorize-index.js +37 -39
- package/lib/cloudflare/vectorize-index.js.map +1 -1
- package/lib/cloudflare/vectorize-metadata-index.d.ts +1 -1
- package/lib/cloudflare/vectorize-metadata-index.d.ts.map +1 -1
- package/lib/cloudflare/vectorize-metadata-index.js +10 -13
- package/lib/cloudflare/vectorize-metadata-index.js.map +1 -1
- package/lib/cloudflare/worker.d.ts +18 -3
- package/lib/cloudflare/worker.d.ts.map +1 -1
- package/lib/cloudflare/worker.js +11 -54
- package/lib/cloudflare/worker.js.map +1 -1
- package/lib/cloudflare/workflow.d.ts +1 -1
- package/lib/cloudflare/workflow.d.ts.map +1 -1
- package/lib/cloudflare/workflow.js.map +1 -1
- package/lib/cloudflare/zone.d.ts.map +1 -1
- package/lib/cloudflare/zone.js +48 -50
- package/lib/cloudflare/zone.js.map +1 -1
- package/lib/dns/godaddy.js +1 -1
- package/lib/dns/import-dns.js +1 -1
- package/lib/dns/import-dns.js.map +1 -1
- package/lib/env.js +7 -9
- package/lib/env.js.map +1 -1
- package/lib/esbuild/bundle.d.ts.map +1 -1
- package/lib/esbuild/bundle.js +8 -11
- package/lib/esbuild/bundle.js.map +1 -1
- package/lib/fs/copy-file.d.ts.map +1 -1
- package/lib/fs/copy-file.js +27 -29
- package/lib/fs/copy-file.js.map +1 -1
- package/lib/fs/file.d.ts +1 -1
- package/lib/fs/file.d.ts.map +1 -1
- package/lib/fs/file.js +1 -1
- package/lib/fs/file.js.map +1 -1
- package/lib/fs/folder.d.ts.map +1 -1
- package/lib/fs/folder.js +1 -3
- package/lib/fs/folder.js.map +1 -1
- package/lib/github/client.d.ts.map +1 -1
- package/lib/github/client.js +3 -5
- package/lib/github/client.js.map +1 -1
- package/lib/github/repository-environment.d.ts.map +1 -1
- package/lib/github/repository-environment.js +173 -176
- package/lib/github/repository-environment.js.map +1 -1
- package/lib/github/secret.d.ts.map +1 -1
- package/lib/github/secret.js +97 -99
- package/lib/github/secret.js.map +1 -1
- package/lib/internal/docs/providers.d.ts.map +1 -1
- package/lib/internal/docs/providers.js +5 -7
- package/lib/internal/docs/providers.js.map +1 -1
- package/lib/neon/api.js +1 -2
- package/lib/neon/api.js.map +1 -1
- package/lib/neon/project.js +2 -2
- package/lib/neon/project.js.map +1 -1
- package/lib/os/exec.d.ts +5 -0
- package/lib/os/exec.d.ts.map +1 -1
- package/lib/os/exec.js +88 -56
- package/lib/os/exec.js.map +1 -1
- package/lib/scope.d.ts +3 -0
- package/lib/scope.d.ts.map +1 -1
- package/lib/scope.js +10 -3
- package/lib/scope.js.map +1 -1
- package/lib/secret.d.ts.map +1 -1
- package/lib/secret.js +1 -3
- package/lib/secret.js.map +1 -1
- package/lib/serde.d.ts.map +1 -1
- package/lib/serde.js +13 -15
- package/lib/serde.js.map +1 -1
- package/lib/stripe/price.d.ts.map +1 -1
- package/lib/stripe/price.js +69 -73
- package/lib/stripe/price.js.map +1 -1
- package/lib/stripe/product.d.ts.map +1 -1
- package/lib/stripe/product.js +50 -52
- package/lib/stripe/product.js.map +1 -1
- package/lib/stripe/webhook.d.ts.map +1 -1
- package/lib/stripe/webhook.js +51 -53
- package/lib/stripe/webhook.js.map +1 -1
- package/lib/test/bun.d.ts +1 -1
- package/lib/test/bun.d.ts.map +1 -1
- package/lib/test/bun.js +3 -8
- package/lib/test/bun.js.map +1 -1
- package/lib/test/prune.d.ts.map +1 -1
- package/lib/test/prune.js.map +1 -1
- package/lib/util/dedent.js +4 -4
- package/lib/util/dedent.js.map +1 -1
- package/lib/web/astro.js +1 -1
- package/lib/web/shadcn.js +4 -4
- package/lib/web/shadcn.js.map +1 -1
- package/lib/web/tailwind.d.ts.map +1 -1
- package/lib/web/tailwind.js +0 -1
- package/lib/web/tailwind.js.map +1 -1
- package/lib/web/vite.js +3 -3
- package/lib/web/vitepress/home-page.d.ts.map +1 -1
- package/lib/web/vitepress/home-page.js +6 -8
- package/lib/web/vitepress/home-page.js.map +1 -1
- package/lib/web/vitepress/process-front-matter-files.js +1 -1
- package/lib/web/vitepress/process-front-matter-files.js.map +1 -1
- package/lib/web/vitepress/vitepress.js +2 -2
- package/lib/web/vitepress/vitepress.js.map +1 -1
- package/package.json +4 -1
- package/src/ai/astro-file.ts +4 -4
- package/src/ai/client.ts +4 -5
- package/src/ai/css-file.ts +4 -4
- package/src/ai/document.ts +3 -3
- package/src/ai/html-file.ts +4 -4
- package/src/ai/json-file.ts +1 -1
- package/src/ai/typescript-file.ts +4 -4
- package/src/ai/vue-file.ts +4 -4
- package/src/ai/yaml-file.ts +1 -1
- package/src/alchemy.ts +111 -104
- package/src/apply.ts +13 -6
- package/src/aws/bucket.ts +72 -75
- package/src/aws/function.ts +296 -297
- package/src/aws/oidc/github-oidc-provider.ts +1 -1
- package/src/aws/oidc/oidc-provider.ts +15 -15
- package/src/aws/policy-attachment.ts +10 -11
- package/src/aws/policy.ts +91 -94
- package/src/aws/queue.ts +111 -111
- package/src/aws/role.ts +24 -24
- package/src/aws/ses.ts +17 -17
- package/src/aws/table.ts +114 -115
- package/src/cloudflare/account-api-token.ts +11 -11
- package/src/cloudflare/ai-gateway.ts +4 -4
- package/src/cloudflare/ai.ts +1 -1
- package/src/cloudflare/api-error.ts +1 -1
- package/src/cloudflare/api.ts +70 -25
- package/src/cloudflare/assets.ts +4 -4
- package/src/cloudflare/auth.ts +49 -164
- package/src/cloudflare/bucket.ts +62 -63
- package/src/cloudflare/bundle/alias-plugin.ts +48 -0
- package/src/cloudflare/bundle/build-failures.ts +55 -0
- package/src/cloudflare/bundle/bundle-worker.ts +89 -0
- package/src/cloudflare/bundle/external.ts +9 -1
- package/src/cloudflare/bundle/local-dev-cloudflare-shim.ts +7 -6
- package/src/cloudflare/bundle/nodejs-compat-mode.ts +49 -0
- package/src/cloudflare/bundle/{hybrid-nodejs-compat.ts → nodejs-compat.ts} +10 -10
- package/src/cloudflare/custom-domain.ts +27 -28
- package/src/cloudflare/d1-database.ts +101 -102
- package/src/cloudflare/d1-migrations.ts +10 -10
- package/src/cloudflare/dns-records.ts +23 -24
- package/src/cloudflare/durable-object-namespace.ts +1 -1
- package/src/cloudflare/event-source.ts +1 -1
- package/src/cloudflare/hyperdrive.ts +3 -3
- package/src/cloudflare/kv-namespace.ts +36 -37
- package/src/cloudflare/nuxt.ts +1 -1
- package/src/cloudflare/permission-groups.ts +7 -7
- package/src/cloudflare/pipeline.ts +55 -56
- package/src/cloudflare/queue-consumer.ts +46 -53
- package/src/cloudflare/queue.ts +56 -57
- package/src/cloudflare/r2-rest-state-store.ts +11 -11
- package/src/cloudflare/redwood.ts +1 -1
- package/src/cloudflare/tanstack-start.ts +1 -1
- package/src/cloudflare/types.ts +1 -2
- package/src/cloudflare/user.ts +142 -0
- package/src/cloudflare/vectorize-index.ts +60 -61
- package/src/cloudflare/vectorize-metadata-index.ts +25 -25
- package/src/cloudflare/vite.ts +1 -1
- package/src/cloudflare/website.ts +3 -3
- package/src/cloudflare/worker.ts +83 -108
- package/src/cloudflare/workflow.ts +4 -4
- package/src/cloudflare/wrangler.json.ts +4 -4
- package/src/cloudflare/zone.ts +69 -70
- package/src/destroy.ts +4 -4
- package/src/dns/godaddy.ts +1 -1
- package/src/dns/import-dns.ts +5 -5
- package/src/encrypt.ts +6 -6
- package/src/env.ts +10 -10
- package/src/esbuild/bundle.ts +14 -15
- package/src/fs/copy-file.ts +35 -36
- package/src/fs/file-system-state-store.ts +4 -4
- package/src/fs/file.ts +9 -8
- package/src/fs/folder.ts +6 -7
- package/src/github/client.ts +15 -14
- package/src/github/repository-environment.ts +206 -210
- package/src/github/secret.ts +111 -116
- package/src/internal/docs/providers.ts +16 -17
- package/src/neon/api-error.ts +1 -1
- package/src/neon/api.ts +6 -6
- package/src/neon/project.ts +18 -17
- package/src/os/exec.ts +107 -66
- package/src/resource.ts +3 -3
- package/src/scope.ts +14 -4
- package/src/secret.ts +2 -3
- package/src/serde.ts +30 -22
- package/src/stripe/price.ts +74 -77
- package/src/stripe/product.ts +55 -56
- package/src/stripe/webhook.ts +56 -57
- package/src/test/bun.ts +9 -13
- package/src/test/prune.ts +4 -4
- package/src/util/dedent.ts +4 -4
- package/src/web/astro.ts +10 -10
- package/src/web/shadcn-component.ts +4 -4
- package/src/web/shadcn.ts +10 -10
- package/src/web/tailwind.ts +2 -3
- package/src/web/vite.ts +11 -11
- package/src/web/vitepress/config.ts +2 -2
- package/src/web/vitepress/custom-theme.ts +7 -7
- package/src/web/vitepress/dependencies.ts +4 -4
- package/src/web/vitepress/home-page.ts +8 -9
- package/src/web/vitepress/process-front-matter-files.ts +5 -5
- package/src/web/vitepress/vitepress.ts +7 -7
- package/lib/cloudflare/account-id.d.ts +0 -6
- package/lib/cloudflare/account-id.d.ts.map +0 -1
- package/lib/cloudflare/account-id.js +0 -6
- package/lib/cloudflare/account-id.js.map +0 -1
- package/lib/cloudflare/bundle/hybrid-nodejs-compat.d.ts.map +0 -1
- package/lib/cloudflare/bundle/hybrid-nodejs-compat.js.map +0 -1
- package/src/cloudflare/account-id.ts +0 -12
package/src/stripe/product.ts
CHANGED
|
@@ -142,7 +142,7 @@ export const Product = Resource(
|
|
|
142
142
|
async function (
|
|
143
143
|
this: Context<Product>,
|
|
144
144
|
id: string,
|
|
145
|
-
props: ProductProps
|
|
145
|
+
props: ProductProps,
|
|
146
146
|
): Promise<Product> {
|
|
147
147
|
// Get Stripe API key from context or environment
|
|
148
148
|
const apiKey = process.env.STRIPE_API_KEY;
|
|
@@ -165,62 +165,61 @@ export const Product = Resource(
|
|
|
165
165
|
|
|
166
166
|
// Return a minimal output for deleted state
|
|
167
167
|
return this.destroy();
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
return this({
|
|
202
|
-
id: product.id,
|
|
203
|
-
name: product.name,
|
|
204
|
-
description: product.description || undefined,
|
|
205
|
-
active: product.active,
|
|
206
|
-
images: product.images || undefined,
|
|
207
|
-
url: product.url || undefined,
|
|
208
|
-
shippable: product.shippable || undefined,
|
|
209
|
-
type: product.type as ProductType,
|
|
210
|
-
unitLabel: product.unit_label || undefined,
|
|
211
|
-
statementDescriptor: product.statement_descriptor || undefined,
|
|
212
|
-
metadata: product.metadata || undefined,
|
|
213
|
-
taxCode:
|
|
214
|
-
typeof product.tax_code === "string" ? product.tax_code : undefined,
|
|
215
|
-
createdAt: product.created,
|
|
216
|
-
livemode: product.livemode,
|
|
217
|
-
updatedAt: product.updated,
|
|
218
|
-
packageDimensions: product.package_dimensions || undefined,
|
|
168
|
+
}
|
|
169
|
+
try {
|
|
170
|
+
let product: Stripe.Product;
|
|
171
|
+
|
|
172
|
+
if (this.phase === "update" && this.output?.id) {
|
|
173
|
+
// Update existing product
|
|
174
|
+
product = await stripe.products.update(this.output.id, {
|
|
175
|
+
name: props.name,
|
|
176
|
+
description: props.description,
|
|
177
|
+
active: props.active,
|
|
178
|
+
images: props.images,
|
|
179
|
+
url: props.url,
|
|
180
|
+
statement_descriptor: props.statementDescriptor,
|
|
181
|
+
metadata: props.metadata,
|
|
182
|
+
tax_code: props.taxCode,
|
|
183
|
+
});
|
|
184
|
+
} else {
|
|
185
|
+
// Create new product
|
|
186
|
+
product = await stripe.products.create({
|
|
187
|
+
name: props.name,
|
|
188
|
+
description: props.description,
|
|
189
|
+
active: props.active,
|
|
190
|
+
images: props.images,
|
|
191
|
+
url: props.url,
|
|
192
|
+
shippable: props.shippable,
|
|
193
|
+
type: props.type as Stripe.ProductCreateParams.Type,
|
|
194
|
+
unit_label: props.unitLabel,
|
|
195
|
+
statement_descriptor: props.statementDescriptor,
|
|
196
|
+
metadata: props.metadata,
|
|
197
|
+
tax_code: props.taxCode,
|
|
219
198
|
});
|
|
220
|
-
} catch (error) {
|
|
221
|
-
console.error("Error creating/updating product:", error);
|
|
222
|
-
throw error;
|
|
223
199
|
}
|
|
200
|
+
|
|
201
|
+
return this({
|
|
202
|
+
id: product.id,
|
|
203
|
+
name: product.name,
|
|
204
|
+
description: product.description || undefined,
|
|
205
|
+
active: product.active,
|
|
206
|
+
images: product.images || undefined,
|
|
207
|
+
url: product.url || undefined,
|
|
208
|
+
shippable: product.shippable || undefined,
|
|
209
|
+
type: product.type as ProductType,
|
|
210
|
+
unitLabel: product.unit_label || undefined,
|
|
211
|
+
statementDescriptor: product.statement_descriptor || undefined,
|
|
212
|
+
metadata: product.metadata || undefined,
|
|
213
|
+
taxCode:
|
|
214
|
+
typeof product.tax_code === "string" ? product.tax_code : undefined,
|
|
215
|
+
createdAt: product.created,
|
|
216
|
+
livemode: product.livemode,
|
|
217
|
+
updatedAt: product.updated,
|
|
218
|
+
packageDimensions: product.package_dimensions || undefined,
|
|
219
|
+
});
|
|
220
|
+
} catch (error) {
|
|
221
|
+
console.error("Error creating/updating product:", error);
|
|
222
|
+
throw error;
|
|
224
223
|
}
|
|
225
|
-
}
|
|
224
|
+
},
|
|
226
225
|
);
|
package/src/stripe/webhook.ts
CHANGED
|
@@ -136,7 +136,7 @@ export const WebhookEndpoint = Resource(
|
|
|
136
136
|
async function (
|
|
137
137
|
this: Context<WebhookEndpoint>,
|
|
138
138
|
id: string,
|
|
139
|
-
props: WebhookEndpointProps
|
|
139
|
+
props: WebhookEndpointProps,
|
|
140
140
|
) {
|
|
141
141
|
// Get Stripe API key from context or environment
|
|
142
142
|
const apiKey = process.env.STRIPE_API_KEY;
|
|
@@ -159,65 +159,64 @@ export const WebhookEndpoint = Resource(
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
return this.destroy();
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
// For connect parameter, need to handle it separately if it exists
|
|
185
|
-
if (props.connect !== undefined) {
|
|
186
|
-
// Note: connect is specified at creation time and cannot be updated
|
|
187
|
-
console.log(
|
|
188
|
-
"Note: 'connect' parameter will be applied at creation time only"
|
|
189
|
-
);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
162
|
+
}
|
|
163
|
+
try {
|
|
164
|
+
let webhook: Stripe.WebhookEndpoint;
|
|
165
|
+
|
|
166
|
+
if (this.phase === "update" && this.output?.id) {
|
|
167
|
+
// Update existing webhook
|
|
168
|
+
webhook = await stripe.webhookEndpoints.update(this.output.id, {
|
|
169
|
+
url: props.url,
|
|
170
|
+
enabled_events: props.enabledEvents,
|
|
171
|
+
description: props.description,
|
|
172
|
+
disabled: props.active === false,
|
|
173
|
+
metadata: props.metadata,
|
|
174
|
+
});
|
|
175
|
+
} else {
|
|
176
|
+
// Create new webhook
|
|
177
|
+
webhook = await stripe.webhookEndpoints.create({
|
|
178
|
+
url: props.url,
|
|
179
|
+
enabled_events: props.enabledEvents,
|
|
180
|
+
description: props.description,
|
|
181
|
+
metadata: props.metadata,
|
|
182
|
+
});
|
|
192
183
|
|
|
193
|
-
//
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
184
|
+
// For connect parameter, need to handle it separately if it exists
|
|
185
|
+
if (props.connect !== undefined) {
|
|
186
|
+
// Note: connect is specified at creation time and cannot be updated
|
|
187
|
+
console.log(
|
|
188
|
+
"Note: 'connect' parameter will be applied at creation time only",
|
|
189
|
+
);
|
|
199
190
|
}
|
|
191
|
+
}
|
|
200
192
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
apiVersion: webhook.api_version || undefined,
|
|
208
|
-
// connect: !!webhook.connect,
|
|
209
|
-
metadata: webhook.metadata || undefined,
|
|
210
|
-
secret: secret,
|
|
211
|
-
application: webhook.application || undefined,
|
|
212
|
-
createdAt: webhook.created,
|
|
213
|
-
livemode: webhook.livemode,
|
|
214
|
-
updatedAt: webhook.created, // Using created timestamp as updated
|
|
215
|
-
status: webhook.status,
|
|
216
|
-
});
|
|
217
|
-
} catch (error) {
|
|
218
|
-
console.error("Error creating/updating webhook:", error);
|
|
219
|
-
throw error;
|
|
193
|
+
// Store the secret if available
|
|
194
|
+
let secret = "";
|
|
195
|
+
if (webhook.secret) {
|
|
196
|
+
secret = webhook.secret;
|
|
197
|
+
} else if (this.phase === "update" && this.output?.secret) {
|
|
198
|
+
secret = this.output.secret;
|
|
220
199
|
}
|
|
200
|
+
|
|
201
|
+
return this({
|
|
202
|
+
id: webhook.id,
|
|
203
|
+
url: webhook.url,
|
|
204
|
+
enabledEvents: webhook.enabled_events as EnabledEvent[],
|
|
205
|
+
description: webhook.description || undefined,
|
|
206
|
+
active: webhook.status === "enabled",
|
|
207
|
+
apiVersion: webhook.api_version || undefined,
|
|
208
|
+
// connect: !!webhook.connect,
|
|
209
|
+
metadata: webhook.metadata || undefined,
|
|
210
|
+
secret: secret,
|
|
211
|
+
application: webhook.application || undefined,
|
|
212
|
+
createdAt: webhook.created,
|
|
213
|
+
livemode: webhook.livemode,
|
|
214
|
+
updatedAt: webhook.created, // Using created timestamp as updated
|
|
215
|
+
status: webhook.status,
|
|
216
|
+
});
|
|
217
|
+
} catch (error) {
|
|
218
|
+
console.error("Error creating/updating webhook:", error);
|
|
219
|
+
throw error;
|
|
221
220
|
}
|
|
222
|
-
}
|
|
221
|
+
},
|
|
223
222
|
);
|
package/src/test/bun.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type { StateStoreType } from "../state.js";
|
|
|
10
10
|
/**
|
|
11
11
|
* Extend the Alchemy interface to include test functionality
|
|
12
12
|
*/
|
|
13
|
-
declare module "../alchemy" {
|
|
13
|
+
declare module "../alchemy.js" {
|
|
14
14
|
interface Alchemy {
|
|
15
15
|
test: typeof test;
|
|
16
16
|
}
|
|
@@ -71,7 +71,7 @@ type test = {
|
|
|
71
71
|
name: string,
|
|
72
72
|
options: TestOptions,
|
|
73
73
|
fn: (scope: Scope) => Promise<any>,
|
|
74
|
-
timeout?: number
|
|
74
|
+
timeout?: number,
|
|
75
75
|
): void;
|
|
76
76
|
|
|
77
77
|
/**
|
|
@@ -142,6 +142,7 @@ export function test(meta: ImportMeta, defaultOptions?: TestOptions): test {
|
|
|
142
142
|
scopeName: `${defaultOptions.prefix ? `${defaultOptions.prefix}-` : ""}${path.basename(meta.filename)}`,
|
|
143
143
|
// parent: globalTestScope,
|
|
144
144
|
stateStore: defaultOptions?.stateStore,
|
|
145
|
+
phase: "up",
|
|
145
146
|
});
|
|
146
147
|
|
|
147
148
|
test.beforeAll = (fn: (scope: Scope) => Promise<void>) => {
|
|
@@ -173,8 +174,8 @@ export function test(meta: ImportMeta, defaultOptions?: TestOptions): test {
|
|
|
173
174
|
obj && typeof obj === "object"
|
|
174
175
|
? Object.fromEntries(
|
|
175
176
|
Object.entries(obj).flatMap(([k, v]) =>
|
|
176
|
-
v !== undefined ? [[k, v]] : []
|
|
177
|
-
)
|
|
177
|
+
v !== undefined ? [[k, v]] : [],
|
|
178
|
+
),
|
|
178
179
|
)
|
|
179
180
|
: {};
|
|
180
181
|
|
|
@@ -198,16 +199,11 @@ export function test(meta: ImportMeta, defaultOptions?: TestOptions): test {
|
|
|
198
199
|
parent: scope,
|
|
199
200
|
},
|
|
200
201
|
async (scope) => {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
} catch (err) {
|
|
205
|
-
console.error(err);
|
|
206
|
-
throw err;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
202
|
+
// Enter test scope since bun calls from different scope
|
|
203
|
+
await scope.run(() => fn(scope));
|
|
204
|
+
},
|
|
209
205
|
),
|
|
210
|
-
timeout
|
|
206
|
+
timeout,
|
|
211
207
|
);
|
|
212
208
|
}
|
|
213
209
|
}
|
package/src/test/prune.ts
CHANGED
|
@@ -13,7 +13,7 @@ const execAsync = promisify(exec);
|
|
|
13
13
|
*/
|
|
14
14
|
export async function runChangedTests(
|
|
15
15
|
directory: string,
|
|
16
|
-
baseCommit?: string
|
|
16
|
+
baseCommit?: string,
|
|
17
17
|
): Promise<void> {
|
|
18
18
|
const changedTests = await findChangedTestFiles(directory, baseCommit);
|
|
19
19
|
|
|
@@ -45,7 +45,7 @@ export async function runChangedTests(
|
|
|
45
45
|
*/
|
|
46
46
|
export async function findChangedTestFiles(
|
|
47
47
|
directory: string,
|
|
48
|
-
baseCommit
|
|
48
|
+
baseCommit = "HEAD~1",
|
|
49
49
|
): Promise<string[]> {
|
|
50
50
|
// 1. Find all test files
|
|
51
51
|
const testFiles = await findTestFiles(directory);
|
|
@@ -62,7 +62,7 @@ export async function findChangedTestFiles(
|
|
|
62
62
|
|
|
63
63
|
// Check if any dependencies have changed
|
|
64
64
|
const changedDependencies = [...dependencies].filter((dep) =>
|
|
65
|
-
changedFiles.has(dep)
|
|
65
|
+
changedFiles.has(dep),
|
|
66
66
|
);
|
|
67
67
|
|
|
68
68
|
if (changedDependencies.length > 0) {
|
|
@@ -90,7 +90,7 @@ async function findTestFiles(directory: string): Promise<string[]> {
|
|
|
90
90
|
async function getChangedFiles(baseCommit: string): Promise<Set<string>> {
|
|
91
91
|
// Get changed files from git
|
|
92
92
|
const { stdout: gitOutput } = await execAsync(
|
|
93
|
-
`git diff --name-only ${baseCommit}
|
|
93
|
+
`git diff --name-only ${baseCommit}`,
|
|
94
94
|
);
|
|
95
95
|
|
|
96
96
|
// Convert to set of absolute paths
|
package/src/util/dedent.ts
CHANGED
|
@@ -19,12 +19,12 @@ export function dedent(
|
|
|
19
19
|
...values: any[]
|
|
20
20
|
): string {
|
|
21
21
|
// Combine the template strings and values
|
|
22
|
-
|
|
22
|
+
const result = strings.reduce((acc, str, i) => {
|
|
23
23
|
return acc + str + (values[i] !== undefined ? values[i] : "");
|
|
24
24
|
}, "");
|
|
25
25
|
|
|
26
26
|
// Split into lines
|
|
27
|
-
|
|
27
|
+
const lines = result.split("\n");
|
|
28
28
|
|
|
29
29
|
// Remove ALL leading blank/whitespace-only lines
|
|
30
30
|
while (lines.length > 0 && lines[0].trim() === "") {
|
|
@@ -48,11 +48,11 @@ export function dedent(
|
|
|
48
48
|
const indent = line.match(/^[ \t]*/)?.[0].length || 0;
|
|
49
49
|
// Handle potentially infinite min if all lines are blank (though handled by early return)
|
|
50
50
|
return indent < min ? indent : min;
|
|
51
|
-
},
|
|
51
|
+
}, Number.POSITIVE_INFINITY);
|
|
52
52
|
|
|
53
53
|
// If minIndent remains Infinity (only blank lines existed), return empty string.
|
|
54
54
|
// This case should be caught by the lines.length check above, but belt-and-suspenders.
|
|
55
|
-
if (minIndent ===
|
|
55
|
+
if (minIndent === Number.POSITIVE_INFINITY) {
|
|
56
56
|
return "";
|
|
57
57
|
}
|
|
58
58
|
|
package/src/web/astro.ts
CHANGED
|
@@ -196,7 +196,7 @@ export const AstroProject = Resource(
|
|
|
196
196
|
async function (
|
|
197
197
|
this: Context<AstroProject>,
|
|
198
198
|
id: string,
|
|
199
|
-
props: AstroProjectProps
|
|
199
|
+
props: AstroProjectProps,
|
|
200
200
|
): Promise<AstroProject> {
|
|
201
201
|
const dir = props.dir ?? props.name;
|
|
202
202
|
|
|
@@ -394,7 +394,7 @@ export const AstroProject = Resource(
|
|
|
394
394
|
export default defineConfig({${integrationsStr}${vitePluginsStr}
|
|
395
395
|
site: "https://example.com",
|
|
396
396
|
output: "static"
|
|
397
|
-
})
|
|
397
|
+
});`,
|
|
398
398
|
);
|
|
399
399
|
}
|
|
400
400
|
|
|
@@ -425,14 +425,14 @@ pnpm-debug.log*
|
|
|
425
425
|
# macOS-specific files
|
|
426
426
|
.DS_Store
|
|
427
427
|
.astro/
|
|
428
|
-
|
|
428
|
+
`,
|
|
429
429
|
);
|
|
430
430
|
|
|
431
431
|
// Create .env.d.ts
|
|
432
432
|
await StaticTextFile(
|
|
433
433
|
path.join(dir, "src", "env.d.ts"),
|
|
434
434
|
`/// <reference types="astro/client" />
|
|
435
|
-
|
|
435
|
+
`,
|
|
436
436
|
);
|
|
437
437
|
|
|
438
438
|
// Create a basic layout
|
|
@@ -476,7 +476,7 @@ const { title, description = "Welcome to my Astro site" } = Astro.props;
|
|
|
476
476
|
Bitstream Vera Sans Mono, Courier New, monospace;
|
|
477
477
|
}
|
|
478
478
|
</style>
|
|
479
|
-
|
|
479
|
+
`,
|
|
480
480
|
);
|
|
481
481
|
|
|
482
482
|
// Create a basic index page
|
|
@@ -530,7 +530,7 @@ import Layout from '../layouts/Layout.astro';
|
|
|
530
530
|
padding: 0.3em 0.45em;
|
|
531
531
|
}
|
|
532
532
|
</style>
|
|
533
|
-
|
|
533
|
+
`,
|
|
534
534
|
);
|
|
535
535
|
|
|
536
536
|
// Create public/favicon.svg
|
|
@@ -546,7 +546,7 @@ import Layout from '../layouts/Layout.astro';
|
|
|
546
546
|
</linearGradient>
|
|
547
547
|
</defs>
|
|
548
548
|
</svg>
|
|
549
|
-
|
|
549
|
+
`,
|
|
550
550
|
);
|
|
551
551
|
}
|
|
552
552
|
|
|
@@ -588,7 +588,7 @@ import Layout from '../layouts/Layout.astro';
|
|
|
588
588
|
`@tailwind base;
|
|
589
589
|
@tailwind components;
|
|
590
590
|
@tailwind utilities;
|
|
591
|
-
|
|
591
|
+
`,
|
|
592
592
|
);
|
|
593
593
|
break;
|
|
594
594
|
case "mdx":
|
|
@@ -618,7 +618,7 @@ import Layout from '../layouts/Layout.astro';
|
|
|
618
618
|
const exec = (command: string) => execAsync(command, { cwd });
|
|
619
619
|
|
|
620
620
|
// Install Astro and general dependencies
|
|
621
|
-
await exec(
|
|
621
|
+
await exec("bun add astro");
|
|
622
622
|
|
|
623
623
|
// Install dev dependencies
|
|
624
624
|
const devDepsEntries = Object.entries(props.devDependencies || {});
|
|
@@ -638,5 +638,5 @@ import Layout from '../layouts/Layout.astro';
|
|
|
638
638
|
await exec(`bun add ${depsArg}`);
|
|
639
639
|
}
|
|
640
640
|
}
|
|
641
|
-
}
|
|
641
|
+
},
|
|
642
642
|
);
|
|
@@ -44,13 +44,13 @@ export const ShadcnComponent = Resource(
|
|
|
44
44
|
async function (
|
|
45
45
|
this: Context<ShadcnComponent>,
|
|
46
46
|
id: string,
|
|
47
|
-
props: ShadcnComponentProps
|
|
47
|
+
props: ShadcnComponentProps,
|
|
48
48
|
): Promise<ShadcnComponent> {
|
|
49
49
|
if (this.phase === "delete") {
|
|
50
50
|
await ignore("ENOENT", () =>
|
|
51
51
|
fs.unlink(
|
|
52
|
-
path.join(props.cwd, "src", "components", "ui", `${props.name}.tsx`)
|
|
53
|
-
)
|
|
52
|
+
path.join(props.cwd, "src", "components", "ui", `${props.name}.tsx`),
|
|
53
|
+
),
|
|
54
54
|
);
|
|
55
55
|
return this.destroy();
|
|
56
56
|
}
|
|
@@ -68,5 +68,5 @@ export const ShadcnComponent = Resource(
|
|
|
68
68
|
await execAsync(addCommand, { cwd: props.cwd });
|
|
69
69
|
|
|
70
70
|
return this(props);
|
|
71
|
-
}
|
|
71
|
+
},
|
|
72
72
|
);
|
package/src/web/shadcn.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { exec } from "child_process";
|
|
1
|
+
import { exec } from "node:child_process";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { promisify } from "node:util";
|
|
4
4
|
import type { Context } from "../context.js";
|
|
@@ -121,14 +121,14 @@ export const ShadcnUI = Resource(
|
|
|
121
121
|
async function (
|
|
122
122
|
this: Context<ShadcnUI>,
|
|
123
123
|
id: string,
|
|
124
|
-
props: ShadcnUIProps
|
|
124
|
+
props: ShadcnUIProps,
|
|
125
125
|
): Promise<ShadcnUI> {
|
|
126
126
|
if (this.phase === "delete") {
|
|
127
127
|
// For a delete phase, we don't perform any action
|
|
128
128
|
// as removing Shadcn UI would require removing many files
|
|
129
129
|
// which could be destructive to the project
|
|
130
130
|
console.log(
|
|
131
|
-
"Note: ShadcnUI delete phase does not remove installed components"
|
|
131
|
+
"Note: ShadcnUI delete phase does not remove installed components",
|
|
132
132
|
);
|
|
133
133
|
|
|
134
134
|
return this.destroy();
|
|
@@ -139,11 +139,11 @@ export const ShadcnUI = Resource(
|
|
|
139
139
|
|
|
140
140
|
// Ensure React is installed if not already
|
|
141
141
|
if (!props.react) {
|
|
142
|
-
await exec(
|
|
142
|
+
await exec("bun add react react-dom");
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
// Install shadcn dependencies
|
|
146
|
-
await exec(
|
|
146
|
+
await exec("bun add -D @types/node");
|
|
147
147
|
|
|
148
148
|
// Create components.json directly instead of running shadcn init
|
|
149
149
|
await StaticJsonFile(path.join(props.cwd, "components.json"), {
|
|
@@ -172,15 +172,15 @@ export const ShadcnUI = Resource(
|
|
|
172
172
|
props.cwd,
|
|
173
173
|
props.srcDir !== false ? "src" : "",
|
|
174
174
|
"components",
|
|
175
|
-
"ui"
|
|
176
|
-
)
|
|
175
|
+
"ui",
|
|
176
|
+
),
|
|
177
177
|
);
|
|
178
178
|
|
|
179
179
|
// Create lib directory
|
|
180
180
|
const libPath = path.join(
|
|
181
181
|
props.cwd,
|
|
182
182
|
props.srcDir !== false ? "src" : "",
|
|
183
|
-
"lib"
|
|
183
|
+
"lib",
|
|
184
184
|
);
|
|
185
185
|
const lib = await Folder(libPath);
|
|
186
186
|
|
|
@@ -197,7 +197,7 @@ export const ShadcnUI = Resource(
|
|
|
197
197
|
await StaticTypeScriptFile(path.join(libPath, "utils.ts"), utilsContent);
|
|
198
198
|
|
|
199
199
|
// Install clsx and tailwind-merge
|
|
200
|
-
await exec(
|
|
200
|
+
await exec("bun add clsx tailwind-merge");
|
|
201
201
|
|
|
202
202
|
// Install requested components
|
|
203
203
|
if (props.components && props.components.length > 0) {
|
|
@@ -216,5 +216,5 @@ export const ShadcnUI = Resource(
|
|
|
216
216
|
ui,
|
|
217
217
|
lib,
|
|
218
218
|
});
|
|
219
|
-
}
|
|
219
|
+
},
|
|
220
220
|
);
|
package/src/web/tailwind.ts
CHANGED
|
@@ -82,7 +82,7 @@ export const TailwindConfig = Resource(
|
|
|
82
82
|
async function (
|
|
83
83
|
this: Context<TailwindConfig>,
|
|
84
84
|
id: string,
|
|
85
|
-
props: TailwindConfigProps
|
|
85
|
+
props: TailwindConfigProps,
|
|
86
86
|
): Promise<TailwindConfig> {
|
|
87
87
|
if (this.phase === "delete") {
|
|
88
88
|
// Nothing to clean up specifically for Tailwind
|
|
@@ -139,7 +139,6 @@ export const TailwindConfig = Resource(
|
|
|
139
139
|
return ["@astrojs/tailwind"];
|
|
140
140
|
case "next":
|
|
141
141
|
return [];
|
|
142
|
-
case "standalone":
|
|
143
142
|
default:
|
|
144
143
|
return [];
|
|
145
144
|
}
|
|
@@ -164,5 +163,5 @@ export const TailwindConfig = Resource(
|
|
|
164
163
|
// Create CSS file with Tailwind directives
|
|
165
164
|
await StaticTextFile(cssPath, tailwindDirectives);
|
|
166
165
|
}
|
|
167
|
-
}
|
|
166
|
+
},
|
|
168
167
|
);
|
package/src/web/vite.ts
CHANGED
|
@@ -138,7 +138,7 @@ export const ViteProject = Resource(
|
|
|
138
138
|
async function (
|
|
139
139
|
this: Context<ViteProject>,
|
|
140
140
|
id: string,
|
|
141
|
-
props: ViteProjectProps
|
|
141
|
+
props: ViteProjectProps,
|
|
142
142
|
): Promise<ViteProject> {
|
|
143
143
|
const phase = this.phase;
|
|
144
144
|
if (this.phase === "delete") {
|
|
@@ -157,7 +157,7 @@ export const ViteProject = Resource(
|
|
|
157
157
|
await modifyConfig(props);
|
|
158
158
|
} else {
|
|
159
159
|
console.warn(
|
|
160
|
-
"ViteProject does not support updates - the project must be recreated to change the template"
|
|
160
|
+
"ViteProject does not support updates - the project must be recreated to change the template",
|
|
161
161
|
);
|
|
162
162
|
}
|
|
163
163
|
} else {
|
|
@@ -211,7 +211,7 @@ export const ViteProject = Resource(
|
|
|
211
211
|
|
|
212
212
|
async function build() {
|
|
213
213
|
// tsc -b will fail if we have not invoked tan stacks' code gen
|
|
214
|
-
await execAsync(
|
|
214
|
+
await execAsync("bun vite build", { cwd: props.name });
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
async function installTailwind() {
|
|
@@ -236,7 +236,7 @@ export default defineConfig({
|
|
|
236
236
|
"@": path.resolve(__dirname, "./src"),
|
|
237
237
|
},
|
|
238
238
|
},
|
|
239
|
-
})
|
|
239
|
+
});`,
|
|
240
240
|
);
|
|
241
241
|
}
|
|
242
242
|
|
|
@@ -272,9 +272,9 @@ export default defineConfig({
|
|
|
272
272
|
}
|
|
273
273
|
|
|
274
274
|
async function installTanstack() {
|
|
275
|
-
await exec(
|
|
275
|
+
await exec("bun add @tanstack/react-router");
|
|
276
276
|
await exec(
|
|
277
|
-
|
|
277
|
+
"bun add -D @tanstack/router-plugin @tanstack/react-router-devtools",
|
|
278
278
|
);
|
|
279
279
|
|
|
280
280
|
const src = path.join(props.name, "src");
|
|
@@ -308,7 +308,7 @@ export const Route = createRootRoute({
|
|
|
308
308
|
</div>
|
|
309
309
|
),
|
|
310
310
|
});
|
|
311
|
-
|
|
311
|
+
`,
|
|
312
312
|
);
|
|
313
313
|
|
|
314
314
|
// Create index route file
|
|
@@ -326,7 +326,7 @@ function Index() {
|
|
|
326
326
|
<h3>Welcome Home!</h3>
|
|
327
327
|
</div>
|
|
328
328
|
)
|
|
329
|
-
}
|
|
329
|
+
}`,
|
|
330
330
|
);
|
|
331
331
|
|
|
332
332
|
// Create about route file
|
|
@@ -340,7 +340,7 @@ export const Route = createLazyFileRoute('/about')({
|
|
|
340
340
|
|
|
341
341
|
function About() {
|
|
342
342
|
return <div className="p-2">Hello from About!</div>
|
|
343
|
-
}
|
|
343
|
+
}`,
|
|
344
344
|
);
|
|
345
345
|
|
|
346
346
|
// Create main.tsx
|
|
@@ -373,7 +373,7 @@ if (!rootElement.innerHTML) {
|
|
|
373
373
|
<RouterProvider router={router} />
|
|
374
374
|
</StrictMode>,
|
|
375
375
|
)
|
|
376
|
-
}
|
|
376
|
+
}`,
|
|
377
377
|
);
|
|
378
378
|
}
|
|
379
379
|
|
|
@@ -402,5 +402,5 @@ if (!rootElement.innerHTML) {
|
|
|
402
402
|
});
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
|
-
}
|
|
405
|
+
},
|
|
406
406
|
);
|