@navita/core 1.0.1 → 3.0.0-next.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.
@@ -0,0 +1,23 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+ //#endregion
23
+ exports.__toESM = __toESM;
@@ -1,50 +1,51 @@
1
- 'use strict';
2
-
3
- var engine = require('@navita/engine');
4
- var MagicString = require('magic-string');
5
- var evaluateAndProcess = require('./evaluateAndProcess.cjs');
6
-
7
- const resultCache = {};
8
- function createRenderer({ resolver , readFile , importMap =[] , engineOptions , context }) {
9
- const engine$1 = new engine.Engine({
10
- context,
11
- ...engineOptions || {}
12
- });
13
- const clearCache = (filePath)=>{
14
- engine$1.clearCache(filePath);
15
- resultCache[filePath] = [];
16
- };
17
- return {
18
- engine: engine$1,
19
- clearCache,
20
- async transformAndProcess ({ content , filePath }) {
21
- clearCache(filePath);
22
- const { result , dependencies } = await evaluateAndProcess.evaluateAndProcess({
23
- type: 'entryPoint',
24
- source: content,
25
- filePath,
26
- resolver,
27
- readFile,
28
- importMap,
29
- engine: engine$1,
30
- resultCache
31
- });
32
- const newSource = new MagicString(content, {
33
- filename: filePath
34
- });
35
- for (const { start , end , value } of result.reverse()){
36
- newSource.update(start, end, value);
37
- }
38
- return {
39
- result: newSource.toString(),
40
- dependencies,
41
- usedIds: engine$1.getCacheIds([
42
- filePath
43
- ]),
44
- sourceMap: newSource.generateMap()
45
- };
46
- }
47
- };
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
3
+ const require_evaluateAndProcess = require("./evaluateAndProcess.cjs");
4
+ let _navita_engine = require("@navita/engine");
5
+ let magic_string = require("magic-string");
6
+ magic_string = require_runtime.__toESM(magic_string);
7
+ //#region src/createRenderer.ts
8
+ function createRenderer({ resolver, readFile, importMap = [], engineOptions, context }) {
9
+ const engine = new _navita_engine.Engine({
10
+ context,
11
+ ...engineOptions || {}
12
+ });
13
+ const resultCache = {};
14
+ const moduleCache = /* @__PURE__ */ new Map();
15
+ const nodeModuleCache = {};
16
+ const resolverCache = {};
17
+ const clearCache = (filePath) => {
18
+ engine.clearCache(filePath);
19
+ resultCache[filePath] = [];
20
+ };
21
+ return {
22
+ engine,
23
+ clearCache,
24
+ async transformAndProcess({ content, filePath }) {
25
+ clearCache(filePath);
26
+ const { result, dependencies } = await require_evaluateAndProcess.evaluateAndProcess({
27
+ type: "entryPoint",
28
+ source: content,
29
+ filePath,
30
+ resolver,
31
+ readFile,
32
+ importMap,
33
+ engine,
34
+ resultCache,
35
+ moduleCache,
36
+ nodeModuleCache,
37
+ resolverCache
38
+ });
39
+ const newSource = new magic_string.default(content, { filename: filePath });
40
+ for (const { start, end, value } of result.reverse()) newSource.update(start, end, value);
41
+ return {
42
+ result: newSource.toString(),
43
+ dependencies,
44
+ usedIds: engine.getCacheIds([filePath]),
45
+ sourceMap: newSource.generateMap()
46
+ };
47
+ }
48
+ };
48
49
  }
49
-
50
+ //#endregion
50
51
  exports.createRenderer = createRenderer;
@@ -1,29 +1,36 @@
1
- import * as magic_string from 'magic-string';
2
- import { Options as Options$1, Engine, UsedIdCache } from '@navita/engine';
3
- export { Engine, Options as EngineOptions, UsedIdCache } from '@navita/engine';
4
- import { ImportMap } from '@navita/types';
5
- export { ImportMap } from '@navita/types';
1
+ import { Engine, Options as EngineOptions, UsedIdCache } from "@navita/engine";
2
+ import { ImportMap } from "@navita/types";
6
3
 
4
+ //#region src/createRenderer.d.ts
7
5
  interface Options {
8
- resolver: (filepath: string, request: string) => Promise<string>;
9
- readFile: (filepath: string) => Promise<string>;
10
- importMap: ImportMap;
11
- engineOptions?: Options$1;
12
- context?: string;
6
+ resolver: (filepath: string, request: string) => Promise<string>;
7
+ readFile: (filepath: string) => Promise<string>;
8
+ importMap: ImportMap;
9
+ engineOptions?: EngineOptions;
10
+ context?: string;
13
11
  }
14
- declare function createRenderer({ resolver, readFile, importMap, engineOptions, context, }: Options): {
15
- engine: Engine;
16
- clearCache: (filePath: string) => void;
17
- transformAndProcess({ content, filePath, }: {
18
- content: string;
19
- filePath: string;
20
- }): Promise<{
21
- result: string;
22
- dependencies: string[];
23
- usedIds: UsedIdCache;
24
- sourceMap: magic_string.SourceMap;
25
- }>;
12
+ declare function createRenderer({
13
+ resolver,
14
+ readFile,
15
+ importMap,
16
+ engineOptions,
17
+ context
18
+ }: Options): {
19
+ engine: Engine;
20
+ clearCache: (filePath: string) => void;
21
+ transformAndProcess({
22
+ content,
23
+ filePath
24
+ }: {
25
+ content: string;
26
+ filePath: string;
27
+ }): Promise<{
28
+ result: string;
29
+ dependencies: string[];
30
+ usedIds: UsedIdCache;
31
+ sourceMap: import("magic-string").SourceMap;
32
+ }>;
26
33
  };
27
34
  type Renderer = ReturnType<typeof createRenderer>;
28
-
29
- export { Options, Renderer, createRenderer };
35
+ //#endregion
36
+ export { type Engine, type EngineOptions, type ImportMap, Options, Renderer, type UsedIdCache, createRenderer };
@@ -1,48 +1,51 @@
1
- import { Engine } from '@navita/engine';
2
- import MagicString from 'magic-string';
3
- import { evaluateAndProcess } from './evaluateAndProcess.mjs';
4
-
5
- const resultCache = {};
6
- function createRenderer({ resolver , readFile , importMap =[] , engineOptions , context }) {
7
- const engine = new Engine({
8
- context,
9
- ...engineOptions || {}
10
- });
11
- const clearCache = (filePath)=>{
12
- engine.clearCache(filePath);
13
- resultCache[filePath] = [];
14
- };
15
- return {
16
- engine,
17
- clearCache,
18
- async transformAndProcess ({ content , filePath }) {
19
- clearCache(filePath);
20
- const { result , dependencies } = await evaluateAndProcess({
21
- type: 'entryPoint',
22
- source: content,
23
- filePath,
24
- resolver,
25
- readFile,
26
- importMap,
27
- engine,
28
- resultCache
29
- });
30
- const newSource = new MagicString(content, {
31
- filename: filePath
32
- });
33
- for (const { start , end , value } of result.reverse()){
34
- newSource.update(start, end, value);
35
- }
36
- return {
37
- result: newSource.toString(),
38
- dependencies,
39
- usedIds: engine.getCacheIds([
40
- filePath
41
- ]),
42
- sourceMap: newSource.generateMap()
43
- };
44
- }
45
- };
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { evaluateAndProcess } from "./evaluateAndProcess.mjs";
5
+ import { Engine } from "@navita/engine";
6
+ import MagicString from "magic-string";
7
+ //#region src/createRenderer.ts
8
+ function createRenderer({ resolver, readFile, importMap = [], engineOptions, context }) {
9
+ const engine = new Engine({
10
+ context,
11
+ ...engineOptions || {}
12
+ });
13
+ const resultCache = {};
14
+ const moduleCache = /* @__PURE__ */ new Map();
15
+ const nodeModuleCache = {};
16
+ const resolverCache = {};
17
+ const clearCache = (filePath) => {
18
+ engine.clearCache(filePath);
19
+ resultCache[filePath] = [];
20
+ };
21
+ return {
22
+ engine,
23
+ clearCache,
24
+ async transformAndProcess({ content, filePath }) {
25
+ clearCache(filePath);
26
+ const { result, dependencies } = await evaluateAndProcess({
27
+ type: "entryPoint",
28
+ source: content,
29
+ filePath,
30
+ resolver,
31
+ readFile,
32
+ importMap,
33
+ engine,
34
+ resultCache,
35
+ moduleCache,
36
+ nodeModuleCache,
37
+ resolverCache
38
+ });
39
+ const newSource = new MagicString(content, { filename: filePath });
40
+ for (const { start, end, value } of result.reverse()) newSource.update(start, end, value);
41
+ return {
42
+ result: newSource.toString(),
43
+ dependencies,
44
+ usedIds: engine.getCacheIds([filePath]),
45
+ sourceMap: newSource.generateMap()
46
+ };
47
+ }
48
+ };
46
49
  }
47
-
50
+ //#endregion
48
51
  export { createRenderer };
@@ -1,72 +1,68 @@
1
- 'use strict';
2
-
3
- var path = require('node:path');
4
- var swc = require('@navita/swc');
5
- var createCompiledFunction = require('./helpers/createCompiledFunction.cjs');
6
- var createDefineFunction = require('./helpers/createDefineFunction.cjs');
7
- var setAdapter = require('./helpers/setAdapter.cjs');
8
-
9
- const rootDir = path.resolve(__dirname, "../../");
10
- const isExternal = (dependency)=>dependency.startsWith(rootDir) || dependency.includes('node_modules');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
3
+ const require_helpers_createCompiledFunction = require("./helpers/createCompiledFunction.cjs");
4
+ const require_helpers_createDefineFunction = require("./helpers/createDefineFunction.cjs");
5
+ const require_helpers_setAdapter = require("./helpers/setAdapter.cjs");
6
+ let node_path = require("node:path");
7
+ node_path = require_runtime.__toESM(node_path);
8
+ let _navita_extraction = require("@navita/extraction");
9
+ //#region src/evaluateAndProcess.ts
10
+ const rootDir = node_path.default.resolve(__dirname, "../../");
11
+ const isExternal = (dependency) => dependency.startsWith(rootDir) || dependency.includes("node_modules");
11
12
  const defaultNodeModuleCache = {};
12
13
  const defaultResolverCache = {};
13
- const defaultModuleCache = new Map();
14
+ const defaultModuleCache = /* @__PURE__ */ new Map();
14
15
  const defaultResultCache = {};
15
- async function evaluateAndProcess({ type , filePath , source , engine , resolver , readFile , importMap , nodeModuleCache =defaultNodeModuleCache , resolverCache =defaultResolverCache , moduleCache =defaultModuleCache , resultCache =defaultResultCache }) {
16
- const cacheKey = `${filePath}:${type}`;
17
- const compiledFn = await (async ()=>{
18
- if (moduleCache.has(cacheKey)) {
19
- const cache = moduleCache.get(cacheKey);
20
- if (cache.source === source) {
21
- return cache.compiledFn;
22
- }
23
- }
24
- const newSource = await swc.extraction(source, {
25
- filename: filePath,
26
- entryPoint: type === 'entryPoint',
27
- importMap
28
- });
29
- const define = createDefineFunction.createDefineFunction({
30
- filePath,
31
- resolver,
32
- isExternal,
33
- resolverCache,
34
- nodeModuleCache,
35
- setAdapter: ()=>setAdapter.setAdapter({
36
- engine,
37
- resultCache: resultCache
38
- })
39
- }, (dependency)=>readFile(dependency).then((source)=>evaluateAndProcess({
40
- type: 'dependency',
41
- source: source.toString(),
42
- filePath: dependency,
43
- engine,
44
- resolver,
45
- readFile,
46
- importMap,
47
- nodeModuleCache,
48
- resolverCache,
49
- moduleCache
50
- })).then(({ result })=>result));
51
- const compiledFn = createCompiledFunction.createCompiledFunction(`return ${newSource}`, define);
52
- moduleCache.set(cacheKey, {
53
- source,
54
- compiledFn
55
- });
56
- return compiledFn;
57
- })();
58
- return compiledFn().then(({ dependencies , exports })=>{
59
- if (type === 'entryPoint') {
60
- return {
61
- result: resultCache[filePath] || [],
62
- dependencies
63
- };
64
- }
65
- return {
66
- result: exports,
67
- dependencies
68
- };
69
- });
16
+ async function evaluateAndProcess({ type, filePath, source, engine, resolver, readFile, importMap, nodeModuleCache = defaultNodeModuleCache, resolverCache = defaultResolverCache, moduleCache = defaultModuleCache, resultCache = defaultResultCache }) {
17
+ const cacheKey = `${filePath}:${type}`;
18
+ return (await (async () => {
19
+ if (moduleCache.has(cacheKey)) {
20
+ const cache = moduleCache.get(cacheKey);
21
+ if (cache.source === source) return cache.compiledFn;
22
+ }
23
+ const newSource = await (0, _navita_extraction.extraction)(source, {
24
+ filename: filePath,
25
+ entryPoint: type === "entryPoint",
26
+ importMap
27
+ });
28
+ const define = require_helpers_createDefineFunction.createDefineFunction({
29
+ filePath,
30
+ resolver,
31
+ isExternal,
32
+ resolverCache,
33
+ nodeModuleCache,
34
+ setAdapter: () => require_helpers_setAdapter.setAdapter({
35
+ engine,
36
+ resultCache
37
+ })
38
+ }, (dependency) => readFile(dependency).then((source) => evaluateAndProcess({
39
+ type: "dependency",
40
+ source: source.toString(),
41
+ filePath: dependency,
42
+ engine,
43
+ resolver,
44
+ readFile,
45
+ importMap,
46
+ nodeModuleCache,
47
+ resolverCache,
48
+ moduleCache
49
+ })).then(({ result }) => result));
50
+ const compiledFn = require_helpers_createCompiledFunction.createCompiledFunction(`return ${newSource}`, define);
51
+ moduleCache.set(cacheKey, {
52
+ source,
53
+ compiledFn
54
+ });
55
+ return compiledFn;
56
+ })())().then(({ dependencies, exports }) => {
57
+ if (type === "entryPoint") return {
58
+ result: resultCache[filePath] || [],
59
+ dependencies
60
+ };
61
+ return {
62
+ result: exports,
63
+ dependencies
64
+ };
65
+ });
70
66
  }
71
-
67
+ //#endregion
72
68
  exports.evaluateAndProcess = evaluateAndProcess;
@@ -1,44 +1,59 @@
1
- import { Engine } from '@navita/engine';
2
- import { ImportMap } from '@navita/types';
1
+ import { Engine } from "@navita/engine";
2
+ import { ImportMap } from "@navita/types";
3
3
 
4
+ //#region src/helpers/createDefineFunction.d.ts
4
5
  type FilePath$1 = string;
5
6
  type ResolverCache = Record<FilePath$1, unknown>;
6
7
  type NodeModuleCache = Record<FilePath$1, unknown>;
7
-
8
+ //#endregion
9
+ //#region src/helpers/setAdapter.d.ts
8
10
  type FilePath = string;
9
11
  type ResultCache = Record<FilePath, {
10
- start: number;
11
- end: number;
12
- value: string;
12
+ start: number;
13
+ end: number;
14
+ value: string;
13
15
  }[]>;
14
-
16
+ //#endregion
17
+ //#region src/evaluateAndProcess.d.ts
15
18
  type FilePathWithType = string;
16
19
  type ModuleCache = Map<FilePathWithType, {
17
- source: string;
18
- compiledFn: () => Promise<{
19
- dependencies: string[];
20
- exports: Record<string, unknown>;
21
- }>;
20
+ source: string;
21
+ compiledFn: () => Promise<{
22
+ dependencies: string[];
23
+ exports: Record<string, unknown>;
24
+ }>;
22
25
  }>;
23
26
  interface Caches {
24
- nodeModuleCache?: NodeModuleCache;
25
- resolverCache?: ResolverCache;
26
- moduleCache?: ModuleCache;
27
- resultCache?: ResultCache;
27
+ nodeModuleCache?: NodeModuleCache;
28
+ resolverCache?: ResolverCache;
29
+ moduleCache?: ModuleCache;
30
+ resultCache?: ResultCache;
28
31
  }
29
- type Types = 'entryPoint' | 'dependency';
32
+ type Types = "entryPoint" | "dependency";
30
33
  interface Output<Type extends Types> {
31
- result: Type extends 'entryPoint' ? ResultCache[number] : Record<string, unknown>;
32
- dependencies: string[];
34
+ result: Type extends "entryPoint" ? ResultCache[number] : Record<string, unknown>;
35
+ dependencies: string[];
33
36
  }
34
- declare function evaluateAndProcess<Type extends 'entryPoint' | 'dependency'>({ type, filePath, source, engine, resolver, readFile, importMap, nodeModuleCache, resolverCache, moduleCache, resultCache, }: {
35
- source: string;
36
- filePath: string;
37
- type: Type;
38
- engine: Engine;
39
- resolver: (filePath: string, request: string) => Promise<string>;
40
- readFile: (filePath: string) => Promise<string>;
41
- importMap: ImportMap;
37
+ declare function evaluateAndProcess<Type extends "entryPoint" | "dependency">({
38
+ type,
39
+ filePath,
40
+ source,
41
+ engine,
42
+ resolver,
43
+ readFile,
44
+ importMap,
45
+ nodeModuleCache,
46
+ resolverCache,
47
+ moduleCache,
48
+ resultCache
49
+ }: {
50
+ source: string;
51
+ filePath: string;
52
+ type: Type;
53
+ engine: Engine;
54
+ resolver: (filePath: string, request: string) => Promise<string>;
55
+ readFile: (filePath: string) => Promise<string>;
56
+ importMap: ImportMap;
42
57
  } & Caches): Promise<Output<Type>>;
43
-
44
- export { Caches, evaluateAndProcess };
58
+ //#endregion
59
+ export { Caches, evaluateAndProcess };
@@ -1,74 +1,69 @@
1
- import { fileURLToPath as fileURLToPath$1 } from 'url';
2
- const __filename = fileURLToPath$1(import.meta.url);
3
- import { dirname as dirname$1 } from 'path';
4
- const __dirname = dirname$1(__filename);
5
- import path from 'node:path';
6
- import { extraction } from '@navita/swc';
7
- import { createCompiledFunction } from './helpers/createCompiledFunction.mjs';
8
- import { createDefineFunction } from './helpers/createDefineFunction.mjs';
9
- import { setAdapter } from './helpers/setAdapter.mjs';
10
-
11
- const rootDir = path.resolve(__dirname, "../../");
12
- const isExternal = (dependency)=>dependency.startsWith(rootDir) || dependency.includes('node_modules');
1
+ import __tsdown_shims_path from "node:path";
2
+ import __tsdown_shims_url from "node:url";
3
+ const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url);
4
+ const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__);
5
+ import { createCompiledFunction } from "./helpers/createCompiledFunction.mjs";
6
+ import { createDefineFunction } from "./helpers/createDefineFunction.mjs";
7
+ import { setAdapter } from "./helpers/setAdapter.mjs";
8
+ import path from "node:path";
9
+ import { extraction } from "@navita/extraction";
10
+ //#region src/evaluateAndProcess.ts
11
+ const rootDir = path.resolve(__TSDOWN_SHIM_DIRNAME__, "../../");
12
+ const isExternal = (dependency) => dependency.startsWith(rootDir) || dependency.includes("node_modules");
13
13
  const defaultNodeModuleCache = {};
14
14
  const defaultResolverCache = {};
15
- const defaultModuleCache = new Map();
15
+ const defaultModuleCache = /* @__PURE__ */ new Map();
16
16
  const defaultResultCache = {};
17
- async function evaluateAndProcess({ type , filePath , source , engine , resolver , readFile , importMap , nodeModuleCache =defaultNodeModuleCache , resolverCache =defaultResolverCache , moduleCache =defaultModuleCache , resultCache =defaultResultCache }) {
18
- const cacheKey = `${filePath}:${type}`;
19
- const compiledFn = await (async ()=>{
20
- if (moduleCache.has(cacheKey)) {
21
- const cache = moduleCache.get(cacheKey);
22
- if (cache.source === source) {
23
- return cache.compiledFn;
24
- }
25
- }
26
- const newSource = await extraction(source, {
27
- filename: filePath,
28
- entryPoint: type === 'entryPoint',
29
- importMap
30
- });
31
- const define = createDefineFunction({
32
- filePath,
33
- resolver,
34
- isExternal,
35
- resolverCache,
36
- nodeModuleCache,
37
- setAdapter: ()=>setAdapter({
38
- engine,
39
- resultCache: resultCache
40
- })
41
- }, (dependency)=>readFile(dependency).then((source)=>evaluateAndProcess({
42
- type: 'dependency',
43
- source: source.toString(),
44
- filePath: dependency,
45
- engine,
46
- resolver,
47
- readFile,
48
- importMap,
49
- nodeModuleCache,
50
- resolverCache,
51
- moduleCache
52
- })).then(({ result })=>result));
53
- const compiledFn = createCompiledFunction(`return ${newSource}`, define);
54
- moduleCache.set(cacheKey, {
55
- source,
56
- compiledFn
57
- });
58
- return compiledFn;
59
- })();
60
- return compiledFn().then(({ dependencies , exports })=>{
61
- if (type === 'entryPoint') {
62
- return {
63
- result: resultCache[filePath] || [],
64
- dependencies
65
- };
66
- }
67
- return {
68
- result: exports,
69
- dependencies
70
- };
71
- });
17
+ async function evaluateAndProcess({ type, filePath, source, engine, resolver, readFile, importMap, nodeModuleCache = defaultNodeModuleCache, resolverCache = defaultResolverCache, moduleCache = defaultModuleCache, resultCache = defaultResultCache }) {
18
+ const cacheKey = `${filePath}:${type}`;
19
+ return (await (async () => {
20
+ if (moduleCache.has(cacheKey)) {
21
+ const cache = moduleCache.get(cacheKey);
22
+ if (cache.source === source) return cache.compiledFn;
23
+ }
24
+ const newSource = await extraction(source, {
25
+ filename: filePath,
26
+ entryPoint: type === "entryPoint",
27
+ importMap
28
+ });
29
+ const define = createDefineFunction({
30
+ filePath,
31
+ resolver,
32
+ isExternal,
33
+ resolverCache,
34
+ nodeModuleCache,
35
+ setAdapter: () => setAdapter({
36
+ engine,
37
+ resultCache
38
+ })
39
+ }, (dependency) => readFile(dependency).then((source) => evaluateAndProcess({
40
+ type: "dependency",
41
+ source: source.toString(),
42
+ filePath: dependency,
43
+ engine,
44
+ resolver,
45
+ readFile,
46
+ importMap,
47
+ nodeModuleCache,
48
+ resolverCache,
49
+ moduleCache
50
+ })).then(({ result }) => result));
51
+ const compiledFn = createCompiledFunction(`return ${newSource}`, define);
52
+ moduleCache.set(cacheKey, {
53
+ source,
54
+ compiledFn
55
+ });
56
+ return compiledFn;
57
+ })())().then(({ dependencies, exports }) => {
58
+ if (type === "entryPoint") return {
59
+ result: resultCache[filePath] || [],
60
+ dependencies
61
+ };
62
+ return {
63
+ result: exports,
64
+ dependencies
65
+ };
66
+ });
72
67
  }
73
-
68
+ //#endregion
74
69
  export { evaluateAndProcess };