Skip to content

Commit cbeb8be

Browse files
committed
feat: first version
0 parents  commit cbeb8be

20 files changed

+7669
-0
lines changed

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
indent_style = space
6+
indent_size = 4
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

.eslintrc.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": [
3+
"./node_modules/@lottojs/eslint-config/node"
4+
]
5+
}

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@lottojs/magic-team
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
name: "Bug Report"
3+
about: "Report an issue to help the project improve."
4+
title: "[BUG] "
5+
labels: "Type: [BUG]"
6+
assignees: harbspedro
7+
---
8+
9+
# **Bug Report**
10+
11+
**Version:**
12+
<!-- Version of the package that you are having the problem. -->
13+
14+
**Environment:**
15+
- **Operating system**:
16+
- **browser**:
17+
- **Nodejs**:
18+
- **npm**:
19+
<!-- use all the applicable bulleted list elements for this specific issue,
20+
and remove all the bulleted list elements that are not relevant for this issue. -->
21+
22+
**Expected result:**
23+
<!-- A clear and concise description of what you expected to happen. -->
24+
25+
**Actual result:**
26+
<!-- A clear and concise description of what the bug is. -->
27+
28+
**Steps to reproduce:**
29+
<!-- Steps to reproduce the error:
30+
(e.g.:)
31+
1. Use x argument / navigate to
32+
2. Fill this information
33+
3. Go to...
34+
4. See error -->
35+
36+
<!-- Write the steps here (add or remove as many steps as needed)-->
37+
38+
39+
1.
40+
2.
41+
3.
42+
43+
**Aditional Context:**
44+
<!-- Add any other context or additional information about the problem here.-->
45+
46+
*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: "Feature Request"
3+
about: "Suggest an idea or possible new feature for this project."
4+
title: "[FEATURE] "
5+
labels: "Type: [FEATURE]"
6+
assignees: harbspedro
7+
---
8+
9+
# **Feature Request**
10+
11+
## **Is your feature request related to a problem? Please describe.**
12+
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
13+
14+
*
15+
16+
---
17+
18+
## **Describe the solution you'd like**
19+
<!-- A clear and concise description of what you want to happen. -->
20+
21+
*
22+
23+
---
24+
25+
## **Describe alternatives you've considered**
26+
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
27+
28+
*
29+
30+
---
31+
32+
### **Additional context**
33+
<!-- Add any other context or additional information about the problem here.-->
34+
35+
*

.github/ISSUE_TEMPLATE/3-question.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: "Question"
3+
about: "Questions and requests for support."
4+
title: "[QUESTION] "
5+
labels: "Type: [QUESTION]"
6+
assignees: harbspedro
7+
---
8+
9+
10+
# **Question or Support Request**
11+
12+
## **Describe your question or ask for support.**
13+
<!-- A clear and concise description of what your doubt is. -->
14+
15+
*

.github/PULL_REQUEST_TEMPLATE.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#### Type:
2+
<!-- Please select the type -->
3+
4+
* [ ] Feature
5+
* [ ] Bugfix
6+
* [ ] Refactor
7+
* [ ] Documentation Update
8+
9+
#### Is Critical:
10+
<!-- Is a critical PR, like a bug on a principal feature? -->
11+
12+
- [ ] YES
13+
- [ ] NO
14+
15+
#### Motivation:
16+
<!-- Describe the motivation to raise this PR -->
17+
18+
#### Proposed Changes:
19+
<!-- Describe in topics your changes, feel free to ad as much as you want or also remove. -->
20+
21+
*
22+
*
23+
*
24+
25+
#### How has it been tested?
26+
<!-- Describe as much as possible how it was tested. -->
27+
28+
*
29+
30+
#### Other relavant informations?
31+
<!-- Describe here all informations that doesn't fit in the other fields if there are. -->

.github/logo.png

30.4 KB
Loading

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
/lib

.husky/commit-msg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
.git/hooks/commit-msg $1

.husky/pre-commit

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx validate-branch-name
5+
npx lint-staged
6+
git add -A .

CONTRIBUTING.md

+173
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
# Contributing
2+
3+
We welcome and encourage community contributions to our projects. This document
4+
specifies the guidelines for contributing to the projects that are created under
5+
the **lottojs** organization. We've split this document in smaller sections:
6+
7+
- [Feature Requests](#feature-requests)
8+
- [Questions](#questions)
9+
- [Issues](#issues)
10+
- [Outline of a good bug report](#outline-of-a-good-bug-report)
11+
- [Labels](#labels)
12+
- [Code](#code)
13+
- [Commits](#commits)
14+
- [Branch Naming](#branch-naming)
15+
- [Code of Conduct](#code-of-conduct)
16+
17+
There are always many ways you can help out this project besides contributing
18+
to the code:
19+
20+
- Writing and improving our documentation.
21+
- Searching for potential memory leaks, event loops blocks and de-optimized code.
22+
- Filing bugs.
23+
24+
And that list goes on and on. No matter what you choose we are thankful for your interest and for the fact that you want to contribute to our projects. They are build and maintained with love and we hope to share some of that love with you.
25+
26+
## Feature Requests
27+
28+
Yes! Make them! We would love to hear your idea(s) and what we can do to continue to move this project forward. Changes, big or small, are always welcomed. If the feature requested is not in line with our roadmap we will work with you to ensure that you can build it yourself on top of our project.
29+
30+
## Questions
31+
32+
When you're first starting out, you're bound to have questions about this project. We hope that our documentation at [lottojs.tech](https://lottojs.tech) provides answers to all your questions. In rare cases when the documentation does not answer your question you could:
33+
34+
1. Create an issue on GitHub thoroughly explaining your issue. The more information you provide us with, the better we can help you.
35+
36+
We will do our best to answer your questions in a timely manner. Please note that if you create a new issue and put everything in the title with no explanation in the body, it will be closed and locked immediately and you'll be prompted to follow the instructions contained in this file.
37+
38+
## Issues
39+
40+
Before creating an issue make sure that you are using the latest version of the module as the issue you report could be already resolved. If you are using the latest version please use the Github search feature to check if the issue is already known. If you've found an issue that is:
41+
42+
- **closed:** Check if the issue provides a solution for your issue. If it's already fixed using a commit it could be that there have been a regression in the code. In this case it's best to open a new issue. For all other cases it might make more sense to just add comment to the closed issue explaining that you're still affected by this.
43+
- **open:** Try to provide more details to the issue. If you can reproduce the issue in a different way than the one used by the original author, please add this. The more ways we have to reproduce the bug, the more are the chances to get it fixed fast.
44+
- **missing:** Please open a new issue, we would love to hear more about it.
45+
46+
### Outline of a good bug report
47+
48+
When reporting new issues for the project please use the following issue template so you know what kind of data you need to supply and we can resolve it as quickly as possible. If some of these fields do not apply to your issue feel free to leave them empty or remove them completely:
49+
50+
```
51+
**Version:**
52+
53+
**Environment:**
54+
- **Operating system**:
55+
- **browser**:
56+
- **Nodejs**:
57+
- **npm**:
58+
59+
**Expected result:**
60+
61+
**Actual result:**
62+
63+
**Steps to reproduce:**
64+
65+
1. Step 1.
66+
2. Step 2.
67+
3. Things are broken.
68+
69+
**Aditional Context:**
70+
```
71+
72+
Here is a small explanation of the fields and what kind of information could be present in them.
73+
74+
- **Version:** The version number of the module that you're currently using. If you don't know the current version number you can check it by running `npm ls` in your terminal.
75+
- **Environment:** This allows us to narrow down the issue to a potential platform or version if we cannot reproduce it on our own machines. If you don't know your npm and node.js version you can run `npm version` in your terminal and it will output all the information you need. If you are reporting a node.js specific bug you can omit the browser field unless it requires a browser to reproduce it.
76+
- **Expected result:** What did you expect would happen.
77+
- **Actual result:** What actually happened when you executed the code.
78+
- **Steps to reproduce:** Every step to fully reproduce the issue is described here, no matter how small. You cannot be specific enough. It's better to have too much details than too few here.
79+
80+
A complete example of this would be:
81+
82+
```
83+
Version: 0.1.2
84+
Environment:
85+
- Operating System: macOS Ventura 13.5.1 (22G90)
86+
- Node:18.15.0
87+
- npm: 9.5.0
88+
89+
Expected result: A `console.log` message in the terminal.
90+
91+
Actual result: An empty console without any log messages.
92+
93+
Steps to reproduce:
94+
95+
// Piece of Code here.
96+
97+
1. Copy the code I provided.
98+
2. runs: `node your_file_name.js`.
99+
3. Press enter to execute the code.
100+
```
101+
102+
When adding code to your example please use [code fencing][fencing] to ensure
103+
that your snippet is highlighted correctly. This greatly improves the
104+
readability of the issue.
105+
106+
### Labels
107+
108+
We try to label all created issues to facilitate the identification of the issue scope.
109+
110+
The labels are:
111+
112+
- [BUG]
113+
- [FEATURE]
114+
- [QUESTION]
115+
116+
## Code
117+
118+
Unless you are fixing a known bug we **strongly** encourage to discuss your feature with the core team via a GitHub issue. Before getting started ensure that your work will not be rejected.
119+
120+
All contributions must be made via pull requests. After a pull request is made other contributors will either provide feedback or merge it directly depending on:
121+
122+
- Addition of new tests and passing of the test suite.
123+
- Code coverage.
124+
- The severity of the bug that the code is addressing.
125+
- The overall quality of patch.
126+
127+
We expect that every bug fix comes with new tests for our test suite. This is important to prevent regression in the future as our current set of tests did not trigger the code path.
128+
129+
### Commits
130+
131+
We follow the Conventional Commits specification, so please try to follow it as much as you can to don't have your pull request declined.
132+
133+
**Examples**:
134+
135+
- Commit implementing a new feature:
136+
- `feat: implements /users/:id route`
137+
- Commit message documents update:
138+
- `docs: updates README.md`
139+
- Commit doing a fix:
140+
- `fix: fixing problem with status code on route ...`
141+
142+
And so on, see more at [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
143+
144+
145+
### Branch Naming
146+
147+
Make sure when contributing to follow our branch namming pattern.
148+
149+
We have some prefixes and you can take a look here:
150+
151+
- **Bugfix**: fix/work_you_are_doing
152+
- **Feature**: feat/work_you_are_doing
153+
- **Improvement**: imp/work_you_are_doing
154+
- **Tests**: test/work_you_are_doing
155+
156+
**Examples:**
157+
158+
- Fixing something: `fix/broken_middlewares`
159+
- New Feature: `feat/cors_middleware`
160+
- Improvement: `imp/lotto_core`
161+
- Adding tests: `test/router`
162+
163+
## Code of Conduct
164+
165+
- We are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, disability, ethnicity, religion, or similar personal characteristic.
166+
- Please be kind and courteous. There's no need to be mean or rude.
167+
- Respect that people have differences of opinion and that every design or implementation choice carries a trade-off and numerous costs. There is seldom a right answer.
168+
- Please keep unstructured critique to a minimum. If you have solid ideas you want to experiment with, make a fork and see how it works.
169+
- We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behaviour.
170+
- Private harassment is also unacceptable. No matter who you are, if you feel you have been or are being harassed or made uncomfortable by a community member, please contact us.
171+
- Likewise any spamming, trolling, flaming, baiting or other attention-stealing behaviour is not welcome.
172+
173+
[fencing]: https://help.github.com/articles/github-flavored-markdown/#fenced-code-blocks

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 lottojs
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)