Skip to content

Commit 4803c68

Browse files
authored
update release CI (#97)
<!-- CURSOR_SUMMARY --> > [!NOTE] > Introduces stricter quality gates and centralizes environment management while refining type handling across packages. > > - **CI/CD**: Split `continuous-release` into `lint`, `typecheck`, `test` (incl. 1Password + `@proofkit/fmodata` E2E), and `build`; `release.yml` adds manual trigger, TURBO env, and a `quality` job gating publish > - **Secrets/ENV**: New root `op.env`; removes per-package `op.env` and updates scripts to reference `../../op.env` > - **Tooling**: Adds `typecheck` scripts across packages and a Turbo `typecheck` task; bumps `turbo` and `pnpm`; small lint script tweaks > - **CLI/Deploy**: Safer handling of `envFile` (defaults to `.env`); fixes category typing; improves provider wrapping types > - **Typegen/Generators**: Normalizes data source config (default `type: "fmdapi"`), narrows types to `FmdapiDataSourceConfig`, and filters ops by type > - **Registry**: Replaces `shadcn` type imports with local lightweight schemas; updates `registry` package scripts > - **Auth installer**: Ensures added config includes `type: "fmdapi"` and explicit `envNames: undefined` > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit e0cc7d3. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 23639ec commit 4803c68

File tree

21 files changed

+451
-285
lines changed

21 files changed

+451
-285
lines changed

.github/workflows/continuous-release.yml

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,79 @@
11
name: Publish Any Commit
22
on: [push, pull_request]
33

4+
env:
5+
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
6+
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
7+
48
jobs:
5-
build:
9+
lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- run: corepack enable
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 22
19+
cache: "pnpm"
20+
21+
- name: Install dependencies
22+
run: pnpm install --frozen-lockfile
23+
24+
- name: Lint
25+
run: pnpm lint
26+
27+
typecheck:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v4
32+
33+
- run: corepack enable
34+
- uses: actions/setup-node@v4
35+
with:
36+
node-version: 22
37+
cache: "pnpm"
38+
39+
- name: Install dependencies
40+
run: pnpm install --frozen-lockfile
41+
42+
- name: Type Check
43+
run: pnpm typecheck
44+
45+
test:
646
runs-on: ubuntu-latest
47+
needs: [lint, typecheck]
48+
steps:
49+
- name: Checkout code
50+
uses: actions/checkout@v4
751

52+
- run: corepack enable
53+
- uses: actions/setup-node@v4
54+
with:
55+
node-version: 22
56+
cache: "pnpm"
57+
58+
- name: Install dependencies
59+
run: pnpm install --frozen-lockfile
60+
61+
- name: Install 1Password CLI
62+
uses: 1password/install-cli-action@v1
63+
64+
- name: Run Unit Tests
65+
run: op run --env-file=op.env -- pnpm test
66+
env:
67+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
68+
69+
- name: Run fmodata E2E Tests
70+
run: op run --env-file=op.env -- pnpm --filter @proofkit/fmodata test:e2e:ci
71+
env:
72+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
73+
74+
build:
75+
runs-on: ubuntu-latest
76+
needs: [test]
877
steps:
978
- name: Checkout code
1079
uses: actions/checkout@v4
@@ -20,4 +89,5 @@ jobs:
2089

2190
- name: Build
2291
run: pnpm build
92+
2393
- run: pnpm dlx pkg-pr-new publish './packages/*' --packageManager=pnpm

.github/workflows/release.yml

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,65 @@
11
name: Release
22

33
on:
4+
workflow_dispatch:
5+
46
push:
57
branches:
68
- main
79

810
concurrency: ${{ github.workflow }}-${{ github.ref }}
911

12+
env:
13+
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
14+
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
15+
1016
permissions:
11-
# Changesets/action needs to push version commits and open/update a PR
1217
contents: write
1318
pull-requests: write
14-
id-token: write # Required for OIDC
19+
id-token: write
1520

1621
jobs:
22+
quality:
23+
name: Quality Checks
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout Repo
27+
uses: actions/checkout@v4
28+
29+
- name: Enable Corepack
30+
run: corepack enable
31+
32+
- name: Setup Node.js 22.x
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: 22
36+
cache: "pnpm"
37+
38+
- name: Install Dependencies
39+
run: pnpm install --frozen-lockfile
40+
41+
- name: Lint
42+
run: pnpm lint
43+
44+
- name: Type Check
45+
run: pnpm typecheck
46+
47+
- name: Install 1Password CLI
48+
uses: 1password/install-cli-action@v1
49+
50+
- name: Run Tests
51+
run: op run --env-file=op.env -- pnpm test
52+
env:
53+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
54+
55+
- name: Run fmodata E2E Tests
56+
run: op run --env-file=op.env -- pnpm --filter @proofkit/fmodata test:e2e:ci
57+
env:
58+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
59+
1760
release:
1861
name: Release
62+
needs: [quality]
1963
runs-on: ubuntu-latest
2064
steps:
2165
- name: Checkout Repo
@@ -38,9 +82,7 @@ jobs:
3882
id: changesets
3983
uses: changesets/action@v1
4084
with:
41-
# This expects you to have a script called release which does a build for your packages and calls changeset publish
4285
publish: pnpm release
4386
env:
4487
GITHUB_TOKEN: ${{ github.token }}
45-
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
4688
NPM_CONFIG_PROVENANCE: true
Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,27 @@
55
# | | | | (_| \__ \__ \\ V V / (_) | | | (_| || __/ | | \ V /
66
# |_|_| \__,_|___/___/ \_/\_/ \___/|_| \__,_(_)___|_| |_|\_/
77
#
8-
# This file is intentionally commited to source control.
8+
# This file is intentionally committed to source control.
99
# It should only reference secrets in 1Password
1010

11-
DIFFERENT_FM_SERVER="op://xrs5sehh2gm36me62rlfpmsyde/ztcjgvgc4i5aa6cjh5vudpco4m/1Password env Values/FM_SERVER"
12-
DIFFERENT_FM_DATABASE="op://xrs5sehh2gm36me62rlfpmsyde/ztcjgvgc4i5aa6cjh5vudpco4m/1Password env Values/FM_DATABASE"
13-
DIFFERENT_OTTO_API_KEY="op://xrs5sehh2gm36me62rlfpmsyde/ztcjgvgc4i5aa6cjh5vudpco4m/1Password env Values/OTTO_API_KEY"
14-
11+
# fmdapi & typegen secrets
1512
FM_SERVER="op://xrs5sehh2gm36me62rlfpmsyde/ztcjgvgc4i5aa6cjh5vudpco4m/1Password env Values/FM_SERVER"
1613
FM_DATABASE="op://xrs5sehh2gm36me62rlfpmsyde/ztcjgvgc4i5aa6cjh5vudpco4m/1Password env Values/FM_DATABASE"
1714
OTTO_API_KEY="op://xrs5sehh2gm36me62rlfpmsyde/ztcjgvgc4i5aa6cjh5vudpco4m/1Password env Values/OTTO_API_KEY"
1815
FM_USERNAME="op://xrs5sehh2gm36me62rlfpmsyde/ztcjgvgc4i5aa6cjh5vudpco4m/username"
1916
FM_PASSWORD="op://xrs5sehh2gm36me62rlfpmsyde/ztcjgvgc4i5aa6cjh5vudpco4m/password"
20-
21-
# Test environment variables
17+
DIFFERENT_FM_SERVER="op://xrs5sehh2gm36me62rlfpmsyde/ztcjgvgc4i5aa6cjh5vudpco4m/1Password env Values/FM_SERVER"
18+
DIFFERENT_FM_DATABASE="op://xrs5sehh2gm36me62rlfpmsyde/ztcjgvgc4i5aa6cjh5vudpco4m/1Password env Values/FM_DATABASE"
19+
DIFFERENT_OTTO_API_KEY="op://xrs5sehh2gm36me62rlfpmsyde/ztcjgvgc4i5aa6cjh5vudpco4m/1Password env Values/OTTO_API_KEY"
2220
TEST_FM_SERVER="op://xrs5sehh2gm36me62rlfpmsyde/ztcjgvgc4i5aa6cjh5vudpco4m/1Password env Values/FM_SERVER"
2321
TEST_FM_DATABASE="op://xrs5sehh2gm36me62rlfpmsyde/ztcjgvgc4i5aa6cjh5vudpco4m/1Password env Values/FM_DATABASE"
2422
TEST_OTTO_API_KEY="op://xrs5sehh2gm36me62rlfpmsyde/ztcjgvgc4i5aa6cjh5vudpco4m/1Password env Values/OTTO_API_KEY"
2523
TEST_USERNAME="op://xrs5sehh2gm36me62rlfpmsyde/ztcjgvgc4i5aa6cjh5vudpco4m/username"
2624
TEST_PASSWORD="op://xrs5sehh2gm36me62rlfpmsyde/ztcjgvgc4i5aa6cjh5vudpco4m/password"
25+
26+
# fmodata secrets
27+
FMODATA_SERVER_URL="op://xrs5sehh2gm36me62rlfpmsyde/fmdapi_test/1Password env Values/FM_SERVER"
28+
FMODATA_DATABASE="op://xrs5sehh2gm36me62rlfpmsyde/fmdapi_test/1Password env Values/FM_DATABASE"
29+
FMODATA_API_KEY="op://xrs5sehh2gm36me62rlfpmsyde/fmdapi_test/1Password env Values/OTTO_API_KEY"
30+
FMODATA_USERNAME="op://xrs5sehh2gm36me62rlfpmsyde/fmdapi_test/username"
31+
FMODATA_PASSWORD="op://xrs5sehh2gm36me62rlfpmsyde/fmdapi_test/password"

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"build": "turbo run build --filter={./packages/*} --filter=@proofkit/docs",
55
"dev": "turbo run dev",
66
"lint": "turbo run lint",
7+
"typecheck": "turbo run typecheck",
78
"clean": "turbo run clean && rm -rf node_modules",
89
"format": "biome format --write .",
910
"changeset": "changeset",
@@ -22,12 +23,12 @@
2223
"husky": "^9.1.7",
2324
"knip": "^5.56.0",
2425
"lint-staged": "^16.2.7",
25-
"turbo": "^2.5.4",
26+
"turbo": "^2.7.3",
2627
"typescript": "^5.9.3",
2728
"ultracite": "7.0.8",
2829
"vitest": "^4.0.7"
2930
},
30-
"packageManager": "pnpm@10.14.0",
31+
"packageManager": "pnpm@10.27.0",
3132
"engines": {
3233
"node": ">=18"
3334
},

packages/better-auth/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"scripts": {
88
"dev": "pnpm build:watch",
99
"test": "vitest run",
10+
"typecheck": "tsc --noEmit",
1011
"build": "vite build && publint --strict",
1112
"build:watch": "vite build --watch",
1213
"ci": "pnpm run build && pnpm run test",

packages/cli/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,8 @@
4545
"dev": "tsdown --watch",
4646
"clean": "rm -rf dist .turbo node_modules",
4747
"start": "node dist/index.js",
48-
"lint": "biome check .",
48+
"lint": "biome check . --write",
4949
"lint:summary": "biome check . --reporter=summary",
50-
"format": "biome format --write .",
51-
"format:check": "biome format --check .",
5250
"release": "changeset version",
5351
"pub:beta": "NODE_ENV=production pnpm build && npm publish --tag beta --access public",
5452
"pub:next": "NODE_ENV=production pnpm build && npm publish --tag next --access public",

packages/cli/src/cli/add/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { select } from "@clack/prompts";
2+
import type { RegistryIndex } from "@proofkit/registry";
23
import { Command } from "commander";
34
import { capitalize, groupBy, uniq } from "es-toolkit";
45
import ora from "ora";
5-
66
import { ciOption, debugOption } from "~/globalOptions.js";
77
import { initProgramState, state } from "~/state.js";
88
import { logger } from "~/utils/logger.js";
@@ -77,7 +77,7 @@ const runAddFromRegistry = async (_options?: { noInstall?: boolean }) => {
7777
await runAddSchemaAction();
7878
} else if (addType === "data") {
7979
await runAddDataSourceCommand();
80-
} else if (categories.includes(addType)) {
80+
} else if ((categories as string[]).includes(addType)) {
8181
// one of the categories
8282
const itemsFromCategory = groupedByCategory[addType as keyof typeof groupedByCategory];
8383

packages/cli/src/cli/add/registry/postInstall/wrap-provider.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import path from "node:path";
22
import type { PostInstallStep } from "@proofkit/registry";
3-
import { type ImportDeclarationStructure, StructureKind, SyntaxKind } from "ts-morph";
3+
import { type ImportDeclarationStructure, type JsxChild, type JsxElement, StructureKind, SyntaxKind } from "ts-morph";
44

55
import { getShadcnConfig } from "~/helpers/shadcn-cli.js";
66
import { state } from "~/state.js";
@@ -66,9 +66,7 @@ export async function wrapProvider(step: Extract<PostInstallStep, { action: "wra
6666
return;
6767
}
6868

69-
let targetElement: ReturnType<
70-
(typeof returnStatement.getDescendantsOfKind<typeof SyntaxKind.JsxOpeningElement>)[number]["getParentIfKind"]
71-
>;
69+
let targetElement: JsxElement | undefined;
7270

7371
// Try to find the parent tag if specified
7472
if (parentTag && parentTag.length > 0) {
@@ -88,7 +86,7 @@ export async function wrapProvider(step: Extract<PostInstallStep, { action: "wra
8886
// If we found a parent tag, wrap its children
8987
const childrenText = targetElement
9088
?.getJsxChildren()
91-
.map((child) => child.getText())
89+
.map((child: JsxChild) => child.getText())
9290
.filter(Boolean)
9391
.join("\n");
9492

packages/cli/src/cli/deploy/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ async function pushEnvironmentVariables() {
182182

183183
try {
184184
const settings = getSettings();
185-
const envFile = path.join(process.cwd(), settings.envFile);
185+
const envFile = path.join(process.cwd(), settings.envFile ?? ".env");
186186

187187
if (!fs.existsSync(envFile)) {
188188
spinner.stop("No environment file found");

0 commit comments

Comments
 (0)