two-stroke 1.0.34 → 1.1.0

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 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:bulk /dev/stdin --env ${env}`);
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/bin/format.mjs CHANGED
@@ -2,4 +2,5 @@
2
2
  "use strict";
3
3
  import { cmd } from "../src/cmd.mjs";
4
4
 
5
- cmd("prettier --write . !tsconfig.json !test/api.d.ts");
5
+ cmd("eslint --fix");
6
+ cmd("prettier --write .");
package/bin/lint.mjs CHANGED
@@ -2,5 +2,5 @@
2
2
  "use strict";
3
3
  import { cmd } from "../src/cmd.mjs";
4
4
 
5
- cmd("eslint --max-warnings=0 src");
6
- cmd("prettier --check . !tsconfig.json !test/api.d.ts");
5
+ cmd("eslint --max-warnings=0");
6
+ cmd("prettier --check .");
package/bin/test.mjs CHANGED
@@ -4,6 +4,8 @@ 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 prettier from "prettier";
8
+ import ts from "typescript";
7
9
  import { Miniflare } from "miniflare";
8
10
 
9
11
  if (fs.existsSync("wrangler.toml")) {
@@ -13,13 +15,28 @@ if (fs.existsSync("wrangler.toml")) {
13
15
  scriptPath: "dist/index.js",
14
16
  });
15
17
  const request = await fetch(
18
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
16
19
  `${await miniflare.ready}doc`,
17
20
  { SENTRY_DSN: null, SENTRY_ENVIRONMENT: null },
18
21
  null,
19
22
  );
20
23
  const types = await openapiTS(await consumers.json(request.body));
21
24
  await miniflare.dispose();
22
- fs.writeFileSync("test/api.d.ts", types);
25
+ const printer = ts.createPrinter({});
26
+ const resultFile = ts.createSourceFile(
27
+ "test/api.d.ts",
28
+ "",
29
+ ts.ScriptTarget.Latest,
30
+ );
31
+ const result = printer.printNode(
32
+ ts.EmitHint.Unspecified,
33
+ types[0],
34
+ resultFile,
35
+ );
36
+ fs.writeFileSync(
37
+ "test/api.d.ts",
38
+ await prettier.format(result, { parser: "typescript" }),
39
+ );
23
40
  }
24
41
  cmd("vitest --globals --no-file-parallelism --pool threads", [
25
42
  ...(!process.argv.slice(2).includes("-w") &&
@@ -0,0 +1,3 @@
1
+ import config from "eslint-config-two-stroke";
2
+
3
+ export default config;
package/package.json CHANGED
@@ -8,21 +8,21 @@
8
8
  "type-check": "./bin/type-check.mjs"
9
9
  },
10
10
  "dependencies": {
11
- "@anatine/zod-openapi": "^2.2.5",
11
+ "@anatine/zod-openapi": "^2.2.6",
12
12
  "@asteasolutions/zod-to-openapi": "^7.1.1",
13
- "@cloudflare/workers-types": "^4.20240620.0",
14
- "@sentry/cli": "^2.32.1",
15
- "@typescript-eslint/eslint-plugin": "^7.16.0",
16
- "@typescript-eslint/parser": "^7.16.0",
17
- "@vitest/coverage-v8": "^2.0.1",
13
+ "@cloudflare/workers-types": "^4.20240806.0",
14
+ "@sentry/cli": "^2.33.1",
15
+ "@typescript-eslint/eslint-plugin": "^8.0.1",
16
+ "@typescript-eslint/parser": "^8.0.1",
17
+ "@vitest/coverage-v8": "^2.0.5",
18
18
  "eslint-config-prettier": "^9.1.0",
19
- "eslint-config-two-stroke": "^1.0.10",
19
+ "eslint-config-two-stroke": "^1.1.1",
20
20
  "eslint-config-typescript": "^3.0.0",
21
21
  "jose": "^5.6.3",
22
22
  "jwk-subtle": "^1.0.7",
23
23
  "miniflare": "3.20240419.0",
24
- "openapi-fetch": "^0.10.0",
25
- "openapi-typescript": "^6.7.6",
24
+ "openapi-fetch": "^0.10.6",
25
+ "openapi-typescript": "^7.3.0",
26
26
  "openapi3-ts": "^4.3.3",
27
27
  "pbkdf-subtle": "^1.0.0",
28
28
  "toml": "^3.0.0",
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@sentry/cli": ">=2",
34
- "eslint": ">=8",
34
+ "eslint": ">=9",
35
35
  "prettier": ">=3",
36
36
  "typescript": ">=5",
37
37
  "vitest": ">=1",
@@ -51,13 +51,13 @@
51
51
  "name": "two-stroke",
52
52
  "packageManager": "yarn@4.3.0",
53
53
  "type": "module",
54
- "version": "1.0.34",
54
+ "version": "1.1.0",
55
55
  "devDependencies": {
56
- "@types/eslint": "^8.56.10",
57
- "@types/node": "^20.14.10",
58
- "eslint": "^8.57.0",
59
- "prettier": "^3.3.2",
60
- "typescript": "^5.5.3",
61
- "vitest": "^2.0.1"
56
+ "@types/eslint": "^9.6.0",
57
+ "@types/node": "^22.1.0",
58
+ "eslint": "^9.8.0",
59
+ "prettier": "^3.3.3",
60
+ "typescript": "^5.5.4",
61
+ "vitest": "^2.0.5"
62
62
  }
63
63
  }
package/src/index.ts CHANGED
@@ -180,7 +180,6 @@ export function twoStroke<T extends Env>(title: string, release: string) {
180
180
  });
181
181
  } catch (err) {
182
182
  console.warn(err);
183
- // eslint-disable-next-line deprecation/deprecation
184
183
  sentry.captureException(err);
185
184
  return new Response("", {
186
185
  status: 500,
@@ -327,7 +326,7 @@ export function twoStroke<T extends Env>(title: string, release: string) {
327
326
  handler,
328
327
  });
329
328
  },
330
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
329
+
331
330
  post<
332
331
  I extends ZodSchema,
333
332
  O extends ZodSchema,
@@ -356,7 +355,7 @@ export function twoStroke<T extends Env>(title: string, release: string) {
356
355
  params,
357
356
  });
358
357
  },
359
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
358
+
360
359
  get<
361
360
  O extends ZodSchema,
362
361
  A,
package/src/test.ts CHANGED
@@ -9,7 +9,7 @@ import toml from "toml";
9
9
  import { URLSearchParams } from "url";
10
10
  import { Env } from "./types";
11
11
 
12
- // eslint-disable-next-line @typescript-eslint/ban-types
12
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
13
13
  export const setupTests = async <Paths extends {}>(bindings: Env) => {
14
14
  const fetchMock = createFetchMock();
15
15
  fetchMock.disableNetConnect();
@@ -54,7 +54,6 @@ export const setupTests = async <Paths extends {}>(bindings: Env) => {
54
54
  // Hack until miniflare supports auto running D1 migrations.
55
55
  // Note: Each migration file can contain only a single statement.
56
56
  await Promise.all(
57
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
58
57
  (config.d1_databases ?? []).map(
59
58
  async ({ binding }: { binding: string }) => {
60
59
  const d1 = await miniflare.getD1Database(binding);
package/tsconfig.json CHANGED
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "compilerOptions": {
3
+ "allowJs": true,
3
4
  "esModuleInterop": true,
4
5
  "isolatedModules": true,
5
6
  "lib": ["ESNext"],