Skip to content

Commit a9cf2cd

Browse files
authored
refactor(ui): split rive-canvas and asciinema from ui package as standalone packages (#229)
* fix: build error Error [ERR_MODULE_NOT_FOUND] .vitepress/.temp/style.l0sNRNKZ.js Cannot find module '/Users/neko/Git/nolebase/integrations/docs/.vitepress/.temp/style.l0sNRNKZ.js' imported from /Users/neko/Git/nolebase/integrations/docs/.vitepress/.temp/app.js Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/neko/Git/nolebase/integrations/docs/.vitepress/.temp/style.l0sNRNKZ.js' imported from /Users/neko/Git/nolebase/integrations/docs/.vitepress/.temp/app.js Already fixing under [[Bug Report] 5.2.12 regression - dynamic css import will cause MODULE_NOT_FOUND in SSR build · Issue #17366 · vitejs/vite](vitejs/vite#17366) * chore: update to main * chore: correct package.json Signed-off-by: Neko Ayaka <neko@ayaka.moe>
1 parent 7e4376d commit a9cf2cd

46 files changed

Lines changed: 576 additions & 265 deletions

File tree

Some content is hidden

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

docs/.vitepress/theme/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { type Plugin, h } from 'vue'
33
import { MotionPlugin } from '@vueuse/motion'
44
import TwoslashFloatingVue from '@shikijs/vitepress-twoslash/client'
55

6-
import { NuLazyTeleportRiveCanvas } from '@nolebase/ui'
6+
import { NuLazyTeleportRiveCanvas } from '@nolebase/ui-rive-canvas'
77
import { defineThemeUnconfig } from '@nolebase/unconfig-vitepress'
88
import { NolebasePluginPreset } from '@nolebase/unconfig-vitepress/plugins'
99

docs/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
"@nolebase/markdown-it-element-transform": "workspace:^",
2121
"@nolebase/markdown-it-unlazy-img": "workspace:^",
2222
"@nolebase/ui": "workspace:^",
23+
"@nolebase/ui-asciinema": "workspace:^",
24+
"@nolebase/ui-rive-canvas": "workspace:^",
2325
"@nolebase/unconfig-vitepress": "workspace:^",
2426
"@nolebase/vitepress-plugin-enhanced-mark": "workspace:^",
2527
"@nolebase/vitepress-plugin-enhanced-readabilities": "workspace:^",
@@ -44,6 +46,6 @@
4446
"motion": "^10.17.0",
4547
"thumbhash": "^0.1.1",
4648
"unlazy": "^0.11.3",
47-
"vite-plugin-vue-devtools": "^7.2.1"
49+
"vite-plugin-vue-devtools": "^7.1.3"
4850
}
4951
}

docs/pages/en/integrations/markdown-it-bi-directional-links/getting-started.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export default defineConfigWithTheme({
4545
},
4646
markdown: {
4747
config: (md) => {
48+
// @ts-expect-error unmatched type for VitePress, ref https://github.com/nolebase/integrations/pull/228 [!code ++]
4849
md.use(BiDirectionalLinks()) // [!code ++]
4950
},
5051
},

docs/pages/en/integrations/vitepress-plugin-enhanced-readabilities/index.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,6 @@ import { defineConfig } from 'vitepress'
8585
export default defineConfig({
8686
vite: { // [!code ++]
8787
optimizeDeps: { // [!code ++]
88-
include: [ // [!code ++]
89-
// @rive-app/canvas is a CJS/UMD module, so it needs to be included here // [!code ++]
90-
// for Vite to properly bundle it. // [!code ++]
91-
'@nolebase/vitepress-plugin-enhanced-readabilities > @nolebase/ui > @rive-app/canvas', // [!code ++]
92-
], // [!code ++]
9388
exclude: [ // [!code ++]
9489
'@nolebase/vitepress-plugin-enhanced-readabilities/client', // [!code ++]
9590
], // [!code ++]
@@ -122,11 +117,6 @@ import { defineConfig } from 'vite'
122117
export default defineConfig(() => {
123118
return {
124119
optimizeDeps: {
125-
include: [ // [!code ++]
126-
// @rive-app/canvas is a CJS/UMD module, so it needs to be included here // [!code ++]
127-
// for Vite to properly bundle it. // [!code ++]
128-
'@nolebase/vitepress-plugin-enhanced-readabilities > @nolebase/ui > @rive-app/canvas', // [!code ++]
129-
], // [!code ++]
130120
exclude: [ // [!code ++]
131121
'@nolebase/vitepress-plugin-enhanced-readabilities/client', // [!code ++]
132122
'vitepress' // [!code ++]

docs/pages/en/integrations/vitepress-plugin-git-changelog/configure-ui.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,6 @@ import { defineConfig } from 'vite'
405405
export default defineConfig(() => {
406406
return {
407407
optimizeDeps: {
408-
include: [
409-
// @rive-app/canvas is a CJS/UMD module, so it needs to be included here
410-
// for Vite to properly bundle it.
411-
'@nolebase/vitepress-plugin-git-changelog > @nolebase/ui > @rive-app/canvas',
412-
],
413408
exclude: [
414409
'@nolebase/vitepress-plugin-git-changelog/client',
415410
],

docs/pages/en/integrations/vitepress-plugin-inline-link-preview/configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ export default defineConfig({
322322
markdown: {
323323
config(md) {
324324
// other markdown-it configurations...
325+
// @ts-expect-error unmatched type for VitePress, ref https://github.com/nolebase/integrations/pull/228 [!code ++]
325326
md.use(InlineLinkPreviewElementTransform, { tag: 'YourComponentName' }) // [!code focus]
326327
}
327328
}

docs/pages/en/integrations/vitepress-plugin-inline-link-preview/getting-started.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export default defineConfig({
5757
markdown: { // [!code ++]
5858
config(md) { // [!code ++]
5959
// other markdown-it configurations... // [!code ++]
60+
// @ts-expect-error unmatched type for VitePress, ref https://github.com/nolebase/integrations/pull/228 [!code ++]
6061
md.use(InlineLinkPreviewElementTransform) // [!code ++]
6162
} // [!code ++]
6263
} // [!code ++]

docs/pages/en/releases/migrations/v1-to-v2.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export default defineConfig({
7171
markdown: {
7272
// ...
7373
config: (md) => {
74+
// @ts-expect-error unmatched type for VitePress, ref https://github.com/nolebase/integrations/pull/228 [!code ++]
7475
md.use(InlineLinkPreviewElementTransform) // [!code ++]
7576
},
7677
},
@@ -119,6 +120,7 @@ export default defineConfig({
119120
} as ElementTransformOptions // [!code --]
120121
})()) // [!code --]
121122

123+
// @ts-expect-error unmatched type for VitePress, ref https://github.com/nolebase/integrations/pull/228 [!code ++]
122124
md.use(InlineLinkPreviewElementTransform) // [!code ++]
123125
},
124126
},
@@ -214,7 +216,7 @@ import '@nolebase/vitepress-plugin-highlight-targeted-heading/client/style.css'
214216
1. `changelog.title`
215217
2. `contributors.title`;
216218
6. In order to better structure the organization of the i18n fields, the original
217-
1. `noLogs` i18n configuration changed to `changelog.noData`;
219+
1. `noLogs` i18n configuration changed to `changelog.noData`;
218220
2. `noContributors` i18n configuration was changed to `contributors.noData`.
219221
3. `lastEdited` i18n Configuration changed to `lastEdited`.
220222
4. `lastEditedDateFnsLocaleName` configuration changed to `changelog.lastEditedDateFnsLocaleName`

docs/pages/en/ui/asciinema-player/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup>
2-
import { NuAsciinemaPlayer } from '@nolebase/ui'
2+
import { NuAsciinemaPlayer } from '@nolebase/ui-asciinema'
33
</script>
44

55
# Asciinema Player
@@ -17,24 +17,24 @@ import { NuAsciinemaPlayer } from '@nolebase/ui'
1717

1818
## Installation
1919

20-
Install `@nolebase/ui` and `asciinema-player` to your project dependencies by running the following command:
20+
Install `@nolebase/ui-asciinema` to your project dependencies by running the following command:
2121

2222
::: code-group
2323

2424
```shell [@antfu/ni]
25-
ni @nolebase/ui asciinema-player
25+
ni @nolebase/ui-asciinema
2626
```
2727

2828
```shell [pnpm]
29-
pnpm add @nolebase/ui asciinema-player
29+
pnpm add @nolebase/ui-asciinema
3030
```
3131

3232
```shell [npm]
33-
npm install @nolebase/ui asciinema-player
33+
npm install @nolebase/ui-asciinema
3434
```
3535

3636
```shell [yarn]
37-
yarn add @nolebase/ui asciinema-player
37+
yarn add @nolebase/ui-asciinema
3838
```
3939

4040
:::
@@ -43,7 +43,7 @@ yarn add @nolebase/ui asciinema-player
4343

4444
```vue
4545
<script setup>
46-
import { NuAsciinemaPlayer } from '@nolebase/ui'
46+
import { NuAsciinemaPlayer } from '@nolebase/ui-asciinema'
4747
import 'asciinema-player/dist/bundle/asciinema-player.css'
4848
</script>
4949

docs/pages/en/ui/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default defineConfig(() => {
3434
optimizeDeps: { // [!code ++]
3535
include: [ // [!code ++]
3636
// Add this line to your vite.config.ts's optimizeDeps.include array // [!code ++]
37-
'@nolebase/ui > @rive-app/canvas', // [!code ++]
37+
'@nolebase/ui-rive-canvas > @rive-app/canvas', // [!code ++]
3838
], // [!code ++]
3939
}, // [!code ++]
4040
}

0 commit comments

Comments
 (0)