Skip to content

Commit 1dd232c

Browse files
committed
build: fix post-review issues and add packaging/type tooling for 0.3.1
1 parent 54dfa8d commit 1dd232c

File tree

9 files changed

+807
-62
lines changed

9 files changed

+807
-62
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,28 @@ jobs:
1010
check:
1111
runs-on: ubuntu-latest
1212

13+
strategy:
14+
matrix:
15+
node-version: [20, 22]
16+
1317
steps:
1418
- uses: actions/checkout@v4
1519

1620
- uses: pnpm/action-setup@v4
1721

1822
- uses: actions/setup-node@v4
1923
with:
20-
node-version: 20
24+
node-version: ${{ matrix.node-version }}
2125
cache: pnpm
2226

2327
- run: pnpm install --frozen-lockfile
2428

2529
- run: pnpm build
2630

31+
- run: pnpm lint:packages
32+
33+
- run: pnpm check:types
34+
2735
- run: pnpm --filter @formhaus/core --filter @formhaus/react run test:resolve
2836

2937
- run: pnpm test

CHANGELOG.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,22 @@
44

55
### `@formhaus/core`
66

7-
- New `onStepValidate` option and `nextStepAsync()` method for async step validation (e.g. server-side checks between steps). Exposes `stepValidating` state, `StepValidateFn` type, and routes top-level errors through `topLevelErrors`.
7+
- New `onStepValidate` option runs an async validator between steps. `nextStepAsync()` awaits it. Exposes `stepValidating` and the `StepValidateFn` type.
88

99
### `@formhaus/react`
1010

11-
- `FormRenderer` accepts `onStepValidate`; Continue button shows loading during async validation.
11+
- `FormRenderer` accepts `onStepValidate`. Continue button shows a loading state while the validator runs.
1212

1313
### `@formhaus/vue`
1414

15-
- `FormRenderer` accepts `onStepValidate`; `useFormEngine` exposes `stepValidating`.
15+
- `FormRenderer` accepts `onStepValidate`. `useFormEngine` now returns `stepValidating`.
1616

17-
### Build
17+
### Packaging
1818

19-
- `@formhaus/core` and `@formhaus/react` now ship as single bundled ESM via `tsup` instead of `tsc` directory output. Sizes: core 2.87 KB gzipped, react 3.15 KB gzipped.
20-
- `"sideEffects": false` on core and react, `"sideEffects": ["**/*.vue", "**/*.css"]` on vue.
21-
- Reordered `exports` field so `types` comes before `import`.
22-
- New `test:resolve` script in core and react runs built `dist/index.js` through Node's strict ESM resolver in CI.
23-
- Dropped "JSON-schema-driven" wording from package descriptions and removed `json-schema` from core keywords.
19+
- **Breaking:** ESM-only. Dropped legacy `main` and `module` fields. Minimum Node is 18.
20+
- Fixed `@formhaus/vue` type resolution under `moduleResolution: "node16"` and `"nodenext"`.
21+
- `@formhaus/core` and `@formhaus/react` down to 2.87 KB and 3.15 KB gzipped.
22+
- `sideEffects: false` on core, react, and vue.
2423

2524
## 0.3.0 - 2026-04-07
2625

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@
77
"docs:build": "cd docs && pnpm install && npx vitepress build",
88
"docs:dev": "cd docs && npx vitepress dev",
99
"test": "pnpm -r run test",
10-
"clean": "pnpm -r run clean"
10+
"clean": "pnpm -r run clean",
11+
"lint:packages": "pnpm --filter @formhaus/core --filter @formhaus/react --filter @formhaus/vue exec publint",
12+
"check:types": "pnpm --filter @formhaus/core --filter @formhaus/react --filter @formhaus/vue exec attw --pack --profile esm-only"
1113
},
1214
"engines": {
13-
"node": ">=18"
15+
"node": ">=20"
16+
},
17+
"devDependencies": {
18+
"@arethetypeswrong/cli": "^0.18.2",
19+
"publint": "^0.3.18"
1420
}
1521
}

packages/core/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "@formhaus/core",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "Framework-agnostic form engine with validation, conditional visibility, and multi-step support. Define forms as plain JSON, render anywhere.",
55
"type": "module",
66
"sideEffects": false,
7-
"main": "./dist/index.js",
8-
"module": "./dist/index.js",
9-
"types": "./dist/index.d.ts",
7+
"engines": {
8+
"node": ">=18"
9+
},
1010
"exports": {
1111
".": {
1212
"types": "./dist/index.d.ts",
@@ -32,7 +32,7 @@
3232
"license": "MIT",
3333
"repository": {
3434
"type": "git",
35-
"url": "https://github.com/ignsm/formhaus.git",
35+
"url": "git+https://github.com/ignsm/formhaus.git",
3636
"directory": "packages/core"
3737
},
3838
"keywords": [

packages/figma/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@formhaus/figma",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "Figma plugin: generates form mockups from @formhaus/core form definitions",
55
"scripts": {
66
"build": "esbuild src/code.ts --bundle --outfile=dist/code.js --target=es2017 --format=iife",
@@ -20,7 +20,7 @@
2020
"license": "MIT",
2121
"repository": {
2222
"type": "git",
23-
"url": "https://github.com/ignsm/formhaus.git",
23+
"url": "git+https://github.com/ignsm/formhaus.git",
2424
"directory": "packages/figma"
2525
}
2626
}

packages/react/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "@formhaus/react",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "React components for Formhaus forms. Define a form once in JSON, render with native HTML or your own components.",
55
"type": "module",
66
"sideEffects": false,
7-
"main": "./dist/index.js",
8-
"module": "./dist/index.js",
9-
"types": "./dist/index.d.ts",
7+
"engines": {
8+
"node": ">=18"
9+
},
1010
"exports": {
1111
".": {
1212
"types": "./dist/index.d.ts",
@@ -19,6 +19,7 @@
1919
"scripts": {
2020
"build": "tsup",
2121
"test": "vitest run",
22+
"test:watch": "vitest",
2223
"test:resolve": "node --input-type=module -e \"import('./dist/index.js').then(m => { if (!m.FormRenderer) process.exit(1); console.log('ESM resolve OK'); })\"",
2324
"clean": "rm -rf dist"
2425
},
@@ -42,7 +43,7 @@
4243
"license": "MIT",
4344
"repository": {
4445
"type": "git",
45-
"url": "https://github.com/ignsm/formhaus.git",
46+
"url": "git+https://github.com/ignsm/formhaus.git",
4647
"directory": "packages/react"
4748
}
4849
}

packages/vue/package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{
22
"name": "@formhaus/vue",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "Vue 3 components for Formhaus forms. Define a form once in JSON, render with native HTML or your own components.",
55
"type": "module",
6-
"sideEffects": ["**/*.vue", "**/*.css"],
7-
"main": "./dist/index.js",
8-
"module": "./dist/index.js",
9-
"types": "./dist/index.d.ts",
6+
"sideEffects": false,
7+
"engines": {
8+
"node": ">=18"
9+
},
1010
"exports": {
1111
".": {
12-
"import": "./dist/index.js",
13-
"types": "./dist/index.d.ts"
12+
"types": "./dist/index.d.ts",
13+
"import": "./dist/index.js"
1414
}
1515
},
1616
"files": [
1717
"dist"
1818
],
1919
"scripts": {
20-
"build": "vite build && vue-tsc --declaration --emitDeclarationOnly",
20+
"build": "vite build",
2121
"test": "vitest run",
2222
"clean": "rm -rf dist"
2323
},
@@ -33,14 +33,14 @@
3333
"jsdom": "^29.0.2",
3434
"typescript": "^5.7.3",
3535
"vite": "^6.2.2",
36+
"vite-plugin-dts": "^4.5.4",
3637
"vitest": "^4.1.3",
37-
"vue": "^3.5.13",
38-
"vue-tsc": "^2.0.0"
38+
"vue": "^3.5.13"
3939
},
4040
"license": "MIT",
4141
"repository": {
4242
"type": "git",
43-
"url": "https://github.com/ignsm/formhaus.git",
43+
"url": "git+https://github.com/ignsm/formhaus.git",
4444
"directory": "packages/vue"
4545
}
4646
}

packages/vue/vite.config.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
import { defineConfig } from 'vite';
22
import vue from '@vitejs/plugin-vue';
3+
import dts from 'vite-plugin-dts';
34
import { resolve } from 'path';
45

56
export default defineConfig({
6-
plugins: [vue()],
7+
plugins: [
8+
vue(),
9+
dts({
10+
include: ['src/**/*.ts', 'src/**/*.vue'],
11+
rollupTypes: true,
12+
tsconfigPath: './tsconfig.json',
13+
}),
14+
],
715
build: {
816
lib: {
917
entry: resolve(__dirname, 'src/index.ts'),

0 commit comments

Comments
 (0)