@eventra_dev/cli-plugin-vue 1.0.0 → 1.0.2

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.
Files changed (2) hide show
  1. package/README.md +9 -5
  2. package/package.json +4 -2
package/README.md CHANGED
@@ -7,7 +7,8 @@
7
7
  <p align="center">
8
8
  <a href="https://www.npmjs.com/package/@eventra_dev/cli-plugin-vue"><img alt="npm version" src="https://img.shields.io/npm/v/@eventra_dev/cli-plugin-vue.svg?style=flat-square&color=blue"></a>
9
9
  <a href="https://www.npmjs.com/package/@eventra_dev/cli-plugin-vue"><img alt="npm downloads" src="https://img.shields.io/npm/dm/@eventra_dev/cli-plugin-vue.svg?style=flat-square&color=blue"></a>
10
- <img alt="tests passing" src="https://img.shields.io/badge/tests-15%20passing-brightgreen?style=flat-square&logo=vitest&logoColor=white">
10
+ <img alt="tests passing" src="https://img.shields.io/badge/tests-16%20passing-brightgreen?style=flat-square&logo=vitest&logoColor=white">
11
+ <img alt="coverage" src="https://img.shields.io/badge/coverage-95%25-brightgreen?style=flat-square&logo=vitest&logoColor=white">
11
12
  <img alt="node" src="https://img.shields.io/node/v/@eventra_dev/cli-plugin-vue?style=flat-square&color=darkgreen&logo=node.js&logoColor=white">
12
13
  <a href="https://www.typescriptlang.org/"><img alt="TypeScript" src="https://img.shields.io/badge/TypeScript-ready-blue?style=flat-square&logo=typescript&logoColor=white"></a>
13
14
  <img alt="license" src="https://img.shields.io/npm/l/@eventra_dev/cli-plugin-vue?style=flat-square&color=lightgrey">
@@ -95,7 +96,7 @@ The expression is copied as-is into the same module scope as the script. If it r
95
96
 
96
97
  Nuxt pages, layouts, and components are ordinary `.vue` SFCs — parsed identically, no extra configuration needed.
97
98
 
98
- Composables auto-imported without an explicit `import` statement (Nuxt's own composables, or your own from `composables/`/`utils/`) resolve correctly **once the project has run `nuxt prepare`/`nuxt dev`** (so `.nuxt/` exists and is wired into `tsconfig.json` — the CLI analyzes the project's real `tsconfig.json`, so Nuxt's generated ambient types are visible to it like any other TypeScript project). This includes the case where a wrapper function that calls `track()` is only reachable via auto-import: the CLI understands the `declare const x: typeof import("./module")["name"]` shape Nuxt/`unplugin-auto-import` generate for these bindings.
99
+ Composables auto-imported without an explicit `import` statement (Nuxt's own composables, or your own from `composables/`/`utils/`) are intended to resolve **once the project has run `nuxt prepare`/`nuxt dev`** (so `.nuxt/` exists and is wired into `tsconfig.json` — the CLI analyzes the project's real `tsconfig.json`, so Nuxt's generated ambient types are visible to it like any other TypeScript project). The CLI's resolver understands the `declare const x: typeof import("./module")["name"]` shape Nuxt/`unplugin-auto-import` generate for these bindings, and this is covered by a unit test that hand-writes that ambient shape (`@eventra_dev/eventra-cli`'s `nuxtAutoImportCompat.test.ts`) — but running a real `nuxt prepare`/`nuxt build` end-to-end has not been verified in this environment (blocked by a sandbox GLIBC incompatibility with Nuxt's native build tooling), so this is not confirmed against a real generated `.nuxt/imports.d.ts`.
99
100
 
100
101
  ---
101
102
 
@@ -133,23 +134,26 @@ No dependency on `@eventra_dev/eventra-cli` — the CLI adapts this shape intern
133
134
 
134
135
  ## Test Coverage
135
136
 
136
- **15 unit tests** (vitest), covering:
137
+ **95% statement coverage** (79.2% branch, 100% function, 96.6% line — v8 provider, `pnpm test:coverage`).
138
+
139
+ **16 unit tests** (vitest), covering:
137
140
 
138
141
  | Area | Covers |
139
142
  |---|---|
140
143
  | SFC parsing | Script + script-setup merge order, comment safety, `src=` external files |
141
144
  | Template — literal | Nested elements, `v-if`/`v-for`, slots, multiple template roots |
142
145
  | Template — dynamic | Raw expression passthrough, resolution through the merged script scope |
143
- | Script-setup macros | `defineProps`/`defineEmits` pass through without special-casing |
146
+ | Script-setup macros | All five compiler macros (`defineProps`/`defineEmits`/`defineExpose`/`defineOptions`/`withDefaults`) pass through without special-casing |
144
147
  | Virtual module output | Single combined `.vue.ts`, export stub when script/template are empty |
145
148
  | Plugin contract | `match()`, `includeGlobs`, `staticSinks`, `transform()` |
146
149
 
147
- Also validated end-to-end against real Vue and Nuxt projects (including Nuxt's own generated `.nuxt/` ambient types) as part of `@eventra_dev/eventra-cli`'s test suite.
150
+ The Nuxt ambient auto-import shape (`declare const x: typeof import(...)`) is covered by a unit test in `@eventra_dev/eventra-cli` (`nuxtAutoImportCompat.test.ts`) that hand-writes that shape — this is not the same as an end-to-end run against a real `nuxt prepare`/`nuxt build`, which has not been verified in this environment (see the [Nuxt](#nuxt) section above).
148
151
 
149
152
  Run locally:
150
153
 
151
154
  ```bash
152
155
  pnpm --filter @eventra_dev/cli-plugin-vue test
156
+ pnpm --filter @eventra_dev/cli-plugin-vue test:coverage
153
157
  ```
154
158
 
155
159
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eventra_dev/cli-plugin-vue",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Eventra CLI plugin — extract track() calls from Vue SFC (.vue) files",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
@@ -29,7 +29,8 @@
29
29
  "build": "tsc -p tsconfig.json",
30
30
  "clean": "rm -rf dist",
31
31
  "test": "vitest run",
32
- "test:watch": "vitest"
32
+ "test:watch": "vitest",
33
+ "test:coverage": "vitest run --coverage"
33
34
  },
34
35
  "dependencies": {
35
36
  "@vue/compiler-core": "^3.5.40",
@@ -38,6 +39,7 @@
38
39
  },
39
40
  "devDependencies": {
40
41
  "@types/node": "^20.0.0",
42
+ "@vitest/coverage-v8": "^4.1.7",
41
43
  "typescript": "^5.3.0",
42
44
  "vitest": "^4.1.7"
43
45
  },