@varavel/vdl-plugin-sdk 0.1.4 → 0.1.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 CHANGED
@@ -139,8 +139,8 @@ npx vdl-plugin check
139
139
  npx vdl-plugin build
140
140
  ```
141
141
 
142
- - `check` runs TypeScript without emitting files.
143
- - `build` bundles the required `src/index.ts` entry into `dist/index.js`.
142
+ - `check` runs TypeScript without emitting files. If a `tsconfig.vitest.json` is present, it also type-checks test code.
143
+ - `build` bundles the required `src/index.ts` entry into `dist/index.js`. Minification is enabled by default; pass `--no-minify` to disable it.
144
144
 
145
145
  Example `package.json` scripts:
146
146
 
@@ -155,14 +155,37 @@ Example `package.json` scripts:
155
155
 
156
156
  ## TypeScript Setup
157
157
 
158
- You can extend the shared base config exported by the SDK:
158
+ You can extend the shared base config exported by the SDK in your `tsconfig.json` file:
159
159
 
160
160
  ```json
161
161
  {
162
- "extends": "@varavel/vdl-plugin-sdk/tsconfig.base.json"
162
+ "extends": "@varavel/vdl-plugin-sdk/tsconfig.base.json",
163
+ "include": ["src/**/*.ts"],
164
+ "exclude": ["src/**/*.test.ts"]
163
165
  }
164
166
  ```
165
167
 
168
+ ## Testing
169
+
170
+ To add tests to your plugin, install [vitest](https://vitest.dev):
171
+
172
+ ```bash
173
+ npm install --save-dev vitest
174
+ ```
175
+
176
+ Then create a `tsconfig.vitest.json` in the root of your project:
177
+
178
+ ```json
179
+ {
180
+ "extends": "@varavel/vdl-plugin-sdk/tsconfig.vitest.base.json",
181
+ "include": ["src/**/*.test.ts", "tests/**/*.ts", "vitest.config.ts"]
182
+ }
183
+ ```
184
+
185
+ This config extends the base provided by the SDK and includes Node.js types exclusively for test files, keeping them out of your main plugin compilation.
186
+
187
+ Once the file is in place, `vdl-plugin check` will automatically type-check your test code as well.
188
+
166
189
  ## License
167
190
 
168
191
  This project is released under the MIT License. See [LICENSE](LICENSE).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varavel/vdl-plugin-sdk",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "SDK to build plugins for VDL using TypeScript",
5
5
  "keywords": [
6
6
  "varavel",
@@ -14,7 +14,5 @@
14
14
  "declarationMap": true,
15
15
  "sourceMap": true,
16
16
  "types": ["@varavel/vdl-plugin-sdk"]
17
- },
18
- "include": ["src/**/*.ts"],
19
- "exclude": ["src/**/*.test.ts"]
17
+ }
20
18
  }
@@ -2,7 +2,5 @@
2
2
  "extends": "./tsconfig.base.json",
3
3
  "compilerOptions": {
4
4
  "types": ["@varavel/vdl-plugin-sdk", "node", "vitest/importMeta"]
5
- },
6
- "include": ["src/**/*.test.ts", "tests/**/*.ts", "vitest.config.ts"],
7
- "exclude": []
5
+ }
8
6
  }