vite-plugin-vue-dx 0.0.2
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 +11 -0
- package/dist/index.cjs +40 -0
- package/dist/index.d.cts +23 -0
- package/dist/index.d.mts +23 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.mjs +25 -0
- package/package.json +51 -0
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# vite-plugin-vue-dx (wip)
|
|
2
|
+
|
|
3
|
+
This plugin is a collection of various plugins combined. The goal is to improve dx and remove the hassle of setting everything manually
|
|
4
|
+
|
|
5
|
+
#### Credits
|
|
6
|
+
|
|
7
|
+
- https://github.com/antfu/vitesse
|
|
8
|
+
- https://devtools-next.vuejs.org/
|
|
9
|
+
- https://github.com/unplugin/unplugin-turbo-console
|
|
10
|
+
- https://github.com/unplugin/unplugin-auto-import
|
|
11
|
+
- https://github.com/unplugin/unplugin-vue-components
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const VueJsx = require('@vitejs/plugin-vue-jsx');
|
|
6
|
+
const VueDevTools = require('vite-plugin-vue-devtools');
|
|
7
|
+
const TurboConsole = require('unplugin-turbo-console/vite');
|
|
8
|
+
const AutoImport = require('unplugin-auto-import/vite');
|
|
9
|
+
const Components = require('unplugin-vue-components/vite');
|
|
10
|
+
const utils = require('@antfu/utils');
|
|
11
|
+
const resolvers = require('unplugin-vue-components/resolvers');
|
|
12
|
+
|
|
13
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
14
|
+
|
|
15
|
+
const VueJsx__default = /*#__PURE__*/_interopDefaultCompat(VueJsx);
|
|
16
|
+
const VueDevTools__default = /*#__PURE__*/_interopDefaultCompat(VueDevTools);
|
|
17
|
+
const TurboConsole__default = /*#__PURE__*/_interopDefaultCompat(TurboConsole);
|
|
18
|
+
const AutoImport__default = /*#__PURE__*/_interopDefaultCompat(AutoImport);
|
|
19
|
+
const Components__default = /*#__PURE__*/_interopDefaultCompat(Components);
|
|
20
|
+
|
|
21
|
+
function applyPlugin(plugin, config, defaults, optional) {
|
|
22
|
+
if (config === false || optional && !config)
|
|
23
|
+
return [];
|
|
24
|
+
return plugin(defaults ? utils.deepMerge(defaults, config || {}) : config);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const index = (config) => {
|
|
28
|
+
return [
|
|
29
|
+
VueDevTools__default(config.devtools),
|
|
30
|
+
TurboConsole__default(config.console),
|
|
31
|
+
applyPlugin(VueJsx__default, config.jsx, void 0, true),
|
|
32
|
+
applyPlugin(AutoImport__default, config.autoimport, void 0, true),
|
|
33
|
+
applyPlugin(Components__default, config.components, void 0, true)
|
|
34
|
+
].flatMap((e) => e);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
exports.default = index;
|
|
38
|
+
Object.keys(resolvers).forEach(function (k) {
|
|
39
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = resolvers[k];
|
|
40
|
+
});
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as unplugin_vue_components_types from 'unplugin-vue-components/types';
|
|
2
|
+
import * as unplugin_auto_import_types from 'unplugin-auto-import/types';
|
|
3
|
+
import * as _vitejs_plugin_vue_jsx from '@vitejs/plugin-vue-jsx';
|
|
4
|
+
import * as unplugin_turbo_console_types from 'unplugin-turbo-console/types';
|
|
5
|
+
import { Plugin } from 'vite';
|
|
6
|
+
import { VitePluginVueDevToolsOptions } from 'vite-plugin-vue-devtools';
|
|
7
|
+
export * from 'unplugin-vue-components/resolvers';
|
|
8
|
+
|
|
9
|
+
interface Config {
|
|
10
|
+
/** {@link https://devtools-next.vuejs.org/ devtools-next} */
|
|
11
|
+
devtools: VitePluginVueDevToolsOptions;
|
|
12
|
+
/** {@link https://github.com/unplugin/unplugin-turbo-console unplugin-turbo-console} */
|
|
13
|
+
console: unplugin_turbo_console_types.Options;
|
|
14
|
+
/** {@link https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx @vitejs/plugin-vue-jsx} */
|
|
15
|
+
jsx: _vitejs_plugin_vue_jsx.Options | false;
|
|
16
|
+
/** {@link https://github.com/unplugin/unplugin-auto-import unplugin-auto-import} */
|
|
17
|
+
autoimport: unplugin_auto_import_types.Options | false;
|
|
18
|
+
/** {@link https://github.com/unplugin/unplugin-vue-components unplugin-vue-components} */
|
|
19
|
+
components: unplugin_vue_components_types.Options;
|
|
20
|
+
}
|
|
21
|
+
declare const _default: (config: Partial<Config>) => Plugin[];
|
|
22
|
+
|
|
23
|
+
export { type Config, _default as default };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as unplugin_vue_components_types from 'unplugin-vue-components/types';
|
|
2
|
+
import * as unplugin_auto_import_types from 'unplugin-auto-import/types';
|
|
3
|
+
import * as _vitejs_plugin_vue_jsx from '@vitejs/plugin-vue-jsx';
|
|
4
|
+
import * as unplugin_turbo_console_types from 'unplugin-turbo-console/types';
|
|
5
|
+
import { Plugin } from 'vite';
|
|
6
|
+
import { VitePluginVueDevToolsOptions } from 'vite-plugin-vue-devtools';
|
|
7
|
+
export * from 'unplugin-vue-components/resolvers';
|
|
8
|
+
|
|
9
|
+
interface Config {
|
|
10
|
+
/** {@link https://devtools-next.vuejs.org/ devtools-next} */
|
|
11
|
+
devtools: VitePluginVueDevToolsOptions;
|
|
12
|
+
/** {@link https://github.com/unplugin/unplugin-turbo-console unplugin-turbo-console} */
|
|
13
|
+
console: unplugin_turbo_console_types.Options;
|
|
14
|
+
/** {@link https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx @vitejs/plugin-vue-jsx} */
|
|
15
|
+
jsx: _vitejs_plugin_vue_jsx.Options | false;
|
|
16
|
+
/** {@link https://github.com/unplugin/unplugin-auto-import unplugin-auto-import} */
|
|
17
|
+
autoimport: unplugin_auto_import_types.Options | false;
|
|
18
|
+
/** {@link https://github.com/unplugin/unplugin-vue-components unplugin-vue-components} */
|
|
19
|
+
components: unplugin_vue_components_types.Options;
|
|
20
|
+
}
|
|
21
|
+
declare const _default: (config: Partial<Config>) => Plugin[];
|
|
22
|
+
|
|
23
|
+
export { type Config, _default as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as unplugin_vue_components_types from 'unplugin-vue-components/types';
|
|
2
|
+
import * as unplugin_auto_import_types from 'unplugin-auto-import/types';
|
|
3
|
+
import * as _vitejs_plugin_vue_jsx from '@vitejs/plugin-vue-jsx';
|
|
4
|
+
import * as unplugin_turbo_console_types from 'unplugin-turbo-console/types';
|
|
5
|
+
import { Plugin } from 'vite';
|
|
6
|
+
import { VitePluginVueDevToolsOptions } from 'vite-plugin-vue-devtools';
|
|
7
|
+
export * from 'unplugin-vue-components/resolvers';
|
|
8
|
+
|
|
9
|
+
interface Config {
|
|
10
|
+
/** {@link https://devtools-next.vuejs.org/ devtools-next} */
|
|
11
|
+
devtools: VitePluginVueDevToolsOptions;
|
|
12
|
+
/** {@link https://github.com/unplugin/unplugin-turbo-console unplugin-turbo-console} */
|
|
13
|
+
console: unplugin_turbo_console_types.Options;
|
|
14
|
+
/** {@link https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx @vitejs/plugin-vue-jsx} */
|
|
15
|
+
jsx: _vitejs_plugin_vue_jsx.Options | false;
|
|
16
|
+
/** {@link https://github.com/unplugin/unplugin-auto-import unplugin-auto-import} */
|
|
17
|
+
autoimport: unplugin_auto_import_types.Options | false;
|
|
18
|
+
/** {@link https://github.com/unplugin/unplugin-vue-components unplugin-vue-components} */
|
|
19
|
+
components: unplugin_vue_components_types.Options;
|
|
20
|
+
}
|
|
21
|
+
declare const _default: (config: Partial<Config>) => Plugin[];
|
|
22
|
+
|
|
23
|
+
export { type Config, _default as default };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import VueJsx from '@vitejs/plugin-vue-jsx';
|
|
2
|
+
import VueDevTools from 'vite-plugin-vue-devtools';
|
|
3
|
+
import TurboConsole from 'unplugin-turbo-console/vite';
|
|
4
|
+
import AutoImport from 'unplugin-auto-import/vite';
|
|
5
|
+
import Components from 'unplugin-vue-components/vite';
|
|
6
|
+
import { deepMerge } from '@antfu/utils';
|
|
7
|
+
export * from 'unplugin-vue-components/resolvers';
|
|
8
|
+
|
|
9
|
+
function applyPlugin(plugin, config, defaults, optional) {
|
|
10
|
+
if (config === false || optional && !config)
|
|
11
|
+
return [];
|
|
12
|
+
return plugin(defaults ? deepMerge(defaults, config || {}) : config);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const index = (config) => {
|
|
16
|
+
return [
|
|
17
|
+
VueDevTools(config.devtools),
|
|
18
|
+
TurboConsole(config.console),
|
|
19
|
+
applyPlugin(VueJsx, config.jsx, void 0, true),
|
|
20
|
+
applyPlugin(AutoImport, config.autoimport, void 0, true),
|
|
21
|
+
applyPlugin(Components, config.components, void 0, true)
|
|
22
|
+
].flatMap((e) => e);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { index as default };
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "vite-plugin-vue-dx",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.2",
|
|
5
|
+
"description": "Improves dx by using various vite plugins out of the box",
|
|
6
|
+
"author": "Fahadul Islam @dapotatoman",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"vite-plugin",
|
|
10
|
+
"vue",
|
|
11
|
+
"dx"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.mjs",
|
|
17
|
+
"require": "./dist/index.cjs"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"main": "./dist/index.cjs",
|
|
21
|
+
"module": "./dist/index.mjs",
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "unbuild",
|
|
28
|
+
"prepack": "pnpm unbuild",
|
|
29
|
+
"release": "changelogen --release && git push --follow-tags && npm publish",
|
|
30
|
+
"prerelease": "changelogen --prerelease --release && git push --follow-tags && npm publish --tag rc"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@antfu/utils": "^0.7.7",
|
|
34
|
+
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
|
35
|
+
"unplugin-auto-import": "^0.17.5",
|
|
36
|
+
"unplugin-icons": "^0.18.5",
|
|
37
|
+
"unplugin-turbo-console": "^1.4.0",
|
|
38
|
+
"unplugin-vue-components": "^0.26.0",
|
|
39
|
+
"vite": "^5.1.4",
|
|
40
|
+
"vite-plugin-vue-devtools": "^7.0.16"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@antfu/eslint-config": "^2.6.4",
|
|
44
|
+
"changelogen": "^0.5.5",
|
|
45
|
+
"eslint": "^8.57.0",
|
|
46
|
+
"type-fest": "^4.10.3",
|
|
47
|
+
"typescript": "^5.2.2",
|
|
48
|
+
"unbuild": "^2.0.0",
|
|
49
|
+
"vitest": "^1.3.1"
|
|
50
|
+
}
|
|
51
|
+
}
|