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

code-inspector-plugin

Package Overview
Dependencies
Maintainers
0
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

code-inspector-plugin - npm Package Compare versions

Comparing version 0.17.4 to 0.17.5-beta.1

2

dist/index.js

@@ -1,1 +0,1 @@

"use strict";var P=Object.defineProperty,k=Object.defineProperties;var C=Object.getOwnPropertyDescriptors;var _=Object.getOwnPropertySymbols;var x=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var b=(e,t,n)=>t in e?P(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,w=(e,t)=>{for(var n in t||(t={}))x.call(t,n)&&b(e,n,t[n]);if(_)for(var n of _(t))R.call(t,n)&&b(e,n,t[n]);return e},D=(e,t)=>k(e,C(t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("vite-code-inspector-plugin"),L=require("webpack-code-inspector-plugin"),f=require("code-inspector-core"),g=require("fs"),v=require("path"),F=require("chalk");var K=(e,t,n)=>new Promise((s,c)=>{var r=a=>{try{i(n.next(a))}catch(u){c(u)}},o=a=>{try{i(n.throw(a))}catch(u){c(u)}},i=a=>a.done?s(a.value):Promise.resolve(a.value).then(r,o);i((n=n.apply(e,t)).next())});const A="esbuild-code-inspector-plugin";function Y(e){return{name:A,setup(t){if(e.close||!f.isDev(e.dev,!1))return;const n={port:0,entry:"",output:e.output},{escapeTags:s=[]}=e,c=new Map;t.onLoad({filter:e.match||/\.(jsx|tsx|js|ts|mjs|mts)?$/},r=>K(this,null,function*(){const o=r.path;let i=yield g.promises.readFile(o,"utf8"),a=c.get(o);if(!a||a.originCode!==i){let u=yield f.getCodeWithWebComponent(e,o,i,n),d="";if(f.isJsTypeFile(o)?d="jsx":o.endsWith(".svelte")&&(d="svelte"),d)u=f.transformCode({content:u,filePath:o,fileType:d,escapeTags:s});else if(o.endsWith(".vue")){d="vue";const{descriptor:E}=f.parseSFC(u,{sourceMap:!1}),V=f.transformCode({content:E.template.content,filePath:o,fileType:d,escapeTags:s});u=u.replace(E.template.content,V)}const $=v.extname(o).replace(".","");a={originCode:i,output:{contents:u,loader:$}},c.set(o,a)}return a.output}))}}}function M(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function s(){if(this instanceof s){var c=[null];c.push.apply(c,arguments);var r=Function.bind.apply(t,c);return new r}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(s){var c=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(n,s,c.get?c:{enumerable:!0,get:function(){return e[s]}})}),n}var p={},U={get exports(){return p},set exports(e){p=e}};const q={},B=Object.freeze(Object.defineProperty({__proto__:null,default:q},Symbol.toStringTag,{value:"Module"})),I=M(B),W="dotenv",J="16.3.1",G="Loads environment variables from .env file",Q="lib/main.js",z="lib/main.d.ts",H={".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},X={"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},Z={type:"git",url:"git://github.com/motdotla/dotenv.git"},ee="https://github.com/motdotla/dotenv?sponsor=1",te=["dotenv","env",".env","environment","variables","config","settings"],ne="README.md",re="BSD-2-Clause",oe={"@definitelytyped/dtslint":"^0.0.133","@types/node":"^18.11.3",decache:"^4.6.1",sinon:"^14.0.1",standard:"^17.0.0","standard-markdown":"^7.1.0","standard-version":"^9.5.0",tap:"^16.3.0",tar:"^6.1.11",typescript:"^4.8.4"},se={node:">=12"},ce={fs:!1},ie={name:W,version:J,description:G,main:Q,types:z,exports:H,scripts:X,repository:Z,funding:ee,keywords:te,readmeFilename:ne,license:re,devDependencies:oe,engines:se,browser:ce},O=g,h=v,ae=I,le=I,ue=ie,y=ue.version,de=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function pe(e){const t={};let n=e.toString();n=n.replace(/\r\n?/mg,"\n");let s;for(;(s=de.exec(n))!=null;){const c=s[1];let r=s[2]||"";r=r.trim();const o=r[0];r=r.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),o==='"'&&(r=r.replace(/\\n/g,"\n"),r=r.replace(/\\r/g,"\r")),t[c]=r}return t}function fe(e){const t=j(e),n=l.configDotenv({path:t});if(!n.parsed)throw new Error("MISSING_DATA: Cannot parse ".concat(t," for an unknown reason"));const s=T(e).split(","),c=s.length;let r;for(let o=0;o<c;o++)try{const i=s[o].trim(),a=me(n,i);r=l.decrypt(a.ciphertext,a.key);break}catch(i){if(o+1>=c)throw i}return l.parse(r)}function ve(e){console.log("[dotenv@".concat(y,"][INFO] ").concat(e))}function ge(e){console.log("[dotenv@".concat(y,"][WARN] ").concat(e))}function m(e){console.log("[dotenv@".concat(y,"][DEBUG] ").concat(e))}function T(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function me(e,t){let n;try{n=new URL(t)}catch(i){throw i.code==="ERR_INVALID_URL"?new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development"):i}const s=n.password;if(!s)throw new Error("INVALID_DOTENV_KEY: Missing key part");const c=n.searchParams.get("environment");if(!c)throw new Error("INVALID_DOTENV_KEY: Missing environment part");const r="DOTENV_VAULT_".concat(c.toUpperCase()),o=e.parsed[r];if(!o)throw new Error("NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ".concat(r," in your .env.vault file."));return{ciphertext:o,key:s}}function j(e){let t=h.resolve(process.cwd(),".env");return e&&e.path&&e.path.length>0&&(t=e.path),t.endsWith(".vault")?t:"".concat(t,".vault")}function he(e){return e[0]==="~"?h.join(ae.homedir(),e.slice(1)):e}function ye(e){ve("Loading env from encrypted .env.vault");const t=l._parseVault(e);let n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),l.populate(n,t,e),{parsed:t}}function Ee(e){let t=h.resolve(process.cwd(),".env"),n="utf8";const s=!!(e&&e.debug);e&&(e.path!=null&&(t=he(e.path)),e.encoding!=null&&(n=e.encoding));try{const c=l.parse(O.readFileSync(t,{encoding:n}));let r=process.env;return e&&e.processEnv!=null&&(r=e.processEnv),l.populate(r,c,e),{parsed:c}}catch(c){return s&&m("Failed to load ".concat(t," ").concat(c.message)),{error:c}}}function _e(e){const t=j(e);return T(e).length===0?l.configDotenv(e):O.existsSync(t)?l._configVault(e):(ge("You set DOTENV_KEY but you are missing a .env.vault file at ".concat(t,". Did you forget to build it?")),l.configDotenv(e))}function be(e,t){const n=Buffer.from(t.slice(-64),"hex");let s=Buffer.from(e,"base64");const c=s.slice(0,12),r=s.slice(-16);s=s.slice(12,-16);try{const o=le.createDecipheriv("aes-256-gcm",n,c);return o.setAuthTag(r),"".concat(o.update(s)).concat(o.final())}catch(o){const i=o instanceof RangeError,a=o.message==="Invalid key length",u=o.message==="Unsupported state or unable to authenticate data";if(i||a){const d="INVALID_DOTENV_KEY: It must be 64 characters long (or more)";throw new Error(d)}else if(u){const d="DECRYPTION_FAILED: Please check your DOTENV_KEY";throw new Error(d)}else throw console.error("Error: ",o.code),console.error("Error: ",o.message),o}}function we(e,t,n={}){const s=!!(n&&n.debug),c=!!(n&&n.override);if(typeof t!="object")throw new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");for(const r of Object.keys(t))Object.prototype.hasOwnProperty.call(e,r)?(c===!0&&(e[r]=t[r]),s&&m(c===!0?'"'.concat(r,'" is already defined and WAS overwritten'):'"'.concat(r,'" is already defined and was NOT overwritten'))):e[r]=t[r]}const l={configDotenv:Ee,_configVault:ye,_parseVault:fe,config:_e,decrypt:be,parse:pe,populate:we};p.configDotenv=l.configDotenv;p._configVault=l._configVault;p._parseVault=l._parseVault;p.config=l.config;p.decrypt=l.decrypt;p.parse=l.parse;p.populate=l.populate;U.exports=l;function N(e){if(!(e!=null&&e.bundler)){console.log(F.red("Please specify the bundler in the options of code-inspector-plugin."));return}let t=!1;if(e.needEnvInspector)if(t=!0,process.env.CODE_INSPECTOR==="true")t=!1;else{const r=v.resolve(process.cwd(),".env.local");if(g.existsSync(r)){const o=g.readFileSync(r,"utf-8"),i=p.parse(o||"");(i==null?void 0:i.CODE_INSPECTOR)==="true"&&(t=!1)}}let n="";typeof __dirname!="undefined"?n=__dirname:n=v.dirname(f.fileURLToPath(typeof document=="undefined"?require("url").pathToFileURL(__filename).href:document.currentScript&&document.currentScript.src||new URL("index.js",document.baseURI).href));const s=D(w({},e),{close:t,output:v.resolve(n,"./")});return e.bundler==="webpack"||e.bundler==="rspack"?new L(s):e.bundler==="esbuild"?Y(s):S.ViteCodeInspectorPlugin(s)}const De=N;exports.CodeInspectorPlugin=N;exports.codeInspectorPlugin=De;
"use strict";var P=Object.defineProperty,k=Object.defineProperties;var C=Object.getOwnPropertyDescriptors;var _=Object.getOwnPropertySymbols;var x=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var b=(e,t,n)=>t in e?P(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,w=(e,t)=>{for(var n in t||(t={}))x.call(t,n)&&b(e,n,t[n]);if(_)for(var n of _(t))R.call(t,n)&&b(e,n,t[n]);return e},D=(e,t)=>k(e,C(t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("vite-code-inspector-plugin"),L=require("webpack-code-inspector-plugin"),f=require("code-inspector-core"),g=require("fs"),v=require("path"),F=require("chalk");var K=(e,t,n)=>new Promise((s,c)=>{var r=a=>{try{i(n.next(a))}catch(u){c(u)}},o=a=>{try{i(n.throw(a))}catch(u){c(u)}},i=a=>a.done?s(a.value):Promise.resolve(a.value).then(r,o);i((n=n.apply(e,t)).next())});const A="esbuild-code-inspector-plugin";function Y(e){return{name:A,setup(t){if(e.close||!f.isDev(e.dev,!1))return;const n={port:0,entry:"",output:e.output},{escapeTags:s=[]}=e,c=new Map;t.onLoad({filter:e.match||/\.(jsx|tsx|js|ts|mjs|mts)?$/},r=>K(this,null,function*(){const o=r.path;let i=yield g.promises.readFile(o,"utf8"),a=c.get(o);if(!a||a.originCode!==i){let u=yield f.getCodeWithWebComponent({options:e,file:o,code:i,record:n}),d="";if(f.isJsTypeFile(o)?d="jsx":o.endsWith(".svelte")&&(d="svelte"),d)u=f.transformCode({content:u,filePath:o,fileType:d,escapeTags:s});else if(o.endsWith(".vue")){d="vue";const{descriptor:E}=f.parseSFC(u,{sourceMap:!1}),V=f.transformCode({content:E.template.content,filePath:o,fileType:d,escapeTags:s});u=u.replace(E.template.content,V)}const $=v.extname(o).replace(".","");a={originCode:i,output:{contents:u,loader:$}},c.set(o,a)}return a.output}))}}}function M(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function s(){if(this instanceof s){var c=[null];c.push.apply(c,arguments);var r=Function.bind.apply(t,c);return new r}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(s){var c=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(n,s,c.get?c:{enumerable:!0,get:function(){return e[s]}})}),n}var p={},U={get exports(){return p},set exports(e){p=e}};const q={},B=Object.freeze(Object.defineProperty({__proto__:null,default:q},Symbol.toStringTag,{value:"Module"})),I=M(B),W="dotenv",J="16.3.1",G="Loads environment variables from .env file",Q="lib/main.js",z="lib/main.d.ts",H={".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},X={"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},Z={type:"git",url:"git://github.com/motdotla/dotenv.git"},ee="https://github.com/motdotla/dotenv?sponsor=1",te=["dotenv","env",".env","environment","variables","config","settings"],ne="README.md",re="BSD-2-Clause",oe={"@definitelytyped/dtslint":"^0.0.133","@types/node":"^18.11.3",decache:"^4.6.1",sinon:"^14.0.1",standard:"^17.0.0","standard-markdown":"^7.1.0","standard-version":"^9.5.0",tap:"^16.3.0",tar:"^6.1.11",typescript:"^4.8.4"},se={node:">=12"},ce={fs:!1},ie={name:W,version:J,description:G,main:Q,types:z,exports:H,scripts:X,repository:Z,funding:ee,keywords:te,readmeFilename:ne,license:re,devDependencies:oe,engines:se,browser:ce},O=g,h=v,ae=I,le=I,ue=ie,y=ue.version,de=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function pe(e){const t={};let n=e.toString();n=n.replace(/\r\n?/mg,"\n");let s;for(;(s=de.exec(n))!=null;){const c=s[1];let r=s[2]||"";r=r.trim();const o=r[0];r=r.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),o==='"'&&(r=r.replace(/\\n/g,"\n"),r=r.replace(/\\r/g,"\r")),t[c]=r}return t}function fe(e){const t=j(e),n=l.configDotenv({path:t});if(!n.parsed)throw new Error("MISSING_DATA: Cannot parse ".concat(t," for an unknown reason"));const s=T(e).split(","),c=s.length;let r;for(let o=0;o<c;o++)try{const i=s[o].trim(),a=me(n,i);r=l.decrypt(a.ciphertext,a.key);break}catch(i){if(o+1>=c)throw i}return l.parse(r)}function ve(e){console.log("[dotenv@".concat(y,"][INFO] ").concat(e))}function ge(e){console.log("[dotenv@".concat(y,"][WARN] ").concat(e))}function m(e){console.log("[dotenv@".concat(y,"][DEBUG] ").concat(e))}function T(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function me(e,t){let n;try{n=new URL(t)}catch(i){throw i.code==="ERR_INVALID_URL"?new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development"):i}const s=n.password;if(!s)throw new Error("INVALID_DOTENV_KEY: Missing key part");const c=n.searchParams.get("environment");if(!c)throw new Error("INVALID_DOTENV_KEY: Missing environment part");const r="DOTENV_VAULT_".concat(c.toUpperCase()),o=e.parsed[r];if(!o)throw new Error("NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ".concat(r," in your .env.vault file."));return{ciphertext:o,key:s}}function j(e){let t=h.resolve(process.cwd(),".env");return e&&e.path&&e.path.length>0&&(t=e.path),t.endsWith(".vault")?t:"".concat(t,".vault")}function he(e){return e[0]==="~"?h.join(ae.homedir(),e.slice(1)):e}function ye(e){ve("Loading env from encrypted .env.vault");const t=l._parseVault(e);let n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),l.populate(n,t,e),{parsed:t}}function Ee(e){let t=h.resolve(process.cwd(),".env"),n="utf8";const s=!!(e&&e.debug);e&&(e.path!=null&&(t=he(e.path)),e.encoding!=null&&(n=e.encoding));try{const c=l.parse(O.readFileSync(t,{encoding:n}));let r=process.env;return e&&e.processEnv!=null&&(r=e.processEnv),l.populate(r,c,e),{parsed:c}}catch(c){return s&&m("Failed to load ".concat(t," ").concat(c.message)),{error:c}}}function _e(e){const t=j(e);return T(e).length===0?l.configDotenv(e):O.existsSync(t)?l._configVault(e):(ge("You set DOTENV_KEY but you are missing a .env.vault file at ".concat(t,". Did you forget to build it?")),l.configDotenv(e))}function be(e,t){const n=Buffer.from(t.slice(-64),"hex");let s=Buffer.from(e,"base64");const c=s.slice(0,12),r=s.slice(-16);s=s.slice(12,-16);try{const o=le.createDecipheriv("aes-256-gcm",n,c);return o.setAuthTag(r),"".concat(o.update(s)).concat(o.final())}catch(o){const i=o instanceof RangeError,a=o.message==="Invalid key length",u=o.message==="Unsupported state or unable to authenticate data";if(i||a){const d="INVALID_DOTENV_KEY: It must be 64 characters long (or more)";throw new Error(d)}else if(u){const d="DECRYPTION_FAILED: Please check your DOTENV_KEY";throw new Error(d)}else throw console.error("Error: ",o.code),console.error("Error: ",o.message),o}}function we(e,t,n={}){const s=!!(n&&n.debug),c=!!(n&&n.override);if(typeof t!="object")throw new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");for(const r of Object.keys(t))Object.prototype.hasOwnProperty.call(e,r)?(c===!0&&(e[r]=t[r]),s&&m(c===!0?'"'.concat(r,'" is already defined and WAS overwritten'):'"'.concat(r,'" is already defined and was NOT overwritten'))):e[r]=t[r]}const l={configDotenv:Ee,_configVault:ye,_parseVault:fe,config:_e,decrypt:be,parse:pe,populate:we};p.configDotenv=l.configDotenv;p._configVault=l._configVault;p._parseVault=l._parseVault;p.config=l.config;p.decrypt=l.decrypt;p.parse=l.parse;p.populate=l.populate;U.exports=l;function N(e){if(!(e!=null&&e.bundler)){console.log(F.red("Please specify the bundler in the options of code-inspector-plugin."));return}let t=!1;if(e.needEnvInspector)if(t=!0,process.env.CODE_INSPECTOR==="true")t=!1;else{const r=v.resolve(process.cwd(),".env.local");if(g.existsSync(r)){const o=g.readFileSync(r,"utf-8"),i=p.parse(o||"");(i==null?void 0:i.CODE_INSPECTOR)==="true"&&(t=!1)}}let n="";typeof __dirname!="undefined"?n=__dirname:n=v.dirname(f.fileURLToPath(typeof document=="undefined"?require("url").pathToFileURL(__filename).href:document.currentScript&&document.currentScript.src||new URL("index.js",document.baseURI).href));const s=D(w({},e),{close:t,output:v.resolve(n,"./")});return e.bundler==="webpack"||e.bundler==="rspack"?new L(s):e.bundler==="esbuild"?Y(s):S.ViteCodeInspectorPlugin(s)}const De=N;exports.CodeInspectorPlugin=N;exports.codeInspectorPlugin=De;
{
"name": "code-inspector-plugin",
"version": "0.17.4",
"version": "0.17.5-beta.1",
"main": "./dist/index.js",

@@ -50,6 +50,6 @@ "module": "./dist/index.mjs",

"chalk": "4.1.1",
"code-inspector-core": "0.17.4",
"vite-code-inspector-plugin": "0.17.4",
"webpack-code-inspector-plugin": "0.17.4",
"esbuild-code-inspector-plugin": "0.17.4"
"code-inspector-core": "0.17.5-beta.1",
"vite-code-inspector-plugin": "0.17.5-beta.1",
"webpack-code-inspector-plugin": "0.17.5-beta.1",
"esbuild-code-inspector-plugin": "0.17.5-beta.1"
},

@@ -56,0 +56,0 @@ "devDependencies": {

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