Skip to content

Commit 7eeeddd

Browse files
committed
feat: initial TypeScript rewrite
BREAKING CHANGES: - Remove Form and FormList components - Importing is now done as named imports from package main
1 parent 27417ab commit 7eeeddd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+45839
-24478
lines changed

.eslintignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
cjs
2-
esm
3-
node_modules
1+
node_modules/**
2+
typings/**
3+
.vscode/**
4+
.eslintrc.js
5+
jest.config.js
6+
.storybook/**

.eslintrc.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
module.exports = {
2+
parser: "@typescript-eslint/parser",
3+
parserOptions: {
4+
project: "./tsconfig.json",
5+
tsconfigRootDir: __dirname,
6+
sourceType: "module",
7+
warnOnUnsupportedTypeScriptVersion: false,
8+
},
9+
plugins: ["@typescript-eslint", "jest", "simple-import-sort"],
10+
extends: [
11+
"standard-with-typescript",
12+
"plugin:react/recommended",
13+
"plugin:jest/recommended",
14+
],
15+
globals: {
16+
FormData: false,
17+
fetch: false,
18+
},
19+
rules: {
20+
// note you must disable the base rule as it can report incorrect errors
21+
"no-use-before-define": "off",
22+
"@typescript-eslint/no-use-before-define": ["error"],
23+
"react/prop-types": "off",
24+
"simple-import-sort/imports": "error",
25+
},
26+
settings: {
27+
react: {
28+
version: "detect",
29+
},
30+
},
31+
ignorePatterns: ["!.storybook"],
32+
};

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [longshotlabs]
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ""
5+
labels: bug
6+
assignees: ""
7+
---
8+
9+
<!--
10+
If you benefit from this package and would like to see more of our time devoted to it,
11+
you can help by sponsoring: https://github.com/sponsors/longshotlabs
12+
13+
You may delete this text or leave it. It is invisible.
14+
-->
15+
16+
**Describe the bug**
17+
A clear and concise description of what the bug is.
18+
19+
**To Reproduce**
20+
Steps to reproduce the behavior:
21+
22+
1. Go to '...'
23+
2. Click on '....'
24+
3. Scroll down to '....'
25+
4. See error
26+
27+
**Expected behavior**
28+
A clear and concise description of what you expected to happen.
29+
30+
**Screenshots**
31+
If applicable, add screenshots to help explain your problem.
32+
33+
**Desktop (please complete the following information):**
34+
35+
- OS: [e.g. iOS]
36+
- Browser [e.g. chrome, safari]
37+
- Version [e.g. 22]
38+
39+
**Smartphone (please complete the following information):**
40+
41+
- Device: [e.g. iPhone6]
42+
- OS: [e.g. iOS8.1]
43+
- Browser [e.g. stock browser, safari]
44+
- Version [e.g. 22]
45+
46+
**Additional context**
47+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Feature Requests
4+
url: https://github.com/longshotlabs/reacto-form/discussions
5+
about: Request new features and product improvements on GitHub Discussions.

.github/ISSUE_TEMPLATE/task.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
name: Task
3+
about: Core maintainers use this type of issue to track planned tasks. It is not for requesting features.
4+
title: ""
5+
labels: enhancement
6+
assignees: ""
7+
---
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Lint, Test, and (Maybe) Publish
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
shell: bash
15+
steps:
16+
- name: Check out files
17+
uses: actions/checkout@v2
18+
- name: Use Node.js 14.x
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: 14.x
22+
- name: Install package dependencies
23+
run: npm ci
24+
- name: Lint code
25+
run: npm run lint --if-present
26+
27+
test:
28+
runs-on: ubuntu-latest
29+
defaults:
30+
run:
31+
shell: bash
32+
steps:
33+
- name: Check out files
34+
uses: actions/checkout@v2
35+
- name: Use Node.js 14.x
36+
uses: actions/setup-node@v1
37+
with:
38+
node-version: 14.x
39+
- name: Install package dependencies
40+
run: npm ci
41+
- name: Test code
42+
run: npm run test --if-present
43+
44+
publish:
45+
runs-on: ubuntu-latest
46+
if: ${{ github.event_name == 'push' && github.repository_owner == 'longshotlabs' && github.ref == 'refs/heads/main' }}
47+
needs: [lint, test]
48+
defaults:
49+
run:
50+
shell: bash
51+
steps:
52+
- name: Check out files
53+
uses: actions/checkout@v2
54+
- name: Use Node.js 14.x
55+
uses: actions/setup-node@v1
56+
with:
57+
node-version: 14.x
58+
- name: Install package dependencies
59+
run: npm ci
60+
- name: Semantic Release
61+
run: npx semantic-release
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Add immediate comment on new issues
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
jobs:
8+
createComment:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Create Comment
12+
uses: peter-evans/[email protected]
13+
with:
14+
issue-number: ${{ github.event.issue.number }}
15+
body: |
16+
Thank you for submitting an issue!
17+
18+
If this is a bug report, please be sure to include, at minimum, example code that will reproduce the issue. Even better, you can link to a saved online code editor example, where anyone can immediately run the code and see the issue.
19+
20+
If you are requesting a feature, it is better to discuss it in the Discussions area first.
21+
22+
If you need to edit your issue description, click the [**...**] and choose Edit.
23+
24+
Be patient. This is a free and freely licensed package that we maintain in our spare time. You may get a response in a day, but it could also take a month. If you benefit from this package and would like to see more time devoted to it, you can help by [sponsoring](https://github.com/sponsors/longshotlabs).
25+

.gitignore

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
dist
2-
cjs
3-
esm
4-
.DS_Store
1+
npm-debug.log*
2+
3+
# Dependencies
54
node_modules
6-
npm-debug.log
7-
.idea
5+
6+
# Transpiled files
7+
build/
8+
9+
# Misc
10+
.DS_Store

.markdownlint.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"line-length": false,
3+
"no-bare-urls": false,
4+
"no-emphasis-as-header": false,
5+
"no-inline-html": false
6+
}

0 commit comments

Comments
 (0)