-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft: Refactoring the whole app #7
Open
fabien-renaud
wants to merge
7
commits into
chris-mcdonald-dev:development
Choose a base branch
from
fabien-renaud:feature/refactoring
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ff7517d
Add development tools
fabien-renaud be103d4
Add core and messages
fabien-renaud b3416c6
core and messages documentation
fabien-renaud bf923c0
Fix PR comments
fabien-renaud 848c4b8
Fix 2 lines comments
fabien-renaud 0e3a48e
Rename npm validate scripts
fabien-renaud 618afd4
Fix dotenv loading
fabien-renaud File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,6 @@ | ||
/src/messages | ||
/src/modules | ||
/src/scripts | ||
/src/tasks | ||
/src/utils | ||
/src/index.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,13 @@ | ||
{ | ||
"extends": ["node", "prettier"], | ||
"plugins": ["prettier"], | ||
"settings": { | ||
"import/resolver": { | ||
"node": {"extensions": [".js"]} | ||
} | ||
}, | ||
"rules": { | ||
"import/prefer-default-export": "off", | ||
"prettier/prettier": ["error"] | ||
} | ||
} |
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
.env | ||
.idea | ||
*.bat | ||
/lib | ||
/node_modules | ||
package-lock.json | ||
lib |
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,6 @@ | ||
{ | ||
"hooks": { | ||
"pre-commit": "npm run test", | ||
"pre-push": "npm run test" | ||
} | ||
} | ||
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,6 @@ | ||
/src/messages | ||
/src/modules | ||
/src/scripts | ||
/src/tasks | ||
/src/utils | ||
/src/index.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,18 @@ | ||
{ | ||
"printWidth": 120, | ||
"tabWidth": 4, | ||
"useTabs": false, | ||
"semi": true, | ||
"singleQuote": true, | ||
"quoteProps": "as-needed", | ||
"jsxSingleQuote": true, | ||
"trailingComma": "none", | ||
"bracketSpacing": false, | ||
"jsxBracketSameLine": true, | ||
"arrowParens": "always", | ||
"requirePragma": false, | ||
"insertPragma": false, | ||
"proseWrap": "preserve", | ||
"htmlWhitespaceSensitivity": "ignore", | ||
"endOfLine": "auto" | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be better to put these checks in a workflow file and prevent merge instead of enforcing it on pre-commit since anybody can disable their pre-commit locally and push
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know about GitHub workflow, so I guess I will just leave it to you! I see GitHub hooks as a reminder for the developers to not push or merge broken code, but you're right saying that you can just skip Git hooks. We can remove this feature if it doesn't make senses for you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you create a
.yml
file in .github/workflows/ with these contents it should pick it up as a job when you next push:Alternatively (the better solution, imo):
which integrates with GitHub but we'd need to add a GitHub token into the secrets first and also add the .github directory into the .eslintignore and .prettierignore files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Github Secrets aren't a problem. And there's no point adding
.github
directory on the.eslintignore
and.prettierignore
, since we're only running linter on thesrc
folder.I think we can integrate both git hooks and github workflow: git hooks allows you to automatically validate your code before comiting and pushing your branch, then github workflow force a validation before merging your branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep! Adding the secret is easy, it should just be done before pushing the workflow file (otherwise it'll fail the check)
Maybe, but I'm not sure about it since it would add a redundant dependency on husky, it isn't a particularly large package but if possible we should try to minimise package bloat whenever we can