@sordo/deploy-cloudflare 0.4.0 → 1.0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @sordo/deploy-cloudflare
2
2
 
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 7f48eb7: The framework now publishes as `@sordo/core` and the scaffolder as `@sordo/create`; `sordo` and `create-sordo` remain as thin re-export shims for a deprecation window. Imports change from `sordo/*` to `@sordo/core/*` (run `sordo migrate scope` to rewrite imports and `package.json`), and `sordo upgrade` now tracks `@sordo/core`. The `sordo` CLI binary keeps its name.
8
+
9
+ ### Patch Changes
10
+
11
+ - b9a7257: edge: `sordo build --target edge` reports the inlined `public/` total and largest files, warns at `adapter.edge.warnBytes` and fails above `adapter.edge.maxBytes`, and prints the `worker.js` path last; docs state the `.sordo/worker.js` output path. deploy-cloudflare: `wranglerEnv` with a generated config now defines `env.<name>` (`<name>-<env>`) instead of deploying the unsuffixed Worker.
12
+
13
+ ## 0.5.0
14
+
3
15
  ## 0.4.0
4
16
 
5
17
  ### Minor Changes
package/README.md CHANGED
@@ -9,7 +9,7 @@ bunx wrangler login
9
9
 
10
10
  ```ts
11
11
  // sordo.config.ts
12
- import { defineConfig } from "sordo/config";
12
+ import { defineConfig } from "@sordo/core/config";
13
13
  import { cloudflare } from "@sordo/deploy-cloudflare";
14
14
 
15
15
  export default defineConfig({
@@ -37,7 +37,7 @@ sordo deploy --target edge
37
37
  | `name` | package.json `name` | Worker name in the generated config |
38
38
  | `config` | auto-detect | Path to your own Wrangler config |
39
39
  | `compatibilityDate` | today (UTC) | Generated config only |
40
- | `wranglerEnv` | — | `wrangler deploy --env <name>` |
40
+ | `wranglerEnv` | — | `wrangler deploy --env <name>`; a generated config gets an `env.<name>` block deploying `<name>-<env>`, so staging never overwrites production |
41
41
  | `dryRun` | `false` | `--dry-run`; also `SORDO_DEPLOY_DRY_RUN=1` |
42
42
  | `args` | — | Extra `wrangler deploy` arguments |
43
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sordo/deploy-cloudflare",
3
- "version": "0.4.0",
3
+ "version": "1.0.0",
4
4
  "description": "Deploy a Sordo edge build to Cloudflare Workers with Wrangler.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,10 +23,10 @@
23
23
  "lint": "biome check ."
24
24
  },
25
25
  "peerDependencies": {
26
- "sordo": ">=0.3.0"
26
+ "@sordo/core": ">=0.3.0"
27
27
  },
28
28
  "devDependencies": {
29
- "sordo": "workspace:*"
29
+ "@sordo/core": "workspace:*"
30
30
  },
31
31
  "engines": {
32
32
  "bun": ">=1.3.0"
package/src/index.ts CHANGED
@@ -3,7 +3,7 @@ import type {
3
3
  DeployArtifacts,
4
4
  DeployContext,
5
5
  DeployPlugin,
6
- } from "sordo/plugin";
6
+ } from "@sordo/core/plugin";
7
7
 
8
8
  export interface RunResult {
9
9
  code: number;
@@ -80,13 +80,21 @@ async function generateConfig(
80
80
  const hasAssets = await Bun.file(
81
81
  join(outDir, "worker-assets", "manifest.json"),
82
82
  ).exists();
83
+ const name = await workerName(cwd, options.name);
83
84
  const config: Record<string, unknown> = {
84
- name: await workerName(cwd, options.name),
85
+ name,
85
86
  main: "worker.js",
86
87
  compatibility_date:
87
88
  options.compatibilityDate ?? new Date().toISOString().slice(0, 10),
88
89
  };
89
90
  if (hasAssets) config.assets = { directory: "worker-assets" };
91
+ // Wrangler only warns on an unknown --env and then deploys the top-level
92
+ // (production-named) Worker, so the env must exist in the generated config.
93
+ if (options.wranglerEnv) {
94
+ config.env = {
95
+ [options.wranglerEnv]: { name: `${name}-${options.wranglerEnv}` },
96
+ };
97
+ }
90
98
  const path = join(outDir, "wrangler.generated.jsonc");
91
99
  await Bun.write(path, `${JSON.stringify(config, null, 2)}\n`);
92
100
  return path;
@@ -98,6 +106,8 @@ export function cloudflare(
98
106
  const run = options.run ?? spawnRunner;
99
107
  return {
100
108
  name: PLUGIN_NAME,
109
+ // Keep in step with the `@sordo/core` peerDependency range in package.json.
110
+ compat: ">=0.3.0",
101
111
  deployTarget: "edge",
102
112
  async deploy(
103
113
  artifacts: DeployArtifacts,