unpeek 2.0.0 → 4.0.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 +57 -21
- package/README.tr.md +65 -29
- package/dist/adapters/esbuild.cjs +13 -0
- package/dist/adapters/esbuild.d.cts +13 -0
- package/dist/adapters/esbuild.d.ts +11 -0
- package/dist/adapters/esbuild.js +13 -0
- package/dist/adapters/next/adapter.cjs +43 -0
- package/dist/{next → adapters/next}/adapter.d.cts +4 -4
- package/dist/{next → adapters/next}/adapter.d.ts +4 -4
- package/dist/adapters/next/adapter.js +43 -0
- package/dist/adapters/next/index.cjs +16 -0
- package/dist/adapters/next/index.d.cts +53 -0
- package/dist/adapters/next/index.d.ts +53 -0
- package/dist/adapters/next/index.js +16 -0
- package/dist/adapters/rollup.cjs +13 -0
- package/dist/adapters/rollup.d.cts +13 -0
- package/dist/adapters/rollup.d.ts +11 -0
- package/dist/adapters/rollup.js +13 -0
- package/dist/adapters/rspack.cjs +13 -0
- package/dist/adapters/rspack.d.cts +13 -0
- package/dist/adapters/rspack.d.ts +11 -0
- package/dist/adapters/rspack.js +13 -0
- package/dist/adapters/vite.cjs +13 -0
- package/dist/adapters/vite.d.cts +13 -0
- package/dist/adapters/vite.d.ts +11 -0
- package/dist/adapters/vite.js +13 -0
- package/dist/adapters/webpack.cjs +13 -0
- package/dist/adapters/webpack.d.cts +13 -0
- package/dist/adapters/webpack.d.ts +11 -0
- package/dist/adapters/webpack.js +13 -0
- package/dist/browser.cjs +8 -5
- package/dist/browser.d.cts +44 -3
- package/dist/browser.d.ts +44 -3
- package/dist/browser.js +10 -7
- package/dist/{chunk-5QD6FZPB.js → chunk-2JU3V7HW.js} +75 -43
- package/dist/chunk-3LWXEJU6.cjs +1054 -0
- package/dist/chunk-4FNZNIBW.js +7391 -0
- package/dist/chunk-7HXLHLLQ.cjs +503 -0
- package/dist/chunk-ADKRENAP.js +1054 -0
- package/dist/chunk-EN6QVR6P.js +89 -0
- package/dist/chunk-HHC7BUCK.js +503 -0
- package/dist/chunk-KLYFNMKS.cjs +7391 -0
- package/dist/chunk-L6BOM5VS.cjs +40 -0
- package/dist/{chunk-OOXSZTRV.js → chunk-LA6J3BT3.js} +26 -1
- package/dist/chunk-URPPSTHZ.cjs +89 -0
- package/dist/chunk-VG4Y26ZN.cjs +429 -0
- package/dist/{chunk-GZB7PFLY.js → chunk-W77DAC3H.js} +46 -64
- package/dist/chunk-X6EETCO6.cjs +352 -0
- package/dist/chunk-YCRMTXOE.js +429 -0
- package/dist/{chunk-GAVI2C44.cjs → chunk-ZG7BIAUI.cjs} +80 -48
- package/dist/cli/index.js +9861 -32
- package/dist/{types-BBSRUEab.d.cts → config-Y6JwVGwX.d.cts} +58 -86
- package/dist/{types-BBSRUEab.d.ts → config-Y6JwVGwX.d.ts} +58 -86
- package/dist/config.cjs +4 -16
- package/dist/config.d.cts +1 -12
- package/dist/config.d.ts +1 -12
- package/dist/config.js +5 -17
- package/dist/index-0O1WSfVP.d.ts +52 -0
- package/dist/index-COVHErnx.d.cts +52 -0
- package/dist/index.cjs +437 -9
- package/dist/index.d.cts +9 -17
- package/dist/index.d.ts +9 -17
- package/dist/index.js +438 -10
- package/dist/plugins/unplugin.cjs +21 -0
- package/dist/plugins/unplugin.d.cts +17 -0
- package/dist/plugins/unplugin.d.ts +15 -0
- package/dist/{bundler → plugins}/unplugin.js +6 -5
- package/dist/types-CMtZnV8C.d.ts +112 -0
- package/dist/types-D93PuOOl.d.cts +112 -0
- package/package.json +48 -52
- package/dist/ast/index.cjs +0 -17
- package/dist/ast/index.d.cts +0 -18
- package/dist/ast/index.d.ts +0 -18
- package/dist/ast/index.js +0 -17
- package/dist/bundler/unplugin.cjs +0 -20
- package/dist/bundler/unplugin.d.cts +0 -16
- package/dist/bundler/unplugin.d.ts +0 -14
- package/dist/chunk-24K5NDXH.cjs +0 -370
- package/dist/chunk-27HR647Q.js +0 -190
- package/dist/chunk-4TDLLEEU.cjs +0 -15
- package/dist/chunk-5LCMI2TL.js +0 -575
- package/dist/chunk-5M6Z7ZFT.cjs +0 -83
- package/dist/chunk-6N6S6WTQ.cjs +0 -423
- package/dist/chunk-7YVEHJVM.cjs +0 -575
- package/dist/chunk-J5CGNZDM.cjs +0 -190
- package/dist/chunk-KQWNFKT2.js +0 -423
- package/dist/chunk-LXP73HJC.cjs +0 -4532
- package/dist/chunk-R6EBIR3T.cjs +0 -14
- package/dist/chunk-S4S2WXGC.js +0 -14
- package/dist/chunk-UMPUYLLZ.js +0 -4532
- package/dist/chunk-X5MKMFMX.js +0 -83
- package/dist/cli/index.cjs +0 -324
- package/dist/cli/index.d.cts +0 -22
- package/dist/cli/index.d.ts +0 -22
- package/dist/esbuild.cjs +0 -15
- package/dist/esbuild.d.cts +0 -11
- package/dist/esbuild.d.ts +0 -11
- package/dist/esbuild.js +0 -13
- package/dist/next/adapter.cjs +0 -31
- package/dist/next/adapter.js +0 -31
- package/dist/next/index.cjs +0 -18
- package/dist/next/index.d.cts +0 -42
- package/dist/next/index.d.ts +0 -42
- package/dist/next/index.js +0 -18
- package/dist/rollup.cjs +0 -15
- package/dist/rollup.d.cts +0 -11
- package/dist/rollup.d.ts +0 -11
- package/dist/rollup.js +0 -13
- package/dist/runtime/index.cjs +0 -17
- package/dist/runtime/index.d.cts +0 -36
- package/dist/runtime/index.d.ts +0 -36
- package/dist/runtime/index.js +0 -17
- package/dist/vite.cjs +0 -15
- package/dist/vite.d.cts +0 -11
- package/dist/vite.d.ts +0 -11
- package/dist/vite.js +0 -13
- package/dist/webpack.cjs +0 -15
- package/dist/webpack.d.cts +0 -11
- package/dist/webpack.d.ts +0 -11
- package/dist/webpack.js +0 -13
package/dist/chunk-24K5NDXH.cjs
DELETED
|
@@ -1,370 +0,0 @@
|
|
|
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
|
-
|
|
3
|
-
var _chunkR6EBIR3Tcjs = require('./chunk-R6EBIR3T.cjs');
|
|
4
|
-
|
|
5
|
-
// src/config.ts
|
|
6
|
-
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
7
|
-
var _path = require('path');
|
|
8
|
-
var _url = require('url');
|
|
9
|
-
var _module = require('module');
|
|
10
|
-
var CONFIG_CANDIDATES = [
|
|
11
|
-
"unpeek.config.js",
|
|
12
|
-
"unpeek.config.mjs",
|
|
13
|
-
"unpeek.config.cjs",
|
|
14
|
-
"unpeek.config.json"
|
|
15
|
-
];
|
|
16
|
-
var DEFAULT_CONFIG = {
|
|
17
|
-
framework: void 0,
|
|
18
|
-
target: "browser",
|
|
19
|
-
outDir: void 0,
|
|
20
|
-
extensions: [".js", ".jsx", ".ts", ".tsx", ".mjs", ".cjs"],
|
|
21
|
-
publicDirs: ["public", "static"],
|
|
22
|
-
filter: {
|
|
23
|
-
include: [],
|
|
24
|
-
exclude: ["node_modules/**", "**/*.test.*", "**/*.spec.*"]
|
|
25
|
-
},
|
|
26
|
-
hotPath: {
|
|
27
|
-
customAnimationCalls: [],
|
|
28
|
-
importSources: {},
|
|
29
|
-
customHooks: [],
|
|
30
|
-
arrayHofMethods: [],
|
|
31
|
-
hocWrappers: [],
|
|
32
|
-
excludeComponents: [],
|
|
33
|
-
maxPipelineCallers: 2
|
|
34
|
-
},
|
|
35
|
-
vault: {
|
|
36
|
-
minStringLength: 4,
|
|
37
|
-
customDirectives: [],
|
|
38
|
-
reservedProps: [],
|
|
39
|
-
cssFramework: "tailwind",
|
|
40
|
-
semanticAnchors: {
|
|
41
|
-
excludeUiClasses: true
|
|
42
|
-
},
|
|
43
|
-
polymorphicDecoys: true
|
|
44
|
-
},
|
|
45
|
-
mangler: {
|
|
46
|
-
minLength: 3,
|
|
47
|
-
reservedIdentifiers: [],
|
|
48
|
-
excludePrefixes: [],
|
|
49
|
-
excludePatterns: []
|
|
50
|
-
},
|
|
51
|
-
shield: {
|
|
52
|
-
detectHeadless: false,
|
|
53
|
-
deterrentMode: "passive"
|
|
54
|
-
},
|
|
55
|
-
sourcemaps: {
|
|
56
|
-
keepPrivate: true,
|
|
57
|
-
vaultDir: ".unpeek-maps",
|
|
58
|
-
stripComments: true
|
|
59
|
-
},
|
|
60
|
-
next: {},
|
|
61
|
-
vite: {}
|
|
62
|
-
};
|
|
63
|
-
function mergeStringArrays(a, b) {
|
|
64
|
-
return Array.from(/* @__PURE__ */ new Set([..._nullishCoalesce(a, () => ( [])), ..._nullishCoalesce(b, () => ( []))]));
|
|
65
|
-
}
|
|
66
|
-
function isRecord(val) {
|
|
67
|
-
return typeof val === "object" && val !== null && !Array.isArray(val);
|
|
68
|
-
}
|
|
69
|
-
function toRegExp(val) {
|
|
70
|
-
if (!val) return void 0;
|
|
71
|
-
if (val instanceof RegExp) return val;
|
|
72
|
-
if (typeof val === "string") {
|
|
73
|
-
return new RegExp(val);
|
|
74
|
-
}
|
|
75
|
-
return void 0;
|
|
76
|
-
}
|
|
77
|
-
function toRegExpArray(val) {
|
|
78
|
-
if (!Array.isArray(val)) return void 0;
|
|
79
|
-
const result = [];
|
|
80
|
-
for (const item of val) {
|
|
81
|
-
const rx = toRegExp(item);
|
|
82
|
-
if (rx) result.push(rx);
|
|
83
|
-
}
|
|
84
|
-
return result;
|
|
85
|
-
}
|
|
86
|
-
function normalizeConfig(raw) {
|
|
87
|
-
if (!isRecord(raw)) {
|
|
88
|
-
return {};
|
|
89
|
-
}
|
|
90
|
-
const result = { ...raw };
|
|
91
|
-
if (isRecord(raw.hotPath)) {
|
|
92
|
-
result.hotPath = {
|
|
93
|
-
...raw.hotPath,
|
|
94
|
-
hookPattern: toRegExp(raw.hotPath.hookPattern),
|
|
95
|
-
eventHandlerRegex: toRegExp(raw.hotPath.eventHandlerRegex)
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
if (isRecord(raw.vault)) {
|
|
99
|
-
result.vault = {
|
|
100
|
-
...raw.vault,
|
|
101
|
-
semanticAnchors: isRecord(raw.vault.semanticAnchors) ? {
|
|
102
|
-
...raw.vault.semanticAnchors,
|
|
103
|
-
patterns: toRegExpArray(raw.vault.semanticAnchors.patterns)
|
|
104
|
-
} : void 0
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
if (isRecord(raw.mangler)) {
|
|
108
|
-
result.mangler = {
|
|
109
|
-
...raw.mangler,
|
|
110
|
-
excludePatterns: toRegExpArray(raw.mangler.excludePatterns)
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
return result;
|
|
114
|
-
}
|
|
115
|
-
function mergeUnpeekConfig(base, override) {
|
|
116
|
-
if (!override) {
|
|
117
|
-
return { ...base };
|
|
118
|
-
}
|
|
119
|
-
return {
|
|
120
|
-
...base,
|
|
121
|
-
framework: _nullishCoalesce(override.framework, () => ( base.framework)),
|
|
122
|
-
target: _nullishCoalesce(override.target, () => ( base.target)),
|
|
123
|
-
outDir: _nullishCoalesce(override.outDir, () => ( base.outDir)),
|
|
124
|
-
extensions: override.extensions ? [...override.extensions] : base.extensions ? [...base.extensions] : void 0,
|
|
125
|
-
publicDirs: override.publicDirs ? [...override.publicDirs] : base.publicDirs ? [...base.publicDirs] : void 0,
|
|
126
|
-
filter: {
|
|
127
|
-
include: _optionalChain([override, 'access', _ => _.filter, 'optionalAccess', _2 => _2.include]) ? [...override.filter.include] : _optionalChain([base, 'access', _3 => _3.filter, 'optionalAccess', _4 => _4.include]) ? [...base.filter.include] : [],
|
|
128
|
-
exclude: _optionalChain([override, 'access', _5 => _5.filter, 'optionalAccess', _6 => _6.exclude]) ? [...override.filter.exclude] : _optionalChain([base, 'access', _7 => _7.filter, 'optionalAccess', _8 => _8.exclude]) ? [...base.filter.exclude] : []
|
|
129
|
-
},
|
|
130
|
-
hotPath: {
|
|
131
|
-
customAnimationCalls: mergeStringArrays(
|
|
132
|
-
_optionalChain([base, 'access', _9 => _9.hotPath, 'optionalAccess', _10 => _10.customAnimationCalls]),
|
|
133
|
-
_optionalChain([override, 'access', _11 => _11.hotPath, 'optionalAccess', _12 => _12.customAnimationCalls])
|
|
134
|
-
),
|
|
135
|
-
importSources: {
|
|
136
|
-
..._nullishCoalesce(_optionalChain([base, 'access', _13 => _13.hotPath, 'optionalAccess', _14 => _14.importSources]), () => ( {})),
|
|
137
|
-
..._nullishCoalesce(_optionalChain([override, 'access', _15 => _15.hotPath, 'optionalAccess', _16 => _16.importSources]), () => ( {}))
|
|
138
|
-
},
|
|
139
|
-
hookPattern: _nullishCoalesce(_optionalChain([override, 'access', _17 => _17.hotPath, 'optionalAccess', _18 => _18.hookPattern]), () => ( _optionalChain([base, 'access', _19 => _19.hotPath, 'optionalAccess', _20 => _20.hookPattern]))),
|
|
140
|
-
customHooks: mergeStringArrays(
|
|
141
|
-
_optionalChain([base, 'access', _21 => _21.hotPath, 'optionalAccess', _22 => _22.customHooks]),
|
|
142
|
-
_optionalChain([override, 'access', _23 => _23.hotPath, 'optionalAccess', _24 => _24.customHooks])
|
|
143
|
-
),
|
|
144
|
-
arrayHofMethods: mergeStringArrays(
|
|
145
|
-
_optionalChain([base, 'access', _25 => _25.hotPath, 'optionalAccess', _26 => _26.arrayHofMethods]),
|
|
146
|
-
_optionalChain([override, 'access', _27 => _27.hotPath, 'optionalAccess', _28 => _28.arrayHofMethods])
|
|
147
|
-
),
|
|
148
|
-
eventHandlerRegex: _nullishCoalesce(_optionalChain([override, 'access', _29 => _29.hotPath, 'optionalAccess', _30 => _30.eventHandlerRegex]), () => ( _optionalChain([base, 'access', _31 => _31.hotPath, 'optionalAccess', _32 => _32.eventHandlerRegex]))),
|
|
149
|
-
maxPipelineCallers: _nullishCoalesce(_nullishCoalesce(_optionalChain([override, 'access', _33 => _33.hotPath, 'optionalAccess', _34 => _34.maxPipelineCallers]), () => ( _optionalChain([base, 'access', _35 => _35.hotPath, 'optionalAccess', _36 => _36.maxPipelineCallers]))), () => ( 2)),
|
|
150
|
-
hocWrappers: mergeStringArrays(
|
|
151
|
-
_optionalChain([base, 'access', _37 => _37.hotPath, 'optionalAccess', _38 => _38.hocWrappers]),
|
|
152
|
-
_optionalChain([override, 'access', _39 => _39.hotPath, 'optionalAccess', _40 => _40.hocWrappers])
|
|
153
|
-
),
|
|
154
|
-
excludeComponents: mergeStringArrays(
|
|
155
|
-
_optionalChain([base, 'access', _41 => _41.hotPath, 'optionalAccess', _42 => _42.excludeComponents]),
|
|
156
|
-
_optionalChain([override, 'access', _43 => _43.hotPath, 'optionalAccess', _44 => _44.excludeComponents])
|
|
157
|
-
)
|
|
158
|
-
},
|
|
159
|
-
vault: {
|
|
160
|
-
minStringLength: _nullishCoalesce(_nullishCoalesce(_optionalChain([override, 'access', _45 => _45.vault, 'optionalAccess', _46 => _46.minStringLength]), () => ( _optionalChain([base, 'access', _47 => _47.vault, 'optionalAccess', _48 => _48.minStringLength]))), () => ( 4)),
|
|
161
|
-
customDirectives: mergeStringArrays(
|
|
162
|
-
_optionalChain([base, 'access', _49 => _49.vault, 'optionalAccess', _50 => _50.customDirectives]),
|
|
163
|
-
_optionalChain([override, 'access', _51 => _51.vault, 'optionalAccess', _52 => _52.customDirectives])
|
|
164
|
-
),
|
|
165
|
-
reservedProps: mergeStringArrays(
|
|
166
|
-
_optionalChain([base, 'access', _53 => _53.vault, 'optionalAccess', _54 => _54.reservedProps]),
|
|
167
|
-
_optionalChain([override, 'access', _55 => _55.vault, 'optionalAccess', _56 => _56.reservedProps])
|
|
168
|
-
),
|
|
169
|
-
cssFramework: _nullishCoalesce(_nullishCoalesce(_optionalChain([override, 'access', _57 => _57.vault, 'optionalAccess', _58 => _58.cssFramework]), () => ( _optionalChain([base, 'access', _59 => _59.vault, 'optionalAccess', _60 => _60.cssFramework]))), () => ( "tailwind")),
|
|
170
|
-
semanticAnchors: {
|
|
171
|
-
patterns: _optionalChain([override, 'access', _61 => _61.vault, 'optionalAccess', _62 => _62.semanticAnchors, 'optionalAccess', _63 => _63.patterns]) ? [...override.vault.semanticAnchors.patterns] : _optionalChain([base, 'access', _64 => _64.vault, 'optionalAccess', _65 => _65.semanticAnchors, 'optionalAccess', _66 => _66.patterns]),
|
|
172
|
-
excludeUiClasses: _nullishCoalesce(_nullishCoalesce(_optionalChain([override, 'access', _67 => _67.vault, 'optionalAccess', _68 => _68.semanticAnchors, 'optionalAccess', _69 => _69.excludeUiClasses]), () => ( _optionalChain([base, 'access', _70 => _70.vault, 'optionalAccess', _71 => _71.semanticAnchors, 'optionalAccess', _72 => _72.excludeUiClasses]))), () => ( true))
|
|
173
|
-
},
|
|
174
|
-
polymorphicDecoys: _nullishCoalesce(_nullishCoalesce(_optionalChain([override, 'access', _73 => _73.vault, 'optionalAccess', _74 => _74.polymorphicDecoys]), () => ( _optionalChain([base, 'access', _75 => _75.vault, 'optionalAccess', _76 => _76.polymorphicDecoys]))), () => ( true))
|
|
175
|
-
},
|
|
176
|
-
mangler: {
|
|
177
|
-
minLength: _nullishCoalesce(_nullishCoalesce(_optionalChain([override, 'access', _77 => _77.mangler, 'optionalAccess', _78 => _78.minLength]), () => ( _optionalChain([base, 'access', _79 => _79.mangler, 'optionalAccess', _80 => _80.minLength]))), () => ( 3)),
|
|
178
|
-
reservedIdentifiers: mergeStringArrays(
|
|
179
|
-
_optionalChain([base, 'access', _81 => _81.mangler, 'optionalAccess', _82 => _82.reservedIdentifiers]),
|
|
180
|
-
_optionalChain([override, 'access', _83 => _83.mangler, 'optionalAccess', _84 => _84.reservedIdentifiers])
|
|
181
|
-
),
|
|
182
|
-
excludePrefixes: mergeStringArrays(
|
|
183
|
-
_optionalChain([base, 'access', _85 => _85.mangler, 'optionalAccess', _86 => _86.excludePrefixes]),
|
|
184
|
-
_optionalChain([override, 'access', _87 => _87.mangler, 'optionalAccess', _88 => _88.excludePrefixes])
|
|
185
|
-
),
|
|
186
|
-
excludePatterns: _optionalChain([override, 'access', _89 => _89.mangler, 'optionalAccess', _90 => _90.excludePatterns]) ? [...override.mangler.excludePatterns] : _optionalChain([base, 'access', _91 => _91.mangler, 'optionalAccess', _92 => _92.excludePatterns])
|
|
187
|
-
},
|
|
188
|
-
shield: {
|
|
189
|
-
detectHeadless: _nullishCoalesce(_nullishCoalesce(_optionalChain([override, 'access', _93 => _93.shield, 'optionalAccess', _94 => _94.detectHeadless]), () => ( _optionalChain([base, 'access', _95 => _95.shield, 'optionalAccess', _96 => _96.detectHeadless]))), () => ( false)),
|
|
190
|
-
deterrentMode: _nullishCoalesce(_nullishCoalesce(_optionalChain([override, 'access', _97 => _97.shield, 'optionalAccess', _98 => _98.deterrentMode]), () => ( _optionalChain([base, 'access', _99 => _99.shield, 'optionalAccess', _100 => _100.deterrentMode]))), () => ( "passive"))
|
|
191
|
-
},
|
|
192
|
-
sourcemaps: {
|
|
193
|
-
keepPrivate: _nullishCoalesce(_nullishCoalesce(_optionalChain([override, 'access', _101 => _101.sourcemaps, 'optionalAccess', _102 => _102.keepPrivate]), () => ( _optionalChain([base, 'access', _103 => _103.sourcemaps, 'optionalAccess', _104 => _104.keepPrivate]))), () => ( true)),
|
|
194
|
-
vaultDir: _nullishCoalesce(_nullishCoalesce(_optionalChain([override, 'access', _105 => _105.sourcemaps, 'optionalAccess', _106 => _106.vaultDir]), () => ( _optionalChain([base, 'access', _107 => _107.sourcemaps, 'optionalAccess', _108 => _108.vaultDir]))), () => ( ".unpeek-maps")),
|
|
195
|
-
stripComments: _nullishCoalesce(_nullishCoalesce(_optionalChain([override, 'access', _109 => _109.sourcemaps, 'optionalAccess', _110 => _110.stripComments]), () => ( _optionalChain([base, 'access', _111 => _111.sourcemaps, 'optionalAccess', _112 => _112.stripComments]))), () => ( true))
|
|
196
|
-
},
|
|
197
|
-
next: {
|
|
198
|
-
distDir: _nullishCoalesce(_optionalChain([override, 'access', _113 => _113.next, 'optionalAccess', _114 => _114.distDir]), () => ( _optionalChain([base, 'access', _115 => _115.next, 'optionalAccess', _116 => _116.distDir])))
|
|
199
|
-
},
|
|
200
|
-
vite: {
|
|
201
|
-
outDir: _nullishCoalesce(_optionalChain([override, 'access', _117 => _117.vite, 'optionalAccess', _118 => _118.outDir]), () => ( _optionalChain([base, 'access', _119 => _119.vite, 'optionalAccess', _120 => _120.outDir]))),
|
|
202
|
-
assetsDir: _nullishCoalesce(_optionalChain([override, 'access', _121 => _121.vite, 'optionalAccess', _122 => _122.assetsDir]), () => ( _optionalChain([base, 'access', _123 => _123.vite, 'optionalAccess', _124 => _124.assetsDir])))
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
function findConfigFile(cwd = process.cwd()) {
|
|
207
|
-
const root = cwd ? _path.resolve.call(void 0, cwd) : process.cwd();
|
|
208
|
-
for (const filename of CONFIG_CANDIDATES) {
|
|
209
|
-
const candidate = _path.join.call(void 0, root, filename);
|
|
210
|
-
if (_fs.existsSync.call(void 0, candidate)) {
|
|
211
|
-
return candidate;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
return null;
|
|
215
|
-
}
|
|
216
|
-
function formatErr(err) {
|
|
217
|
-
return err instanceof Error ? err.message : String(err);
|
|
218
|
-
}
|
|
219
|
-
function unwrapDefaultExport(raw) {
|
|
220
|
-
if (isRecord(raw) && "default" in raw && !("framework" in raw) && !("vault" in raw) && !("hotPath" in raw) && !("shield" in raw)) {
|
|
221
|
-
return raw.default;
|
|
222
|
-
}
|
|
223
|
-
return raw;
|
|
224
|
-
}
|
|
225
|
-
function validateAndNormalizeConfig(raw, configPath) {
|
|
226
|
-
if (raw === void 0) {
|
|
227
|
-
return {};
|
|
228
|
-
}
|
|
229
|
-
if (!isRecord(raw)) {
|
|
230
|
-
throw new (0, _chunkR6EBIR3Tcjs.UnpeekError)(
|
|
231
|
-
"ERR_CONFIG_INVALID",
|
|
232
|
-
`Configuration at "${configPath}" must export or contain a JSON object.`
|
|
233
|
-
);
|
|
234
|
-
}
|
|
235
|
-
try {
|
|
236
|
-
return normalizeConfig(raw);
|
|
237
|
-
} catch (err) {
|
|
238
|
-
if (err instanceof _chunkR6EBIR3Tcjs.UnpeekError) throw err;
|
|
239
|
-
throw new (0, _chunkR6EBIR3Tcjs.UnpeekError)(
|
|
240
|
-
"ERR_CONFIG_INVALID",
|
|
241
|
-
`Invalid configuration at "${configPath}": ${formatErr(err)}`,
|
|
242
|
-
{ cause: err }
|
|
243
|
-
);
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
function parseJsonConfig(content, configPath) {
|
|
247
|
-
let parsed;
|
|
248
|
-
try {
|
|
249
|
-
parsed = JSON.parse(content);
|
|
250
|
-
} catch (err) {
|
|
251
|
-
throw new (0, _chunkR6EBIR3Tcjs.UnpeekError)(
|
|
252
|
-
"ERR_CONFIG_INVALID",
|
|
253
|
-
`Failed to parse JSON configuration at "${configPath}": ${formatErr(err)}`,
|
|
254
|
-
{ cause: err }
|
|
255
|
-
);
|
|
256
|
-
}
|
|
257
|
-
return validateAndNormalizeConfig(parsed, configPath);
|
|
258
|
-
}
|
|
259
|
-
async function loadUnpeekConfig(cwd = process.cwd(), explicitConfig) {
|
|
260
|
-
const root = cwd ? _path.resolve.call(void 0, cwd) : process.cwd();
|
|
261
|
-
const configPath = findConfigFile(root);
|
|
262
|
-
let parsedConfig = {};
|
|
263
|
-
if (configPath) {
|
|
264
|
-
const ext = _path.extname.call(void 0, configPath).toLowerCase();
|
|
265
|
-
if (ext === ".json") {
|
|
266
|
-
let content;
|
|
267
|
-
try {
|
|
268
|
-
content = await _fs2.default.promises.readFile(configPath, "utf8");
|
|
269
|
-
} catch (err) {
|
|
270
|
-
throw new (0, _chunkR6EBIR3Tcjs.UnpeekError)(
|
|
271
|
-
"ERR_CONFIG_LOAD",
|
|
272
|
-
`Failed to read configuration at "${configPath}": ${formatErr(err)}`,
|
|
273
|
-
{ cause: err }
|
|
274
|
-
);
|
|
275
|
-
}
|
|
276
|
-
parsedConfig = parseJsonConfig(content, configPath);
|
|
277
|
-
} else {
|
|
278
|
-
let raw;
|
|
279
|
-
try {
|
|
280
|
-
const fileUrl = _url.pathToFileURL.call(void 0, configPath).href;
|
|
281
|
-
const mod = await Promise.resolve().then(() => _interopRequireWildcard(require(fileUrl)));
|
|
282
|
-
raw = isRecord(mod) && "default" in mod ? mod.default : mod;
|
|
283
|
-
if (typeof raw === "function") {
|
|
284
|
-
raw = await raw();
|
|
285
|
-
}
|
|
286
|
-
raw = unwrapDefaultExport(raw);
|
|
287
|
-
} catch (importErr) {
|
|
288
|
-
try {
|
|
289
|
-
const req = _module.createRequire.call(void 0, configPath);
|
|
290
|
-
let cjsRaw = req(configPath);
|
|
291
|
-
cjsRaw = unwrapDefaultExport(cjsRaw);
|
|
292
|
-
if (typeof cjsRaw === "function") {
|
|
293
|
-
cjsRaw = await cjsRaw();
|
|
294
|
-
}
|
|
295
|
-
raw = cjsRaw;
|
|
296
|
-
} catch (e) {
|
|
297
|
-
throw new (0, _chunkR6EBIR3Tcjs.UnpeekError)(
|
|
298
|
-
"ERR_CONFIG_LOAD",
|
|
299
|
-
`Failed to load configuration at "${configPath}": ${formatErr(importErr)}`,
|
|
300
|
-
{ cause: importErr }
|
|
301
|
-
);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
parsedConfig = validateAndNormalizeConfig(_nullishCoalesce(raw, () => ( {})), configPath);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
const baseConfig = mergeUnpeekConfig(DEFAULT_CONFIG, parsedConfig);
|
|
308
|
-
return explicitConfig ? mergeUnpeekConfig(baseConfig, explicitConfig) : baseConfig;
|
|
309
|
-
}
|
|
310
|
-
function resolveUnpeekConfigSync(cwd = process.cwd(), explicitConfig) {
|
|
311
|
-
const root = cwd ? _path.resolve.call(void 0, cwd) : process.cwd();
|
|
312
|
-
const configPath = findConfigFile(root);
|
|
313
|
-
let parsedConfig = {};
|
|
314
|
-
if (configPath) {
|
|
315
|
-
const ext = _path.extname.call(void 0, configPath).toLowerCase();
|
|
316
|
-
if (ext === ".json") {
|
|
317
|
-
let content;
|
|
318
|
-
try {
|
|
319
|
-
content = _fs.readFileSync.call(void 0, configPath, "utf8");
|
|
320
|
-
} catch (err) {
|
|
321
|
-
throw new (0, _chunkR6EBIR3Tcjs.UnpeekError)(
|
|
322
|
-
"ERR_CONFIG_LOAD",
|
|
323
|
-
`Failed to read configuration at "${configPath}": ${formatErr(err)}`,
|
|
324
|
-
{ cause: err }
|
|
325
|
-
);
|
|
326
|
-
}
|
|
327
|
-
parsedConfig = parseJsonConfig(content, configPath);
|
|
328
|
-
} else {
|
|
329
|
-
let raw;
|
|
330
|
-
try {
|
|
331
|
-
const req = _module.createRequire.call(void 0, configPath);
|
|
332
|
-
raw = unwrapDefaultExport(req(configPath));
|
|
333
|
-
if (typeof raw === "function") {
|
|
334
|
-
raw = raw();
|
|
335
|
-
}
|
|
336
|
-
} catch (err) {
|
|
337
|
-
const errCode = isRecord(err) ? err.code : void 0;
|
|
338
|
-
if (errCode === "ERR_REQUIRE_ESM") {
|
|
339
|
-
throw new (0, _chunkR6EBIR3Tcjs.UnpeekError)(
|
|
340
|
-
"ERR_CONFIG_LOAD",
|
|
341
|
-
`Synchronous loading of ESM configuration "${configPath}" is not supported by Node.js require(). Use loadUnpeekConfig() or CommonJS/JSON config format instead.`,
|
|
342
|
-
{ cause: err }
|
|
343
|
-
);
|
|
344
|
-
}
|
|
345
|
-
throw new (0, _chunkR6EBIR3Tcjs.UnpeekError)(
|
|
346
|
-
"ERR_CONFIG_LOAD",
|
|
347
|
-
`Failed to load configuration at "${configPath}": ${formatErr(err)}`,
|
|
348
|
-
{ cause: err }
|
|
349
|
-
);
|
|
350
|
-
}
|
|
351
|
-
parsedConfig = validateAndNormalizeConfig(_nullishCoalesce(raw, () => ( {})), configPath);
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
const baseConfig = mergeUnpeekConfig(DEFAULT_CONFIG, parsedConfig);
|
|
355
|
-
return explicitConfig ? mergeUnpeekConfig(baseConfig, explicitConfig) : baseConfig;
|
|
356
|
-
}
|
|
357
|
-
function defineConfig(config) {
|
|
358
|
-
return config;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
exports.CONFIG_CANDIDATES = CONFIG_CANDIDATES; exports.DEFAULT_CONFIG = DEFAULT_CONFIG; exports.normalizeConfig = normalizeConfig; exports.mergeUnpeekConfig = mergeUnpeekConfig; exports.findConfigFile = findConfigFile; exports.loadUnpeekConfig = loadUnpeekConfig; exports.resolveUnpeekConfigSync = resolveUnpeekConfigSync; exports.defineConfig = defineConfig;
|
package/dist/chunk-27HR647Q.js
DELETED
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
detectTargetFramework
|
|
3
|
-
} from "./chunk-5LCMI2TL.js";
|
|
4
|
-
import {
|
|
5
|
-
UnpeekError
|
|
6
|
-
} from "./chunk-S4S2WXGC.js";
|
|
7
|
-
|
|
8
|
-
// src/core/init.ts
|
|
9
|
-
import fs from "fs";
|
|
10
|
-
import path from "path";
|
|
11
|
-
function isPlainObject(val) {
|
|
12
|
-
return typeof val === "object" && val !== null && !Array.isArray(val);
|
|
13
|
-
}
|
|
14
|
-
function detectIndentation(rawJson) {
|
|
15
|
-
const match = rawJson.match(/^[ \t]+(?=["{\[])/m);
|
|
16
|
-
if (!match) return 2;
|
|
17
|
-
const indent = match[0];
|
|
18
|
-
if (indent.includes(" ")) return " ";
|
|
19
|
-
return indent.length;
|
|
20
|
-
}
|
|
21
|
-
function isNext16OrAbove(versionStr) {
|
|
22
|
-
if (!versionStr) return false;
|
|
23
|
-
const clean = versionStr.replace(/^[^\d]*/, "");
|
|
24
|
-
const match = clean.match(/^(\d+)\.(\d+)/);
|
|
25
|
-
if (!match) return false;
|
|
26
|
-
const major = parseInt(match[1], 10);
|
|
27
|
-
const minor = parseInt(match[2], 10);
|
|
28
|
-
if (major > 16) return true;
|
|
29
|
-
if (major === 16 && minor >= 2) return true;
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
var NEXT_CONFIG_FILES = ["next.config.ts", "next.config.mjs", "next.config.js", "next.config.cjs"];
|
|
33
|
-
function wireNextConfig(rootDir, dryRun) {
|
|
34
|
-
let targetFile;
|
|
35
|
-
for (const f of NEXT_CONFIG_FILES) {
|
|
36
|
-
if (fs.existsSync(path.join(rootDir, f))) {
|
|
37
|
-
targetFile = f;
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
if (!targetFile) {
|
|
42
|
-
const defaultMjs = `import { withUnpeek } from 'unpeek/next';
|
|
43
|
-
|
|
44
|
-
/** @type {import('next').NextConfig} */
|
|
45
|
-
const nextConfig = {};
|
|
46
|
-
|
|
47
|
-
export default withUnpeek(nextConfig);
|
|
48
|
-
`;
|
|
49
|
-
if (!dryRun) {
|
|
50
|
-
fs.writeFileSync(path.join(rootDir, "next.config.mjs"), defaultMjs, "utf8");
|
|
51
|
-
}
|
|
52
|
-
return { updated: true, filename: "next.config.mjs" };
|
|
53
|
-
}
|
|
54
|
-
const filePath = path.join(rootDir, targetFile);
|
|
55
|
-
const content = fs.readFileSync(filePath, "utf8");
|
|
56
|
-
if (content.includes("withUnpeek")) {
|
|
57
|
-
return { updated: false, filename: targetFile };
|
|
58
|
-
}
|
|
59
|
-
const isCjs = targetFile.endsWith(".cjs") || targetFile.endsWith(".js") && !content.includes("import ") && !content.includes("export ");
|
|
60
|
-
let modified = content;
|
|
61
|
-
if (isCjs) {
|
|
62
|
-
const importStmt = `const { withUnpeek } = require('unpeek/next');
|
|
63
|
-
`;
|
|
64
|
-
modified = `${importStmt}${modified}`;
|
|
65
|
-
if (/module\.exports\s*=\s*([a-zA-Z0-9_$]+)\s*;?/.test(modified)) {
|
|
66
|
-
modified = modified.replace(/module\.exports\s*=\s*([a-zA-Z0-9_$]+)\s*;?/, "module.exports = withUnpeek($1);");
|
|
67
|
-
} else if (/module\.exports\s*=\s*/.test(modified)) {
|
|
68
|
-
modified = modified.replace(/module\.exports\s*=\s*([\s\S]+?);?\s*$/, "module.exports = withUnpeek($1);");
|
|
69
|
-
}
|
|
70
|
-
} else {
|
|
71
|
-
const importStmt = `import { withUnpeek } from 'unpeek/next';
|
|
72
|
-
`;
|
|
73
|
-
modified = `${importStmt}${modified}`;
|
|
74
|
-
if (/export\s+default\s+([a-zA-Z0-9_$]+)\s*;?/.test(modified)) {
|
|
75
|
-
modified = modified.replace(/export\s+default\s+([a-zA-Z0-9_$]+)\s*;?/, "export default withUnpeek($1);");
|
|
76
|
-
} else if (/export\s+default\s+/.test(modified)) {
|
|
77
|
-
modified = modified.replace(/export\s+default\s+([\s\S]+?);?\s*$/, "export default withUnpeek($1);");
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
if (!dryRun && modified !== content) {
|
|
81
|
-
fs.writeFileSync(filePath, modified, "utf8");
|
|
82
|
-
}
|
|
83
|
-
return { updated: modified !== content, filename: targetFile };
|
|
84
|
-
}
|
|
85
|
-
function initProject(cwd = process.cwd(), options = {}) {
|
|
86
|
-
const dryRun = typeof options === "boolean" ? options : options.dryRun ?? false;
|
|
87
|
-
const rootDir = path.resolve(cwd);
|
|
88
|
-
const { framework } = detectTargetFramework(rootDir);
|
|
89
|
-
const pkgPath = path.join(rootDir, "package.json");
|
|
90
|
-
let updatedPackageJson = false;
|
|
91
|
-
let updatedGitignore = false;
|
|
92
|
-
let updatedNextConfig = false;
|
|
93
|
-
let isNext16 = false;
|
|
94
|
-
let nextVersion;
|
|
95
|
-
let pkg = {};
|
|
96
|
-
let rawPkgContent = "";
|
|
97
|
-
if (fs.existsSync(pkgPath)) {
|
|
98
|
-
rawPkgContent = fs.readFileSync(pkgPath, "utf8");
|
|
99
|
-
let parsed;
|
|
100
|
-
try {
|
|
101
|
-
parsed = JSON.parse(rawPkgContent);
|
|
102
|
-
} catch (err) {
|
|
103
|
-
throw new UnpeekError(
|
|
104
|
-
"ERR_INIT_INVALID_PACKAGE_JSON",
|
|
105
|
-
`Invalid JSON in package.json at "${pkgPath}": ${err instanceof Error ? err.message : String(err)}`,
|
|
106
|
-
{ cause: err }
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
if (!isPlainObject(parsed)) {
|
|
110
|
-
throw new UnpeekError(
|
|
111
|
-
"ERR_INIT_INVALID_PACKAGE_JSON",
|
|
112
|
-
`package.json at "${pkgPath}" must contain a JSON object.`
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
pkg = parsed;
|
|
116
|
-
const deps = isPlainObject(pkg.dependencies) ? pkg.dependencies : void 0;
|
|
117
|
-
const devDeps = isPlainObject(pkg.devDependencies) ? pkg.devDependencies : void 0;
|
|
118
|
-
const rawNext = deps?.next ?? devDeps?.next;
|
|
119
|
-
nextVersion = typeof rawNext === "string" ? rawNext : void 0;
|
|
120
|
-
}
|
|
121
|
-
if (framework === "nextjs" && isNext16OrAbove(nextVersion)) {
|
|
122
|
-
isNext16 = true;
|
|
123
|
-
const configRes = wireNextConfig(rootDir, dryRun);
|
|
124
|
-
updatedNextConfig = configRes.updated;
|
|
125
|
-
} else if (fs.existsSync(pkgPath)) {
|
|
126
|
-
const indent = detectIndentation(rawPkgContent);
|
|
127
|
-
const trailingNewline = rawPkgContent.endsWith("\r\n") ? "\r\n" : rawPkgContent.endsWith("\n") ? "\n" : "";
|
|
128
|
-
const scripts = isPlainObject(pkg.scripts) ? { ...pkg.scripts } : {};
|
|
129
|
-
pkg.scripts = scripts;
|
|
130
|
-
const existingPostbuild = typeof scripts.postbuild === "string" ? scripts.postbuild : void 0;
|
|
131
|
-
if (!existingPostbuild) {
|
|
132
|
-
scripts.postbuild = "unpeek protect";
|
|
133
|
-
updatedPackageJson = true;
|
|
134
|
-
} else if (!existingPostbuild.includes("unpeek protect")) {
|
|
135
|
-
scripts.postbuild = `${existingPostbuild.trim()} && unpeek protect`;
|
|
136
|
-
updatedPackageJson = true;
|
|
137
|
-
}
|
|
138
|
-
if (updatedPackageJson && !dryRun) {
|
|
139
|
-
fs.writeFileSync(pkgPath, `${JSON.stringify(pkg, null, indent)}${trailingNewline}`, "utf8");
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
const gitignorePath = path.join(rootDir, ".gitignore");
|
|
143
|
-
if (fs.existsSync(gitignorePath)) {
|
|
144
|
-
const current = fs.readFileSync(gitignorePath, "utf8");
|
|
145
|
-
const lines = current.split(/\r?\n/).map((line) => line.trim());
|
|
146
|
-
if (!lines.includes(".unpeek-maps/") && !lines.includes(".unpeek-maps")) {
|
|
147
|
-
const prefix = current.length > 0 && !current.endsWith("\n") ? "\n" : "";
|
|
148
|
-
if (!dryRun) {
|
|
149
|
-
fs.writeFileSync(gitignorePath, `${current}${prefix}.unpeek-maps/
|
|
150
|
-
`, "utf8");
|
|
151
|
-
}
|
|
152
|
-
updatedGitignore = true;
|
|
153
|
-
}
|
|
154
|
-
} else {
|
|
155
|
-
if (!dryRun) {
|
|
156
|
-
fs.writeFileSync(gitignorePath, ".unpeek-maps/\n", "utf8");
|
|
157
|
-
}
|
|
158
|
-
updatedGitignore = true;
|
|
159
|
-
}
|
|
160
|
-
let message;
|
|
161
|
-
if (isNext16) {
|
|
162
|
-
if (dryRun) {
|
|
163
|
-
message = `[dry-run] Detected Next.js 16.2+ (${nextVersion}). Would configure withUnpeek adapter in next.config and .unpeek-maps/ vault.`;
|
|
164
|
-
} else if (updatedNextConfig || updatedGitignore) {
|
|
165
|
-
message = `Detected Next.js 16.2+ (${nextVersion}). Initialized unpeek: configured withUnpeek adapter in next.config and .unpeek-maps/ vault.`;
|
|
166
|
-
} else {
|
|
167
|
-
message = `Detected Next.js 16.2+ (${nextVersion}). unpeek is already initialized in this project.`;
|
|
168
|
-
}
|
|
169
|
-
} else {
|
|
170
|
-
if (dryRun) {
|
|
171
|
-
message = `[dry-run] Detected framework: ${framework}. Would configure postbuild hook and .unpeek-maps/ vault.`;
|
|
172
|
-
} else if (updatedPackageJson || updatedGitignore) {
|
|
173
|
-
message = `Detected framework: ${framework}. Initialized unpeek: configured postbuild hook and .unpeek-maps/ vault.`;
|
|
174
|
-
} else {
|
|
175
|
-
message = `Detected framework: ${framework}. unpeek is already initialized in this project.`;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
return {
|
|
179
|
-
updatedPackageJson,
|
|
180
|
-
updatedGitignore,
|
|
181
|
-
updatedNextConfig,
|
|
182
|
-
framework,
|
|
183
|
-
isNext162Plus: isNext16,
|
|
184
|
-
message
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
export {
|
|
189
|
-
initProject
|
|
190
|
-
};
|
package/dist/chunk-4TDLLEEU.cjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
-
}) : x)(function(x) {
|
|
4
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
// ../../node_modules/.pnpm/tsup@9.0.0_jiti@2.7.0_postc_67389378eb6cac6e57778cd40e79e1a8/node_modules/tsup/assets/cjs_shims.js
|
|
9
|
-
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
10
|
-
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
exports.__require = __require; exports.importMetaUrl = importMetaUrl;
|