vite-plugin-ember 0.0.3 → 0.0.5
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 +24 -0
- package/package.json +8 -1
package/README.md
CHANGED
|
@@ -21,10 +21,14 @@ Write `.gjs` / `.gts` code fences in markdown and see them rendered on the page
|
|
|
21
21
|
|
|
22
22
|
### 1. Install
|
|
23
23
|
|
|
24
|
+
Install the plugin along with Ember packages your components need:
|
|
25
|
+
|
|
24
26
|
```sh
|
|
25
27
|
pnpm add vite-plugin-ember ember-source @glimmer/component
|
|
26
28
|
```
|
|
27
29
|
|
|
30
|
+
> **Note:** `ember-source` and `@glimmer/component` are peer dependencies — you manage their versions in your project.
|
|
31
|
+
|
|
28
32
|
### 2. Configure VitePress
|
|
29
33
|
|
|
30
34
|
```ts
|
|
@@ -60,6 +64,16 @@ export default {
|
|
|
60
64
|
} satisfies Theme;
|
|
61
65
|
```
|
|
62
66
|
|
|
67
|
+
If TypeScript cannot resolve the `.vue` import, add this declaration to your project (e.g. `env.d.ts`):
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
declare module 'vite-plugin-ember/components/code-preview.vue' {
|
|
71
|
+
import type { DefineComponent } from 'vue';
|
|
72
|
+
const component: DefineComponent<object, object, any>;
|
|
73
|
+
export default component;
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
63
77
|
### 4. Write a live demo
|
|
64
78
|
|
|
65
79
|
In any markdown file:
|
|
@@ -111,6 +125,16 @@ pnpm dev
|
|
|
111
125
|
└── pnpm-workspace.yaml
|
|
112
126
|
````
|
|
113
127
|
|
|
128
|
+
## Limitations
|
|
129
|
+
|
|
130
|
+
Components are rendered standalone via `@ember/renderer` — there is **no Ember application container**. This means:
|
|
131
|
+
|
|
132
|
+
- **`@service` injection does not work** — there is no owner/DI container to resolve services from
|
|
133
|
+
- **Initializers and instance-initializers** are not executed
|
|
134
|
+
- **Routing** (`LinkTo`, `RouterService`) is not available
|
|
135
|
+
|
|
136
|
+
Components that rely only on `@tracked` state, `@action`, modifiers, and helpers work as expected.
|
|
137
|
+
|
|
114
138
|
## Requirements
|
|
115
139
|
|
|
116
140
|
- Node.js ≥ 20
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-ember",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Vite plugin for rendering live Ember components in VitePress documentation",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -67,10 +67,17 @@
|
|
|
67
67
|
"vue": "^3.5.28"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
+
"@glimmer/component": ">=1",
|
|
71
|
+
"ember-source": ">=5",
|
|
70
72
|
"vite": ">=5",
|
|
71
73
|
"vitepress": ">=1",
|
|
72
74
|
"vue": ">=3"
|
|
73
75
|
},
|
|
76
|
+
"peerDependenciesMeta": {
|
|
77
|
+
"@glimmer/component": {
|
|
78
|
+
"optional": true
|
|
79
|
+
}
|
|
80
|
+
},
|
|
74
81
|
"scripts": {
|
|
75
82
|
"build": "tsc -p tsconfig.json",
|
|
76
83
|
"lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:'",
|