two-stroke 1.0.31 → 1.0.33
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/bin/deploy.mjs +13 -0
- package/package.json +1 -1
- package/src/index.ts +7 -6
package/bin/deploy.mjs
CHANGED
|
@@ -10,4 +10,17 @@ const release = process.argv[3];
|
|
|
10
10
|
fs.writeFileSync("src/release.ts", `export default "${release}";`);
|
|
11
11
|
|
|
12
12
|
cmd(`wrangler secret:bulk /dev/stdin --env ${env}`);
|
|
13
|
+
|
|
14
|
+
cmd(
|
|
15
|
+
`sentry-cli releases --org change-engine --project ${basename(process.cwd())} new ${release} --finalize`,
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
cmd(
|
|
19
|
+
`sentry-cli releases --org change-engine --project ${basename(process.cwd())} set-commits ${release}`,
|
|
20
|
+
);
|
|
21
|
+
|
|
13
22
|
cmd(`wrangler deploy --env ${env} --outdir dist`);
|
|
23
|
+
|
|
24
|
+
cmd(
|
|
25
|
+
`sentry-cli sourcemaps --org change-engine --project ${basename(process.cwd())} upload --release="${release}" dist`,
|
|
26
|
+
);
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -147,14 +147,15 @@ export function twoStroke<T extends Env>(title: string, release: string) {
|
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
|
|
151
|
-
if (!headers.has("Content-Type"))
|
|
152
|
-
headers.set("Content-Type", "application/json");
|
|
153
|
-
if (!headers.has("Access-Control-Allow-Origin"))
|
|
154
|
-
headers.set("Access-Control-Allow-Origin", "*");
|
|
150
|
+
response.headers = new Headers(response.headers ?? {});
|
|
151
|
+
if (!response.headers.has("Content-Type"))
|
|
152
|
+
response.headers.set("Content-Type", "application/json");
|
|
153
|
+
if (!response.headers.has("Access-Control-Allow-Origin"))
|
|
154
|
+
response.headers.set("Access-Control-Allow-Origin", "*");
|
|
155
|
+
|
|
155
156
|
return new Response(
|
|
156
157
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
157
|
-
headers.get("Content-Type") === "application/json"
|
|
158
|
+
response.headers.get("Content-Type") === "application/json"
|
|
158
159
|
? JSON.stringify(response.body)
|
|
159
160
|
: response.body,
|
|
160
161
|
response,
|