New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vite-plugin-stimulus-hmr

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-stimulus-hmr - npm Package Compare versions

Comparing version 1.0.2 to 3.0.0

dist/index.cjs

3

dist/index.d.ts

@@ -14,3 +14,2 @@ import { Plugin } from 'vite';

export default StimulusHMRPlugin;
export { Options };
export { Options, StimulusHMRPlugin as default };

@@ -1,9 +0,6 @@

"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// src/index.ts
var _stimulusvitehelpers = require('stimulus-vite-helpers');
var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
var debug = _debug2.default.call(void 0, "stimulus:hmr");
function isSSR(options) {
return typeof options === "object" ? options.ssr : options;
}
function StimulusHMRPlugin({appGlobal = "$$StimulusApp$$"} = {}) {
// src/index.ts
import { identifierForGlobKey } from "stimulus-vite-helpers";
import createDebugger from "debug";
var debug = createDebugger("stimulus:hmr");
function StimulusHMRPlugin({ appGlobal = "$$StimulusApp$$" } = {}) {
return {

@@ -13,3 +10,3 @@ name: "stimulus:hmr",

transform(code, id, options) {
if (isSSR(options) || id.includes("node_modules"))
if ((options == null ? void 0 : options.ssr) && !process.env.VITEST || id.includes("node_modules"))
return;

@@ -19,3 +16,3 @@ const appRegex = /\n[^\n]*?\s(\w+)(?:\s*=\s*Application\.start\(\))/;

if (appVariable) {
debug("application", {appVariable, id});
debug("application", { appVariable, id });
const exportFooter = `export const $$StimulusApp$$ = window.$$StimulusApp$$ = ${appVariable};`;

@@ -25,6 +22,6 @@ return `${code}

}
const controllerId = _stimulusvitehelpers.identifierForGlobKey.call(void 0, id);
const controllerId = identifierForGlobKey(id);
if (!controllerId)
return;
debug("controller", {name: controllerId, id});
debug("controller", { name: controllerId, id });
const metaHotFooter = `

@@ -47,4 +44,4 @@ if (import.meta.hot) {

}
exports.default = StimulusHMRPlugin;
export {
StimulusHMRPlugin as default
};
{
"name": "vite-plugin-stimulus-hmr",
"description": "HMR for Stimulus controllers in Vite.js, tweak your JS without refreshing the page.",
"version": "1.0.2",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"version": "3.0.0",
"files": [
"dist"
],
"sideEffects": false,
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.cjs",
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"license": "MIT",

@@ -26,15 +38,10 @@ "author": "Máximo Mussini <maximomussini@gmail.com>",

],
"files": [
"dist",
"default.vite.json"
],
"scripts": {
"lint": "eslint .",
"test": "jest",
"test": "vitest --config example/vite.config.ts",
"dev": "npm run build -- --watch",
"example:dev": "npm -C example run dev",
"example:build": "npm -C example run build",
"build": "tsup src/index.ts --dts --format cjs,esm",
"clean": "rm -rf ./dist",
"release": "nr clean && nr build && npm publish",
"build": "tsup src/index.ts --dts --format cjs,esm --clean",
"release": "nr build && npm publish",
"prepublishOnly": "npm run build",

@@ -44,18 +51,25 @@ "postpublish": "PACKAGE_VERSION=$(cat package.json | grep \\\"version\\\" | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') && git tag v$PACKAGE_VERSION && git push --tags"

"dependencies": {
"debug": "^4.3.1",
"stimulus-vite-helpers": "^1.0.4"
"debug": "^4.3",
"stimulus-vite-helpers": "^3.0.0"
},
"devDependencies": {
"@antfu/eslint-config": "^0.4.3",
"@types/debug": "^4.1.5",
"@types/minimatch": "^3.0.3",
"@types/node": "^14.14.20",
"@mussi/eslint-config": "^0.5",
"@types/debug": "^4.1",
"@types/node": "^14.14",
"@typescript-eslint/eslint-plugin": "^4.12.0",
"eslint": "^7.17.0",
"rollup": "^2.36.1",
"fast-glob": "^3.2.7",
"happy-dom": "^2.25.1",
"rollup": "^2.59",
"standard-version": "^9.1.0",
"tsup": "^3.11.0",
"typescript": "^4.1.3",
"vite": "^2.6.0"
"tsup": "^5",
"typescript": "^4.5",
"vite": "^2.7.0",
"vitest": "^0.0.132"
},
"eslintConfig": {
"extends": [
"@mussi/eslint-config"
]
}
}
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