Skip to content

Commit 9d44bd9

Browse files
committed
Clean up some Astro and Docs stuff
1 parent 2572878 commit 9d44bd9

53 files changed

Lines changed: 918 additions & 765 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

eslint.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ const eslintConfig = [
288288
'site/src/assets/application.js',
289289
'site/src/assets/partials/*.js',
290290
'site/src/assets/search.js',
291-
'site/src/assets/snippets.js',
292291
'site/src/assets/stackblitz.js',
293292
'site/src/plugins/*.js'
294293
],

site/.prettierrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"$schema": "http://json.schemastore.org/prettierrc",
33
"arrowParens": "always",
4+
"plugins": ["prettier-plugin-astro"],
45
"printWidth": 120,
56
"semi": false,
67
"singleQuote": true,

site/astro.config.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { fileURLToPath } from 'node:url'
2+
13
import { defineConfig } from 'astro/config'
24
import astroBrokenLinksChecker from 'astro-broken-links-checker'
35
import bootstrapLight from 'bootstrap-vscode-theme/themes/bootstrap-light.json'
@@ -9,6 +11,11 @@ import { getConfig } from './src/libs/config'
911
import { algoliaPlugin } from './src/plugins/algolia-plugin'
1012
import { stackblitzPlugin } from './src/plugins/stackblitz-plugin'
1113

14+
// Resolve `@bootstrap` to the same on-disk Bootstrap bundle the docs ship, so
15+
// every docs script imports from a single module instance (no duplicated
16+
// component registries). Mirrors the `@bootstrap` alias in `tsconfig.json`.
17+
const bootstrapBundlePath = fileURLToPath(new URL('../dist/js/bootstrap.bundle.js', import.meta.url))
18+
1219
const isDev = process.env.NODE_ENV === 'development'
1320

1421
const site = isDev
@@ -62,6 +69,11 @@ export default defineConfig({
6269
},
6370
site,
6471
vite: {
65-
plugins: [algoliaPlugin(), stackblitzPlugin()]
72+
plugins: [algoliaPlugin(), stackblitzPlugin()],
73+
resolve: {
74+
alias: {
75+
'@bootstrap': bootstrapBundlePath
76+
}
77+
}
6678
}
6779
})

site/src/assets/application.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
2-
// IT'S ALL JUST JUNK FOR OUR DOCS!
3-
// ++++++++++++++++++++++++++++++++++++++++++
1+
// NOTICE: Internal docs helpers — not shipped in Bootstrap; not for reuse.
42

53
/*!
64
* JavaScript for Bootstrap's docs (https://getbootstrap.com/)

site/src/assets/partials/sidebar.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
2-
// IT'S ALL JUST JUNK FOR OUR DOCS!
3-
// ++++++++++++++++++++++++++++++++++++++++++
1+
// NOTICE: Internal docs helpers — not shipped in Bootstrap; not for reuse.
42

53
/*
64
* JavaScript for Bootstrap's docs (https://getbootstrap.com/)

site/src/assets/partials/snippets.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
// NOTICE!!! Initially embedded in our docs this JavaScript
2-
// file contains elements that can help you create reproducible
3-
// use cases in StackBlitz for instance.
4-
// In a real project please adapt this content to your needs.
5-
// ++++++++++++++++++++++++++++++++++++++++++
1+
// NOTICE: Embedded as-is into StackBlitz playgrounds via `?raw` import.
2+
// Adapt to your needs in real projects.
63

74
/*
85
* JavaScript for Bootstrap's docs (https://getbootstrap.com/)
@@ -16,7 +13,7 @@ import {
1613
Popover,
1714
Toast,
1815
Carousel
19-
} from '../../../../dist/js/bootstrap.bundle.js'
16+
} from '@bootstrap'
2017

2118
export default () => {
2219
// --------

site/src/assets/partials/sticky.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
2-
// IT'S ALL JUST JUNK FOR OUR DOCS!
3-
// ++++++++++++++++++++++++++++++++++++++++++
1+
// NOTICE: Internal docs helpers — not shipped in Bootstrap; not for reuse.
42

53
/*
64
* JavaScript for Bootstrap's docs (https://getbootstrap.com/)

site/src/assets/partials/toc.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
2-
// IT'S ALL JUST JUNK FOR OUR DOCS!
3-
// ++++++++++++++++++++++++++++++++++++++++++
1+
// NOTICE: Internal docs helpers — not shipped in Bootstrap; not for reuse.
42

53
/*
64
* JavaScript for Bootstrap's docs (https://getbootstrap.com/)
@@ -9,7 +7,7 @@
97
* For details, see https://creativecommons.org/licenses/by/3.0/.
108
*/
119

12-
import { Drawer } from '../../../../dist/js/bootstrap.bundle.js'
10+
import { Drawer } from '@bootstrap'
1311

1412
export default () => {
1513
const tocSidebar = document.querySelector('#bdTocSidebar')

site/src/assets/search.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
2-
// IT'S ALL JUST JUNK FOR OUR DOCS!
3-
// ++++++++++++++++++++++++++++++++++++++++++
1+
// NOTICE: Internal docs helpers — not shipped in Bootstrap; not for reuse.
42

53
/*!
64
* JavaScript for Bootstrap's docs (https://getbootstrap.com/)

site/src/assets/snippets.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)