@poveste/plugin-vue 0.6.0 → 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.
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Guillaume Chau (original "histoire" project)
4
+ Copyright (c) 2026 Sorin Gitlan (poveste fork)
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
@@ -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.0",
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,33 +58,43 @@
42
58
  },
43
59
  "main": "dist/index.js",
44
60
  "types": "dist/index.node.d.ts",
45
- "scripts": {
46
- "build": "rimraf dist && vite build && tsc -d -P tsconfig.build.json && pnpm run build:types",
47
- "build:types": "tsc --declaration --emitDeclarationOnly",
48
- "watch": "concurrently \"vite build --watch\" \"tsc -d -P tsconfig.build.json --watch\" \"pnpm run build:types --watch\"",
49
- "test": "vitest run",
50
- "test:dev": "vitest"
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"
51
70
  },
52
71
  "peerDependencies": {
53
- "poveste": "workspace:^",
54
- "vue": "^3.5.26"
72
+ "vue": "^3.5.26",
73
+ "poveste": "^0.7.0"
55
74
  },
56
75
  "dependencies": {
57
- "@poveste/controls": "workspace:^",
58
- "@poveste/shared": "workspace:^",
59
- "@poveste/vendors": "workspace:^",
60
76
  "change-case": "^5.4.4",
61
77
  "globby": "^14.0.2",
62
78
  "launch-editor": "^2.9.1",
63
- "pathe": "^1.1.2"
79
+ "pathe": "^1.1.2",
80
+ "@poveste/controls": "^0.7.0",
81
+ "@poveste/vendors": "^0.7.0",
82
+ "@poveste/shared": "^0.7.0"
64
83
  },
65
84
  "devDependencies": {
66
85
  "@types/node": "^22.10.1",
67
86
  "concurrently": "^9.1.0",
68
- "poveste": "workspace:*",
69
- "typescript": "catalog:",
70
- "vite": "catalog:",
71
- "vitest": "catalog:",
72
- "vue": "^3.5.26"
87
+ "typescript": "5.6.3",
88
+ "vite": "^8.2.0",
89
+ "vitest": "^4.1.10",
90
+ "vue": "^3.5.26",
91
+ "poveste": "0.7.0"
92
+ },
93
+ "scripts": {
94
+ "build": "rimraf dist && vite build && tsc -d -P tsconfig.build.json && pnpm run build:types",
95
+ "build:types": "tsc --declaration --emitDeclarationOnly",
96
+ "watch": "concurrently \"vite build --watch\" \"tsc -d -P tsconfig.build.json --watch\" \"pnpm run build:types --watch\"",
97
+ "test": "vitest run",
98
+ "test:dev": "vitest"
73
99
  }
74
- }
100
+ }
@@ -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
- })