Skip to content
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

Migrate changes to main #171

Merged
merged 12 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"prettier/prettier": "warn",
"react/prop-types": ["off"],
"no-console": ["warn", { "allow": ["warn", "error"] }],
"no-unused-vars": "warn",
"no-unused-vars": ["warn", { "vars": "all", "args": "none", "ignoreRestSiblings": false }],
"eol-last": ["error", "always"],
"react/react-in-jsx-scope": "off"
}
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/generate-static-data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Generate MetaData JSON files

on:
schedule:
- cron: '0 0 * * *'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3

- name: Install yarn
run: npm i yarn -g

- name: Install dependencies
run: yarn install

- name: Compile scripts
run: yarn compile:scripts

- name: Run script
run: node scriptsOut/index.js

- name: Commit and push changes
run: |
git config --global user.email "${{secrets.EMAIL}}"
git config --global user.name "${{secrets.NAME}}"
git add .
git commit -am "generated dir metadata" || echo "Couldn't generate metadata"
git push
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# next.js
/.next/
/out/
/scriptsOut/

# production
/build
Expand Down
59 changes: 30 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,49 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"lint:fix": "next lint --fix"
"lint:fix": "next lint --fix",
"compile:scripts": "tsc --project tsconfig.scripts.json"
},
"dependencies": {
"@chakra-ui/react": "^2.5.1",
"@emotion/react": "^11.10.6",
"@emotion/styled": "^11.10.6",
"@octokit/core": "^4.2.0",
"@tanstack/react-query": "^4.29.5",
"@chakra-ui/react": "^2.8.0",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@octokit/core": "^5.0.0",
"@tanstack/react-query": "^4.32.6",
"@types/jsonwebtoken": "^9.0.2",
"@types/markdown-it": "^12.2.3",
"axios": "^1.3.4",
"@types/markdown-it": "^13.0.0",
"axios": "^1.4.0",
"cheerio": "^1.0.0-rc.12",
"date-fns": "^2.29.3",
"framer-motion": "^10.0.1",
"date-fns": "^2.30.0",
"framer-motion": "^10.15.1",
"jsonwebtoken": "^9.0.1",
"jwt-decode": "^3.1.2",
"markdown-it": "^13.0.1",
"match-sorter": "^6.3.1",
"next": "13.2.3",
"next-auth": "^4.20.1",
"react": "18.2.0",
"react-datepicker": "^4.11.0",
"react-dom": "18.2.0",
"react-icons": "^4.8.0",
"next": "^13.4.13",
"next-auth": "^4.22.5",
"react": "^18.2.0",
"react-datepicker": "^4.16.0",
"react-dom": "^18.2.0",
"react-icons": "^4.10.1",
"react-markdown-editor-lite": "^1.3.4",
"react-youtube": "^10.1.0",
"sanitize-html": "^2.10.0",
"sanitize-html": "^2.11.0",
"slugify": "^1.6.6"
},
"devDependencies": {
"@types/marked": "^4.0.8",
"@types/node": "18.14.5",
"@types/react": "18.0.28",
"@types/react-datepicker": "^4.10.0",
"@types/react-dom": "18.0.11",
"@types/marked": "^5.0.1",
"@types/node": "^20.4.9",
"@types/react": "^18.2.19",
"@types/react-datepicker": "^4.15.0",
"@types/react-dom": "^18.2.7",
"@types/sanitize-html": "^2.9.0",
"eslint": "8.35.0",
"eslint-config-next": "13.2.3",
"eslint-config-prettier": "^8.7.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.8.4",
"sass": "^1.58.3",
"typescript": "4.9.5"
"eslint": "^8.46.0",
"eslint-config-next": "^13.4.13",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"prettier": "^3.0.1",
"sass": "^1.64.2",
"typescript": "^5.1.6"
}
}
82 changes: 82 additions & 0 deletions public/static/directoryMetadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"adopting-bitcoin": { "2021": {} },
"advancing-bitcoin": { "2019": {}, "2020": {}, "2022": {} },
"andreas-antonopoulos": {},
"austin-bitcoin-developers": {},
"baltic-honeybadger": { "2018": {}, "2019": {} },
"bit-block-boom": { "2019": {} },
"bitcoin-core-dev-tech": { "bitcoin-devcore-2015": {} },
"bitcoin-design": {},
"bitcoin-developers-miners-meeting-2016": {},
"bitcoin-magazine": {},
"bitcoinology": {},
"bitcoinops": {},
"bitcoinplusplus": { "2022": {} },
"bitcointranscripts": { "stephan-livera-podcast": {} },
"blockchain-protocol-analysis-security-engineering": {
"2017": {},
"2018": {}
},
"blockstream-webinars": {},
"boltathon": {},
"breaking-bitcoin": { "2017": {}, "2019": {} },
"building-on-bitcoin": { "2018": {} },
"c-lightning": {},
"chaincode-labs": { "chaincode-podcast": {}, "chaincode-residency": {} },
"chicago-bitdevs": {},
"coindesk-consensus-2016": {},
"coordination-of-decentralized-finance-workshop": { "2020-stanford": {} },
"cppcon": { "2017": {}, "2020": {} },
"cryptoeconomic-systems": { "2019": {} },
"dallas-bitcoin-symposium": {},
"decentralized-financial-architecture-workshop": {},
"greg-maxwell": {},
"grincon": { "2019": {} },
"honey-badger-diaries": {},
"iacr": {},
"la-bitdevs": {},
"layer2-summit": { "2018": {} },
"lets-talk-bitcoin-podcast": {},
"lightning-conference": { "2019": {} },
"lightning-hack-day": {},
"lightning-specification": {},
"london-bitcoin-devs": {},
"magicalcryptoconference": { "2019": {} },
"misc": {},
"mit-bitcoin-expo": {
"mit-bitcoin-expo-2015": {},
"mit-bitcoin-expo-2016": {},
"mit-bitcoin-expo-2017": {},
"mit-bitcoin-expo-2018": {},
"mit-bitcoin-expo-2019": {},
"mit-bitcoin-expo-2020": {},
"mit-bitcoin-expo-2021": {}
},
"munich-meetup": {},
"noded-podcast": {},
"realworldcrypto": { "2018": {}, "2021": {} },
"rebooting-web-of-trust": { "2019-prague": {} },
"ruben-somsen": {},
"satoshi-roundtable": { "sr-004": {} },
"scalingbitcoin": {
"hong-kong-2015": {},
"milan-2016": {},
"montreal-2015": {},
"stanford-2017": { "edgeplusplus": {} },
"tel-aviv-2019": { "edgedevplusplus": {} },
"tokyo-2018": { "edgedevplusplus": {} }
},
"sf-bitcoin-meetup": {},
"simons-institute": {},
"stanford-blockchain-conference": { "2019": {}, "2020": {} },
"stephan-livera-podcast": {},
"sydney-bitcoin-meetup": {},
"tabconf": { "2021": {}, "2022": {} },
"texas-bitcoin-conference-2014": {},
"tftc-podcast": {},
"verifiable-delay-functions": { "vdf-day-2019": {} },
"vr-bitcoin": {},
"w3-blockchain-workshop-2016": {},
"wasabi-research-club": {},
"what-bitcoin-did-podcast": {}
}
57 changes: 57 additions & 0 deletions scripts/generate-dir-static-metadata.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import * as fs from "fs/promises";
import axios from "axios";

const treeUrl =
"https://api.github.com/repos/bitcointranscripts/bitcointranscripts/git/trees/master?recursive=1";
const dirPath = "public/static/";
const fileName = "directoryMetadata.json";

const fetchGithubData = async (path: string) => {
const { data } = await axios.get(path, {
headers: {
Accept: "application/vnd.github.raw+json",
},
});
return data;
};

const placeContent = (
segment: string[],
lastEntry: any,
currentDepth: number,
length: number
) => {
if (currentDepth < length) {
if (lastEntry[segment[currentDepth]] === undefined) {
lastEntry[segment[currentDepth]] = {};
}
placeContent(
segment,
lastEntry[segment[currentDepth]],
currentDepth + 1,
length
);
}
}

export const createDirectoryMetadata = async () => {
const dirMetadata = {};
try {
const data = await fetchGithubData(treeUrl);
const tree = data.tree;
if (tree?.length) {
for (const item of tree) {
if (item.path[0] !== "." && item.type === "tree") {
const segment = item.path.split("/");
placeContent(segment, dirMetadata, 0, segment.length);
}
}
}
await fs.mkdir(dirPath, { recursive: true });
await fs.writeFile(dirPath + fileName, JSON.stringify(dirMetadata));
// fs.writeFileSync("public/static/directoryMetadata.json", JSON.stringify(dirMetadata));

} catch (err) {
console.log({ err });
}
};
3 changes: 3 additions & 0 deletions scripts/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { createDirectoryMetadata } from "./generate-dir-static-metadata";

createDirectoryMetadata();
3 changes: 1 addition & 2 deletions src/components/editTranscript/EditTranscript.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// import dynamic from "next/dynamic";
import {
Box,
Button,
Expand Down Expand Up @@ -43,7 +42,7 @@ const EditTranscript = ({
const [isPreviewOnly, setIsPreviewOnly] = useState(false);
const [isModalOpen, setIsModalopen] = useState(false);

const mdParser = new MarkdownIt(/* Markdown-it options */);
const mdParser = new MarkdownIt();

// Finish!
function handleEditorChange({ text }: IHandleEditorChange) {
Expand Down
1 change: 0 additions & 1 deletion src/components/home/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const Hero = ({
}) => {
return (
<Box bgColor="gray.100">
{/* <Box pos="fixed" isolation="isolate" top="0" left="0" zIndex={0} w="100%" h="100%" bgColor="blackAlpha.800"></Box> */}
<GlobalContainer py={4}>
<Flex direction={{ base: "column", sm: "row" }} gap={4}>
<Flex flex="1 1 50%" gap={4} direction="column" justifyContent="left">
Expand Down
1 change: 0 additions & 1 deletion src/components/home/Queuer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable react/no-unescaped-entities */
import QueueTable from "@/components/tables/QueueTable";
import GlobalContainer from "../GlobalContainer";

Expand Down
Loading