-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add prettier, lint, workflows and fixes for API
- Loading branch information
1 parent
1aa7b1d
commit a5bde49
Showing
183 changed files
with
4,060 additions
and
2,305 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 |
---|---|---|
|
@@ -6,4 +6,4 @@ module.exports = { | |
parserOptions: { | ||
project: false, | ||
}, | ||
} | ||
}; |
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
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
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,58 @@ | ||
name: JS Checks | ||
|
||
on: | ||
pull_request: | ||
push: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-shared: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Dependencies | ||
run: npm install --workspaces --include-workspace-root | ||
|
||
- name: Build Shared Package | ||
run: npm run build --workspaces --include-workspace-root | ||
|
||
- name: Save Build Output | ||
run: tar -czf shared-build.tar.gz packages/shared/dist | ||
|
||
- name: Upload Build Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: shared-build | ||
path: shared-build.tar.gz | ||
|
||
prepare-environment: | ||
needs: build-shared | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Download Shared Build | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: shared-build | ||
|
||
- name: Create Directory for Shared Build | ||
run: mkdir -p packages/shared/dist | ||
|
||
- name: Extract Shared Build | ||
run: tar -xzf shared-build.tar.gz -C packages/shared/dist | ||
|
||
- name: Install Dependencies | ||
run: npm install --workspaces --include-workspace-root | ||
|
||
js-checks: | ||
needs: prepare-environment | ||
uses: hemilabs/actions/.github/workflows/js-checks.yml@main | ||
with: | ||
node-versions: '["16", "18", "20", "22"]' |
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 |
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
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,16 +1,21 @@ | ||
# Coding Challenge Submission <br><br> | ||
|
||
## Description | ||
|
||
Describe your project here | ||
|
||
## Prerequisites, Dependencies, Versions | ||
|
||
Please add anything here you've built that requires the above specifics | ||
|
||
## Licensing | ||
|
||
Please state if license is CC, MIT or ISC or other (please no GPL) | ||
|
||
## Outside Libraries | ||
|
||
Link any outside open source libraries used | ||
|
||
## Steps | ||
|
||
Tell us how to run it locally |
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
This file was deleted.
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,26 @@ | ||
{ | ||
"extends": ["bloq", "prettier"], | ||
"ignorePatterns": ["dist", "_esm/*", "_cjs/*", "_types/*"], | ||
"overrides": [ | ||
{ | ||
"extends": ["bloq/typescript", "prettier"], | ||
"files": ["src/**/*.ts"] | ||
}, | ||
{ | ||
"extends": ["bloq/markdown"], | ||
"files": ["*.md"] | ||
}, | ||
{ | ||
"extends": ["bloq/vitest", "prettier"], | ||
"files": ["*.spec.{js,ts}"] | ||
} | ||
], | ||
"parserOptions": { | ||
"sourceType": "module" | ||
}, | ||
"root": true, | ||
"rules": { | ||
"arrow-body-style": "off", | ||
"no-console": "off" | ||
} | ||
} |
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 @@ | ||
{ | ||
"arrowParens": "avoid", | ||
"quoteProps": "consistent", | ||
"semi": false, | ||
"singleQuote": true, | ||
"tabWidth": 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
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
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,12 +1,12 @@ | ||
import WebSocket, { WebSocketServer } from 'ws'; | ||
import { L2Block } from '@cryptochords/shared'; | ||
import WebSocket, { WebSocketServer } from 'ws' | ||
import { L2Block } from '@cryptochords/shared' | ||
|
||
const BroadcastToClients = (wss: WebSocketServer, l2Block: L2Block): void => { | ||
const broadcastToClients = (wss: WebSocketServer, l2Block: L2Block): void => { | ||
wss.clients.forEach((client: WebSocket) => { | ||
if (client.readyState === WebSocket.OPEN) { | ||
client.send(JSON.stringify(l2Block.toJSON())); | ||
client.send(JSON.stringify(l2Block.toJSON())) | ||
} | ||
}); | ||
}; | ||
}) | ||
} | ||
|
||
export default BroadcastToClients | ||
export default broadcastToClients |
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
Oops, something went wrong.