forked from crypto-org-chain/chain-jslib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: (Fix #1) Missing project setup
Solution: Setup TypeScript projects with GitHub actions
- Loading branch information
1 parent
b6d4df6
commit f1fb78d
Showing
16 changed files
with
2,422 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
lib/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"extends": ["airbnb-base", "prettier"], | ||
"plugins": ["@typescript-eslint", "prettier"], | ||
"parser": "@typescript-eslint/parser", | ||
"settings": { | ||
// https://github.com/benmosher/eslint-plugin-import/issues/1615 | ||
"import/resolver": { | ||
"node": { | ||
"extensions": [".js", ".ts", ".json"] | ||
} | ||
} | ||
}, | ||
"rules": { | ||
"prettier/prettier": "error", | ||
"import/no-extraneous-dependencies": [ | ||
"error", | ||
{ | ||
"devDependencies": true | ||
} | ||
], | ||
"import/prefer-default-export": "off", | ||
"no-unused-vars": "off", | ||
"@typescript-eslint/no-unused-vars": "error", | ||
// https://github.com/benmosher/eslint-plugin-import/issues/1615 | ||
"import/extensions": [ | ||
"error", | ||
"ignorePackages", | ||
{ | ||
"js": "never", | ||
"mjs": "never", | ||
"ts": "never" | ||
} | ||
] | ||
}, | ||
"env": { | ||
"mocha": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @calvinaco @foreseaz @cdc-Hitesh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**please complete the following information** | ||
- OS: [e.g. Windows] | ||
- npm version [`npm -v`] | ||
- Node.js version [`node -v`] | ||
- Version [can be found in `package.json`] | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Build | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/cache@v2 | ||
id: cache-deps | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node12-${{ hashFiles('**/package-lock.json') }} | ||
|
||
- name: lint | ||
run: | | ||
npm install | ||
npm run lint | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/cache@v2 | ||
id: cache-deps | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node12-${{ hashFiles('**/package-lock.json') }} | ||
|
||
- name: build | ||
run: | | ||
npm install | ||
npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Dependency directories | ||
node_modules/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
.vscode-test | ||
|
||
# yarn v2 | ||
.yarn/cache | ||
.yarn/unplugged | ||
.yarn/build-state.yml | ||
.yarn/install-state.gz | ||
.pnp.* | ||
|
||
# library build folder | ||
lib/dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"printWidth": 120, | ||
"tabWidth": 4, | ||
"semi": true, | ||
"singleQuote": true, | ||
"quoteProps": "as-needed", | ||
"trailingComma": "all", | ||
"bracketSpacing": true, | ||
"arrowParens": "always", | ||
"endOfLine": "lf" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Code of Conduct | ||
|
||
## Conduct | ||
### Contact: [email protected] | ||
|
||
* We are committed to providing a friendly, safe and welcoming environment for all, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other similar characteristic. | ||
|
||
* On communication channels, please avoid using overtly sexual nicknames or other nicknames that might detract from a friendly, safe and welcoming environment for all. | ||
|
||
* Please be kind and courteous. There’s no need to be mean or rude. | ||
|
||
* 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. | ||
|
||
* 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. | ||
|
||
* We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behaviour. We interpret the term “harassment” as including the definition in the [Citizen Code of Conduct](http://citizencodeofconduct.org/); if you have any lack of clarity about what might be included in that concept, please read their definition. In particular, we don’t tolerate behavior that excludes people in socially marginalized groups. | ||
|
||
* 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 one of the communication channel admins or the email mentioned above immediately. Whether you’re a regular contributor or a newcomer, we care about making this community a safe place for you and we’ve got your back. | ||
|
||
* Likewise any spamming, trolling, flaming, baiting or other attention-stealing behaviour is not welcome. | ||
|
||
|
||
---- | ||
|
||
|
||
## Moderation | ||
These are the policies for upholding our community’s standards of conduct. If you feel that a thread needs moderation, please contact the above mentioned person. | ||
|
||
1. Remarks that violate the Crypto.com Chain standards of conduct, including hateful, hurtful, oppressive, or exclusionary remarks, are not allowed. (Cursing is allowed, but never targeting another user, and never in a hateful manner.) | ||
|
||
2. Remarks that moderators find inappropriate, whether listed in the code of conduct or not, are also not allowed. | ||
|
||
3. Moderators will first respond to such remarks with a warning. | ||
|
||
4. If the warning is unheeded, the user will be “kicked,” i.e., kicked out of the communication channel to cool off. | ||
|
||
5. If the user comes back and continues to make trouble, they will be banned, i.e., indefinitely excluded. | ||
|
||
6. Moderators may choose at their discretion to un-ban the user if it was a first offense and they offer the offended party a genuine apology. | ||
|
||
7. If a moderator bans someone and you think it was unjustified, please take it up with that moderator, or with a different moderator, in private. Complaints about bans in-channel are not allowed. | ||
|
||
8. Moderators are held to a higher standard than other community members. If a moderator creates an inappropriate situation, they should expect less leeway than others. | ||
|
||
In the Crypto.com Chain developer community we strive to go the extra step to look out for each other. Don’t just aim to be technically unimpeachable, try to be your best self. In particular, avoid flirting with offensive or sensitive issues, particularly if they’re off-topic; this all too often leads to unnecessary fights, hurt feelings, and damaged trust; worse, it can drive people away from the community entirely. | ||
|
||
And if someone takes issue with something you said or did, resist the urge to be defensive. Just stop doing what it was they complained about and apologize. Even if you feel you were misinterpreted or unfairly accused, chances are good there was something you could’ve communicated better — remember that it’s your responsibility to make your fellow Crypto.com Chain developer community members comfortable. Everyone wants to get along and we are all here first and foremost because we want to talk about cool technology. You will find that people will be eager to assume good intent and forgive as long as you earn their trust. | ||
|
||
The enforcement policies listed above apply to all official Crypto.com Chain venues. For other projects adopting the Crypto.com Chain Code of Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion. | ||
|
||
* Adapted from the the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html), the [Node.js Policy on Trolling](http://blog.izs.me/post/30036893703/policy-on-trolling) as well as the [Contributor Covenant v1.3.0](http://contributor-covenant.org/version/1/3/0/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Contributing | ||
|
||
Thank you for your interest in contributing to Crypto.com Chain Node.js Library. We try to make the process of contribution easy for you. But still there are some guidelines we need you to follow. | ||
|
||
## Code of Conduct | ||
|
||
All contributors are expected to follow our [Code of Conduct](./CODE_OF_CONDUCT.md). | ||
|
||
## Feature Requests | ||
|
||
Feature requests are welcomed. You should post your request as [Github issues](https://github.com/crypto-com/chain-nodelib/issues/new) first. In an issue, please describe what your request is, the expected behaviour and how it will benefit you and/or other users. | ||
|
||
Crypto.com Chain and its surrounding products are under active development. We may not be able to respond to your feature request issue promptly. However, you are free to submit a pull request by following the guidelines and we are happy to review it. Please check the [Working of issues](#working-on-issues) section for more details. | ||
|
||
## Bug Reports | ||
|
||
Bug reports should be posted as [Github issues](https://github.com/crypto-com/chain-nodelib/issues/new). In an issue, please describe what you did, what you expected, and what happened instead. | ||
|
||
If you think that you have identified an issue that might compromise its users' security, please do not open a public issue on GitHub. Instead, we ask you to refer to [security policy](./SECURITY.md). | ||
|
||
## Working on issues | ||
|
||
We use the variation of the "fork and pull" model where contributors push changes to their personal fork and create pull requests to bring those changes into the source repository. | ||
|
||
Changes in pull requests should satisfy "Patch Requirements" described in [The Collective Code Construction Contract (C4)](https://rfc.zeromq.org/spec:42/C4/#23-patch-requirements). We have provided [ESLint Rules](./eslintrc.json) and Rustfmt and Clippy for standardizing our code style, so please make sure to use `npm run lint` before every commit (e.g. by configuring your editor to do it for you upon saving a file). The code comments should follow [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript#comments). | ||
|
||
Once you identified an issue to work on, this is the summary of your basic steps: | ||
|
||
* Fork the repository under your Github account. | ||
|
||
* Clone your fork locally on your machine. | ||
|
||
* Post a comment in the issue to say that you are working on it, so that other people do not work on the same issue. | ||
|
||
* Create a local branch on your machine by `git checkout -b branch_name`. | ||
|
||
* Commit your changes to your own fork -- see [C4 Patch Requirements](https://rfc.zeromq.org/spec:42/C4/#23-patch-requirements) for guidelines. | ||
|
||
* Include tests that cover all non-trivial code. | ||
|
||
* Check you are working on the latest version on master in the official repository. If not, please pull from official repository's master (upstream) into your fork's master branch, and rebase your committed changes or replay your stashed changes in your branch over the latest changes in the upstream version. | ||
|
||
* If your changes are of interest to other developers, please make corresponding changes in the official documentation and the changelog. | ||
|
||
* Push your changes to your fork's branch and open the pull request to Sample Chain Wallet repository master branch. | ||
|
||
* In the pull request, complete its checklist, add a clear description of the problem your changes solve, and add the following statement to confirm that your contribution is your own original work: "I hereby certify that my contribution is in accordance with the Developer Certificate of Origin (https://developercertificate.org/)." | ||
|
||
* The reviewer will either accept and merge your pull request, or leave comments requesting changes via the Github PR interface (you should then make changes by pushing directly to your existing PR branch). | ||
|
||
### Developer Certificate of Origin | ||
All contributions to this project are subject to the terms of the Developer Certificate of Origin, available [here](https://developercertificate.org/) and reproduced below: | ||
|
||
``` | ||
Developer Certificate of Origin | ||
Version 1.1 | ||
Copyright (C) 2004, 2006 The Linux Foundation and its contributors. | ||
1 Letterman Drive | ||
Suite D4700 | ||
San Francisco, CA, 94129 | ||
Everyone is permitted to copy and distribute verbatim copies of this | ||
license document, but changing it is not allowed. | ||
Developer's Certificate of Origin 1.1 | ||
By making a contribution to this project, I certify that: | ||
(a) The contribution was created in whole or in part by me and I | ||
have the right to submit it under the open source license | ||
indicated in the file; or | ||
(b) The contribution is based upon previous work that, to the best | ||
of my knowledge, is covered under an appropriate open source | ||
license and I have the right under that license to submit that | ||
work with modifications, whether created in whole or in part | ||
by me, under the same open source license (unless I am | ||
permitted to submit under a different license), as indicated | ||
in the file; or | ||
(c) The contribution was provided directly to me by some other | ||
person who certified (a), (b) or (c) and I have not modified | ||
it. | ||
(d) I understand and agree that this project and the contribution | ||
are public and that a record of the contribution (including all | ||
personal information I submit with it, including my sign-off) is | ||
maintained indefinitely and may be redistributed consistent with | ||
this project or the open source license(s) involved. | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
## Coordinated Vulnerability Disclosure Policy | ||
We ask security researchers to keep vulnerabilities and communications around vulnerability submissions private and confidential until a patch is developed to protect the people using Crypto.com’s protocols. In addition to this, we ask that you: | ||
|
||
- Allow us a reasonable amount of time to correct or address security vulnerabilities. | ||
- Avoid exploiting any vulnerabilities that you discover. | ||
- Demonstrate good faith by not disrupting or degrading Crypto.com’s data or services. | ||
|
||
## Vulnerability Disclosure Process | ||
Once we receive a vulnerability report, Crypto.com will take these steps to address it: | ||
|
||
1. Crypto.com will confirm receipt of the vulnerability report within 5 business days. The timing of our response may depend on when a report is submitted. As our daily operations are distributed in time zones across the globe, response times may vary. If you have not received a response to a vulnerability report from us within 5 business days, we encourage you to follow up with us again for a response. | ||
2. Crypto.com will investigate and validate the security issue submitted to us as quickly as we can, usually within 10 business days of receipt. Submitting a thorough report with clear steps to recreate the vulnerability and/or a proof-of-concept will move the process along in a timely manner. | ||
3. Crypto.com will acknowledge the bug, and make the necessary code changes to patch it. Some issues may require more time than others to patch, but we will strive to patch each vulnerability as quickly as our resources and development process allow. | ||
4. Crypto.com will publicly release the security patch for the vulnerability, and acknowledge the security fix in the release notes once the issue has been resolved. Public release notes can reference to the person or people who reported the vulnerability, unless they wish to stay anonymous. | ||
|
||
## Contact Us | ||
If you find a security issue, you can contact our team directly at [[email protected]](mailto:[email protected]). | ||
|
||
The following key can be used to communicate sensitive information to this email address: | ||
|
||
``` | ||
-----BEGIN PGP PUBLIC KEY BLOCK----- | ||
mDMEXUqLzhYJKwYBBAHaRw8BAQdAPBcxA1UIEZH+9lk1nyx9Lml6HC+N9gsoOHW4 | ||
QtRwLA60Q0NyeXB0by5jb20gQ2hhaW4gKENoYWluIFNlY3VyaXR5IGFsaWFzKSA8 | ||
Y2hhaW4tc2VjdXJpdHlAY3J5cHRvLmNvbT6IkAQTFggAOBYhBP4RUHmmU1JUI4bg | ||
lI/op3Om4R2lBQJdSovOAhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEI/o | ||
p3Om4R2lkFEA/iKjrYFvWuwVcAcsiLQC0Su9INXwrb6voGkXTtIkTOY8AP9rc1sW | ||
6LG0A/f5wqIQxauQCXohFF6dogSUHTghSN3FAbg4BF1Ki84SCisGAQQBl1UBBQEB | ||
B0Clox9gYNHHDdWoG7ASSnPL4XtQKd5Ic2BEBbL96AZueQMBCAeIeAQYFggAIBYh | ||
BP4RUHmmU1JUI4bglI/op3Om4R2lBQJdSovOAhsMAAoJEI/op3Om4R2lMbwA/1Ol | ||
PXOsTvkBEyITp4pitott/fYgbTbcf19vSpUAPOdZAP9TWqypvKnG3f0FwckJwMB+ | ||
lKMS+/mfuYvXWtrqOWN5AQ== | ||
=GZRl | ||
-----END PGP PUBLIC KEY BLOCK----- | ||
``` | ||
|
||
You can also contact `cryptocom` account on [Wire](https://wire.com/), its key fingerprint is: | ||
|
||
``` | ||
2009df951d8880a4f319c6bafb2da6376d5e5aeb927a5ef10b8074af8b9df8c8 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// eslint-disable-next-line no-console | ||
console.log('Hello world'); |
Oops, something went wrong.