Skip to content

Commit

Permalink
Merge pull request #14 from cuweb/feature/github-pages
Browse files Browse the repository at this point in the history
Feature/GitHub pages
  • Loading branch information
troychaplin authored Oct 25, 2023
2 parents b98c324 + 897c406 commit d5f391c
Show file tree
Hide file tree
Showing 39 changed files with 6,381 additions and 672 deletions.
6 changes: 6 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": ["@commitlint/config-conventional"],
"rules": {
"type-enum": [2, "always", ["add", "change", "deprecate", "doc", "fix", "refactor", "release", "revert", "test"]]
}
}
48 changes: 48 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
## PR Checklist & Notes

### What type of PR is this? (check all applicable)

- [ ] New component
- [ ] New feature
- [ ] Refactor
- [ ] Bug fix
- [ ] Optimization / Build Tools
- [ ] Documentation Update

### Related Tickets & Documents

- Jira Ticket / Github Issue #

### Is this a breaking change?

If yes, please note which project will be impacted.

- [ ] Yes
- [ ] No

### Have you made an entry in the Changelog?

If not, please make an entry or your PR will be declined. Add new entries under the "Unreleased" section of the changelog.

- [ ] Yes
- [ ] No

### Have you made changes to dependencies?

If you've made changes to dependencies please note them here, adding if they've been added, removed or updated, including packages version where applicable.

- [ ] Added
- [ ] Updated
- [ ] Removed
- [ ] Combo of any of the above
- [ ] No

### QA Instructions, Screenshots, Recordings

Please replace this line with instructions on how to test your changes, and if applicable add a note
about any UI changes or if a test should be done on a specific browser. Add any other detail relevant to this PR.

### UI accessibility concerns?

If your PR includes UI changes, please replace this line with details on how
accessibility is impacted and tested. If there are no accessibility concerns delete this section.
29 changes: 29 additions & 0 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Storybook Deploy
on:
push:
branches:
- develop
jobs:
build-and-deploy:
name: Build and deploy Storybook
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install
run: npm ci

- name: Build
run: npm run build-storybook
env:
NODE_OPTIONS: --max_old_space_size=4096

- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: storybook-static

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dist-ssr
*.local

# Editor directories and files
storybook-static
.vscode/*
!.vscode/extensions.json
.idea
Expand Down
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx commitlint --edit $1
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn build
# npm run build
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"trailingComma": "all",
"tabWidth": 2,
"semi": false,
"singleQuote": true,
"printWidth": 120,
"bracketSpacing": true
}
10 changes: 10 additions & 0 deletions .size-limit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"path": "dist/rds-forms.es.js",
"limit": "125 kB"
},
{
"path": "dist/rds-forms.umd.js",
"limit": "125 kB"
}
]
1 change: 1 addition & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const config: StorybookConfig = {
"@storybook/addon-essentials",
"@storybook/addon-onboarding",
"@storybook/addon-interactions",
"@storybook/addon-a11y",
],
framework: {
name: "@storybook/react-vite",
Expand Down
63 changes: 44 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,52 @@
# React + TypeScript + Vite
# Raven Design System - Forms

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
## Build Tools

Currently, two official plugins are available:
- [React](https://reactjs.org/)
- [TypeScript](https://www.typescriptlang.org/)
- [Storybook](https://storybook.js.org/)
- [Vite](https://vitejs.dev/)
- [Tailwind CSS](https://tailwindcss.com/)

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
## Getting Started

## Expanding the ESLint configuration
1. In a terminal window open your install location and run the following:

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
```shell
git clone https://github.com/cuweb/rds-forms.git
```

- Configure the top-level `parserOptions` property like this:
2. Once the clone is complete move into the `RDS` directory and run:

```js
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
```
```shell
npm install
```

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
3. Run Storybook

```shell
npm run storybook
```

4. Other useful shell commands

- `npm run clean` - deletes node modules, package lock and run npm install
- `npm run cypress` - launch cypress app
- `npm run format` - format files with prettier
- `npm run lint` - check for errors with eslint
- `npm run size` - compare compiled size against pre-defined limit


## Comment Linting

When adding a commit with a commit you may be blocked if you do not prefix your comment with one of the following types. So a commit should look like: `git commit -m "change: updated spacing around button"`. The prefix requires a colon to separate it from the comment.

- `add` - used when adding something new such as a component, story or test file
- `change` - used when making a change to an existing file in the project
- `doc` - used when updating something related to documentation
- `fix` - used when fixing an error, warning or something else
- `perf` - used when making changes relating to performance
- `refactor` - used when refactoring something such as a component or build tool
- `release` - used when preparing a new release
- `revert` - used when revert to a past commit
- `test` - used when making changes relating to testing
Loading

0 comments on commit d5f391c

Please sign in to comment.