@poveste/plugin-quasar 0.18.3 → 0.19.1

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 CHANGED
@@ -6,9 +6,10 @@ 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, with a setup file:
10
10
 
11
11
  ```ts
12
+ // poveste.config.ts
12
13
  import { HstQuasar } from '@poveste/plugin-quasar'
13
14
  import { HstVue } from '@poveste/plugin-vue'
14
15
  import { defineConfig } from 'poveste'
@@ -18,9 +19,20 @@ export default defineConfig({
18
19
  HstVue(),
19
20
  HstQuasar(),
20
21
  ],
22
+ setupFile: '/src/poveste.setup.ts',
21
23
  })
22
24
  ```
23
25
 
26
+ The setup file installs Quasar into the app Poveste renders your stories in, and every Quasar component needs it, not only boot files. Without it the book still builds, and each story that uses a Quasar component shows "This component threw while rendering", with `Cannot read properties of undefined (reading 'platform')` in the browser console.
27
+
28
+ ```ts
29
+ // src/poveste.setup.ts
30
+ import { setupQuasar } from '@poveste/plugin-quasar/setup'
31
+ import { defineSetupVue } from '@poveste/plugin-vue'
32
+
33
+ export const setupVue = defineSetupVue(setupQuasar())
34
+ ```
35
+
24
36
  Quasar builds its Vite config asynchronously and exposes it through an
25
37
  entrypoint whose own header says it is for tooling. This plugin fetches it and
26
38
  makes the two adjustments a book needs — both of which are easy to get wrong and
package/dist/index.d.ts CHANGED
@@ -48,11 +48,19 @@ export declare function withoutProcessExit<T>(fn: () => Promise<T>): Promise<T>;
48
48
  * `ssr.noExternal` is the part users should not have to know: Quasar's plugin
49
49
  * writes `__QUASAR_VERSION__` while transforming its own source, so that source
50
50
  * has to be transformed rather than externalised during story collection.
51
+ *
52
+ * `optimizeDeps.include` names Quasar because Vite's scan cannot find it: a
53
+ * `<q-btn>` becomes an import of `quasar` only when Quasar's plugin transforms
54
+ * the template. Left to be discovered, it is bundled in a second pass once the
55
+ * first story loads, and the page is reloaded under the reader while it runs.
51
56
  */
52
57
  export declare function quasarViteConfig(viteConfig: QuasarViteConfig): {
53
58
  ssr: {
54
59
  noExternal: RegExp[];
55
60
  };
61
+ optimizeDeps: {
62
+ include: string[];
63
+ };
56
64
  define: {
57
65
  [x: string]: unknown;
58
66
  };
package/dist/index.js CHANGED
@@ -88,10 +88,16 @@ export async function withoutProcessExit(fn) {
88
88
  * `ssr.noExternal` is the part users should not have to know: Quasar's plugin
89
89
  * writes `__QUASAR_VERSION__` while transforming its own source, so that source
90
90
  * has to be transformed rather than externalised during story collection.
91
+ *
92
+ * `optimizeDeps.include` names Quasar because Vite's scan cannot find it: a
93
+ * `<q-btn>` becomes an import of `quasar` only when Quasar's plugin transforms
94
+ * the template. Left to be discovered, it is bundled in a second pass once the
95
+ * first story loads, and the page is reloaded under the reader while it runs.
91
96
  */
92
97
  export function quasarViteConfig(viteConfig) {
93
98
  return {
94
99
  ssr: { noExternal: [/quasar/] },
100
+ optimizeDeps: { include: ['quasar'] },
95
101
  define: { ...viteConfig.define },
96
102
  resolve: {
97
103
  alias: viteConfig.resolve?.alias,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@poveste/plugin-quasar",
3
3
  "type": "module",
4
- "version": "0.18.3",
4
+ "version": "0.19.1",
5
5
  "description": "Poveste plugin that builds a book inside a Quasar project",
6
6
  "author": {
7
7
  "name": "Sorin Gitlan",
@@ -52,18 +52,18 @@
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@quasar/app-vite": "^3.8.0",
55
- "poveste": "^0.18.3",
55
+ "poveste": "^0.19.1",
56
56
  "quasar": "^2.24.0",
57
57
  "vue": "^3.5.43"
58
58
  },
59
59
  "dependencies": {
60
- "@poveste/shared": "0.18.3",
60
+ "@poveste/shared": "0.19.1",
61
61
  "pathe": "^2.0.3"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@quasar/app-vite": "^3.10.0",
65
65
  "@types/node": "^26.6.3",
66
- "poveste": "0.18.3",
66
+ "poveste": "0.19.1",
67
67
  "quasar": "^2.33.2",
68
68
  "typescript": "6.0.3",
69
69
  "vite": "^8.3.1",