two-stroke 1.0.33 → 1.0.35
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 +2 -2
- package/package.json +1 -1
- package/src/index.ts +19 -7
package/bin/deploy.mjs
CHANGED
|
@@ -9,14 +9,14 @@ const release = process.argv[3];
|
|
|
9
9
|
|
|
10
10
|
fs.writeFileSync("src/release.ts", `export default "${release}";`);
|
|
11
11
|
|
|
12
|
-
cmd(`wrangler secret
|
|
12
|
+
cmd(`wrangler secret bulk /dev/stdin --env ${env}`);
|
|
13
13
|
|
|
14
14
|
cmd(
|
|
15
15
|
`sentry-cli releases --org change-engine --project ${basename(process.cwd())} new ${release} --finalize`,
|
|
16
16
|
);
|
|
17
17
|
|
|
18
18
|
cmd(
|
|
19
|
-
`sentry-cli releases --org change-engine --project ${basename(process.cwd())} set-commits ${release}`,
|
|
19
|
+
`sentry-cli releases --org change-engine --project ${basename(process.cwd())} set-commits ${release} --ignore-missing`,
|
|
20
20
|
);
|
|
21
21
|
|
|
22
22
|
cmd(`wrangler deploy --env ${env} --outdir dist`);
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -147,18 +147,30 @@ export function twoStroke<T extends Env>(title: string, release: string) {
|
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
response.headers
|
|
150
|
+
const responseWithHeaders: Omit<typeof response, "headers"> & {
|
|
151
|
+
headers: Headers;
|
|
152
|
+
} = {
|
|
153
|
+
...response,
|
|
154
|
+
headers: new Headers(response.headers ?? {}),
|
|
155
|
+
};
|
|
156
|
+
if (!responseWithHeaders.headers.has("Content-Type"))
|
|
157
|
+
responseWithHeaders.headers.set(
|
|
158
|
+
"Content-Type",
|
|
159
|
+
"application/json",
|
|
160
|
+
);
|
|
161
|
+
if (!responseWithHeaders.headers.has("Access-Control-Allow-Origin"))
|
|
162
|
+
responseWithHeaders.headers.set(
|
|
163
|
+
"Access-Control-Allow-Origin",
|
|
164
|
+
"*",
|
|
165
|
+
);
|
|
155
166
|
|
|
156
167
|
return new Response(
|
|
157
168
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
158
|
-
|
|
169
|
+
responseWithHeaders.headers.get("Content-Type") ===
|
|
170
|
+
"application/json"
|
|
159
171
|
? JSON.stringify(response.body)
|
|
160
172
|
: response.body,
|
|
161
|
-
|
|
173
|
+
responseWithHeaders,
|
|
162
174
|
);
|
|
163
175
|
}
|
|
164
176
|
}
|