Skip to content

Commit

Permalink
Adding prettier (#169)
Browse files Browse the repository at this point in the history
* adding prettier
* removed README mangling
* removed extra lines
* added test coverage for withParams to prevent coverup of other attributes, and to test binding
* fixed verify
  • Loading branch information
kwhitley committed Jun 1, 2023
1 parent 8d63e83 commit 65432fc
Show file tree
Hide file tree
Showing 39 changed files with 602 additions and 501 deletions.
7 changes: 3 additions & 4 deletions .eslintrc.json → .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
"plugin:@typescript-eslint/recommended",
"prettier"
],
"overrides": [],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
Expand Down
11 changes: 9 additions & 2 deletions .github/ISSUE_TEMPLATE/issue_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,49 @@ about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

## Describe the Issue

A clear and concise description of what the issue is.

## Example Router Code

Please provide the itty-router code related to the issue. If possible, create a minimal, reproducible example.

```ts
// your code here

```

## Request Details

- Method: [e.g., GET, POST, PUT, DELETE]
- URL: [e.g., /api/v1/users]
- Request Body: If applicable, include the request body.
- Request Headers: If applicable, include the request headers.

## Steps to Reproduce

Steps to reproduce the behavior:

1. Run '...'
2. Send request to '....'
3. See error

## Expected Behavior

A clear and concise description of what you expected to happen.

## Actual Behavior

A clear and concise description of what actually happens. Include any error messages or unexpected responses.

## Environment (please complete the following information):

- Environment: [e.g., Node, Bun, Cloudflare Workers, Service Workers, Browser]
- itty-router Version: [e.g., 1.0.0]
- Other Relevant Libraries and their versions: [e.g., node 14.0.0]

## Additional Context

Add any other context about the problem here.
5 changes: 3 additions & 2 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ about: Have a question or something to discuss?
title: ''
labels: ''
assignees: ''

---

## Questions & Discussion
To cut down on long-standing topics that are discussion-based, rather than actual issues, please opt for one of the following paths, when possible. These have the benefit of potentially helping others after the issue (here) would have been closed.

To cut down on long-standing topics that are discussion-based, rather than actual issues, please opt for one of the following paths, when possible. These have the benefit of potentially helping others after the issue (here) would have been closed.

1. [Create a Discussion Topic](https://github.com/kwhitley/itty-router/discussions/new/choose)
2. [Discuss on Discord](https://discord.com/channels/832353585802903572)

Expand Down
11 changes: 8 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
### Description

Please explain the changes you made here.

### Issue Related
- Link to the related issue:

- Link to the related issue:

### Type of Change (select one and follow subtasks)

- [ ] Maintenance or repo-level work (e.g. linting, build, tests, refactoring, etc.)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Is this a mainstream benefit or an edge case?
- [ ] Is it worth the bytes?
- [ ] Breaking change (fix or feature that would cause existing functionality/userland code to not work as expected)
- [ ] Explain why a breaking change is necessary:
- [ ] Explain why a breaking change is necessary:
- [ ] This change requires (or is) a documentation update
- [ ] I have added necessary local documentation (if appropriate)
- [ ] I have added necessary [itty.dev](https://github.com/kwhitley/itty.dev) documentation (if appropriate)

### Testing
### Testing

Please describe the tests that you ran to verify your changes.

### Checklist

- [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) doc
26 changes: 12 additions & 14 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
on: ["push", "pull_request"]
on: ['push', 'pull_request']

name: Coveralls

jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- uses: actions/checkout@v1

- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: npm install, npm run coverage
run: |
npm install
npm run coverage
- name: npm install, npm run coverage
run: |
npm install
npm run coverage
- name: Coveralls
uses: coverallsapp/github-action@v2
- name: Coveralls
uses: coverallsapp/github-action@v2
5 changes: 2 additions & 3 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ name: build

on:
push:
branches: [ v4.x ]
branches: [v4.x]
pull_request:
branches: [ v4.x ]
branches: [v4.x]

jobs:
build:

runs-on: ubuntu-latest

steps:
Expand Down
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
trailingComma: 'es5'
tabWidth: 2
semi: false
singleQuote: true
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
- **v4.0.00** - Partial changelog below
- BREAKING: heavy TS rewrite for core Router (thank you, ChatGPT)
- added: nearly all extras from itty-router-extras
- added: createCors from itty-cors
- added: createCors from itty-cors
- added: complete documentation at https://itty.dev
- feature: withParams may be used as upstream middleware (hooray!)
- feature: withParams may be used as upstream middleware (hooray!)
- **v3.0.11** - changed environment build to rollup (from tsup) and code golfed the toQuery logic. (credit [@DrLoopFall](https://github.com/DrLoopFall))
- **v3.0.9** - fixes some TS issue, previously requiring you to define Router Methods to chain request definitions. (credit [@jahands](https://github.com/jahands))
- **v3.0.0** - total TS conversion with improved types, adding greedy params (credit [@markusahlstrand](https://github.com/markusahlstrand))
Expand All @@ -20,7 +20,7 @@
- **v2.4.9** - fixed the cursed "optional" file format capturing bug - RIP all the bytes lost
- **v2.4.6** - fixed README issues
- **v2.4.1** - fixed type errors introduced with 2.4.0
- **v2.4.0** - HUGE internal code-golfing refactor thanks to [@taralx](https://github.com/taralx)! Super cool work on this!!!
- **v2.4.0** - HUGE internal code-golfing refactor thanks to [@taralx](https://github.com/taralx)! Super cool work on this!!!
- **v2.3.10** - fix: dots now properly escaped (e.g. /image.jpg should not match /imageXjpg)
- **v2.3.9** - dev fixes: [@taralx](https://github.com/taralx) improved QOL issues for test writers and dev installers
- **v2.3.7** - fix: :id.:format not resolving (only conditional format would match)
Expand All @@ -43,6 +43,6 @@
- **v1.0.0** - production release, stamped into gold from x0.9.7
- **v0.9.0** - added support for multiple handlers (middleware)
- **v0.8.0** - deep minification pass and build steps for final module
- **v0.7.0** - removed { path } from request handler context, travis build fixed, added coveralls, improved README docs
- **v0.7.0** - removed { path } from request handler context, travis build fixed, added coveralls, improved README docs
- **v0.6.0** - added types to project for vscode intellisense (thanks [@mvasigh](https://github.com/mvasigh))
- **v0.5.4** - fix: wildcard routes properly supported
22 changes: 11 additions & 11 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
- Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand Down Expand Up @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

The [Open Source Guides](https://opensource.guide/) website has a collection of resources for individuals, communities, and companies. These resources help people who want to learn how to run and contribute to open source projects. Contributors and people new to open source alike will find the following guides especially useful:

* [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
* [Building Welcoming Communities](https://opensource.guide/building-community/)
- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
- [Building Welcoming Communities](https://opensource.guide/building-community/)

## Bugs

Expand Down
Loading

0 comments on commit 65432fc

Please sign in to comment.