Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 38 additions & 24 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,56 @@
name: Coverage
name: Test Coverage

on: [push, pull_request]
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

jobs:
test:
name: Test Core Package
runs-on: ubuntu-latest

strategy:
matrix:
package: [core]

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "18"

- name: Install dependencies
run: npm install
working-directory: packages/${{ matrix.package }}
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Run tests with coverage
run: npm run coverage
working-directory: packages/${{ matrix.package }}
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: List project directory
run: ls -R packages/${{ matrix.package }}
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install --no-frozen-lockfile

- name: List coverage directory
run: ls -R packages/${{ matrix.package }}/coverage
- name: Run tests with coverage
run: pnpm --filter @react-formgen/core run coverage

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: packages/${{ matrix.package }}/coverage/lcov.info
files: ./packages/core/coverage/lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
flags: core
name: codecov-umbrella
fail_ci_if_error: false
15 changes: 0 additions & 15 deletions .gitmodules

This file was deleted.

4 changes: 3 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": true
"semi": true,
"singleQuote": false,
"useTabs": false
}
54 changes: 0 additions & 54 deletions examples/README.md

This file was deleted.

1 change: 0 additions & 1 deletion examples/antd
Submodule antd deleted from 5a6866
1 change: 0 additions & 1 deletion examples/bootstrap
Submodule bootstrap deleted from d3e685
1 change: 0 additions & 1 deletion examples/material-ui
Submodule material-ui deleted from 81a9bc
1 change: 0 additions & 1 deletion examples/shadcn-ui
Submodule shadcn-ui deleted from 7aeb83
1 change: 0 additions & 1 deletion examples/tailwindcss
Submodule tailwindcss deleted from d2ebee
11 changes: 7 additions & 4 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@react-formgen/core",
"description": "A headless, type-safe, customizable, and super simple React form generator.",
"private": false,
"version": "0.0.0-alpha.24",
"version": "0.0.0-alpha.25",
"license": "MIT",
"author": "m6io",
"repository": {
Expand Down Expand Up @@ -44,14 +44,15 @@
"zustand": "^4.5.2"
},
"peerDependencies": {
"react": "^18.3.1",
"react-dom": "^18.0.0"
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.4.8",
"@testing-library/react": "^16.0.0",
"@types/node": "^20.14.8",
"@types/react": "^18.3.3",
"@types/react": "^18.0.0 || ^19.0.0",
"@types/react-dom": "^18.0.0 || ^19.0.0",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"@vitejs/plugin-react": "^4.3.1",
Expand All @@ -61,6 +62,8 @@
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"jsdom": "^24.1.1",
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0",
"rollup-plugin-visualizer": "^5.12.0",
"typescript": "^5.5.2",
"vite": "^5.3.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/factory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export const createFormProviderAndHooks = <S, E>(
renderTemplate = BaseRenderTemplate,
enableDevtools = false,
}) => {
const storeRef = React.useRef<FormStore<S, E>>();
const storeRef = React.useRef<FormStore<S, E>>(null);
if (!storeRef.current) {
storeRef.current = createFormStore<S, E>(
initialData,
Expand Down
13 changes: 8 additions & 5 deletions packages/json-schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@react-formgen/json-schema",
"description": "A headless, type-safe, customizable, and super simple React form generator.",
"private": false,
"version": "0.0.0-alpha.24",
"version": "0.0.0-alpha.25",
"license": "MIT",
"author": "m6io",
"repository": {
Expand Down Expand Up @@ -35,25 +35,28 @@
"analyze": "vite build --mode analyze"
},
"dependencies": {
"@react-formgen/core": "0.0.0-alpha.24"
"@react-formgen/core": "0.0.0-alpha.25"
},
"peerDependencies": {
"ajv": "^8.16.0",
"ajv-formats": "^3.0.1",
"json-schema": "^0.4.0",
"react": "^18.3.1",
"react-dom": "^18.0.0"
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
},
"devDependencies": {
"@types/json-schema": "^7.0.15",
"@types/node": "^20.14.8",
"@types/react": "^18.3.3",
"@types/react": "^18.0.0 || ^19.0.0",
"@types/react-dom": "^18.0.0 || ^19.0.0",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"@vitejs/plugin-react": "^4.3.1",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0",
"rollup-plugin-visualizer": "^5.12.0",
"typescript": "^5.5.2",
"vite": "^5.3.1"
Expand Down
13 changes: 8 additions & 5 deletions packages/yup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@react-formgen/yup",
"description": "A headless, type-safe, customizable, and super simple React form generator.",
"private": false,
"version": "0.0.0-alpha.24",
"version": "0.0.0-alpha.25",
"license": "MIT",
"author": "m6io",
"repository": {
Expand Down Expand Up @@ -33,22 +33,25 @@
"analyze": "vite build --mode analyze"
},
"dependencies": {
"@react-formgen/core": "0.0.0-alpha.24"
"@react-formgen/core": "0.0.0-alpha.25"
},
"peerDependencies": {
"react": "^18.3.1",
"react-dom": "^18.0.0",
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0",
"yup": "^1.4.0"
},
"devDependencies": {
"@types/node": "^20.14.8",
"@types/react": "^18.3.3",
"@types/react": "^18.0.0 || ^19.0.0",
"@types/react-dom": "^18.0.0 || ^19.0.0",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"@vitejs/plugin-react": "^4.3.1",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0",
"rollup-plugin-visualizer": "^5.12.0",
"typescript": "^5.5.2",
"vite": "^5.3.1"
Expand Down
13 changes: 8 additions & 5 deletions packages/zod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@react-formgen/zod",
"description": "A headless, type-safe, customizable, and super simple React form generator.",
"private": false,
"version": "0.0.0-alpha.24",
"version": "0.0.0-alpha.25",
"license": "MIT",
"author": "m6io",
"repository": {
Expand Down Expand Up @@ -33,22 +33,25 @@
"analyze": "vite build --mode analyze"
},
"dependencies": {
"@react-formgen/core": "0.0.0-alpha.24"
"@react-formgen/core": "0.0.0-alpha.25"
},
"peerDependencies": {
"react": "^18.3.1",
"react-dom": "^18.0.0",
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0",
"zod": "^3.23.8"
},
"devDependencies": {
"@types/node": "^20.14.8",
"@types/react": "^18.3.3",
"@types/react": "^18.0.0 || ^19.0.0",
"@types/react-dom": "^18.0.0 || ^19.0.0",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"@vitejs/plugin-react": "^4.3.1",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0",
"rollup-plugin-visualizer": "^5.12.0",
"typescript": "^5.5.2",
"vite": "^5.3.1"
Expand Down
Loading