From afe5af8f2f04c5ee5302a0de84ced6906830120e Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Sun, 15 Dec 2024 13:39:13 -0500 Subject: [PATCH] Remove roadmap from site --- components/Footer.tsx | 10 --- components/Issue.tsx | 99 ------------------------------ components/IssueTimeline.tsx | 78 ------------------------ data/roadmap.ts | 3 - linear.mjs | 114 ----------------------------------- package.json | 2 - pages/roadmap.tsx | 86 -------------------------- yarn.lock | 83 ------------------------- 8 files changed, 475 deletions(-) delete mode 100644 components/Issue.tsx delete mode 100644 components/IssueTimeline.tsx delete mode 100644 data/roadmap.ts delete mode 100644 linear.mjs delete mode 100644 pages/roadmap.tsx diff --git a/components/Footer.tsx b/components/Footer.tsx index ddeaf05fc..2ff7c95f9 100644 --- a/components/Footer.tsx +++ b/components/Footer.tsx @@ -70,16 +70,6 @@ export const Footer = () => ( defaultMessage="Donate" /> , - - - , ], }, { diff --git a/components/Issue.tsx b/components/Issue.tsx deleted file mode 100644 index 81b66462d..000000000 --- a/components/Issue.tsx +++ /dev/null @@ -1,99 +0,0 @@ -export type IssueProps = { - id: string - title: string - priority: number - state: string - parent?: { - id: string - title: string - } -} - -export type BarIconProps = { - priority: number - size: number -} - -const PRIORITY_UNSET = 0 -const PRIORITY_URGENT = 1 -const PRIORITY_HIGH = 2 -const PRIORITY_MEDIUM = 3 -const PRIORITY_LOW = 4 - -export const BarIcon = ({ priority, size }: BarIconProps) => ( - - - - - -) - -export const ChevronRight = () => ( - - - -) - -export const Issue = ({ id, title, priority, state, parent }: IssueProps) => { - return ( -
-
- {state === "started" && priority === PRIORITY_URGENT && ( -
- )} -
- -
-
- {priority !== PRIORITY_UNSET && ( - - )} -
-
{id}
-
- {title} - - {parent && ( - - - - - {parent.title} - - )} -
-
-
- ) -} - -export default Issue diff --git a/components/IssueTimeline.tsx b/components/IssueTimeline.tsx deleted file mode 100644 index 348736d6a..000000000 --- a/components/IssueTimeline.tsx +++ /dev/null @@ -1,78 +0,0 @@ -import Issue from "../components/Issue" -import Category from "../components/Category" -import { useState } from "react" -import { FormattedMessage, useIntl, defineMessages } from "react-intl" - -const messages = defineMessages({ - started: { id: "roadmap.state.started", defaultMessage: "In Progress" }, - unstarted: { id: "roadmap.state.unstarted", defaultMessage: "Planned" }, - backlog: { id: "roadmap.state.backlog", defaultMessage: "Exploring" }, - completed: { - id: "roadmap.state.completed", - defaultMessage: "Recently completed", - }, -}) - -export const IssueTimeline = ({ roadmap }) => { - const intl = useIntl() - const [activeCategory, setActiveCategory] = useState("all") - - const filteredRoadmap = roadmap - .map((state) => { - const filteredIssues = state.items.filter( - ({ id }) => id.startsWith(activeCategory) || activeCategory === "all" - ) - - return { - ...state, - items: filteredIssues, - } - }) - .filter(({ items }) => items.length > 0) - - //prettier-ignore - const categories = [ - { key: "all", label: intl.formatMessage({ id: "roadmap.all", defaultMessage: "All" }) }, - { key: "MAS", label: intl.formatMessage({ id: "roadmap.mastodon", defaultMessage: "Web / API" }) }, - { key: "IOS", label: intl.formatMessage({ id: "roadmap.ios", defaultMessage: "iOS" }) }, - { key: "AND", label: intl.formatMessage({ id: "roadmap.android", defaultMessage: "Android" }) }, - ] - - return ( -
-
-
- {categories.map((category) => ( - setActiveCategory(e.target.value)} - /> - ))} -
-
- -
-
- - {filteredRoadmap.map((state) => ( -
-

- {intl.formatMessage(messages[state.type])} -

- -
- {state.items.map((issue) => ( - - ))} -
-
- ))} -
-
- ) -} - -export default IssueTimeline diff --git a/data/roadmap.ts b/data/roadmap.ts deleted file mode 100644 index f11c85964..000000000 --- a/data/roadmap.ts +++ /dev/null @@ -1,3 +0,0 @@ -import linearData from "./linear.json" - -export default linearData diff --git a/linear.mjs b/linear.mjs deleted file mode 100644 index d2294cc3c..000000000 --- a/linear.mjs +++ /dev/null @@ -1,114 +0,0 @@ -import * as dotenv from "dotenv" -import { LinearClient } from "@linear/sdk" -import fs from "fs" - -dotenv.config({ path: ".env.local" }) - -const api = new LinearClient({ - apiKey: process.env.LINEAR_API_KEY, -}) - -const fetchIssues = async (after) => - api.issues({ - filter: { - team: { - key: { - in: ["MAS", "IOS", "AND"], - }, - }, - - labels: { - name: { - eqIgnoreCase: "Public roadmap", - }, - }, - - state: { - type: { - in: ["backlog", "unstarted", "started", "completed"], - }, - }, - }, - }) - -const processIssues = async (stateMap, issues) => { - for (const issue of issues.nodes) { - const state = await issue.state - const list = (stateMap[state.type] || { items: [] }).items - - if (list.find((item) => item.id === issue.identifier)) { - continue - } - - const parent = await issue.parent - - list.push({ - id: issue.identifier, - title: issue.title, - priority: issue.priority, - completedAt: issue.completedAt, - parent: parent - ? { - id: parent.identifier, - title: parent.title, - } - : null, - }) - - stateMap[state.type] = { - type: state.type, - items: list, - } - } -} - -const stateMap = {} -const roadmap = [] - -let issues = await fetchIssues() -await processIssues(stateMap, issues) - -while (issues.pageInfo.hasNextPage) { - issues = await issues.fetchNext() - await processIssues(stateMap, issues) -} - -Object.keys(stateMap).forEach((state) => { - if (state !== "completed") { - stateMap[state].items.sort((a, b) => a.priority - b.priority) - } else { - stateMap[state].items.sort( - (a, b) => new Date(b.completedAt) - new Date(a.completedAt) - ) - } - - roadmap.push(stateMap[state]) -}) - -const stateTypeToValue = (type) => { - switch (type) { - case "backlog": - return 0 - case "unstarted": - return 1 - case "started": - return 2 - case "completed": - return -1 - } -} - -roadmap.sort((a, b) => stateTypeToValue(b.type) - stateTypeToValue(a.type)) - -fs.writeFile( - "./data/linear.json", - JSON.stringify(roadmap, null, " "), - (err) => { - if (err) { - console.error(err) - return - } - - console.log("File updated") - } -) diff --git a/package.json b/package.json index 4de1c78ed..348e7f792 100644 --- a/package.json +++ b/package.json @@ -11,12 +11,10 @@ "start": "next start", "lint": "next lint", "update-sponsors": "node --experimental-fetch patreon.mjs", - "update-roadmap": "node linear.mjs", "extract": "formatjs extract '{components,pages,data}/**/*.{js,jsx,ts,tsx}' --out-file 'locales/en.json' --format 'locales/locale_format.js'" }, "dependencies": { "@headlessui/react": "^2.1.2", - "@linear/sdk": "^35.0.0", "@tanstack/react-query": "^5.51.21", "blurhash": "^2.0.5", "classnames": "^2.5.1", diff --git a/pages/roadmap.tsx b/pages/roadmap.tsx deleted file mode 100644 index 1cccad177..000000000 --- a/pages/roadmap.tsx +++ /dev/null @@ -1,86 +0,0 @@ -import BasicPage from "../components/BasicPage" -import Head from "next/head" -import Hero from "../components/Hero" -import { withDefaultStaticProps } from "../utils/defaultStaticProps" -import Layout from "../components/Layout" -import data from "../data/roadmap" -import IssueTimeline from "../components/IssueTimeline" -import LinkButton from "../components/LinkButton" -import { FormattedMessage, useIntl } from "react-intl" - -const Roadmap = () => { - const intl = useIntl() - - return ( - -
- -
-
-

- -

-

- -

- -
- - - -
-
- -
- -
-
-
- - - - {`${intl.formatMessage({ - id: "roadmap.page_title", - defaultMessage: "Public Roadmap", - })} - Mastodon`} - - - - - - -
-
- ) -} - -export const getStaticProps = withDefaultStaticProps() - -export default Roadmap diff --git a/yarn.lock b/yarn.lock index d17deccb9..329535e8d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1715,15 +1715,6 @@ __metadata: languageName: node linkType: hard -"@graphql-typed-document-node/core@npm:^3.1.0": - version: 3.1.1 - resolution: "@graphql-typed-document-node/core@npm:3.1.1" - peerDependencies: - graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 - checksum: 10c0/c186e5adceb0dfdaa770856d2f17c831a474f5927d79f984326ecb3d8680ba3c1ee2314f7def1d863692cd9cbe4dffc8bb52fc74ee0aa9b31e9491f24ef59f90 - languageName: node - linkType: hard - "@headlessui/react@npm:^2.1.2": version: 2.2.0 resolution: "@headlessui/react@npm:2.2.0" @@ -2004,17 +1995,6 @@ __metadata: languageName: node linkType: hard -"@linear/sdk@npm:^35.0.0": - version: 35.0.0 - resolution: "@linear/sdk@npm:35.0.0" - dependencies: - "@graphql-typed-document-node/core": "npm:^3.1.0" - graphql: "npm:^15.4.0" - isomorphic-unfetch: "npm:^3.1.0" - checksum: 10c0/912f0184e0b7cce8f30da8918fd9c2c4e35131d8785644f4d6ec893364c4d9516e3a531db7a62060b70f8fb63f3b9238b00ac648316adf532f5aa5751ad68193 - languageName: node - linkType: hard - "@next/env@npm:14.2.20": version: 14.2.20 resolution: "@next/env@npm:14.2.20" @@ -4667,13 +4647,6 @@ __metadata: languageName: node linkType: hard -"graphql@npm:^15.4.0": - version: 15.9.0 - resolution: "graphql@npm:15.9.0" - checksum: 10c0/0e93f7138daae07dcb0713ce5e2ae7f8039e911b6180f0170c4929664ec32ab8e690a9ea12be2dc4ab18544f9898989765122f30d2d07d38b0ce2a4c839d29bc - languageName: node - linkType: hard - "has-bigints@npm:^1.0.1, has-bigints@npm:^1.0.2": version: 1.0.2 resolution: "has-bigints@npm:1.0.2" @@ -5159,16 +5132,6 @@ __metadata: languageName: node linkType: hard -"isomorphic-unfetch@npm:^3.1.0": - version: 3.1.0 - resolution: "isomorphic-unfetch@npm:3.1.0" - dependencies: - node-fetch: "npm:^2.6.1" - unfetch: "npm:^4.2.0" - checksum: 10c0/d3b61fca06304db692b7f76bdfd3a00f410e42cfa7403c3b250546bf71589d18cf2f355922f57198e4cc4a9872d3647b20397a5c3edf1a347c90d57c83cf2a89 - languageName: node - linkType: hard - "iterator.prototype@npm:^1.1.2": version: 1.1.2 resolution: "iterator.prototype@npm:1.1.2" @@ -5230,7 +5193,6 @@ __metadata: dependencies: "@formatjs/cli": "npm:^6.2.12" "@headlessui/react": "npm:^2.1.2" - "@linear/sdk": "npm:^35.0.0" "@svgr/webpack": "npm:^8.1.0" "@tanstack/react-query": "npm:^5.51.21" "@tanstack/react-query-devtools": "npm:^5.51.21" @@ -5857,20 +5819,6 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:^2.6.1": - version: 2.7.0 - resolution: "node-fetch@npm:2.7.0" - dependencies: - whatwg-url: "npm:^5.0.0" - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - checksum: 10c0/b55786b6028208e6fbe594ccccc213cab67a72899c9234eb59dba51062a299ea853210fcf526998eaa2867b0963ad72338824450905679ff0fa304b8c5093ae8 - languageName: node - linkType: hard - "node-gyp@npm:^11.0.0": version: 11.0.0 resolution: "node-gyp@npm:11.0.0" @@ -7476,13 +7424,6 @@ __metadata: languageName: node linkType: hard -"tr46@npm:~0.0.3": - version: 0.0.3 - resolution: "tr46@npm:0.0.3" - checksum: 10c0/047cb209a6b60c742f05c9d3ace8fa510bff609995c129a37ace03476a9b12db4dbf975e74600830ef0796e18882b2381fb5fb1f6b4f96b832c374de3ab91a11 - languageName: node - linkType: hard - "ts-api-utils@npm:^1.3.0": version: 1.3.0 resolution: "ts-api-utils@npm:1.3.0" @@ -7625,13 +7566,6 @@ __metadata: languageName: node linkType: hard -"unfetch@npm:^4.2.0": - version: 4.2.0 - resolution: "unfetch@npm:4.2.0" - checksum: 10c0/a5c0a896a6f09f278b868075aea65652ad185db30e827cb7df45826fe5ab850124bf9c44c4dafca4bf0c55a0844b17031e8243467fcc38dd7a7d435007151f1b - languageName: node - linkType: hard - "unicode-canonical-property-names-ecmascript@npm:^2.0.0": version: 2.0.0 resolution: "unicode-canonical-property-names-ecmascript@npm:2.0.0" @@ -7729,23 +7663,6 @@ __metadata: languageName: node linkType: hard -"webidl-conversions@npm:^3.0.0": - version: 3.0.1 - resolution: "webidl-conversions@npm:3.0.1" - checksum: 10c0/5612d5f3e54760a797052eb4927f0ddc01383550f542ccd33d5238cfd65aeed392a45ad38364970d0a0f4fea32e1f4d231b3d8dac4a3bdd385e5cf802ae097db - languageName: node - linkType: hard - -"whatwg-url@npm:^5.0.0": - version: 5.0.0 - resolution: "whatwg-url@npm:5.0.0" - dependencies: - tr46: "npm:~0.0.3" - webidl-conversions: "npm:^3.0.0" - checksum: 10c0/1588bed84d10b72d5eec1d0faa0722ba1962f1821e7539c535558fb5398d223b0c50d8acab950b8c488b4ba69043fd833cc2697056b167d8ad46fac3995a55d5 - languageName: node - linkType: hard - "which-boxed-primitive@npm:^1.0.2": version: 1.0.2 resolution: "which-boxed-primitive@npm:1.0.2"