@poveste/plugin-vue 0.6.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- export { default as MountStory } from './MountStory';
2
- export { default as RenderStory } from './RenderStory';
1
+ export { default as MountStory } from './MountStory.js';
2
+ export { default as RenderStory } from './RenderStory.js';
package/package.json CHANGED
@@ -1,17 +1,33 @@
1
1
  {
2
2
  "name": "@poveste/plugin-vue",
3
3
  "type": "module",
4
- "version": "0.6.1",
4
+ "version": "0.7.0",
5
5
  "description": "Poveste plugin for Vue.js support",
6
6
  "author": {
7
7
  "name": "Sorin Gitlan"
8
8
  },
9
9
  "license": "MIT",
10
+ "homepage": "https://poveste.dev",
10
11
  "repository": {
11
12
  "url": "https://github.com/poveste-dev/poveste.git",
12
13
  "type": "git",
13
14
  "directory": "packages/poveste-plugin-vue"
14
15
  },
16
+ "bugs": "https://github.com/poveste-dev/poveste/issues",
17
+ "keywords": [
18
+ "poveste",
19
+ "histoire",
20
+ "storybook",
21
+ "component-playground",
22
+ "component-explorer",
23
+ "stories",
24
+ "styleguide",
25
+ "design-system",
26
+ "vite",
27
+ "vue",
28
+ "vue3",
29
+ "plugin"
30
+ ],
15
31
  "publishConfig": {
16
32
  "access": "public"
17
33
  },
@@ -42,18 +58,28 @@
42
58
  },
43
59
  "main": "dist/index.js",
44
60
  "types": "dist/index.node.d.ts",
61
+ "files": [
62
+ "client.d.ts",
63
+ "collect.d.ts",
64
+ "components.d.ts",
65
+ "dist",
66
+ "src"
67
+ ],
68
+ "engines": {
69
+ "node": "^22.22.2 || ^24.15.0 || >=26.0.0"
70
+ },
45
71
  "peerDependencies": {
46
72
  "vue": "^3.5.26",
47
- "poveste": "^0.6.1"
73
+ "poveste": "^0.7.0"
48
74
  },
49
75
  "dependencies": {
50
76
  "change-case": "^5.4.4",
51
77
  "globby": "^14.0.2",
52
78
  "launch-editor": "^2.9.1",
53
79
  "pathe": "^1.1.2",
54
- "@poveste/controls": "^0.6.1",
55
- "@poveste/shared": "^0.6.1",
56
- "@poveste/vendors": "^0.6.1"
80
+ "@poveste/controls": "^0.7.0",
81
+ "@poveste/vendors": "^0.7.0",
82
+ "@poveste/shared": "^0.7.0"
57
83
  },
58
84
  "devDependencies": {
59
85
  "@types/node": "^22.10.1",
@@ -62,7 +88,7 @@
62
88
  "vite": "^8.2.0",
63
89
  "vitest": "^4.1.10",
64
90
  "vue": "^3.5.26",
65
- "poveste": "0.6.1"
91
+ "poveste": "0.7.0"
66
92
  },
67
93
  "scripts": {
68
94
  "build": "rimraf dist && vite build && tsc -d -P tsconfig.build.json && pnpm run build:types",
@@ -3,7 +3,7 @@ import type { PropType, VNode } from 'vue'
3
3
  import { omitInheritStoryProps } from '@poveste/shared'
4
4
  import { cloneVNode, computed, defineComponent, getCurrentInstance, h, isRef, provide, reactive, useAttrs } from 'vue'
5
5
  import { useRenderContext } from './render-context.js'
6
- import Variant from './Variant'
6
+ import Variant from './Variant.js'
7
7
 
8
8
  export default defineComponent({
9
9
 
@@ -1,6 +1,6 @@
1
1
  import type { AutoPropComponentDefinition, PropDefinition, Variant } from '@poveste/shared'
2
2
  import { applyState } from '@poveste/shared'
3
- import { getTagName } from '../codegen'
3
+ import { getTagName } from '../codegen.js'
4
4
 
5
5
  export function syncVariantAutoProps(
6
6
  variant: Variant,
@@ -19,8 +19,8 @@ import {
19
19
  onUpdated,
20
20
  ref,
21
21
  } from 'vue'
22
- import Story from './Story'
23
- import Variant from './Variant'
22
+ import Story from './Story.js'
23
+ import Variant from './Variant.js'
24
24
 
25
25
  export function registerGlobalComponents(app: App) {
26
26
  app.component('Story', Story)
@@ -16,7 +16,7 @@ import {
16
16
  import { VUE_SETUP_HOOK_NAMES } from '../../setup-hooks.js'
17
17
  import { registerGlobalComponents } from './global-components.js'
18
18
  import { provideRenderContext } from './render-context.js'
19
- import { RouterLinkStub } from './RouterLinkStub'
19
+ import { RouterLinkStub } from './RouterLinkStub.js'
20
20
 
21
21
  interface PreviewHostOptions {
22
22
  name: string
@@ -1,2 +1,2 @@
1
- export { default as MountStory } from './MountStory'
2
- export { default as RenderStory } from './RenderStory'
1
+ export { default as MountStory } from './MountStory.js'
2
+ export { default as RenderStory } from './RenderStory.js'
@@ -1,7 +1,7 @@
1
1
  import type { ServerStory, ServerStoryFile, ServerVariant } from '@poveste/shared'
2
2
  import type { PropType } from 'vue'
3
3
  import { defineComponent, inject, onMounted, provide } from 'vue'
4
- import { autoStubComponents } from './stub'
4
+ import { autoStubComponents } from './stub.js'
5
5
 
6
6
  export default defineComponent({
7
7
  name: 'PovesteStory',
@@ -7,8 +7,8 @@ import * as generatedSetup from 'virtual:$poveste-generated-global-setup'
7
7
  import * as setup from 'virtual:$poveste-setup'
8
8
  import { createApp, h } from 'vue'
9
9
  import { VUE_SETUP_HOOK_NAMES } from '../../setup-hooks.js'
10
- import Story from './Story'
11
- import Variant from './Variant'
10
+ import Story from './Story.js'
11
+ import Variant from './Variant.js'
12
12
 
13
13
  export async function run({ file, storyData, el }: ServerRunPayload) {
14
14
  const { default: Comp } = await import(/* @vite-ignore */ file.moduleId)
@@ -1,6 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "exclude": [
4
- "src/client"
5
- ]
6
- }
package/tsconfig.json DELETED
@@ -1,40 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ESNext",
4
- // Volar
5
- "jsx": "preserve",
6
- "lib": [
7
- "ESNext",
8
- "DOM"
9
- ],
10
- "rootDir": "src",
11
- "module": "ESNext",
12
- "moduleResolution": "bundler",
13
- "resolveJsonModule": true,
14
- "types": [
15
- "node"
16
- ],
17
- "strictBindCallApply": true,
18
- "strictFunctionTypes": true,
19
- "alwaysStrict": true,
20
- // Strict
21
- "noImplicitAny": false,
22
- "noImplicitThis": true,
23
- "outDir": "dist",
24
- "removeComments": false,
25
- "sourceMap": false,
26
- "allowSyntheticDefaultImports": true,
27
- "esModuleInterop": true,
28
- "skipLibCheck": true,
29
- "preserveWatchOutput": true
30
- },
31
- "include": [
32
- "src"
33
- ],
34
- "exclude": [
35
- "node_modules",
36
- "generated/**/*",
37
- "dist/**/*",
38
- "src/**/*.spec.ts"
39
- ]
40
- }
package/vite.config.ts DELETED
@@ -1,79 +0,0 @@
1
- import fs from 'node:fs'
2
- import { globbySync } from 'globby'
3
- import { defineConfig } from 'vite'
4
-
5
- // Externalize every declared dependency/peer so the lib build emits bare
6
- // specifiers (e.g. `import 'change-case'`) instead of resolved node_modules
7
- // paths. With preserveModules, an un-externalized npm dep leaks its pnpm-store
8
- // path (`../node_modules/.pnpm/change-case@x/...`) which only exists in the
9
- // workspace and breaks every published/fresh install.
10
- const pkg = JSON.parse(fs.readFileSync(new URL('./package.json', import.meta.url), 'utf-8'))
11
-
12
- export default defineConfig({
13
- plugins: [
14
- {
15
- name: 'poveste:preserve:import.dynamic',
16
- enforce: 'pre',
17
- transform(code) {
18
- if (code.includes('import(')) {
19
- return {
20
- code: code.replace(/import\(/g, 'import__dyn('),
21
- }
22
- }
23
- },
24
- closeBundle() {
25
- try {
26
- const files = globbySync('./dist/**/*.js')
27
- for (const file of files) {
28
- const content = fs.readFileSync(file, 'utf-8')
29
- if (content.includes('import__dyn')) {
30
- fs.writeFileSync(file, content.replace(/import__dyn\(/g, 'import(/* @vite-ignore */'), 'utf-8')
31
- }
32
- }
33
- }
34
- catch (e) {
35
- console.error(e)
36
- }
37
- },
38
- },
39
- ],
40
-
41
- build: {
42
- emptyOutDir: false,
43
- outDir: 'dist/bundled',
44
- lib: {
45
- entry: '',
46
- formats: ['es'],
47
- },
48
- rollupOptions: {
49
- external: [
50
- /\$poveste/,
51
- /@poveste/,
52
- 'vue',
53
- ...Object.keys(pkg.dependencies ?? {}),
54
- ...Object.keys(pkg.peerDependencies ?? {}),
55
- ],
56
-
57
- input: [
58
- 'src/client/client.ts',
59
- 'src/client/server.ts',
60
- ],
61
-
62
- output: {
63
- // manualChunks (id) {
64
- // if (id.includes('node_modules')) {
65
- // return 'vendor'
66
- // }
67
- // },
68
- entryFileNames: '[name].js',
69
- chunkFileNames: '[name].js',
70
- assetFileNames: '[name][extname]',
71
- // hoistTransitiveImports: false,
72
- preserveModules: true,
73
- preserveModulesRoot: 'src',
74
- },
75
- treeshake: false,
76
- preserveEntrySignatures: 'strict',
77
- },
78
- },
79
- })
package/vitest.config.ts DELETED
@@ -1,13 +0,0 @@
1
- import { fileURLToPath } from 'node:url'
2
- import { defineConfig } from 'vitest/config'
3
-
4
- export default defineConfig({
5
- resolve: {
6
- alias: {
7
- // Point at the source, not `dist`. The state-sync tests exist to catch a
8
- // regression in `applyState`, and resolving the published entry would test
9
- // whatever was last built instead of what is in the tree.
10
- '@poveste/shared': fileURLToPath(new URL('../poveste-shared/src/index.ts', import.meta.url)),
11
- },
12
- },
13
- })