unpeek 4.2.0 → 4.3.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.
Files changed (34) hide show
  1. package/README.md +2 -2
  2. package/README.tr.md +2 -2
  3. package/dist/adapters/esbuild.cjs +5 -5
  4. package/dist/adapters/esbuild.js +3 -3
  5. package/dist/adapters/next/adapter.cjs +5 -5
  6. package/dist/adapters/next/adapter.js +4 -4
  7. package/dist/adapters/next/index.cjs +5 -5
  8. package/dist/adapters/next/index.js +4 -4
  9. package/dist/adapters/rollup.cjs +5 -5
  10. package/dist/adapters/rollup.js +3 -3
  11. package/dist/adapters/rspack.cjs +5 -5
  12. package/dist/adapters/rspack.js +3 -3
  13. package/dist/adapters/vite.cjs +5 -5
  14. package/dist/adapters/vite.js +3 -3
  15. package/dist/adapters/webpack.cjs +5 -5
  16. package/dist/adapters/webpack.js +3 -3
  17. package/dist/browser.cjs +2 -2
  18. package/dist/browser.js +1 -1
  19. package/dist/{chunk-UUJLTW7O.cjs → chunk-4IRIMLT3.cjs} +16 -16
  20. package/dist/{chunk-AD6UFBPA.cjs → chunk-4XSFPX2Z.cjs} +367 -8
  21. package/dist/{chunk-KIAYVIC5.cjs → chunk-7F75S3GQ.cjs} +60 -36
  22. package/dist/{chunk-K77WRITN.js → chunk-EASD7C2B.js} +3 -3
  23. package/dist/{chunk-APQOBFRO.js → chunk-GKWTP4Z5.js} +30 -6
  24. package/dist/{chunk-MSECP2P4.cjs → chunk-OR5M3SN2.cjs} +1199 -428
  25. package/dist/{chunk-32GLSJAW.js → chunk-RDP4MTHK.js} +359 -0
  26. package/dist/{chunk-BL2UXZGD.js → chunk-RM3V7KJA.js} +1040 -269
  27. package/dist/{chunk-SJK45WAU.cjs → chunk-SBRU7GSX.cjs} +8 -8
  28. package/dist/{chunk-GCWXTWTN.js → chunk-XEYMZUP5.js} +2 -2
  29. package/dist/cli/index.js +1425 -274
  30. package/dist/index.cjs +21 -21
  31. package/dist/index.js +3 -3
  32. package/dist/plugins/unplugin.cjs +4 -4
  33. package/dist/plugins/unplugin.js +3 -3
  34. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
- var _chunkKIAYVIC5cjs = require('./chunk-KIAYVIC5.cjs');
4
+ var _chunk7F75S3GQcjs = require('./chunk-7F75S3GQ.cjs');
5
5
 
6
6
 
7
7
 
@@ -16,7 +16,7 @@ var _chunkURPPSTHZcjs = require('./chunk-URPPSTHZ.cjs');
16
16
 
17
17
 
18
18
 
19
- var _chunkAD6UFBPAcjs = require('./chunk-AD6UFBPA.cjs');
19
+ var _chunk4XSFPX2Zcjs = require('./chunk-4XSFPX2Z.cjs');
20
20
 
21
21
 
22
22
 
@@ -25,7 +25,7 @@ var _chunkAD6UFBPAcjs = require('./chunk-AD6UFBPA.cjs');
25
25
 
26
26
 
27
27
 
28
- var _chunkMSECP2P4cjs = require('./chunk-MSECP2P4.cjs');
28
+ var _chunkOR5M3SN2cjs = require('./chunk-OR5M3SN2.cjs');
29
29
 
30
30
 
31
31
 
@@ -100,7 +100,7 @@ export default withUnpeek(nextConfig);
100
100
  function initProject(cwd = process.cwd(), options = {}) {
101
101
  const dryRun = typeof options === "boolean" ? options : _nullishCoalesce(options.dryRun, () => ( false));
102
102
  const rootDir = _path2.default.resolve(cwd);
103
- const { framework } = _chunkAD6UFBPAcjs.detectTargetFramework.call(void 0, rootDir);
103
+ const { framework } = _chunk4XSFPX2Zcjs.detectTargetFramework.call(void 0, rootDir);
104
104
  const pkgPath = _path2.default.join(rootDir, "package.json");
105
105
  let updatedPackageJson = false;
106
106
  let updatedGitignore = false;
@@ -133,7 +133,7 @@ function initProject(cwd = process.cwd(), options = {}) {
133
133
  const rawNext = _nullishCoalesce(_optionalChain([deps, 'optionalAccess', _ => _.next]), () => ( _optionalChain([devDeps, 'optionalAccess', _2 => _2.next])));
134
134
  nextVersion = typeof rawNext === "string" ? rawNext : void 0;
135
135
  }
136
- if (framework === "nextjs" && _chunkKIAYVIC5cjs.isNext16OrAbove.call(void 0, nextVersion)) {
136
+ if (framework === "nextjs" && _chunk7F75S3GQcjs.isNext16OrAbove.call(void 0, nextVersion)) {
137
137
  isNext16 = true;
138
138
  const configRes = wireNextConfig(rootDir, dryRun);
139
139
  updatedNextConfig = configRes.updated;
@@ -206,7 +206,7 @@ function initProject(cwd = process.cwd(), options = {}) {
206
206
  var _acorn = require('acorn'); var acorn = _interopRequireWildcard(_acorn);
207
207
  var _acornwalk = require('acorn-walk');
208
208
  function walkPublicMaps(currentDir, rootOutDir, found) {
209
- if (_chunkAD6UFBPAcjs.hasNextServerSegment.call(void 0, currentDir, rootOutDir)) {
209
+ if (_chunk4XSFPX2Zcjs.hasNextServerSegment.call(void 0, currentDir, rootOutDir)) {
210
210
  return;
211
211
  }
212
212
  let entries;
@@ -221,7 +221,7 @@ function walkPublicMaps(currentDir, rootOutDir, found) {
221
221
  if (entry.name === "node_modules" || entry.name === ".unpeek-maps") {
222
222
  continue;
223
223
  }
224
- if (_chunkAD6UFBPAcjs.hasNextServerSegment.call(void 0, fullPath, rootOutDir)) {
224
+ if (_chunk4XSFPX2Zcjs.hasNextServerSegment.call(void 0, fullPath, rootOutDir)) {
225
225
  continue;
226
226
  }
227
227
  walkPublicMaps(fullPath, rootOutDir, found);
@@ -257,7 +257,7 @@ function isNodeModulesSource(sourcePath) {
257
257
  }
258
258
  function mapHasOnlyNodeModulesSources(map) {
259
259
  if (!map) return false;
260
- const flat = Array.isArray(map.sections) ? _chunkMSECP2P4cjs.flattenSourceMapSections.call(void 0, map) : map;
260
+ const flat = Array.isArray(map.sections) ? _chunkOR5M3SN2cjs.flattenSourceMapSections.call(void 0, map) : map;
261
261
  const sources = Array.isArray(flat.sources) ? flat.sources : [];
262
262
  if (sources.length === 0) return false;
263
263
  const root = flat.sourceRoot;
@@ -268,12 +268,12 @@ function mapHasOnlyNodeModulesSources(map) {
268
268
  }
269
269
  function isHitFromNodeModules(hit, map, allSourcesNodeModules) {
270
270
  if (!map) return false;
271
- const pos = _chunkMSECP2P4cjs.resolvePosition.call(void 0, map, hit.line, hit.column);
271
+ const pos = _chunkOR5M3SN2cjs.resolvePosition.call(void 0, map, hit.line, hit.column);
272
272
  if (pos.source) {
273
273
  return isNodeModulesSource(pos.source);
274
274
  }
275
275
  if (hit.calleeLine !== hit.line || hit.calleeColumn !== hit.column) {
276
- const calleePos = _chunkMSECP2P4cjs.resolvePosition.call(void 0, map, hit.calleeLine, hit.calleeColumn);
276
+ const calleePos = _chunkOR5M3SN2cjs.resolvePosition.call(void 0, map, hit.calleeLine, hit.calleeColumn);
277
277
  if (calleePos.source) {
278
278
  return isNodeModulesSource(calleePos.source);
279
279
  }
@@ -345,7 +345,7 @@ function findPlaintextSecrets(code, parsedAst) {
345
345
  };
346
346
  const inspectString = (value, node) => {
347
347
  if (!value || isSkippedBinaryPayload(value)) return;
348
- const match = _chunkMSECP2P4cjs.classifyPlaintextSecret.call(void 0, value);
348
+ const match = _chunkOR5M3SN2cjs.classifyPlaintextSecret.call(void 0, value);
349
349
  if (match) {
350
350
  pushHit(match.category, value, node);
351
351
  }
@@ -400,7 +400,7 @@ function findPlaintextSecrets(code, parsedAst) {
400
400
  if (typeof node.value === "string") {
401
401
  inspectString(node.value, node);
402
402
  } else if (node.regex && typeof node.regex.pattern === "string") {
403
- if (_chunkMSECP2P4cjs.hasRegexSecretRun.call(void 0, node.regex.pattern)) {
403
+ if (_chunkOR5M3SN2cjs.hasRegexSecretRun.call(void 0, node.regex.pattern)) {
404
404
  pushHit("regex-secret", node.regex.pattern, node);
405
405
  }
406
406
  }
@@ -475,7 +475,7 @@ function findEvalOrFunctionCalls(code, parsedAst) {
475
475
  async function checkProject(options = {}) {
476
476
  const cwd = _path2.default.resolve(_nullishCoalesce(options.cwd, () => ( process.cwd())));
477
477
  const config = await _chunkBQ2O6HM5cjs.loadUnpeekConfig.call(void 0, cwd);
478
- const { outDir } = _chunkAD6UFBPAcjs.detectTargetFramework.call(void 0, cwd, options.outDir, config);
478
+ const { outDir } = _chunk4XSFPX2Zcjs.detectTargetFramework.call(void 0, cwd, options.outDir, config);
479
479
  const resolvedOutDir = _path2.default.resolve(outDir);
480
480
  const privateMapsDir = _nullishCoalesce(_nullishCoalesce(options.privateMapsDir, () => ( _optionalChain([config, 'access', _16 => _16.sourcemaps, 'optionalAccess', _17 => _17.vaultDir]))), () => ( ".unpeek-maps"));
481
481
  const maxGzipDelta = _nullishCoalesce(options.maxGzipDelta, () => ( 15));
@@ -507,7 +507,7 @@ async function checkProject(options = {}) {
507
507
  } catch (e5) {
508
508
  }
509
509
  }
510
- const clientFiles = _chunkAD6UFBPAcjs.scanClientBundles.call(void 0, resolvedOutDir, config);
510
+ const clientFiles = _chunk4XSFPX2Zcjs.scanClientBundles.call(void 0, resolvedOutDir, config);
511
511
  for (const filePath of clientFiles) {
512
512
  const rel = _path2.default.relative(resolvedOutDir, filePath).replace(/\\/g, "/");
513
513
  const relFromManifest = typeof _optionalChain([manifest, 'optionalAccess', _18 => _18.outDir]) === "string" ? _path2.default.relative(_path2.default.resolve(cwd, manifest.outDir), filePath).replace(/\\/g, "/") : void 0;
@@ -517,8 +517,8 @@ async function checkProject(options = {}) {
517
517
  } catch (e6) {
518
518
  continue;
519
519
  }
520
- _chunkAD6UFBPAcjs.SOURCE_MAP_COMMENT_REGEX.lastIndex = 0;
521
- if (_chunkAD6UFBPAcjs.SOURCE_MAP_COMMENT_REGEX.test(content)) {
520
+ _chunk4XSFPX2Zcjs.SOURCE_MAP_COMMENT_REGEX.lastIndex = 0;
521
+ if (_chunk4XSFPX2Zcjs.SOURCE_MAP_COMMENT_REGEX.test(content)) {
522
522
  violations.push({
523
523
  rule: "sourcemap-comment",
524
524
  severity: "error",
@@ -526,9 +526,9 @@ async function checkProject(options = {}) {
526
526
  file: rel
527
527
  });
528
528
  }
529
- const jsDebugId = _chunkAD6UFBPAcjs.extractDebugId.call(void 0, content);
530
- const decodedRel = _chunkMSECP2P4cjs.safeDecodeURIComponent.call(void 0, rel);
531
- const decodedManifestRel = relFromManifest ? _chunkMSECP2P4cjs.safeDecodeURIComponent.call(void 0, relFromManifest) : void 0;
529
+ const jsDebugId = _chunk4XSFPX2Zcjs.extractDebugId.call(void 0, content);
530
+ const decodedRel = _chunkOR5M3SN2cjs.safeDecodeURIComponent.call(void 0, rel);
531
+ const decodedManifestRel = relFromManifest ? _chunkOR5M3SN2cjs.safeDecodeURIComponent.call(void 0, relFromManifest) : void 0;
532
532
  const mapCandidates = [
533
533
  _path2.default.join(vaultDir, `${rel}.map`),
534
534
  ...decodedRel !== rel ? [_path2.default.join(vaultDir, `${decodedRel}.map`)] : [],
@@ -654,7 +654,7 @@ async function checkProject(options = {}) {
654
654
  }
655
655
  const relVault = _path2.default.relative(cwd, vaultDir).replace(/\\/g, "/");
656
656
  const ignoreEntry = relVault && !relVault.startsWith("..") ? `${relVault}/` : ".unpeek-maps/";
657
- const roots = _chunkAD6UFBPAcjs.findMonorepoRoots.call(void 0, cwd);
657
+ const roots = _chunk4XSFPX2Zcjs.findMonorepoRoots.call(void 0, cwd);
658
658
  let foundGitignore = false;
659
659
  let gitignoreProtected = false;
660
660
  let foundDockerignore = false;
@@ -730,4 +730,4 @@ async function checkProject(options = {}) {
730
730
 
731
731
 
732
732
 
733
- exports.PRESETS = _chunkURPPSTHZcjs.PRESETS; exports.UnpeekError = _chunkL6BOM5VScjs.UnpeekError; exports.checkProject = checkProject; exports.defineConfig = _chunkBQ2O6HM5cjs.defineConfig; exports.initProject = initProject; exports.isUnpeekError = _chunkL6BOM5VScjs.isUnpeekError; exports.loadUnpeekConfig = _chunkBQ2O6HM5cjs.loadUnpeekConfig; exports.protectProject = _chunkKIAYVIC5cjs.protectProject; exports.symbolicateStackTrace = _chunkMSECP2P4cjs.symbolicateStackTrace; exports.transformJavaScript = _chunkMSECP2P4cjs.transformJavaScript;
733
+ exports.PRESETS = _chunkURPPSTHZcjs.PRESETS; exports.UnpeekError = _chunkL6BOM5VScjs.UnpeekError; exports.checkProject = checkProject; exports.defineConfig = _chunkBQ2O6HM5cjs.defineConfig; exports.initProject = initProject; exports.isUnpeekError = _chunkL6BOM5VScjs.isUnpeekError; exports.loadUnpeekConfig = _chunkBQ2O6HM5cjs.loadUnpeekConfig; exports.protectProject = _chunk7F75S3GQcjs.protectProject; exports.symbolicateStackTrace = _chunkOR5M3SN2cjs.symbolicateStackTrace; exports.transformJavaScript = _chunkOR5M3SN2cjs.transformJavaScript;
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  isNext16OrAbove,
3
3
  protectProject
4
- } from "./chunk-APQOBFRO.js";
4
+ } from "./chunk-GKWTP4Z5.js";
5
5
  import {
6
6
  defineConfig,
7
7
  loadUnpeekConfig
@@ -16,7 +16,7 @@ import {
16
16
  findMonorepoRoots,
17
17
  hasNextServerSegment,
18
18
  scanClientBundles
19
- } from "./chunk-32GLSJAW.js";
19
+ } from "./chunk-RDP4MTHK.js";
20
20
  import {
21
21
  classifyPlaintextSecret,
22
22
  flattenSourceMapSections,
@@ -25,7 +25,7 @@ import {
25
25
  safeDecodeURIComponent,
26
26
  symbolicateStackTrace,
27
27
  transformJavaScript
28
- } from "./chunk-BL2UXZGD.js";
28
+ } from "./chunk-RM3V7KJA.js";
29
29
  import {
30
30
  UnpeekError,
31
31
  isUnpeekError
@@ -6,9 +6,9 @@
6
6
 
7
7
 
8
8
 
9
- var _chunkUUJLTW7Ocjs = require('../chunk-UUJLTW7O.cjs');
10
- require('../chunk-AD6UFBPA.cjs');
11
- require('../chunk-MSECP2P4.cjs');
9
+ var _chunk4IRIMLT3cjs = require('../chunk-4IRIMLT3.cjs');
10
+ require('../chunk-4XSFPX2Z.cjs');
11
+ require('../chunk-OR5M3SN2.cjs');
12
12
  require('../chunk-L6BOM5VS.cjs');
13
13
 
14
14
 
@@ -18,4 +18,4 @@ require('../chunk-L6BOM5VS.cjs');
18
18
 
19
19
 
20
20
 
21
- exports.default = _chunkUUJLTW7Ocjs.unplugin_default; exports.esbuildPlugin = _chunkUUJLTW7Ocjs.esbuildPlugin; exports.rollupPlugin = _chunkUUJLTW7Ocjs.rollupPlugin; exports.rspackPlugin = _chunkUUJLTW7Ocjs.rspackPlugin; exports.unpeekPlugin = _chunkUUJLTW7Ocjs.unpeekPlugin; exports.vitePlugin = _chunkUUJLTW7Ocjs.vitePlugin; exports.webpackPlugin = _chunkUUJLTW7Ocjs.webpackPlugin;
21
+ exports.default = _chunk4IRIMLT3cjs.unplugin_default; exports.esbuildPlugin = _chunk4IRIMLT3cjs.esbuildPlugin; exports.rollupPlugin = _chunk4IRIMLT3cjs.rollupPlugin; exports.rspackPlugin = _chunk4IRIMLT3cjs.rspackPlugin; exports.unpeekPlugin = _chunk4IRIMLT3cjs.unpeekPlugin; exports.vitePlugin = _chunk4IRIMLT3cjs.vitePlugin; exports.webpackPlugin = _chunk4IRIMLT3cjs.webpackPlugin;
@@ -6,9 +6,9 @@ import {
6
6
  unplugin_default,
7
7
  vitePlugin,
8
8
  webpackPlugin
9
- } from "../chunk-GCWXTWTN.js";
10
- import "../chunk-32GLSJAW.js";
11
- import "../chunk-BL2UXZGD.js";
9
+ } from "../chunk-XEYMZUP5.js";
10
+ import "../chunk-RDP4MTHK.js";
11
+ import "../chunk-RM3V7KJA.js";
12
12
  import "../chunk-LA6J3BT3.js";
13
13
  export {
14
14
  unplugin_default as default,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unpeek",
3
- "version": "4.2.0",
3
+ "version": "4.3.0",
4
4
  "description": "Zero-config, call-graph-aware polymorphic AST obfuscation and passive runtime anti-tamper with <2% CPU overhead.",
5
5
  "type": "module",
6
6
  "license": "MIT",