code-inspector-plugin 0.13.0 → 0.14.0
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 +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +103 -96
- package/package.json +14 -5
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/code-inspector-plugin)
|
|
10
|
-
[](https://npmcharts.
|
|
10
|
+
[](https://npmcharts.netlify.app/compare/code-inspector-plugin?minimal=true)
|
|
11
11
|
[](https://opensource.org/licenses/MIT)
|
|
12
12
|
[](https://github.com/zh-lx/code-inspector)
|
|
13
13
|
[](https://github.com/zh-lx/code-inspector)
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var $=Object.defineProperty,
|
|
1
|
+
"use strict";var $=Object.defineProperty,j=Object.defineProperties;var V=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var y=(e,t,n)=>t in e?$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,E=(e,t)=>{for(var n in t||(t={}))T.call(t,n)&&y(e,n,t[n]);if(h)for(var n of h(t))k.call(t,n)&&y(e,n,t[n]);return e},_=(e,t)=>j(e,V(t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("vite-code-inspector-plugin"),C=require("webpack-code-inspector-plugin"),R=require("code-inspector-core"),S=require("chalk"),f=require("fs"),d=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 l={},L={get exports(){return l},set exports(e){l=e}};const K={},A=Object.freeze(Object.defineProperty({__proto__:null,default:K},Symbol.toStringTag,{value:"Module"})),b=x(A),Y="dotenv",F="16.3.1",U="Loads environment variables from .env file",M="lib/main.js",q="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"},W={"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"},G={type:"git",url:"git://github.com/motdotla/dotenv.git"},J="https://github.com/motdotla/dotenv?sponsor=1",Q=["dotenv","env",".env","environment","variables","config","settings"],z="README.md",H="BSD-2-Clause",X={"@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"},Z={node:">=12"},ee={fs:!1},te={name:Y,version:F,description:U,main:M,types:q,exports:B,scripts:W,repository:G,funding:J,keywords:Q,readmeFilename:z,license:H,devDependencies:X,engines:Z,browser:ee},w=f,g=d,ne=b,re=b,oe=te,m=oe.version,se=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function ce(e){const t={};let n=e.toString();n=n.replace(/\r\n?/mg,"\n");let o;for(;(o=se.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 ie(e){const t=I(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 a=o[c].trim(),u=ue(n,a);r=i.decrypt(u.ciphertext,u.key);break}catch(a){if(c+1>=s)throw a}return i.parse(r)}function ae(e){console.log("[dotenv@".concat(m,"][INFO] ").concat(e))}function le(e){console.log("[dotenv@".concat(m,"][WARN] ").concat(e))}function v(e){console.log("[dotenv@".concat(m,"][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 ue(e,t){let n;try{n=new URL(t)}catch(a){throw a.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"):a}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 I(e){let t=g.resolve(process.cwd(),".env");return e&&e.path&&e.path.length>0&&(t=e.path),t.endsWith(".vault")?t:"".concat(t,".vault")}function de(e){return e[0]==="~"?g.join(ne.homedir(),e.slice(1)):e}function pe(e){ae("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 fe(e){let t=g.resolve(process.cwd(),".env"),n="utf8";const o=!!(e&&e.debug);e&&(e.path!=null&&(t=de(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&&v("Failed to load ".concat(t," ").concat(s.message)),{error:s}}}function ve(e){const t=I(e);return D(e).length===0?i.configDotenv(e):w.existsSync(t)?i._configVault(e):(le("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 ge(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=re.createDecipheriv("aes-256-gcm",n,s);return c.setAuthTag(r),"".concat(c.update(o)).concat(c.final())}catch(c){const a=c instanceof RangeError,u=c.message==="Invalid key length",N=c.message==="Unsupported state or unable to authenticate data";if(a||u){const p="INVALID_DOTENV_KEY: It must be 64 characters long (or more)";throw new Error(p)}else if(N){const p="DECRYPTION_FAILED: Please check your DOTENV_KEY";throw new Error(p)}else throw console.error("Error: ",c.code),console.error("Error: ",c.message),c}}function me(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&&v(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:fe,_configVault:pe,_parseVault:ie,config:ve,decrypt:ge,parse:ce,populate:me};l.configDotenv=i.configDotenv;l._configVault=i._configVault;l._parseVault=i._parseVault;l.config=i.config;l.decrypt=i.decrypt;l.parse=i.parse;l.populate=i.populate;L.exports=i;function O(e){if(!(e!=null&&e.bundler)){console.log(S.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=d.resolve(process.cwd(),".env.local");if(f.existsSync(r)){const c=f.readFileSync(r,"utf-8"),a=l.parse(c||"");(a==null?void 0:a.CODE_INSPECTOR)==="true"&&(t=!1)}}let n="";typeof __dirname!="undefined"?n=__dirname:n=d.dirname(R.fileURLToPath(typeof document=="undefined"?require("url").pathToFileURL(__filename).href:document.currentScript&&document.currentScript.src||new URL("index.js",document.baseURI).href));const o=_(E({},e),{close:t,output:d.resolve(n,"./")});return e.bundler==="webpack"||e.bundler==="rspack"?new C(o):P.ViteCodeInspectorPlugin(o)}const he=O;exports.CodeInspectorPlugin=O;exports.codeInspectorPlugin=he;
|
package/dist/index.mjs
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
var I = Object.defineProperty,
|
|
2
|
-
var
|
|
1
|
+
var I = Object.defineProperty, V = Object.defineProperties;
|
|
2
|
+
var $ = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var h = Object.getOwnPropertySymbols;
|
|
4
4
|
var j = Object.prototype.hasOwnProperty, k = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var
|
|
5
|
+
var y = (e, t, n) => t in e ? I(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, E = (e, t) => {
|
|
6
6
|
for (var n in t || (t = {}))
|
|
7
|
-
j.call(t, n) &&
|
|
7
|
+
j.call(t, n) && y(e, n, t[n]);
|
|
8
8
|
if (h)
|
|
9
9
|
for (var n of h(t))
|
|
10
|
-
k.call(t, n) &&
|
|
10
|
+
k.call(t, n) && y(e, n, t[n]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
12
|
+
}, _ = (e, t) => V(e, $(t));
|
|
13
13
|
import { ViteCodeInspectorPlugin as T } from "vite-code-inspector-plugin";
|
|
14
14
|
import P from "webpack-code-inspector-plugin";
|
|
15
|
-
import x from "
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
|
|
15
|
+
import { fileURLToPath as x } from "code-inspector-core";
|
|
16
|
+
import C from "chalk";
|
|
17
|
+
import p from "fs";
|
|
18
|
+
import f, { dirname as R } from "path";
|
|
19
|
+
function K(e) {
|
|
19
20
|
if (e.__esModule)
|
|
20
21
|
return e;
|
|
21
22
|
var t = e.default;
|
|
@@ -42,18 +43,18 @@ function C(e) {
|
|
|
42
43
|
});
|
|
43
44
|
}), n;
|
|
44
45
|
}
|
|
45
|
-
var
|
|
46
|
+
var l = {}, A = {
|
|
46
47
|
get exports() {
|
|
47
|
-
return
|
|
48
|
+
return l;
|
|
48
49
|
},
|
|
49
50
|
set exports(e) {
|
|
50
|
-
|
|
51
|
+
l = e;
|
|
51
52
|
}
|
|
52
53
|
};
|
|
53
|
-
const
|
|
54
|
+
const L = {}, S = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
54
55
|
__proto__: null,
|
|
55
|
-
default:
|
|
56
|
-
}, Symbol.toStringTag, { value: "Module" })), b = /* @__PURE__ */
|
|
56
|
+
default: L
|
|
57
|
+
}, Symbol.toStringTag, { value: "Module" })), b = /* @__PURE__ */ K(S), Y = "dotenv", F = "16.3.1", B = "Loads environment variables from .env file", M = "lib/main.js", U = "lib/main.d.ts", W = {
|
|
57
58
|
".": {
|
|
58
59
|
types: "./lib/main.d.ts",
|
|
59
60
|
require: "./lib/main.js",
|
|
@@ -66,7 +67,7 @@ const R = {}, A = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePro
|
|
|
66
67
|
"./lib/cli-options": "./lib/cli-options.js",
|
|
67
68
|
"./lib/cli-options.js": "./lib/cli-options.js",
|
|
68
69
|
"./package.json": "./package.json"
|
|
69
|
-
},
|
|
70
|
+
}, q = {
|
|
70
71
|
"dts-check": "tsc --project tests/types/tsconfig.json",
|
|
71
72
|
lint: "standard",
|
|
72
73
|
"lint-readme": "standard-markdown",
|
|
@@ -74,10 +75,10 @@ const R = {}, A = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePro
|
|
|
74
75
|
test: "tap tests/*.js --100 -Rspec",
|
|
75
76
|
prerelease: "npm test",
|
|
76
77
|
release: "standard-version"
|
|
77
|
-
},
|
|
78
|
+
}, G = {
|
|
78
79
|
type: "git",
|
|
79
80
|
url: "git://github.com/motdotla/dotenv.git"
|
|
80
|
-
},
|
|
81
|
+
}, J = "https://github.com/motdotla/dotenv?sponsor=1", Q = [
|
|
81
82
|
"dotenv",
|
|
82
83
|
"env",
|
|
83
84
|
".env",
|
|
@@ -85,7 +86,7 @@ const R = {}, A = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePro
|
|
|
85
86
|
"variables",
|
|
86
87
|
"config",
|
|
87
88
|
"settings"
|
|
88
|
-
],
|
|
89
|
+
], z = "README.md", H = "BSD-2-Clause", X = {
|
|
89
90
|
"@definitelytyped/dtslint": "^0.0.133",
|
|
90
91
|
"@types/node": "^18.11.3",
|
|
91
92
|
decache: "^4.6.1",
|
|
@@ -96,33 +97,33 @@ const R = {}, A = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePro
|
|
|
96
97
|
tap: "^16.3.0",
|
|
97
98
|
tar: "^6.1.11",
|
|
98
99
|
typescript: "^4.8.4"
|
|
99
|
-
},
|
|
100
|
+
}, Z = {
|
|
100
101
|
node: ">=12"
|
|
101
|
-
},
|
|
102
|
+
}, ee = {
|
|
102
103
|
fs: !1
|
|
103
|
-
},
|
|
104
|
-
name:
|
|
105
|
-
version:
|
|
106
|
-
description:
|
|
107
|
-
main:
|
|
108
|
-
types:
|
|
109
|
-
exports:
|
|
110
|
-
scripts:
|
|
111
|
-
repository:
|
|
112
|
-
funding:
|
|
113
|
-
keywords:
|
|
114
|
-
readmeFilename:
|
|
115
|
-
license:
|
|
116
|
-
devDependencies:
|
|
117
|
-
engines:
|
|
118
|
-
browser:
|
|
119
|
-
}, w =
|
|
120
|
-
function
|
|
104
|
+
}, te = {
|
|
105
|
+
name: Y,
|
|
106
|
+
version: F,
|
|
107
|
+
description: B,
|
|
108
|
+
main: M,
|
|
109
|
+
types: U,
|
|
110
|
+
exports: W,
|
|
111
|
+
scripts: q,
|
|
112
|
+
repository: G,
|
|
113
|
+
funding: J,
|
|
114
|
+
keywords: Q,
|
|
115
|
+
readmeFilename: z,
|
|
116
|
+
license: H,
|
|
117
|
+
devDependencies: X,
|
|
118
|
+
engines: Z,
|
|
119
|
+
browser: ee
|
|
120
|
+
}, w = p, g = f, ne = b, re = b, oe = te, m = oe.version, se = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
121
|
+
function ce(e) {
|
|
121
122
|
const t = {};
|
|
122
123
|
let n = e.toString();
|
|
123
124
|
n = n.replace(/\r\n?/mg, "\n");
|
|
124
125
|
let o;
|
|
125
|
-
for (; (o =
|
|
126
|
+
for (; (o = se.exec(n)) != null; ) {
|
|
126
127
|
const s = o[1];
|
|
127
128
|
let r = o[2] || "";
|
|
128
129
|
r = r.trim();
|
|
@@ -131,7 +132,7 @@ function oe(e) {
|
|
|
131
132
|
}
|
|
132
133
|
return t;
|
|
133
134
|
}
|
|
134
|
-
function
|
|
135
|
+
function ie(e) {
|
|
135
136
|
const t = O(e), n = i.configDotenv({ path: t });
|
|
136
137
|
if (!n.parsed)
|
|
137
138
|
throw new Error("MISSING_DATA: Cannot parse ".concat(t, " for an unknown reason"));
|
|
@@ -139,33 +140,33 @@ function se(e) {
|
|
|
139
140
|
let r;
|
|
140
141
|
for (let c = 0; c < s; c++)
|
|
141
142
|
try {
|
|
142
|
-
const
|
|
143
|
+
const a = o[c].trim(), u = ue(n, a);
|
|
143
144
|
r = i.decrypt(u.ciphertext, u.key);
|
|
144
145
|
break;
|
|
145
|
-
} catch (
|
|
146
|
+
} catch (a) {
|
|
146
147
|
if (c + 1 >= s)
|
|
147
|
-
throw
|
|
148
|
+
throw a;
|
|
148
149
|
}
|
|
149
150
|
return i.parse(r);
|
|
150
151
|
}
|
|
151
|
-
function
|
|
152
|
-
console.log("[dotenv@".concat(
|
|
152
|
+
function ae(e) {
|
|
153
|
+
console.log("[dotenv@".concat(m, "][INFO] ").concat(e));
|
|
153
154
|
}
|
|
154
|
-
function
|
|
155
|
-
console.log("[dotenv@".concat(
|
|
155
|
+
function le(e) {
|
|
156
|
+
console.log("[dotenv@".concat(m, "][WARN] ").concat(e));
|
|
156
157
|
}
|
|
157
|
-
function
|
|
158
|
-
console.log("[dotenv@".concat(
|
|
158
|
+
function v(e) {
|
|
159
|
+
console.log("[dotenv@".concat(m, "][DEBUG] ").concat(e));
|
|
159
160
|
}
|
|
160
161
|
function D(e) {
|
|
161
162
|
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 : "";
|
|
162
163
|
}
|
|
163
|
-
function
|
|
164
|
+
function ue(e, t) {
|
|
164
165
|
let n;
|
|
165
166
|
try {
|
|
166
167
|
n = new URL(t);
|
|
167
|
-
} catch (
|
|
168
|
-
throw
|
|
168
|
+
} catch (a) {
|
|
169
|
+
throw a.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") : a;
|
|
169
170
|
}
|
|
170
171
|
const o = n.password;
|
|
171
172
|
if (!o)
|
|
@@ -179,45 +180,45 @@ function ae(e, t) {
|
|
|
179
180
|
return { ciphertext: c, key: o };
|
|
180
181
|
}
|
|
181
182
|
function O(e) {
|
|
182
|
-
let t =
|
|
183
|
+
let t = g.resolve(process.cwd(), ".env");
|
|
183
184
|
return e && e.path && e.path.length > 0 && (t = e.path), t.endsWith(".vault") ? t : "".concat(t, ".vault");
|
|
184
185
|
}
|
|
185
|
-
function
|
|
186
|
-
return e[0] === "~" ?
|
|
186
|
+
function de(e) {
|
|
187
|
+
return e[0] === "~" ? g.join(ne.homedir(), e.slice(1)) : e;
|
|
187
188
|
}
|
|
188
|
-
function
|
|
189
|
-
|
|
189
|
+
function pe(e) {
|
|
190
|
+
ae("Loading env from encrypted .env.vault");
|
|
190
191
|
const t = i._parseVault(e);
|
|
191
192
|
let n = process.env;
|
|
192
193
|
return e && e.processEnv != null && (n = e.processEnv), i.populate(n, t, e), { parsed: t };
|
|
193
194
|
}
|
|
194
|
-
function
|
|
195
|
-
let t =
|
|
195
|
+
function fe(e) {
|
|
196
|
+
let t = g.resolve(process.cwd(), ".env"), n = "utf8";
|
|
196
197
|
const o = !!(e && e.debug);
|
|
197
|
-
e && (e.path != null && (t =
|
|
198
|
+
e && (e.path != null && (t = de(e.path)), e.encoding != null && (n = e.encoding));
|
|
198
199
|
try {
|
|
199
200
|
const s = i.parse(w.readFileSync(t, { encoding: n }));
|
|
200
201
|
let r = process.env;
|
|
201
202
|
return e && e.processEnv != null && (r = e.processEnv), i.populate(r, s, e), { parsed: s };
|
|
202
203
|
} catch (s) {
|
|
203
|
-
return o &&
|
|
204
|
+
return o && v("Failed to load ".concat(t, " ").concat(s.message)), { error: s };
|
|
204
205
|
}
|
|
205
206
|
}
|
|
206
|
-
function
|
|
207
|
+
function ve(e) {
|
|
207
208
|
const t = O(e);
|
|
208
|
-
return D(e).length === 0 ? i.configDotenv(e) : w.existsSync(t) ? i._configVault(e) : (
|
|
209
|
+
return D(e).length === 0 ? i.configDotenv(e) : w.existsSync(t) ? i._configVault(e) : (le("You set DOTENV_KEY but you are missing a .env.vault file at ".concat(t, ". Did you forget to build it?")), i.configDotenv(e));
|
|
209
210
|
}
|
|
210
|
-
function
|
|
211
|
+
function ge(e, t) {
|
|
211
212
|
const n = Buffer.from(t.slice(-64), "hex");
|
|
212
213
|
let o = Buffer.from(e, "base64");
|
|
213
214
|
const s = o.slice(0, 12), r = o.slice(-16);
|
|
214
215
|
o = o.slice(12, -16);
|
|
215
216
|
try {
|
|
216
|
-
const c =
|
|
217
|
+
const c = re.createDecipheriv("aes-256-gcm", n, s);
|
|
217
218
|
return c.setAuthTag(r), "".concat(c.update(o)).concat(c.final());
|
|
218
219
|
} catch (c) {
|
|
219
|
-
const
|
|
220
|
-
if (
|
|
220
|
+
const a = c instanceof RangeError, u = c.message === "Invalid key length", N = c.message === "Unsupported state or unable to authenticate data";
|
|
221
|
+
if (a || u) {
|
|
221
222
|
const d = "INVALID_DOTENV_KEY: It must be 64 characters long (or more)";
|
|
222
223
|
throw new Error(d);
|
|
223
224
|
} else if (N) {
|
|
@@ -227,34 +228,34 @@ function fe(e, t) {
|
|
|
227
228
|
throw console.error("Error: ", c.code), console.error("Error: ", c.message), c;
|
|
228
229
|
}
|
|
229
230
|
}
|
|
230
|
-
function
|
|
231
|
+
function me(e, t, n = {}) {
|
|
231
232
|
const o = !!(n && n.debug), s = !!(n && n.override);
|
|
232
233
|
if (typeof t != "object")
|
|
233
234
|
throw new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
|
|
234
235
|
for (const r of Object.keys(t))
|
|
235
|
-
Object.prototype.hasOwnProperty.call(e, r) ? (s === !0 && (e[r] = t[r]), o &&
|
|
236
|
+
Object.prototype.hasOwnProperty.call(e, r) ? (s === !0 && (e[r] = t[r]), o && v(s === !0 ? '"'.concat(r, '" is already defined and WAS overwritten') : '"'.concat(r, '" is already defined and was NOT overwritten'))) : e[r] = t[r];
|
|
236
237
|
}
|
|
237
238
|
const i = {
|
|
238
|
-
configDotenv:
|
|
239
|
-
_configVault:
|
|
240
|
-
_parseVault:
|
|
241
|
-
config:
|
|
242
|
-
decrypt:
|
|
243
|
-
parse:
|
|
244
|
-
populate:
|
|
239
|
+
configDotenv: fe,
|
|
240
|
+
_configVault: pe,
|
|
241
|
+
_parseVault: ie,
|
|
242
|
+
config: ve,
|
|
243
|
+
decrypt: ge,
|
|
244
|
+
parse: ce,
|
|
245
|
+
populate: me
|
|
245
246
|
};
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
function
|
|
247
|
+
l.configDotenv = i.configDotenv;
|
|
248
|
+
l._configVault = i._configVault;
|
|
249
|
+
l._parseVault = i._parseVault;
|
|
250
|
+
l.config = i.config;
|
|
251
|
+
l.decrypt = i.decrypt;
|
|
252
|
+
l.parse = i.parse;
|
|
253
|
+
l.populate = i.populate;
|
|
254
|
+
A.exports = i;
|
|
255
|
+
function he(e) {
|
|
255
256
|
if (!(e != null && e.bundler)) {
|
|
256
257
|
console.log(
|
|
257
|
-
|
|
258
|
+
C.red(
|
|
258
259
|
"Please specify the bundler in the options of code-inspector-plugin."
|
|
259
260
|
)
|
|
260
261
|
);
|
|
@@ -265,16 +266,22 @@ function ge(e) {
|
|
|
265
266
|
if (t = !0, process.env.CODE_INSPECTOR === "true")
|
|
266
267
|
t = !1;
|
|
267
268
|
else {
|
|
268
|
-
const
|
|
269
|
-
if (
|
|
270
|
-
const
|
|
271
|
-
(
|
|
269
|
+
const r = f.resolve(process.cwd(), ".env.local");
|
|
270
|
+
if (p.existsSync(r)) {
|
|
271
|
+
const c = p.readFileSync(r, "utf-8"), a = l.parse(c || "");
|
|
272
|
+
(a == null ? void 0 : a.CODE_INSPECTOR) === "true" && (t = !1);
|
|
272
273
|
}
|
|
273
274
|
}
|
|
274
|
-
|
|
275
|
+
let n = "";
|
|
276
|
+
typeof __dirname != "undefined" ? n = __dirname : n = R(x(import.meta.url));
|
|
277
|
+
const o = _(E({}, e), {
|
|
278
|
+
close: t,
|
|
279
|
+
output: f.resolve(n, "./")
|
|
280
|
+
});
|
|
281
|
+
return e.bundler === "webpack" || e.bundler === "rspack" ? new P(o) : T(o);
|
|
275
282
|
}
|
|
276
|
-
const
|
|
283
|
+
const Ne = he;
|
|
277
284
|
export {
|
|
278
|
-
|
|
279
|
-
|
|
285
|
+
he as CodeInspectorPlugin,
|
|
286
|
+
Ne as codeInspectorPlugin
|
|
280
287
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "code-inspector-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"typings": "./types/index.d.ts",
|
|
@@ -21,6 +21,14 @@
|
|
|
21
21
|
"types": "./types/index.d.ts",
|
|
22
22
|
"default": "./dist/index.js"
|
|
23
23
|
}
|
|
24
|
+
},
|
|
25
|
+
"./dist/*": {
|
|
26
|
+
"import": {
|
|
27
|
+
"default": "./dist/*"
|
|
28
|
+
},
|
|
29
|
+
"require": {
|
|
30
|
+
"default": "./dist/*"
|
|
31
|
+
}
|
|
24
32
|
}
|
|
25
33
|
},
|
|
26
34
|
"homepage": "https://inspector.fe-dev.cn/en",
|
|
@@ -39,9 +47,9 @@
|
|
|
39
47
|
},
|
|
40
48
|
"dependencies": {
|
|
41
49
|
"chalk": "4.1.1",
|
|
42
|
-
"code-inspector-core": "0.
|
|
43
|
-
"vite-code-inspector-plugin": "0.
|
|
44
|
-
"webpack-code-inspector-plugin": "0.
|
|
50
|
+
"code-inspector-core": "0.14.0",
|
|
51
|
+
"vite-code-inspector-plugin": "0.14.0",
|
|
52
|
+
"webpack-code-inspector-plugin": "0.14.0"
|
|
45
53
|
},
|
|
46
54
|
"devDependencies": {
|
|
47
55
|
"@types/node": "^16.0.1",
|
|
@@ -50,7 +58,8 @@
|
|
|
50
58
|
"vite": "^4.1.0"
|
|
51
59
|
},
|
|
52
60
|
"scripts": {
|
|
53
|
-
"
|
|
61
|
+
"clear": "rimraf ./dist && rimraf ./types",
|
|
62
|
+
"build": "pnpm clear && tsc && vite build",
|
|
54
63
|
"pub": "pnpm publish",
|
|
55
64
|
"pub:beta": "pnpm publish --tag beta"
|
|
56
65
|
}
|