@shopify/cli 3.83.1 → 3.83.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/dist/assets/hydrogen/starter/.cursor/rules/hydrogen-react-router.mdc +52 -0
- package/dist/assets/hydrogen/starter/CHANGELOG.md +35 -0
- package/dist/assets/hydrogen/starter/app/components/AddToCartButton.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/components/CartLineItem.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/components/CartMain.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/components/CartSummary.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/components/Footer.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/components/Header.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/components/PageLayout.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/components/ProductForm.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/components/ProductItem.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/components/SearchForm.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/components/SearchFormPredictive.tsx +1 -6
- package/dist/assets/hydrogen/starter/app/components/SearchResults.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/components/SearchResultsPredictive.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/entry.client.tsx +2 -2
- package/dist/assets/hydrogen/starter/app/entry.server.tsx +9 -4
- package/dist/assets/hydrogen/starter/app/lib/variants.ts +1 -1
- package/dist/assets/hydrogen/starter/app/root.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/routes/_index.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/routes/account.addresses.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/routes/account.orders.$id.tsx +4 -4
- package/dist/assets/hydrogen/starter/app/routes/account.orders._index.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/routes/account.profile.tsx +1 -7
- package/dist/assets/hydrogen/starter/app/routes/account.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/routes/api.$version.[graphql.json].tsx +14 -0
- package/dist/assets/hydrogen/starter/app/routes/blogs.$blogHandle.$articleHandle.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/routes/blogs.$blogHandle._index.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/routes/blogs._index.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/routes/cart.tsx +7 -2
- package/dist/assets/hydrogen/starter/app/routes/collections.$handle.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/routes/collections._index.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/routes/collections.all.tsx +2 -2
- package/dist/assets/hydrogen/starter/app/routes/pages.$handle.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/routes/policies.$handle.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/routes/policies._index.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/routes/products.$handle.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/routes/search.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/routes.ts +2 -2
- package/dist/assets/hydrogen/starter/env.d.ts +12 -2
- package/dist/assets/hydrogen/starter/eslint.config.js +2 -0
- package/dist/assets/hydrogen/starter/package.json +11 -12
- package/dist/assets/hydrogen/starter/react-router.config.ts +7 -0
- package/dist/assets/hydrogen/starter/server.ts +2 -5
- package/dist/assets/hydrogen/starter/tsconfig.json +18 -6
- package/dist/assets/hydrogen/starter/vite.config.ts +3 -24
- package/dist/assets/hydrogen/tailwind/package.json +4 -1
- package/dist/assets/hydrogen/virtual-routes/components/RequestDetails.jsx +1 -1
- package/dist/assets/hydrogen/virtual-routes/layout.jsx +1 -7
- package/dist/assets/hydrogen/virtual-routes/routes/index.jsx +1 -1
- package/dist/assets/hydrogen/virtual-routes/routes/subrequest-profiler.jsx +1 -1
- package/dist/assets/hydrogen/virtual-routes/virtual-root-with-layout.jsx +1 -1
- package/dist/assets/hydrogen/virtual-routes/virtual-root.jsx +1 -1
- package/dist/assets/hydrogen/vite/vite.config.js +1 -1
- package/dist/{chunk-XOIMWH77.js → chunk-3P2MV54Z.js} +2 -2
- package/dist/{chunk-DVGCJLCA.js → chunk-3TBLURBG.js} +6 -6
- package/dist/{chunk-SJYNVNUB.js → chunk-3ZHC3Q7V.js} +2 -2
- package/dist/{chunk-7KLV4YSY.js → chunk-4ALAOHE7.js} +2 -2
- package/dist/{chunk-KPFBSWRK.js → chunk-4NC2NVYY.js} +3 -3
- package/dist/{chunk-QNMWKLS4.js → chunk-5YPOHZXF.js} +3 -3
- package/dist/{chunk-ARXCCKJT.js → chunk-AGY4NR7U.js} +8 -8
- package/dist/{chunk-JEW6HZHJ.js → chunk-BELVFLJN.js} +3 -3
- package/dist/{chunk-UZIJLLPI.js → chunk-BRKBA6ON.js} +3 -3
- package/dist/{chunk-4BPSIIGV.js → chunk-CK7Y3RFI.js} +3 -3
- package/dist/{chunk-A6DFWCO7.js → chunk-CPTZ34K2.js} +4 -4
- package/dist/{chunk-Y2JP6WFP.js → chunk-EG6MBBEN.js} +2 -2
- package/dist/{chunk-TB443RFG.js → chunk-FRQN52H3.js} +5 -5
- package/dist/{chunk-ZQMRVJXG.js → chunk-HU2Q5MFA.js} +3 -3
- package/dist/{chunk-KSLA767C.js → chunk-IZFYF7OE.js} +2 -2
- package/dist/{chunk-5QFLNCVR.js → chunk-JLITATNF.js} +6 -6
- package/dist/{chunk-BZFP2O66.js → chunk-KDFL67TE.js} +4 -4
- package/dist/{chunk-7EV36FNO.js → chunk-M3TVLW4G.js} +307 -475
- package/dist/{chunk-FNYLJESL.js → chunk-NHZFKFIN.js} +4 -4
- package/dist/{chunk-XI6AXLZO.js → chunk-ORFUSS73.js} +4 -4
- package/dist/{chunk-K5GF4S7D.js → chunk-P464L3K6.js} +2 -2
- package/dist/{chunk-5BJYF6FG.js → chunk-PCHFJ5CE.js} +3 -3
- package/dist/{chunk-RDAZS4FZ.js → chunk-Q3BLA5JC.js} +7 -7
- package/dist/{chunk-DFABOPSU.js → chunk-Q76H7OUL.js} +4 -4
- package/dist/{chunk-TLYRIQK7.js → chunk-QJQK26XP.js} +6 -6
- package/dist/{chunk-DDU22ZPL.js → chunk-RAC2243I.js} +3 -3
- package/dist/{chunk-NJN55E4K.js → chunk-RFX7HBFN.js} +4 -4
- package/dist/{chunk-PPDGMVCL.js → chunk-RHR64CQH.js} +4 -4
- package/dist/{chunk-XVZQHSFP.js → chunk-U6MH2KVY.js} +5 -5
- package/dist/{chunk-ASWHWSRF.js → chunk-UFC6XUMW.js} +2 -2
- package/dist/{chunk-BZBO3V3A.js → chunk-UIFPKYNE.js} +3 -3
- package/dist/{chunk-2ZA3MHM5.js → chunk-V6ZYMBVB.js} +3 -3
- package/dist/{chunk-FEMALH67.js → chunk-YF7CDH6L.js} +4 -4
- package/dist/{chunk-SUA462JY.js → chunk-YKYM3NLB.js} +5 -5
- package/dist/{chunk-57SXE5DE.js → chunk-Z2AIGIVT.js} +2 -2
- package/dist/cli/commands/auth/logout.js +12 -12
- package/dist/cli/commands/auth/logout.test.js +13 -13
- package/dist/cli/commands/cache/clear.js +11 -11
- package/dist/cli/commands/debug/command-flags.js +11 -11
- package/dist/cli/commands/docs/generate.js +11 -11
- package/dist/cli/commands/docs/generate.test.js +11 -11
- package/dist/cli/commands/help.js +11 -11
- package/dist/cli/commands/kitchen-sink/async.js +12 -12
- package/dist/cli/commands/kitchen-sink/async.test.js +12 -12
- package/dist/cli/commands/kitchen-sink/index.js +14 -14
- package/dist/cli/commands/kitchen-sink/index.test.js +14 -14
- package/dist/cli/commands/kitchen-sink/prompts.js +12 -12
- package/dist/cli/commands/kitchen-sink/prompts.test.js +12 -12
- package/dist/cli/commands/kitchen-sink/static.js +12 -12
- package/dist/cli/commands/kitchen-sink/static.test.js +12 -12
- package/dist/cli/commands/notifications/generate.js +12 -12
- package/dist/cli/commands/notifications/list.js +12 -12
- package/dist/cli/commands/search.js +12 -12
- package/dist/cli/commands/upgrade.js +12 -12
- package/dist/cli/commands/version.js +12 -12
- package/dist/cli/commands/version.test.js +12 -12
- package/dist/cli/services/commands/notifications.js +7 -7
- package/dist/cli/services/commands/search.js +3 -3
- package/dist/cli/services/commands/search.test.js +3 -3
- package/dist/cli/services/commands/version.js +4 -4
- package/dist/cli/services/commands/version.test.js +5 -5
- package/dist/cli/services/kitchen-sink/async.js +3 -3
- package/dist/cli/services/kitchen-sink/prompts.js +3 -3
- package/dist/cli/services/kitchen-sink/static.js +3 -3
- package/dist/cli/services/upgrade.js +4 -4
- package/dist/cli/services/upgrade.test.js +5 -5
- package/dist/{custom-oclif-loader-XASCYJ7O.js → custom-oclif-loader-QWOQ6IU2.js} +3 -3
- package/dist/{error-handler-HQBVO3GI.js → error-handler-WBLMZ6OH.js} +9 -9
- package/dist/hooks/postrun.js +7 -7
- package/dist/hooks/prerun.js +8 -8
- package/dist/index.js +817 -1144
- package/dist/{local-PI2REOYY.js → local-EXWDAQEX.js} +3 -3
- package/dist/{morph-5LWJDWYB.js → morph-R37HEQ7R.js} +9 -9
- package/dist/{node-package-manager-RVDETLBX.js → node-package-manager-FY6IDVTF.js} +4 -4
- package/dist/{path-COZT77T2.js → path-GB4VIEM6.js} +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{ui-RDFVKEJS.js → ui-GHYCWXGS.js} +3 -3
- package/dist/{workerd-XLT4ZWI5.js → workerd-GLBI5GFX.js} +14 -14
- package/oclif.manifest.json +3 -23
- package/package.json +8 -8
- package/dist/assets/hydrogen/starter/.cursor/rules/cookbook-recipe-subscriptions.mdc +0 -921
- package/dist/chunk-V67D4V7T.js +0 -107
- package/dist/node-NAYZANSZ.js +0 -162
package/dist/chunk-V67D4V7T.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
init_cjs_shims
|
|
3
|
-
} from "./chunk-PKR7KJ6P.js";
|
|
4
|
-
|
|
5
|
-
// ../../node_modules/.pnpm/@shopify+cli-hydrogen@10.0.1_@graphql-codegen+cli@5.0.4_@parcel+watcher@2.5.1_@types+no_700217a4222a08650099cd57a51aa579/node_modules/@shopify/cli-hydrogen/dist/lib/find-port.js
|
|
6
|
-
init_cjs_shims();
|
|
7
|
-
|
|
8
|
-
// ../../node_modules/.pnpm/get-port@7.1.0/node_modules/get-port/index.js
|
|
9
|
-
init_cjs_shims();
|
|
10
|
-
import net from "node:net";
|
|
11
|
-
import os from "node:os";
|
|
12
|
-
var Locked = class extends Error {
|
|
13
|
-
constructor(port) {
|
|
14
|
-
super(`${port} is locked`);
|
|
15
|
-
}
|
|
16
|
-
}, lockedPorts = {
|
|
17
|
-
old: /* @__PURE__ */ new Set(),
|
|
18
|
-
young: /* @__PURE__ */ new Set()
|
|
19
|
-
}, releaseOldLockedPortsIntervalMs = 1e3 * 15, minPort = 1024, maxPort = 65535, timeout, getLocalHosts = () => {
|
|
20
|
-
let interfaces = os.networkInterfaces(), results = /* @__PURE__ */ new Set([void 0, "0.0.0.0"]);
|
|
21
|
-
for (let _interface of Object.values(interfaces))
|
|
22
|
-
for (let config of _interface)
|
|
23
|
-
results.add(config.address);
|
|
24
|
-
return results;
|
|
25
|
-
}, checkAvailablePort = (options) => new Promise((resolve, reject) => {
|
|
26
|
-
let server = net.createServer();
|
|
27
|
-
server.unref(), server.on("error", reject), server.listen(options, () => {
|
|
28
|
-
let { port } = server.address();
|
|
29
|
-
server.close(() => {
|
|
30
|
-
resolve(port);
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
}), getAvailablePort = async (options, hosts) => {
|
|
34
|
-
if (options.host || options.port === 0)
|
|
35
|
-
return checkAvailablePort(options);
|
|
36
|
-
for (let host of hosts)
|
|
37
|
-
try {
|
|
38
|
-
await checkAvailablePort({ port: options.port, host });
|
|
39
|
-
} catch (error) {
|
|
40
|
-
if (!["EADDRNOTAVAIL", "EINVAL"].includes(error.code))
|
|
41
|
-
throw error;
|
|
42
|
-
}
|
|
43
|
-
return options.port;
|
|
44
|
-
}, portCheckSequence = function* (ports) {
|
|
45
|
-
ports && (yield* ports), yield 0;
|
|
46
|
-
};
|
|
47
|
-
async function getPorts(options) {
|
|
48
|
-
let ports, exclude = /* @__PURE__ */ new Set();
|
|
49
|
-
if (options && (options.port && (ports = typeof options.port == "number" ? [options.port] : options.port), options.exclude)) {
|
|
50
|
-
let excludeIterable = options.exclude;
|
|
51
|
-
if (typeof excludeIterable[Symbol.iterator] != "function")
|
|
52
|
-
throw new TypeError("The `exclude` option must be an iterable.");
|
|
53
|
-
for (let element of excludeIterable) {
|
|
54
|
-
if (typeof element != "number")
|
|
55
|
-
throw new TypeError("Each item in the `exclude` option must be a number corresponding to the port you want excluded.");
|
|
56
|
-
if (!Number.isSafeInteger(element))
|
|
57
|
-
throw new TypeError(`Number ${element} in the exclude option is not a safe integer and can't be used`);
|
|
58
|
-
}
|
|
59
|
-
exclude = new Set(excludeIterable);
|
|
60
|
-
}
|
|
61
|
-
timeout === void 0 && (timeout = setTimeout(() => {
|
|
62
|
-
timeout = void 0, lockedPorts.old = lockedPorts.young, lockedPorts.young = /* @__PURE__ */ new Set();
|
|
63
|
-
}, releaseOldLockedPortsIntervalMs), timeout.unref && timeout.unref());
|
|
64
|
-
let hosts = getLocalHosts();
|
|
65
|
-
for (let port of portCheckSequence(ports))
|
|
66
|
-
try {
|
|
67
|
-
if (exclude.has(port))
|
|
68
|
-
continue;
|
|
69
|
-
let availablePort = await getAvailablePort({ ...options, port }, hosts);
|
|
70
|
-
for (; lockedPorts.old.has(availablePort) || lockedPorts.young.has(availablePort); ) {
|
|
71
|
-
if (port !== 0)
|
|
72
|
-
throw new Locked(port);
|
|
73
|
-
availablePort = await getAvailablePort({ ...options, port }, hosts);
|
|
74
|
-
}
|
|
75
|
-
return lockedPorts.young.add(availablePort), availablePort;
|
|
76
|
-
} catch (error) {
|
|
77
|
-
if (!["EADDRINUSE", "EACCES"].includes(error.code) && !(error instanceof Locked))
|
|
78
|
-
throw error;
|
|
79
|
-
}
|
|
80
|
-
throw new Error("No available ports found");
|
|
81
|
-
}
|
|
82
|
-
function portNumbers(from, to) {
|
|
83
|
-
if (!Number.isInteger(from) || !Number.isInteger(to))
|
|
84
|
-
throw new TypeError("`from` and `to` must be integer numbers");
|
|
85
|
-
if (from < minPort || from > maxPort)
|
|
86
|
-
throw new RangeError(`'from' must be between ${minPort} and ${maxPort}`);
|
|
87
|
-
if (to < minPort || to > maxPort)
|
|
88
|
-
throw new RangeError(`'to' must be between ${minPort} and ${maxPort}`);
|
|
89
|
-
if (from > to)
|
|
90
|
-
throw new RangeError("`to` must be greater than or equal to `from`");
|
|
91
|
-
return function* (from2, to2) {
|
|
92
|
-
for (let port = from2; port <= to2; port++)
|
|
93
|
-
yield port;
|
|
94
|
-
}(from, to);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// ../../node_modules/.pnpm/@shopify+cli-hydrogen@10.0.1_@graphql-codegen+cli@5.0.4_@parcel+watcher@2.5.1_@types+no_700217a4222a08650099cd57a51aa579/node_modules/@shopify/cli-hydrogen/dist/lib/find-port.js
|
|
98
|
-
function findPort(portPreference, range = 100) {
|
|
99
|
-
return getPorts({
|
|
100
|
-
port: portNumbers(portPreference, portPreference + range)
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export {
|
|
105
|
-
findPort
|
|
106
|
-
};
|
|
107
|
-
//# sourceMappingURL=chunk-V67D4V7T.js.map
|
package/dist/node-NAYZANSZ.js
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
findPort
|
|
3
|
-
} from "./chunk-V67D4V7T.js";
|
|
4
|
-
import {
|
|
5
|
-
DEFAULT_INSPECTOR_PORT,
|
|
6
|
-
H2O_BINDING_NAME,
|
|
7
|
-
SUBREQUEST_PROFILER_ENDPOINT,
|
|
8
|
-
createLogRequestEvent,
|
|
9
|
-
getUtilityBannerlines,
|
|
10
|
-
handleDebugNetworkRequest,
|
|
11
|
-
handleMiniOxygenImportFail,
|
|
12
|
-
importLocal,
|
|
13
|
-
logRequestLine,
|
|
14
|
-
setConstructors
|
|
15
|
-
} from "./chunk-7EV36FNO.js";
|
|
16
|
-
import "./chunk-CP3BRHWK.js";
|
|
17
|
-
import "./chunk-FEMALH67.js";
|
|
18
|
-
import "./chunk-DVGCJLCA.js";
|
|
19
|
-
import "./chunk-ARXCCKJT.js";
|
|
20
|
-
import "./chunk-SHWOPMLQ.js";
|
|
21
|
-
import "./chunk-TLYRIQK7.js";
|
|
22
|
-
import "./chunk-TB443RFG.js";
|
|
23
|
-
import "./chunk-5QFLNCVR.js";
|
|
24
|
-
import "./chunk-DFABOPSU.js";
|
|
25
|
-
import "./chunk-25IMI7TH.js";
|
|
26
|
-
import "./chunk-57SXE5DE.js";
|
|
27
|
-
import "./chunk-BZFP2O66.js";
|
|
28
|
-
import {
|
|
29
|
-
AbortError,
|
|
30
|
-
outputNewline,
|
|
31
|
-
readFile,
|
|
32
|
-
renderSuccess,
|
|
33
|
-
source_default
|
|
34
|
-
} from "./chunk-KPFBSWRK.js";
|
|
35
|
-
import "./chunk-75LV6AQS.js";
|
|
36
|
-
import "./chunk-Y2JP6WFP.js";
|
|
37
|
-
import "./chunk-3FBDJEGD.js";
|
|
38
|
-
import "./chunk-UMUTXITN.js";
|
|
39
|
-
import "./chunk-HMDWNGIV.js";
|
|
40
|
-
import "./chunk-G5R6YD27.js";
|
|
41
|
-
import "./chunk-G2ZZKGSV.js";
|
|
42
|
-
import "./chunk-UV5N2VL7.js";
|
|
43
|
-
import "./chunk-XE5EOEBL.js";
|
|
44
|
-
import "./chunk-B5EXYCV3.js";
|
|
45
|
-
import {
|
|
46
|
-
init_cjs_shims
|
|
47
|
-
} from "./chunk-PKR7KJ6P.js";
|
|
48
|
-
|
|
49
|
-
// ../../node_modules/.pnpm/@shopify+cli-hydrogen@10.0.1_@graphql-codegen+cli@5.0.4_@parcel+watcher@2.5.1_@types+no_700217a4222a08650099cd57a51aa579/node_modules/@shopify/cli-hydrogen/dist/lib/mini-oxygen/node.js
|
|
50
|
-
init_cjs_shims();
|
|
51
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
52
|
-
async function startNodeServer({
|
|
53
|
-
appPort,
|
|
54
|
-
watch = !1,
|
|
55
|
-
buildPathWorkerFile,
|
|
56
|
-
buildPathClient,
|
|
57
|
-
env,
|
|
58
|
-
debug = !1,
|
|
59
|
-
inspectorPort,
|
|
60
|
-
root
|
|
61
|
-
}) {
|
|
62
|
-
let { startServer, Request, Response } = await importLocal(
|
|
63
|
-
"@shopify/mini-oxygen/node",
|
|
64
|
-
root
|
|
65
|
-
).catch(handleMiniOxygenImportFail);
|
|
66
|
-
setConstructors({ Response });
|
|
67
|
-
let logRequestEvent = createLogRequestEvent(), asyncLocalStorage = new AsyncLocalStorage(), serviceBindings = {
|
|
68
|
-
[H2O_BINDING_NAME]: {
|
|
69
|
-
fetch: async (request) => logRequestEvent(
|
|
70
|
-
new Request(request.url, {
|
|
71
|
-
method: "POST",
|
|
72
|
-
body: JSON.stringify({
|
|
73
|
-
...asyncLocalStorage.getStore(),
|
|
74
|
-
...await request.json()
|
|
75
|
-
})
|
|
76
|
-
})
|
|
77
|
-
)
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
debug && (inspectorPort || (inspectorPort = await findPort(DEFAULT_INSPECTOR_PORT)), (await import("node:inspector")).open(inspectorPort));
|
|
81
|
-
let readWorkerFile = () => readFile(buildPathWorkerFile).catch((error) => {
|
|
82
|
-
throw new AbortError(
|
|
83
|
-
`Could not read worker file.
|
|
84
|
-
|
|
85
|
-
` + error.stack,
|
|
86
|
-
"Did you build the project?"
|
|
87
|
-
);
|
|
88
|
-
}), miniOxygen = await startServer({
|
|
89
|
-
script: await readWorkerFile(),
|
|
90
|
-
workerFile: buildPathWorkerFile,
|
|
91
|
-
assetsDir: buildPathClient,
|
|
92
|
-
publicPath: "",
|
|
93
|
-
port: appPort,
|
|
94
|
-
watch,
|
|
95
|
-
autoReload: watch,
|
|
96
|
-
modules: !0,
|
|
97
|
-
env: {
|
|
98
|
-
...env,
|
|
99
|
-
...process.env,
|
|
100
|
-
...serviceBindings
|
|
101
|
-
},
|
|
102
|
-
log: () => {
|
|
103
|
-
},
|
|
104
|
-
async onRequest(request, defaultDispatcher) {
|
|
105
|
-
if (new URL(request.url).pathname === SUBREQUEST_PROFILER_ENDPOINT)
|
|
106
|
-
return handleDebugNetworkRequest(request);
|
|
107
|
-
let requestId = request.headers.get("request-id"), startTimeMs = Date.now(), response = await asyncLocalStorage.run(
|
|
108
|
-
{ requestId, purpose: request.headers.get("purpose") },
|
|
109
|
-
() => defaultDispatcher(request)
|
|
110
|
-
), endTimeMs = Date.now();
|
|
111
|
-
return logRequestLine({
|
|
112
|
-
request: {
|
|
113
|
-
url: request.url,
|
|
114
|
-
method: request.method,
|
|
115
|
-
headers: Object.fromEntries(request.headers.entries())
|
|
116
|
-
},
|
|
117
|
-
response: {
|
|
118
|
-
status: response.status,
|
|
119
|
-
statusText: response.statusText,
|
|
120
|
-
headers: Object.fromEntries(response.headers.entries())
|
|
121
|
-
},
|
|
122
|
-
meta: {
|
|
123
|
-
startTimeMs,
|
|
124
|
-
endTimeMs,
|
|
125
|
-
durationMs: startTimeMs > 0 ? endTimeMs - startTimeMs : 0
|
|
126
|
-
}
|
|
127
|
-
}), response;
|
|
128
|
-
}
|
|
129
|
-
}), listeningAt = `http://localhost:${miniOxygen.port}`;
|
|
130
|
-
return {
|
|
131
|
-
listeningAt,
|
|
132
|
-
port: miniOxygen.port,
|
|
133
|
-
async reload(options) {
|
|
134
|
-
let nextOptions = {};
|
|
135
|
-
options?.env && (nextOptions.env = {
|
|
136
|
-
...options.env,
|
|
137
|
-
...process.env
|
|
138
|
-
}), nextOptions.script = await readWorkerFile(), await miniOxygen.reload(nextOptions);
|
|
139
|
-
},
|
|
140
|
-
showBanner(options) {
|
|
141
|
-
outputNewline();
|
|
142
|
-
let customSections = [];
|
|
143
|
-
options?.host && customSections.push({ body: getUtilityBannerlines(options.host) }), debug && inspectorPort && customSections.push({
|
|
144
|
-
body: { warn: `Debugger listening on ws://localhost:${inspectorPort}` }
|
|
145
|
-
}), renderSuccess({
|
|
146
|
-
headline: `${options?.headlinePrefix ?? ""}MiniOxygen (Node Sandbox) ${options?.mode ?? "development"} server running.`,
|
|
147
|
-
body: [
|
|
148
|
-
`View ${options?.appName ? source_default.cyan(options?.appName) : "Hydrogen"} app:`,
|
|
149
|
-
{ link: { url: options?.host || listeningAt } }
|
|
150
|
-
],
|
|
151
|
-
customSections
|
|
152
|
-
}), console.log("");
|
|
153
|
-
},
|
|
154
|
-
async close() {
|
|
155
|
-
await miniOxygen.close();
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
export {
|
|
160
|
-
startNodeServer
|
|
161
|
-
};
|
|
162
|
-
//# sourceMappingURL=node-NAYZANSZ.js.map
|