@townco/fly 0.1.58 → 0.1.60

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/hey-api.js CHANGED
@@ -1,7 +1,23 @@
1
- import { parseEnv } from "@townco/env";
2
1
  export const createClientConfig = (config) => ({
3
2
  ...config,
4
3
  // Fly API spec lacks securitySchemes, so auth callback won't work.
5
4
  // Set Authorization header directly instead.
6
- headers: { Authorization: `Bearer ${parseEnv("FLY_TOKEN").FLY_TOKEN}` },
5
+ //
6
+ // IMPORTANT:
7
+ // This module is imported during Next.js build (apps/shed) via @townco/api -> @townco/fly,
8
+ // and the generated fly client is initialized at module load time. Requiring FLY_TOKEN
9
+ // here would make builds fail in environments where secrets are not available (e.g. PRs from forks).
10
+ //
11
+ // So we read the env var directly and only attach the header if present.
12
+ headers: (() => {
13
+ const token = process.env.FLY_TOKEN;
14
+ if (!token)
15
+ return config?.headers;
16
+ return {
17
+ ...(typeof config?.headers === "object" && config.headers != null
18
+ ? config.headers
19
+ : {}),
20
+ Authorization: `Bearer ${token}`,
21
+ };
22
+ })(),
7
23
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@townco/fly",
3
3
  "type": "module",
4
- "version": "0.1.58",
4
+ "version": "0.1.60",
5
5
  "description": "flyapi",
6
6
  "license": "UNLICENSED",
7
7
  "main": "./dist/index.js",
@@ -19,18 +19,19 @@
19
19
  "devDependencies": {
20
20
  "@biomejs/biome": "^2.3.8",
21
21
  "@hey-api/openapi-ts": "^0.88.0",
22
- "@townco/tsconfig": "0.1.105",
22
+ "@townco/tsconfig": "0.1.107",
23
23
  "@types/node": "^24.10.1",
24
- "@typescript/native-preview": "^7.0.0-dev.20251207.1"
24
+ "@typescript/native-preview": "^7.0.0-dev.20251207.1",
25
+ "openapi-types": "^12.1.3"
25
26
  },
26
27
  "scripts": {
27
28
  "build": "tsgo",
28
29
  "check": "tsgo --noEmit",
29
30
  "fetch-spec": "bun spectool",
30
31
  "gen": "turbo gen:api",
31
- "gen:api": "openapi-ts"
32
+ "gen:api": "openapi-ts && biome check --write"
32
33
  },
33
34
  "dependencies": {
34
- "@townco/env": "0.1.58"
35
+ "@townco/env": "0.1.60"
35
36
  }
36
37
  }