@afterpack/astro 1.0.2 → 1.1.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
@@ -2,6 +2,40 @@
2
2
 
3
3
  The full changelog, including cloud and dashboard changes, is at https://www.afterpack.dev/changelog.
4
4
 
5
+ ## 1.1.0 - 2026-11-28
6
+
7
+ Cloud builds of any size, all-caps variables and empty values that reset
8
+
9
+ ### Added
10
+
11
+ - **Cloud:** A Pro cloud build of any size runs as one build. The server splits a large build into parts, and you get one entry in the builds list, one usage charge and one Protection Map that merges every part. The 200-file limit on a cloud build is gone with the 1.1.0 CLI and plugins; older versions keep sending each build as one request, within that limit. A build that is cancelled or drops gives back what it reserved for files it did not deliver.
12
+ - **Dashboard:** A cloud build in progress shows as building, with the bytes it has reserved. Once it finishes, its page shows what was billed and what went back.
13
+ - **Plugins:** An empty value resets `key`, `seed` or a list option to its default and overrides `afterpack.json`: `AFTERPACK_KEY=` builds locally on Free, and `AFTERPACK_SEED=` draws a fresh seed. Before, an empty seed pinned one fixed seed, in the plugins and in `@afterpack/core` and `@afterpack/wasm` alike. An empty value for any other option, such as `AFTERPACK_PRESET=`, now fails the build with an error naming the option, and so do `complexity=` and `inflation.max=` in a directive. ([Empty values](https://www.afterpack.dev/docs/config#empty-values))
14
+ - **Engine:** In `@afterpack/core`, `key: null` builds locally on Free without reading `AFTERPACK_KEY` or `afterpack.json`.
15
+ - **CLI:** `afterpack network keygen` prints a key pair for network protection, which arrives in a later release.
16
+
17
+ ### Changed
18
+
19
+ - **Plugins:** Every option's environment variable is spelled in capitals: `strings.minLength` is `AFTERPACK_STRINGS_MIN_LENGTH`. The spelling that keeps the option's case, `AFTERPACK_strings_minLength`, still works. Setting both spellings of one option to different values fails the build. An all-caps variable that looks like an option but matches none, such as `AFTERPACK_SOURCEMAP_ENABLED`, fails with the right spelling. ([Configuration](https://www.afterpack.dev/docs/config))
20
+ - **Plugins:** The CLI and plugins read `key` only from `--key=`, `AFTERPACK_KEY` and the `afterpack.json` they read the rest of the configuration from. A key in another `afterpack.json`, such as one at a monorepo root above the project's own, no longer applies. If your key lives only in a monorepo-root `afterpack.json`, move it to `AFTERPACK_KEY` or the project's own `afterpack.json`. With an engine older than 1.1.0, a build that would pick up such a key fails and names the update to install. ([Key lookup](https://www.afterpack.dev/docs/config#key-lookup))
21
+
22
+ ### Fixed
23
+
24
+ - **Plugins:** `seed: "git"` with no commit to read falls back to the seed in `AFTERPACK_SEED`, then the one in `afterpack.json`.
25
+ - **Plugins:** Astro's server build adds its entries to `strings.preserveLiterals` instead of replacing the list from `afterpack.json` or the environment.
26
+
27
+ ## 1.0.3 - 2026-11-13
28
+
29
+ A smaller WebAssembly engine and a `super` fix
30
+
31
+ ### Changed
32
+
33
+ - **Engine:** `@afterpack/wasm` is smaller: 1.23 MiB gzipped, down from 1.29 MiB.
34
+
35
+ ### Fixed
36
+
37
+ - **Engine:** An object literal getter or setter that uses `super`, such as `get x() { return super.x }`, is now protected. Before, the file failed the build.
38
+
5
39
  ## 1.0.2 - 2026-10-27
6
40
 
7
41
  Classic-script scoping and direct `eval` fixes
package/dist/index.cjs CHANGED
@@ -80,15 +80,7 @@ function assertAstroPlaceholdersPinned() {
80
80
  }
81
81
  assertPlaceholdersPinned(findAstroPlaceholders(distDir));
82
82
  }
83
- function serverOptionsOf(options) {
84
- return {
85
- ...options,
86
- strings: {
87
- ...options.strings,
88
- preserveLiterals: [...options.strings?.preserveLiterals ?? [], ...ASTRO_POST_BUILD_PLACEHOLDERS]
89
- }
90
- };
91
- }
83
+ const SERVER_LISTS = { strings: { preserveLiterals: [...ASTRO_POST_BUILD_PLACEHOLDERS] } };
92
84
  function afterpackAstro(options = {}) {
93
85
  return {
94
86
  name: "@afterpack/astro",
@@ -99,7 +91,7 @@ function afterpackAstro(options = {}) {
99
91
  applyToEnvironment: (environment) => environment.name === "client"
100
92
  };
101
93
  const serverPlugin = {
102
- ...(0, __afterpack_vite.afterpackVite)(serverOptionsOf(options)),
94
+ ...(0, __afterpack_vite.afterpackVite)(options, { appendLists: SERVER_LISTS }),
103
95
  applyToEnvironment: (environment) => SERVER_VITE_ENVIRONMENT_NAMES.includes(environment.name)
104
96
  };
105
97
  updateConfig({ vite: { plugins: [clientPlugin, serverPlugin] } });
package/dist/index.js CHANGED
@@ -56,15 +56,7 @@ function assertAstroPlaceholdersPinned() {
56
56
  }
57
57
  assertPlaceholdersPinned(findAstroPlaceholders(distDir));
58
58
  }
59
- function serverOptionsOf(options) {
60
- return {
61
- ...options,
62
- strings: {
63
- ...options.strings,
64
- preserveLiterals: [...options.strings?.preserveLiterals ?? [], ...ASTRO_POST_BUILD_PLACEHOLDERS]
65
- }
66
- };
67
- }
59
+ const SERVER_LISTS = { strings: { preserveLiterals: [...ASTRO_POST_BUILD_PLACEHOLDERS] } };
68
60
  function afterpackAstro(options = {}) {
69
61
  return {
70
62
  name: "@afterpack/astro",
@@ -75,7 +67,7 @@ function afterpackAstro(options = {}) {
75
67
  applyToEnvironment: (environment) => environment.name === "client"
76
68
  };
77
69
  const serverPlugin = {
78
- ...afterpackVite(serverOptionsOf(options)),
70
+ ...afterpackVite(options, { appendLists: SERVER_LISTS }),
79
71
  applyToEnvironment: (environment) => SERVER_VITE_ENVIRONMENT_NAMES.includes(environment.name)
80
72
  };
81
73
  updateConfig({ vite: { plugins: [clientPlugin, serverPlugin] } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afterpack/astro",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "Astro integration for AfterPack: obfuscate the client and server JavaScript of an Astro build",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -30,8 +30,8 @@
30
30
  "astro": "^4.0.0 || ^5.0.0 || ^6.0.0"
31
31
  },
32
32
  "dependencies": {
33
- "@afterpack/integration-utils": "1.0.2",
34
- "@afterpack/vite": "1.0.2"
33
+ "@afterpack/integration-utils": "1.1.0",
34
+ "@afterpack/vite": "1.1.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@biomejs/biome": "2.4.4",