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
24 changes: 5 additions & 19 deletions .github/actions/pnpm-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,14 @@ inputs:
runs:
using: "composite"
steps:
- uses: actions/setup-node@v4
env:
NODE_VERSION: "22"
with:
node-version: "${{ env.NODE_VERSION }}"
- name: Install pnpm
uses: pnpm/action-setup@v4
id: pnpm-install
with:
version: 9
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v4
- uses: actions/setup-node@v5
env:
NODE_VERSION: "24"
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ env.NODE_VERSION }}-${{ inputs.target }}-${{ hashFiles(format('{0}/pnpm-lock.yaml', inputs.target)) }}
restore-keys: |
${{ runner.os }}-pnpm-store-${{ env.NODE_VERSION }}-${{ inputs.target }}-
node-version: "${{ env.NODE_VERSION }}"
cache: pnpm
- name: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: ./.github/actions/pnpm-install
with:
target: '.'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: ./.github/actions/pnpm-install
with:
target: '.'
Expand All @@ -22,7 +22,7 @@ jobs:
- name: Build docs
run: pnpm docs:build
- name: Upload Artifacts
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@v4
with:
path: 'build/'

Expand Down
12 changes: 6 additions & 6 deletions docs/assets/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@import "table";
@import "Main";
@import "DisplayValues";
@import "Forms";
@import "Sidebar";
@import "App";
@use "table";
@use "Main";
@use "DisplayValues";
@use "Forms";
@use "Sidebar";
@use "App";

body {
margin: 0;
Expand Down
2 changes: 1 addition & 1 deletion docs/src/hooks/useSafeState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const useSafeState = <T>(initial: T): UseSafeStateReturnType<T> => {

const safeSetState = useCallback(
(v: SetStateAction<T>) => {
mounted.current && setState(v);
if (mounted.current) setState(v);
},
[mounted],
);
Expand Down
7 changes: 5 additions & 2 deletions docs/src/samples/async/AsyncValidationSample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ const validateName = (setPending: (p: boolean) => void) => (name?: string) => {
}
const lowerCaseUserName = name!.toLowerCase();
setPending(true);
lowerCaseUserName === everySecondTimeFailing_userName &&
if (lowerCaseUserName === everySecondTimeFailing_userName) {
jackValidationCounter++;
}

return Utils.sleep(1000).then(() => {
setPending(false);
if (lowerCaseUserName === alreadyRegistered_userName) {
Expand Down Expand Up @@ -94,11 +96,12 @@ export const AsyncValidationSample = () => {
);

const onSubmitFailed = useCallback((e: Error): void => {
Morfi.isValidationError(e) ||
if (!Morfi.isValidationError(e)) {
setData((data) => ({
...data,
errors: { ...data.errors, userName: { id: e.message } },
}));
}
}, []);

const onSubmitFinished = useCallback((): void => {
Expand Down
1 change: 0 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @ts-check

import js from "@eslint/js";
// @ts-expect-error https://github.com/import-js/eslint-plugin-import/issues/2948
import imp from "eslint-plugin-import";
import prettier from "eslint-plugin-prettier";
// support will be added soon: https://github.com/jsx-eslint/eslint-plugin-react/pull/3727
Expand Down
54 changes: 28 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "morfi",
"version": "2.1.2",
"version": "2.1.3",
"type": "module",
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
Expand Down Expand Up @@ -41,29 +41,31 @@
"react": ">= 16.18"
},
"devDependencies": {
"@testing-library/react": "15.0.7",
"@types/node": "20.12.12",
"@types/react": "18.3.2",
"@types/react-dom": "18.3.0",
"@vitejs/plugin-react": "4.2.1",
"@vitest/coverage-v8": "1.6.0",
"eslint": "9.2.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-react": "7.34.1",
"eslint-plugin-react-hooks": "4.6.2",
"eslint-plugin-simple-import-sort": "12.1.0",
"jsdom": "24.0.0",
"prettier": "3.2.5",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.23.1",
"sass": "1.77.1",
"spy4js": "3.4.1",
"typescript": "5.4.5",
"typescript-eslint": "7.9.0",
"vite": "5.2.11",
"vitest": "1.6.0"
}
"@eslint/js": "9.35.0",
"@testing-library/react": "16.3.0",
"@types/node": "24.5.1",
"@types/react": "19.1.13",
"@types/react-dom": "19.1.9",
"@vitejs/plugin-react": "5.0.3",
"@vitest/coverage-v8": "3.2.4",
"eslint": "9.35.0",
"eslint-config-prettier": "10.1.8",
"eslint-plugin-import": "2.32.0",
"eslint-plugin-prettier": "5.5.4",
"eslint-plugin-react": "7.37.5",
"eslint-plugin-react-hooks": "5.2.0",
"eslint-plugin-simple-import-sort": "12.1.1",
"jsdom": "27.0.0",
"prettier": "3.6.2",
"react": "19.1.1",
"react-dom": "19.1.1",
"react-router-dom": "7.9.1",
"sass": "1.92.1",
"spy4js": "5.0.0",
"typescript": "5.9.2",
"typescript-eslint": "8.44.0",
"vite": "7.1.5",
"vitest": "3.2.4"
},
"packageManager": "pnpm@10.16.1+sha512.0e155aa2629db8672b49e8475da6226aa4bdea85fdcdfdc15350874946d4f3c91faaf64cbdc4a5d1ab8002f473d5c3fcedcd197989cf0390f9badd3c04678706"
}
Loading