@wyw-in-js/shared 1.1.0 → 2.0.0-alpha.1
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/esm/IVariableContext.js +1 -1
- package/esm/IVariableContext.js.map +1 -1
- package/esm/asyncResolveFallback.js +35 -31
- package/esm/asyncResolveFallback.js.map +1 -1
- package/esm/asyncResolverFactory.js +9 -9
- package/esm/asyncResolverFactory.js.map +1 -1
- package/esm/debugger.js +1 -1
- package/esm/debugger.js.map +1 -1
- package/esm/findPackageJSON.js +60 -68
- package/esm/findPackageJSON.js.map +1 -1
- package/esm/hasEvalMeta.js +2 -2
- package/esm/hasEvalMeta.js.map +1 -1
- package/esm/index.js +11 -10
- package/esm/index.js.map +1 -1
- package/esm/isBoxedPrimitive.js +4 -5
- package/esm/isBoxedPrimitive.js.map +1 -1
- package/esm/logger.js +17 -17
- package/esm/logger.js.map +1 -1
- package/esm/options/isFeatureEnabled.js +22 -27
- package/esm/options/isFeatureEnabled.js.map +1 -1
- package/esm/options/nativeResolverOptions.js +49 -0
- package/esm/options/nativeResolverOptions.js.map +1 -0
- package/esm/options/types.js +1 -1
- package/esm/options/types.js.map +1 -1
- package/esm/slugify.js +47 -49
- package/esm/slugify.js.map +1 -1
- package/esm/types.js +6 -10
- package/esm/types.js.map +1 -1
- package/package.json +12 -10
- package/types/IVariableContext.js +1 -2
- package/types/asyncResolveFallback.js +8 -14
- package/types/asyncResolverFactory.js +1 -5
- package/types/debugger.js +1 -2
- package/types/findPackageJSON.js +13 -17
- package/types/hasEvalMeta.js +1 -4
- package/types/index.d.ts +4 -2
- package/types/index.js +10 -23
- package/types/isBoxedPrimitive.js +1 -4
- package/types/logger.js +7 -14
- package/types/options/isFeatureEnabled.js +3 -7
- package/types/options/nativeResolverOptions.d.ts +4 -0
- package/types/options/nativeResolverOptions.js +55 -0
- package/types/options/types.d.ts +120 -10
- package/types/options/types.js +1 -2
- package/types/slugify.js +1 -4
- package/types/types.d.ts +40 -1
- package/types/types.js +2 -5
- package/esm/babel.js +0 -2
- package/esm/babel.js.map +0 -1
- package/lib/IVariableContext.js +0 -2
- package/lib/IVariableContext.js.map +0 -1
- package/lib/asyncResolveFallback.js +0 -47
- package/lib/asyncResolveFallback.js.map +0 -1
- package/lib/asyncResolverFactory.js +0 -18
- package/lib/asyncResolverFactory.js.map +0 -1
- package/lib/babel.js +0 -2
- package/lib/babel.js.map +0 -1
- package/lib/debugger.js +0 -2
- package/lib/debugger.js.map +0 -1
- package/lib/findPackageJSON.js +0 -81
- package/lib/findPackageJSON.js.map +0 -1
- package/lib/hasEvalMeta.js +0 -10
- package/lib/hasEvalMeta.js.map +0 -1
- package/lib/index.js +0 -81
- package/lib/index.js.map +0 -1
- package/lib/isBoxedPrimitive.js +0 -15
- package/lib/isBoxedPrimitive.js.map +0 -1
- package/lib/logger.js +0 -35
- package/lib/logger.js.map +0 -1
- package/lib/options/isFeatureEnabled.js +0 -37
- package/lib/options/isFeatureEnabled.js.map +0 -1
- package/lib/options/types.js +0 -2
- package/lib/options/types.js.map +0 -1
- package/lib/slugify.js +0 -68
- package/lib/slugify.js.map +0 -1
- package/lib/types.js +0 -16
- package/lib/types.js.map +0 -1
- package/types/babel.d.ts +0 -2
- package/types/babel.js +0 -2
package/esm/options/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"mappings":"","names":[],"sources":["../../src/options/types.ts"],"version":3,"sourcesContent":["import type { IVariableContext } from '../IVariableContext';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype VmContext = Record<string, any>; // It's Context from `vm`\n\nexport type ClassNameSlugVars = {\n dir: string;\n ext: string;\n file: string;\n hash: string;\n index: number;\n name: string;\n title: string;\n};\n\nexport type ClassNameFn = (\n hash: string,\n title: string,\n args: ClassNameSlugVars\n) => string;\n\nexport type VariableNameFn = (context: IVariableContext) => string;\n\nexport type EvaluatorConfig = {\n features: StrictOptions['features'];\n highPriorityPlugins: string[];\n importOverrides?: StrictOptions['importOverrides'];\n onlyExports: string[];\n root?: string;\n};\n\nexport type EvaluatorOptions = {\n ast?: boolean | null;\n configFile?: boolean | null | string;\n env?: Record<string, EvaluatorOptions | null | undefined> | null;\n filename?: string | null;\n inputSourceMap?: object | null;\n overrides?: EvaluatorOptions[] | null;\n plugins?: unknown[] | null;\n presets?: unknown[] | null;\n root?: string | null;\n sourceFileName?: string | null;\n sourceMaps?: boolean | 'both' | 'inline' | null;\n [key: string]: unknown;\n};\n\nexport type TransformEngineOptions = EvaluatorOptions;\n\nexport type EvaluatorAst = unknown;\n\nexport type EvaluatorRuntime = unknown;\n\nexport type Evaluator = (\n evalConfig: EvaluatorOptions,\n ast: EvaluatorAst,\n code: string,\n config: EvaluatorConfig,\n runtime: EvaluatorRuntime\n) => [\n ast: EvaluatorAst,\n code: string,\n imports: Map<string, string[]> | null,\n exports?: string[] | null,\n];\n\nexport type EvalRule = {\n action: Evaluator | 'ignore' | string;\n /**\n * Per-rule Oxc options for the Oxc-first transform path.\n */\n oxcOptions?: OxcOptions;\n test?: RegExp | ((path: string, code: string) => boolean);\n};\n\nexport type FeatureFlag = boolean | string | string[];\n\ntype ImportOverrideMock = {\n /**\n * Replaces resolved import with provided specifier (resolved on prepare/eval stages).\n * Raw `source` stays intact; only resolution target changes.\n */\n mock: string;\n noShake?: never;\n unknown?: never;\n};\n\ntype ImportOverrideNoShake = {\n mock?: never;\n /**\n * Disables tree-shaking for this import by forcing `only=['*']`.\n */\n noShake: true;\n unknown?: never;\n};\n\ntype ImportOverrideUnknown = {\n mock?: never;\n noShake?: never;\n /**\n * Controls behavior when an import reaches eval-time native resolver fallback.\n * - 'warn' (default): warn once per canonical import key.\n * - 'error': throw.\n * - 'allow': no warning, keep load-as-is.\n */\n unknown: 'allow' | 'error' | 'warn';\n};\n\nexport type ImportOverride =\n | ImportOverrideMock\n | ImportOverrideNoShake\n | ImportOverrideUnknown;\n\nexport type ImportOverrides = Record<string, ImportOverride>;\n\nexport type ImportLoaderContext = {\n emitWarning: (message: string) => void;\n filename: string;\n hash: string;\n importer: string;\n query: string;\n readFile: () => string;\n request: string;\n resolved: string;\n toUrl: () => string;\n};\n\nexport type ImportLoader =\n | 'raw'\n | 'url'\n | ((context: ImportLoaderContext) => unknown);\n\nexport type ImportLoaders = Record<string, ImportLoader | false>;\n\nexport type EvalResolverMode = 'bundler' | 'hybrid' | 'native' | 'custom';\n\nexport type EvalRequireMode = 'warn-and-run' | 'error' | 'off';\n\nexport type EvalStrategy = 'execute' | 'hybrid' | 'static';\n\nexport type EvalRuntime = 'nodejs';\n\nexport type EvalErrorMode = 'strict' | 'loose';\n\nexport type EvalResolverKind = 'import' | 'dynamic-import' | 'require';\n\nexport type EvalWarningCode =\n | 'resolve-fallback'\n | 'resolve-error'\n | 'require-fallback'\n | 'require-error'\n | 'dynamic-import'\n | 'eval-error';\n\nexport type EvalWarning = {\n code: EvalWarningCode;\n message: string;\n importer?: string;\n specifier?: string;\n resolved?: string | null;\n callstack?: string[];\n hint?: string;\n};\n\nexport type EvalOptionsV2 = {\n /**\n * Controls how interpolation values are computed.\n * - `execute`: use the build-time evaluator.\n * - `hybrid`: resolve provably static values first, then fall back to the evaluator.\n * - `static`: resolve only provably static values and fail on evaluator fallback.\n */\n strategy?: EvalStrategy;\n /**\n * Runtime used by the build-time evaluator.\n */\n runtime?: EvalRuntime;\n /**\n * Default is `bundler`. `hybrid` is an opt-in mode whose intended\n * precedence is customResolver -> native Oxc resolver -> bundler.\n */\n resolver?: EvalResolverMode;\n customResolver?: (\n specifier: string,\n importer: string,\n kind: EvalResolverKind\n ) => Promise<{ id: string; external?: boolean } | null>;\n customLoader?: (\n id: string\n ) => Promise<{ code: string; map?: unknown; loader?: string } | null>;\n require?: EvalRequireMode; // default: 'warn-and-run'\n errors?: EvalErrorMode; // default: 'strict'\n globals?: Record<string, unknown>;\n onWarn?: (warning: EvalWarning) => void;\n};\n\nexport type TagResolverMeta = {\n resolvedSource?: string;\n sourceFile: string | null | undefined;\n};\n\ntype AllFeatureFlags = {\n dangerousCodeRemover: FeatureFlag;\n globalCache: FeatureFlag;\n happyDOM: FeatureFlag;\n softErrors: FeatureFlag;\n useWeakRefInEval: FeatureFlag;\n};\n\nexport type FeatureFlags<\n TOnly extends keyof AllFeatureFlags = keyof AllFeatureFlags,\n> = Pick<AllFeatureFlags, TOnly>;\n\nexport type CodeRemoverOptions = {\n componentTypes?: Record<string, string[]>;\n hocs?: Record<string, string[]>;\n};\n\nexport type OxcOptions = {\n /**\n * Parser-level Oxc options. The first slice only preserves this contract.\n */\n parser?: Record<string, unknown>;\n /**\n * Resolver-level Oxc options. Bundler-aware resolution remains authoritative\n * unless `eval.resolver` explicitly opts into `hybrid`.\n */\n resolver?: Record<string, unknown>;\n /**\n * Transform-level Oxc options.\n */\n transform?: Record<string, unknown>;\n};\n\nexport type StrictOptions = {\n classNameSlug?: string | ClassNameFn;\n codeRemover?: CodeRemoverOptions;\n conditionNames?: string[];\n displayName: boolean;\n eval?: EvalOptionsV2;\n extensions: string[];\n features: FeatureFlags;\n highPriorityPlugins: string[];\n ignore?: RegExp;\n importLoaders?: ImportLoaders;\n importOverrides?: ImportOverrides;\n /**\n * Per-source map of imported names to statically-known values. Used by\n * the static evaluator when resolving imports from the listed sources.\n *\n * Each entry maps an import source (a package name or absolute file\n * path) to a record of imported names. Each name's value is either:\n * - a function: treated as a pure helper. Called at every CallExpression\n * site whose callee resolves to this binding, with evaluator-resolved\n * args. Result is treated as a static value.\n * - any other value: treated as a literal binding override. Returned\n * wherever the binding is referenced.\n *\n * Trust model is the same as importOverrides / tagResolver: the user\n * vouches that pure helpers are deterministic and that literal\n * overrides reflect the runtime value (or knowingly diverge for\n * prototyping / SSR theming).\n *\n * Example:\n * staticBindings: {\n * '@linaria/core': {\n * cx: (...args) => args.filter(Boolean).join(' '),\n * },\n * '/abs/path/to/theme.ts': {\n * themeVars: { panelBg: '#f00' },\n * },\n * }\n */\n staticBindings?: Record<string, Record<string, unknown>>;\n outputMetadata: boolean;\n overrideContext?: (\n context: Partial<VmContext>,\n filename: string\n ) => Partial<VmContext>;\n /**\n * Oxc-first transform options.\n */\n oxcOptions: OxcOptions;\n rules: EvalRule[];\n tagResolver?: (\n source: string,\n tag: string,\n meta: TagResolverMeta\n ) => string | null;\n evalConsole?: 'warning' | 'pipe';\n variableNameConfig?: 'var' | 'dashes' | 'raw';\n variableNameSlug?: string | VariableNameFn;\n};\n"],"file":"types.js"}
|
package/esm/slugify.js
CHANGED
|
@@ -1,62 +1,60 @@
|
|
|
1
1
|
/* eslint-disable no-plusplus, no-bitwise, default-case, no-param-reassign, prefer-destructuring */
|
|
2
2
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
* This file contains a utility to generate hashes to be used as generated class names
|
|
4
|
+
*/
|
|
6
5
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
* murmurhash2 via https://gist.github.com/raycmorgan/588423
|
|
7
|
+
*/
|
|
10
8
|
function UInt32(str, pos) {
|
|
11
|
-
|
|
9
|
+
return str.charCodeAt(pos++) + (str.charCodeAt(pos++) << 8) + (str.charCodeAt(pos++) << 16) + (str.charCodeAt(pos) << 24);
|
|
12
10
|
}
|
|
13
11
|
function UInt16(str, pos) {
|
|
14
|
-
|
|
12
|
+
return str.charCodeAt(pos++) + (str.charCodeAt(pos++) << 8);
|
|
15
13
|
}
|
|
16
14
|
function Umul32(n, m) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
n |= 0;
|
|
16
|
+
m |= 0;
|
|
17
|
+
const nlo = n & 65535;
|
|
18
|
+
const nhi = n >>> 16;
|
|
19
|
+
return nlo * m + ((nhi * m & 65535) << 16) | 0;
|
|
22
20
|
}
|
|
23
21
|
function doHash(str, seed = 0) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
22
|
+
const m = 1540483477;
|
|
23
|
+
const r = 24;
|
|
24
|
+
let h = seed ^ str.length;
|
|
25
|
+
let length = str.length;
|
|
26
|
+
let currentIndex = 0;
|
|
27
|
+
while (length >= 4) {
|
|
28
|
+
let k = UInt32(str, currentIndex);
|
|
29
|
+
k = Umul32(k, m);
|
|
30
|
+
k ^= k >>> r;
|
|
31
|
+
k = Umul32(k, m);
|
|
32
|
+
h = Umul32(h, m);
|
|
33
|
+
h ^= k;
|
|
34
|
+
currentIndex += 4;
|
|
35
|
+
length -= 4;
|
|
36
|
+
}
|
|
37
|
+
switch (length) {
|
|
38
|
+
case 3:
|
|
39
|
+
h ^= UInt16(str, currentIndex);
|
|
40
|
+
h ^= str.charCodeAt(currentIndex + 2) << 16;
|
|
41
|
+
h = Umul32(h, m);
|
|
42
|
+
break;
|
|
43
|
+
case 2:
|
|
44
|
+
h ^= UInt16(str, currentIndex);
|
|
45
|
+
h = Umul32(h, m);
|
|
46
|
+
break;
|
|
47
|
+
case 1:
|
|
48
|
+
h ^= str.charCodeAt(currentIndex);
|
|
49
|
+
h = Umul32(h, m);
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
h ^= h >>> 13;
|
|
53
|
+
h = Umul32(h, m);
|
|
54
|
+
h ^= h >>> 15;
|
|
55
|
+
return h >>> 0;
|
|
58
56
|
}
|
|
59
57
|
export function slugify(code) {
|
|
60
|
-
|
|
58
|
+
return doHash(code).toString(36);
|
|
61
59
|
}
|
|
62
|
-
//# sourceMappingURL=slugify.js.map
|
|
60
|
+
//# sourceMappingURL=slugify.js.map
|
package/esm/slugify.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"mappings":";;;;;;;AASA,SAAS,OAAO,KAAa,KAAa;AACxC,QACE,IAAI,WAAW,MAAM,IACpB,IAAI,WAAW,MAAM,IAAI,MACzB,IAAI,WAAW,MAAM,IAAI,OACzB,IAAI,WAAW,IAAI,IAAI;;AAI5B,SAAS,OAAO,KAAa,KAAa;AACxC,QAAO,IAAI,WAAW,MAAM,IAAI,IAAI,WAAW,MAAM,IAAI;;AAG3D,SAAS,OAAO,GAAW,GAAW;AACpC,MAAK;AACL,MAAK;CACL,MAAM,MAAM,IAAI;CAChB,MAAM,MAAM,MAAM;AAClB,QAAQ,MAAM,MAAO,MAAM,IAAK,UAAW,MAAO;;AAGpD,SAAS,OAAO,KAAa,OAAO,GAAG;CACrC,MAAM,IAAI;CACV,MAAM,IAAI;CACV,IAAI,IAAI,OAAO,IAAI;CACnB,IAAI,SAAS,IAAI;CACjB,IAAI,eAAe;AAEnB,QAAO,UAAU,GAAG;EAClB,IAAI,IAAI,OAAO,KAAK,aAAa;AAEjC,MAAI,OAAO,GAAG,EAAE;AAChB,OAAK,MAAM;AACX,MAAI,OAAO,GAAG,EAAE;AAEhB,MAAI,OAAO,GAAG,EAAE;AAChB,OAAK;AAEL,kBAAgB;AAChB,YAAU;;AAGZ,SAAQ,QAAR;EACE,KAAK;AACH,QAAK,OAAO,KAAK,aAAa;AAC9B,QAAK,IAAI,WAAW,eAAe,EAAE,IAAI;AACzC,OAAI,OAAO,GAAG,EAAE;AAChB;EAEF,KAAK;AACH,QAAK,OAAO,KAAK,aAAa;AAC9B,OAAI,OAAO,GAAG,EAAE;AAChB;EAEF,KAAK;AACH,QAAK,IAAI,WAAW,aAAa;AACjC,OAAI,OAAO,GAAG,EAAE;AAChB;;AAGJ,MAAK,MAAM;AACX,KAAI,OAAO,GAAG,EAAE;AAChB,MAAK,MAAM;AAEX,QAAO,MAAM;;AAGf,OAAO,SAAS,QAAQ,MAAc;AACpC,QAAO,OAAO,KAAK,CAAC,SAAS,GAAG","names":[],"sources":["../src/slugify.ts"],"version":3,"sourcesContent":["/* eslint-disable no-plusplus, no-bitwise, default-case, no-param-reassign, prefer-destructuring */\n/**\n * This file contains a utility to generate hashes to be used as generated class names\n */\n\n/**\n * murmurhash2 via https://gist.github.com/raycmorgan/588423\n */\n\nfunction UInt32(str: string, pos: number) {\n return (\n str.charCodeAt(pos++) +\n (str.charCodeAt(pos++) << 8) +\n (str.charCodeAt(pos++) << 16) +\n (str.charCodeAt(pos) << 24)\n );\n}\n\nfunction UInt16(str: string, pos: number) {\n return str.charCodeAt(pos++) + (str.charCodeAt(pos++) << 8);\n}\n\nfunction Umul32(n: number, m: number) {\n n |= 0;\n m |= 0;\n const nlo = n & 0xffff;\n const nhi = n >>> 16;\n return (nlo * m + (((nhi * m) & 0xffff) << 16)) | 0;\n}\n\nfunction doHash(str: string, seed = 0) {\n const m = 0x5bd1e995;\n const r = 24;\n let h = seed ^ str.length;\n let length = str.length;\n let currentIndex = 0;\n\n while (length >= 4) {\n let k = UInt32(str, currentIndex);\n\n k = Umul32(k, m);\n k ^= k >>> r;\n k = Umul32(k, m);\n\n h = Umul32(h, m);\n h ^= k;\n\n currentIndex += 4;\n length -= 4;\n }\n\n switch (length) {\n case 3:\n h ^= UInt16(str, currentIndex);\n h ^= str.charCodeAt(currentIndex + 2) << 16;\n h = Umul32(h, m);\n break;\n\n case 2:\n h ^= UInt16(str, currentIndex);\n h = Umul32(h, m);\n break;\n\n case 1:\n h ^= str.charCodeAt(currentIndex);\n h = Umul32(h, m);\n break;\n }\n\n h ^= h >>> 13;\n h = Umul32(h, m);\n h ^= h >>> 15;\n\n return h >>> 0;\n}\n\nexport function slugify(code: string) {\n return doHash(code).toString(36);\n}\n"],"file":"slugify.js"}
|
package/esm/types.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
export let ValueType =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
export let ValueType = /* @__PURE__ */ function(ValueType) {
|
|
2
|
+
ValueType[ValueType["LAZY"] = 0] = "LAZY";
|
|
3
|
+
ValueType[ValueType["FUNCTION"] = 1] = "FUNCTION";
|
|
4
|
+
ValueType[ValueType["CONST"] = 2] = "CONST";
|
|
5
|
+
return ValueType;
|
|
6
6
|
}({});
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* CSS-related types
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=types.js.map
|
|
7
|
+
//# sourceMappingURL=types.js.map
|
package/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"mappings":"AAOA,OAAO,IAAK,YAAL;AACL;AACA;AACA;;KACD","names":[],"sources":["../src/types.ts"],"version":3,"sourcesContent":["export type Artifact = [name: string, data: unknown];\n\nexport type BuildCodeFrameErrorFn = <TError extends Error>(\n msg: string,\n Error?: new (innerMsg: string) => TError\n) => TError;\n\nexport enum ValueType {\n LAZY,\n FUNCTION,\n CONST,\n}\n\nexport type SourceLocation = {\n end: Location;\n filename?: string;\n identifierName?: string | null;\n start: Location;\n};\n\nexport type AstNode = {\n end?: number | null;\n loc?: SourceLocation | null;\n start?: number | null;\n type: string;\n};\n\nexport type AstExpression = AstNode;\n\nexport type Identifier = AstExpression & {\n name: string;\n type: 'Identifier';\n};\n\nexport type StringLiteral = AstExpression & {\n type: 'StringLiteral';\n value: string;\n};\n\nexport type NumericLiteral = AstExpression & {\n type: 'NumericLiteral';\n value: number;\n};\n\nexport type NullLiteral = AstExpression & {\n type: 'NullLiteral';\n};\n\nexport type BooleanLiteral = AstExpression & {\n type: 'BooleanLiteral';\n value: boolean;\n};\n\nexport type BigIntLiteral = AstExpression & {\n type: 'BigIntLiteral';\n value: bigint | string;\n};\n\nexport type DecimalLiteral = AstExpression & {\n type: 'DecimalLiteral';\n value: string;\n};\n\nexport type LazyValue = {\n buildCodeFrameError: BuildCodeFrameErrorFn;\n ex: Identifier;\n importedFrom?: string[];\n kind: ValueType.LAZY;\n source: string;\n};\n\nexport type FunctionValue = {\n buildCodeFrameError: BuildCodeFrameErrorFn;\n ex: Identifier;\n importedFrom?: string[];\n kind: ValueType.FUNCTION;\n source: string;\n};\n\nexport type ConstValue = {\n buildCodeFrameError: BuildCodeFrameErrorFn;\n ex:\n | StringLiteral\n | NumericLiteral\n | NullLiteral\n | BooleanLiteral\n | BigIntLiteral\n | DecimalLiteral;\n kind: ValueType.CONST;\n source: string;\n value: string | number | boolean | null;\n};\n\nexport type ExpressionValue = LazyValue | FunctionValue | ConstValue;\n\nexport type WYWEvalMeta = {\n __wyw_meta: {\n className: string;\n extends: WYWEvalMeta;\n };\n};\n\nexport type Location = {\n column: number;\n line: number;\n};\n\nexport type Replacement = {\n length: number;\n original: { end: Location; start: Location };\n};\n\nexport type Replacements = Array<Replacement>;\n\n/**\n * CSS-related types\n */\n\nexport interface ICSSRule {\n atom?: boolean;\n className: string;\n cssText: string;\n displayName: string;\n start: Location | null | undefined;\n}\n\nexport type Rules = Record<string, ICSSRule>;\n"],"file":"types.js"}
|
package/package.json
CHANGED
|
@@ -1,38 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wyw-in-js/shared",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.1",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"dependencies": {
|
|
5
6
|
"debug": "^4.3.4",
|
|
6
7
|
"find-up": "^5.0.0",
|
|
7
8
|
"minimatch": "^9.0.3"
|
|
8
9
|
},
|
|
9
10
|
"devDependencies": {
|
|
10
|
-
"@babel/types": "^7.23.5",
|
|
11
|
-
"@types/babel__core": "^7.20.5",
|
|
12
11
|
"@types/debug": "^4.1.9",
|
|
13
|
-
"@types/node": "^
|
|
14
|
-
"@wyw-in-js/babel-config": "workspace:*",
|
|
12
|
+
"@types/node": "^22.0.0",
|
|
15
13
|
"@wyw-in-js/eslint-config": "workspace:*",
|
|
16
14
|
"@wyw-in-js/ts-config": "workspace:*",
|
|
17
15
|
"typescript": "^5.2.2"
|
|
18
16
|
},
|
|
19
17
|
"engines": {
|
|
20
|
-
"node": ">=
|
|
18
|
+
"node": ">=22.0.0"
|
|
19
|
+
},
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./types/index.d.ts",
|
|
23
|
+
"default": "./esm/index.js"
|
|
24
|
+
}
|
|
21
25
|
},
|
|
22
26
|
"files": [
|
|
23
27
|
"esm/",
|
|
24
|
-
"lib/",
|
|
25
28
|
"types/"
|
|
26
29
|
],
|
|
27
30
|
"license": "MIT",
|
|
28
|
-
"main": "
|
|
31
|
+
"main": "esm/index.js",
|
|
29
32
|
"module": "esm/index.js",
|
|
30
33
|
"publishConfig": {
|
|
31
34
|
"access": "public"
|
|
32
35
|
},
|
|
33
36
|
"scripts": {
|
|
34
|
-
"build:esm": "
|
|
35
|
-
"build:lib": "cross-env NODE_ENV=legacy babel src --out-dir lib --extensions '.js,.jsx,.ts,.tsx' --source-maps --delete-dir-on-start",
|
|
37
|
+
"build:esm": "node ../../scripts/build-esm-oxc.mjs",
|
|
36
38
|
"build:types": "tsc --project ./tsconfig.lib.json --baseUrl . --rootDir ./src",
|
|
37
39
|
"lint": "eslint --ext .js,.ts .",
|
|
38
40
|
"test": "bun test src"
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.asyncResolveFallback = exports.syncResolve = void 0;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
const nodeRequire = createRequire(import.meta.url);
|
|
8
4
|
const safeResolve = (name, where) => {
|
|
9
5
|
try {
|
|
10
|
-
return
|
|
6
|
+
return nodeRequire.resolve(name, {
|
|
11
7
|
paths: where,
|
|
12
8
|
});
|
|
13
9
|
}
|
|
@@ -20,8 +16,8 @@ const suffixes = ['.js', '.ts', '.jsx', '.tsx'].reduce((acc, ext) => {
|
|
|
20
16
|
acc.push(ext);
|
|
21
17
|
return acc;
|
|
22
18
|
}, []);
|
|
23
|
-
const syncResolve = (what, importer, stack) => {
|
|
24
|
-
const where = [importer, ...stack].map((p) =>
|
|
19
|
+
export const syncResolve = (what, importer, stack) => {
|
|
20
|
+
const where = [importer, ...stack].map((p) => path.dirname(p));
|
|
25
21
|
const resolved = safeResolve(what, where);
|
|
26
22
|
if (!(resolved instanceof Error)) {
|
|
27
23
|
return resolved;
|
|
@@ -37,9 +33,7 @@ const syncResolve = (what, importer, stack) => {
|
|
|
37
33
|
}
|
|
38
34
|
throw resolved;
|
|
39
35
|
};
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
const resolved = (0, exports.syncResolve)(what, importer, stack);
|
|
36
|
+
export const asyncResolveFallback = (what, importer, stack) => {
|
|
37
|
+
const resolved = syncResolve(what, importer, stack);
|
|
43
38
|
return Promise.resolve(resolved);
|
|
44
39
|
};
|
|
45
|
-
exports.asyncResolveFallback = asyncResolveFallback;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.asyncResolverFactory = void 0;
|
|
4
|
-
const asyncResolverFactory = (onResolve, mapper) => {
|
|
1
|
+
export const asyncResolverFactory = (onResolve, mapper) => {
|
|
5
2
|
const memoizedSyncResolve = new WeakMap();
|
|
6
3
|
return (resolveFn) => {
|
|
7
4
|
if (!memoizedSyncResolve.has(resolveFn)) {
|
|
@@ -11,4 +8,3 @@ const asyncResolverFactory = (onResolve, mapper) => {
|
|
|
11
8
|
return memoizedSyncResolve.get(resolveFn);
|
|
12
9
|
};
|
|
13
10
|
};
|
|
14
|
-
exports.asyncResolverFactory = asyncResolverFactory;
|
package/types/debugger.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/types/findPackageJSON.js
CHANGED
|
@@ -1,37 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.findPackageJSON = findPackageJSON;
|
|
7
|
-
const fs_1 = require("fs");
|
|
8
|
-
const path_1 = require("path");
|
|
9
|
-
const find_up_1 = __importDefault(require("find-up"));
|
|
1
|
+
import { readFileSync } from 'fs';
|
|
2
|
+
import { dirname, isAbsolute } from 'path';
|
|
3
|
+
import { createRequire } from 'module';
|
|
4
|
+
import findUp from 'find-up';
|
|
10
5
|
const cache = new Map();
|
|
6
|
+
const nodeRequire = createRequire(import.meta.url);
|
|
11
7
|
function findSelfPackageJSON(pkgName, filename) {
|
|
12
|
-
const packageJSONPath =
|
|
13
|
-
cwd:
|
|
8
|
+
const packageJSONPath = findUp.sync('package.json', {
|
|
9
|
+
cwd: dirname(filename),
|
|
14
10
|
});
|
|
15
11
|
if (!packageJSONPath)
|
|
16
12
|
return undefined;
|
|
17
13
|
try {
|
|
18
|
-
const packageJSON = JSON.parse(
|
|
14
|
+
const packageJSON = JSON.parse(readFileSync(packageJSONPath, 'utf8'));
|
|
19
15
|
return packageJSON?.name === pkgName ? packageJSONPath : undefined;
|
|
20
16
|
}
|
|
21
17
|
catch {
|
|
22
18
|
return undefined;
|
|
23
19
|
}
|
|
24
20
|
}
|
|
25
|
-
function findPackageJSON(pkgName, filename) {
|
|
21
|
+
export function findPackageJSON(pkgName, filename) {
|
|
26
22
|
// Jest's resolver does not work properly with `moduleNameMapper` when `paths` are defined
|
|
27
23
|
const isJest = Boolean(globalThis.process?.env?.JEST_WORKER_ID);
|
|
28
24
|
const skipPathsOptions = isJest && !pkgName.startsWith('.');
|
|
29
25
|
try {
|
|
30
|
-
const pkgPath = pkgName === '.' && filename &&
|
|
26
|
+
const pkgPath = pkgName === '.' && filename && isAbsolute(filename)
|
|
31
27
|
? filename
|
|
32
|
-
:
|
|
28
|
+
: nodeRequire.resolve(pkgName, filename ? { paths: [dirname(filename)] } : {});
|
|
33
29
|
if (!cache.has(pkgPath)) {
|
|
34
|
-
cache.set(pkgPath,
|
|
30
|
+
cache.set(pkgPath, findUp.sync('package.json', { cwd: pkgPath }));
|
|
35
31
|
}
|
|
36
32
|
return cache.get(pkgPath);
|
|
37
33
|
}
|
|
@@ -52,7 +48,7 @@ function findPackageJSON(pkgName, filename) {
|
|
|
52
48
|
try {
|
|
53
49
|
const resolved = bun.resolveSync(pkgName, filename);
|
|
54
50
|
if (!cache.has(resolved)) {
|
|
55
|
-
cache.set(resolved,
|
|
51
|
+
cache.set(resolved, findUp.sync('package.json', {
|
|
56
52
|
cwd: resolved,
|
|
57
53
|
}));
|
|
58
54
|
}
|
package/types/hasEvalMeta.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hasEvalMeta = hasEvalMeta;
|
|
4
|
-
function hasEvalMeta(value) {
|
|
1
|
+
export function hasEvalMeta(value) {
|
|
5
2
|
return typeof value === 'object' && value !== null && '__wyw_meta' in value;
|
|
6
3
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -6,8 +6,10 @@ export { findPackageJSON } from './findPackageJSON';
|
|
|
6
6
|
export { isBoxedPrimitive } from './isBoxedPrimitive';
|
|
7
7
|
export { enableDebug, logger } from './logger';
|
|
8
8
|
export { isFeatureEnabled } from './options/isFeatureEnabled';
|
|
9
|
+
export { mergeOxcResolverAlias, toNativeResolverAlias, } from './options/nativeResolverOptions';
|
|
10
|
+
export type { NativeResolverAlias } from './options/nativeResolverOptions';
|
|
9
11
|
export { slugify } from './slugify';
|
|
10
12
|
export { ValueType } from './types';
|
|
11
13
|
export type { IVariableContext } from './IVariableContext';
|
|
12
|
-
export type { ClassNameSlugVars, ClassNameFn, CodeRemoverOptions, ImportLoader, ImportLoaderContext, ImportLoaders, ImportOverride, ImportOverrides, TagResolverMeta, StrictOptions, EvalRule, Evaluator, FeatureFlag, EvaluatorConfig, FeatureFlags, VariableNameFn, } from './options/types';
|
|
13
|
-
export type { Artifact, BuildCodeFrameErrorFn, ConstValue, ExpressionValue, FunctionValue, ICSSRule, LazyValue, Location, Replacement, Replacements, Rules, WYWEvalMeta, } from './types';
|
|
14
|
+
export type { ClassNameSlugVars, ClassNameFn, CodeRemoverOptions, EvalErrorMode, EvalOptionsV2, EvalRequireMode, EvalResolverKind, EvalResolverMode, EvalRuntime, EvalStrategy, EvalWarning, EvalWarningCode, ImportLoader, ImportLoaderContext, ImportLoaders, ImportOverride, ImportOverrides, OxcOptions, TagResolverMeta, StrictOptions, EvalRule, EvaluatorOptions, TransformEngineOptions, Evaluator, FeatureFlag, EvaluatorConfig, FeatureFlags, VariableNameFn, } from './options/types';
|
|
15
|
+
export type { Artifact, AstExpression, AstNode, BigIntLiteral, BooleanLiteral, BuildCodeFrameErrorFn, ConstValue, DecimalLiteral, ExpressionValue, FunctionValue, Identifier, ICSSRule, LazyValue, Location, NullLiteral, NumericLiteral, Replacement, Replacements, Rules, SourceLocation, StringLiteral, WYWEvalMeta, } from './types';
|
package/types/index.js
CHANGED
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var findPackageJSON_1 = require("./findPackageJSON");
|
|
12
|
-
Object.defineProperty(exports, "findPackageJSON", { enumerable: true, get: function () { return findPackageJSON_1.findPackageJSON; } });
|
|
13
|
-
var isBoxedPrimitive_1 = require("./isBoxedPrimitive");
|
|
14
|
-
Object.defineProperty(exports, "isBoxedPrimitive", { enumerable: true, get: function () { return isBoxedPrimitive_1.isBoxedPrimitive; } });
|
|
15
|
-
var logger_1 = require("./logger");
|
|
16
|
-
Object.defineProperty(exports, "enableDebug", { enumerable: true, get: function () { return logger_1.enableDebug; } });
|
|
17
|
-
Object.defineProperty(exports, "logger", { enumerable: true, get: function () { return logger_1.logger; } });
|
|
18
|
-
var isFeatureEnabled_1 = require("./options/isFeatureEnabled");
|
|
19
|
-
Object.defineProperty(exports, "isFeatureEnabled", { enumerable: true, get: function () { return isFeatureEnabled_1.isFeatureEnabled; } });
|
|
20
|
-
var slugify_1 = require("./slugify");
|
|
21
|
-
Object.defineProperty(exports, "slugify", { enumerable: true, get: function () { return slugify_1.slugify; } });
|
|
22
|
-
var types_1 = require("./types");
|
|
23
|
-
Object.defineProperty(exports, "ValueType", { enumerable: true, get: function () { return types_1.ValueType; } });
|
|
1
|
+
export { asyncResolveFallback, syncResolve } from './asyncResolveFallback';
|
|
2
|
+
export { asyncResolverFactory } from './asyncResolverFactory';
|
|
3
|
+
export { hasEvalMeta } from './hasEvalMeta';
|
|
4
|
+
export { findPackageJSON } from './findPackageJSON';
|
|
5
|
+
export { isBoxedPrimitive } from './isBoxedPrimitive';
|
|
6
|
+
export { enableDebug, logger } from './logger';
|
|
7
|
+
export { isFeatureEnabled } from './options/isFeatureEnabled';
|
|
8
|
+
export { mergeOxcResolverAlias, toNativeResolverAlias, } from './options/nativeResolverOptions';
|
|
9
|
+
export { slugify } from './slugify';
|
|
10
|
+
export { ValueType } from './types';
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// There is a problem with using boxed numbers and strings in TS,
|
|
3
2
|
// so we cannot just use `instanceof` here
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.isBoxedPrimitive = isBoxedPrimitive;
|
|
6
3
|
const constructors = ['Number', 'String'];
|
|
7
|
-
function isBoxedPrimitive(o) {
|
|
4
|
+
export function isBoxedPrimitive(o) {
|
|
8
5
|
if (typeof o !== 'object' || o === null)
|
|
9
6
|
return false;
|
|
10
7
|
return (constructors.includes(o.constructor.name) &&
|
package/types/logger.js
CHANGED
|
@@ -1,33 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.logger = void 0;
|
|
7
|
-
exports.enableDebug = enableDebug;
|
|
8
|
-
const debug_1 = __importDefault(require("debug"));
|
|
1
|
+
import genericDebug from 'debug';
|
|
9
2
|
const BASE_NAMESPACE = 'wyw-in-js';
|
|
10
|
-
|
|
3
|
+
export const logger = genericDebug(BASE_NAMESPACE);
|
|
11
4
|
const loggers = new Map();
|
|
12
5
|
function gerOrCreate(namespace) {
|
|
13
6
|
if (!namespace)
|
|
14
|
-
return
|
|
7
|
+
return logger;
|
|
15
8
|
const lastIndexOf = namespace.lastIndexOf(':');
|
|
16
9
|
if (!loggers.has(namespace)) {
|
|
17
10
|
loggers.set(namespace, gerOrCreate(namespace.substring(0, lastIndexOf)).extend(namespace.substring(lastIndexOf + 1)));
|
|
18
11
|
}
|
|
19
12
|
return loggers.get(namespace);
|
|
20
13
|
}
|
|
21
|
-
|
|
14
|
+
genericDebug.formatters.r = (ref) => {
|
|
22
15
|
const namespace = typeof ref === 'string' ? ref : ref.namespace;
|
|
23
16
|
const text = typeof ref === 'string' ? namespace : ref.text ?? namespace;
|
|
24
17
|
const color = parseInt(gerOrCreate(namespace).color, 10);
|
|
25
18
|
const colorCode = `\u001B[3${color < 8 ? color : `8;5;${color}`}`;
|
|
26
19
|
return `${colorCode};1m${text}\u001B[0m`;
|
|
27
20
|
};
|
|
28
|
-
|
|
21
|
+
genericDebug.formatters.f = function f(fn) {
|
|
29
22
|
return JSON.stringify(fn());
|
|
30
23
|
};
|
|
31
|
-
function enableDebug(namespace = `${BASE_NAMESPACE}:*`) {
|
|
32
|
-
|
|
24
|
+
export function enableDebug(namespace = `${BASE_NAMESPACE}:*`) {
|
|
25
|
+
genericDebug.enable(namespace);
|
|
33
26
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isFeatureEnabled = void 0;
|
|
4
|
-
const minimatch_1 = require("minimatch");
|
|
1
|
+
import { Minimatch } from 'minimatch';
|
|
5
2
|
const cachedMatchers = new Map();
|
|
6
|
-
const isFeatureEnabled = (features, featureName, filename) => {
|
|
3
|
+
export const isFeatureEnabled = (features, featureName, filename) => {
|
|
7
4
|
const value = features?.[featureName] ?? false;
|
|
8
5
|
if (typeof value === 'boolean') {
|
|
9
6
|
return value;
|
|
@@ -20,11 +17,10 @@ const isFeatureEnabled = (features, featureName, filename) => {
|
|
|
20
17
|
.map((pattern) => {
|
|
21
18
|
let matcher = cachedMatchers.get(pattern);
|
|
22
19
|
if (!matcher) {
|
|
23
|
-
matcher = [pattern.startsWith('!'), new
|
|
20
|
+
matcher = [pattern.startsWith('!'), new Minimatch(pattern)];
|
|
24
21
|
cachedMatchers.set(pattern, matcher);
|
|
25
22
|
}
|
|
26
23
|
return [matcher[0], matcher[1].match(filename)];
|
|
27
24
|
})
|
|
28
25
|
.reduce((acc, [negated, match]) => (negated ? acc && match : acc || match), false);
|
|
29
26
|
};
|
|
30
|
-
exports.isFeatureEnabled = isFeatureEnabled;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { OxcOptions } from './types';
|
|
2
|
+
export type NativeResolverAlias = Record<string, Array<string | undefined | null>>;
|
|
3
|
+
export declare const toNativeResolverAlias: (alias: unknown) => NativeResolverAlias;
|
|
4
|
+
export declare const mergeOxcResolverAlias: (oxcOptions: OxcOptions | undefined, bundlerAlias: NativeResolverAlias) => OxcOptions | undefined;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
const isNativeResolverAlias = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
2
|
+
const toAliasTargets = (replacement) => {
|
|
3
|
+
if (typeof replacement === 'string') {
|
|
4
|
+
return [replacement];
|
|
5
|
+
}
|
|
6
|
+
if (Array.isArray(replacement) &&
|
|
7
|
+
replacement.every((item) => typeof item === 'string')) {
|
|
8
|
+
return replacement;
|
|
9
|
+
}
|
|
10
|
+
return null;
|
|
11
|
+
};
|
|
12
|
+
export const toNativeResolverAlias = (alias) => {
|
|
13
|
+
const nativeAlias = {};
|
|
14
|
+
const entries = Array.isArray(alias)
|
|
15
|
+
? alias
|
|
16
|
+
: isNativeResolverAlias(alias)
|
|
17
|
+
? Object.entries(alias).map(([find, replacement]) => ({
|
|
18
|
+
find,
|
|
19
|
+
replacement,
|
|
20
|
+
}))
|
|
21
|
+
: [];
|
|
22
|
+
entries.forEach((rawEntry) => {
|
|
23
|
+
if (!isNativeResolverAlias(rawEntry)) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const entry = rawEntry;
|
|
27
|
+
const find = 'find' in entry ? entry.find : entry.name;
|
|
28
|
+
const replacement = 'replacement' in entry ? entry.replacement : entry.alias;
|
|
29
|
+
const targets = toAliasTargets(replacement);
|
|
30
|
+
if (typeof find !== 'string' || !targets) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
nativeAlias[find] = targets;
|
|
34
|
+
});
|
|
35
|
+
return nativeAlias;
|
|
36
|
+
};
|
|
37
|
+
export const mergeOxcResolverAlias = (oxcOptions, bundlerAlias) => {
|
|
38
|
+
if (Object.keys(bundlerAlias).length === 0) {
|
|
39
|
+
return oxcOptions;
|
|
40
|
+
}
|
|
41
|
+
const resolver = oxcOptions?.resolver ?? {};
|
|
42
|
+
const configuredAlias = isNativeResolverAlias(resolver.alias)
|
|
43
|
+
? resolver.alias
|
|
44
|
+
: {};
|
|
45
|
+
return {
|
|
46
|
+
...oxcOptions,
|
|
47
|
+
resolver: {
|
|
48
|
+
...resolver,
|
|
49
|
+
alias: {
|
|
50
|
+
...bundlerAlias,
|
|
51
|
+
...configuredAlias,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
};
|