@varavel/vdl-plugin-sdk 0.1.3 → 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 +27 -4
- package/package.json +1 -1
- package/tsconfig.vitest.base.json +1 -2
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