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

code-inspector-plugin

Package Overview
Dependencies
Maintainers
1
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.4.0 to 0.4.1-beta.1

2

./dist/index.js

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

"use strict";var $=Object.defineProperty,V=Object.defineProperties;var j=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var E=(e,t,n)=>t in e?$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,p=(e,t)=>{for(var n in t||(t={}))k.call(t,n)&&E(e,n,t[n]);if(h)for(var n of h(t))T.call(t,n)&&E(e,n,t[n]);return e},f=(e,t)=>V(e,j(t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("vite-code-inspector-plugin"),C=require("chalk"),v=require("fs"),_=require("path");function x(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function o(){if(this instanceof o){var s=[null];s.push.apply(s,arguments);var r=Function.bind.apply(t,s);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(o){var s=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,s.get?s:{enumerable:!0,get:function(){return e[o]}})}),n}var a={},S={get exports(){return a},set exports(e){a=e}};const K={},R=Object.freeze(Object.defineProperty({__proto__:null,default:K},Symbol.toStringTag,{value:"Module"})),b=x(R),A="dotenv",Y="16.3.1",L="Loads environment variables from .env file",F="lib/main.js",M="lib/main.d.ts",B={".":{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"},q={"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"},U={type:"git",url:"git://github.com/motdotla/dotenv.git"},W="https://github.com/motdotla/dotenv?sponsor=1",G=["dotenv","env",".env","environment","variables","config","settings"],J="README.md",Q="BSD-2-Clause",z={"@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"},H={node:">=12"},X={fs:!1},Z={name:A,version:Y,description:L,main:F,types:M,exports:B,scripts:q,repository:U,funding:W,keywords:G,readmeFilename:J,license:Q,devDependencies:z,engines:H,browser:X},w=v,m=_,ee=b,te=b,ne=Z,y=ne.version,re=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function oe(e){const t={};let n=e.toString();n=n.replace(/\r\n?/mg,"\n");let o;for(;(o=re.exec(n))!=null;){const s=o[1];let r=o[2]||"";r=r.trim();const c=r[0];r=r.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),c==='"'&&(r=r.replace(/\\n/g,"\n"),r=r.replace(/\\r/g,"\r")),t[s]=r}return t}function se(e){const t=O(e),n=i.configDotenv({path:t});if(!n.parsed)throw new Error("MISSING_DATA: Cannot parse ".concat(t," for an unknown reason"));const o=D(e).split(","),s=o.length;let r;for(let c=0;c<s;c++)try{const l=o[c].trim(),u=ae(n,l);r=i.decrypt(u.ciphertext,u.key);break}catch(l){if(c+1>=s)throw l}return i.parse(r)}function ce(e){console.log("[dotenv@".concat(y,"][INFO] ").concat(e))}function ie(e){console.log("[dotenv@".concat(y,"][WARN] ").concat(e))}function g(e){console.log("[dotenv@".concat(y,"][DEBUG] ").concat(e))}function D(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 ae(e,t){let n;try{n=new URL(t)}catch(l){throw l.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"):l}const o=n.password;if(!o)throw new Error("INVALID_DOTENV_KEY: Missing key part");const s=n.searchParams.get("environment");if(!s)throw new Error("INVALID_DOTENV_KEY: Missing environment part");const r="DOTENV_VAULT_".concat(s.toUpperCase()),c=e.parsed[r];if(!c)throw new Error("NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ".concat(r," in your .env.vault file."));return{ciphertext:c,key:o}}function O(e){let t=m.resolve(process.cwd(),".env");return e&&e.path&&e.path.length>0&&(t=e.path),t.endsWith(".vault")?t:"".concat(t,".vault")}function le(e){return e[0]==="~"?m.join(ee.homedir(),e.slice(1)):e}function ue(e){ce("Loading env from encrypted .env.vault");const t=i._parseVault(e);let n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),i.populate(n,t,e),{parsed:t}}function de(e){let t=m.resolve(process.cwd(),".env"),n="utf8";const o=!!(e&&e.debug);e&&(e.path!=null&&(t=le(e.path)),e.encoding!=null&&(n=e.encoding));try{const s=i.parse(w.readFileSync(t,{encoding:n}));let r=process.env;return e&&e.processEnv!=null&&(r=e.processEnv),i.populate(r,s,e),{parsed:s}}catch(s){return o&&g("Failed to load ".concat(t," ").concat(s.message)),{error:s}}}function pe(e){const t=O(e);return D(e).length===0?i.configDotenv(e):w.existsSync(t)?i._configVault(e):(ie("You set DOTENV_KEY but you are missing a .env.vault file at ".concat(t,". Did you forget to build it?")),i.configDotenv(e))}function fe(e,t){const n=Buffer.from(t.slice(-64),"hex");let o=Buffer.from(e,"base64");const s=o.slice(0,12),r=o.slice(-16);o=o.slice(12,-16);try{const c=te.createDecipheriv("aes-256-gcm",n,s);return c.setAuthTag(r),"".concat(c.update(o)).concat(c.final())}catch(c){const l=c instanceof RangeError,u=c.message==="Invalid key length",N=c.message==="Unsupported state or unable to authenticate data";if(l||u){const d="INVALID_DOTENV_KEY: It must be 64 characters long (or more)";throw new Error(d)}else if(N){const d="DECRYPTION_FAILED: Please check your DOTENV_KEY";throw new Error(d)}else throw console.error("Error: ",c.code),console.error("Error: ",c.message),c}}function ve(e,t,n={}){const o=!!(n&&n.debug),s=!!(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)?(s===!0&&(e[r]=t[r]),o&&g(s===!0?'"'.concat(r,'" is already defined and WAS overwritten'):'"'.concat(r,'" is already defined and was NOT overwritten'))):e[r]=t[r]}const i={configDotenv:de,_configVault:ue,_parseVault:se,config:pe,decrypt:fe,parse:oe,populate:ve};a.configDotenv=i.configDotenv;a._configVault=i._configVault;a._parseVault=i._parseVault;a.config=i.config;a.decrypt=i.decrypt;a.parse=i.parse;a.populate=i.populate;S.exports=i;function I(e){if(!(e!=null&&e.bundler)){console.log(C.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 o=_.resolve(process.cwd(),".env.local");if(v.existsSync(o)){const s=v.readFileSync(o,"utf-8"),r=a.parse(s||"");(r==null?void 0:r.CODE_INSPECTOR)==="true"&&(t=!1)}}if(e.bundler==="webpack"||e.bundler==="rspack"){const n=require("webpack-code-inspector-plugin");return new n(f(p({},e),{close:t}))}else return P.ViteCodeInspectorPlugin(f(p({},e),{close:t}))}const ge=I;exports.CodeInspectorPlugin=I;exports.codeInspectorPlugin=ge;
"use strict";var $=Object.defineProperty,V=Object.defineProperties;var j=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var E=(e,t,n)=>t in e?$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,p=(e,t)=>{for(var n in t||(t={}))k.call(t,n)&&E(e,n,t[n]);if(h)for(var n of h(t))T.call(t,n)&&E(e,n,t[n]);return e},f=(e,t)=>V(e,j(t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("vite-code-inspector-plugin"),C=require("webpack-code-inspector-plugin"),x=require("chalk"),v=require("fs"),_=require("path");function S(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function o(){if(this instanceof o){var s=[null];s.push.apply(s,arguments);var r=Function.bind.apply(t,s);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(o){var s=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,s.get?s:{enumerable:!0,get:function(){return e[o]}})}),n}var a={},K={get exports(){return a},set exports(e){a=e}};const R={},A=Object.freeze(Object.defineProperty({__proto__:null,default:R},Symbol.toStringTag,{value:"Module"})),b=S(A),Y="dotenv",L="16.3.1",F="Loads environment variables from .env file",M="lib/main.js",B="lib/main.d.ts",q={".":{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"},U={"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"},W={type:"git",url:"git://github.com/motdotla/dotenv.git"},G="https://github.com/motdotla/dotenv?sponsor=1",J=["dotenv","env",".env","environment","variables","config","settings"],Q="README.md",z="BSD-2-Clause",H={"@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"},X={node:">=12"},Z={fs:!1},ee={name:Y,version:L,description:F,main:M,types:B,exports:q,scripts:U,repository:W,funding:G,keywords:J,readmeFilename:Q,license:z,devDependencies:H,engines:X,browser:Z},w=v,m=_,te=b,ne=b,re=ee,y=re.version,oe=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function se(e){const t={};let n=e.toString();n=n.replace(/\r\n?/mg,"\n");let o;for(;(o=oe.exec(n))!=null;){const s=o[1];let r=o[2]||"";r=r.trim();const c=r[0];r=r.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),c==='"'&&(r=r.replace(/\\n/g,"\n"),r=r.replace(/\\r/g,"\r")),t[s]=r}return t}function ce(e){const t=O(e),n=i.configDotenv({path:t});if(!n.parsed)throw new Error("MISSING_DATA: Cannot parse ".concat(t," for an unknown reason"));const o=D(e).split(","),s=o.length;let r;for(let c=0;c<s;c++)try{const l=o[c].trim(),u=le(n,l);r=i.decrypt(u.ciphertext,u.key);break}catch(l){if(c+1>=s)throw l}return i.parse(r)}function ie(e){console.log("[dotenv@".concat(y,"][INFO] ").concat(e))}function ae(e){console.log("[dotenv@".concat(y,"][WARN] ").concat(e))}function g(e){console.log("[dotenv@".concat(y,"][DEBUG] ").concat(e))}function D(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 le(e,t){let n;try{n=new URL(t)}catch(l){throw l.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"):l}const o=n.password;if(!o)throw new Error("INVALID_DOTENV_KEY: Missing key part");const s=n.searchParams.get("environment");if(!s)throw new Error("INVALID_DOTENV_KEY: Missing environment part");const r="DOTENV_VAULT_".concat(s.toUpperCase()),c=e.parsed[r];if(!c)throw new Error("NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ".concat(r," in your .env.vault file."));return{ciphertext:c,key:o}}function O(e){let t=m.resolve(process.cwd(),".env");return e&&e.path&&e.path.length>0&&(t=e.path),t.endsWith(".vault")?t:"".concat(t,".vault")}function ue(e){return e[0]==="~"?m.join(te.homedir(),e.slice(1)):e}function de(e){ie("Loading env from encrypted .env.vault");const t=i._parseVault(e);let n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),i.populate(n,t,e),{parsed:t}}function pe(e){let t=m.resolve(process.cwd(),".env"),n="utf8";const o=!!(e&&e.debug);e&&(e.path!=null&&(t=ue(e.path)),e.encoding!=null&&(n=e.encoding));try{const s=i.parse(w.readFileSync(t,{encoding:n}));let r=process.env;return e&&e.processEnv!=null&&(r=e.processEnv),i.populate(r,s,e),{parsed:s}}catch(s){return o&&g("Failed to load ".concat(t," ").concat(s.message)),{error:s}}}function fe(e){const t=O(e);return D(e).length===0?i.configDotenv(e):w.existsSync(t)?i._configVault(e):(ae("You set DOTENV_KEY but you are missing a .env.vault file at ".concat(t,". Did you forget to build it?")),i.configDotenv(e))}function ve(e,t){const n=Buffer.from(t.slice(-64),"hex");let o=Buffer.from(e,"base64");const s=o.slice(0,12),r=o.slice(-16);o=o.slice(12,-16);try{const c=ne.createDecipheriv("aes-256-gcm",n,s);return c.setAuthTag(r),"".concat(c.update(o)).concat(c.final())}catch(c){const l=c instanceof RangeError,u=c.message==="Invalid key length",N=c.message==="Unsupported state or unable to authenticate data";if(l||u){const d="INVALID_DOTENV_KEY: It must be 64 characters long (or more)";throw new Error(d)}else if(N){const d="DECRYPTION_FAILED: Please check your DOTENV_KEY";throw new Error(d)}else throw console.error("Error: ",c.code),console.error("Error: ",c.message),c}}function ge(e,t,n={}){const o=!!(n&&n.debug),s=!!(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)?(s===!0&&(e[r]=t[r]),o&&g(s===!0?'"'.concat(r,'" is already defined and WAS overwritten'):'"'.concat(r,'" is already defined and was NOT overwritten'))):e[r]=t[r]}const i={configDotenv:pe,_configVault:de,_parseVault:ce,config:fe,decrypt:ve,parse:se,populate:ge};a.configDotenv=i.configDotenv;a._configVault=i._configVault;a._parseVault=i._parseVault;a.config=i.config;a.decrypt=i.decrypt;a.parse=i.parse;a.populate=i.populate;K.exports=i;function I(e){if(!(e!=null&&e.bundler)){console.log(x.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 o=_.resolve(process.cwd(),".env.local");if(v.existsSync(o)){const s=v.readFileSync(o,"utf-8"),r=a.parse(s||"");(r==null?void 0:r.CODE_INSPECTOR)==="true"&&(t=!1)}}return e.bundler==="webpack"||e.bundler==="rspack"?new C(f(p({},e),{close:t})):P.ViteCodeInspectorPlugin(f(p({},e),{close:t}))}const me=I;exports.CodeInspectorPlugin=I;exports.codeInspectorPlugin=me;

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

"use strict";var $=Object.defineProperty,V=Object.defineProperties;var j=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var E=(e,t,n)=>t in e?$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,p=(e,t)=>{for(var n in t||(t={}))k.call(t,n)&&E(e,n,t[n]);if(h)for(var n of h(t))T.call(t,n)&&E(e,n,t[n]);return e},f=(e,t)=>V(e,j(t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("vite-code-inspector-plugin"),C=require("chalk"),v=require("fs"),_=require("path");function x(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function o(){if(this instanceof o){var s=[null];s.push.apply(s,arguments);var r=Function.bind.apply(t,s);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(o){var s=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,s.get?s:{enumerable:!0,get:function(){return e[o]}})}),n}var a={},S={get exports(){return a},set exports(e){a=e}};const K={},R=Object.freeze(Object.defineProperty({__proto__:null,default:K},Symbol.toStringTag,{value:"Module"})),b=x(R),A="dotenv",Y="16.3.1",L="Loads environment variables from .env file",F="lib/main.js",M="lib/main.d.ts",B={".":{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"},q={"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"},U={type:"git",url:"git://github.com/motdotla/dotenv.git"},W="https://github.com/motdotla/dotenv?sponsor=1",G=["dotenv","env",".env","environment","variables","config","settings"],J="README.md",Q="BSD-2-Clause",z={"@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"},H={node:">=12"},X={fs:!1},Z={name:A,version:Y,description:L,main:F,types:M,exports:B,scripts:q,repository:U,funding:W,keywords:G,readmeFilename:J,license:Q,devDependencies:z,engines:H,browser:X},w=v,m=_,ee=b,te=b,ne=Z,y=ne.version,re=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function oe(e){const t={};let n=e.toString();n=n.replace(/\r\n?/mg,"\n");let o;for(;(o=re.exec(n))!=null;){const s=o[1];let r=o[2]||"";r=r.trim();const c=r[0];r=r.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),c==='"'&&(r=r.replace(/\\n/g,"\n"),r=r.replace(/\\r/g,"\r")),t[s]=r}return t}function se(e){const t=O(e),n=i.configDotenv({path:t});if(!n.parsed)throw new Error("MISSING_DATA: Cannot parse ".concat(t," for an unknown reason"));const o=D(e).split(","),s=o.length;let r;for(let c=0;c<s;c++)try{const l=o[c].trim(),u=ae(n,l);r=i.decrypt(u.ciphertext,u.key);break}catch(l){if(c+1>=s)throw l}return i.parse(r)}function ce(e){console.log("[dotenv@".concat(y,"][INFO] ").concat(e))}function ie(e){console.log("[dotenv@".concat(y,"][WARN] ").concat(e))}function g(e){console.log("[dotenv@".concat(y,"][DEBUG] ").concat(e))}function D(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 ae(e,t){let n;try{n=new URL(t)}catch(l){throw l.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"):l}const o=n.password;if(!o)throw new Error("INVALID_DOTENV_KEY: Missing key part");const s=n.searchParams.get("environment");if(!s)throw new Error("INVALID_DOTENV_KEY: Missing environment part");const r="DOTENV_VAULT_".concat(s.toUpperCase()),c=e.parsed[r];if(!c)throw new Error("NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ".concat(r," in your .env.vault file."));return{ciphertext:c,key:o}}function O(e){let t=m.resolve(process.cwd(),".env");return e&&e.path&&e.path.length>0&&(t=e.path),t.endsWith(".vault")?t:"".concat(t,".vault")}function le(e){return e[0]==="~"?m.join(ee.homedir(),e.slice(1)):e}function ue(e){ce("Loading env from encrypted .env.vault");const t=i._parseVault(e);let n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),i.populate(n,t,e),{parsed:t}}function de(e){let t=m.resolve(process.cwd(),".env"),n="utf8";const o=!!(e&&e.debug);e&&(e.path!=null&&(t=le(e.path)),e.encoding!=null&&(n=e.encoding));try{const s=i.parse(w.readFileSync(t,{encoding:n}));let r=process.env;return e&&e.processEnv!=null&&(r=e.processEnv),i.populate(r,s,e),{parsed:s}}catch(s){return o&&g("Failed to load ".concat(t," ").concat(s.message)),{error:s}}}function pe(e){const t=O(e);return D(e).length===0?i.configDotenv(e):w.existsSync(t)?i._configVault(e):(ie("You set DOTENV_KEY but you are missing a .env.vault file at ".concat(t,". Did you forget to build it?")),i.configDotenv(e))}function fe(e,t){const n=Buffer.from(t.slice(-64),"hex");let o=Buffer.from(e,"base64");const s=o.slice(0,12),r=o.slice(-16);o=o.slice(12,-16);try{const c=te.createDecipheriv("aes-256-gcm",n,s);return c.setAuthTag(r),"".concat(c.update(o)).concat(c.final())}catch(c){const l=c instanceof RangeError,u=c.message==="Invalid key length",N=c.message==="Unsupported state or unable to authenticate data";if(l||u){const d="INVALID_DOTENV_KEY: It must be 64 characters long (or more)";throw new Error(d)}else if(N){const d="DECRYPTION_FAILED: Please check your DOTENV_KEY";throw new Error(d)}else throw console.error("Error: ",c.code),console.error("Error: ",c.message),c}}function ve(e,t,n={}){const o=!!(n&&n.debug),s=!!(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)?(s===!0&&(e[r]=t[r]),o&&g(s===!0?'"'.concat(r,'" is already defined and WAS overwritten'):'"'.concat(r,'" is already defined and was NOT overwritten'))):e[r]=t[r]}const i={configDotenv:de,_configVault:ue,_parseVault:se,config:pe,decrypt:fe,parse:oe,populate:ve};a.configDotenv=i.configDotenv;a._configVault=i._configVault;a._parseVault=i._parseVault;a.config=i.config;a.decrypt=i.decrypt;a.parse=i.parse;a.populate=i.populate;S.exports=i;function I(e){if(!(e!=null&&e.bundler)){console.log(C.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 o=_.resolve(process.cwd(),".env.local");if(v.existsSync(o)){const s=v.readFileSync(o,"utf-8"),r=a.parse(s||"");(r==null?void 0:r.CODE_INSPECTOR)==="true"&&(t=!1)}}if(e.bundler==="webpack"||e.bundler==="rspack"){const n=require("webpack-code-inspector-plugin");return new n(f(p({},e),{close:t}))}else return P.ViteCodeInspectorPlugin(f(p({},e),{close:t}))}const ge=I;exports.CodeInspectorPlugin=I;exports.codeInspectorPlugin=ge;
"use strict";var $=Object.defineProperty,V=Object.defineProperties;var j=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var E=(e,t,n)=>t in e?$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,p=(e,t)=>{for(var n in t||(t={}))k.call(t,n)&&E(e,n,t[n]);if(h)for(var n of h(t))T.call(t,n)&&E(e,n,t[n]);return e},f=(e,t)=>V(e,j(t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("vite-code-inspector-plugin"),C=require("webpack-code-inspector-plugin"),x=require("chalk"),v=require("fs"),_=require("path");function S(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function o(){if(this instanceof o){var s=[null];s.push.apply(s,arguments);var r=Function.bind.apply(t,s);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(o){var s=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,s.get?s:{enumerable:!0,get:function(){return e[o]}})}),n}var a={},K={get exports(){return a},set exports(e){a=e}};const R={},A=Object.freeze(Object.defineProperty({__proto__:null,default:R},Symbol.toStringTag,{value:"Module"})),b=S(A),Y="dotenv",L="16.3.1",F="Loads environment variables from .env file",M="lib/main.js",B="lib/main.d.ts",q={".":{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"},U={"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"},W={type:"git",url:"git://github.com/motdotla/dotenv.git"},G="https://github.com/motdotla/dotenv?sponsor=1",J=["dotenv","env",".env","environment","variables","config","settings"],Q="README.md",z="BSD-2-Clause",H={"@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"},X={node:">=12"},Z={fs:!1},ee={name:Y,version:L,description:F,main:M,types:B,exports:q,scripts:U,repository:W,funding:G,keywords:J,readmeFilename:Q,license:z,devDependencies:H,engines:X,browser:Z},w=v,m=_,te=b,ne=b,re=ee,y=re.version,oe=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function se(e){const t={};let n=e.toString();n=n.replace(/\r\n?/mg,"\n");let o;for(;(o=oe.exec(n))!=null;){const s=o[1];let r=o[2]||"";r=r.trim();const c=r[0];r=r.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),c==='"'&&(r=r.replace(/\\n/g,"\n"),r=r.replace(/\\r/g,"\r")),t[s]=r}return t}function ce(e){const t=O(e),n=i.configDotenv({path:t});if(!n.parsed)throw new Error("MISSING_DATA: Cannot parse ".concat(t," for an unknown reason"));const o=D(e).split(","),s=o.length;let r;for(let c=0;c<s;c++)try{const l=o[c].trim(),u=le(n,l);r=i.decrypt(u.ciphertext,u.key);break}catch(l){if(c+1>=s)throw l}return i.parse(r)}function ie(e){console.log("[dotenv@".concat(y,"][INFO] ").concat(e))}function ae(e){console.log("[dotenv@".concat(y,"][WARN] ").concat(e))}function g(e){console.log("[dotenv@".concat(y,"][DEBUG] ").concat(e))}function D(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 le(e,t){let n;try{n=new URL(t)}catch(l){throw l.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"):l}const o=n.password;if(!o)throw new Error("INVALID_DOTENV_KEY: Missing key part");const s=n.searchParams.get("environment");if(!s)throw new Error("INVALID_DOTENV_KEY: Missing environment part");const r="DOTENV_VAULT_".concat(s.toUpperCase()),c=e.parsed[r];if(!c)throw new Error("NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ".concat(r," in your .env.vault file."));return{ciphertext:c,key:o}}function O(e){let t=m.resolve(process.cwd(),".env");return e&&e.path&&e.path.length>0&&(t=e.path),t.endsWith(".vault")?t:"".concat(t,".vault")}function ue(e){return e[0]==="~"?m.join(te.homedir(),e.slice(1)):e}function de(e){ie("Loading env from encrypted .env.vault");const t=i._parseVault(e);let n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),i.populate(n,t,e),{parsed:t}}function pe(e){let t=m.resolve(process.cwd(),".env"),n="utf8";const o=!!(e&&e.debug);e&&(e.path!=null&&(t=ue(e.path)),e.encoding!=null&&(n=e.encoding));try{const s=i.parse(w.readFileSync(t,{encoding:n}));let r=process.env;return e&&e.processEnv!=null&&(r=e.processEnv),i.populate(r,s,e),{parsed:s}}catch(s){return o&&g("Failed to load ".concat(t," ").concat(s.message)),{error:s}}}function fe(e){const t=O(e);return D(e).length===0?i.configDotenv(e):w.existsSync(t)?i._configVault(e):(ae("You set DOTENV_KEY but you are missing a .env.vault file at ".concat(t,". Did you forget to build it?")),i.configDotenv(e))}function ve(e,t){const n=Buffer.from(t.slice(-64),"hex");let o=Buffer.from(e,"base64");const s=o.slice(0,12),r=o.slice(-16);o=o.slice(12,-16);try{const c=ne.createDecipheriv("aes-256-gcm",n,s);return c.setAuthTag(r),"".concat(c.update(o)).concat(c.final())}catch(c){const l=c instanceof RangeError,u=c.message==="Invalid key length",N=c.message==="Unsupported state or unable to authenticate data";if(l||u){const d="INVALID_DOTENV_KEY: It must be 64 characters long (or more)";throw new Error(d)}else if(N){const d="DECRYPTION_FAILED: Please check your DOTENV_KEY";throw new Error(d)}else throw console.error("Error: ",c.code),console.error("Error: ",c.message),c}}function ge(e,t,n={}){const o=!!(n&&n.debug),s=!!(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)?(s===!0&&(e[r]=t[r]),o&&g(s===!0?'"'.concat(r,'" is already defined and WAS overwritten'):'"'.concat(r,'" is already defined and was NOT overwritten'))):e[r]=t[r]}const i={configDotenv:pe,_configVault:de,_parseVault:ce,config:fe,decrypt:ve,parse:se,populate:ge};a.configDotenv=i.configDotenv;a._configVault=i._configVault;a._parseVault=i._parseVault;a.config=i.config;a.decrypt=i.decrypt;a.parse=i.parse;a.populate=i.populate;K.exports=i;function I(e){if(!(e!=null&&e.bundler)){console.log(x.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 o=_.resolve(process.cwd(),".env.local");if(v.existsSync(o)){const s=v.readFileSync(o,"utf-8"),r=a.parse(s||"");(r==null?void 0:r.CODE_INSPECTOR)==="true"&&(t=!1)}}return e.bundler==="webpack"||e.bundler==="rspack"?new C(f(p({},e),{close:t})):P.ViteCodeInspectorPlugin(f(p({},e),{close:t}))}const me=I;exports.CodeInspectorPlugin=I;exports.codeInspectorPlugin=me;
{
"name": "code-inspector-plugin",
"version": "0.4.0",
"version": "0.4.1-beta.1",
"main": "./dist/index.js",

@@ -42,5 +42,5 @@ "module": "./dist/index.mjs",

"chalk": "4.1.1",
"code-inspector-core": "0.4.0",
"webpack-code-inspector-plugin": "0.4.0",
"vite-code-inspector-plugin": "0.4.0"
"code-inspector-core": "0.4.1-beta.1",
"vite-code-inspector-plugin": "0.4.1-beta.1",
"webpack-code-inspector-plugin": "0.4.1-beta.1"
},

@@ -47,0 +47,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