Skip to content

Commit

Permalink
Rename library
Browse files Browse the repository at this point in the history
  • Loading branch information
GRA0007 committed Jul 4, 2023
1 parent 6686b63 commit d61daf8
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 21 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
# 🌲 Fir - Forms in React
# 🌲 React Zoom Form

[![npm version](https://img.shields.io/npm/v/@stevent-team/react-zoom-form)](https://www.npmjs.com/package/@stevent-team/react-zoom-form)
[![minzip size](https://img.shields.io/bundlephobia/minzip/@stevent-team/react-zoom-form)](https://bundlephobia.com/package/@stevent-team/react-zoom-form)

> **Warning**<br>
> Fir is in alpha, and the API may change entirely within minor releases. Please use at your own risk.
> React Zoom Form is in alpha, and the API may change entirely within minor releases. Please use at your own risk.
Typescript-first, hook-based forms using React, powered by [Zod](https://github.com/colinhacks/zod). Inspired by [react-hook-form](https://github.com/react-hook-form/react-hook-form) and [react-zorm](https://github.com/esamattis/react-zorm).

## Usage

Install `fir` and `zod`
Install `react-zoom-form` and `zod`

```bash
yarn add @stevent-team/fir zod
yarn add @stevent-team/react-zoom-form zod
```

Example usage:

```tsx
import { useForm, useField, Field } from '@stevent-team/fir'
import { useForm, useField, Field } from '@stevent-team/react-zoom-form'
import { z } from 'zod'

// Define the structure and validation of your form
Expand Down
2 changes: 1 addition & 1 deletion example/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SubmitHandler, useForm, Field, useField } from '@stevent-team/fir'
import { SubmitHandler, useForm, Field, useField } from '@stevent-team/react-zoom-form'
import { ZodIssue, z } from 'zod'

// Define the structure and validation of your form
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./example/style.css">
<title>Fir Example</title>
<title>React Zoom Form Example</title>
</head>
<body>
<div id="app"></div>
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@stevent-team/fir",
"name": "@stevent-team/react-zoom-form",
"version": "0.0.1",
"description": "Forms in React",
"description": "React forms powered by Zod",
"keywords": [
"react",
"hooks",
"fir",
"zoom",
"forms",
"zod"
],
"repository": "https://github.com/stevent-team/fir",
"repository": "https://github.com/stevent-team/react-zoom-form",
"author": "Stevent Team (https://stevent.club)",
"license": "MIT",
"scripts": {
Expand All @@ -22,13 +22,13 @@
"files": [
"dist"
],
"module": "./dist/fir.js",
"main": "./dist/fir.umd.cjs",
"types": "./dist/fir.d.ts",
"module": "./dist/react-zoom-form.js",
"main": "./dist/react-zoom-form.umd.cjs",
"types": "./dist/react-zoom-form.d.ts",
"exports": {
".": {
"import": "./dist/fir.js",
"require": "./dist/fir.umd.cjs"
"import": "./dist/react-zoom-form.js",
"require": "./dist/react-zoom-form.umd.cjs"
}
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion test/basic.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, it, expect, vi } from 'vitest'
import { render, screen } from '@testing-library/react'
import { ZodIssue, z } from 'zod'
import { SubmitHandler, useForm } from '@stevent-team/fir'
import { SubmitHandler, useForm } from '@stevent-team/react-zoom-form'
import userEvent from '@testing-library/user-event'

const schema = z.object({
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"paths": {
"@stevent-team/fir": ["./lib/index.ts"] // Allows importing library from realistic path in demo
"@stevent-team/react-zoom-form": ["./lib/index.ts"] // Allows importing library from realistic path in demo
},
"target": "ESNext",
"jsx": "react-jsx",
Expand Down
6 changes: 3 additions & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ export default defineConfig({
],
resolve: {
alias: {
'@stevent-team/fir': resolve(__dirname, 'lib/index.ts')
'@stevent-team/react-zoom-form': resolve(__dirname, 'lib/index.ts')
}
},
build: {
lib: {
entry: resolve(__dirname, 'lib/index.ts'),
name: 'fir',
fileName: 'fir',
name: 'react-zoom-form',
fileName: 'react-zoom-form',
},
},
test: {
Expand Down

0 comments on commit d61daf8

Please sign in to comment.