alchemy 0.25.0 → 0.26.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 +7 -0
- package/lib/ai/astro-file.d.ts.map +1 -1
- package/lib/ai/astro-file.js +2 -1
- package/lib/ai/astro-file.js.map +1 -1
- package/lib/ai/client.d.ts.map +1 -1
- package/lib/ai/client.js +3 -2
- package/lib/ai/client.js.map +1 -1
- package/lib/alchemy.d.ts +7 -0
- package/lib/alchemy.d.ts.map +1 -1
- package/lib/alchemy.js +19 -3
- package/lib/alchemy.js.map +1 -1
- package/lib/apply.d.ts.map +1 -1
- package/lib/apply.js +63 -5
- package/lib/apply.js.map +1 -1
- package/lib/aws/control/client.js +4 -3
- package/lib/aws/control/client.js.map +1 -1
- package/lib/aws/control/properties.d.ts +6 -0
- package/lib/aws/control/properties.d.ts.map +1 -1
- package/lib/aws/control/properties.js +48 -0
- package/lib/aws/control/properties.js.map +1 -1
- package/lib/aws/control/resource.d.ts.map +1 -1
- package/lib/aws/control/resource.js +3 -2
- package/lib/aws/control/resource.js.map +1 -1
- package/lib/aws/control/types.d.ts +3969 -4862
- package/lib/aws/control/types.d.ts.map +1 -1
- package/lib/aws/control/types.js.map +1 -1
- package/lib/aws/function.d.ts.map +1 -1
- package/lib/aws/function.js +9 -8
- package/lib/aws/function.js.map +1 -1
- package/lib/aws/oidc/oidc-provider.d.ts.map +1 -1
- package/lib/aws/oidc/oidc-provider.js +3 -2
- package/lib/aws/oidc/oidc-provider.js.map +1 -1
- package/lib/aws/queue.d.ts.map +1 -1
- package/lib/aws/queue.js +3 -2
- package/lib/aws/queue.js.map +1 -1
- package/lib/aws/role.d.ts.map +1 -1
- package/lib/aws/role.js +3 -1
- package/lib/aws/role.js.map +1 -1
- package/lib/aws/ssm-parameter.d.ts.map +1 -1
- package/lib/aws/ssm-parameter.js +2 -1
- package/lib/aws/ssm-parameter.js.map +1 -1
- package/lib/cloudflare/account-api-token.d.ts.map +1 -1
- package/lib/cloudflare/account-api-token.js +3 -2
- package/lib/cloudflare/account-api-token.js.map +1 -1
- package/lib/cloudflare/ai-gateway.d.ts.map +1 -1
- package/lib/cloudflare/ai-gateway.js +4 -3
- package/lib/cloudflare/ai-gateway.js.map +1 -1
- package/lib/cloudflare/api-error.d.ts +0 -9
- package/lib/cloudflare/api-error.d.ts.map +1 -1
- package/lib/cloudflare/api-error.js +24 -0
- package/lib/cloudflare/api-error.js.map +1 -1
- package/lib/cloudflare/api.d.ts.map +1 -1
- package/lib/cloudflare/api.js +5 -4
- package/lib/cloudflare/api.js.map +1 -1
- package/lib/cloudflare/assets.d.ts.map +1 -1
- package/lib/cloudflare/assets.js +26 -6
- package/lib/cloudflare/assets.js.map +1 -1
- package/lib/cloudflare/astro.d.ts +63 -0
- package/lib/cloudflare/astro.d.ts.map +1 -0
- package/lib/cloudflare/astro.js +133 -0
- package/lib/cloudflare/astro.js.map +1 -0
- package/lib/cloudflare/auth.d.ts.map +1 -1
- package/lib/cloudflare/auth.js +3 -2
- package/lib/cloudflare/auth.js.map +1 -1
- package/lib/cloudflare/bindings.d.ts +23 -2
- package/lib/cloudflare/bindings.d.ts.map +1 -1
- package/lib/cloudflare/bindings.js.map +1 -1
- package/lib/cloudflare/bound.d.ts +7 -1
- package/lib/cloudflare/bound.d.ts.map +1 -1
- package/lib/cloudflare/bucket.d.ts.map +1 -1
- package/lib/cloudflare/bucket.js +12 -8
- package/lib/cloudflare/bucket.js.map +1 -1
- package/lib/cloudflare/bundle/bundle-worker.d.ts.map +1 -1
- package/lib/cloudflare/bundle/bundle-worker.js +2 -1
- package/lib/cloudflare/bundle/bundle-worker.js.map +1 -1
- package/lib/cloudflare/bundle/nodejs-compat-mode.d.ts.map +1 -1
- package/lib/cloudflare/bundle/nodejs-compat-mode.js +2 -1
- package/lib/cloudflare/bundle/nodejs-compat-mode.js.map +1 -1
- package/lib/cloudflare/custom-domain.d.ts.map +1 -1
- package/lib/cloudflare/custom-domain.js +10 -9
- package/lib/cloudflare/custom-domain.js.map +1 -1
- package/lib/cloudflare/d1-database.d.ts.map +1 -1
- package/lib/cloudflare/d1-database.js +11 -10
- package/lib/cloudflare/d1-database.js.map +1 -1
- package/lib/cloudflare/d1-export.d.ts.map +1 -1
- package/lib/cloudflare/d1-export.js +2 -1
- package/lib/cloudflare/d1-export.js.map +1 -1
- package/lib/cloudflare/d1-import.d.ts.map +1 -1
- package/lib/cloudflare/d1-import.js +2 -1
- package/lib/cloudflare/d1-import.js.map +1 -1
- package/lib/cloudflare/d1-migrations.d.ts.map +1 -1
- package/lib/cloudflare/d1-migrations.js +2 -1
- 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 +5 -4
- package/lib/cloudflare/dns-records.js.map +1 -1
- package/lib/cloudflare/do-state-store/worker.d.ts.map +1 -1
- package/lib/cloudflare/do-state-store/worker.js +4 -0
- package/lib/cloudflare/do-state-store/worker.js.map +1 -1
- package/lib/cloudflare/email-address.d.ts +79 -0
- package/lib/cloudflare/email-address.d.ts.map +1 -0
- package/lib/cloudflare/email-address.js +112 -0
- package/lib/cloudflare/email-address.js.map +1 -0
- package/lib/cloudflare/email-catch-all.d.ts +123 -0
- package/lib/cloudflare/email-catch-all.d.ts.map +1 -0
- package/lib/cloudflare/email-catch-all.js +124 -0
- package/lib/cloudflare/email-catch-all.js.map +1 -0
- package/lib/cloudflare/email-routing.d.ts +89 -0
- package/lib/cloudflare/email-routing.d.ts.map +1 -0
- package/lib/cloudflare/email-routing.js +120 -0
- package/lib/cloudflare/email-routing.js.map +1 -0
- package/lib/cloudflare/email-rule.d.ts +196 -0
- package/lib/cloudflare/email-rule.d.ts.map +1 -0
- package/lib/cloudflare/email-rule.js +153 -0
- package/lib/cloudflare/email-rule.js.map +1 -0
- package/lib/cloudflare/hyperdrive.d.ts.map +1 -1
- package/lib/cloudflare/hyperdrive.js +5 -4
- package/lib/cloudflare/hyperdrive.js.map +1 -1
- package/lib/cloudflare/images.d.ts +60 -0
- package/lib/cloudflare/images.d.ts.map +1 -0
- package/lib/cloudflare/images.js +60 -0
- package/lib/cloudflare/images.js.map +1 -0
- package/lib/cloudflare/index.d.ts +9 -0
- package/lib/cloudflare/index.d.ts.map +1 -1
- package/lib/cloudflare/index.js +9 -0
- package/lib/cloudflare/index.js.map +1 -1
- package/lib/cloudflare/kv-namespace.d.ts.map +1 -1
- package/lib/cloudflare/kv-namespace.js +2 -1
- package/lib/cloudflare/kv-namespace.js.map +1 -1
- package/lib/cloudflare/pipeline.d.ts +7 -0
- package/lib/cloudflare/pipeline.d.ts.map +1 -1
- package/lib/cloudflare/pipeline.js +28 -2
- package/lib/cloudflare/pipeline.js.map +1 -1
- package/lib/cloudflare/queue-consumer.d.ts.map +1 -1
- package/lib/cloudflare/queue-consumer.js +2 -1
- package/lib/cloudflare/queue-consumer.js.map +1 -1
- package/lib/cloudflare/queue.d.ts.map +1 -1
- package/lib/cloudflare/queue.js +0 -8
- package/lib/cloudflare/queue.js.map +1 -1
- package/lib/cloudflare/route.d.ts +26 -1
- package/lib/cloudflare/route.d.ts.map +1 -1
- package/lib/cloudflare/route.js +84 -16
- package/lib/cloudflare/route.js.map +1 -1
- package/lib/cloudflare/secret.d.ts +137 -0
- package/lib/cloudflare/secret.d.ts.map +1 -0
- package/lib/cloudflare/secret.js +122 -0
- package/lib/cloudflare/secret.js.map +1 -0
- package/lib/cloudflare/secrets-store.d.ts +145 -0
- package/lib/cloudflare/secrets-store.d.ts.map +1 -0
- package/lib/cloudflare/secrets-store.js +213 -0
- package/lib/cloudflare/secrets-store.js.map +1 -0
- package/lib/cloudflare/sveltekit.d.ts +49 -0
- package/lib/cloudflare/sveltekit.d.ts.map +1 -0
- package/lib/cloudflare/sveltekit.js +56 -0
- package/lib/cloudflare/sveltekit.js.map +1 -0
- package/lib/cloudflare/user.d.ts.map +1 -1
- package/lib/cloudflare/user.js +2 -1
- package/lib/cloudflare/user.js.map +1 -1
- package/lib/cloudflare/vectorize-index.d.ts.map +1 -1
- package/lib/cloudflare/vectorize-index.js +6 -5
- package/lib/cloudflare/vectorize-index.js.map +1 -1
- package/lib/cloudflare/vectorize-metadata-index.d.ts.map +1 -1
- package/lib/cloudflare/vectorize-metadata-index.js +2 -1
- package/lib/cloudflare/vectorize-metadata-index.js.map +1 -1
- package/lib/cloudflare/website.d.ts.map +1 -1
- package/lib/cloudflare/website.js +7 -2
- package/lib/cloudflare/website.js.map +1 -1
- package/lib/cloudflare/worker-assets.d.ts +18 -0
- package/lib/cloudflare/worker-assets.d.ts.map +1 -1
- package/lib/cloudflare/worker-assets.js +61 -67
- package/lib/cloudflare/worker-assets.js.map +1 -1
- package/lib/cloudflare/worker-metadata.d.ts.map +1 -1
- package/lib/cloudflare/worker-metadata.js +16 -1
- package/lib/cloudflare/worker-metadata.js.map +1 -1
- package/lib/cloudflare/worker.d.ts +31 -1
- package/lib/cloudflare/worker.d.ts.map +1 -1
- package/lib/cloudflare/worker.js +34 -8
- package/lib/cloudflare/worker.js.map +1 -1
- package/lib/cloudflare/wrangler.json.d.ts +14 -0
- package/lib/cloudflare/wrangler.json.d.ts.map +1 -1
- package/lib/cloudflare/wrangler.json.js +23 -0
- package/lib/cloudflare/wrangler.json.js.map +1 -1
- package/lib/cloudflare/zone.d.ts.map +1 -1
- package/lib/cloudflare/zone.js +4 -3
- package/lib/cloudflare/zone.js.map +1 -1
- package/lib/destroy.d.ts.map +1 -1
- package/lib/destroy.js +30 -13
- package/lib/destroy.js.map +1 -1
- package/lib/dns/godaddy.d.ts.map +1 -1
- package/lib/dns/godaddy.js +3 -2
- package/lib/dns/godaddy.js.map +1 -1
- package/lib/dns/import-dns.d.ts.map +1 -1
- package/lib/dns/import-dns.js +2 -1
- package/lib/dns/import-dns.js.map +1 -1
- package/lib/esbuild/bundle.d.ts +1 -1
- package/lib/esbuild/bundle.d.ts.map +1 -1
- package/lib/esbuild/bundle.js +2 -1
- package/lib/esbuild/bundle.js.map +1 -1
- package/lib/fs/copy-file.d.ts.map +1 -1
- package/lib/fs/copy-file.js +2 -1
- package/lib/fs/copy-file.js.map +1 -1
- package/lib/fs/file.d.ts.map +1 -1
- package/lib/fs/file.js +2 -1
- package/lib/fs/file.js.map +1 -1
- package/lib/github/client.d.ts.map +1 -1
- package/lib/github/client.js +11 -10
- package/lib/github/client.js.map +1 -1
- package/lib/github/repository-environment.d.ts.map +1 -1
- package/lib/github/repository-environment.js +5 -4
- package/lib/github/repository-environment.js.map +1 -1
- package/lib/github/secret.d.ts.map +1 -1
- package/lib/github/secret.js +7 -6
- package/lib/github/secret.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/neon/project.d.ts.map +1 -1
- package/lib/neon/project.js +3 -2
- package/lib/neon/project.js.map +1 -1
- package/lib/planetscale/api.d.ts +53 -0
- package/lib/planetscale/api.d.ts.map +1 -0
- package/lib/planetscale/api.js +84 -0
- package/lib/planetscale/api.js.map +1 -0
- package/lib/planetscale/branch.d.ts +129 -0
- package/lib/planetscale/branch.d.ts.map +1 -0
- package/lib/planetscale/branch.js +161 -0
- package/lib/planetscale/branch.js.map +1 -0
- package/lib/planetscale/database.d.ts +143 -0
- package/lib/planetscale/database.d.ts.map +1 -0
- package/lib/planetscale/database.js +184 -0
- package/lib/planetscale/database.js.map +1 -0
- package/lib/planetscale/index.d.ts +5 -0
- package/lib/planetscale/index.d.ts.map +1 -0
- package/lib/planetscale/index.js +5 -0
- package/lib/planetscale/index.js.map +1 -0
- package/lib/planetscale/utils.d.ts +15 -0
- package/lib/planetscale/utils.d.ts.map +1 -0
- package/lib/planetscale/utils.js +95 -0
- package/lib/planetscale/utils.js.map +1 -0
- package/lib/resource.js +7 -1
- package/lib/resource.js.map +1 -1
- package/lib/runtime/plugin.d.ts.map +1 -1
- package/lib/runtime/plugin.js +2 -1
- package/lib/runtime/plugin.js.map +1 -1
- package/lib/scope.d.ts +13 -2
- package/lib/scope.d.ts.map +1 -1
- package/lib/scope.js +53 -10
- package/lib/scope.js.map +1 -1
- package/lib/sentry/client-key.d.ts.map +1 -1
- package/lib/sentry/client-key.js +5 -4
- package/lib/sentry/client-key.js.map +1 -1
- package/lib/sentry/project.d.ts.map +1 -1
- package/lib/sentry/project.js +5 -4
- package/lib/sentry/project.js.map +1 -1
- package/lib/sentry/team.d.ts.map +1 -1
- package/lib/sentry/team.js +5 -4
- package/lib/sentry/team.js.map +1 -1
- package/lib/stripe/card.d.ts.map +1 -1
- package/lib/stripe/card.js +2 -1
- package/lib/stripe/card.js.map +1 -1
- package/lib/stripe/client.d.ts.map +1 -1
- package/lib/stripe/client.js +3 -2
- package/lib/stripe/client.js.map +1 -1
- package/lib/stripe/coupon.d.ts.map +1 -1
- package/lib/stripe/coupon.js +2 -1
- package/lib/stripe/coupon.js.map +1 -1
- package/lib/stripe/customer.d.ts.map +1 -1
- package/lib/stripe/customer.js +2 -1
- package/lib/stripe/customer.js.map +1 -1
- package/lib/stripe/entitlements-feature.d.ts.map +1 -1
- package/lib/stripe/entitlements-feature.js +2 -1
- package/lib/stripe/entitlements-feature.js.map +1 -1
- package/lib/stripe/file.d.ts.map +1 -1
- package/lib/stripe/file.js +2 -1
- package/lib/stripe/file.js.map +1 -1
- package/lib/stripe/meter.d.ts.map +1 -1
- package/lib/stripe/meter.js +4 -2
- package/lib/stripe/meter.js.map +1 -1
- package/lib/stripe/portal-configuration.d.ts.map +1 -1
- package/lib/stripe/portal-configuration.js +2 -1
- package/lib/stripe/portal-configuration.js.map +1 -1
- package/lib/stripe/price.d.ts.map +1 -1
- package/lib/stripe/price.js +2 -1
- package/lib/stripe/price.js.map +1 -1
- package/lib/stripe/product-feature.d.ts.map +1 -1
- package/lib/stripe/product-feature.js +2 -1
- package/lib/stripe/product-feature.js.map +1 -1
- package/lib/stripe/product.d.ts.map +1 -1
- package/lib/stripe/product.js +2 -1
- package/lib/stripe/product.js.map +1 -1
- package/lib/stripe/promotion-code.d.ts.map +1 -1
- package/lib/stripe/promotion-code.js +2 -1
- package/lib/stripe/promotion-code.js.map +1 -1
- package/lib/stripe/shipping-rate.d.ts.map +1 -1
- package/lib/stripe/shipping-rate.js +2 -1
- package/lib/stripe/shipping-rate.js.map +1 -1
- package/lib/stripe/tax-rate.d.ts.map +1 -1
- package/lib/stripe/tax-rate.js +2 -1
- package/lib/stripe/tax-rate.js.map +1 -1
- package/lib/stripe/webhook.d.ts.map +1 -1
- package/lib/stripe/webhook.js +3 -2
- package/lib/stripe/webhook.js.map +1 -1
- package/lib/test/bun.d.ts.map +1 -1
- package/lib/test/bun.js +6 -1
- package/lib/test/bun.js.map +1 -1
- package/lib/test/prune.js +7 -1
- package/lib/test/prune.js.map +1 -1
- package/lib/test/vitest.d.ts.map +1 -1
- package/lib/test/vitest.js +2 -0
- package/lib/test/vitest.js.map +1 -1
- package/lib/upstash/redis.d.ts.map +1 -1
- package/lib/upstash/redis.js +2 -1
- package/lib/upstash/redis.js.map +1 -1
- package/lib/util/async-queue.d.ts +35 -0
- package/lib/util/async-queue.d.ts.map +1 -0
- package/lib/util/async-queue.js +87 -0
- package/lib/util/async-queue.js.map +1 -0
- package/lib/util/cli.d.ts +37 -0
- package/lib/util/cli.d.ts.map +1 -0
- package/lib/util/cli.js +90 -0
- package/lib/util/cli.js.map +1 -0
- package/lib/util/ignore-matcher.d.ts +94 -0
- package/lib/util/ignore-matcher.d.ts.map +1 -0
- package/lib/util/ignore-matcher.js +616 -0
- package/lib/util/ignore-matcher.js.map +1 -0
- package/lib/util/logger.d.ts +3 -0
- package/lib/util/logger.d.ts.map +1 -0
- package/lib/util/logger.js +15 -0
- package/lib/util/logger.js.map +1 -0
- package/lib/util/retry.d.ts.map +1 -1
- package/lib/util/retry.js +0 -1
- package/lib/util/retry.js.map +1 -1
- package/lib/util/safe-fetch.d.ts.map +1 -1
- package/lib/util/safe-fetch.js +2 -1
- package/lib/util/safe-fetch.js.map +1 -1
- package/lib/util/telemetry/client.d.ts +32 -0
- package/lib/util/telemetry/client.d.ts.map +1 -0
- package/lib/util/telemetry/client.js +94 -0
- package/lib/util/telemetry/client.js.map +1 -0
- package/lib/util/telemetry/constants.d.ts +4 -0
- package/lib/util/telemetry/constants.d.ts.map +1 -0
- package/lib/util/telemetry/constants.js +8 -0
- package/lib/util/telemetry/constants.js.map +1 -0
- package/lib/util/telemetry/context.d.ts +15 -0
- package/lib/util/telemetry/context.d.ts.map +1 -0
- package/lib/util/telemetry/context.js +128 -0
- package/lib/util/telemetry/context.js.map +1 -0
- package/lib/util/telemetry/index.d.ts +3 -0
- package/lib/util/telemetry/index.d.ts.map +1 -0
- package/lib/util/telemetry/index.js +3 -0
- package/lib/util/telemetry/index.js.map +1 -0
- package/lib/util/telemetry/types.d.ts +59 -0
- package/lib/util/telemetry/types.d.ts.map +1 -0
- package/lib/util/telemetry/types.js +1 -0
- package/lib/util/telemetry/types.js.map +1 -0
- package/lib/util/xdg-paths.d.ts +9 -0
- package/lib/util/xdg-paths.d.ts.map +1 -0
- package/lib/util/xdg-paths.js +41 -0
- package/lib/util/xdg-paths.js.map +1 -0
- package/lib/vercel/project.d.ts.map +1 -1
- package/lib/vercel/project.js +2 -1
- package/lib/vercel/project.js.map +1 -1
- package/lib/web/astro.d.ts.map +1 -1
- package/lib/web/astro.js +2 -1
- package/lib/web/astro.js.map +1 -1
- package/lib/web/shadcn.d.ts.map +1 -1
- package/lib/web/shadcn.js +2 -1
- package/lib/web/shadcn.js.map +1 -1
- package/lib/web/vite.d.ts.map +1 -1
- package/lib/web/vite.js +3 -2
- package/lib/web/vite.js.map +1 -1
- package/lib/web/vitepress/dependencies.d.ts.map +1 -1
- package/lib/web/vitepress/dependencies.js +2 -1
- package/lib/web/vitepress/dependencies.js.map +1 -1
- package/lib/web/vitepress/vitepress.d.ts.map +1 -1
- package/lib/web/vitepress/vitepress.js +2 -1
- package/lib/web/vitepress/vitepress.js.map +1 -1
- package/package.json +6 -4
- package/src/ai/astro-file.ts +2 -1
- package/src/ai/client.ts +3 -2
- package/src/alchemy.ts +28 -3
- package/src/apply.ts +66 -5
- package/src/aws/control/client.ts +4 -4
- package/src/aws/control/properties.ts +48 -0
- package/src/aws/control/resource.ts +3 -2
- package/src/aws/control/types.ts +3988 -6301
- package/src/aws/function.ts +9 -8
- package/src/aws/oidc/oidc-provider.ts +3 -2
- package/src/aws/queue.ts +3 -2
- package/src/aws/role.ts +3 -1
- package/src/aws/ssm-parameter.ts +2 -1
- package/src/cloudflare/account-api-token.ts +3 -2
- package/src/cloudflare/ai-gateway.ts +4 -3
- package/src/cloudflare/api-error.ts +36 -0
- package/src/cloudflare/api.ts +9 -4
- package/src/cloudflare/assets.ts +30 -6
- package/src/cloudflare/astro.ts +176 -0
- package/src/cloudflare/auth.ts +3 -2
- package/src/cloudflare/bindings.ts +27 -0
- package/src/cloudflare/bound.ts +31 -17
- package/src/cloudflare/bucket.ts +15 -8
- package/src/cloudflare/bundle/bundle-worker.ts +2 -1
- package/src/cloudflare/bundle/nodejs-compat-mode.ts +2 -1
- package/src/cloudflare/custom-domain.ts +10 -9
- package/src/cloudflare/d1-database.ts +11 -10
- package/src/cloudflare/d1-export.ts +2 -1
- package/src/cloudflare/d1-import.ts +2 -1
- package/src/cloudflare/d1-migrations.ts +2 -1
- package/src/cloudflare/dns-records.ts +5 -4
- package/src/cloudflare/do-state-store/worker.ts +4 -0
- package/src/cloudflare/email-address.ts +203 -0
- package/src/cloudflare/email-catch-all.ts +248 -0
- package/src/cloudflare/email-routing.ts +230 -0
- package/src/cloudflare/email-rule.ts +322 -0
- package/src/cloudflare/hyperdrive.ts +5 -4
- package/src/cloudflare/images.ts +59 -0
- package/src/cloudflare/index.ts +9 -0
- package/src/cloudflare/kv-namespace.ts +2 -1
- package/src/cloudflare/pipeline.ts +38 -2
- package/src/cloudflare/queue-consumer.ts +2 -1
- package/src/cloudflare/queue.ts +0 -12
- package/src/cloudflare/route.ts +118 -18
- package/src/cloudflare/secret.ts +253 -0
- package/src/cloudflare/secrets-store.ts +420 -0
- package/src/cloudflare/sveltekit.ts +72 -0
- package/src/cloudflare/user.ts +2 -1
- package/src/cloudflare/vectorize-index.ts +6 -5
- package/src/cloudflare/vectorize-metadata-index.ts +2 -1
- package/src/cloudflare/website.ts +76 -66
- package/src/cloudflare/worker-assets.ts +95 -89
- package/src/cloudflare/worker-metadata.ts +14 -1
- package/src/cloudflare/worker.ts +76 -9
- package/src/cloudflare/wrangler.json.ts +42 -0
- package/src/cloudflare/zone.ts +4 -3
- package/src/destroy.ts +35 -17
- package/src/dns/godaddy.ts +3 -2
- package/src/dns/import-dns.ts +2 -1
- package/src/esbuild/bundle.ts +2 -1
- package/src/fs/copy-file.ts +2 -1
- package/src/fs/file.ts +3 -1
- package/src/github/client.ts +11 -10
- package/src/github/repository-environment.ts +5 -4
- package/src/github/secret.ts +7 -6
- package/src/index.ts +2 -1
- package/src/neon/project.ts +3 -2
- package/src/planetscale/api.ts +115 -0
- package/src/planetscale/branch.ts +352 -0
- package/src/planetscale/database.ts +394 -0
- package/src/planetscale/index.ts +4 -0
- package/src/planetscale/utils.ts +189 -0
- package/src/resource.ts +7 -1
- package/src/runtime/plugin.ts +2 -1
- package/src/scope.ts +64 -13
- package/src/sentry/client-key.ts +5 -4
- package/src/sentry/project.ts +5 -4
- package/src/sentry/team.ts +5 -4
- package/src/stripe/card.ts +2 -1
- package/src/stripe/client.ts +3 -2
- package/src/stripe/coupon.ts +2 -1
- package/src/stripe/customer.ts +2 -1
- package/src/stripe/entitlements-feature.ts +2 -1
- package/src/stripe/file.ts +2 -1
- package/src/stripe/meter.ts +4 -2
- package/src/stripe/portal-configuration.ts +2 -1
- package/src/stripe/price.ts +2 -1
- package/src/stripe/product-feature.ts +2 -1
- package/src/stripe/product.ts +2 -1
- package/src/stripe/promotion-code.ts +2 -1
- package/src/stripe/shipping-rate.ts +2 -1
- package/src/stripe/tax-rate.ts +2 -1
- package/src/stripe/webhook.ts +3 -2
- package/src/test/bun.ts +6 -1
- package/src/test/prune.ts +7 -1
- package/src/test/vitest.ts +2 -0
- package/src/upstash/redis.ts +2 -1
- package/src/util/async-queue.ts +97 -0
- package/src/util/cli.tsx +221 -0
- package/src/util/ignore-matcher.ts +873 -0
- package/src/util/logger.ts +17 -0
- package/src/util/retry.ts +0 -1
- package/src/util/safe-fetch.ts +2 -1
- package/src/util/telemetry/client.ts +127 -0
- package/src/util/telemetry/constants.ts +13 -0
- package/src/util/telemetry/context.ts +154 -0
- package/src/util/telemetry/index.ts +2 -0
- package/src/util/telemetry/types.ts +83 -0
- package/src/util/xdg-paths.ts +48 -0
- package/src/vercel/project.ts +2 -1
- package/src/web/astro.ts +2 -1
- package/src/web/shadcn.ts +2 -1
- package/src/web/vite.ts +3 -2
- package/src/web/vitepress/dependencies.ts +2 -1
- package/src/web/vitepress/vitepress.ts +2 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Scope } from "../scope.ts";
|
|
2
|
+
import type { LoggerApi } from "./cli.tsx";
|
|
3
|
+
|
|
4
|
+
export const logger = new Proxy({} as LoggerApi, {
|
|
5
|
+
get: (_, prop: keyof LoggerApi) => {
|
|
6
|
+
const logger =
|
|
7
|
+
Scope.get()?.logger ??
|
|
8
|
+
({
|
|
9
|
+
log: console.log,
|
|
10
|
+
error: console.error,
|
|
11
|
+
warn: console.warn,
|
|
12
|
+
task: () => {},
|
|
13
|
+
exit: () => {},
|
|
14
|
+
} as LoggerApi);
|
|
15
|
+
return logger[prop].bind(logger);
|
|
16
|
+
},
|
|
17
|
+
});
|
package/src/util/retry.ts
CHANGED
package/src/util/safe-fetch.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Agent } from "undici";
|
|
2
|
+
import { logger } from "./logger.ts";
|
|
2
3
|
|
|
3
4
|
export async function safeFetch(
|
|
4
5
|
url: string | URL | Request,
|
|
@@ -25,7 +26,7 @@ export async function safeFetch(
|
|
|
25
26
|
throw err;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
logger.warn(`Retry ${attempt}/${retries} for ${url}: ${err.code}`);
|
|
29
30
|
await new Promise((r) => setTimeout(r, 250 * attempt)); // exponential backoff
|
|
30
31
|
}
|
|
31
32
|
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import os from "node:os";
|
|
2
|
+
import type { Phase } from "../../alchemy.ts";
|
|
3
|
+
import { INGEST_URL, TELEMETRY_DISABLED } from "./constants.ts";
|
|
4
|
+
import { context } from "./context.ts";
|
|
5
|
+
import type { Telemetry } from "./types.ts";
|
|
6
|
+
|
|
7
|
+
export interface TelemetryClientOptions {
|
|
8
|
+
sessionId: string;
|
|
9
|
+
phase: Phase;
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
quiet: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ITelemetryClient {
|
|
15
|
+
ready: Promise<void>;
|
|
16
|
+
record(event: Telemetry.EventInput): void;
|
|
17
|
+
finalize(): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export class NoopTelemetryClient implements ITelemetryClient {
|
|
21
|
+
ready = Promise.resolve();
|
|
22
|
+
record(_: Telemetry.EventInput) {}
|
|
23
|
+
finalize() {
|
|
24
|
+
return Promise.resolve();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export class TelemetryClient implements ITelemetryClient {
|
|
29
|
+
ready: Promise<void>;
|
|
30
|
+
|
|
31
|
+
private events: Telemetry.Event[] = [];
|
|
32
|
+
private context?: Telemetry.Context;
|
|
33
|
+
|
|
34
|
+
constructor(readonly options: TelemetryClientOptions) {
|
|
35
|
+
this.ready = this.init();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
private async init() {
|
|
39
|
+
const now = Date.now();
|
|
40
|
+
this.context = await context({
|
|
41
|
+
sessionId: this.options.sessionId,
|
|
42
|
+
phase: this.options.phase,
|
|
43
|
+
});
|
|
44
|
+
this.record(
|
|
45
|
+
{
|
|
46
|
+
event: "app.start",
|
|
47
|
+
},
|
|
48
|
+
now,
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
record(event: Telemetry.EventInput, timestamp = Date.now()) {
|
|
53
|
+
if (!this.context) {
|
|
54
|
+
throw new Error("Context not initialized");
|
|
55
|
+
}
|
|
56
|
+
const payload = {
|
|
57
|
+
...event,
|
|
58
|
+
error: this.serializeError(event.error),
|
|
59
|
+
context: this.context,
|
|
60
|
+
timestamp,
|
|
61
|
+
} as Telemetry.Event;
|
|
62
|
+
this.events.push(payload);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
private serializeError(
|
|
66
|
+
error: Telemetry.ErrorInput | undefined,
|
|
67
|
+
): Telemetry.SerializedError | undefined {
|
|
68
|
+
if (!error) {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
if (error instanceof Error) {
|
|
72
|
+
return {
|
|
73
|
+
...error, // include additional properties from error object
|
|
74
|
+
name: error.name,
|
|
75
|
+
message: error.message,
|
|
76
|
+
// TODO: maybe redact more of the stack trace?
|
|
77
|
+
stack: error.stack?.replaceAll(os.homedir(), "~"), // redact home directory
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
return error;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
async finalize() {
|
|
84
|
+
await this.send(this.events).catch((error) => {
|
|
85
|
+
if (!this.options.quiet) {
|
|
86
|
+
console.warn(error);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
private async send(events: Telemetry.Event[]) {
|
|
92
|
+
if (events.length === 0) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const response = await fetch(INGEST_URL, {
|
|
96
|
+
method: "POST",
|
|
97
|
+
headers: {
|
|
98
|
+
"Content-Type": "application/json",
|
|
99
|
+
},
|
|
100
|
+
body: JSON.stringify(events),
|
|
101
|
+
});
|
|
102
|
+
if (!response.ok) {
|
|
103
|
+
throw new Error(
|
|
104
|
+
`Failed to send telemetry: ${response.status} ${response.statusText} - ${await response.text()}`,
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
static create({
|
|
110
|
+
phase,
|
|
111
|
+
enabled,
|
|
112
|
+
quiet,
|
|
113
|
+
}: Omit<TelemetryClientOptions, "sessionId">): ITelemetryClient {
|
|
114
|
+
if (!enabled || TELEMETRY_DISABLED) {
|
|
115
|
+
if (!quiet) {
|
|
116
|
+
console.warn("[Alchemy] Telemetry is disabled.");
|
|
117
|
+
}
|
|
118
|
+
return new NoopTelemetryClient();
|
|
119
|
+
}
|
|
120
|
+
return new TelemetryClient({
|
|
121
|
+
sessionId: crypto.randomUUID(),
|
|
122
|
+
phase,
|
|
123
|
+
enabled,
|
|
124
|
+
quiet,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createXdgAppPaths } from "../xdg-paths.js";
|
|
2
|
+
|
|
3
|
+
const xdg = createXdgAppPaths("alchemy");
|
|
4
|
+
|
|
5
|
+
export const CONFIG_DIR = xdg.config();
|
|
6
|
+
|
|
7
|
+
export const TELEMETRY_DISABLED =
|
|
8
|
+
!!process.env.ALCHEMY_TELEMETRY_DISABLED || !!process.env.DO_NOT_TRACK;
|
|
9
|
+
|
|
10
|
+
// TODO(sam): replace with permanent URL
|
|
11
|
+
export const INGEST_URL =
|
|
12
|
+
process.env.ALCHEMY_TELEMETRY_URL ??
|
|
13
|
+
"https://5fbb5d5ca66f44b685468684cfceb325.pipelines.cloudflare.com";
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { exec } from "node:child_process";
|
|
2
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import pkg from "../../../package.json" with { type: "json" };
|
|
6
|
+
import type { Phase } from "../../alchemy.ts";
|
|
7
|
+
import { CONFIG_DIR } from "./constants.ts";
|
|
8
|
+
import type { Telemetry } from "./types.ts";
|
|
9
|
+
|
|
10
|
+
async function userId() {
|
|
11
|
+
const path = join(CONFIG_DIR, "id");
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
return (await readFile(path, "utf-8")).trim();
|
|
15
|
+
} catch {}
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
await mkdir(CONFIG_DIR, { recursive: true });
|
|
19
|
+
} catch {}
|
|
20
|
+
|
|
21
|
+
const id = crypto.randomUUID();
|
|
22
|
+
try {
|
|
23
|
+
await writeFile(path, id);
|
|
24
|
+
console.warn(
|
|
25
|
+
[
|
|
26
|
+
"Attention: To help improve Alchemy, we now collect anonymous usage, performance, and error data.",
|
|
27
|
+
"You can opt out by setting the ALCHEMY_TELEMETRY_DISABLED or DO_NOT_TRACK environment variable to a truthy value.",
|
|
28
|
+
].join("\n"),
|
|
29
|
+
);
|
|
30
|
+
} catch {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return id;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function projectId() {
|
|
38
|
+
return new Promise<string | null>((resolve) => {
|
|
39
|
+
exec("git rev-list --max-parents=0 HEAD", (err, stdout) => {
|
|
40
|
+
if (err) {
|
|
41
|
+
resolve(null);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
resolve(stdout.trim());
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function system(): Telemetry.Context["system"] {
|
|
50
|
+
return {
|
|
51
|
+
platform: os.platform(),
|
|
52
|
+
osVersion: os.release(),
|
|
53
|
+
arch: os.arch(),
|
|
54
|
+
cpus: os.cpus().length,
|
|
55
|
+
memory: os.totalmem() / 1024 / 1024,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
declare global {
|
|
60
|
+
var Deno:
|
|
61
|
+
| {
|
|
62
|
+
version: {
|
|
63
|
+
deno: string;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
| undefined;
|
|
67
|
+
var EdgeRuntime: Record<string, unknown> | undefined;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const RUNTIMES = [
|
|
71
|
+
{
|
|
72
|
+
name: "bun",
|
|
73
|
+
detect: () => !!globalThis.Bun,
|
|
74
|
+
version: () => globalThis.Bun?.version,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "deno",
|
|
78
|
+
detect: () => !!globalThis.Deno,
|
|
79
|
+
version: () => globalThis.Deno?.version?.deno,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: "workerd",
|
|
83
|
+
detect: () => !!globalThis.EdgeRuntime,
|
|
84
|
+
version: () => null,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: "node",
|
|
88
|
+
detect: () => !!globalThis.process?.versions?.node,
|
|
89
|
+
version: () => process.versions.node,
|
|
90
|
+
},
|
|
91
|
+
] as const;
|
|
92
|
+
|
|
93
|
+
function runtime(): Telemetry.Context["runtime"] {
|
|
94
|
+
for (const runtime of RUNTIMES) {
|
|
95
|
+
if (runtime.detect()) {
|
|
96
|
+
return {
|
|
97
|
+
name: runtime.name,
|
|
98
|
+
version: runtime.version() ?? null,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
name: null,
|
|
104
|
+
version: null,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const PROVIDERS = [
|
|
109
|
+
{ env: "GITHUB_ACTIONS", provider: "GitHub Actions", isCI: true },
|
|
110
|
+
{ env: "GITLAB_CI", provider: "GitLab CI", isCI: true },
|
|
111
|
+
{ env: "CIRCLECI", provider: "CircleCI", isCI: true },
|
|
112
|
+
{ env: "JENKINS_URL", provider: "Jenkins", isCI: true },
|
|
113
|
+
{ env: "TRAVIS", provider: "Travis CI", isCI: true },
|
|
114
|
+
{ env: "NOW_BUILDER", provider: "Vercel", isCI: true },
|
|
115
|
+
{ env: "VERCEL", provider: "Vercel", isCI: false },
|
|
116
|
+
];
|
|
117
|
+
|
|
118
|
+
function environment(): Telemetry.Context["environment"] {
|
|
119
|
+
for (const provider of PROVIDERS) {
|
|
120
|
+
if (process.env[provider.env]) {
|
|
121
|
+
return {
|
|
122
|
+
provider: provider.provider,
|
|
123
|
+
isCI: provider.isCI,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
provider: null,
|
|
129
|
+
isCI: !!process.env.CI,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export async function context(input: {
|
|
134
|
+
sessionId: string;
|
|
135
|
+
phase: Phase;
|
|
136
|
+
}): Promise<Telemetry.Context> {
|
|
137
|
+
const env = environment();
|
|
138
|
+
const [uid, pid] = await Promise.all([
|
|
139
|
+
env.isCI ? null : userId(),
|
|
140
|
+
projectId(),
|
|
141
|
+
]);
|
|
142
|
+
return {
|
|
143
|
+
userId: uid,
|
|
144
|
+
projectId: pid,
|
|
145
|
+
sessionId: input.sessionId,
|
|
146
|
+
system: system(),
|
|
147
|
+
runtime: runtime(),
|
|
148
|
+
environment: env,
|
|
149
|
+
alchemy: {
|
|
150
|
+
version: pkg.version,
|
|
151
|
+
phase: input.phase,
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { Phase } from "../../alchemy.ts";
|
|
2
|
+
|
|
3
|
+
export namespace Telemetry {
|
|
4
|
+
export interface Context {
|
|
5
|
+
/** Random UUID generated once per machine and stored in XDG config directory (e.g. `~/Library/Preferences/alchemy` on Mac). Null for CI environments. */
|
|
6
|
+
userId: string | null;
|
|
7
|
+
/** Root commit hash for the git repository. Anonymous, stable identifier for anyone using git. */
|
|
8
|
+
projectId: string | null;
|
|
9
|
+
/** UUID generated once per application run. */
|
|
10
|
+
sessionId: string;
|
|
11
|
+
|
|
12
|
+
system: {
|
|
13
|
+
platform: string;
|
|
14
|
+
osVersion: string;
|
|
15
|
+
arch: string;
|
|
16
|
+
cpus: number;
|
|
17
|
+
memory: number;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
runtime: {
|
|
21
|
+
name: string | null;
|
|
22
|
+
version: string | null;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
environment: {
|
|
26
|
+
provider: string | null;
|
|
27
|
+
isCI: boolean;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
alchemy: {
|
|
31
|
+
version: string;
|
|
32
|
+
phase: Phase;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface BaseEvent {
|
|
37
|
+
event: string;
|
|
38
|
+
context: Context;
|
|
39
|
+
timestamp: number;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface SerializedError {
|
|
43
|
+
name?: string;
|
|
44
|
+
message: string;
|
|
45
|
+
stack?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type ErrorInput = Error | SerializedError;
|
|
49
|
+
|
|
50
|
+
export interface AppEvent extends BaseEvent {
|
|
51
|
+
event: "app.start" | "app.success" | "app.error";
|
|
52
|
+
elapsed?: number;
|
|
53
|
+
error?: SerializedError;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface ResourceEvent extends BaseEvent {
|
|
57
|
+
event:
|
|
58
|
+
| "resource.start"
|
|
59
|
+
| "resource.success"
|
|
60
|
+
| "resource.error"
|
|
61
|
+
| "resource.skip"
|
|
62
|
+
| "resource.read";
|
|
63
|
+
resource: string;
|
|
64
|
+
status?:
|
|
65
|
+
| "creating"
|
|
66
|
+
| "created"
|
|
67
|
+
| "updating"
|
|
68
|
+
| "updated"
|
|
69
|
+
| "deleting"
|
|
70
|
+
| "deleted";
|
|
71
|
+
elapsed?: number;
|
|
72
|
+
error?: SerializedError;
|
|
73
|
+
replaced?: boolean;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export type Event = AppEvent | ResourceEvent;
|
|
77
|
+
export type EventInput = (
|
|
78
|
+
| Omit<AppEvent, "context" | "timestamp" | "error">
|
|
79
|
+
| Omit<ResourceEvent, "context" | "timestamp" | "error">
|
|
80
|
+
) & {
|
|
81
|
+
error?: ErrorInput;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Vendored XDG Base Directory Specification implementation
|
|
6
|
+
* Provides cross-platform directory paths for config and state
|
|
7
|
+
*/
|
|
8
|
+
export function createXdgAppPaths(appName: string) {
|
|
9
|
+
const platform = process.platform;
|
|
10
|
+
const home = homedir();
|
|
11
|
+
|
|
12
|
+
function config(): string {
|
|
13
|
+
if (platform === "win32") {
|
|
14
|
+
return join(
|
|
15
|
+
process.env.LOCALAPPDATA || join(home, "AppData", "Local"),
|
|
16
|
+
appName,
|
|
17
|
+
);
|
|
18
|
+
} else if (platform === "darwin") {
|
|
19
|
+
return join(home, "Library", "Preferences", appName);
|
|
20
|
+
} else {
|
|
21
|
+
// Linux/Unix - follow XDG Base Directory Specification
|
|
22
|
+
const xdgConfigHome =
|
|
23
|
+
process.env.XDG_CONFIG_HOME || join(home, ".config");
|
|
24
|
+
return join(xdgConfigHome, appName);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function state(): string {
|
|
29
|
+
if (platform === "win32") {
|
|
30
|
+
return join(
|
|
31
|
+
process.env.LOCALAPPDATA || join(home, "AppData", "Local"),
|
|
32
|
+
appName,
|
|
33
|
+
);
|
|
34
|
+
} else if (platform === "darwin") {
|
|
35
|
+
return join(home, "Library", "Application Support", appName);
|
|
36
|
+
} else {
|
|
37
|
+
// Linux/Unix - follow XDG Base Directory Specification
|
|
38
|
+
const xdgStateHome =
|
|
39
|
+
process.env.XDG_STATE_HOME || join(home, ".local", "state");
|
|
40
|
+
return join(xdgStateHome, appName);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
config,
|
|
46
|
+
state,
|
|
47
|
+
};
|
|
48
|
+
}
|
package/src/vercel/project.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Context } from "../context.ts";
|
|
2
2
|
import { Resource } from "../resource.ts";
|
|
3
3
|
import { isSecret, type Secret } from "../secret.ts";
|
|
4
|
+
import { logger } from "../util/logger.ts";
|
|
4
5
|
import { createVercelApi, type VercelApi } from "./api.ts";
|
|
5
6
|
|
|
6
7
|
type TargetEnvironment = "production" | "preview" | "development";
|
|
@@ -380,7 +381,7 @@ export const Project = Resource(
|
|
|
380
381
|
await api.delete(`/projects/${this.output.id}`);
|
|
381
382
|
}
|
|
382
383
|
} catch (error) {
|
|
383
|
-
|
|
384
|
+
logger.error("Error deleting project:", error);
|
|
384
385
|
}
|
|
385
386
|
|
|
386
387
|
return this.destroy();
|
package/src/web/astro.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { StaticJsonFile } from "../fs/static-json-file.ts";
|
|
|
8
8
|
import { StaticTextFile } from "../fs/static-text-file.ts";
|
|
9
9
|
import { StaticTypeScriptFile } from "../fs/static-typescript-file.ts";
|
|
10
10
|
import { Resource } from "../resource.ts";
|
|
11
|
+
import { logger } from "../util/logger.ts";
|
|
11
12
|
import { ShadcnUI } from "./shadcn.ts";
|
|
12
13
|
|
|
13
14
|
const execAsync = promisify(exec);
|
|
@@ -208,7 +209,7 @@ export const AstroProject = Resource(
|
|
|
208
209
|
}
|
|
209
210
|
}
|
|
210
211
|
} catch (error) {
|
|
211
|
-
|
|
212
|
+
logger.error(`Error deleting project ${id}:`, error);
|
|
212
213
|
}
|
|
213
214
|
return this.destroy();
|
|
214
215
|
}
|
package/src/web/shadcn.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { Folder } from "../fs/folder.ts";
|
|
|
6
6
|
import { StaticJsonFile } from "../fs/static-json-file.ts";
|
|
7
7
|
import { StaticTypeScriptFile } from "../fs/static-typescript-file.ts";
|
|
8
8
|
import { Resource } from "../resource.ts";
|
|
9
|
+
import { logger } from "../util/logger.ts";
|
|
9
10
|
import { ShadcnComponent } from "./shadcn-component.ts";
|
|
10
11
|
|
|
11
12
|
const execAsync = promisify(exec);
|
|
@@ -127,7 +128,7 @@ export const ShadcnUI = Resource(
|
|
|
127
128
|
// For a delete phase, we don't perform any action
|
|
128
129
|
// as removing Shadcn UI would require removing many files
|
|
129
130
|
// which could be destructive to the project
|
|
130
|
-
|
|
131
|
+
logger.log(
|
|
131
132
|
"Note: ShadcnUI delete phase does not remove installed components",
|
|
132
133
|
);
|
|
133
134
|
|
package/src/web/vite.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { Folder } from "../fs/folder.ts";
|
|
|
6
6
|
import { StaticJsonFile } from "../fs/static-json-file.ts";
|
|
7
7
|
import { StaticTypeScriptFile } from "../fs/static-typescript-file.ts";
|
|
8
8
|
import { Resource } from "../resource.ts";
|
|
9
|
+
import { logger } from "../util/logger.ts";
|
|
9
10
|
import { rm } from "../util/rm.ts";
|
|
10
11
|
import { ShadcnComponent } from "./shadcn-component.ts";
|
|
11
12
|
import { TailwindConfig } from "./tailwind.ts";
|
|
@@ -147,7 +148,7 @@ export const ViteProject = Resource(
|
|
|
147
148
|
await execAsync(`rm -rf ${props.name}`);
|
|
148
149
|
}
|
|
149
150
|
} catch (error) {
|
|
150
|
-
|
|
151
|
+
logger.error(`Error deleting project ${id}:`, error);
|
|
151
152
|
}
|
|
152
153
|
return this.destroy();
|
|
153
154
|
}
|
|
@@ -156,7 +157,7 @@ export const ViteProject = Resource(
|
|
|
156
157
|
if (props.overwrite) {
|
|
157
158
|
await modifyConfig(props);
|
|
158
159
|
} else {
|
|
159
|
-
|
|
160
|
+
logger.warn(
|
|
160
161
|
"ViteProject does not support updates - the project must be recreated to change the template",
|
|
161
162
|
);
|
|
162
163
|
}
|
|
@@ -2,6 +2,7 @@ import { exec } from "node:child_process";
|
|
|
2
2
|
import { promisify } from "node:util";
|
|
3
3
|
import type { Context } from "../../context.ts";
|
|
4
4
|
import { Resource } from "../../resource.ts";
|
|
5
|
+
import { logger } from "../../util/logger.ts";
|
|
5
6
|
|
|
6
7
|
const execAsync = promisify(exec);
|
|
7
8
|
|
|
@@ -63,6 +64,6 @@ export async function installDependencies(
|
|
|
63
64
|
.join(" ");
|
|
64
65
|
|
|
65
66
|
const cmd = `bun add ${args.join(" ")} ${deps}`;
|
|
66
|
-
|
|
67
|
+
logger.log(cmd);
|
|
67
68
|
await execAsync(cmd, { cwd });
|
|
68
69
|
}
|
|
@@ -8,6 +8,7 @@ import { StaticJsonFile } from "../../fs/static-json-file.ts";
|
|
|
8
8
|
import { StaticTextFile } from "../../fs/static-text-file.ts";
|
|
9
9
|
import { StaticTypeScriptFile } from "../../fs/static-typescript-file.ts";
|
|
10
10
|
import { Resource } from "../../resource.ts";
|
|
11
|
+
import { logger } from "../../util/logger.ts";
|
|
11
12
|
import { InstallDependencies, fixedDependencies } from "./dependencies.ts";
|
|
12
13
|
|
|
13
14
|
const _execAsync = promisify(exec);
|
|
@@ -121,7 +122,7 @@ export const VitepressProject = Resource(
|
|
|
121
122
|
}
|
|
122
123
|
}
|
|
123
124
|
} catch (error) {
|
|
124
|
-
|
|
125
|
+
logger.error(`Error deleting VitePress project ${id}:`, error);
|
|
125
126
|
}
|
|
126
127
|
return this.destroy();
|
|
127
128
|
}
|