-
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.
chore: initial project structure [part 1/5] (#1)
* chore: added initial yarn + typescript structure * chore: added hathor-rpc-handler * chore: update flake inputs * chore: added github PR templates * chore: added tsconfig and eslint.config * chore: opt-out of yarn's PnP * chore: removed release candidate and release PR templates * chore: using yarn-berry from nix stable * chore: stop ignoring eslint config * chore: removed gitattributes * chore: ignoring all of .yarn * refactor: added hathor header
- Loading branch information
1 parent
d34cf65
commit f0d2dd5
Showing
14 changed files
with
1,459 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,10 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
|
||
[*.{js,json,yml}] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 |
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,7 @@ | ||
if [[ $(type -t use_flake) != function ]]; then | ||
echo "ERROR: use_flake function missing." | ||
echo "Please update direnv to v2.30.0 or later." | ||
exit 1 | ||
fi | ||
|
||
use flake |
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,3 @@ | ||
Please go the the `Preview` tab and select the appropriate Pull Request template: | ||
|
||
* [Feature Branch](?expand=1&template=feature_branch_pr_template.md) - Use this PR template when you are merging a feature branch into `master` |
12 changes: 12 additions & 0 deletions
12
.github/PULL_REQUEST_TEMPLATE/feature_branch_pr_template.md
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,12 @@ | ||
### Motivation | ||
|
||
What was the motivation for the changes in this PR? | ||
|
||
### Acceptance Criteria | ||
|
||
- Include here all things that this PR should solve | ||
|
||
### Checklist | ||
- [ ] If you are requesting a merge into `master`, confirm this code is production-ready and can be included in future releases as soon as it gets merged | ||
- [ ] Make sure either the unit tests and/or the QA tests are capable of testing the new features | ||
- [ ] Make sure you do not include new dependencies in the project unless strictly necessary and do not include dev-dependencies as production ones. More dependencies increase the possibility of one of them being hijacked and affecting us. |
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,4 @@ | ||
.yarn/* | ||
node_modules/ | ||
.pnp.* | ||
.direnv/ |
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 @@ | ||
nodeLinker: node-modules |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,40 @@ | ||
{ | ||
description = "virtual environments"; | ||
|
||
inputs = { | ||
devshell.url = "github:numtide/devshell"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
|
||
outputs = { self, flake-utils, devshell, nixpkgs, ... }@inputs: | ||
let | ||
overlays.default = final: prev: | ||
let | ||
packages = self.packages.${final.system}; | ||
inherit (packages) node-packages; | ||
in | ||
{ | ||
nodejs = final.nodejs_20; | ||
nodePackages = prev.nodePackages; | ||
}; | ||
in | ||
flake-utils.lib.eachDefaultSystem (system: { | ||
devShell = | ||
let pkgs = import nixpkgs { | ||
inherit system; | ||
|
||
overlays = [ | ||
devshell.overlays.default | ||
overlays.default | ||
]; | ||
}; | ||
in | ||
pkgs.devshell.mkShell { | ||
packages = with pkgs; [ | ||
nixpkgs-fmt | ||
nodejs_20 | ||
yarn-berry | ||
]; | ||
}; | ||
}); | ||
} |
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,8 @@ | ||
{ | ||
"name": "hathor-rpc-lib", | ||
"private": true, | ||
"packageManager": "[email protected]", | ||
"workspaces": [ | ||
"packages/hathor-rpc-handler" | ||
] | ||
} |
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,14 @@ | ||
// @ts-check | ||
|
||
import eslint from '@eslint/js'; | ||
import tseslint from 'typescript-eslint'; | ||
|
||
export default tseslint.config( | ||
eslint.configs.recommended, | ||
...tseslint.configs.recommended, | ||
{ | ||
ignores: [ | ||
'dist/**/*.js', | ||
], | ||
} | ||
) |
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,28 @@ | ||
{ | ||
"name": "hathor-rpc-handler", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"type": "module", | ||
"typings": "dist/index.d.ts", | ||
"files": [ | ||
"dist", | ||
"src" | ||
], | ||
"engines": { | ||
"node": ">=20" | ||
}, | ||
"scripts": { | ||
"lint": "eslint .", | ||
"build": "tsc", | ||
"watch": "tsc -w" | ||
}, | ||
"author": "André Abadesso", | ||
"devDependencies": { | ||
"@eslint/js": "9.4.0", | ||
"@types/eslint__js": "8.42.3", | ||
"@types/node": "20.14.2", | ||
"eslint": "9.4.0", | ||
"typescript": "5.4.5", | ||
"typescript-eslint": "7.13.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,9 @@ | ||
/** | ||
* Copyright (c) Hathor Labs and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
export default () => { | ||
}; |
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,18 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2022", | ||
"module": "CommonJS", | ||
"sourceMap": true, | ||
"strict": true, | ||
"esModuleInterop": true, | ||
"skipLibCheck": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"outDir": "./dist", | ||
"types": ["node"] | ||
}, | ||
"exclude": [ | ||
"node_modules", | ||
"dist" | ||
] | ||
} | ||
|
Oops, something went wrong.