unpeek 4.1.0 → 4.2.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 +7 -7
- package/README.tr.md +7 -7
- package/dist/adapters/esbuild.cjs +4 -4
- package/dist/adapters/esbuild.js +2 -2
- package/dist/adapters/next/adapter.cjs +4 -4
- package/dist/adapters/next/adapter.js +3 -3
- package/dist/adapters/next/index.cjs +4 -4
- package/dist/adapters/next/index.js +3 -3
- package/dist/adapters/rollup.cjs +4 -4
- package/dist/adapters/rollup.js +2 -2
- package/dist/adapters/rspack.cjs +4 -4
- package/dist/adapters/rspack.js +2 -2
- package/dist/adapters/vite.cjs +4 -4
- package/dist/adapters/vite.js +2 -2
- package/dist/adapters/webpack.cjs +4 -4
- package/dist/adapters/webpack.js +2 -2
- package/dist/browser.cjs +2 -2
- package/dist/browser.d.cts +3 -2
- package/dist/browser.d.ts +3 -2
- package/dist/browser.js +1 -1
- package/dist/{chunk-STTUFUDC.js → chunk-APQOBFRO.js} +1 -1
- package/dist/{chunk-6KLUNEKE.js → chunk-BL2UXZGD.js} +1187 -162
- package/dist/{chunk-TOUYQ4N5.js → chunk-GCWXTWTN.js} +1 -1
- package/dist/{chunk-HV47WJIR.js → chunk-K77WRITN.js} +2 -2
- package/dist/{chunk-WYW5UOBE.cjs → chunk-KIAYVIC5.cjs} +11 -11
- package/dist/{chunk-VLL4THTG.cjs → chunk-MSECP2P4.cjs} +1326 -301
- package/dist/{chunk-FLZ4FSP5.cjs → chunk-SJK45WAU.cjs} +6 -6
- package/dist/{chunk-Q4DFRMAV.cjs → chunk-UUJLTW7O.cjs} +9 -9
- package/dist/cli/index.js +1332 -171
- package/dist/index.cjs +159 -19
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +150 -10
- package/dist/plugins/unplugin.cjs +3 -3
- package/dist/plugins/unplugin.js +2 -2
- package/dist/{types-BZqvBhBI.d.ts → types-BDpFfokR.d.ts} +2 -1
- package/dist/{types-E4ugA4Oz.d.cts → types-WIoud53X.d.cts} +2 -1
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
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
|
|
4
|
+
var _chunkKIAYVIC5cjs = require('./chunk-KIAYVIC5.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkAD6UFBPAcjs = require('./chunk-AD6UFBPA.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkMSECP2P4cjs = require('./chunk-MSECP2P4.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -135,8 +135,8 @@ function createUnpeekNextAdapter(options = {}) {
|
|
|
135
135
|
elapsedMs: 0
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
|
-
const deterministicSeed = typeof options.seed === "number" ? options.seed : context.buildId ?
|
|
139
|
-
const summary = await
|
|
138
|
+
const deterministicSeed = typeof options.seed === "number" ? options.seed : context.buildId ? _chunkMSECP2P4cjs.computeFnv1aHash.call(void 0, context.buildId, 1597463007) : 1597463007;
|
|
139
|
+
const summary = await _chunkKIAYVIC5cjs.protectProject.call(void 0, {
|
|
140
140
|
...options,
|
|
141
141
|
cwd,
|
|
142
142
|
outDir: targetDir,
|
|
@@ -151,7 +151,7 @@ function createUnpeekNextAdapter(options = {}) {
|
|
|
151
151
|
if (!rawFilePath) continue;
|
|
152
152
|
let absPath = _path2.default.isAbsolute(rawFilePath) ? rawFilePath : _path2.default.resolve(cwd, rawFilePath);
|
|
153
153
|
if (!_fs2.default.existsSync(absPath)) {
|
|
154
|
-
const relClean =
|
|
154
|
+
const relClean = _chunkMSECP2P4cjs.safeDecodeURIComponent.call(void 0, rawFilePath).replace(/\\/g, "/").replace(/^\/?(?:_next\/|\.next\/)/, "");
|
|
155
155
|
const fromDist = _path2.default.resolve(distDir, relClean);
|
|
156
156
|
if (_fs2.default.existsSync(fromDist)) {
|
|
157
157
|
absPath = fromDist;
|
|
@@ -232,7 +232,7 @@ function applyWithUnpeek(config = {}, options) {
|
|
|
232
232
|
process.env.UNPEEK_UPSTREAM_ADAPTER_PATH = options.upstreamAdapterPath;
|
|
233
233
|
}
|
|
234
234
|
if (options) {
|
|
235
|
-
const serialized =
|
|
235
|
+
const serialized = _chunkKIAYVIC5cjs.serializeNextOptions.call(void 0, options);
|
|
236
236
|
const byteLength = Buffer.byteLength(serialized, "utf8");
|
|
237
237
|
if (byteLength > MAX_NEXT_OPTIONS_ENV_BYTES) {
|
|
238
238
|
throw new (0, _chunkL6BOM5VScjs.UnpeekError)(
|
|
@@ -14,7 +14,7 @@ var _chunkAD6UFBPAcjs = require('./chunk-AD6UFBPA.cjs');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkMSECP2P4cjs = require('./chunk-MSECP2P4.cjs');
|
|
18
18
|
|
|
19
19
|
// src/plugins/unplugin.ts
|
|
20
20
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
@@ -70,8 +70,8 @@ var unpeekPlugin = _unplugin.createUnplugin.call(void 0, (options = {}) => {
|
|
|
70
70
|
const injectRuntimeShield = _nullishCoalesce(options.injectRuntimeShield, () => ( true));
|
|
71
71
|
const minStringLength = _nullishCoalesce(_nullishCoalesce(options.minStringLength, () => ( _optionalChain([config, 'optionalAccess', _11 => _11.vault, 'optionalAccess', _12 => _12.minStringLength]))), () => ( 4));
|
|
72
72
|
const aggressive = _nullishCoalesce(options.aggressive, () => ( false));
|
|
73
|
-
const masterSym =
|
|
74
|
-
const masterShield = injectRuntimeShield ?
|
|
73
|
+
const masterSym = _chunkMSECP2P4cjs.deriveWindowKeySymbol.call(void 0, baseSeed);
|
|
74
|
+
const masterShield = injectRuntimeShield ? _chunkMSECP2P4cjs.generateRuntimeShield.call(void 0, {
|
|
75
75
|
seed: baseSeed,
|
|
76
76
|
deterrentMode,
|
|
77
77
|
detectHeadless,
|
|
@@ -90,7 +90,7 @@ var unpeekPlugin = _unplugin.createUnplugin.call(void 0, (options = {}) => {
|
|
|
90
90
|
}
|
|
91
91
|
const shouldInjectShield = injectRuntimeShield && isEntry;
|
|
92
92
|
const shouldGenerateMap = requestMap || Boolean(inputMap);
|
|
93
|
-
const chunkSeed =
|
|
93
|
+
const chunkSeed = _chunkMSECP2P4cjs.computeFnv1aHash.call(void 0, fileName, baseSeed);
|
|
94
94
|
const transformOptions = {
|
|
95
95
|
seed: chunkSeed,
|
|
96
96
|
minStringLength,
|
|
@@ -109,7 +109,7 @@ var unpeekPlugin = _unplugin.createUnplugin.call(void 0, (options = {}) => {
|
|
|
109
109
|
generateMap: shouldGenerateMap,
|
|
110
110
|
rootDir: process.cwd()
|
|
111
111
|
};
|
|
112
|
-
const result =
|
|
112
|
+
const result = _chunkMSECP2P4cjs.transformJavaScript.call(void 0, codeToTransform, transformOptions);
|
|
113
113
|
let finalCode = result.code;
|
|
114
114
|
let preambleLineOffset = 0;
|
|
115
115
|
const integrityCheckFnName = masterShield && "integrityCheckFnName" in masterShield ? masterShield.integrityCheckFnName : void 0;
|
|
@@ -120,21 +120,21 @@ var unpeekPlugin = _unplugin.createUnplugin.call(void 0, (options = {}) => {
|
|
|
120
120
|
finalCode = `${prefix}${finalCode}`;
|
|
121
121
|
}
|
|
122
122
|
const rawTransformMap = result.sourceMap;
|
|
123
|
-
const shiftedTransformMap = rawTransformMap ?
|
|
123
|
+
const shiftedTransformMap = rawTransformMap ? _chunkMSECP2P4cjs.shiftSourceMapLines.call(void 0, rawTransformMap, preambleLineOffset) : void 0;
|
|
124
124
|
let composedMap = null;
|
|
125
125
|
if (shiftedTransformMap && inputMap) {
|
|
126
|
-
composedMap =
|
|
126
|
+
composedMap = _chunkMSECP2P4cjs.chainSourceMaps.call(void 0, shiftedTransformMap, inputMap);
|
|
127
127
|
} else if (shiftedTransformMap) {
|
|
128
128
|
composedMap = shiftedTransformMap;
|
|
129
129
|
} else if (inputMap) {
|
|
130
|
-
composedMap =
|
|
130
|
+
composedMap = _chunkMSECP2P4cjs.flattenSourceMapSections.call(void 0, inputMap);
|
|
131
131
|
}
|
|
132
132
|
const inputMapDebugId = _nullishCoalesce(_optionalChain([inputMap, 'optionalAccess', _18 => _18.debugId]), () => ( _optionalChain([inputMap, 'optionalAccess', _19 => _19.debug_id])));
|
|
133
133
|
const hadDebugId = Boolean(fileDebugId || inputMapDebugId || result.debugId);
|
|
134
134
|
const shouldMintDebugId = hadDebugId || shouldGenerateMap && !result.skippedReason && Boolean(composedMap || inputMap);
|
|
135
135
|
if (shouldMintDebugId) {
|
|
136
136
|
const codeWithoutDebugId = _chunkAD6UFBPAcjs.stripDebugIdComments.call(void 0, finalCode);
|
|
137
|
-
const mintedDebugId =
|
|
137
|
+
const mintedDebugId = _chunkMSECP2P4cjs.computeDeterministicDebugId.call(void 0,
|
|
138
138
|
codeWithoutDebugId,
|
|
139
139
|
_nullishCoalesce(_optionalChain([composedMap, 'optionalAccess', _20 => _20.mappings]), () => ( ""))
|
|
140
140
|
);
|