@jk2908/solas 0.8.1 → 0.8.2

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,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.8.2
4
+
5
+ ### Fixes
6
+
7
+ - The Cloudflare adapter copies `dist/sitemap.xml` to the asset root, so `/sitemap.xml` is served. It was generated at the output root but never copied into the deployed assets.
8
+
3
9
  ## 0.8.1
4
10
 
5
11
  ### Fixes
@@ -48,17 +48,18 @@ async function findAssetDirs(root, found = []) {
48
48
  * renders RSC otherwise
49
49
  * - `dist/.solas/**` (runtime manifest + ppr artifacts) at `<prefix>`, read back
50
50
  * through the `ASSETS` binding
51
+ * - `dist/sitemap.xml` at the asset root, so `/sitemap.xml` is served
51
52
  */
52
53
  async function copyOutput(cwd) {
53
54
  const outDir = path.join(cwd, Config.OUT_DIR);
54
55
  const artifactSource = path.join(outDir, Config.GENERATED_DIR);
55
56
  const staticSource = path.join(outDir, 'static');
57
+ const sitemapSource = path.join(outDir, 'sitemap.xml');
56
58
  const assetDirs = await findAssetDirs(path.join(cwd, '.cloudflare', 'output'));
57
59
  // Cloudflare compresses at the edge, so the Worker must serve uncompressed
58
- // bytes. If a `.br`/`.gz` sibling is present the assets binding hands the
59
- // Worker the precompressed body, which the edge then compresses *again*,
60
- // producing a double-encoded body (or one that does not match its
61
- // `content-encoding`). Skip the siblings so the Worker serves the original.
60
+ // bytes. Keeping a `.br`/`.gz` sibling makes the assets binding hand the
61
+ // Worker the compressed body, which the edge compresses again, producing a
62
+ // double-encoded response (or one that does not match its `content-encoding`)
62
63
  const skipPrecompressed = (source) => !/\.(br|gz)$/.test(source);
63
64
  for (const assetDir of assetDirs) {
64
65
  if (await pathExists(artifactSource)) {
@@ -75,6 +76,10 @@ async function copyOutput(cwd) {
75
76
  filter: skipPrecompressed,
76
77
  });
77
78
  }
79
+ // the sitemap is generated at the output root; serve it at the asset root
80
+ if (await pathExists(sitemapSource)) {
81
+ await fs.copyFile(sitemapSource, path.join(assetDir, 'sitemap.xml'));
82
+ }
78
83
  }
79
84
  }
80
85
  function withAdapterConfig(config) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jk2908/solas",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "A Vite + React meta-framework exploring streaming, Server Components, and partial prerendering. Designed for simplicity and lightness",
5
5
  "keywords": [
6
6
  "framework",