@jk2908/solas 0.8.0 → 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 +12 -0
- package/dist/adapters/cloudflare/vite.js +13 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
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
|
+
|
|
9
|
+
## 0.8.1
|
|
10
|
+
|
|
11
|
+
### Fixes
|
|
12
|
+
|
|
13
|
+
- The Cloudflare adapter no longer copies precompressed `.br`/`.gz` assets into the Worker's asset output. The assets binding served the Worker the compressed body, which Cloudflare then compressed again at the edge, so a hard load of a prerendered route rendered as garbled binary (a double-encoded or header-mismatched response). The Worker now serves the uncompressed asset and the edge handles encoding.
|
|
14
|
+
|
|
3
15
|
## 0.8.0
|
|
4
16
|
|
|
5
17
|
### Features
|
|
@@ -48,25 +48,38 @@ 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'));
|
|
59
|
+
// Cloudflare compresses at the edge, so the Worker must serve uncompressed
|
|
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`)
|
|
63
|
+
const skipPrecompressed = (source) => !/\.(br|gz)$/.test(source);
|
|
57
64
|
for (const assetDir of assetDirs) {
|
|
58
65
|
if (await pathExists(artifactSource)) {
|
|
59
66
|
await fs.cp(artifactSource, path.join(assetDir, NAMESPACE_PREFIX.artifact), {
|
|
60
67
|
recursive: true,
|
|
61
68
|
force: true,
|
|
69
|
+
filter: skipPrecompressed,
|
|
62
70
|
});
|
|
63
71
|
}
|
|
64
72
|
if (await pathExists(staticSource)) {
|
|
65
73
|
await fs.cp(staticSource, path.join(assetDir, NAMESPACE_PREFIX.static), {
|
|
66
74
|
recursive: true,
|
|
67
75
|
force: true,
|
|
76
|
+
filter: skipPrecompressed,
|
|
68
77
|
});
|
|
69
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
|
+
}
|
|
70
83
|
}
|
|
71
84
|
}
|
|
72
85
|
function withAdapterConfig(config) {
|
package/package.json
CHANGED