@powerlines/plugin-cloudflare 0.5.3 → 0.5.6

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/dist/index.cjs CHANGED
@@ -91,28 +91,56 @@ function plugin(options = {}) {
91
91
  account: { id: this.config.cloudflare.accountId },
92
92
  name: this.config.cloudflare.domain
93
93
  } }, { provider });
94
- const workerScripts = [];
95
- const workerRoutes = [];
94
+ const workers = [];
95
+ const workerVersions = [];
96
+ const workersDeployments = [];
97
+ const workersRoutes = [];
96
98
  const dnsRecords = [];
97
99
  for (const worker of this.workers) {
98
- const workerScript = new _pulumi_cloudflare.WorkersScript(`${this.config.organization ? `${this.config.organization}.` : ""}${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.name) === (0, _stryke_string_format_kebab_case.kebabCase)(worker.metadata.name) ? (0, _stryke_string_format_kebab_case.kebabCase)(this.config.name) : `${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.name)}.${(0, _stryke_string_format_kebab_case.kebabCase)(worker.metadata.name)}`}.${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.mode)}.worker-script`, (0, defu.default)({
100
+ const resource = new _pulumi_cloudflare.Worker(`${this.config.organization ? `${this.config.organization}.` : ""}${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.name) === (0, _stryke_string_format_kebab_case.kebabCase)(worker.metadata.name) ? (0, _stryke_string_format_kebab_case.kebabCase)(this.config.name) : `${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.name)}.${(0, _stryke_string_format_kebab_case.kebabCase)(worker.metadata.name)}`}.${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.mode)}.worker`, (0, defu.default)({
99
101
  accountId: this.config.cloudflare.accountId,
100
- scriptName: worker.metadata.name,
101
- contentFile: (0, _stryke_path.joinPaths)(this.config.output.publishPath, "index.js"),
102
- module: true
102
+ name: worker.metadata.name,
103
+ tags: [
104
+ `project:${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.name)}`,
105
+ this.config.organization ? `organization:${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.organization)}` : void 0,
106
+ this.config.mode ? `mode:${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.mode)}` : void 0
107
+ ].filter(Boolean)
108
+ }, worker.metadata), { provider });
109
+ workers.push(resource);
110
+ const workerVersion = new _pulumi_cloudflare.WorkerVersion(`${this.config.organization ? `${this.config.organization}.` : ""}${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.name) === (0, _stryke_string_format_kebab_case.kebabCase)(worker.metadata.name) ? (0, _stryke_string_format_kebab_case.kebabCase)(this.config.name) : `${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.name)}.${(0, _stryke_string_format_kebab_case.kebabCase)(worker.metadata.name)}`}.${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.mode)}.worker-version`, (0, defu.default)({
111
+ accountId: this.config.cloudflare.accountId,
112
+ workerId: resource.id,
113
+ mainModule: (0, _stryke_path.joinPaths)(this.config.output.path, "index.mjs"),
114
+ modules: [{
115
+ name: (0, _stryke_path.joinPaths)(this.config.output.path, "index.mjs"),
116
+ contentType: "application/javascript+module",
117
+ contentFile: (0, _stryke_path.joinPaths)(this.config.output.path, "index.mjs")
118
+ }]
103
119
  }, worker.metadata, {
104
120
  compatibilityDate: this.config.compatibilityDate?.cloudflare?.toString(),
105
121
  compatibilityFlags: ["nodejs_als"]
106
122
  }), { provider });
107
- workerScripts.push(workerScript);
108
- const workerRoute = new _pulumi_cloudflare.WorkersRoute(`${this.config.organization ? `${this.config.organization}.` : ""}${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.name) === (0, _stryke_string_format_kebab_case.kebabCase)(worker.metadata.name) ? (0, _stryke_string_format_kebab_case.kebabCase)(this.config.name) : `${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.name)}-${(0, _stryke_string_format_kebab_case.kebabCase)(worker.metadata.name)}`}.${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.mode)}.worker-route`, (0, defu.default)({
123
+ workerVersions.push(workerVersion);
124
+ const workersDeployment = new _pulumi_cloudflare.WorkersDeployment(`${this.config.organization ? `${this.config.organization}.` : ""}${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.name) === (0, _stryke_string_format_kebab_case.kebabCase)(worker.metadata.name) ? (0, _stryke_string_format_kebab_case.kebabCase)(this.config.name) : `${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.name)}-${(0, _stryke_string_format_kebab_case.kebabCase)(worker.metadata.name)}`}.${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.mode)}.workers-deployment`, (0, defu.default)({
125
+ accountId: this.config.cloudflare.accountId,
109
126
  zoneId: zone.id,
110
- pattern: worker.metadata.pattern.replace("{domain}", this.config.cloudflare.domain),
111
- script: workerScript.scriptName
112
- }, worker.metadata), { provider });
113
- workerRoutes.push(workerRoute);
127
+ strategy: "percentage",
128
+ scriptName: resource.name,
129
+ versions: [{
130
+ percentage: 100,
131
+ versionId: workerVersion.id
132
+ }]
133
+ }), { provider });
134
+ workersDeployments.push(workersDeployment);
135
+ const workersRoute = new _pulumi_cloudflare.WorkersRoute(`${this.config.organization ? `${this.config.organization}.` : ""}${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.name) === (0, _stryke_string_format_kebab_case.kebabCase)(worker.metadata.name) ? (0, _stryke_string_format_kebab_case.kebabCase)(this.config.name) : `${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.name)}-${(0, _stryke_string_format_kebab_case.kebabCase)(worker.metadata.name)}`}.${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.mode)}.workers-route`, (0, defu.default)({
136
+ accountId: this.config.cloudflare.accountId,
137
+ zoneId: zone.id,
138
+ pattern: worker.metadata.pattern.replace("{domain}", this.config.cloudflare.domain).replace("{scriptName}", worker.metadata.name).replace("{mode}", this.config.mode),
139
+ script: resource.name
140
+ }), { provider });
141
+ workersRoutes.push(workersRoute);
114
142
  const dnsRecord = new _pulumi_cloudflare.DnsRecord(`${this.config.organization ? `${this.config.organization}.` : ""}${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.name) === (0, _stryke_string_format_kebab_case.kebabCase)(worker.metadata.name) ? (0, _stryke_string_format_kebab_case.kebabCase)(this.config.name) : `${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.name)}-${(0, _stryke_string_format_kebab_case.kebabCase)(worker.metadata.name)}`}.${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.mode)}.dns-record`, {
115
- name: workerRoute.pattern,
143
+ name: workersRoute.pattern,
116
144
  type: "A",
117
145
  content: "192.0.2.1",
118
146
  zoneId: zone.id,
@@ -122,8 +150,10 @@ function plugin(options = {}) {
122
150
  dnsRecords.push(dnsRecord);
123
151
  }
124
152
  return {
125
- workerScripts,
126
- workerRoutes,
153
+ workers,
154
+ workerVersions,
155
+ workersDeployments,
156
+ workersRoutes,
127
157
  dnsRecords
128
158
  };
129
159
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;;;;YA6CY,MAAA;IACR,UAAA,GAAa,uBAAA;EAAA;AAAA;;AAJY;;iBAWb,MAAA,kBACG,uBAAA,GAA0B,uBAAA,CAAA,CAC3C,OAAA,GAAS,uBAAA,GAgNJ,MAAA,CAAO,QAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;;;;YA6CY,MAAA;IACR,UAAA,GAAa,uBAAA;EAAA;AAAA;;AAJY;;iBAWb,MAAA,kBACG,uBAAA,GAA0B,uBAAA,CAAA,CAC3C,OAAA,GAAS,uBAAA,GAyQJ,MAAA,CAAO,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;;;;YA6CY,MAAA;IACR,UAAA,GAAa,uBAAA;EAAA;AAAA;;AAJY;;iBAWb,MAAA,kBACG,uBAAA,GAA0B,uBAAA,CAAA,CAC3C,OAAA,GAAS,uBAAA,GAgNJ,MAAA,CAAO,QAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;;;;YA6CY,MAAA;IACR,UAAA,GAAa,uBAAA;EAAA;AAAA;;AAJY;;iBAWb,MAAA,kBACG,uBAAA,GAA0B,uBAAA,CAAA,CAC3C,OAAA,GAAS,uBAAA,GAyQJ,MAAA,CAAO,QAAA"}
package/dist/index.mjs CHANGED
@@ -86,28 +86,56 @@ function plugin(options = {}) {
86
86
  account: { id: this.config.cloudflare.accountId },
87
87
  name: this.config.cloudflare.domain
88
88
  } }, { provider });
89
- const workerScripts = [];
90
- const workerRoutes = [];
89
+ const workers = [];
90
+ const workerVersions = [];
91
+ const workersDeployments = [];
92
+ const workersRoutes = [];
91
93
  const dnsRecords = [];
92
94
  for (const worker of this.workers) {
93
- const workerScript = new pulumiCloudflare.WorkersScript(`${this.config.organization ? `${this.config.organization}.` : ""}${kebabCase(this.config.name) === kebabCase(worker.metadata.name) ? kebabCase(this.config.name) : `${kebabCase(this.config.name)}.${kebabCase(worker.metadata.name)}`}.${kebabCase(this.config.mode)}.worker-script`, defu({
95
+ const resource = new pulumiCloudflare.Worker(`${this.config.organization ? `${this.config.organization}.` : ""}${kebabCase(this.config.name) === kebabCase(worker.metadata.name) ? kebabCase(this.config.name) : `${kebabCase(this.config.name)}.${kebabCase(worker.metadata.name)}`}.${kebabCase(this.config.mode)}.worker`, defu({
94
96
  accountId: this.config.cloudflare.accountId,
95
- scriptName: worker.metadata.name,
96
- contentFile: joinPaths(this.config.output.publishPath, "index.js"),
97
- module: true
97
+ name: worker.metadata.name,
98
+ tags: [
99
+ `project:${kebabCase(this.config.name)}`,
100
+ this.config.organization ? `organization:${kebabCase(this.config.organization)}` : void 0,
101
+ this.config.mode ? `mode:${kebabCase(this.config.mode)}` : void 0
102
+ ].filter(Boolean)
103
+ }, worker.metadata), { provider });
104
+ workers.push(resource);
105
+ const workerVersion = new pulumiCloudflare.WorkerVersion(`${this.config.organization ? `${this.config.organization}.` : ""}${kebabCase(this.config.name) === kebabCase(worker.metadata.name) ? kebabCase(this.config.name) : `${kebabCase(this.config.name)}.${kebabCase(worker.metadata.name)}`}.${kebabCase(this.config.mode)}.worker-version`, defu({
106
+ accountId: this.config.cloudflare.accountId,
107
+ workerId: resource.id,
108
+ mainModule: joinPaths(this.config.output.path, "index.mjs"),
109
+ modules: [{
110
+ name: joinPaths(this.config.output.path, "index.mjs"),
111
+ contentType: "application/javascript+module",
112
+ contentFile: joinPaths(this.config.output.path, "index.mjs")
113
+ }]
98
114
  }, worker.metadata, {
99
115
  compatibilityDate: this.config.compatibilityDate?.cloudflare?.toString(),
100
116
  compatibilityFlags: ["nodejs_als"]
101
117
  }), { provider });
102
- workerScripts.push(workerScript);
103
- const workerRoute = new pulumiCloudflare.WorkersRoute(`${this.config.organization ? `${this.config.organization}.` : ""}${kebabCase(this.config.name) === kebabCase(worker.metadata.name) ? kebabCase(this.config.name) : `${kebabCase(this.config.name)}-${kebabCase(worker.metadata.name)}`}.${kebabCase(this.config.mode)}.worker-route`, defu({
118
+ workerVersions.push(workerVersion);
119
+ const workersDeployment = new pulumiCloudflare.WorkersDeployment(`${this.config.organization ? `${this.config.organization}.` : ""}${kebabCase(this.config.name) === kebabCase(worker.metadata.name) ? kebabCase(this.config.name) : `${kebabCase(this.config.name)}-${kebabCase(worker.metadata.name)}`}.${kebabCase(this.config.mode)}.workers-deployment`, defu({
120
+ accountId: this.config.cloudflare.accountId,
104
121
  zoneId: zone.id,
105
- pattern: worker.metadata.pattern.replace("{domain}", this.config.cloudflare.domain),
106
- script: workerScript.scriptName
107
- }, worker.metadata), { provider });
108
- workerRoutes.push(workerRoute);
122
+ strategy: "percentage",
123
+ scriptName: resource.name,
124
+ versions: [{
125
+ percentage: 100,
126
+ versionId: workerVersion.id
127
+ }]
128
+ }), { provider });
129
+ workersDeployments.push(workersDeployment);
130
+ const workersRoute = new pulumiCloudflare.WorkersRoute(`${this.config.organization ? `${this.config.organization}.` : ""}${kebabCase(this.config.name) === kebabCase(worker.metadata.name) ? kebabCase(this.config.name) : `${kebabCase(this.config.name)}-${kebabCase(worker.metadata.name)}`}.${kebabCase(this.config.mode)}.workers-route`, defu({
131
+ accountId: this.config.cloudflare.accountId,
132
+ zoneId: zone.id,
133
+ pattern: worker.metadata.pattern.replace("{domain}", this.config.cloudflare.domain).replace("{scriptName}", worker.metadata.name).replace("{mode}", this.config.mode),
134
+ script: resource.name
135
+ }), { provider });
136
+ workersRoutes.push(workersRoute);
109
137
  const dnsRecord = new pulumiCloudflare.DnsRecord(`${this.config.organization ? `${this.config.organization}.` : ""}${kebabCase(this.config.name) === kebabCase(worker.metadata.name) ? kebabCase(this.config.name) : `${kebabCase(this.config.name)}-${kebabCase(worker.metadata.name)}`}.${kebabCase(this.config.mode)}.dns-record`, {
110
- name: workerRoute.pattern,
138
+ name: workersRoute.pattern,
111
139
  type: "A",
112
140
  content: "192.0.2.1",
113
141
  zoneId: zone.id,
@@ -117,8 +145,10 @@ function plugin(options = {}) {
117
145
  dnsRecords.push(dnsRecord);
118
146
  }
119
147
  return {
120
- workerScripts,
121
- workerRoutes,
148
+ workers,
149
+ workerVersions,
150
+ workersDeployments,
151
+ workersRoutes,
122
152
  dnsRecords
123
153
  };
124
154
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { For } from \"@alloy-js/core\";\nimport { getCloudflarePreset } from \"@cloudflare/unenv-preset\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport { readEnvTypeReflection } from \"@powerlines/plugin-env/helpers\";\nimport { resolveModule } from \"@powerlines/plugin-esbuild/helpers/resolve\";\nimport unenv from \"@powerlines/plugin-unenv\";\nimport * as pulumiCloudflare from \"@pulumi/cloudflare\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { joinPaths, replaceExtension } from \"@stryke/path\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport { CloudflareEnvBuiltin } from \"./components\";\nimport { CloudflareBuiltin } from \"./components/cloudflare-builtin\";\nimport { WorkerEntry } from \"./components/worker-entry\";\nimport {\n CloudflarePluginContext,\n CloudflarePluginOptions,\n CloudflareWorkerEntryModule\n} from \"./types/plugin\";\nimport { WorkerModule } from \"./types/worker-module\";\n\nexport * from \"./components\";\nexport type * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n cloudflare?: CloudflarePluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport function plugin<\n TContext extends CloudflarePluginContext = CloudflarePluginContext\n>(options: CloudflarePluginOptions = {}) {\n return [\n unenv(options.unenv),\n {\n name: \"cloudflare\",\n config() {\n return {\n cloudflare: defu(omit(options, [\"unenv\"]), {}),\n resolve: {\n skipNodeModulesBundle: false\n },\n unenv: {\n presets: [\n getCloudflarePreset({\n compatibilityDate: this.config.compatibilityDate?.toString(),\n compatibilityFlags: [\"nodejs_als\"]\n })\n ]\n }\n };\n },\n configResolved() {\n this.devDependencies[\"@cloudflare/workers-types\"] = \"^4.20240616.0\";\n },\n async prepare() {\n const result = await readEnvTypeReflection(this, \"env\");\n\n return render(\n this,\n <>\n <CloudflareBuiltin />\n <CloudflareEnvBuiltin reflection={result} />\n </>\n );\n },\n build: {\n order: \"pre\",\n async handler() {\n this.workers = await Promise.all(\n this.entry.map(async (entry, i, arr) => {\n if (!entry.input) {\n throw new Error(\n `Cloudflare Worker entry \"${entry.file}\" is missing an input file.`\n );\n }\n\n const workerModule = await resolveModule<WorkerModule>(\n this,\n entry.input\n );\n if (!workerModule?.default) {\n throw new Error(\n `Cloudflare Worker entry \"${\n entry.file\n }\" does not export a default handler. The Powerlines Cloudflare plugin expects each Worker entry module to export a default object matching the \\`ExportedHandler\\` interface from \"@cloudflare/workers-types\".`\n );\n }\n\n const name =\n workerModule.metadata?.name ||\n replaceExtension(entry.input.file || entry.file) ||\n arr.length > 1\n ? `${this.config.name}-${i}`\n : this.config.name;\n\n return {\n metadata: {\n name,\n pattern: `${name}.{domain}`,\n entry\n },\n fetch: isFunction(workerModule.default.fetch),\n tail: isFunction(workerModule.default.tail),\n trace: isFunction(workerModule.default.trace),\n tailStream: isFunction(workerModule.default.tailStream),\n scheduled: isFunction(workerModule.default.scheduled),\n test: isFunction(workerModule.default.test),\n email: isFunction(workerModule.default.email),\n queue: isFunction(workerModule.default.queue)\n } satisfies CloudflareWorkerEntryModule;\n })\n );\n\n return render(\n this,\n <For each={this.workers}>\n {worker => <WorkerEntry worker={worker} />}\n </For>\n );\n }\n },\n async deployPulumi() {\n let apiToken = process.env.CLOUDFLARE_API_TOKEN;\n if (!apiToken) {\n apiToken = this.config.cloudflare.apiToken;\n if (apiToken) {\n this.warn(\n \"If possible, please use the `CLOUDFLARE_API_TOKEN` environment variable instead of using the `apiToken` option directly. The `apiToken` option will work; however, this is a less secure method of configuration.\"\n );\n } else {\n throw new Error(\n \"Unable to determine the Cloudflare API token. Please set the `CLOUDFLARE_API_TOKEN` environment variable.\"\n );\n }\n }\n\n await this.pulumi.setConfig(\"cloudflare:apiToken\", {\n value: apiToken\n });\n\n const provider = new pulumiCloudflare.Provider(\"cloudflare-provider\", {\n apiToken\n });\n\n const zone = await pulumiCloudflare.getZone(\n {\n filter: {\n account: { id: this.config.cloudflare.accountId },\n name: this.config.cloudflare.domain\n }\n },\n { provider }\n );\n\n const workerScripts = [] as pulumiCloudflare.WorkersScript[];\n const workerRoutes = [] as pulumiCloudflare.WorkersRoute[];\n const dnsRecords = [] as pulumiCloudflare.DnsRecord[];\n for (const worker of this.workers) {\n const workerScript = new pulumiCloudflare.WorkersScript(\n `${this.config.organization ? `${this.config.organization}.` : \"\"}${\n kebabCase(this.config.name) === kebabCase(worker.metadata.name)\n ? kebabCase(this.config.name)\n : `${kebabCase(this.config.name)}.${kebabCase(\n worker.metadata.name\n )}`\n }.${kebabCase(this.config.mode)}.worker-script`,\n defu(\n {\n accountId: this.config.cloudflare.accountId,\n scriptName: worker.metadata.name,\n contentFile: joinPaths(\n this.config.output.publishPath,\n \"index.js\"\n ),\n module: true\n },\n worker.metadata,\n {\n compatibilityDate:\n this.config.compatibilityDate?.cloudflare?.toString() as string,\n compatibilityFlags: [\"nodejs_als\"]\n }\n ) as pulumiCloudflare.WorkersScriptArgs,\n { provider }\n );\n workerScripts.push(workerScript);\n\n const workerRoute = new pulumiCloudflare.WorkersRoute(\n `${this.config.organization ? `${this.config.organization}.` : \"\"}${\n kebabCase(this.config.name) === kebabCase(worker.metadata.name)\n ? kebabCase(this.config.name)\n : `${kebabCase(this.config.name)}-${kebabCase(\n worker.metadata.name\n )}`\n }.${kebabCase(this.config.mode)}.worker-route`,\n defu(\n {\n zoneId: zone.id,\n pattern: worker.metadata.pattern.replace(\n \"{domain}\",\n this.config.cloudflare.domain\n ),\n script: workerScript.scriptName\n },\n worker.metadata\n ),\n { provider }\n );\n workerRoutes.push(workerRoute);\n\n const dnsRecord = new pulumiCloudflare.DnsRecord(\n `${this.config.organization ? `${this.config.organization}.` : \"\"}${\n kebabCase(this.config.name) === kebabCase(worker.metadata.name)\n ? kebabCase(this.config.name)\n : `${kebabCase(this.config.name)}-${kebabCase(\n worker.metadata.name\n )}`\n }.${kebabCase(this.config.mode)}.dns-record`,\n {\n name: workerRoute.pattern,\n type: \"A\",\n content: \"192.0.2.1\",\n zoneId: zone.id,\n proxied: true,\n ttl: 1\n },\n { provider }\n );\n dnsRecords.push(dnsRecord);\n }\n\n return {\n workerScripts,\n workerRoutes,\n dnsRecords\n };\n }\n }\n ] as Plugin<TContext>[];\n}\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAgDA,SAAA,OAAA,UAAA,EAAA,EAAA;;EAEE,MAAA;EACE,SAAC;AACH,UAAA;IACK,YAAS,KAAM,KAAA,SAAA,CAAA,QAAA,CAAA,EAAA,EAAA,CAAA;IACpB,SAAS,EACD,uBAAC,OACF;IACL,OAAM,EACN,SAAA,CAAA,oBAAA;KACQ,mBAAY,KAAA,OAAA,mBAAA,UAAA;KACZ,oBAAG,CAAA,aAAA;KACP,CAAA,CAAA,EACC;IACF;;EAEH,iBAAO;AACL,QAAI,gBAAO,+BAAA;;EAEb,MAAM,UAAI;GACR,MAAM,SAAI,MAAA,sBAA+B,MAAA,MAAA;AACzC,UAAO,OAAG,MAAA,CAAA,gBAAsB,mBAAW,EAAA,CAAA,EAAA,gBAAA,sBAAA,EACzC,YAAO,QACR,CAAC,CAAC,CAAC;;EAEN,OAAK;GACH,OAAC;GACD,MAAA,UAAgB;IACd,MAAK,SAAA;AACN,SAAA,UAAA,MAAA,QAAA,IAAA,KAAA,MAAA,IAAA,OAAA,OAAA,GAAA,QAAA;AACD,SAAM,CAAA,MAAS,MACb,OAAM,IAAQ,MAAM,4BAA4B,MAAM,KAAC,6BAAA;KAEvD,MAAO,eAAM,MAAA,cAAA,MAAA,MAAA,MAAA;AACX,SAAI,CAAA,cAAA,QACH,OAAA,IAAA,MAAA,4BAAA,MAAA,KAAA,gNAAA;KAED,MAAG,OAAA,aAAqB,UAAY,QAAQ,iBAAC,MAAA,MAAA,QAAA,MAAA,KAAA,IAAA,IAAA,SAAA,IAAA,GAAA,KAAA,OAAA,KAAA,GAAA,MAAA,KAAA,OAAA;AAC7C,YAAE;MACH,UAAA;OACF;OACM,SAAA,GAAA,KAAA;O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,CAAC"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { For } from \"@alloy-js/core\";\nimport { getCloudflarePreset } from \"@cloudflare/unenv-preset\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport { readEnvTypeReflection } from \"@powerlines/plugin-env/helpers\";\nimport { resolveModule } from \"@powerlines/plugin-esbuild/helpers/resolve\";\nimport unenv from \"@powerlines/plugin-unenv\";\nimport * as pulumiCloudflare from \"@pulumi/cloudflare\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { joinPaths, replaceExtension } from \"@stryke/path\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport { CloudflareEnvBuiltin } from \"./components\";\nimport { CloudflareBuiltin } from \"./components/cloudflare-builtin\";\nimport { WorkerEntry } from \"./components/worker-entry\";\nimport {\n CloudflarePluginContext,\n CloudflarePluginOptions,\n CloudflareWorkerEntryModule\n} from \"./types/plugin\";\nimport { WorkerModule } from \"./types/worker-module\";\n\nexport * from \"./components\";\nexport type * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n cloudflare?: CloudflarePluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport function plugin<\n TContext extends CloudflarePluginContext = CloudflarePluginContext\n>(options: CloudflarePluginOptions = {}) {\n return [\n unenv(options.unenv),\n {\n name: \"cloudflare\",\n config() {\n return {\n cloudflare: defu(omit(options, [\"unenv\"]), {}),\n resolve: {\n skipNodeModulesBundle: false\n },\n unenv: {\n presets: [\n getCloudflarePreset({\n compatibilityDate: this.config.compatibilityDate?.toString(),\n compatibilityFlags: [\"nodejs_als\"]\n })\n ]\n }\n };\n },\n configResolved() {\n this.devDependencies[\"@cloudflare/workers-types\"] = \"^4.20240616.0\";\n },\n async prepare() {\n const result = await readEnvTypeReflection(this, \"env\");\n\n return render(\n this,\n <>\n <CloudflareBuiltin />\n <CloudflareEnvBuiltin reflection={result} />\n </>\n );\n },\n build: {\n order: \"pre\",\n async handler() {\n this.workers = await Promise.all(\n this.entry.map(async (entry, i, arr) => {\n if (!entry.input) {\n throw new Error(\n `Cloudflare Worker entry \"${entry.file}\" is missing an input file.`\n );\n }\n\n const workerModule = await resolveModule<WorkerModule>(\n this,\n entry.input\n );\n if (!workerModule?.default) {\n throw new Error(\n `Cloudflare Worker entry \"${\n entry.file\n }\" does not export a default handler. The Powerlines Cloudflare plugin expects each Worker entry module to export a default object matching the \\`ExportedHandler\\` interface from \"@cloudflare/workers-types\".`\n );\n }\n\n const name =\n workerModule.metadata?.name ||\n replaceExtension(entry.input.file || entry.file) ||\n arr.length > 1\n ? `${this.config.name}-${i}`\n : this.config.name;\n\n return {\n metadata: {\n name,\n pattern: `${name}.{domain}`,\n entry\n },\n fetch: isFunction(workerModule.default.fetch),\n tail: isFunction(workerModule.default.tail),\n trace: isFunction(workerModule.default.trace),\n tailStream: isFunction(workerModule.default.tailStream),\n scheduled: isFunction(workerModule.default.scheduled),\n test: isFunction(workerModule.default.test),\n email: isFunction(workerModule.default.email),\n queue: isFunction(workerModule.default.queue)\n } satisfies CloudflareWorkerEntryModule;\n })\n );\n\n return render(\n this,\n <For each={this.workers}>\n {worker => <WorkerEntry worker={worker} />}\n </For>\n );\n }\n },\n async deployPulumi() {\n let apiToken = process.env.CLOUDFLARE_API_TOKEN;\n if (!apiToken) {\n apiToken = this.config.cloudflare.apiToken;\n if (apiToken) {\n this.warn(\n \"If possible, please use the `CLOUDFLARE_API_TOKEN` environment variable instead of using the `apiToken` option directly. The `apiToken` option will work; however, this is a less secure method of configuration.\"\n );\n } else {\n throw new Error(\n \"Unable to determine the Cloudflare API token. Please set the `CLOUDFLARE_API_TOKEN` environment variable.\"\n );\n }\n }\n\n await this.pulumi.setConfig(\"cloudflare:apiToken\", {\n value: apiToken\n });\n\n const provider = new pulumiCloudflare.Provider(\"cloudflare-provider\", {\n apiToken\n });\n\n const zone = await pulumiCloudflare.getZone(\n {\n filter: {\n account: { id: this.config.cloudflare.accountId },\n name: this.config.cloudflare.domain\n }\n },\n { provider }\n );\n\n const workers = [] as pulumiCloudflare.Worker[];\n const workerVersions = [] as pulumiCloudflare.WorkerVersion[];\n const workersDeployments = [] as pulumiCloudflare.WorkersDeployment[];\n const workersRoutes = [] as pulumiCloudflare.WorkersRoute[];\n const dnsRecords = [] as pulumiCloudflare.DnsRecord[];\n for (const worker of this.workers) {\n const resource = new pulumiCloudflare.Worker(\n `${this.config.organization ? `${this.config.organization}.` : \"\"}${\n kebabCase(this.config.name) === kebabCase(worker.metadata.name)\n ? kebabCase(this.config.name)\n : `${kebabCase(this.config.name)}.${kebabCase(\n worker.metadata.name\n )}`\n }.${kebabCase(this.config.mode)}.worker`,\n defu(\n {\n accountId: this.config.cloudflare.accountId,\n name: worker.metadata.name,\n tags: [\n `project:${kebabCase(this.config.name)}`,\n this.config.organization\n ? `organization:${kebabCase(this.config.organization)}`\n : undefined,\n this.config.mode\n ? `mode:${kebabCase(this.config.mode)}`\n : undefined\n ].filter(Boolean) as string[]\n },\n worker.metadata\n ) as pulumiCloudflare.WorkerArgs,\n { provider }\n );\n workers.push(resource);\n\n const workerVersion = new pulumiCloudflare.WorkerVersion(\n `${this.config.organization ? `${this.config.organization}.` : \"\"}${\n kebabCase(this.config.name) === kebabCase(worker.metadata.name)\n ? kebabCase(this.config.name)\n : `${kebabCase(this.config.name)}.${kebabCase(\n worker.metadata.name\n )}`\n }.${kebabCase(this.config.mode)}.worker-version`,\n defu(\n {\n accountId: this.config.cloudflare.accountId,\n workerId: resource.id,\n mainModule: joinPaths(this.config.output.path, \"index.mjs\"),\n modules: [\n {\n name: joinPaths(this.config.output.path, \"index.mjs\"),\n contentType: \"application/javascript+module\",\n contentFile: joinPaths(this.config.output.path, \"index.mjs\")\n }\n ]\n },\n worker.metadata,\n {\n compatibilityDate:\n this.config.compatibilityDate?.cloudflare?.toString() as string,\n compatibilityFlags: [\"nodejs_als\"]\n }\n ) as pulumiCloudflare.WorkerVersionArgs,\n { provider }\n );\n workerVersions.push(workerVersion);\n\n const workersDeployment = new pulumiCloudflare.WorkersDeployment(\n `${this.config.organization ? `${this.config.organization}.` : \"\"}${\n kebabCase(this.config.name) === kebabCase(worker.metadata.name)\n ? kebabCase(this.config.name)\n : `${kebabCase(this.config.name)}-${kebabCase(\n worker.metadata.name\n )}`\n }.${kebabCase(this.config.mode)}.workers-deployment`,\n defu({\n accountId: this.config.cloudflare.accountId,\n zoneId: zone.id,\n strategy: \"percentage\",\n scriptName: resource.name,\n versions: [\n {\n percentage: 100,\n versionId: workerVersion.id\n }\n ]\n }),\n { provider }\n );\n workersDeployments.push(workersDeployment);\n\n const workersRoute = new pulumiCloudflare.WorkersRoute(\n `${this.config.organization ? `${this.config.organization}.` : \"\"}${\n kebabCase(this.config.name) === kebabCase(worker.metadata.name)\n ? kebabCase(this.config.name)\n : `${kebabCase(this.config.name)}-${kebabCase(\n worker.metadata.name\n )}`\n }.${kebabCase(this.config.mode)}.workers-route`,\n defu({\n accountId: this.config.cloudflare.accountId,\n zoneId: zone.id,\n pattern: worker.metadata.pattern\n .replace(\"{domain}\", this.config.cloudflare.domain)\n .replace(\"{scriptName}\", worker.metadata.name)\n .replace(\"{mode}\", this.config.mode),\n script: resource.name\n }),\n { provider }\n );\n workersRoutes.push(workersRoute);\n\n const dnsRecord = new pulumiCloudflare.DnsRecord(\n `${this.config.organization ? `${this.config.organization}.` : \"\"}${\n kebabCase(this.config.name) === kebabCase(worker.metadata.name)\n ? kebabCase(this.config.name)\n : `${kebabCase(this.config.name)}-${kebabCase(\n worker.metadata.name\n )}`\n }.${kebabCase(this.config.mode)}.dns-record`,\n {\n name: workersRoute.pattern,\n type: \"A\",\n content: \"192.0.2.1\",\n zoneId: zone.id,\n proxied: true,\n ttl: 1\n },\n { provider }\n );\n dnsRecords.push(dnsRecord);\n }\n\n return {\n workers,\n workerVersions,\n workersDeployments,\n workersRoutes,\n dnsRecords\n };\n }\n }\n ] as Plugin<TContext>[];\n}\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAgDA,SAAA,OAAA,UAAA,EAAA,EAAA;;EAEE,MAAA;EACE,SAAC;AACH,UAAA;IACK,YAAS,KAAM,KAAA,SAAA,CAAA,QAAA,CAAA,EAAA,EAAA,CAAA;IACpB,SAAS,EACD,uBAAC,OACF;IACL,OAAM,EACN,SAAA,CAAA,oBAAA;KACQ,mBAAY,KAAA,OAAA,mBAAA,UAAA;KACZ,oBAAG,CAAA,aAAA;KACP,CAAA,CAAA,EACC;IACF;;EAEH,iBAAO;AACL,QAAI,gBAAO,+BAAA;;EAEb,MAAM,UAAI;GACR,MAAM,SAAI,MAAA,sBAA+B,MAAA,MAAA;AACzC,UAAO,OAAG,MAAA,CAAA,gBAAsB,mBAAW,EAAA,CAAA,EAAA,gBAAA,sBAAA,EACzC,YAAO,QACR,CAAC,CAAC,CAAC;;EAEN,OAAK;GACH,OAAC;GACD,MAAA,UAAgB;IACd,MAAK,SAAA;AACN,SAAA,UAAA,MAAA,QAAA,IAAA,KAAA,MAAA,IAAA,OAAA,OAAA,GAAA,QAAA;AACD,SAAM,CAAA,MAAS,MACb,OAAM,IAAQ,MAAM,4BAA4B,MAAM,KAAC,6BAAA;KAEvD,MAAO,eAAM,MAAA,cAAA,MAAA,MAAA,MAAA;AACX,SAAI,CAAA,cAAA,QACH,OAA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AAA,SAAA,KAAA,GAAA,UAAA,KAAA,OAAA,KAAA,GAAA,GAAA,UAAA,KAAA,OAAA,KAAA,CAAA,GAAA,UAAA,OAAA,SAAA,KAAA,GAAA,GAAA,UAAA,KAAA,OAAA,KAAA,CAAA,cAAA;KACV,MAAM,aAAU;KAChB,MAAM;KACN,SAAI;KACJ,QAAM,KAAA;KACN,SAAM;KACN,KAAK;KACN,EAAE,EACD,UACD,CAAC;AACF,eAAW,KAAG,UAAS;;AAEzB,UAAO;IACL;IACA;IACA;IACA;IACA;IACD;;EAEJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-cloudflare",
3
- "version": "0.5.3",
3
+ "version": "0.5.6",
4
4
  "private": false,
5
5
  "description": "A Powerlines plugin that provides integration with Cloudflare services.",
6
6
  "keywords": ["powerlines", "storm-software", "powerlines-plugin"],
@@ -162,12 +162,12 @@
162
162
  "@alloy-js/core": "0.23.0-dev.8",
163
163
  "@alloy-js/typescript": "0.23.0-dev.4",
164
164
  "@cloudflare/workers-types": "^4.20260317.1",
165
- "@powerlines/plugin-env": "^0.16.83",
166
- "@powerlines/plugin-pulumi": "^0.6.3",
167
- "@powerlines/plugin-unenv": "^0.1.351",
165
+ "@powerlines/plugin-env": "^0.16.86",
166
+ "@powerlines/plugin-pulumi": "^0.6.6",
167
+ "@powerlines/plugin-unenv": "^0.1.354",
168
168
  "@pulumi/cloudflare": "^6.13.0",
169
169
  "@pulumi/pulumi": "^3.226.0",
170
- "@storm-software/config-tools": "^1.189.39",
170
+ "@storm-software/config-tools": "^1.189.40",
171
171
  "@stryke/hash": "^0.13.16",
172
172
  "@stryke/helpers": "^0.10.6",
173
173
  "@stryke/path": "^0.27.2",
@@ -175,16 +175,16 @@
175
175
  "@stryke/type-checks": "^0.5.41",
176
176
  "@stryke/types": "^0.11.1",
177
177
  "defu": "^6.1.4",
178
- "powerlines": "^0.42.3"
178
+ "powerlines": "^0.42.6"
179
179
  },
180
180
  "devDependencies": {
181
181
  "@cloudflare/unenv-preset": "^2.15.0",
182
182
  "@cloudflare/workers-types": "^4.20260317.1",
183
- "@powerlines/plugin-alloy": "^0.25.48",
184
- "@powerlines/plugin-plugin": "^0.12.313",
183
+ "@powerlines/plugin-alloy": "^0.25.51",
184
+ "@powerlines/plugin-plugin": "^0.12.316",
185
185
  "@types/node": "^25.5.0"
186
186
  },
187
187
  "publishConfig": { "access": "public" },
188
188
  "inlinedDependencies": { "@cloudflare/unenv-preset": "2.15.0" },
189
- "gitHead": "c9c61ea343f037afaa4097720d77cb822eb86e63"
189
+ "gitHead": "af94c1952c9f2d293dac72a2d0ed3627be8d807d"
190
190
  }