-
Notifications
You must be signed in to change notification settings - Fork 61
chore(deps-dev): bump astro, @astrojs/mdx and astro-auto-import #3700
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,9 +6,16 @@ import { oudsWeb } from './src/libs/astro' | |
| import { getConfig } from './src/libs/config' | ||
| import { algoliaPlugin } from './src/plugins/algolia-plugin' | ||
| import { stackblitzPlugin } from './src/plugins/stackblitz-plugin' | ||
| import type { Element, Text } from 'hast' | ||
| import { rehypeHeadingIds, unified } from '@astrojs/markdown-remark' | ||
| import { rehypeBsTable } from './src/libs/rehype' | ||
| import { remarkBsComp, remarkBsConfig, remarkBsDocsref } from './src/libs/remark' | ||
| import rehypeAutolinkHeadings from 'rehype-autolink-headings' | ||
|
|
||
| const isDev = process.env.NODE_ENV === 'development' | ||
|
|
||
| const headingsRangeRegex = new RegExp(`^h[${getConfig().anchors.min}-${getConfig().anchors.max}]$`) | ||
|
|
||
| const site = isDev | ||
| ? // In development mode, use the local dev server. | ||
| 'http://localhost:9001' | ||
|
|
@@ -20,12 +27,32 @@ const site = isDev | |
|
|
||
| // https://astro.build/config | ||
| export default defineConfig({ | ||
| compressHTML: false, | ||
| build: { | ||
| assets: `${getConfig().brand}/docs/${getConfig().docs_version}/assets` | ||
| }, | ||
| integrations: [oudsWeb()], | ||
| markdown: { | ||
| smartypants: false, | ||
| processor: unified({ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not know if this was a mandatory change but I think it's clearer to have that config here 👍 |
||
| rehypePlugins: [ | ||
| rehypeHeadingIds, | ||
| [ | ||
| rehypeAutolinkHeadings, | ||
| { | ||
| behavior: 'append', | ||
| content: [{ type: 'text', value: ' '}], | ||
| properties: (element: Element) => ({ | ||
| class: 'anchor-link', | ||
| ariaLabel: `Link to this section: ${(element.children[0] as Text).value}` | ||
| }), | ||
| test: (element: Element) => element.tagName.match(headingsRangeRegex) | ||
| } | ||
| ], | ||
| rehypeBsTable | ||
| ], | ||
| remarkPlugins: [remarkBsConfig, remarkBsDocsref, remarkBsComp] | ||
| }), | ||
| syntaxHighlight: 'prism' | ||
| }, | ||
| site, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| --- | ||
| import { getData } from '@libs/data' | ||
| import { getConfig } from '@libs/config' | ||
| import { docsPages } from '@libs/content' | ||
| import { docsPages, getDocsPageSlug } from '@libs/content' | ||
| import { getSlug } from '@libs/utils' | ||
| import { getVersionedDocsPath } from '@libs/path' | ||
|
|
||
|
|
@@ -14,9 +14,10 @@ const sidebarMap = { | |
| utilities: 'utilities', | ||
| layout: 'layout', | ||
| about: '' | ||
| } | ||
| } as const | ||
|
|
||
| const sidebar = sidebarMap[slug] ? getData(`sidebar-${sidebarMap[slug]}`) : [] | ||
| const sidebarKey = sidebarMap[slug as keyof typeof sidebarMap] | ||
| const sidebar = sidebarKey ? getData(`sidebar-${sidebarKey}`) : [] | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I rewrote this too in the Scrollspy update. I started from the actual data definition to get the sidebars and have a hard typing. We can keep this and see what we do on the scrollspy side
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's only some warnings that I got from the tsconfig, I can revert them and wait for Scrollspy
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes same, just I fixed them with an other solution but we can discuss on the Scrollspy PR |
||
| --- | ||
|
|
||
| <nav class="bd-links w-100" id="bd-docs-nav" aria-labelledby="docs-nav"> | ||
|
|
@@ -60,12 +61,12 @@ const sidebar = sidebarMap[slug] ? getData(`sidebar-${sidebarMap[slug]}`) : [] | |
| } | ||
| const active = Astro.params.slug === unversionedPageSlug | ||
|
|
||
| const generatedPage = docsPages.find((page: any) => page.slug === unversionedPageSlug) | ||
| const generatedPage = docsPages.find((page: any) => getDocsPageSlug(page.id) === unversionedPageSlug) | ||
|
|
||
| // This test should not be necessary, see comments for `getSlug()` in `src/libs/utils.ts`. | ||
| if (!page.direct_url && !generatedPage) { | ||
| throw new Error( | ||
| `The page '${page.title}' referenced in 'site/data/sidebar${sidebarMap[slug]}.yml' does not exist at '${url}'.` | ||
| `The page '${page.title}' referenced in 'site/data/sidebar${sidebarKey}.yml' does not exist at '${url}'.` | ||
| ) | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| export { default as AddedIn } from './AddedIn.astro' | ||
| export { default as BootstrapCompatibility } from './BootstrapCompatibility.astro' | ||
| export { default as BrandSpecific } from './BrandSpecific.astro' | ||
| export { default as BsTable } from './BsTable.astro' | ||
| export { default as Callout } from './Callout.astro' | ||
| export { default as CalloutSoon } from './CalloutSoon.astro' | ||
| export { default as Code } from './Code.astro' | ||
| export { default as ColorTable } from './ColorTable.astro' | ||
| export { default as ComponentCard } from './ComponentCard.astro' | ||
| export { default as ControlItem } from './ControlItem.mdx' | ||
| export { default as DeprecatedIn } from './DeprecatedIn.astro' | ||
| export { default as Details } from './Details.astro' | ||
| export { default as EnableBtnCloseTooltip } from './EnableBtnCloseTooltip.astro' | ||
| export { default as Example } from './Example.astro' | ||
| export { default as GuideFooter } from './GuideFooter.mdx' | ||
| export { default as JsDataAttributes } from './JsDataAttributes.mdx' | ||
| export { default as JsDismiss } from './JsDismiss.astro' | ||
| export { default as JsDocs } from './JsDocs.astro' | ||
| export { default as MandatoryFieldIndication } from './MandatoryFieldIndication.astro' | ||
| export { default as Placeholder } from './Placeholder.astro' | ||
| export { default as ScssDocs } from './ScssDocs.astro' | ||
| export { default as SkeletonRedirect } from './SkeletonRedirect.astro' | ||
| export { default as SvgDocs } from './SvgDocs.astro' | ||
| export { default as Table } from './Table.astro' | ||
| export { default as TableContent } from './TableContent.md' | ||
| export { default as ThemeDemo } from './ThemeDemo.astro' | ||
| export { default as ThemeDemoStylesImport } from './ThemeDemoStylesImport.astro' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ toc: true | |
|
|
||
| import { componentsDetails } from '../../../data/components-details' | ||
| import { getVersionedDocsPath } from '@libs/path' | ||
| import { ComponentCard } from '@components/shortcodes' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it not made available everywhere by what you added in
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought, but I had some errors while not having it, I don't know why tbh |
||
|
|
||
| <Callout | ||
| type="info" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.