vite-plugin-dts 3.0.2 → 3.0.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/README.md CHANGED
@@ -15,7 +15,7 @@
15
15
  ## Install
16
16
 
17
17
  ```sh
18
- pnpm add vite-plugin-dts -D
18
+ pnpm i vite-plugin-dts -D
19
19
  ```
20
20
 
21
21
  ## Usage
@@ -59,9 +59,7 @@ export default defineComponent({
59
59
 
60
60
  ```vue
61
61
  <script setup lang="ts">
62
- // Need to access the defineProps returned value to
63
- // infer types although you never use the props directly
64
- const props = defineProps<{
62
+ defineProps<{
65
63
  color: 'blue' | 'red'
66
64
  }>()
67
65
  </script>
package/README.zh-CN.md CHANGED
@@ -15,7 +15,7 @@
15
15
  ## 安装
16
16
 
17
17
  ```sh
18
- pnpm add vite-plugin-dts -D
18
+ pnpm i vite-plugin-dts -D
19
19
  ```
20
20
 
21
21
  ## 使用
@@ -59,8 +59,7 @@ export default defineComponent({
59
59
 
60
60
  ```vue
61
61
  <script setup lang="ts">
62
- // 尽管没有直接使用 props,你仍需要接收 defineProps 的返回值
63
- const props = defineProps<{
62
+ defineProps<{
64
63
  color: 'blue' | 'red'
65
64
  }>()
66
65
  </script>
package/dist/index.cjs CHANGED
@@ -25,6 +25,7 @@ const debug__default = /*#__PURE__*/_interopDefaultCompat(debug);
25
25
  const dtsRE$1 = /\.d\.tsx?$/;
26
26
  function rollupDeclarationFiles({
27
27
  root,
28
+ configPath,
28
29
  compilerOptions,
29
30
  outDir,
30
31
  entryPath,
@@ -44,7 +45,7 @@ function rollupDeclarationFiles({
44
45
  mainEntryPointFilePath: entryPath,
45
46
  bundledPackages,
46
47
  compiler: {
47
- // tsconfigFilePath: tsConfigPath,
48
+ tsconfigFilePath: configPath,
48
49
  overrideTsconfig: {
49
50
  $schema: "http://json.schemastore.org/tsconfig",
50
51
  compilerOptions: {
@@ -86,7 +87,7 @@ function rollupDeclarationFiles({
86
87
  const compilerState = apiExtractor.CompilerState.create(extractorConfig, {
87
88
  localBuild: false,
88
89
  showVerboseMessages: false,
89
- typescriptCompilerFolder: libFolder ? node_path.resolve(libFolder, "..") : void 0
90
+ typescriptCompilerFolder: libFolder ? node_path.resolve(libFolder) : void 0
90
91
  });
91
92
  const sourceMapper = new SourceMapper_js.SourceMapper();
92
93
  const messageRouter = new MessageRouter_js.MessageRouter({
@@ -356,6 +357,7 @@ function dtsPlugin(options = {}) {
356
357
  let root = ensureAbsolute(options.root ?? "", process.cwd());
357
358
  let publicRoot = "";
358
359
  let entryRoot = options.entryRoot ?? "";
360
+ let configPath;
359
361
  let compilerOptions;
360
362
  let rawCompilerOptions;
361
363
  let outDirs;
@@ -455,7 +457,7 @@ ${kolorist.cyan(
455
457
  bundleDebug("begin buildStart");
456
458
  timeRecord = 0;
457
459
  const startTime = Date.now();
458
- const configPath = tsconfigPath ? ensureAbsolute(tsconfigPath, root) : ts__default.findConfigFile(root, ts__default.sys.fileExists);
460
+ configPath = tsconfigPath ? ensureAbsolute(tsconfigPath, root) : ts__default.findConfigFile(root, ts__default.sys.fileExists);
459
461
  const content = configPath ? languageCore.createParsedCommandLine(ts__default, ts__default.sys, configPath) : void 0;
460
462
  compilerOptions = {
461
463
  ...content?.options || {},
@@ -658,6 +660,7 @@ export default ${libName}
658
660
  const path = resolve(outDir, `${name.replace(tsRE, "")}.d.ts`);
659
661
  rollupDeclarationFiles({
660
662
  root,
663
+ configPath,
661
664
  compilerOptions: rawCompilerOptions,
662
665
  outDir,
663
666
  entryPath: path,
@@ -671,6 +674,7 @@ export default ${libName}
671
674
  } else {
672
675
  rollupDeclarationFiles({
673
676
  root,
677
+ configPath,
674
678
  compilerOptions: rawCompilerOptions,
675
679
  outDir,
676
680
  entryPath: typesPath,
package/dist/index.mjs CHANGED
@@ -25,6 +25,7 @@ import { PackageJsonLookup } from '@rushstack/node-core-library';
25
25
  const dtsRE$1 = /\.d\.tsx?$/;
26
26
  function rollupDeclarationFiles({
27
27
  root,
28
+ configPath,
28
29
  compilerOptions,
29
30
  outDir,
30
31
  entryPath,
@@ -44,7 +45,7 @@ function rollupDeclarationFiles({
44
45
  mainEntryPointFilePath: entryPath,
45
46
  bundledPackages,
46
47
  compiler: {
47
- // tsconfigFilePath: tsConfigPath,
48
+ tsconfigFilePath: configPath,
48
49
  overrideTsconfig: {
49
50
  $schema: "http://json.schemastore.org/tsconfig",
50
51
  compilerOptions: {
@@ -86,7 +87,7 @@ function rollupDeclarationFiles({
86
87
  const compilerState = CompilerState.create(extractorConfig, {
87
88
  localBuild: false,
88
89
  showVerboseMessages: false,
89
- typescriptCompilerFolder: libFolder ? resolve$1(libFolder, "..") : void 0
90
+ typescriptCompilerFolder: libFolder ? resolve$1(libFolder) : void 0
90
91
  });
91
92
  const sourceMapper = new SourceMapper();
92
93
  const messageRouter = new MessageRouter({
@@ -356,6 +357,7 @@ function dtsPlugin(options = {}) {
356
357
  let root = ensureAbsolute(options.root ?? "", process.cwd());
357
358
  let publicRoot = "";
358
359
  let entryRoot = options.entryRoot ?? "";
360
+ let configPath;
359
361
  let compilerOptions;
360
362
  let rawCompilerOptions;
361
363
  let outDirs;
@@ -455,7 +457,7 @@ ${cyan(
455
457
  bundleDebug("begin buildStart");
456
458
  timeRecord = 0;
457
459
  const startTime = Date.now();
458
- const configPath = tsconfigPath ? ensureAbsolute(tsconfigPath, root) : ts.findConfigFile(root, ts.sys.fileExists);
460
+ configPath = tsconfigPath ? ensureAbsolute(tsconfigPath, root) : ts.findConfigFile(root, ts.sys.fileExists);
459
461
  const content = configPath ? createParsedCommandLine(ts, ts.sys, configPath) : void 0;
460
462
  compilerOptions = {
461
463
  ...content?.options || {},
@@ -658,6 +660,7 @@ export default ${libName}
658
660
  const path = resolve(outDir, `${name.replace(tsRE, "")}.d.ts`);
659
661
  rollupDeclarationFiles({
660
662
  root,
663
+ configPath,
661
664
  compilerOptions: rawCompilerOptions,
662
665
  outDir,
663
666
  entryPath: path,
@@ -671,6 +674,7 @@ export default ${libName}
671
674
  } else {
672
675
  rollupDeclarationFiles({
673
676
  root,
677
+ configPath,
674
678
  compilerOptions: rawCompilerOptions,
675
679
  outDir,
676
680
  entryPath: typesPath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-dts",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "qmhc",