@ollie-shop/cli 1.0.1 → 1.0.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/.turbo/turbo-build.log +3 -3
- package/CHANGELOG.md +6 -0
- package/dist/index.js +5 -1
- package/package.json +1 -1
- package/src/utils/esbuild.ts +5 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @ollie-shop/cli@1.0.
|
|
2
|
+
> @ollie-shop/cli@1.0.2 build /home/runner/work/ollie-shop/ollie-shop/packages/cli
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.tsx
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
[34mCLI[39m Target: node22
|
|
10
10
|
[34mCLI[39m Cleaning output folder
|
|
11
11
|
[34mESM[39m Build start
|
|
12
|
-
[32mESM[39m [1mdist/index.js [22m[32m37.
|
|
13
|
-
[32mESM[39m ⚡️ Build success in
|
|
12
|
+
[32mESM[39m [1mdist/index.js [22m[32m37.48 KB[39m
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 166ms
|
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -603,6 +603,7 @@ async function startDevServer(ctx, options = {}) {
|
|
|
603
603
|
const componentName = pathMatch[1];
|
|
604
604
|
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
605
605
|
res.setHeader("Access-Control-Allow-Methods", "GET, OPTIONS");
|
|
606
|
+
res.setHeader("Access-Control-Allow-Private-Network", "true");
|
|
606
607
|
try {
|
|
607
608
|
const stream = await createComponentBundle({ cwd, componentName });
|
|
608
609
|
res.setHeader("Content-Type", "application/zip");
|
|
@@ -642,6 +643,7 @@ async function startDevServer(ctx, options = {}) {
|
|
|
642
643
|
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
643
644
|
res.setHeader("Access-Control-Allow-Methods", "POST, OPTIONS");
|
|
644
645
|
res.setHeader("Access-Control-Allow-Headers", "Content-Type");
|
|
646
|
+
res.setHeader("Access-Control-Allow-Private-Network", "true");
|
|
645
647
|
let body = "";
|
|
646
648
|
req.on("data", (chunk) => {
|
|
647
649
|
body += chunk.toString();
|
|
@@ -680,6 +682,7 @@ async function startDevServer(ctx, options = {}) {
|
|
|
680
682
|
if (req.method === "OPTIONS") {
|
|
681
683
|
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
682
684
|
res.setHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
|
|
685
|
+
res.setHeader("Access-Control-Allow-Private-Network", "true");
|
|
683
686
|
const requestedHeaders = req.headers["access-control-request-headers"];
|
|
684
687
|
res.setHeader(
|
|
685
688
|
"Access-Control-Allow-Headers",
|
|
@@ -700,7 +703,8 @@ async function startDevServer(ctx, options = {}) {
|
|
|
700
703
|
(proxyRes) => {
|
|
701
704
|
const responseHeaders = {
|
|
702
705
|
...proxyRes.headers,
|
|
703
|
-
"access-control-allow-origin": "*"
|
|
706
|
+
"access-control-allow-origin": "*",
|
|
707
|
+
"access-control-allow-private-network": "true"
|
|
704
708
|
};
|
|
705
709
|
res.writeHead(proxyRes.statusCode || 200, responseHeaders);
|
|
706
710
|
proxyRes.pipe(res);
|
package/package.json
CHANGED
package/src/utils/esbuild.ts
CHANGED
|
@@ -280,6 +280,7 @@ export async function startDevServer(
|
|
|
280
280
|
// Set CORS headers
|
|
281
281
|
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
282
282
|
res.setHeader("Access-Control-Allow-Methods", "GET, OPTIONS");
|
|
283
|
+
res.setHeader("Access-Control-Allow-Private-Network", "true");
|
|
283
284
|
|
|
284
285
|
try {
|
|
285
286
|
const stream = await createComponentBundle({ cwd, componentName });
|
|
@@ -328,6 +329,7 @@ export async function startDevServer(
|
|
|
328
329
|
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
329
330
|
res.setHeader("Access-Control-Allow-Methods", "POST, OPTIONS");
|
|
330
331
|
res.setHeader("Access-Control-Allow-Headers", "Content-Type");
|
|
332
|
+
res.setHeader("Access-Control-Allow-Private-Network", "true");
|
|
331
333
|
|
|
332
334
|
// Read request body
|
|
333
335
|
let body = "";
|
|
@@ -380,6 +382,8 @@ export async function startDevServer(
|
|
|
380
382
|
if (req.method === "OPTIONS") {
|
|
381
383
|
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
382
384
|
res.setHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
|
|
385
|
+
// Allow Private Network Access (public origin → localhost)
|
|
386
|
+
res.setHeader("Access-Control-Allow-Private-Network", "true");
|
|
383
387
|
// Reflect requested headers back (supports traceparent, tracestate, etc.)
|
|
384
388
|
const requestedHeaders = req.headers["access-control-request-headers"];
|
|
385
389
|
res.setHeader(
|
|
@@ -405,6 +409,7 @@ export async function startDevServer(
|
|
|
405
409
|
const responseHeaders = {
|
|
406
410
|
...proxyRes.headers,
|
|
407
411
|
"access-control-allow-origin": "*",
|
|
412
|
+
"access-control-allow-private-network": "true",
|
|
408
413
|
};
|
|
409
414
|
|
|
410
415
|
res.writeHead(proxyRes.statusCode || 200, responseHeaders);
|