Skip to content

Commit

Permalink
Update contributing and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Cocoa committed Mar 9, 2024
1 parent 261a32f commit a06545d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
7 changes: 4 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ If you require more detailed instructions on any of these steps, please see the

## Running the App

1. Run the webpack build step with `npm run build` - this will update the generated `preload.js` file with the latest code from `src/`
1. At present, this project does not automatically rebuild to reflect your changes. If you have made changes to files in `src/` you will need to run `npm run build` to see them reflected in the app.
1. Open `index.html` in your browser and you're all set! (if you're not using a tool like VS Code's [LiveServer](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) extension you will need to refresh the page to see changes you've made)
1. Run the development server step with `npm run dev` - this will start the Vite dev server on http://localhost:5173/bookbinder-js/ which will refresh when you save changes to any of the source files.
1. If you want to check something in a 'final' build, you can run `npm run preview`, which will build and then serve the app on http://localhost:4173/bookbinder-js/ - this mode will *not* auto-refresh.
1. If you are using VS Code, you can install the 'Debugger for Chrome' or 'Debugger for Firefox' extensions, and then launch the app via VS Code's Run menu to get an IDE debug session.

## Branching and Committing

1. Create a feature branch with `git checkout -b` for whatever you're working on, such as `feature/contribution-docs` or `bugfix/page-layout-issues`
1. Commit your changes as you go with meaningful commit messages
1. Ideally, write tests for any new behavior you're introducting
1. Run tests with `npm run test` as you introduce changes; try to catch any breaking changes early and, as appropriate, either debug your code to find the problem or update the existing tests to reflect the new expected behavior
1. When you're done with your changes, make sure it passes the formatting and linting checks. These can be run as `npm run prettier` and `npm run lint` to simply check, or `npm run prettier:fix` and `npm run lint:fix` to autofix as much as possible (and show messages about the portions that can't be automatically fixed)
1. Push your changes up to the feature branch on your fork as you go with `git push origin [name of branch]`, for example, `git push origin feature/contribution-docs`

## Pull Requests
Expand Down
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,32 @@ A very helpful guide on page size given layout and paper selection has been crea
Snapshot of the size chart as of 2022-08-11
![Snapshot of sizes as of 2022-08-11](/docs/sizes_guide_snapshot_2022_08_11.png)

## Building
## Contributing

See the [contributing](/CONTRIBUTING.md) documentation!

## Dev script cheatsheet

```shell
npm run dev # Starts the development server (auto-refreshes changes) on http://localhost:5173/bookbinder-js/
npm run build # Builds output files into the /dist folder, to be copied and served elsewhere
npm run preview # Builds output files into the /dist folder and serves locally on http://localhost:4173/bookbinder-js/
npm run test # Runs vitest, and auto-retests if you make changes to test files
npm run lint # Runs ESLint to check for coding style violations
npm run lint:fix # Runs ESLint to check for coding style violations, and attempts to fix all easily-fixed ones
npm run prettier # Runs Prettier to check for file formatting violations
npm run prettier:fix # Runs ESLint to check for file formatting violations, and attempts reformat any bad files
```
To close out of any of the commands that don't automatically exist (`dev`, `preview`, and `test`), type `q` and then hit Enter.

## Running Locally

```
npm install
npm run dev
```

And load `index.html` in any modern web browser.
And load http://localhost:4173/bookbinder-js/ in any modern web browser.

## Auditing Results

Expand Down

0 comments on commit a06545d

Please sign in to comment.