Skip to content

Commit

Permalink
Merge pull request #950 from datopian/site-deps-update
Browse files Browse the repository at this point in the history
Replace `@flowershow/*` with `@portaljs/*` packages in /site
  • Loading branch information
demenech authored Jun 16, 2023
2 parents 3352191 + c79b69f commit ed8de38
Show file tree
Hide file tree
Showing 16 changed files with 760 additions and 882 deletions.
2 changes: 1 addition & 1 deletion site/config/siteConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defaultConfig } from "@flowershow/core";
import { defaultConfig } from "@portaljs/core";
import userConfig from "../content/config";

export const siteConfig: any = {
Expand Down
2 changes: 1 addition & 1 deletion site/content/blog/markdowndb-basics-tutorial-2023.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

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:

Expand Down
8 changes: 4 additions & 4 deletions site/content/howto/blog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

## 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
npm i @flowershow/core
npm i @portaljs/core
```

## Create home page for your blogs

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
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`
export default function BlogIndex({ blogs, title, description }) {
Expand Down Expand Up @@ -47,7 +47,7 @@ interface Blog {
Add the following code to your blog pages, e.g. to `/pages/blog/[...slug].tsx`:

```tsx
import { BlogLayout } from "@flowershow/core";
import { BlogLayout } from "@portaljs/core";

export default BlogPost({ content, title, date, authors }) {
return (
Expand Down
4 changes: 2 additions & 2 deletions site/content/howto/comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ NEXT_PUBLIC_DISQUS_SHORTNAME=

## 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
npm i @flowershow/core
npm i @portaljs/core
```

Then, add the following to your custom layout (or directly to your pages):
Expand Down
2 changes: 1 addition & 1 deletion site/layouts/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
SimpleLayout,
UnstyledLayout,
} from "@flowershow/core";
} from "@portaljs/core";
import { BlogLayout } from "./blog";
import DefaultLayout from "./default";
import { DocsLayout } from "./docs";
Expand Down
6 changes: 3 additions & 3 deletions site/lib/markdown.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import matter from "gray-matter";
import mdxmermaid from "mdx-mermaid";
import { h } from "hastscript";
import remarkCallouts from "@flowershow/remark-callouts";
import remarkEmbed from "@flowershow/remark-embed";
import remarkCallouts from "@portaljs/remark-callouts";
import remarkEmbed from "@portaljs/remark-embed";
import remarkGfm from "remark-gfm";
import remarkMath from "remark-math";
import remarkSmartypants from "remark-smartypants";
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 rehypeKatex from "rehype-katex";
import rehypeSlug from "rehype-slug";
Expand Down
2 changes: 1 addition & 1 deletion site/lib/mddb.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MarkdownDB } from "@flowershow/markdowndb";
import { MarkdownDB } from "mddb";
// import config from "./markdowndb.config.js";

// TODO get this path from markdowndb.config.js or something
Expand Down
1,574 changes: 726 additions & 848 deletions site/package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
"mddb": "mddb content"
},
"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",
"@heroicons/react": "^1.0.3",
"@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",
"clsx": "^1.2.1",
"gray-matter": "^4.0.3",
"hastscript": "^7.2.0",
"mddb": "^0.1.9",
"next": "^13.2.1",
"next-mdx-remote": "^4.4.1",
"next-seo": "^5.15.0",
Expand All @@ -45,17 +45,17 @@
"remark-slug": "^6.1.0",
"remark-smartypants": "^2.0.0",
"remark-toc": "^7.2.0",
"strip-markdown": "^5.0.0",
"vega": "^5.20.2",
"vega-lite": "^5.1.0",
"strip-markdown": "^5.0.0"
"vega-lite": "^5.1.0"
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.9",
"autoprefixer": "^10.4.14",
"postcss": "^8.4.22",
"prettier": "^2.8.7",
"remark": "^14.0.2",
"tailwindcss": "^3.3.1",
"typescript": "^5.0.4",
"remark": "^14.0.2"
"typescript": "^5.0.4"
}
}
2 changes: 1 addition & 1 deletion site/pages/[...slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import clientPromise from '@/lib/mddb';
import Layout from 'components/Layout';
import { useEffect, useState } from 'react';
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 { CustomAppProps } from './_app.jsx';
import computeFields from '@/lib/computeFields';
Expand Down
2 changes: 1 addition & 1 deletion site/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Script from "next/script";

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 { useEffect } from "react";
import { useRouter } from "next/dist/client/router";
Expand Down
2 changes: 1 addition & 1 deletion site/pages/blog.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Layout from '@/components/Layout';
import computeFields from '@/lib/computeFields';
import clientPromise from '@/lib/mddb';
import { BlogsList, SimpleLayout } from '@flowershow/core';
import { BlogsList, SimpleLayout } from '@portaljs/core';
import * as fs from 'fs';

export default function Blog({ blogs }) {
Expand Down
2 changes: 1 addition & 1 deletion site/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Showcases from '@/components/Showcases';
import Layout from '../components/Layout';
import { useRouter } from 'next/router';
import { useEffect, useState } from 'react';
import { collectHeadings } from '@flowershow/core';
import { collectHeadings } from '@portaljs/core';

export default function Home({ sidebarTree }) {
const router = useRouter();
Expand Down
2 changes: 1 addition & 1 deletion site/styles/globals.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "@flowershow/remark-callouts/styles.css";
@import "@portaljs/remark-callouts/styles.css";
@import './prism.css';

html,
Expand Down
4 changes: 2 additions & 2 deletions site/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ module.exports = {
"./components/**/*.jsx",
"./components/**/*.tsx",
"./lib/markdown.mjs",
"./node_modules/@flowershow/core/dist/*.js",
"./node_modules/@flowershow/core/*.js",
"./node_modules/@portaljs/core/dist/*.js",
"./node_modules/@portaljs/core/*.js",
],
darkMode: "class", // or 'media' or 'class'
theme: {
Expand Down
10 changes: 5 additions & 5 deletions site/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@flowershow/core": ["node_modules/@flowershow/core/dist/src"],
"@flowershow/remark-callouts": [
"node_modules/@flowershow/remark-callouts/dist/src"
"@portaljs/core": ["node_modules/@portaljs/core/dist/src"],
"@portaljs/remark-callouts": [
"node_modules/@portaljs/remark-callouts/dist/src"
],
"@flowershow/remark-embed": [
"node_modules/@flowershow/remark-embed/dist/src"
"@portaljs/remark-embed": [
"node_modules/@portaljs/remark-embed/dist/src"
],
"@/*": ["./*"]
},
Expand Down

1 comment on commit ed8de38

@vercel
Copy link

@vercel vercel bot commented on ed8de38 Jun 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.