Skip to content

Commit

Permalink
feat: support Vite 6 and update deps (#770)
Browse files Browse the repository at this point in the history
* Upgrade dependencies

* Use ESM vite

* fix chokidar glob

* Use micromatch instead of minimatch

* Remove optimizeDeps on vite server

* Fix markdown watcher

* Update artifact version

* Fix import

* Make plugins mjs

* Migrate from vite-node to vite runtime

* Revert "Migrate from vite-node to vite runtime"

This reverts commit 4e19240.

* Try to trigger some tests

* fix minimatch import

* Lint everything

* Update file path handling

* Revert vite-node version

* revert vitest version

* fix cypress lint error

* Fix lint

* hopefully last lint fix...

* please be the last lint fix

* sigh...

* Revert some version to make svelte compile

* Fix nuxt build

* Replace flexsearch with fuse

* Fix typescript erro

* Fix lint
  • Loading branch information
hugoattal authored Jan 8, 2025
1 parent f583371 commit 40c16f2
Show file tree
Hide file tree
Showing 257 changed files with 7,619 additions and 11,744 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-nuxt3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
working-directory: ${{env.dir}}
run: pnpm run ci

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-svelte4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
working-directory: ${{env.dir}}
run: pnpm run ci

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-vue3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
TOTAL_RUNNERS: 5
THIS_RUNNER: ${{ matrix.containers }}

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
Expand Down
1 change: 0 additions & 1 deletion .stackblitz/codeflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"overrides": {
"histoire": "./packages/histoire",
"@histoire/plugin-vue": "./packages/historie-plugin-vue",
"@histoire/plugin-vue2": "./packages/historie-plugin-vue2",
"@histoire/plugin-svelte": "./packages/historie-plugin-svelte",
"@histoire/plugin-nuxt": "./packages/historie-plugin-nuxt",
"@histoire/plugin-percy": "./packages/historie-plugin-percy",
Expand Down
62 changes: 0 additions & 62 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ module.exports = {
text: 'Vue 3',
link: '/guide/vue3/getting-started',
},
{
text: 'Vue 2.7',
link: '/guide/vue2/getting-started',
},
{
text: 'Svelte 3',
link: '/guide/svelte3/getting-started',
Expand Down Expand Up @@ -212,64 +208,6 @@ module.exports = {
],
},
],
'/guide/vue2/': [
{
text: 'Guide - Vue 2',
collapsible: true,
items: [
{
text: 'Getting Started',
link: '/guide/vue2/getting-started',
},
{
text: 'Stories',
link: '/guide/vue2/stories',
},
{
text: 'State & Controls',
link: '/guide/vue2/controls',
},
{
text: 'Events',
link: '/guide/vue2/events',
},
{
text: 'App setup',
link: '/guide/vue2/app-setup',
},
{
text: 'Wrapper',
link: '/guide/vue2/wrapper',
},
{
text: 'Documentation',
link: '/guide/vue2/docs',
},
{
text: 'Hierarchy',
link: '/guide/vue2/hierarchy',
},
],
},
{
text: 'Learn more',
collapsible: true,
items: [
{
text: 'About Histoire ⮌',
link: '/guide/',
},
{
text: 'Configuration ⮌',
link: '/guide/config',
},
{
text: 'Plugins ⮌',
link: '/guide/plugins/official',
},
],
},
],
'/guide/svelte3/': [
{
text: 'Guide - Svelte 3',
Expand Down
12 changes: 6 additions & 6 deletions docs/.vitepress/theme/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import DefaultTheme from 'vitepress/theme'
import FloatingVue from 'floating-vue'
import { Icon } from '@iconify/vue'
import FloatingVue from 'floating-vue'
import DefaultTheme from 'vitepress/theme'
import DemoLinks from './DemoLinks.vue'
import DemoPreview from './DemoPreview.vue'
import MeetTeam from './MeetTeam.vue'
import SponsorButton from './SponsorButton.vue'
import 'floating-vue/dist/style.css'
import './style/vars.pcss'
import './style/index.pcss'
import SponsorButton from './SponsorButton.vue'
import MeetTeam from './MeetTeam.vue'
import DemoPreview from './DemoPreview.vue'
import DemoLinks from './DemoLinks.vue'

export default {
...DefaultTheme,
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/visual-regression-testing/lost-pixel.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ Lost Pixel has first-class Histoire support meaning that you don't need to do mu

Start with installing lost-pixel by `npm install lost-pixel` and creating a `lostpixel.config.js|ts` file with following contents.

```javascript
import { CustomProjectConfig } from 'lost-pixel';
```ts
import { CustomProjectConfig } from 'lost-pixel'

export const config: CustomProjectConfig = {
histoireShots: {
histoireUrl: './.histoire/dist',
},
generateOnly: true,
failOnDifference: true
};
}
```
**Before running visual tests you need to have your Histoire book built first**.

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/visual-regression-testing/percy.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ pnpm add -D @histoire/plugin-percy
Add the plugin in histoire config:

```js
import { defineConfig } from 'histoire'
import { HstPercy } from '@histoire/plugin-percy'
import { defineConfig } from 'histoire'

export default defineConfig({
plugins: [
Expand Down
5 changes: 2 additions & 3 deletions docs/guide/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,16 @@ You can also tell Histoire to configure the sandbox application using the corres
| Framework | Setup function |
| --------- | -------------- |
| Vue 3 | `setupVue3` |
| Vue 2 | `setupVue2` |
### Vue setup
Inside your setup file, you can export a `setupVue3` (or `setupVue2` for Vue 2) function that will be called by Histoire allowing you to configure the Vue 3 sandbox application. Histoire provides an optional `defineSetupVue3` helper to have better types in your IDE :
Inside your setup file, you can export a `setupVue3` function that will be called by Histoire allowing you to configure the Vue 3 sandbox application. Histoire provides an optional `defineSetupVue3` helper to have better types in your IDE :
```ts
// src/histoire.setup.ts

import { createPinia } from 'pinia'
import { defineSetupVue3 } from '@histoire/plugin-vue'
import { createPinia } from 'pinia'

export const setupVue3 = defineSetupVue3(({ app, story, variant }) => {
const pinia = createPinia()
Expand Down
1 change: 0 additions & 1 deletion docs/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ Histoire is an Open-Source project supported by our sponsors - thank you!
| Framework | Version | Support* | Auto-CodeGen* | Auto-Docs* |
| --------- | -------- | ------- | ------------ | ---- |
| [Vue →](./vue3/getting-started.md) | `3.2+` ||| 🏗️ |
| [Vue →](./vue2/getting-started.md) | `2.7+` ||| 🏗️ |
| [Svelte →](./svelte3/getting-started.md) | `3+` || - | 🏗️ |
| Solid | - | - | - | - |
| Angular | - | - | - | - |
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/svelte3/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ yarn add -D histoire @histoire/plugin-svelte
Create an `histoire.config.js` or `histoire.config.ts` file in your project root to enable the Svelte plugin:

```ts
import { defineConfig } from 'histoire'
import { HstSvelte } from '@histoire/plugin-svelte'
import { defineConfig } from 'histoire'

export default defineConfig({
plugins: [
Expand Down
134 changes: 0 additions & 134 deletions docs/guide/vue2/app-setup.md

This file was deleted.

Loading

0 comments on commit 40c16f2

Please sign in to comment.