Skip to content
This repository was archived by the owner on Jan 10, 2024. It is now read-only.

Commit 57feef8

Browse files
author
Jake Donham
committed
prettier setup
1 parent 4a37e8b commit 57feef8

19 files changed

+859
-392
lines changed

.github/blocks/folder/githubnext__blocks-examples__code-tour-block/.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
]
1919
}
2020
]
21-
}
21+
}

.github/workflows/azure.yml

+65-66
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,65 @@
1-
name: Deploy to Azure (githubnext-blocks-staging)
2-
3-
on:
4-
push:
5-
branches:
6-
- main
7-
workflow_dispatch:
8-
9-
jobs:
10-
deploy:
11-
runs-on: ubuntu-latest
12-
env:
13-
NEXT_PUBLIC_MARKETPLACE_URL: "https://blocks-marketplace.githubnext.com"
14-
steps:
15-
- uses: actions/checkout@v2
16-
17-
- name: Set up Node.js version
18-
uses: actions/setup-node@v1
19-
with:
20-
node-version: "16.x"
21-
22-
23-
- name: Get yarn cache directory path
24-
id: yarn-cache-dir-path
25-
run: echo "::set-output name=dir::$(yarn cache dir)"
26-
27-
- name: Cache yarn
28-
uses: actions/cache@v2
29-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
30-
with:
31-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
32-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
33-
restore-keys: |
34-
${{ runner.os }}-yarn-
35-
36-
- name: yarn install
37-
if: steps.cache-yarn.outputs.cache-hit != 'true'
38-
run: |
39-
yarn
40-
41-
- name: Cache next
42-
uses: actions/cache@v2
43-
id: cache-next
44-
with:
45-
path: ${{ github.workspace }}/.next/cache
46-
# Generate a new cache whenever packages or source files change.
47-
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
48-
# If source files changed but packages didn't, rebuild from a prior cache.
49-
restore-keys: |
50-
${{ runner.os }}-nextjs-${{ hashFiles('**/yarn-lock') }}-
51-
52-
- name: yarn build
53-
run: |
54-
yarn build
55-
56-
- name: package zip
57-
run: zip -r web.zip package.json .next node_modules/ public/
58-
59-
- name: "Deploy to Azure Web App"
60-
id: deploy-to-webapp
61-
uses: azure/webapps-deploy@v2
62-
with:
63-
app-name: "githubnext-blocks"
64-
slot-name: "staging"
65-
publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE }}
66-
package: web.zip
1+
name: Deploy to Azure (githubnext-blocks-staging)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
env:
13+
NEXT_PUBLIC_MARKETPLACE_URL: "https://blocks-marketplace.githubnext.com"
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Set up Node.js version
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: "16.x"
21+
22+
- name: Get yarn cache directory path
23+
id: yarn-cache-dir-path
24+
run: echo "::set-output name=dir::$(yarn cache dir)"
25+
26+
- name: Cache yarn
27+
uses: actions/cache@v2
28+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
29+
with:
30+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
31+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
32+
restore-keys: |
33+
${{ runner.os }}-yarn-
34+
35+
- name: yarn install
36+
if: steps.cache-yarn.outputs.cache-hit != 'true'
37+
run: |
38+
yarn
39+
40+
- name: Cache next
41+
uses: actions/cache@v2
42+
id: cache-next
43+
with:
44+
path: ${{ github.workspace }}/.next/cache
45+
# Generate a new cache whenever packages or source files change.
46+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
47+
# If source files changed but packages didn't, rebuild from a prior cache.
48+
restore-keys: |
49+
${{ runner.os }}-nextjs-${{ hashFiles('**/yarn-lock') }}-
50+
51+
- name: yarn build
52+
run: |
53+
yarn build
54+
55+
- name: package zip
56+
run: zip -r web.zip package.json .next node_modules/ public/
57+
58+
- name: "Deploy to Azure Web App"
59+
id: deploy-to-webapp
60+
uses: azure/webapps-deploy@v2
61+
with:
62+
app-name: "githubnext-blocks"
63+
slot-name: "staging"
64+
publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE }}
65+
package: web.zip

.github/workflows/codeql-analysis.yml

+29-29
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ main ]
16+
branches: [main]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ main ]
19+
branches: [main]
2020
schedule:
21-
- cron: '44 1 * * 0'
21+
- cron: "44 1 * * 0"
2222

2323
jobs:
2424
analyze:
@@ -32,39 +32,39 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
language: [ 'typescript', 'javascript' ]
35+
language: ["typescript", "javascript"]
3636
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
3737
# Learn more about CodeQL language support at https://git.io/codeql-language-support
3838

3939
steps:
40-
- name: Checkout repository
41-
uses: actions/checkout@v2
40+
- name: Checkout repository
41+
uses: actions/checkout@v2
4242

43-
# Initializes the CodeQL tools for scanning.
44-
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v1
46-
with:
47-
languages: ${{ matrix.language }}
48-
# If you wish to specify custom queries, you can do so here or in a config file.
49-
# By default, queries listed here will override any specified in a config file.
50-
# Prefix the list here with "+" to use these queries and those in the config file.
51-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v1
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5252

53-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54-
# If this step fails, then you should remove it and run the build manually (see below)
55-
- name: Autobuild
56-
uses: github/codeql-action/autobuild@v1
53+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54+
# If this step fails, then you should remove it and run the build manually (see below)
55+
- name: Autobuild
56+
uses: github/codeql-action/autobuild@v1
5757

58-
# ℹ️ Command-line programs to run using the OS shell.
59-
# 📚 https://git.io/JvXDl
58+
# ℹ️ Command-line programs to run using the OS shell.
59+
# 📚 https://git.io/JvXDl
6060

61-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62-
# and modify them (or add more) to build your code if your project
63-
# uses a compiled language
61+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62+
# and modify them (or add more) to build your code if your project
63+
# uses a compiled language
6464

65-
#- run: |
66-
# make bootstrap
67-
# make release
65+
#- run: |
66+
# make bootstrap
67+
# make release
6868

69-
- name: Perform CodeQL Analysis
70-
uses: github/codeql-action/analyze@v1
69+
- name: Perform CodeQL Analysis
70+
uses: github/codeql-action/analyze@v1

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx lint-staged

.prettierignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules
2+
dist
3+
.next
4+
public/excalidraw
5+
index.js
6+
blocks
7+
8+

.prettierrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

components/CircleText.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import uniqueId from "lodash/uniqueId";
22
import React, { useMemo } from "react";
33

4-
export const CircleText = ({
5-
r = 10,
6-
rotate = 0,
7-
text = "",
8-
...props
9-
}) => {
4+
export const CircleText = ({ r = 10, rotate = 0, text = "", ...props }) => {
105
const id = useMemo(() => uniqueId("CircleText--"), []);
116

127
return (
@@ -21,8 +16,7 @@ export const CircleText = ({
2116
id={id}
2217
transform={`rotate(${rotate})`}
2318
style={{ pointerEvents: "none" }}
24-
>
25-
</path>
19+
></path>
2620
<text textAnchor="middle" {...props}>
2721
<textPath href={`#${id}`} startOffset="50%">
2822
{text}

components/Tooltip.tsx

+21-13
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
1-
import * as TooltipPrimitive from "@radix-ui/react-tooltip"
1+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
22

3-
export const Tooltip = ({ children, side = "top", text, className = "", ...props }: {
4-
children: React.ReactNode,
5-
text: string,
6-
side?: "top" | "bottom" | "left" | "right",
7-
className?: string,
3+
export const Tooltip = ({
4+
children,
5+
side = "top",
6+
text,
7+
className = "",
8+
...props
9+
}: {
10+
children: React.ReactNode;
11+
text: string;
12+
side?: "top" | "bottom" | "left" | "right";
13+
className?: string;
814
}) => {
9-
1015
return (
1116
<TooltipPrimitive.Root delayDuration={0}>
12-
<TooltipPrimitive.Trigger asChild>
13-
{children}
14-
</TooltipPrimitive.Trigger>
15-
<TooltipPrimitive.Content side={side} sideOffset={6} className={`relative bg-indigo-600 text-white p-3 py-1 rounded-lg shadow-lg text-sm ${className}`} {...props}>
17+
<TooltipPrimitive.Trigger asChild>{children}</TooltipPrimitive.Trigger>
18+
<TooltipPrimitive.Content
19+
side={side}
20+
sideOffset={6}
21+
className={`relative bg-indigo-600 text-white p-3 py-1 rounded-lg shadow-lg text-sm ${className}`}
22+
{...props}
23+
>
1624
{text}
1725
<TooltipPrimitive.Arrow className="border-indigo-600" />
1826
</TooltipPrimitive.Content>
1927
</TooltipPrimitive.Root>
20-
)
21-
}
28+
);
29+
};

0 commit comments

Comments
 (0)