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

🚧 Upgrade to latest Flowershow (V2 - with MarkdownDB) #708

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f791a0f
[.github/workflows][s]: add E2E workflow
olayway Aug 4, 2023
9bbcc36
[.gitignore][xs]: rm contentlayer, add markdowndb
olayway Aug 4, 2023
4757eb2
[next.config.mjs][xs]: rm contentlayer hook
olayway Aug 4, 2023
a7d8133
[.eslintrc][xs]: rm old nx reference
olayway Aug 4, 2023
a783155
[styles/prism.css][s]: code highlighting styles upgrade
olayway Aug 4, 2023
99d4a60
[package.json][m]: dependencies upgrade pt.1
olayway Aug 4, 2023
22ec8d8
[/][xs]: add types.d.ts with @portaljs/remark-wiki-link declaration
olayway Aug 4, 2023
e54f31f
[/][s]: replace jsconfig with tsconfig
olayway Aug 4, 2023
3e554fb
[scripts/search][s]: upgrade script to use mddb instead of contentlayer
olayway Aug 4, 2023
8dbfc6d
[/][xs]: add prettierignore
olayway Aug 4, 2023
379213b
[/][xs]: rm contentlayer.config.js
olayway Aug 4, 2023
ef52baf
[tailwind.config.js][xs]: rename to tailwind.config.cjs
olayway Aug 4, 2023
f26b48d
[/][xs]: rm nx's project.json
olayway Aug 4, 2023
37f359d
[components][m]: add MdxPage
olayway Aug 7, 2023
2c7db32
[pages/_all][s]: upgrade to use mddb and ts
olayway Aug 7, 2023
9c5c1e5
[pages][s]: upgrade _app
olayway Aug 7, 2023
f3fdee6
[config][s]: upgdare siteConfig
olayway Aug 7, 2023
86fae63
[content/config.js][xs]: rename to config.mjs
olayway Aug 7, 2023
c3afdb8
[scripts][m]: add mddb and sitemap scripts
olayway Aug 7, 2023
69c4eca
[lib/getAuthorsDetails][s]: upgrade to use mddb
olayway Aug 7, 2023
2b33d72
[lib][m]: add mddb lib
olayway Aug 7, 2023
15f03ea
[lib][s]: add sluggify lib
olayway Aug 7, 2023
595afe8
[lib][s]: add computeFields lib
olayway Aug 7, 2023
8550122
[lib][m]: add markdown lib
olayway Aug 7, 2023
0eaa4ad
[pages][xs]: slug upgrade
olayway Aug 7, 2023
c439bd6
[pages/index][xs]: rename to tsx
olayway Aug 7, 2023
9c411f1
works v1
olayway Aug 7, 2023
d471f63
[components][s]: rm unneeded components
olayway Aug 9, 2023
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
7 changes: 1 addition & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"extends": [
"plugin:@nrwl/nx/react",
"next",
"next/core-web-vitals",
"../../.eslintrc.json"
],
"extends": ["next", "next/core-web-vitals", "../../.eslintrc.json"],
"ignorePatterns": [".obsidian/**/*", ".next/**/*", "out/**/*"],
"overrides": [
{
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Run E2E Tests

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Check out E2E tests repo
uses: actions/checkout@v2
with:
repository: datopian/flowershow-template-e2e

- name: Check out this repo into test-app
uses: actions/checkout@v2
with:
path: test-app

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '16.x'

- name: Install dependencies of E2E tests
run: |
npm ci
npx playwright install --with-deps

- name: Install dependencies of this repo
run: npm ci
working-directory: test-app

- name: Replace template /content with fixture content
run: |
rm -rf test-app/content
cp -r fixtures/content test-app/content

- name: Build the app
run: npm run export
working-directory: test-app

- name: Run the tests
run: npx playwright test

- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ yarn-error.log*
# vercel
.vercel


# Contentlayer
.contentlayer

# editor
.obsidian
sandbox

# markdowndb
markdown.db
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.obsidian/
.next/
out/
dist/
excalidraw/
content/
meta/
.github/
pnpm-lock.yaml
16 changes: 0 additions & 16 deletions components/Link.jsx

This file was deleted.

28 changes: 0 additions & 28 deletions components/MDX.jsx

This file was deleted.

32 changes: 32 additions & 0 deletions components/MdxPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React from "react";
import { MDXRemote } from "next-mdx-remote";
import { Mermaid, Pre } from "@portaljs/core";

import layouts from "../layouts";

// Custom components/renderers to pass to MDX.
// Since the MDX files aren't loaded by webpack, they have no knowledge of how
// to handle import statements. Instead, you must include components in scope
// here.
const components = {
mermaid: Mermaid,
pre: Pre,
};

export default function MdxPage({ source, frontMatter }) {
const Layout = ({ children }) => {
if (frontMatter.layout) {
const LayoutComponent = layouts[frontMatter.layout];
return <LayoutComponent {...frontMatter}>{children}</LayoutComponent>;
}
return <>{children}</>;
};

return (
<main id="mdxpage" className="prose mx-auto">
<Layout>
<MDXRemote {...source} components={components} />
</Layout>
</main>
);
}
14 changes: 0 additions & 14 deletions components/Mermaid.jsx

This file was deleted.

70 changes: 0 additions & 70 deletions components/Pre.jsx

This file was deleted.

7 changes: 0 additions & 7 deletions components/TempCallout.jsx

This file was deleted.

4 changes: 2 additions & 2 deletions components/custom/InitiativeCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default function InitiativeCard({ initiative }) {
<li className="group relative flex flex-col items-start m-0 p-0">
<div role="heading" className="text-base font-semibold text-primary">
<div className="absolute -inset-x-4 -inset-y-6 z-0 scale-95 bg-zinc-100 opacity-0 transition group-hover:scale-100 group-hover:opacity-100 sm:-inset-x-6 sm:rounded-2xl"></div>
<Link href={initiative.url_path} className="flex flex-col transition font-medium text-primary group-hover:text-secondary">
<Link href={initiative.urlPath} className="flex flex-col transition font-medium text-primary group-hover:text-secondary">
<span className="absolute -inset-x-4 -inset-y-6 z-20 sm:-inset-x-6 sm:rounded-2xl" />
{initiative.image && <img src={initiative.image} className="z-10 w-full aspect-video object-cover object-left m-0 rounded-lg shadow-sm" />}
<span className="relative z-10 mt-4">
Expand All @@ -21,4 +21,4 @@ export default function InitiativeCard({ initiative }) {
</p>
</li>
)
}
}
43 changes: 0 additions & 43 deletions config/siteConfig.js

This file was deleted.

16 changes: 16 additions & 0 deletions config/siteConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { defaultConfig } from "@portaljs/core";
import userConfig from "../content/config.mjs";

// TODO types
const siteConfig: any = {
...defaultConfig,
...userConfig,
// prevent theme object overrides for
// values not provided in userConfig
theme: {
...defaultConfig.theme,
...userConfig?.theme,
},
};

export default siteConfig;
File renamed without changes.
Loading
Loading