From 23d914971291b39500abf3441e4160142278fb86 Mon Sep 17 00:00:00 2001 From: Timothy Lin Date: Sun, 16 Jul 2023 18:17:27 +0800 Subject: [PATCH 1/3] simplify repository exports --- .changeset/fuzzy-apples-judge.md | 5 +++++ packages/pliny/add-use-client.mjs | 4 +++- packages/pliny/src/analytics.ts | 1 - packages/pliny/src/comments.ts | 1 - packages/pliny/src/comments/index.tsx | 27 +++------------------------ packages/pliny/src/mdx-plugins.ts | 1 - packages/pliny/src/newsletter.ts | 1 - 7 files changed, 11 insertions(+), 29 deletions(-) create mode 100644 .changeset/fuzzy-apples-judge.md delete mode 100644 packages/pliny/src/analytics.ts delete mode 100644 packages/pliny/src/comments.ts delete mode 100644 packages/pliny/src/mdx-plugins.ts delete mode 100644 packages/pliny/src/newsletter.ts diff --git a/.changeset/fuzzy-apples-judge.md b/.changeset/fuzzy-apples-judge.md new file mode 100644 index 0000000..2a619c5 --- /dev/null +++ b/.changeset/fuzzy-apples-judge.md @@ -0,0 +1,5 @@ +--- +'pliny': patch +--- + +Remove dynamic load of comments diff --git a/packages/pliny/add-use-client.mjs b/packages/pliny/add-use-client.mjs index b45de6b..db8ff92 100644 --- a/packages/pliny/add-use-client.mjs +++ b/packages/pliny/add-use-client.mjs @@ -5,7 +5,9 @@ import globby from 'globby' // So these packages can be directly used in Next.js directly ;(async () => { const clientPaths = await globby([ - 'comments/*.js', + 'comments/Disqus.js', + 'comments/Giscus.js', + 'comments/Utterances.js', 'search/*.js', 'ui/NewsletterForm.js', 'ui/Pre.js', diff --git a/packages/pliny/src/analytics.ts b/packages/pliny/src/analytics.ts deleted file mode 100644 index bb499fa..0000000 --- a/packages/pliny/src/analytics.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './analytics/index' diff --git a/packages/pliny/src/comments.ts b/packages/pliny/src/comments.ts deleted file mode 100644 index 48a279c..0000000 --- a/packages/pliny/src/comments.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './comments/index' diff --git a/packages/pliny/src/comments/index.tsx b/packages/pliny/src/comments/index.tsx index b55502c..fd21b71 100644 --- a/packages/pliny/src/comments/index.tsx +++ b/packages/pliny/src/comments/index.tsx @@ -1,4 +1,3 @@ -import dynamic from 'next/dynamic.js' import { Disqus, DisqusConfig, DisqusProps } from './Disqus' import { Giscus, GiscusConfig, GiscusProps } from './Giscus' import { Utterances, UtterancesConfig, UtterancesProps } from './Utterances' @@ -45,26 +44,6 @@ export interface CommentsProps { slug?: string } -const UtterancesComponent = dynamic( - () => { - return import('./Utterances').then((mod) => mod.Utterances) - }, - { ssr: false } -) -const GiscusComponent = dynamic( - () => { - return import('./Giscus').then((mod) => mod.Giscus) - }, - { ssr: false } -) - -const DisqusComponent = dynamic( - () => { - return import('./Disqus').then((mod) => mod.Disqus) - }, - { ssr: false } -) - /** * Supports Giscus, Utterances or Disqus * If you want to use a comments provider you have to add it to the @@ -77,11 +56,11 @@ const DisqusComponent = dynamic( export const Comments = ({ commentsConfig, slug }: CommentsProps) => { switch (commentsConfig.provider) { case 'giscus': - return + return case 'utterances': - return + return case 'disqus': - return + return } } diff --git a/packages/pliny/src/mdx-plugins.ts b/packages/pliny/src/mdx-plugins.ts deleted file mode 100644 index 65c0dfa..0000000 --- a/packages/pliny/src/mdx-plugins.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './mdx-plugins/index' diff --git a/packages/pliny/src/newsletter.ts b/packages/pliny/src/newsletter.ts deleted file mode 100644 index fcded98..0000000 --- a/packages/pliny/src/newsletter.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './newsletter/index' From 86b57e7448c1fd5904c9637d0e6c016aaadf3d0e Mon Sep 17 00:00:00 2001 From: Timothy Lin Date: Sun, 16 Jul 2023 18:18:39 +0800 Subject: [PATCH 2/3] add sample css for algolia --- .changeset/proud-brooms-laugh.md | 5 + packages/pliny/package.json | 7 +- packages/pliny/public/algolia.css | 796 ++++++++++++++++++++++++++++++ packages/pliny/tsconfig.json | 2 +- yarn.lock | 110 ++++- 5 files changed, 913 insertions(+), 7 deletions(-) create mode 100644 .changeset/proud-brooms-laugh.md create mode 100644 packages/pliny/public/algolia.css diff --git a/.changeset/proud-brooms-laugh.md b/.changeset/proud-brooms-laugh.md new file mode 100644 index 0000000..303f983 --- /dev/null +++ b/.changeset/proud-brooms-laugh.md @@ -0,0 +1,5 @@ +--- +'pliny': patch +--- + +Export example css for algolia diff --git a/packages/pliny/package.json b/packages/pliny/package.json index 17fb1ff..759671c 100644 --- a/packages/pliny/package.json +++ b/packages/pliny/package.json @@ -18,14 +18,16 @@ "**" ], "scripts": { - "dev": "tsup-node --watch && cp -fR dist/* ./ && rimraf dist && node add-use-client.mjs", - "build": "rimraf dist && tsup-node && cp -fR dist/* ./ && rimraf dist && node add-use-client.mjs" + "dev": "tsup-node --watch && cp -fR dist/* ./ && rimraf dist && node add-use-client.mjs && yarn copyfiles", + "build": "rimraf dist && tsup && cp -fR dist/* ./ && rimraf dist && node add-use-client.mjs && yarn copyfiles", + "copyfiles": "copyfiles -f public/algolia.css search" }, "author": "Timothy Lin (https://timlrx.com)", "dependencies": { "@docsearch/react": "^3.5.0", "@mailchimp/mailchimp_marketing": "^3.0.80", "contentlayer": "^0.3.4", + "copyfiles": "^2.4.1", "github-slugger": "^1.4.0", "image-size": "1.0.0", "js-yaml": "4.1.0", @@ -41,6 +43,7 @@ "react-dom": "^17.0.2 || ^18.0.0" }, "devDependencies": { + "@types/copyfiles": "^2", "next": "13.4.10", "react": "18.2.0", "react-dom": "18.2.0", diff --git a/packages/pliny/public/algolia.css b/packages/pliny/public/algolia.css new file mode 100644 index 0000000..ec705b2 --- /dev/null +++ b/packages/pliny/public/algolia.css @@ -0,0 +1,796 @@ +/* Original css taken from @docsearch/css */ +:root { + --docsearch-primary-color: #5468ff; + --docsearch-text-color: #1c1e21; + --docsearch-spacing: 12px; + --docsearch-icon-stroke-width: 1.4; + --docsearch-highlight-color: var(--docsearch-primary-color); + --docsearch-muted-color: #969faf; + --docsearch-container-background: rgba(101, 108, 133, 0.8); + --docsearch-logo-color: #5468ff; + --docsearch-modal-width: 560px; + --docsearch-modal-height: 600px; + --docsearch-modal-background: #f5f6f7; + --docsearch-modal-shadow: inset 1px 1px 0 0 hsla(0, 0%, 100%, 0.5), 0 3px 8px 0 #555a64; + --docsearch-searchbox-height: 56px; + --docsearch-searchbox-background: #ebedf0; + --docsearch-searchbox-focus-background: #fff; + --docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color); + --docsearch-hit-height: 56px; + --docsearch-hit-color: #444950; + --docsearch-hit-active-color: #fff; + --docsearch-hit-background: #fff; + --docsearch-hit-shadow: 0 1px 3px 0 #d4d9e1; + --docsearch-key-gradient: linear-gradient(-225deg, #d5dbe4, #f8f8f8); + --docsearch-key-shadow: inset 0 -2px 0 0 #cdcde6, inset 0 0 1px 1px #fff, + 0 1px 2px 1px rgba(30, 35, 90, 0.4); + --docsearch-footer-height: 44px; + --docsearch-footer-background: #fff; + --docsearch-footer-shadow: 0 -1px 0 0 #e0e3e8, 0 -3px 6px 0 rgba(69, 98, 155, 0.12); +} + +html[data-theme='dark'] { + --docsearch-text-color: #f5f6f7; + --docsearch-container-background: rgba(9, 10, 17, 0.8); + --docsearch-modal-background: #15172a; + --docsearch-modal-shadow: inset 1px 1px 0 0 #2c2e40, 0 3px 8px 0 #000309; + --docsearch-searchbox-background: #090a11; + --docsearch-searchbox-focus-background: #000; + --docsearch-hit-color: #bec3c9; + --docsearch-hit-shadow: none; + --docsearch-hit-background: #090a11; + --docsearch-key-gradient: linear-gradient(-26.5deg, #565872, #31355b); + --docsearch-key-shadow: inset 0 -2px 0 0 #282d55, inset 0 0 1px 1px #51577d, + 0 2px 2px 0 rgba(3, 4, 9, 0.3); + --docsearch-footer-background: #1e2136; + --docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, 0.5), 0 -4px 8px 0 rgba(0, 0, 0, 0.2); + --docsearch-logo-color: #fff; + --docsearch-muted-color: #7f8497; +} + +.DocSearch-Button { + align-items: center; + background: var(--docsearch-searchbox-background); + border: 0; + border-radius: 40px; + color: var(--docsearch-muted-color); + cursor: pointer; + display: flex; + font-weight: 500; + height: 36px; + justify-content: space-between; + margin: 0 0 0 16px; + padding: 0 8px; + user-select: none; +} + +.DocSearch-Button:active, +.DocSearch-Button:focus, +.DocSearch-Button:hover { + background: var(--docsearch-searchbox-focus-background); + box-shadow: var(--docsearch-searchbox-shadow); + color: var(--docsearch-text-color); + outline: none; +} + +.DocSearch-Button-Container { + align-items: center; + display: flex; +} + +.DocSearch-Search-Icon { + stroke-width: 1.6; +} + +.DocSearch-Button .DocSearch-Search-Icon { + color: var(--docsearch-text-color); +} + +.DocSearch-Button-Placeholder { + font-size: 1rem; + padding: 0 12px 0 6px; +} + +.DocSearch-Button-Keys { + display: flex; + min-width: calc(40px + 0.8em); +} + +.DocSearch-Button-Key { + align-items: center; + background: var(--docsearch-key-gradient); + border-radius: 3px; + box-shadow: var(--docsearch-key-shadow); + color: var(--docsearch-muted-color); + display: flex; + height: 18px; + justify-content: center; + margin-right: 0.4em; + position: relative; + padding: 0 0 2px; + border: 0; + top: -1px; + width: 20px; +} + +@media (max-width: 768px) { + .DocSearch-Button-Keys, + .DocSearch-Button-Placeholder { + display: none; + } +} + +.DocSearch--active { + overflow: hidden !important; +} + +.DocSearch-Container, +.DocSearch-Container * { + box-sizing: border-box; +} + +.DocSearch-Container { + background-color: var(--docsearch-container-background); + height: 100vh; + left: 0; + position: fixed; + top: 0; + width: 100vw; + z-index: 200; +} + +.DocSearch-Container a { + text-decoration: none; +} + +.DocSearch-Link { + appearance: none; + background: none; + border: 0; + color: var(--docsearch-highlight-color); + cursor: pointer; + font: inherit; + margin: 0; + padding: 0; +} + +.DocSearch-Modal { + background: var(--docsearch-modal-background); + border-radius: 6px; + box-shadow: var(--docsearch-modal-shadow); + flex-direction: column; + margin: 60px auto auto; + max-width: var(--docsearch-modal-width); + position: relative; +} + +.DocSearch-SearchBar { + display: flex; + padding: var(--docsearch-spacing) var(--docsearch-spacing) 0; +} + +.DocSearch-Form { + align-items: center; + background: var(--docsearch-searchbox-focus-background); + border-radius: 4px; + box-shadow: var(--docsearch-searchbox-shadow); + display: flex; + height: var(--docsearch-searchbox-height); + margin: 0; + padding: 0 var(--docsearch-spacing); + position: relative; + width: 100%; +} + +.DocSearch-Input { + appearance: none; + background: transparent; + border: 0; + color: var(--docsearch-text-color); + flex: 1; + font: inherit; + font-size: 1.2em; + height: 100%; + outline: none; + padding: 0 0 0 8px; + width: 80%; +} + +.DocSearch-Input::placeholder { + color: var(--docsearch-muted-color); + opacity: 1; +} + +.DocSearch-Input::-webkit-search-cancel-button, +.DocSearch-Input::-webkit-search-decoration, +.DocSearch-Input::-webkit-search-results-button, +.DocSearch-Input::-webkit-search-results-decoration { + display: none; +} + +.DocSearch-LoadingIndicator, +.DocSearch-MagnifierLabel, +.DocSearch-Reset { + margin: 0; + padding: 0; +} + +.DocSearch-MagnifierLabel, +.DocSearch-Reset { + align-items: center; + color: var(--docsearch-highlight-color); + display: flex; + justify-content: center; +} + +.DocSearch-Container--Stalled .DocSearch-MagnifierLabel, +.DocSearch-LoadingIndicator { + display: none; +} + +.DocSearch-Container--Stalled .DocSearch-LoadingIndicator { + align-items: center; + color: var(--docsearch-highlight-color); + display: flex; + justify-content: center; +} + +@media screen and (prefers-reduced-motion: reduce) { + .DocSearch-Reset { + animation: none; + appearance: none; + background: none; + border: 0; + border-radius: 50%; + color: var(--docsearch-icon-color); + cursor: pointer; + right: 0; + stroke-width: var(--docsearch-icon-stroke-width); + } +} + +.DocSearch-Reset { + animation: fade-in 0.1s ease-in forwards; + appearance: none; + background: none; + border: 0; + border-radius: 50%; + color: var(--docsearch-icon-color); + cursor: pointer; + padding: 2px; + right: 0; + stroke-width: var(--docsearch-icon-stroke-width); +} + +.DocSearch-Reset[hidden] { + display: none; +} + +.DocSearch-Reset:hover { + color: var(--docsearch-highlight-color); +} + +.DocSearch-LoadingIndicator svg, +.DocSearch-MagnifierLabel svg { + height: 24px; + width: 24px; +} + +.DocSearch-Cancel { + display: none; +} + +.DocSearch-Dropdown { + max-height: calc( + var(--docsearch-modal-height) - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - + var(--docsearch-footer-height) + ); + min-height: var(--docsearch-spacing); + overflow-y: auto; + overflow-y: overlay; + padding: 0 var(--docsearch-spacing); + scrollbar-color: var(--docsearch-muted-color) var(--docsearch-modal-background); + scrollbar-width: thin; +} + +.DocSearch-Dropdown::-webkit-scrollbar { + width: 12px; +} + +.DocSearch-Dropdown::-webkit-scrollbar-track { + background: transparent; +} + +.DocSearch-Dropdown::-webkit-scrollbar-thumb { + background-color: var(--docsearch-muted-color); + border: 3px solid var(--docsearch-modal-background); + border-radius: 20px; +} + +.DocSearch-Dropdown ul { + list-style: none; + margin: 0; + padding: 0; +} + +.DocSearch-Label { + font-size: 0.75em; + line-height: 1.6em; +} + +.DocSearch-Help, +.DocSearch-Label { + color: var(--docsearch-muted-color); +} + +.DocSearch-Help { + font-size: 0.9em; + margin: 0; + user-select: none; +} + +.DocSearch-Title { + font-size: 1.2em; +} + +.DocSearch-Logo a { + display: flex; +} + +.DocSearch-Logo svg { + color: var(--docsearch-logo-color); + margin-left: 8px; +} + +.DocSearch-Hits:last-of-type { + margin-bottom: 24px; +} + +.DocSearch-Hits mark { + background: none; + color: var(--docsearch-highlight-color); +} + +.DocSearch-HitsFooter { + color: var(--docsearch-muted-color); + display: flex; + font-size: 0.85em; + justify-content: center; + margin-bottom: var(--docsearch-spacing); + padding: var(--docsearch-spacing); +} + +.DocSearch-HitsFooter a { + border-bottom: 1px solid; + color: inherit; +} + +.DocSearch-Hit { + border-radius: 4px; + display: flex; + padding-bottom: 4px; + position: relative; +} + +@media screen and (prefers-reduced-motion: reduce) { + .DocSearch-Hit--deleting { + transition: none; + } +} + +.DocSearch-Hit--deleting { + opacity: 0; + transition: all 0.25s linear; +} + +@media screen and (prefers-reduced-motion: reduce) { + .DocSearch-Hit--favoriting { + transition: none; + } +} + +.DocSearch-Hit--favoriting { + transform: scale(0); + transform-origin: top center; + transition: all 0.25s linear; + transition-delay: 0.25s; +} + +.DocSearch-Hit a { + background: var(--docsearch-hit-background); + border-radius: 4px; + box-shadow: var(--docsearch-hit-shadow); + display: block; + padding-left: var(--docsearch-spacing); + width: 100%; +} + +.DocSearch-Hit-source { + background: var(--docsearch-modal-background); + color: var(--docsearch-highlight-color); + font-size: 0.85em; + font-weight: 600; + line-height: 32px; + margin: 0 -4px; + padding: 8px 4px 0; + position: sticky; + top: 0; + z-index: 10; +} + +.DocSearch-Hit-Tree { + color: var(--docsearch-muted-color); + height: var(--docsearch-hit-height); + opacity: 0.5; + stroke-width: var(--docsearch-icon-stroke-width); + width: 24px; +} + +.DocSearch-Hit[aria-selected='true'] a { + background-color: var(--docsearch-highlight-color); +} + +.DocSearch-Hit[aria-selected='true'] mark { + text-decoration: underline; +} + +.DocSearch-Hit-Container { + align-items: center; + color: var(--docsearch-hit-color); + display: flex; + flex-direction: row; + height: var(--docsearch-hit-height); + padding: 0 var(--docsearch-spacing) 0 0; +} + +.DocSearch-Hit-icon { + height: 20px; + width: 20px; +} + +.DocSearch-Hit-action, +.DocSearch-Hit-icon { + color: var(--docsearch-muted-color); + stroke-width: var(--docsearch-icon-stroke-width); +} + +.DocSearch-Hit-action { + align-items: center; + display: flex; + height: 22px; + width: 22px; +} + +.DocSearch-Hit-action svg { + display: block; + height: 18px; + width: 18px; +} + +.DocSearch-Hit-action + .DocSearch-Hit-action { + margin-left: 6px; +} + +.DocSearch-Hit-action-button { + appearance: none; + background: none; + border: 0; + border-radius: 50%; + color: inherit; + cursor: pointer; + padding: 2px; +} + +svg.DocSearch-Hit-Select-Icon { + display: none; +} + +.DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-Select-Icon { + display: block; +} + +.DocSearch-Hit-action-button:focus, +.DocSearch-Hit-action-button:hover { + background: rgba(0, 0, 0, 0.2); + transition: background-color 0.1s ease-in; +} + +@media screen and (prefers-reduced-motion: reduce) { + .DocSearch-Hit-action-button:focus, + .DocSearch-Hit-action-button:hover { + transition: none; + } +} + +.DocSearch-Hit-action-button:focus path, +.DocSearch-Hit-action-button:hover path { + fill: #fff; +} + +.DocSearch-Hit-content-wrapper { + display: flex; + flex: 1 1 auto; + flex-direction: column; + font-weight: 500; + justify-content: center; + line-height: 1.2em; + margin: 0 8px; + overflow-x: hidden; + position: relative; + text-overflow: ellipsis; + white-space: nowrap; + width: 80%; +} + +.DocSearch-Hit-title { + font-size: 0.9em; +} + +.DocSearch-Hit-path { + color: var(--docsearch-muted-color); + font-size: 0.75em; +} + +.DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-action, +.DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-icon, +.DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-path, +.DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-text, +.DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-title, +.DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-Tree, +.DocSearch-Hit[aria-selected='true'] mark { + color: var(--docsearch-hit-active-color) !important; +} + +@media screen and (prefers-reduced-motion: reduce) { + .DocSearch-Hit-action-button:focus, + .DocSearch-Hit-action-button:hover { + background: rgba(0, 0, 0, 0.2); + transition: none; + } +} + +.DocSearch-ErrorScreen, +.DocSearch-NoResults, +.DocSearch-StartScreen { + font-size: 0.9em; + margin: 0 auto; + padding: 36px 0; + text-align: center; + width: 80%; +} + +.DocSearch-Screen-Icon { + color: var(--docsearch-muted-color); + padding-bottom: 12px; +} + +.DocSearch-NoResults-Prefill-List { + display: inline-block; + padding-bottom: 24px; + text-align: left; +} + +.DocSearch-NoResults-Prefill-List ul { + display: inline-block; + padding: 8px 0 0; +} + +.DocSearch-NoResults-Prefill-List li { + list-style-position: inside; + list-style-type: 'ยป '; +} + +.DocSearch-Prefill { + appearance: none; + background: none; + border: 0; + border-radius: 1em; + color: var(--docsearch-highlight-color); + cursor: pointer; + display: inline-block; + font-size: 1em; + font-weight: 700; + padding: 0; +} + +.DocSearch-Prefill:focus, +.DocSearch-Prefill:hover { + outline: none; + text-decoration: underline; +} + +.DocSearch-Footer { + align-items: center; + background: var(--docsearch-footer-background); + border-radius: 0 0 8px 8px; + box-shadow: var(--docsearch-footer-shadow); + display: flex; + flex-direction: row-reverse; + flex-shrink: 0; + height: var(--docsearch-footer-height); + justify-content: space-between; + padding: 0 var(--docsearch-spacing); + position: relative; + user-select: none; + width: 100%; + z-index: 300; +} + +.DocSearch-Commands { + color: var(--docsearch-muted-color); + display: flex; + list-style: none; + margin: 0; + padding: 0; +} + +.DocSearch-Commands li { + align-items: center; + display: flex; +} + +.DocSearch-Commands li:not(:last-of-type) { + margin-right: 0.8em; +} + +.DocSearch-Commands-Key { + align-items: center; + background: var(--docsearch-key-gradient); + border-radius: 2px; + box-shadow: var(--docsearch-key-shadow); + display: flex; + height: 18px; + justify-content: center; + margin-right: 0.4em; + padding: 0 0 1px; + color: var(--docsearch-muted-color); + border: 0; + width: 20px; +} + +@media (max-width: 768px) { + :root { + --docsearch-spacing: 10px; + --docsearch-footer-height: 40px; + } + + .DocSearch-Dropdown { + height: 100%; + } + + .DocSearch-Container { + height: 100vh; + height: -webkit-fill-available; + height: calc(var(--docsearch-vh, 1vh) * 100); + position: absolute; + } + + .DocSearch-Footer { + border-radius: 0; + bottom: 0; + position: absolute; + } + + .DocSearch-Hit-content-wrapper { + display: flex; + position: relative; + width: 80%; + } + + .DocSearch-Modal { + border-radius: 0; + box-shadow: none; + height: 100vh; + height: -webkit-fill-available; + height: calc(var(--docsearch-vh, 1vh) * 100); + margin: 0; + max-width: 100%; + width: 100%; + } + + .DocSearch-Dropdown { + max-height: calc( + var(--docsearch-vh, 1vh) * 100 - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - + var(--docsearch-footer-height) + ); + } + + .DocSearch-Cancel { + appearance: none; + background: none; + border: 0; + color: var(--docsearch-highlight-color); + cursor: pointer; + display: inline-block; + flex: none; + font: inherit; + font-size: 1em; + font-weight: 500; + margin-left: var(--docsearch-spacing); + outline: none; + overflow: hidden; + padding: 0; + user-select: none; + white-space: nowrap; + } + + .DocSearch-Commands, + .DocSearch-Hit-Tree { + display: none; + } +} + +@keyframes fade-in { + 0% { + opacity: 0; + } + + to { + opacity: 1; + } +} + +/* Custom overrides to work with a primary tailwind css theme */ + +.light .DocSearch { + --docsearch-primary-color: theme(colors.primary.600); + --docsearch-highlight-color: theme(colors.primary.600); + --docsearch-searchbox-shadow: inset 0 0 0 2px theme(colors.primary.600); + --docsearch-muted-color: theme(colors.gray.500); + --docsearch-container-background: theme(colors.gray.400 / 80%); + /* Modal */ + --docsearch-modal-background: theme(colors.gray.200); + /* Search box */ + --docsearch-searchbox-background: theme(colors.gray.100); + --docsearch-searchbox-focus-background: theme(colors.gray.100); + /* Hit */ + --docsearch-hit-color: theme(colors.gray.700); + --docsearch-hit-shadow: none; + --docsearch-hit-active-color: theme(colors.gray.800); + --docsearch-hit-background: theme(colors.gray.100); + /* Footer */ + --docsearch-footer-background: theme(colors.gray.100); +} + +.dark .DocSearch { + --docsearch-primary-color: theme(colors.primary.600); + --docsearch-highlight-color: theme(colors.primary.600); + --docsearch-searchbox-shadow: inset 0 0 0 2px theme(colors.primary.600); + --docsearch-text-color: theme(colors.gray.200); + --docsearch-muted-color: theme(colors.gray.400); + --docsearch-container-background: theme(colors.gray.900 / 80%); + /* Modal */ + --docsearch-modal-background: theme(colors.gray.900); + --docsearch-modal-shadow: inset 1px 1px 0 0 rgb(44, 46, 64), 0 3px 8px 0 rgb(0, 3, 9); + /* Search box */ + --docsearch-searchbox-background: theme(colors.gray.800); + --docsearch-searchbox-focus-background: theme(colors.gray.800); + /* Hit */ + --docsearch-hit-color: theme(colors.gray.200); + --docsearch-hit-shadow: none; + --docsearch-hit-active-color: theme(colors.gray.100); + --docsearch-hit-background: theme(colors.gray.800); + /* Footer */ + --docsearch-footer-background: theme(colors.gray.900); + --docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, 0.5), 0 -4px 8px 0 rgba(0, 0, 0, 0.2); + --docsearch-key-gradient: linear-gradient( + -26.5deg, + theme(colors.gray.800) 0%, + theme(colors.gray.900) 100% + ); + --docsearch-key-shadow: inset 0 -2px 0 0 rgb(40, 45, 85), inset 0 0 1px 1px rgb(81, 87, 125), + 0 2px 2px 0 rgba(3, 4, 9, 0.3); + --docsearch-logo-color: theme(colors.gray.300); +} + +.light .DocSearch-Input { + @apply hover: ring-0 ring-0; +} + +.dark .DocSearch-Input { + @apply hover: ring-0 ring-0; +} + +.DocSearch-Container { + @apply backdrop-blur; +} diff --git a/packages/pliny/tsconfig.json b/packages/pliny/tsconfig.json index 7384cc4..bcbb125 100644 --- a/packages/pliny/tsconfig.json +++ b/packages/pliny/tsconfig.json @@ -7,5 +7,5 @@ "module": "ES2020", "moduleResolution": "node" }, - "exclude": ["dist", "node_modules"] + "exclude": ["dist", "node_modules", "public"] } diff --git a/yarn.lock b/yarn.lock index 9085a55..cf23a7d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1922,6 +1922,13 @@ __metadata: languageName: node linkType: hard +"@types/copyfiles@npm:^2": + version: 2.4.1 + resolution: "@types/copyfiles@npm:2.4.1" + checksum: e586284f736c5e1336c7760972db44c26cb4aa02a7fea0d31694306b5569a499546f35990aec9c007df7506a9c0ab62ddb019d96d054560d39d423ebd5ecb917 + languageName: node + linkType: hard + "@types/debug@npm:^4.0.0": version: 4.1.7 resolution: "@types/debug@npm:4.1.7" @@ -3318,6 +3325,24 @@ __metadata: languageName: node linkType: hard +"copyfiles@npm:^2.4.1": + version: 2.4.1 + resolution: "copyfiles@npm:2.4.1" + dependencies: + glob: ^7.0.5 + minimatch: ^3.0.3 + mkdirp: ^1.0.4 + noms: 0.0.0 + through2: ^2.0.1 + untildify: ^4.0.0 + yargs: ^16.1.0 + bin: + copyfiles: copyfiles + copyup: copyfiles + checksum: aea69873bb99cc5f553967660cbfb70e4eeda198f572a36fb0f748b36877ff2c90fd906c58b1d540adbad8afa8ee82820172f1c18e69736f7ab52792c12745a7 + languageName: node + linkType: hard + "core-js-pure@npm:^3.25.1": version: 3.26.0 resolution: "core-js-pure@npm:3.26.0" @@ -4760,7 +4785,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^7.1.3, glob@npm:^7.1.4": +"glob@npm:^7.0.5, glob@npm:^7.1.3, glob@npm:^7.1.4": version: 7.2.3 resolution: "glob@npm:7.2.3" dependencies: @@ -5208,7 +5233,7 @@ __metadata: languageName: node linkType: hard -"inherits@npm:2, inherits@npm:^2.0.3, inherits@npm:~2.0.3": +"inherits@npm:2, inherits@npm:^2.0.1, inherits@npm:^2.0.3, inherits@npm:~2.0.1, inherits@npm:~2.0.3": version: 2.0.4 resolution: "inherits@npm:2.0.4" checksum: 4a48a733847879d6cf6691860a6b1e3f0f4754176e4d71494c41f3475553768b10f84b5ce1d40fbd0e34e6bfbb864ee35858ad4dd2cf31e02fc4a154b724d7f1 @@ -5570,6 +5595,13 @@ __metadata: languageName: node linkType: hard +"isarray@npm:0.0.1": + version: 0.0.1 + resolution: "isarray@npm:0.0.1" + checksum: 49191f1425681df4a18c2f0f93db3adb85573bcdd6a4482539d98eac9e705d8961317b01175627e860516a2fc45f8f9302db26e5a380a97a520e272e2a40a8d4 + languageName: node + linkType: hard + "isarray@npm:~1.0.0": version: 1.0.0 resolution: "isarray@npm:1.0.0" @@ -6715,7 +6747,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": +"minimatch@npm:^3.0.3, minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": version: 3.1.2 resolution: "minimatch@npm:3.1.2" dependencies: @@ -7060,6 +7092,16 @@ __metadata: languageName: node linkType: hard +"noms@npm:0.0.0": + version: 0.0.0 + resolution: "noms@npm:0.0.0" + dependencies: + inherits: ^2.0.1 + readable-stream: ~1.0.31 + checksum: a05f056dabf764c86472b6b5aad10455f3adcb6971f366cdf36a72b559b29310a940e316bca30802f2804fdd41707941366224f4cba80c4f53071512245bf200 + languageName: node + linkType: hard + "nopt@npm:^6.0.0": version: 6.0.0 resolution: "nopt@npm:6.0.0" @@ -7567,7 +7609,9 @@ __metadata: dependencies: "@docsearch/react": ^3.5.0 "@mailchimp/mailchimp_marketing": ^3.0.80 + "@types/copyfiles": ^2 contentlayer: ^0.3.4 + copyfiles: ^2.4.1 github-slugger: ^1.4.0 image-size: 1.0.0 js-yaml: 4.1.0 @@ -7928,6 +7972,33 @@ __metadata: languageName: node linkType: hard +"readable-stream@npm:~1.0.31": + version: 1.0.34 + resolution: "readable-stream@npm:1.0.34" + dependencies: + core-util-is: ~1.0.0 + inherits: ~2.0.1 + isarray: 0.0.1 + string_decoder: ~0.10.x + checksum: 85042c537e4f067daa1448a7e257a201070bfec3dd2706abdbd8ebc7f3418eb4d3ed4b8e5af63e2544d69f88ab09c28d5da3c0b77dc76185fddd189a59863b60 + languageName: node + linkType: hard + +"readable-stream@npm:~2.3.6": + version: 2.3.8 + resolution: "readable-stream@npm:2.3.8" + dependencies: + core-util-is: ~1.0.0 + inherits: ~2.0.3 + isarray: ~1.0.0 + process-nextick-args: ~2.0.0 + safe-buffer: ~5.1.1 + string_decoder: ~1.1.1 + util-deprecate: ~1.0.1 + checksum: 65645467038704f0c8aaf026a72fbb588a9e2ef7a75cd57a01702ee9db1c4a1e4b03aaad36861a6a0926546a74d174149c8c207527963e0c2d3eee2f37678a42 + languageName: node + linkType: hard + "readdirp@npm:~3.6.0": version: 3.6.0 resolution: "readdirp@npm:3.6.0" @@ -8754,6 +8825,13 @@ __metadata: languageName: node linkType: hard +"string_decoder@npm:~0.10.x": + version: 0.10.31 + resolution: "string_decoder@npm:0.10.31" + checksum: fe00f8e303647e5db919948ccb5ce0da7dea209ab54702894dd0c664edd98e5d4df4b80d6fabf7b9e92b237359d21136c95bf068b2f7760b772ca974ba970202 + languageName: node + linkType: hard + "string_decoder@npm:~1.1.1": version: 1.1.1 resolution: "string_decoder@npm:1.1.1" @@ -8999,6 +9077,16 @@ __metadata: languageName: node linkType: hard +"through2@npm:^2.0.1": + version: 2.0.5 + resolution: "through2@npm:2.0.5" + dependencies: + readable-stream: ~2.3.6 + xtend: ~4.0.1 + checksum: beb0f338aa2931e5660ec7bf3ad949e6d2e068c31f4737b9525e5201b824ac40cac6a337224856b56bd1ddd866334bbfb92a9f57cd6f66bc3f18d3d86fc0fe50 + languageName: node + linkType: hard + "through2@npm:^4.0.0": version: 4.0.2 resolution: "through2@npm:4.0.2" @@ -9612,6 +9700,13 @@ __metadata: languageName: node linkType: hard +"untildify@npm:^4.0.0": + version: 4.0.0 + resolution: "untildify@npm:4.0.0" + checksum: 39ced9c418a74f73f0a56e1ba4634b4d959422dff61f4c72a8e39f60b99380c1b45ed776fbaa0a4101b157e4310d873ad7d114e8534ca02609b4916bb4187fb9 + languageName: node + linkType: hard + "uri-js@npm:^4.2.2": version: 4.4.1 resolution: "uri-js@npm:4.4.1" @@ -9974,6 +10069,13 @@ __metadata: languageName: node linkType: hard +"xtend@npm:~4.0.1": + version: 4.0.2 + resolution: "xtend@npm:4.0.2" + checksum: ac5dfa738b21f6e7f0dd6e65e1b3155036d68104e67e5d5d1bde74892e327d7e5636a076f625599dc394330a731861e87343ff184b0047fef1360a7ec0a5a36a + languageName: node + linkType: hard + "y18n@npm:^4.0.0": version: 4.0.3 resolution: "y18n@npm:4.0.3" @@ -10066,7 +10168,7 @@ __metadata: languageName: node linkType: hard -"yargs@npm:^16.2.0": +"yargs@npm:^16.1.0, yargs@npm:^16.2.0": version: 16.2.0 resolution: "yargs@npm:16.2.0" dependencies: From d84b2d602d7afebf67d5ead92a5e2f054d85aa47 Mon Sep 17 00:00:00 2001 From: Timothy Lin Date: Sun, 16 Jul 2023 18:19:42 +0800 Subject: [PATCH 3/3] comment out unit test --- .github/workflows/ci.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41b6bbf..d1dd873 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,20 +8,20 @@ on: concurrency: ${{ github.workflow }}-${{ github.ref }} jobs: - test: - name: Unit Test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: '18.x' - - name: Install dependencies - run: yarn - - name: Build - run: yarn build - - name: Run unit tests - run: yarn test + # test: + # name: Unit Test + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v3 + # - uses: actions/setup-node@v3 + # with: + # node-version: '18.x' + # - name: Install dependencies + # run: yarn + # - name: Build + # run: yarn build + # - name: Run unit tests + # run: yarn test release: name: Release