@afterpack/astro 1.0.3 → 1.2.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,47 @@
2
2
 
3
3
  The full changelog, including cloud and dashboard changes, is at https://www.afterpack.dev/changelog.
4
4
 
5
+ ## 1.2.0 - 2026-11-28
6
+
7
+ A file list for every build, and excluded files stay local
8
+
9
+ ### Added
10
+
11
+ - **Dashboard:** Every Pro cloud build's page lists the files it was made of, each with its size before and after protection, its inflation and its status. Coverage, inflation and complexity show on every build, with or without a Protection Map. ([Builds](https://www.afterpack.dev/docs/dashboard/builds))
12
+ - **Dashboard:** A build's page names the bundle it built, such as `vite.landing.config.ts`, and shows whether it ran in CI, with a link to the run, or locally. The builds list groups the builds of one commit by bundle. The bundle name and the CI details come from the 1.2.0 CLI and plugins.
13
+ - **Plugins:** A Pro cloud build reports the bundle it built, the CI provider and a link to the CI run, for the build's page.
14
+ - **Engine:** The build context in `@afterpack/core` accepts `bundle`, `environment`, `ciProvider` and `ciRunUrl`.
15
+
16
+ ### Changed
17
+
18
+ - **Plugins:** On a Pro cloud build, files matched by `paths.exclude` are no longer uploaded or billed. They ship unchanged, as before, and still appear in the build's file list. ([paths.exclude](https://www.afterpack.dev/docs/config#paths-exclude))
19
+
20
+ ### Fixed
21
+
22
+ - **Cloud:** A Pro cloud build no longer hangs when an upload stalls: the stalled part is sent again, and it is not billed twice.
23
+
24
+ ## 1.1.0 - 2026-11-28
25
+
26
+ Cloud builds of any size, all-caps variables and empty values that reset
27
+
28
+ ### Added
29
+
30
+ - **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.
31
+ - **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.
32
+ - **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))
33
+ - **Engine:** In `@afterpack/core`, `key: null` builds locally on Free without reading `AFTERPACK_KEY` or `afterpack.json`.
34
+ - **CLI:** `afterpack network keygen` prints a key pair for network protection, which arrives in a later release.
35
+
36
+ ### Changed
37
+
38
+ - **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))
39
+ - **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))
40
+
41
+ ### Fixed
42
+
43
+ - **Plugins:** `seed: "git"` with no commit to read falls back to the seed in `AFTERPACK_SEED`, then the one in `afterpack.json`.
44
+ - **Plugins:** Astro's server build adds its entries to `strings.preserveLiterals` instead of replacing the list from `afterpack.json` or the environment.
45
+
5
46
  ## 1.0.3 - 2026-11-13
6
47
 
7
48
  A smaller WebAssembly engine and a `super` fix
package/dist/index.cjs CHANGED
@@ -70,6 +70,7 @@ function assertPlaceholdersPinned(found) {
70
70
 
71
71
  //#endregion
72
72
  //#region src/index.ts
73
+ const ASTRO = "astro";
73
74
  const SERVER_VITE_ENVIRONMENT_NAMES = ["ssr", "prerender"];
74
75
  function assertAstroPlaceholdersPinned() {
75
76
  let distDir;
@@ -80,26 +81,21 @@ function assertAstroPlaceholdersPinned() {
80
81
  }
81
82
  assertPlaceholdersPinned(findAstroPlaceholders(distDir));
82
83
  }
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
- }
84
+ const SERVER_LISTS = { strings: { preserveLiterals: [...ASTRO_POST_BUILD_PLACEHOLDERS] } };
92
85
  function afterpackAstro(options = {}) {
93
86
  return {
94
87
  name: "@afterpack/astro",
95
88
  hooks: { "astro:config:setup": ({ updateConfig }) => {
96
89
  assertAstroPlaceholdersPinned();
97
90
  const clientPlugin = {
98
- ...(0, __afterpack_vite.afterpackVite)(options),
91
+ ...(0, __afterpack_vite.afterpackVite)(options, { framework: ASTRO }),
99
92
  applyToEnvironment: (environment) => environment.name === "client"
100
93
  };
101
94
  const serverPlugin = {
102
- ...(0, __afterpack_vite.afterpackVite)(serverOptionsOf(options)),
95
+ ...(0, __afterpack_vite.afterpackVite)(options, {
96
+ appendLists: SERVER_LISTS,
97
+ framework: ASTRO
98
+ }),
103
99
  applyToEnvironment: (environment) => SERVER_VITE_ENVIRONMENT_NAMES.includes(environment.name)
104
100
  };
105
101
  updateConfig({ vite: { plugins: [clientPlugin, serverPlugin] } });
package/dist/index.js CHANGED
@@ -46,6 +46,7 @@ function assertPlaceholdersPinned(found) {
46
46
 
47
47
  //#endregion
48
48
  //#region src/index.ts
49
+ const ASTRO = "astro";
49
50
  const SERVER_VITE_ENVIRONMENT_NAMES = ["ssr", "prerender"];
50
51
  function assertAstroPlaceholdersPinned() {
51
52
  let distDir;
@@ -56,26 +57,21 @@ function assertAstroPlaceholdersPinned() {
56
57
  }
57
58
  assertPlaceholdersPinned(findAstroPlaceholders(distDir));
58
59
  }
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
- }
60
+ const SERVER_LISTS = { strings: { preserveLiterals: [...ASTRO_POST_BUILD_PLACEHOLDERS] } };
68
61
  function afterpackAstro(options = {}) {
69
62
  return {
70
63
  name: "@afterpack/astro",
71
64
  hooks: { "astro:config:setup": ({ updateConfig }) => {
72
65
  assertAstroPlaceholdersPinned();
73
66
  const clientPlugin = {
74
- ...afterpackVite(options),
67
+ ...afterpackVite(options, { framework: ASTRO }),
75
68
  applyToEnvironment: (environment) => environment.name === "client"
76
69
  };
77
70
  const serverPlugin = {
78
- ...afterpackVite(serverOptionsOf(options)),
71
+ ...afterpackVite(options, {
72
+ appendLists: SERVER_LISTS,
73
+ framework: ASTRO
74
+ }),
79
75
  applyToEnvironment: (environment) => SERVER_VITE_ENVIRONMENT_NAMES.includes(environment.name)
80
76
  };
81
77
  updateConfig({ vite: { plugins: [clientPlugin, serverPlugin] } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afterpack/astro",
3
- "version": "1.0.3",
3
+ "version": "1.2.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.3",
34
- "@afterpack/vite": "1.0.3"
33
+ "@afterpack/integration-utils": "1.2.0",
34
+ "@afterpack/vite": "1.2.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@biomejs/biome": "2.4.4",