Merge pull request #950 from datopian/site-deps-update

Replace `@flowershow/*` with `@portaljs/*` packages in /site
This commit is contained in:
João Demenech
2023-06-16 09:04:42 -03:00
committed by GitHub
16 changed files with 728 additions and 850 deletions

View File

@@ -1,4 +1,4 @@
import { defaultConfig } from "@flowershow/core"; import { defaultConfig } from "@portaljs/core";
import userConfig from "../content/config"; import userConfig from "../content/config";
export const siteConfig: any = { export const siteConfig: any = {

View File

@@ -142,7 +142,7 @@ process.exit(0);
Since we're using ES6 modules, we also need to add `"type": "module"` to our `package.json` file. Since we're using ES6 modules, we also need to add `"type": "module"` to our `package.json` file.
Before we run the above script, we need to make sure that the `dbPath` variable is pointing to our `markdown.db` file. If you want to store the database outside of your project folder, you can update the `dbPath` variable to point to the correct location. If you want to have it inside your project folder, you can copy it there, or simply re-run the `npx mddb` {'<'}path-to-markdown-folder{'>'}` command from within your project folder. Before we run the above script, we need to make sure that the `dbPath` variable is pointing to our `markdown.db` file. If you want to store the database outside of your project folder, you can update the `dbPath` variable to point to the correct location. If you want to have it inside your project folder, you can copy it there, or simply re-run the `npx mddb <path-to-markdown-folder>` command from within your project folder.
Now, let's run the script: Now, let's run the script:

View File

@@ -2,10 +2,10 @@
## Setup ## Setup
The following example uses components imported from the [`@flowershow/core` package](https://github.com/datopian/flowershow). If you want to follow along install it too: The following example uses components imported from the [`@portaljs/core` package](https://www.npmjs.com/package/@portaljs/core). If you want to follow along install it too:
```sh ```sh
npm i @flowershow/core npm i @portaljs/core
``` ```
## Create home page for your blogs ## Create home page for your blogs
@@ -13,7 +13,7 @@ npm i @flowershow/core
Add the following code to the Next.js page that is going to be your blog home page, e.g. to `/pages/blog/index.tsx`: Add the following code to the Next.js page that is going to be your blog home page, e.g. to `/pages/blog/index.tsx`:
```tsx ```tsx
import { BlogsList, SimpleLayout } from "@flowershow/core"; import { BlogsList, SimpleLayout } from "@portaljs/core";
// pass a list of blogs, home page title and home page description, e.g. from `getStaticProps` // pass a list of blogs, home page title and home page description, e.g. from `getStaticProps`
export default function BlogIndex({ blogs, title, description }) { export default function BlogIndex({ blogs, title, description }) {
@@ -47,7 +47,7 @@ interface Blog {
Add the following code to your blog pages, e.g. to `/pages/blog/[...slug].tsx`: Add the following code to your blog pages, e.g. to `/pages/blog/[...slug].tsx`:
```tsx ```tsx
import { BlogLayout } from "@flowershow/core"; import { BlogLayout } from "@portaljs/core";
export default BlogPost({ content, title, date, authors }) { export default BlogPost({ content, title, date, authors }) {
return ( return (

View File

@@ -75,10 +75,10 @@ NEXT_PUBLIC_DISQUS_SHORTNAME=
## Add comments to your page layout ## Add comments to your page layout
You can use `@flowershow/core` to import the comments section component. Install it with: You can use `@portaljs/core` to import the comments section component. Install it with:
```sh ```sh
npm i @flowershow/core npm i @portaljs/core
``` ```
Then, add the following to your custom layout (or directly to your pages): Then, add the following to your custom layout (or directly to your pages):

View File

@@ -1,7 +1,7 @@
import { import {
SimpleLayout, SimpleLayout,
UnstyledLayout, UnstyledLayout,
} from "@flowershow/core"; } from "@portaljs/core";
import { BlogLayout } from "./blog"; import { BlogLayout } from "./blog";
import DefaultLayout from "./default"; import DefaultLayout from "./default";
import { DocsLayout } from "./docs"; import { DocsLayout } from "./docs";

View File

@@ -1,13 +1,13 @@
import matter from "gray-matter"; import matter from "gray-matter";
import mdxmermaid from "mdx-mermaid"; import mdxmermaid from "mdx-mermaid";
import { h } from "hastscript"; import { h } from "hastscript";
import remarkCallouts from "@flowershow/remark-callouts"; import remarkCallouts from "@portaljs/remark-callouts";
import remarkEmbed from "@flowershow/remark-embed"; import remarkEmbed from "@portaljs/remark-embed";
import remarkGfm from "remark-gfm"; import remarkGfm from "remark-gfm";
import remarkMath from "remark-math"; import remarkMath from "remark-math";
import remarkSmartypants from "remark-smartypants"; import remarkSmartypants from "remark-smartypants";
import remarkToc from "remark-toc"; import remarkToc from "remark-toc";
import remarkWikiLink from "@flowershow/remark-wiki-link"; import remarkWikiLink from "@portaljs/remark-wiki-link";
import rehypeAutolinkHeadings from "rehype-autolink-headings"; import rehypeAutolinkHeadings from "rehype-autolink-headings";
import rehypeKatex from "rehype-katex"; import rehypeKatex from "rehype-katex";
import rehypeSlug from "rehype-slug"; import rehypeSlug from "rehype-slug";

View File

@@ -1,4 +1,4 @@
import { MarkdownDB } from "@flowershow/markdowndb"; import { MarkdownDB } from "mddb";
// import config from "./markdowndb.config.js"; // import config from "./markdowndb.config.js";
// TODO get this path from markdowndb.config.js or something // TODO get this path from markdowndb.config.js or something

1510
site/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -10,18 +10,18 @@
"mddb": "mddb content" "mddb": "mddb content"
}, },
"dependencies": { "dependencies": {
"@flowershow/core": "^0.4.11",
"@flowershow/markdowndb": "^0.1.1",
"@flowershow/remark-callouts": "^1.0.0",
"@flowershow/remark-embed": "^1.0.0",
"@flowershow/remark-wiki-link": "^1.0.1",
"@headlessui/react": "^1.3.0", "@headlessui/react": "^1.3.0",
"@heroicons/react": "^1.0.3", "@heroicons/react": "^1.0.3",
"@mdx-js/loader": "^2.3.0", "@mdx-js/loader": "^2.3.0",
"@portaljs/core": "^1.0.5",
"@portaljs/remark-callouts": "^1.0.5",
"@portaljs/remark-embed": "^1.0.4",
"@portaljs/remark-wiki-link": "^1.0.4",
"axios": "^1.3.6", "axios": "^1.3.6",
"clsx": "^1.2.1", "clsx": "^1.2.1",
"gray-matter": "^4.0.3", "gray-matter": "^4.0.3",
"hastscript": "^7.2.0", "hastscript": "^7.2.0",
"mddb": "^0.1.9",
"next": "^13.2.1", "next": "^13.2.1",
"next-mdx-remote": "^4.4.1", "next-mdx-remote": "^4.4.1",
"next-seo": "^5.15.0", "next-seo": "^5.15.0",
@@ -45,17 +45,17 @@
"remark-slug": "^6.1.0", "remark-slug": "^6.1.0",
"remark-smartypants": "^2.0.0", "remark-smartypants": "^2.0.0",
"remark-toc": "^7.2.0", "remark-toc": "^7.2.0",
"strip-markdown": "^5.0.0",
"vega": "^5.20.2", "vega": "^5.20.2",
"vega-lite": "^5.1.0", "vega-lite": "^5.1.0"
"strip-markdown": "^5.0.0"
}, },
"devDependencies": { "devDependencies": {
"@tailwindcss/typography": "^0.5.9", "@tailwindcss/typography": "^0.5.9",
"autoprefixer": "^10.4.14", "autoprefixer": "^10.4.14",
"postcss": "^8.4.22", "postcss": "^8.4.22",
"prettier": "^2.8.7", "prettier": "^2.8.7",
"remark": "^14.0.2",
"tailwindcss": "^3.3.1", "tailwindcss": "^3.3.1",
"typescript": "^5.0.4", "typescript": "^5.0.4"
"remark": "^14.0.2"
} }
} }

View File

@@ -7,7 +7,7 @@ import clientPromise from '@/lib/mddb';
import Layout from 'components/Layout'; import Layout from 'components/Layout';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { useRouter } from 'next/router.js'; import { useRouter } from 'next/router.js';
import { NavGroup, NavItem, collectHeadings } from '@flowershow/core'; import { NavGroup, NavItem, collectHeadings } from '@portaljs/core';
import { GetStaticProps, GetStaticPropsResult } from 'next'; import { GetStaticProps, GetStaticPropsResult } from 'next';
import { CustomAppProps } from './_app.jsx'; import { CustomAppProps } from './_app.jsx';
import computeFields from '@/lib/computeFields'; import computeFields from '@/lib/computeFields';

View File

@@ -5,7 +5,7 @@ import Script from "next/script";
import { DefaultSeo } from "next-seo"; import { DefaultSeo } from "next-seo";
import { NavGroup, NavItem, pageview, ThemeProvider } from "@flowershow/core"; import { NavGroup, NavItem, pageview, ThemeProvider } from "@portaljs/core";
import { siteConfig } from "../config/siteConfig"; import { siteConfig } from "../config/siteConfig";
import { useEffect } from "react"; import { useEffect } from "react";
import { useRouter } from "next/dist/client/router"; import { useRouter } from "next/dist/client/router";

View File

@@ -1,7 +1,7 @@
import Layout from '@/components/Layout'; import Layout from '@/components/Layout';
import computeFields from '@/lib/computeFields'; import computeFields from '@/lib/computeFields';
import clientPromise from '@/lib/mddb'; import clientPromise from '@/lib/mddb';
import { BlogsList, SimpleLayout } from '@flowershow/core'; import { BlogsList, SimpleLayout } from '@portaljs/core';
import * as fs from 'fs'; import * as fs from 'fs';
export default function Blog({ blogs }) { export default function Blog({ blogs }) {

View File

@@ -6,7 +6,7 @@ import Showcases from '@/components/Showcases';
import Layout from '../components/Layout'; import Layout from '../components/Layout';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { collectHeadings } from '@flowershow/core'; import { collectHeadings } from '@portaljs/core';
export default function Home({ sidebarTree }) { export default function Home({ sidebarTree }) {
const router = useRouter(); const router = useRouter();

View File

@@ -1,4 +1,4 @@
@import "@flowershow/remark-callouts/styles.css"; @import "@portaljs/remark-callouts/styles.css";
@import './prism.css'; @import './prism.css';
html, html,

View File

@@ -13,8 +13,8 @@ module.exports = {
"./components/**/*.jsx", "./components/**/*.jsx",
"./components/**/*.tsx", "./components/**/*.tsx",
"./lib/markdown.mjs", "./lib/markdown.mjs",
"./node_modules/@flowershow/core/dist/*.js", "./node_modules/@portaljs/core/dist/*.js",
"./node_modules/@flowershow/core/*.js", "./node_modules/@portaljs/core/*.js",
], ],
darkMode: "class", // or 'media' or 'class' darkMode: "class", // or 'media' or 'class'
theme: { theme: {

View File

@@ -2,12 +2,12 @@
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
"@flowershow/core": ["node_modules/@flowershow/core/dist/src"], "@portaljs/core": ["node_modules/@portaljs/core/dist/src"],
"@flowershow/remark-callouts": [ "@portaljs/remark-callouts": [
"node_modules/@flowershow/remark-callouts/dist/src" "node_modules/@portaljs/remark-callouts/dist/src"
], ],
"@flowershow/remark-embed": [ "@portaljs/remark-embed": [
"node_modules/@flowershow/remark-embed/dist/src" "node_modules/@portaljs/remark-embed/dist/src"
], ],
"@/*": ["./*"] "@/*": ["./*"]
}, },