@poveste/plugin-quasar 0.19.1 → 0.21.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/README.md +16 -3
- package/dist/default-setup.d.ts +3 -0
- package/dist/default-setup.js +4 -0
- package/dist/index.js +13 -0
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Builds a Poveste book inside a Quasar project.
|
|
|
6
6
|
pnpm add -D poveste @poveste/plugin-vue @poveste/plugin-quasar
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Add both plugins in poveste config
|
|
9
|
+
Add both plugins in poveste config:
|
|
10
10
|
|
|
11
11
|
```ts
|
|
12
12
|
// poveste.config.ts
|
|
@@ -19,11 +19,22 @@ export default defineConfig({
|
|
|
19
19
|
HstVue(),
|
|
20
20
|
HstQuasar(),
|
|
21
21
|
],
|
|
22
|
-
setupFile: '/src/poveste.setup.ts',
|
|
23
22
|
})
|
|
24
23
|
```
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
Every Quasar component needs Quasar installed into the app Poveste renders your stories in. With no `setupFile`, `HstQuasar()` installs it with Quasar's defaults. Name a setup file when you need Quasar's options or your boot files (below). Installing Quasar is then that file's job, and `setupQuasar()` does it. A setup file that skips it shows "This component threw while rendering" on each story that uses a Quasar component, with `Cannot read properties of undefined (reading 'platform')` in the browser console.
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
// poveste.config.ts
|
|
29
|
+
import { HstQuasar } from '@poveste/plugin-quasar'
|
|
30
|
+
import { HstVue } from '@poveste/plugin-vue'
|
|
31
|
+
import { defineConfig } from 'poveste'
|
|
32
|
+
|
|
33
|
+
export default defineConfig({
|
|
34
|
+
plugins: [HstVue(), HstQuasar()],
|
|
35
|
+
setupFile: '/src/poveste.setup.ts',
|
|
36
|
+
})
|
|
37
|
+
```
|
|
27
38
|
|
|
28
39
|
```ts
|
|
29
40
|
// src/poveste.setup.ts
|
|
@@ -33,6 +44,8 @@ import { defineSetupVue } from '@poveste/plugin-vue'
|
|
|
33
44
|
export const setupVue = defineSetupVue(setupQuasar())
|
|
34
45
|
```
|
|
35
46
|
|
|
47
|
+
Your Vue components get a props, slots and events table on each story's **Docs** tab, through `@poveste/plugin-vue`. It needs `typescript` 6 or earlier in the project (`npm i -D typescript@6`), which a Quasar project installed with npm doesn't have; without it, or with 7, it turns itself off and says so once.
|
|
48
|
+
|
|
36
49
|
Quasar builds its Vite config asynchronously and exposes it through an
|
|
37
50
|
entrypoint whose own header says it is for tooling. This plugin fetches it and
|
|
38
51
|
makes the two adjustments a book needs — both of which are easy to get wrong and
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import process from 'node:process';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
3
4
|
import { dirname, join, parse } from 'pathe';
|
|
4
5
|
/**
|
|
5
6
|
* Quasar builds its Vite config asynchronously and hands it over through one
|
|
@@ -107,6 +108,8 @@ export function quasarViteConfig(viteConfig) {
|
|
|
107
108
|
plugins: viteConfig.plugins,
|
|
108
109
|
};
|
|
109
110
|
}
|
|
111
|
+
/** Installs Quasar with its defaults: what `setupQuasar()` does with no options. */
|
|
112
|
+
const DEFAULT_SETUP_FILE = fileURLToPath(new URL('./default-setup.js', import.meta.url));
|
|
110
113
|
export function HstQuasar(options = {}) {
|
|
111
114
|
return {
|
|
112
115
|
name: '@poveste/plugin-quasar',
|
|
@@ -118,5 +121,15 @@ export function HstQuasar(options = {}) {
|
|
|
118
121
|
const viteConfig = await withoutProcessExit(() => getTestingConfig(options.ctx ?? {}));
|
|
119
122
|
return { vite: quasarViteConfig(viteConfig) };
|
|
120
123
|
},
|
|
124
|
+
// Every Quasar component needs Quasar installed into the app a story renders
|
|
125
|
+
// in, and a book with no setup file built green and threw on every one of
|
|
126
|
+
// them (#1337). A book that names its own is left to install it, with its
|
|
127
|
+
// own options and boot files.
|
|
128
|
+
config(config) {
|
|
129
|
+
if (!config.setupFile) {
|
|
130
|
+
return { setupFile: DEFAULT_SETUP_FILE };
|
|
131
|
+
}
|
|
132
|
+
return undefined;
|
|
133
|
+
},
|
|
121
134
|
};
|
|
122
135
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poveste/plugin-quasar",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"description": "Poveste plugin that builds a book inside a Quasar project",
|
|
4
|
+
"version": "0.21.0",
|
|
5
|
+
"description": "Poveste plugin that builds a book inside a Quasar project, including the props tables @poveste/plugin-vue reads from your components' types",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Sorin Gitlan",
|
|
8
8
|
"url": "https://x.com/50rayn"
|
|
@@ -52,23 +52,23 @@
|
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@quasar/app-vite": "^3.8.0",
|
|
55
|
-
"poveste": "^0.
|
|
55
|
+
"poveste": "^0.21.0",
|
|
56
56
|
"quasar": "^2.24.0",
|
|
57
57
|
"vue": "^3.5.43"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@poveste/shared": "0.
|
|
60
|
+
"@poveste/shared": "0.21.0",
|
|
61
61
|
"pathe": "^2.0.3"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@quasar/app-vite": "^3.10.
|
|
65
|
-
"@types/node": "^26.6.
|
|
66
|
-
"poveste": "0.
|
|
67
|
-
"quasar": "^2.
|
|
64
|
+
"@quasar/app-vite": "^3.10.3",
|
|
65
|
+
"@types/node": "^26.6.5",
|
|
66
|
+
"poveste": "0.21.0",
|
|
67
|
+
"quasar": "^2.35.2",
|
|
68
68
|
"typescript": "6.0.3",
|
|
69
|
-
"vite": "^8.3.
|
|
70
|
-
"vitest": "^5.0.
|
|
71
|
-
"vue": "^3.5.
|
|
69
|
+
"vite": "^8.3.4",
|
|
70
|
+
"vitest": "^5.0.5",
|
|
71
|
+
"vue": "^3.5.44"
|
|
72
72
|
},
|
|
73
73
|
"scripts": {
|
|
74
74
|
"build": "rimraf dist && tsc -d",
|