Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vite-plugin-components

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-components - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

11

dist/index.js

@@ -5,2 +5,4 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// src/constants.ts

// src/generator/resolver.ts
var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
const debug2 = _debug2.default.call(void 0, "vite-plugin-components:resolver");
function isResolverPath(reqPath) {

@@ -13,2 +15,4 @@ return reqPath.endsWith(RESOLVER_EXT);

const components = ctx.components.filter((i) => names.includes(i[0]) && i[1] !== sfcPath);
debug2(`resolving ${sfcPath}`);
debug2(`components [${names.join(", ")}]`);
return `

@@ -26,2 +30,4 @@ ${components.map(([name, path3]) => `import ${name} from "${path3}"`).join("\n")}

var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);
const debug4 = _debug2.default.call(void 0, "vite-plugin-components:glob");
function toArray(arr) {

@@ -41,2 +47,3 @@ if (Array.isArray(arr))

const globs = toArray(dirs).map((i) => deep ? `${i}/**/*.${extsGlob}` : `${i}/*.${extsGlob}`);
debug4(`searching start with: [${globs.join(", ")}]`);
const files = await _fastglob2.default.call(void 0, globs, {

@@ -51,2 +58,4 @@ ignore: [

const components = files.map((f) => [_path2.default.parse(f).name, `/${f}`]);
debug4(`${components.length} components found.`);
debug4(`[${components.map((i) => i).join(", ")}]`);
ctx.components = components;

@@ -85,3 +94,3 @@ ctx._searchingPromise = void 0;

try {
await searchComponents(context, true);
await searchComponents(context);
ctx.body = await generateResolver(context, ctx.path);

@@ -88,0 +97,0 @@ ctx.type = "js";

4

package.json
{
"name": "vite-plugin-components",
"description": "Components auto importing for Vite",
"version": "0.2.1",
"version": "0.2.2",
"main": "dist/index.js",

@@ -26,2 +26,3 @@ "module": "dist/index.mjs",

"@antfu/eslint-config-ts": "^0.3.2",
"@types/debug": "^4.1.5",
"@typescript-eslint/eslint-plugin": "^3.9.1",

@@ -35,4 +36,5 @@ "eslint": "^7.7.0",

"dependencies": {
"debug": "^4.1.1",
"fast-glob": "^3.2.4"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc