@varavel/vdl-plugin-sdk 0.1.2 → 0.1.3

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/bin/vdl-plugin.js CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { execFileSync } from "node:child_process";
4
+ import { existsSync } from "node:fs";
4
5
  import { createRequire } from "node:module";
5
6
  import { resolve } from "node:path";
6
7
  import * as esbuild from "esbuild";
@@ -37,7 +38,24 @@ function runCheck() {
37
38
 
38
39
  try {
39
40
  const tscPath = require.resolve("typescript/bin/tsc");
40
- execFileSync(process.execPath, [tscPath, "--noEmit"], { stdio: "inherit" });
41
+
42
+ log.info("Checking production code...");
43
+ execFileSync(
44
+ process.execPath,
45
+ [tscPath, "-p", "tsconfig.json", "--noEmit"],
46
+ { stdio: "inherit" },
47
+ );
48
+
49
+ const vitestTsConfig = resolve(process.cwd(), "tsconfig.vitest.json");
50
+ if (existsSync(vitestTsConfig)) {
51
+ log.info("Checking test code...");
52
+ execFileSync(
53
+ process.execPath,
54
+ [tscPath, "-p", "tsconfig.vitest.json", "--noEmit"],
55
+ { stdio: "inherit" },
56
+ );
57
+ }
58
+
41
59
  log.ok("Type checks completed successfully.");
42
60
  } catch {
43
61
  log.error("Type checks failed.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varavel/vdl-plugin-sdk",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "SDK to build plugins for VDL using TypeScript",
5
5
  "keywords": [
6
6
  "varavel",
@@ -37,7 +37,8 @@
37
37
  "require": "./dist/index.cjs",
38
38
  "default": "./dist/index.js"
39
39
  },
40
- "./tsconfig.base.json": "./tsconfig.base.json"
40
+ "./tsconfig.base.json": "./tsconfig.base.json",
41
+ "./tsconfig.vitest.base.json": "./tsconfig.vitest.base.json"
41
42
  },
42
43
  "files": [
43
44
  "bin",
@@ -45,6 +46,7 @@
45
46
  "src",
46
47
  "dist",
47
48
  "tsconfig.base.json",
49
+ "tsconfig.vitest.base.json",
48
50
  "README.md",
49
51
  "LICENSE"
50
52
  ],
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "./tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "types": ["@varavel/vdl-plugin-sdk", "node", "vitest/importMeta"]
5
+ },
6
+ "include": ["src/**/*.test.ts", "tests/**/*.ts", "vitest.config.ts"]
7
+ }