Socket
Socket
Sign inDemoInstall

vite-plugin-vue-type-imports

Package Overview
Dependencies
44
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.0 to 0.2.1

dist/chunk-CATVRM2Q.mjs

16

dist/index.d.ts

@@ -1,3 +0,13 @@

import VitePluginVueTypeImports from './vite';
export { default } from './vite';
import 'vite';
import { Plugin } from 'vite';
interface CleanOptions {
newline?: boolean;
interface?: boolean;
}
interface PluginOptions {
clean?: CleanOptions;
}
declare function VitePluginVueTypeImports(options?: PluginOptions): Plugin;
export { VitePluginVueTypeImports as default };

54

package.json
{
"name": "vite-plugin-vue-type-imports",
"version": "0.2.0",
"version": "0.2.1",
"types": "dist/index.d.ts",

@@ -19,6 +19,2 @@ "license": "MIT",

},
"./vite": {
"require": "./dist/vite.js",
"import": "./dist/vite.mjs"
},
"./nuxt": {

@@ -30,33 +26,32 @@ "require": "./dist/nuxt.js",

"scripts": {
"build": "tsup",
"dev": "tsup --watch src",
"build": "cross-env NODE_ENV=production tsup",
"dev": "cross-env NODE_ENV=development tsup --watch src",
"prepublishOnly": "nr build",
"lint": "eslint \"**/*.{ts,vue,mjs}\"",
"lint:fix": "nr lint -- --fix",
"lint:fix": "nr lint --fix",
"play": "npm -C playground run dev",
"play:build": "pnpm run build && npm -C playground run build",
"release": "git-ensure --no-behind -b main --clean && bumpp --commit --tag --push",
"test": "jest",
"test:update": "jest -u"
"test": "vitest",
"test:ui": "vitest --ui",
"coverage": "vitest run --coverage"
},
"keywords": [],
"devDependencies": {
"@antfu/eslint-config": "^0.11.1",
"@antfu/ni": "^0.11.0",
"@babel/generator": "^7.16.0",
"@types/jest": "^27.0.3",
"@types/node": "^16.11.11",
"@vue/compiler-sfc": "^3.2.24",
"bumpp": "^7.1.1",
"eslint": "^8.3.0",
"eslint-plugin-jest": "^25.3.0",
"esno": "^0.12.1",
"fast-glob": "^3.2.7",
"@antfu/eslint-config": "^0.25.2",
"@antfu/ni": "^0.17.2",
"@types/node": "^18.6.3",
"@vitest/ui": "^0.20.3",
"@vue/compiler-sfc": "^3.2.37",
"bumpp": "^8.2.1",
"c8": "^7.12.0",
"cross-env": "^7.0.3",
"eslint": "^8.21.0",
"esno": "^0.16.3",
"git-ensure": "^0.1.0",
"jest": "^27.4.3",
"ts-jest": "^27.0.7",
"tsup": "5.6.0",
"typescript": "^4.5.2",
"vite": "^2.6.14",
"vue": "^3.2.24"
"tsup": "6.2.1",
"typescript": "^4.7.4",
"vite": "^3.0.4",
"vitest": "^0.20.3",
"vue": "^3.2.37"
},

@@ -66,3 +61,8 @@ "peerDependencies": {

"vue": "^3.2.24"
},
"dependencies": {
"@babel/types": "^7.18.10",
"fast-glob": "^3.2.11",
"local-pkg": "^0.4.2"
}
}

@@ -29,3 +29,3 @@ <h2 align="center">vite-plugin-vue-type-imports</h2>

Vue(),
VueTypeImports(),
VueTypeImports({/* options */}),
],

@@ -68,5 +68,36 @@ })

## Options
```typescript
VueTypeImports({
// Non-practical function
// Just for those who want to get a nice output
clean: {
// Clean redundant newlines ("\n")
newline: false,
// Clean isolated interfaces which are replaced by a new interface created by the plugin
interface: false,
}
})
```
## Known limitations
- The following syntaxes are not supported currently:
- `import default`
- `import { a as b }`
- `export default`
- `export * from`
- nested type parameters (e.g. `defineProps<Props<T>>()`) are not supported.
- ~~At this stage, the plugin only scans the imported interfaces and does not process the interfaces defined in the SFC~~ Supported in the next release.
- ~~HMR is not fully supported right now.~~ Fixed in the next release.
- Interface which extends Literal Type or Intersection Type is not supported.
- Types imported from external packages are not fully supported right now.
- When interfaces implicitly rely on interfaces with the same name but different structures, the results may be different from what is expected.
- The plugin currently only scans the content of `<script setup>`. Types defined in `<script>` will be ignored.
## Notes
- `Enum` types will be converted to Union Types (e.g. `type [name] = number | string`) , since Vue can't handle them right now.
- The plugin may be slow because it needs to traverse the AST (using @babel/parser).
## License
[MIT License](https://github.com/jacobclevenger/vite-plugin-vue-gql/blob/main/LICENSE) © 2021-PRESENT [Jacob Clevenger](https://github.com/jacobclevenger)

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc