@varlock/cloudflare-integration 0.0.0 → 0.0.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 ADDED
@@ -0,0 +1,17 @@
1
+ # @varlock/cloudflare-integration
2
+
3
+ This package helps you integrate [varlock](https://varlock.dev) into a [Cloudflare Workers](https://developers.cloudflare.com/workers/) project.
4
+
5
+ It provides:
6
+
7
+ - a Vite plugin (`varlockCloudflareVitePlugin`) that wraps `@cloudflare/vite-plugin` with automatic env var injection into miniflare bindings and Cloudflare's secret bindings at runtime
8
+ - a `varlock-wrangler` CLI binary — a drop-in replacement for `wrangler` that injects env via named pipe in dev, uploads vars/secrets on deploy, and generates correct types
9
+ - a standalone init module (`@varlock/cloudflare-integration/init`) for non-Vite workers
10
+ - validation of your env vars against your `.env.schema`
11
+ - type-generation and type-safe env var access with built-in docs
12
+ - redaction of sensitive values from logs
13
+ - leak prevention in responses
14
+
15
+ Compared to the base `@varlock/vite-integration`, this package avoids bundling secrets into your worker code. Instead, sensitive values are stored as Cloudflare secrets and non-sensitive values as Cloudflare vars.
16
+
17
+ See [our docs site](https://varlock.dev/integrations/cloudflare/) for complete installation and usage instructions.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import '../dist/varlock-wrangler.js';
@@ -0,0 +1,25 @@
1
+ import { PluginConfig } from '@cloudflare/vite-plugin';
2
+
3
+ /**
4
+ * Varlock Cloudflare Vite plugin — wraps the Cloudflare Workers Vite plugin
5
+ * with automatic env var injection.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * import { varlockCloudflareVitePlugin } from '@varlock/cloudflare-integration';
10
+ *
11
+ * export default defineConfig({
12
+ * plugins: [
13
+ * varlockCloudflareVitePlugin(),
14
+ * ],
15
+ * });
16
+ * ```
17
+ */
18
+ declare function varlockCloudflareVitePlugin(
19
+ /**
20
+ * All options from the original Cloudflare Vite plugin are supported.
21
+ * @see https://developers.cloudflare.com/workers/vite-plugin/reference/api/
22
+ */
23
+ cloudflareOptions?: PluginConfig): Array<any>;
24
+
25
+ export { varlockCloudflareVitePlugin };