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

Fix: Missing export for components #54

Merged
merged 2 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"scripts": {
"preinstall": "npx only-allow pnpm",
"dev": "pnpm --filter vitepress-carbon-demo run dev",
"dev": "pnpm --filter vitepress-carbon run build && pnpm --filter vitepress-carbon-demo run dev",
"demo-build": "vitepress build ./packages/demo",
"eslint": "eslint ./packages/**/src/**/*.{ts,js,vue}",
"prettier": "prettier --check --write --parser typescript \"{__tests__,docs,packages,types}/**/*.ts\"",
Expand Down
91 changes: 61 additions & 30 deletions packages/demo/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
import { defineConfigWithTheme } from 'vitepress'
import path from 'path'
import type { ThemeConfig } from 'vitepress-carbon'
import baseConfig from 'vitepress-carbon/config'
import { DefaultTheme } from 'vitepress/theme'
import { searchForWorkspaceRoot } from './theme/utils/SearchRoot'
import { CarbonTheme } from 'vitepress-carbon/dist/theme/CarbonTheme'
import baseConfig from 'vitepress-carbon/dist/theme/config/baseConfig'
import { searchForWorkspaceRoot } from './theme/utils/SearchRoot.js'

const guideGroupItems = [
{ text: 'Introduction', link: '/guide/introduction' },
{ text: 'Getting Started', link: '/guide/getting-started' },
{ text: 'Configuration', link: '/guide/configuration' }
]

const themeGroupItems = [
{ text: 'Extending', link: '/guide/extending-theme' }
]
const themeGroupItems = [{ text: 'Extending', link: '/guide/extending-theme' }]

const componentGroupItems = [
{ text: 'Home', link: '/guide/home-component' }
]
const componentGroupItems = [{ text: 'Home', link: '/guide/home-component' }]

const examplesItems = [
{ text: 'Markdown Examples', link: '/examples/markdown-examples' },
{ text: 'Runtime API Examples', link: '/examples/api-examples' }
]

const nav: DefaultTheme.NavItem[] = [
const nav: CarbonTheme.NavItem[] = [
{
text: 'Guide',
activeMatch: `^/guide/`,
Expand All @@ -38,7 +34,8 @@ const nav: DefaultTheme.NavItem[] = [
text: 'Examples',
activeMatch: `^/examples/`,
items: examplesItems
}, {
},
{
text: 'VitePress',
link: `https://vitepress.dev`
}
Expand All @@ -56,12 +53,12 @@ export default defineConfigWithTheme<ThemeConfig>({

lang: 'en-US',
title: 'VitePress Carbon',
description: 'Carbon embraces GitHub\'s monochromatic ethos, offering a theme for VitePress documentation that is sleek, modern, and effortlessly stylish.',
description:
"Carbon embraces GitHub's monochromatic ethos, offering a theme for VitePress documentation that is sleek, modern, and effortlessly stylish.",
srcDir: 'src',
lastUpdated: true,
cleanUrls: true,
metaChunk: true,

sitemap: {
hostname: 'https://carbon.breno.tech',
transformItems(items) {
Expand All @@ -82,7 +79,8 @@ export default defineConfigWithTheme<ThemeConfig>({
},

editLink: {
pattern: 'https://github.com/brenoepics/vitepress-carbon/edit/main/demo/src/:path',
pattern:
'https://github.com/brenoepics/vitepress-carbon/edit/main/demo/src/:path',
text: 'Edit this page on GitHub'
},

Expand All @@ -91,28 +89,62 @@ export default defineConfigWithTheme<ThemeConfig>({
},

socialLinks: [
{ icon: 'github', link: 'https://github.com/brenoepics/vitepress-carbon' },
{ icon: 'github', link: 'https://github.com/brenoepics/vitepress-carbon' }
]
},

head: [
['link', { rel: 'icon', href: 'https://carbon.breno.tech/logo.svg' }],
['meta', {
name: 'description',
content: 'Carbon embraces GitHub\'s monochromatic ethos, offering a theme for VitePress documentation that is sleek, modern, and effortlessly stylish.'
}],
[
'meta',
{
name: 'description',
content:
"Carbon embraces GitHub's monochromatic ethos, offering a theme for VitePress documentation that is sleek, modern, and effortlessly stylish."
}
],
['meta', { property: 'og:url', content: 'https://carbon.breno.tech/' }],
['meta', { property: 'og:type', content: 'website' }],
['meta', { property: 'og:title', content: 'VitePress Carbon' }],
['meta', {
property: 'og:description',
content: 'Carbon embraces GitHub\'s monochromatic ethos, offering a theme for VitePress documentation that is sleek, modern, and effortlessly stylish.'
}],
['meta', { property: 'og:image', content: 'https://carbon.breno.tech/site-card.jpg' }],
['meta', { property: 'theme-color', name: 'theme-color', content: '#41ad4f' }],
['meta', { property: 'twitter:card', name: 'twitter:card', content: 'summary_large_image' }],
['script', { async: '', src: 'https://www.googletagmanager.com/gtag/js?id=AW-16586074464' }],
['script', {}, `window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'AW-16586074464');`]
[
'meta',
{
property: 'og:description',
content:
"Carbon embraces GitHub's monochromatic ethos, offering a theme for VitePress documentation that is sleek, modern, and effortlessly stylish."
}
],
[
'meta',
{
property: 'og:image',
content: 'https://carbon.breno.tech/site-card.jpg'
}
],
[
'meta',
{ property: 'theme-color', name: 'theme-color', content: '#41ad4f' }
],
[
'meta',
{
property: 'twitter:card',
name: 'twitter:card',
content: 'summary_large_image'
}
],
[
'script',
{
async: '',
src: 'https://www.googletagmanager.com/gtag/js?id=AW-16586074464'
}
],
[
'script',
{},
`window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'AW-16586074464');`
]
],

vite: {
Expand All @@ -126,7 +158,6 @@ export default defineConfigWithTheme<ThemeConfig>({
path.join(__dirname, '../../theme/src/theme/fonts/')
]
}
},
}
}
})

7 changes: 5 additions & 2 deletions packages/theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./dist/*": "./dist/*",
"./package.json": "./package.json",
"./config": {
"types": "./dist/theme/config/baseConfig.d.ts",
"default": "./dist/theme/config/baseConfig.js"
Expand Down Expand Up @@ -40,7 +42,7 @@
"packageManager": "pnpm@9.9.0",
"scripts": {
"preinstall": "npx only-allow pnpm",
"clean": "rm -rf dist",
"clean": "rimraf dist",
"addAssets": "node scripts/copyTheme.js && node scripts/generateComponentExports.js",
"build": "pnpm clean && vue-tsc --noEmit -p ./ && tsc -p ./ && pnpm addAssets",
"release": "pnpm build && npm publish"
Expand All @@ -62,6 +64,7 @@
},
"devDependencies": {
"@mdit-vue/types": "^2.1.0",
"@types/body-scroll-lock": "^3.1.0"
"@types/body-scroll-lock": "^3.1.0",
"rimraf": "^6.0.1"
}
}
Loading