-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from ably-labs/add-formatting
Add formatting
- Loading branch information
Showing
14 changed files
with
4,467 additions
and
150 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,12 @@ | ||
# http://EditorConfig.org | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
charset = utf-8 | ||
|
||
[*.{js,ts,.ts.d}] | ||
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,3 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
} |
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: Format Check | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
format-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js 20.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 20.x | ||
- run: npm ci | ||
- run: npm run lint | ||
- run: npm run format:check |
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 |
---|---|---|
|
@@ -18,7 +18,6 @@ | |
# misc | ||
.DS_Store | ||
.env | ||
package-lock.json | ||
|
||
# debug | ||
npm-debug.log* | ||
|
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 @@ | ||
{ | ||
"trailingComma": "all", | ||
"tabWidth": 2, | ||
"semi": true, | ||
"singleQuote": true, | ||
"printWidth": 120 | ||
} |
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,9 +1,9 @@ | ||
import Ably from "ably/promises"; | ||
import Ably from 'ably/promises'; | ||
|
||
export async function GET(request) { | ||
const client = new Ably.Realtime(process.env.ABLY_API_KEY); | ||
const tokenRequestData = await client.auth.createTokenRequest({ clientId: 'ably-nextjs-demo' }); | ||
const client = new Ably.Realtime(process.env.ABLY_API_KEY); | ||
const tokenRequestData = await client.auth.createTokenRequest({ clientId: 'ably-nextjs-demo' }); | ||
|
||
console.log(`Request: ${JSON.stringify(tokenRequestData)}`) | ||
return Response.json(tokenRequestData); | ||
console.log(`Request: ${JSON.stringify(tokenRequestData)}`); | ||
return Response.json(tokenRequestData); | ||
} |
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,14 +1,14 @@ | ||
import './global.css' | ||
import './global.css'; | ||
|
||
export const metadata = { | ||
title: 'Next.js', | ||
description: 'Generated by Next.js', | ||
} | ||
}; | ||
|
||
export default function RootLayout({ children }) { | ||
return ( | ||
return ( | ||
<html lang="en"> | ||
<body>{children}</body> | ||
</html> | ||
) | ||
); | ||
} |
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,15 @@ | ||
'use client' | ||
'use client'; | ||
|
||
import * as Ably from 'ably' | ||
import { AblyProvider } from 'ably/react' | ||
import ChatBox from './ChatBox.jsx' | ||
import * as Ably from 'ably'; | ||
import { AblyProvider } from 'ably/react'; | ||
import ChatBox from './ChatBox.jsx'; | ||
|
||
export default function Chat() { | ||
|
||
const client = Ably.Realtime.Promise({ authUrl: '/api' }) | ||
const client = Ably.Realtime.Promise({ authUrl: '/api' }); | ||
|
||
return ( | ||
<AblyProvider client={ client }> | ||
<AblyProvider client={client}> | ||
<ChatBox /> | ||
</AblyProvider> | ||
) | ||
} | ||
); | ||
} |
Oops, something went wrong.