two-stroke 1.0.8 → 1.0.10

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/test.mjs CHANGED
@@ -4,16 +4,21 @@ import fs from "fs";
4
4
  import { cmd } from "../src/cmd.mjs";
5
5
  import consumers from "stream/consumers";
6
6
  import openapiTS from "openapi-typescript";
7
+ import { Miniflare } from "miniflare";
7
8
 
8
9
  if (fs.existsSync("wrangler.toml")) {
9
10
  await cmd("wrangler deploy --dry-run --outdir=dist");
10
- const app = await import(`${process.cwd()}/dist/index.js`);
11
- const request = await app.default.fetch(
12
- { url: "http://example.com/doc", method: "GET" },
11
+ const miniflare = new Miniflare({
12
+ modules: true,
13
+ scriptPath: "dist/index.js",
14
+ });
15
+ const request = await fetch(
16
+ `${await miniflare.ready}doc`,
13
17
  { SENTRY_DSN: null, SENTRY_ENVIRONMENT: null },
14
18
  null,
15
19
  );
16
20
  const types = await openapiTS(await consumers.json(request.body));
21
+ await miniflare.dispose();
17
22
  fs.writeFileSync("test/api.d.ts", types);
18
23
  }
19
24
  await cmd("vitest --globals --no-file-parallelism", [
package/package.json CHANGED
@@ -19,7 +19,7 @@
19
19
  "eslint-config-two-stroke": "^1.0.0",
20
20
  "eslint-config-typescript": "^3.0.0",
21
21
  "jose": "^5.2.3",
22
- "jwk-subtle": "^1.0.6",
22
+ "jwk-subtle": "^1.0.7",
23
23
  "miniflare": "^3.20240223.1",
24
24
  "openapi-fetch": "^0.9.3",
25
25
  "openapi-typescript": "^6.7.4",
@@ -51,7 +51,7 @@
51
51
  "name": "two-stroke",
52
52
  "packageManager": "yarn@4.1.0",
53
53
  "type": "module",
54
- "version": "1.0.8",
54
+ "version": "1.0.10",
55
55
  "devDependencies": {
56
56
  "@types/eslint": "^8.56.5",
57
57
  "@types/node": "^20.11.25",
package/src/types.ts CHANGED
@@ -1,7 +1,14 @@
1
1
  import { Toucan } from "toucan-js";
2
2
  import { ZodObject, ZodSchema, z } from "zod";
3
3
  export type Env = {
4
- [k: string]: string | Queue | KVNamespace | R2Bucket | D1Database | Fetcher | Hyperdrive;
4
+ [k: string]:
5
+ | string
6
+ | Queue
7
+ | KVNamespace
8
+ | R2Bucket
9
+ | D1Database
10
+ | Fetcher
11
+ | Hyperdrive;
5
12
  };
6
13
  export type Route<T extends Env, A> =
7
14
  | {