-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from storybook-vue/path-preview
fix: vit:vue plugin versions
- Loading branch information
Showing
13 changed files
with
2,443 additions
and
4,512 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { spawn } from 'node:child_process' | ||
|
||
import path from 'node:path' | ||
import { existsSync } from 'node:fs' | ||
|
||
// Unicode icons for better display | ||
const CHECKMARK = '\u2714' // ✔ | ||
const CROSSMARK = '\u274C' // ❌ | ||
const STARTMARK = '\u25B6' // ▶ | ||
|
||
const logger = console | ||
|
||
async function buildStorybook() { | ||
logger.log(`${STARTMARK} Building Storybook ...`) | ||
logger.log() | ||
// Path to the project root | ||
const projectRoot = process.cwd() | ||
|
||
logger.info('🔌 projectRoot :', projectRoot) | ||
|
||
const buildNuxtProcess = spawn('npx', ['storybook', 'build', '--output-dir', '.output/pub'], { | ||
cwd: projectRoot, | ||
stdio: 'inherit', | ||
}) | ||
buildNuxtProcess.on('close', async (code) => { | ||
if (code !== 0) | ||
logger.error(`${CROSSMARK} nuxt build failed with code ${code}`) | ||
|
||
else | ||
logger.log(`${CHECKMARK} nuxt build successfully!`) | ||
}) | ||
|
||
// Install required packages using pnpm | ||
} | ||
|
||
// Function to detect the package manager | ||
export function detectPackageManager() { | ||
if (existsSync(path.join(process.cwd(), 'package-lock.json'))) | ||
return 'npm' | ||
|
||
else if (existsSync(path.join(process.cwd(), 'yarn.lock'))) | ||
return 'yarn' | ||
|
||
else if (existsSync(path.join(process.cwd(), 'pnpm-lock.yaml'))) | ||
return 'pnpm' | ||
|
||
else if (existsSync(path.join(process.cwd(), 'bun.lock'))) | ||
return 'bun' | ||
|
||
return undefined | ||
} | ||
|
||
export { buildStorybook } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"name": "@storybook-vue/nuxt", | ||
"version": "0.1.9", | ||
"type": "module", | ||
"version": "0.2.0", | ||
"packageManager": "[email protected]", | ||
"description": "Storybook for Nuxt and Vite: Develop Vue3 components in isolation with Hot Reloading.", | ||
"license": "MIT", | ||
|
@@ -32,7 +33,6 @@ | |
"./preview": { | ||
"types": "./dist/preview.d.ts", | ||
"import": "./dist/preview.mjs", | ||
"require": "./dist/preview.cjs", | ||
"default": "./preview.js" | ||
}, | ||
"./package.json": "./package.json" | ||
|
@@ -50,7 +50,7 @@ | |
"*.d.ts" | ||
], | ||
"engines": { | ||
"node": ">=16.0.0" | ||
"node": ">=18.0.0" | ||
}, | ||
"scripts": { | ||
"build": "unbuild", | ||
|
@@ -61,31 +61,38 @@ | |
"release": "pnpm changelogen --release --push && pnpm publish" | ||
}, | ||
"peerDependencies": { | ||
"nuxt": "^3.6 || ^3.7", | ||
"vite": "^4.0.0", | ||
"vue": "^3.3.4" | ||
"nuxt": "^3.6 || ^3.7 || ^3.8", | ||
"vite": "^3.0.0 || ^4.0.0 || ^5.0.0", | ||
"vue": "^3.0.0" | ||
}, | ||
"dependencies": { | ||
"@nuxt/devtools-kit": "^0.7.2", | ||
"@nuxt/kit": "3.6.5", | ||
"@nuxt/schema": "3.6.5", | ||
"@nuxt/vite-builder": "3.6.5", | ||
"@storybook/builder-vite": "7.5.1", | ||
"@storybook/vue3": "^7.5.1", | ||
"@storybook/vue3-vite": "^7.5.1", | ||
"@nuxt/devtools-kit": "^1.0.2", | ||
"@nuxt/kit": "3.8.1", | ||
"@nuxt/schema": "3.8.1", | ||
"@nuxt/types": "2.17.2", | ||
"@nuxt/vite-builder": "3.8.1", | ||
"@storybook/builder-vite": "7.5.3", | ||
"@storybook/vue3": "^7.5.3", | ||
"@storybook/vue3-vite": "^7.5.3", | ||
"autoprefixer": "^10.4.15", | ||
"nuxt": "3.8.1", | ||
"postcss": "^8.4.27", | ||
"postcss-import": "^15.1.0", | ||
"postcss-url": "^10.1.3", | ||
"typescript": "^5.2.2", | ||
"vue-router": "^4.2.5" | ||
"typescript": "^5.2.2" | ||
}, | ||
"devDependencies": { | ||
"@storybook/types": "7.5.1", | ||
"@storybook/types": "7.5.3", | ||
"@vitejs/plugin-vue": "^4.2.3", | ||
"@vitejs/plugin-vue-jsx": "^3.0.1", | ||
"@vitejs/plugin-vue-jsx": "^3.1.0", | ||
"changelogen": "^0.5.5", | ||
"unbuild": "^2.0.0" | ||
"unbuild": "^2.0.0", | ||
"vite": "4.5.0" | ||
}, | ||
"resolutions": { | ||
"@storybook/vue3": "^7.5.3", | ||
"@storybook/vue3-vite": "^7.5.3", | ||
"vite": "4.5.0" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from './dist/preview.mjs' | ||
export * from './dist/preview' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.