xanix 1.0.19 → 1.0.21
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/dist/bin/bundler/cache/buildCache.js +9 -11
- package/dist/bin/bundler/cache/index.js +70 -116
- package/dist/bin/bundler/cache/utils.d.ts +3 -2
- package/dist/bin/bundler/cache/utils.js +27 -24
- package/dist/bin/bundler/client/build.js +1 -1
- package/dist/bin/bundler/client/plugins/Transformer/TransformCacheFunction copy.d.ts +3 -0
- package/dist/bin/bundler/client/plugins/Transformer/TransformCacheFunction copy.js +32 -0
- package/dist/bin/bundler/client/plugins/Transformer/TransformCacheFunction.d.ts +1 -1
- package/dist/bin/bundler/client/plugins/Transformer/TransformCacheFunction.js +1 -1
- package/dist/bin/bundler/client/plugins/Transformer/TransformCreateSession.d.ts +1 -1
- package/dist/bin/bundler/client/plugins/Transformer/TransformCreateSession.js +1 -1
- package/dist/bin/bundler/client/plugins/Transformer/TransformDevModule.d.ts +13 -0
- package/dist/bin/bundler/client/plugins/Transformer/{transformModuleCache.js → TransformDevModule.js} +6 -18
- package/dist/bin/bundler/client/plugins/Transformer/TransformServerFunction.d.ts +1 -1
- package/dist/bin/bundler/client/plugins/Transformer/TransformServerFunction.js +1 -1
- package/dist/bin/bundler/client/plugins/Transformer/cacheFunctionReplacer.d.ts +3 -0
- package/dist/bin/bundler/client/plugins/Transformer/cacheFunctionReplacer.js +32 -0
- package/dist/bin/bundler/client/plugins/Transformer/cacheFunctionTransformer.d.ts +3 -0
- package/dist/bin/bundler/client/plugins/Transformer/cacheFunctionTransformer.js +32 -0
- package/dist/bin/bundler/client/plugins/Transformer/serverFunctionReplacer.d.ts +3 -0
- package/dist/bin/bundler/client/plugins/Transformer/serverFunctionReplacer.js +32 -0
- package/dist/bin/bundler/client/plugins/Transformer/useServerReplacer.d.ts +3 -0
- package/dist/bin/bundler/client/plugins/Transformer/useServerReplacer.js +42 -0
- package/dist/bin/bundler/client/plugins/Transformer.js +4 -2
- package/dist/bin/bundler/client/plugins/XanixAppRoot.d.ts +2 -0
- package/dist/bin/bundler/client/plugins/XanixAppRoot.js +46 -0
- package/dist/bin/bundler/client/plugins/XanixPage.js +30 -0
- package/dist/bin/bundler/client/plugins/XanixPages.js +8 -8
- package/dist/bin/bundler/client/plugins/replacer/cacheFunctionReplacer.d.ts +1 -1
- package/dist/bin/bundler/client/plugins/replacer/cacheFunctionReplacer.js +5 -1
- package/dist/bin/bundler/client/plugins/replacer/serverFunctionReplacer.d.ts +1 -1
- package/dist/bin/bundler/client/plugins/replacer/serverFunctionReplacer.js +5 -1
- package/dist/bin/bundler/client/plugins/replacer/useServerReplacer.d.ts +1 -1
- package/dist/bin/bundler/client/plugins/replacer/useServerReplacer.js +7 -3
- package/dist/bin/bundler/server/build.js +1 -1
- package/dist/bin/bundler/server/plugins/Transformer/TransformCacheFunction copy.d.ts +3 -0
- package/dist/bin/bundler/server/plugins/Transformer/TransformCacheFunction copy.js +32 -0
- package/dist/bin/bundler/server/plugins/Transformer/TransformCacheFunction.d.ts +1 -1
- package/dist/bin/bundler/server/plugins/Transformer/TransformCacheFunction.js +1 -1
- package/dist/bin/bundler/server/plugins/Transformer/TransformCreateSession.d.ts +1 -1
- package/dist/bin/bundler/server/plugins/Transformer/TransformCreateSession.js +1 -1
- package/dist/bin/bundler/server/plugins/Transformer/TransformExpressFunction.d.ts +1 -1
- package/dist/bin/bundler/server/plugins/Transformer/TransformExpressFunction.js +1 -1
- package/dist/bin/bundler/server/plugins/Transformer/TransformPage.js +1 -1
- package/dist/bin/bundler/server/plugins/Transformer/TransformServerFunction.d.ts +1 -1
- package/dist/bin/bundler/server/plugins/Transformer/TransformServerFunction.js +1 -1
- package/dist/bin/bundler/server/plugins/Transformer/cacheFunctionReplacer.d.ts +3 -0
- package/dist/bin/bundler/server/plugins/Transformer/cacheFunctionReplacer.js +32 -0
- package/dist/bin/bundler/server/plugins/Transformer/expressFunctionReplace.d.ts +3 -0
- package/dist/bin/bundler/server/plugins/Transformer/expressFunctionReplace.js +24 -0
- package/dist/bin/bundler/server/plugins/Transformer/pageReplacer.d.ts +4 -0
- package/dist/bin/bundler/server/plugins/Transformer/pageReplacer.js +31 -0
- package/dist/bin/bundler/server/plugins/Transformer/serverFunctionReplacer.d.ts +3 -0
- package/dist/bin/bundler/server/plugins/Transformer/serverFunctionReplacer.js +32 -0
- package/dist/bin/bundler/server/plugins/Transformer/useServerReplacer.d.ts +3 -0
- package/dist/bin/bundler/server/plugins/Transformer/useServerReplacer.js +42 -0
- package/dist/bin/bundler/server/plugins/Transformer copy.js +3 -3
- package/dist/bin/bundler/server/plugins/Transformer.js +2 -2
- package/dist/bin/bundler/server/plugins/replacer/cacheFunctionReplacer.d.ts +1 -1
- package/dist/bin/bundler/server/plugins/replacer/cacheFunctionReplacer.js +5 -1
- package/dist/bin/bundler/server/plugins/replacer/serverFunctionReplacer copy.d.ts +3 -0
- package/dist/bin/bundler/server/plugins/replacer/serverFunctionReplacer copy.js +26 -0
- package/dist/bin/bundler/server/plugins/replacer/serverFunctionReplacer.d.ts +1 -1
- package/dist/bin/bundler/server/plugins/replacer/serverFunctionReplacer.js +5 -1
- package/dist/bin/bundler/server/plugins/replacer/serverReplacer.d.ts +3 -0
- package/dist/bin/bundler/server/plugins/replacer/serverReplacer.js +26 -0
- package/dist/bin/bundler/server/plugins/replacer/useServerReplacer.d.ts +2 -2
- package/dist/bin/bundler/server/plugins/replacer/useServerReplacer.js +9 -5
- package/dist/bin/cli/dev.js +85 -71
- package/dist/bin/cli/start/index.d.ts +4 -1
- package/dist/bin/cli/start/index.js +60 -9
- package/dist/bin/finder/callbackReplacer.d.ts +2 -0
- package/dist/bin/finder/callbackReplacer.js +52 -0
- package/dist/bin/finder/findImport.d.ts +9 -0
- package/dist/bin/finder/findImport.js +50 -0
- package/dist/bin/finder/findImports.d.ts +16 -0
- package/dist/bin/finder/findImports.js +45 -0
- package/dist/bin/finder/findPage.d.ts +9 -0
- package/dist/bin/finder/findPage.js +30 -0
- package/dist/bin/finder/importFinder.d.ts +9 -0
- package/dist/bin/finder/importFinder.js +50 -0
- package/dist/bin/finder/pageFinder.d.ts +9 -0
- package/dist/bin/finder/pageFinder.js +30 -0
- package/dist/bin/finder/stripComments.d.ts +3 -0
- package/dist/bin/finder/stripComments.js +15 -0
- package/dist/bin/include/path.d.ts +5 -1
- package/dist/bin/include/path.js +15 -1
- package/dist/bin/include/sendFinder.d.ts +4 -1
- package/dist/bin/include/sendFinder.js +88 -53
- package/dist/bin/index.js +0 -0
- package/dist/bin/modifier/callbackReplacer.js +35 -80
- package/dist/bin/modifier/findImports.d.ts +16 -0
- package/dist/bin/modifier/findImports.js +45 -0
- package/dist/bin/modifier/importFinder.js +44 -63
- package/dist/bin/modifier/pageFinder.d.ts +1 -1
- package/dist/bin/modifier/pageFinder.js +19 -124
- package/dist/bin/modifier/sendFinder.d.ts +9 -0
- package/dist/bin/modifier/sendFinder.js +135 -0
- package/dist/bin/modifier/sriptCommnet.d.ts +1 -0
- package/dist/bin/modifier/sriptCommnet.js +12 -5
- package/dist/bin/modifier/stripComments.d.ts +3 -0
- package/dist/bin/modifier/stripComments.js +15 -0
- package/dist/bin/plugins/XanixAssets.js +2 -2
- package/dist/bin/plugins/XanixCss.js +13 -13
- package/dist/bin/plugins/XanixDocument.js +4 -4
- package/dist/components/Head.js +1 -1
- package/dist/hooks/encript.d.ts +2 -0
- package/dist/hooks/encript.js +13 -0
- package/dist/hooks/server.js +2 -2
- package/dist/hooks/session.js +2 -2
- package/dist/index.js +0 -0
- package/dist/libs/encoder.d.ts +2 -0
- package/dist/libs/encoder.js +13 -0
- package/dist/libs/encript.d.ts +2 -0
- package/dist/libs/encript.js +30 -0
- package/dist/navigate.js +1 -1
- package/dist/server/express/Router.js +4 -4
- package/dist/server/express/page.d.ts +1 -1
- package/dist/server/express/page.js +1 -1
- package/dist/types/assets.d.ts +72 -72
- package/dist/types/express.d.ts +11 -11
- package/dist/types/globals.d.ts +18 -18
- package/dist/types/xanix-virtual.d.ts +35 -35
- package/package.json +57 -60
- package/dist/bin/bundler/Cache.d.ts +0 -1
- package/dist/bin/bundler/Cache.js +0 -210
- package/dist/bin/bundler/External.d.ts +0 -3
- package/dist/bin/bundler/External.js +0 -6
- package/dist/bin/bundler/buildClient.d.ts +0 -3
- package/dist/bin/bundler/buildClient.js +0 -42
- package/dist/bin/bundler/buildServer.d.ts +0 -7
- package/dist/bin/bundler/buildServer.js +0 -50
- package/dist/bin/bundler/cache/plugin/Transformer.d.ts +0 -3
- package/dist/bin/bundler/cache/plugin/Transformer.js +0 -42
- package/dist/bin/bundler/client/plugins/Transformer/TransformExpress.d.ts +0 -9
- package/dist/bin/bundler/client/plugins/Transformer/TransformExpress.js +0 -26
- package/dist/bin/bundler/client/plugins/Transformer/TransformPage.d.ts +0 -29
- package/dist/bin/bundler/client/plugins/Transformer/TransformPage.js +0 -77
- package/dist/bin/bundler/client/plugins/Transformer/TransformReactContext.d.ts +0 -17
- package/dist/bin/bundler/client/plugins/Transformer/TransformReactContext.js +0 -101
- package/dist/bin/bundler/client/plugins/Transformer/transformModuleCache.d.ts +0 -15
- package/dist/bin/bundler/client/plugins/Transformer copy.d.ts +0 -3
- package/dist/bin/bundler/client/plugins/Transformer copy.js +0 -70
- package/dist/bin/bundler/client/plugins/VirtualDev.d.ts +0 -2
- package/dist/bin/bundler/client/plugins/VirtualDev.js +0 -34
- package/dist/bin/bundler/client/plugins/XanixReactRefresh.d.ts +0 -2
- package/dist/bin/bundler/client/plugins/XanixReactRefresh.js +0 -22
- package/dist/bin/bundler/config/defines.d.ts +0 -20
- package/dist/bin/bundler/config/defines.js +0 -21
- package/dist/bin/bundler/config/external.d.ts +0 -1
- package/dist/bin/bundler/config/external.js +0 -12
- package/dist/bin/bundler/config/loadEnv.d.ts +0 -20
- package/dist/bin/bundler/config/loadEnv.js +0 -48
- package/dist/bin/bundler/config/output.d.ts +0 -10
- package/dist/bin/bundler/config/output.js +0 -52
- package/dist/bin/bundler/externalResolver-dep.d.ts +0 -3
- package/dist/bin/bundler/externalResolver-dep.js +0 -203
- package/dist/bin/bundler/externalResolver.d.ts +0 -3
- package/dist/bin/bundler/externalResolver.js +0 -203
- package/dist/bin/bundler/plugins/TransformServer/TransformExpress.d.ts +0 -9
- package/dist/bin/bundler/plugins/TransformServer/TransformExpress.js +0 -26
- package/dist/bin/bundler/plugins/TransformServer/TransformPage.d.ts +0 -25
- package/dist/bin/bundler/plugins/TransformServer/TransformPage.js +0 -79
- package/dist/bin/bundler/plugins/TransformServer/index.d.ts +0 -3
- package/dist/bin/bundler/plugins/TransformServer/index.js +0 -103
- package/dist/bin/bundler/plugins/XanixAssets.d.ts +0 -5
- package/dist/bin/bundler/plugins/XanixAssets.js +0 -51
- package/dist/bin/bundler/plugins/XanixCacheDeps-dep.d.ts +0 -2
- package/dist/bin/bundler/plugins/XanixCacheDeps-dep.js +0 -150
- package/dist/bin/bundler/plugins/XanixCacheDeps.d.ts +0 -2
- package/dist/bin/bundler/plugins/XanixCacheDeps.js +0 -150
- package/dist/bin/bundler/plugins/XanixDocument/index.js +0 -53
- package/dist/bin/bundler/plugins/XanixEntryFinder/finder.d.ts +0 -11
- package/dist/bin/bundler/plugins/XanixEntryFinder/finder.js +0 -149
- package/dist/bin/bundler/plugins/XanixEntryFinder/index.d.ts +0 -6
- package/dist/bin/bundler/plugins/XanixEntryFinder/index.js +0 -37
- package/dist/bin/bundler/plugins/XanixEntryFinder-dep/finder.d.ts +0 -11
- package/dist/bin/bundler/plugins/XanixEntryFinder-dep/finder.js +0 -149
- package/dist/bin/bundler/plugins/XanixEntryFinder-dep/index.d.ts +0 -6
- package/dist/bin/bundler/plugins/XanixEntryFinder-dep/index.js +0 -37
- package/dist/bin/bundler/plugins/XanixEnv.d.ts +0 -15
- package/dist/bin/bundler/plugins/XanixEnv.js +0 -44
- package/dist/bin/bundler/plugins/XanixPageTransform/index.d.ts +0 -2
- package/dist/bin/bundler/plugins/XanixPageTransform/index.js +0 -62
- package/dist/bin/bundler/plugins/XanixPageTransform/transformer copy.d.ts +0 -18
- package/dist/bin/bundler/plugins/XanixPageTransform/transformer copy.js +0 -414
- package/dist/bin/bundler/plugins/XanixPageTransform/transformer.d.ts +0 -23
- package/dist/bin/bundler/plugins/XanixPageTransform/transformer.js +0 -589
- package/dist/bin/bundler/plugins/XanixReactRefresh copy.d.ts +0 -2
- package/dist/bin/bundler/plugins/XanixReactRefresh copy.js +0 -121
- package/dist/bin/bundler/plugins/XanixReactRefresh.d.ts +0 -2
- package/dist/bin/bundler/plugins/XanixReactRefresh.js +0 -170
- package/dist/bin/bundler/plugins/XanixResolveCacheDeps/BuildClientCache.d.ts +0 -11
- package/dist/bin/bundler/plugins/XanixResolveCacheDeps/BuildClientCache.js +0 -129
- package/dist/bin/bundler/plugins/XanixResolveCacheDeps/index copy.d.ts +0 -15
- package/dist/bin/bundler/plugins/XanixResolveCacheDeps/index copy.js +0 -228
- package/dist/bin/bundler/plugins/XanixResolveCacheDeps/index.d.ts +0 -7
- package/dist/bin/bundler/plugins/XanixResolveCacheDeps/index.js +0 -166
- package/dist/bin/bundler/plugins/XanixResolveCacheDeps-dep/BuildClientCache.d.ts +0 -11
- package/dist/bin/bundler/plugins/XanixResolveCacheDeps-dep/BuildClientCache.js +0 -129
- package/dist/bin/bundler/plugins/XanixResolveCacheDeps-dep/index.d.ts +0 -5
- package/dist/bin/bundler/plugins/XanixResolveCacheDeps-dep/index.js +0 -26
- package/dist/bin/bundler/plugins/XanixResolver.d.ts +0 -11
- package/dist/bin/bundler/plugins/XanixResolver.js +0 -55
- package/dist/bin/bundler/plugins/XanixServerTransform.d.ts +0 -5
- package/dist/bin/bundler/plugins/XanixServerTransform.js +0 -207
- package/dist/bin/bundler/plugins/XanixTransform.d.ts +0 -3
- package/dist/bin/bundler/plugins/XanixTransform.js +0 -23
- package/dist/bin/bundler/plugins/XanixTsconfigAlias.d.ts +0 -19
- package/dist/bin/bundler/plugins/XanixTsconfigAlias.js +0 -197
- package/dist/bin/bundler/plugins/XanixUseServer.d.ts +0 -7
- package/dist/bin/bundler/plugins/XanixUseServer.js +0 -445
- package/dist/bin/bundler/plugins/plugins.d.ts +0 -9
- package/dist/bin/bundler/plugins/plugins.js +0 -37
- package/dist/bin/bundler/requireCache.d.ts +0 -3
- package/dist/bin/bundler/requireCache.js +0 -85
- package/dist/bin/bundler/server/plugins/ServerAction.d.ts +0 -3
- package/dist/bin/bundler/server/plugins/ServerAction.js +0 -9
- package/dist/bin/bundler/server/plugins/Transformer/ServerAction.d.ts +0 -11
- package/dist/bin/bundler/server/plugins/Transformer/ServerAction.js +0 -28
- package/dist/bin/bundler/server/plugins/Transformer/TransformExpress copy.d.ts +0 -11
- package/dist/bin/bundler/server/plugins/Transformer/TransformExpress copy.js +0 -22
- package/dist/bin/bundler/server/plugins/Transformer/TransformExpress.d.ts +0 -10
- package/dist/bin/bundler/server/plugins/Transformer/TransformExpress.js +0 -19
- package/dist/bin/bundler/server/plugins/Transformer/TransformReactContext.d.ts +0 -17
- package/dist/bin/bundler/server/plugins/Transformer/TransformReactContext.js +0 -101
- package/dist/bin/bundler/server/plugins/Transformer/TransformServerAction copy.d.ts +0 -14
- package/dist/bin/bundler/server/plugins/Transformer/TransformServerAction copy.js +0 -38
- package/dist/bin/bundler/server/types.d.ts +0 -5
- package/dist/bin/bundler/server/types.js +0 -1
- package/dist/bin/bundler/watchClient.d.ts +0 -12
- package/dist/bin/bundler/watchClient.js +0 -104
- package/dist/bin/bundler/watchServer.d.ts +0 -10
- package/dist/bin/bundler/watchServer.js +0 -139
- package/dist/bin/cli/dev/dev.d.ts +0 -2
- package/dist/bin/cli/dev/dev.js +0 -178
- package/dist/bin/cli/start/start.d.ts +0 -2
- package/dist/bin/cli/start/start.js +0 -27
- package/dist/bin/include/entry.d.ts +0 -2
- package/dist/bin/include/entry.js +0 -21
- package/dist/bin/plugins/XanixDocument/XanixDocument.d.ts +0 -2
- package/dist/bin/plugins/XanixDocument/XanixDocument.js +0 -50
- package/dist/bin/plugins/XanixDocument/index.d.ts +0 -2
- package/dist/bin/plugins/XanixDocument/index.js +0 -50
- package/dist/bin/plugins/XanixPageTransform-dep/index.d.ts +0 -2
- package/dist/bin/plugins/XanixPageTransform-dep/index.js +0 -62
- package/dist/bin/plugins/XanixPageTransform-dep/transformer.d.ts +0 -23
- package/dist/bin/plugins/XanixPageTransform-dep/transformer.js +0 -589
- package/dist/bin/plugins/XanixServerTransform.d.ts +0 -5
- package/dist/bin/plugins/XanixServerTransform.js +0 -207
- package/dist/bin/plugins/XanixUseServer.d.ts +0 -7
- package/dist/bin/plugins/XanixUseServer.js +0 -445
- package/dist/bin/plugins/plugins.d.ts +0 -8
- package/dist/bin/plugins/plugins.js +0 -31
- package/dist/components/Script.d.ts +0 -3
- package/dist/components/Script.js +0 -5
- package/dist/dev.d.ts +0 -1
- package/dist/dev.js +0 -25
- package/dist/react/createContext.d.ts +0 -3
- package/dist/react/createContext.js +0 -11
- package/dist/react/index.d.ts +0 -12
- package/dist/react/index.js +0 -3
- package/dist/server/express/Ruter.d.ts +0 -2
- package/dist/server/express/Ruter.js +0 -15
- package/dist/server/runtime/createServer.d.ts +0 -12
- package/dist/server/runtime/createServer.js +0 -62
- package/dist/server/runtime/index.d.ts +0 -3
- package/dist/server/runtime/index.js +0 -3
- package/dist/server/runtime/readManifest.d.ts +0 -14
- package/dist/server/runtime/readManifest.js +0 -9
- package/dist/server/runtime/xanixPage.d.ts +0 -11
- package/dist/server/runtime/xanixPage.js +0 -92
- /package/dist/bin/bundler/{plugins/XanixDocument/index.d.ts → client/plugins/XanixPage.d.ts} +0 -0
- /package/dist/bin/{cli/start/utils.d.ts → bundler/server/plugins/replacer/useServer.d.ts} +0 -0
- /package/dist/bin/{cli/start/utils.js → bundler/server/plugins/replacer/useServer.js} +0 -0
|
@@ -1,589 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import fs from "node:fs";
|
|
3
|
-
import crypto from "node:crypto";
|
|
4
|
-
const RUNTIME_IMPORT = "xanix/runtime";
|
|
5
|
-
const SOURCE_EXTENSIONS = [".tsx", ".ts", ".jsx", ".js", ".mjs", ".cjs"];
|
|
6
|
-
export function normalizeFilePath(file) {
|
|
7
|
-
return path.resolve(file).split(path.sep).join("/");
|
|
8
|
-
}
|
|
9
|
-
export function resolveFile(file) {
|
|
10
|
-
const absolute = path.resolve(file);
|
|
11
|
-
if (fs.existsSync(absolute)) {
|
|
12
|
-
const stat = fs.statSync(absolute);
|
|
13
|
-
if (stat.isFile()) {
|
|
14
|
-
return absolute;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
for (const ext of SOURCE_EXTENSIONS) {
|
|
18
|
-
const candidate = `${absolute}${ext}`;
|
|
19
|
-
if (fs.existsSync(candidate) && fs.statSync(candidate).isFile()) {
|
|
20
|
-
return path.resolve(candidate);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
if (fs.existsSync(absolute) && fs.statSync(absolute).isDirectory()) {
|
|
24
|
-
for (const ext of SOURCE_EXTENSIONS) {
|
|
25
|
-
const candidate = path.join(absolute, `index${ext}`);
|
|
26
|
-
if (fs.existsSync(candidate) && fs.statSync(candidate).isFile()) {
|
|
27
|
-
return path.resolve(candidate);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return absolute;
|
|
32
|
-
}
|
|
33
|
-
export function resolveComponentFile(importer, importPath) {
|
|
34
|
-
if (!importPath.startsWith(".")) {
|
|
35
|
-
return importPath;
|
|
36
|
-
}
|
|
37
|
-
const base = path.resolve(path.dirname(importer), importPath);
|
|
38
|
-
return resolveFile(base);
|
|
39
|
-
}
|
|
40
|
-
export function createPageId(file) {
|
|
41
|
-
return crypto
|
|
42
|
-
.createHash("sha256")
|
|
43
|
-
.update(path.normalize(file))
|
|
44
|
-
.digest("hex")
|
|
45
|
-
.slice(0, 12);
|
|
46
|
-
}
|
|
47
|
-
/* -------------------------------------------------------------------------- */
|
|
48
|
-
/* AST helpers */
|
|
49
|
-
/* -------------------------------------------------------------------------- */
|
|
50
|
-
function isNode(value) {
|
|
51
|
-
return (typeof value === "object" &&
|
|
52
|
-
value !== null &&
|
|
53
|
-
typeof value.type === "string");
|
|
54
|
-
}
|
|
55
|
-
function walk(node, visitor, parent = null, ancestors = []) {
|
|
56
|
-
visitor(node, parent, ancestors);
|
|
57
|
-
const nextAncestors = [...ancestors, node];
|
|
58
|
-
for (const key of Object.keys(node)) {
|
|
59
|
-
if (key === "parent" ||
|
|
60
|
-
key === "loc" ||
|
|
61
|
-
key === "range" ||
|
|
62
|
-
key === "tokens" ||
|
|
63
|
-
key === "comments") {
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
const value = node[key];
|
|
67
|
-
if (Array.isArray(value)) {
|
|
68
|
-
for (const item of value) {
|
|
69
|
-
if (isNode(item)) {
|
|
70
|
-
walk(item, visitor, node, nextAncestors);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
if (isNode(value)) {
|
|
76
|
-
walk(value, visitor, node, nextAncestors);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
function isFunctionNode(node) {
|
|
81
|
-
return (node.type === "FunctionDeclaration" ||
|
|
82
|
-
node.type === "FunctionExpression" ||
|
|
83
|
-
node.type === "ArrowFunctionExpression");
|
|
84
|
-
}
|
|
85
|
-
function findFunctionParent(ancestors) {
|
|
86
|
-
for (let i = ancestors.length - 1; i >= 0; i--) {
|
|
87
|
-
if (isFunctionNode(ancestors[i])) {
|
|
88
|
-
return ancestors[i];
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
return null;
|
|
92
|
-
}
|
|
93
|
-
function isMemberExpression(node) {
|
|
94
|
-
return (!!node &&
|
|
95
|
-
(node.type === "MemberExpression" ||
|
|
96
|
-
node.type === "OptionalMemberExpression"));
|
|
97
|
-
}
|
|
98
|
-
function getMemberPropertyName(node) {
|
|
99
|
-
if (!isMemberExpression(node)) {
|
|
100
|
-
return null;
|
|
101
|
-
}
|
|
102
|
-
if (node.computed) {
|
|
103
|
-
const property = node.property;
|
|
104
|
-
if (property?.type === "Literal" && typeof property.value === "string") {
|
|
105
|
-
return property.value;
|
|
106
|
-
}
|
|
107
|
-
return null;
|
|
108
|
-
}
|
|
109
|
-
if (node.property?.type === "Identifier") {
|
|
110
|
-
return node.property.name;
|
|
111
|
-
}
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
function getJSXComponentName(jsx) {
|
|
115
|
-
const name = jsx.openingElement?.name;
|
|
116
|
-
if (!name) {
|
|
117
|
-
return null;
|
|
118
|
-
}
|
|
119
|
-
if (name.type === "JSXIdentifier") {
|
|
120
|
-
return name.name;
|
|
121
|
-
}
|
|
122
|
-
if (name.type === "JSXMemberExpression") {
|
|
123
|
-
const parts = [];
|
|
124
|
-
let current = name;
|
|
125
|
-
while (current) {
|
|
126
|
-
if (current.type === "JSXIdentifier") {
|
|
127
|
-
parts.unshift(current.name);
|
|
128
|
-
break;
|
|
129
|
-
}
|
|
130
|
-
if (current.type === "JSXMemberExpression") {
|
|
131
|
-
if (current.property?.type === "JSXIdentifier") {
|
|
132
|
-
parts.unshift(current.property.name);
|
|
133
|
-
}
|
|
134
|
-
current = current.object;
|
|
135
|
-
continue;
|
|
136
|
-
}
|
|
137
|
-
break;
|
|
138
|
-
}
|
|
139
|
-
return parts.length ? parts.join(".") : null;
|
|
140
|
-
}
|
|
141
|
-
return null;
|
|
142
|
-
}
|
|
143
|
-
function getImportedName(specifier) {
|
|
144
|
-
if (specifier.type === "ImportDefaultSpecifier") {
|
|
145
|
-
return "default";
|
|
146
|
-
}
|
|
147
|
-
if (specifier.type === "ImportSpecifier") {
|
|
148
|
-
const imported = specifier.imported;
|
|
149
|
-
if (imported?.type === "Identifier") {
|
|
150
|
-
return imported.name;
|
|
151
|
-
}
|
|
152
|
-
if (imported?.type === "Literal") {
|
|
153
|
-
return String(imported.value);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
return null;
|
|
157
|
-
}
|
|
158
|
-
// function findComponentImport(
|
|
159
|
-
// ast: AstNode,
|
|
160
|
-
// componentName: string,
|
|
161
|
-
// ): ComponentImport | null {
|
|
162
|
-
// const body = ast.body ?? [];
|
|
163
|
-
// for (const statement of body) {
|
|
164
|
-
// if (statement.type !== "ImportDeclaration") {
|
|
165
|
-
// continue;
|
|
166
|
-
// }
|
|
167
|
-
// const source = statement.source?.value;
|
|
168
|
-
// if (typeof source !== "string") {
|
|
169
|
-
// continue;
|
|
170
|
-
// }
|
|
171
|
-
// for (const specifier of statement.specifiers ?? []) {
|
|
172
|
-
// if (!specifier.local || specifier.local.name !== componentName) {
|
|
173
|
-
// continue;
|
|
174
|
-
// }
|
|
175
|
-
// const exportName = getImportedName(specifier);
|
|
176
|
-
// if (!exportName) {
|
|
177
|
-
// continue;
|
|
178
|
-
// }
|
|
179
|
-
// return {
|
|
180
|
-
// source,
|
|
181
|
-
// exportName,
|
|
182
|
-
// declaration: statement,
|
|
183
|
-
// specifier,
|
|
184
|
-
// };
|
|
185
|
-
// }
|
|
186
|
-
// }
|
|
187
|
-
// return null;
|
|
188
|
-
// }
|
|
189
|
-
/* -------------------------------------------------------------------------- */
|
|
190
|
-
/* JSX -> props */
|
|
191
|
-
/* -------------------------------------------------------------------------- */
|
|
192
|
-
function sourceSlice(code, node) {
|
|
193
|
-
return code.slice(node.start, node.end);
|
|
194
|
-
}
|
|
195
|
-
// function jsxNameToExpression(name: AstNode): string | null {
|
|
196
|
-
// if (name.type === "JSXIdentifier") {
|
|
197
|
-
// return name.name;
|
|
198
|
-
// }
|
|
199
|
-
// if (name.type === "JSXMemberExpression") {
|
|
200
|
-
// const object = jsxNameToExpression(name.object);
|
|
201
|
-
// const property = jsxNameToExpression(name.property);
|
|
202
|
-
// if (!object || !property) {
|
|
203
|
-
// return null;
|
|
204
|
-
// }
|
|
205
|
-
// return `${object}.${property}`;
|
|
206
|
-
// }
|
|
207
|
-
// return null;
|
|
208
|
-
// }
|
|
209
|
-
function jsxAttributeKey(attribute) {
|
|
210
|
-
const name = attribute.name;
|
|
211
|
-
if (name?.type === "JSXIdentifier") {
|
|
212
|
-
return name.name;
|
|
213
|
-
}
|
|
214
|
-
if (name?.type === "JSXNamespacedName") {
|
|
215
|
-
const namespace = name.namespace?.name ?? "";
|
|
216
|
-
const local = name.name?.name ?? "";
|
|
217
|
-
return `${namespace}:${local}`;
|
|
218
|
-
}
|
|
219
|
-
return "";
|
|
220
|
-
}
|
|
221
|
-
function jsxAttributeValue(attribute, code) {
|
|
222
|
-
const value = attribute.value;
|
|
223
|
-
if (!value) {
|
|
224
|
-
return "true";
|
|
225
|
-
}
|
|
226
|
-
if (value.type === "Literal") {
|
|
227
|
-
return JSON.stringify(String(value.value ?? ""));
|
|
228
|
-
}
|
|
229
|
-
if (value.type === "JSXExpressionContainer") {
|
|
230
|
-
const expression = value.expression;
|
|
231
|
-
if (!expression || expression.type === "JSXEmptyExpression") {
|
|
232
|
-
return "undefined";
|
|
233
|
-
}
|
|
234
|
-
return sourceSlice(code, expression);
|
|
235
|
-
}
|
|
236
|
-
if (value.type === "JSXElement" || value.type === "JSXFragment") {
|
|
237
|
-
return sourceSlice(code, value);
|
|
238
|
-
}
|
|
239
|
-
return sourceSlice(code, value);
|
|
240
|
-
}
|
|
241
|
-
function jsxAttributesToProps(jsx, code) {
|
|
242
|
-
const properties = [];
|
|
243
|
-
const attributes = jsx.openingElement?.attributes ?? [];
|
|
244
|
-
for (const attribute of attributes) {
|
|
245
|
-
if (attribute.type === "JSXSpreadAttribute") {
|
|
246
|
-
const argument = attribute.argument;
|
|
247
|
-
if (!argument) {
|
|
248
|
-
continue;
|
|
249
|
-
}
|
|
250
|
-
properties.push(`...${sourceSlice(code, argument)}`);
|
|
251
|
-
continue;
|
|
252
|
-
}
|
|
253
|
-
if (attribute.type !== "JSXAttribute") {
|
|
254
|
-
continue;
|
|
255
|
-
}
|
|
256
|
-
const key = jsxAttributeKey(attribute);
|
|
257
|
-
if (!key) {
|
|
258
|
-
continue;
|
|
259
|
-
}
|
|
260
|
-
const value = jsxAttributeValue(attribute, code);
|
|
261
|
-
const validIdentifier = /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(key);
|
|
262
|
-
const propertyKey = validIdentifier ? key : JSON.stringify(key);
|
|
263
|
-
properties.push(`${propertyKey}: ${value}`);
|
|
264
|
-
}
|
|
265
|
-
return `{ ${properties.join(", ")} }`;
|
|
266
|
-
}
|
|
267
|
-
/* -------------------------------------------------------------------------- */
|
|
268
|
-
/* Import editing */
|
|
269
|
-
/* -------------------------------------------------------------------------- */
|
|
270
|
-
function createImportRemovalEdit(declaration, specifier, code) {
|
|
271
|
-
const specifiers = declaration.specifiers ?? [];
|
|
272
|
-
if (specifier.start == null || specifier.end == null) {
|
|
273
|
-
return null;
|
|
274
|
-
}
|
|
275
|
-
if (specifiers.length === 1) {
|
|
276
|
-
return {
|
|
277
|
-
start: declaration.start,
|
|
278
|
-
end: declaration.end,
|
|
279
|
-
content: "",
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
const index = specifiers.indexOf(specifier);
|
|
283
|
-
if (index === -1) {
|
|
284
|
-
return null;
|
|
285
|
-
}
|
|
286
|
-
/*
|
|
287
|
-
* import Foo, { Bar } from "x"
|
|
288
|
-
* ^^^^^^^^^
|
|
289
|
-
*
|
|
290
|
-
* import { Foo, Bar } from "x"
|
|
291
|
-
* ^^^
|
|
292
|
-
*/
|
|
293
|
-
if (index === 0) {
|
|
294
|
-
const next = specifiers[index + 1];
|
|
295
|
-
if (next?.start != null) {
|
|
296
|
-
return {
|
|
297
|
-
start: specifier.start,
|
|
298
|
-
end: next.start,
|
|
299
|
-
content: "",
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
const previous = specifiers[index - 1];
|
|
304
|
-
if (previous?.end != null) {
|
|
305
|
-
return {
|
|
306
|
-
start: previous.end,
|
|
307
|
-
end: specifier.end,
|
|
308
|
-
content: "",
|
|
309
|
-
};
|
|
310
|
-
}
|
|
311
|
-
return null;
|
|
312
|
-
}
|
|
313
|
-
function hasRuntimeImport(ast, name) {
|
|
314
|
-
for (const statement of ast.body ?? []) {
|
|
315
|
-
if (statement.type !== "ImportDeclaration") {
|
|
316
|
-
continue;
|
|
317
|
-
}
|
|
318
|
-
if (statement.source?.value !== RUNTIME_IMPORT) {
|
|
319
|
-
continue;
|
|
320
|
-
}
|
|
321
|
-
for (const specifier of statement.specifiers ?? []) {
|
|
322
|
-
if (specifier.type === "ImportSpecifier" &&
|
|
323
|
-
specifier.imported?.type === "Identifier" &&
|
|
324
|
-
specifier.imported.name === name) {
|
|
325
|
-
return true;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
return false;
|
|
330
|
-
}
|
|
331
|
-
function createRuntimeImportEdit(ast, name) {
|
|
332
|
-
if (hasRuntimeImport(ast, name)) {
|
|
333
|
-
return {
|
|
334
|
-
start: 0,
|
|
335
|
-
end: 0,
|
|
336
|
-
content: "",
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
|
-
/*
|
|
340
|
-
* Keep this simple and let Rolldown/Oxc
|
|
341
|
-
* process the import normally afterward.
|
|
342
|
-
*/
|
|
343
|
-
return {
|
|
344
|
-
start: 0,
|
|
345
|
-
end: 0,
|
|
346
|
-
content: `import { ${name} } from "${RUNTIME_IMPORT}";\n`,
|
|
347
|
-
};
|
|
348
|
-
}
|
|
349
|
-
/* -------------------------------------------------------------------------- */
|
|
350
|
-
/* Function async */
|
|
351
|
-
/* -------------------------------------------------------------------------- */
|
|
352
|
-
function createAsyncEdit(functionNode, code) {
|
|
353
|
-
if (functionNode.async) {
|
|
354
|
-
return null;
|
|
355
|
-
}
|
|
356
|
-
if (functionNode.start == null) {
|
|
357
|
-
return null;
|
|
358
|
-
}
|
|
359
|
-
/*
|
|
360
|
-
* Arrow:
|
|
361
|
-
*
|
|
362
|
-
* (req, res) => ...
|
|
363
|
-
*
|
|
364
|
-
* becomes:
|
|
365
|
-
*
|
|
366
|
-
* async (req, res) => ...
|
|
367
|
-
*
|
|
368
|
-
*/
|
|
369
|
-
if (functionNode.type === "ArrowFunctionExpression") {
|
|
370
|
-
return {
|
|
371
|
-
start: functionNode.start,
|
|
372
|
-
end: functionNode.start,
|
|
373
|
-
content: "async ",
|
|
374
|
-
};
|
|
375
|
-
}
|
|
376
|
-
/*
|
|
377
|
-
* Function:
|
|
378
|
-
*
|
|
379
|
-
* function handler(...)
|
|
380
|
-
*
|
|
381
|
-
* becomes:
|
|
382
|
-
*
|
|
383
|
-
* async function handler(...)
|
|
384
|
-
*/
|
|
385
|
-
if (functionNode.type === "FunctionDeclaration" ||
|
|
386
|
-
functionNode.type === "FunctionExpression") {
|
|
387
|
-
return {
|
|
388
|
-
start: functionNode.start,
|
|
389
|
-
end: functionNode.start,
|
|
390
|
-
content: "async ",
|
|
391
|
-
};
|
|
392
|
-
}
|
|
393
|
-
return null;
|
|
394
|
-
}
|
|
395
|
-
/* -------------------------------------------------------------------------- */
|
|
396
|
-
/* Main transformer */
|
|
397
|
-
/* -------------------------------------------------------------------------- */
|
|
398
|
-
export function transformer(code, id, ast) {
|
|
399
|
-
const edits = [];
|
|
400
|
-
const entries = [];
|
|
401
|
-
const componentImports = new Map();
|
|
402
|
-
/*
|
|
403
|
-
* Cache all imports first.
|
|
404
|
-
*/
|
|
405
|
-
for (const statement of ast.body ?? []) {
|
|
406
|
-
if (statement.type !== "ImportDeclaration") {
|
|
407
|
-
continue;
|
|
408
|
-
}
|
|
409
|
-
const source = statement.source?.value;
|
|
410
|
-
if (typeof source !== "string") {
|
|
411
|
-
continue;
|
|
412
|
-
}
|
|
413
|
-
for (const specifier of statement.specifiers ?? []) {
|
|
414
|
-
const localName = specifier.local?.name;
|
|
415
|
-
if (!localName) {
|
|
416
|
-
continue;
|
|
417
|
-
}
|
|
418
|
-
const exportName = getImportedName(specifier);
|
|
419
|
-
if (!exportName) {
|
|
420
|
-
continue;
|
|
421
|
-
}
|
|
422
|
-
componentImports.set(localName, {
|
|
423
|
-
source,
|
|
424
|
-
exportName,
|
|
425
|
-
declaration: statement,
|
|
426
|
-
specifier,
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
const removedImportDeclarations = new Set();
|
|
431
|
-
const transformedCalls = new Set();
|
|
432
|
-
walk(ast, (node, _parent, ancestors) => {
|
|
433
|
-
if (node.type !== "CallExpression") {
|
|
434
|
-
return;
|
|
435
|
-
}
|
|
436
|
-
if (transformedCalls.has(node)) {
|
|
437
|
-
return;
|
|
438
|
-
}
|
|
439
|
-
const callee = node.callee;
|
|
440
|
-
if (!isMemberExpression(callee)) {
|
|
441
|
-
return;
|
|
442
|
-
}
|
|
443
|
-
const method = getMemberPropertyName(callee);
|
|
444
|
-
if (method !== "send") {
|
|
445
|
-
return;
|
|
446
|
-
}
|
|
447
|
-
const argument = node.arguments?.[0];
|
|
448
|
-
if (!argument || argument.type !== "JSXElement") {
|
|
449
|
-
return;
|
|
450
|
-
}
|
|
451
|
-
const functionNode = findFunctionParent(ancestors);
|
|
452
|
-
if (!functionNode) {
|
|
453
|
-
return;
|
|
454
|
-
}
|
|
455
|
-
const params = functionNode.params ?? [];
|
|
456
|
-
if (params.length < 2) {
|
|
457
|
-
return;
|
|
458
|
-
}
|
|
459
|
-
const requestParam = params[0];
|
|
460
|
-
const responseParam = params[1];
|
|
461
|
-
if (requestParam?.type !== "Identifier") {
|
|
462
|
-
return;
|
|
463
|
-
}
|
|
464
|
-
if (responseParam?.type !== "Identifier") {
|
|
465
|
-
return;
|
|
466
|
-
}
|
|
467
|
-
const componentName = getJSXComponentName(argument);
|
|
468
|
-
if (!componentName) {
|
|
469
|
-
return;
|
|
470
|
-
}
|
|
471
|
-
/*
|
|
472
|
-
* For:
|
|
473
|
-
*
|
|
474
|
-
* <Foo />
|
|
475
|
-
*
|
|
476
|
-
* componentName = Foo
|
|
477
|
-
*
|
|
478
|
-
* For:
|
|
479
|
-
*
|
|
480
|
-
* <UI.Page />
|
|
481
|
-
*
|
|
482
|
-
* this only works when the import is
|
|
483
|
-
* represented by the same local identifier.
|
|
484
|
-
*/
|
|
485
|
-
const componentImport = componentImports.get(componentName);
|
|
486
|
-
if (!componentImport) {
|
|
487
|
-
return;
|
|
488
|
-
}
|
|
489
|
-
const componentImportPath = componentImport.source;
|
|
490
|
-
const componentFile = resolveComponentFile(id, componentImportPath);
|
|
491
|
-
/*
|
|
492
|
-
* Only local component files become
|
|
493
|
-
* Xanix pages.
|
|
494
|
-
*/
|
|
495
|
-
if (!path.isAbsolute(componentFile)) {
|
|
496
|
-
return;
|
|
497
|
-
}
|
|
498
|
-
const normalizedFile = normalizeFilePath(componentFile);
|
|
499
|
-
const pageId = createPageId(normalizedFile);
|
|
500
|
-
const props = jsxAttributesToProps(argument, code);
|
|
501
|
-
entries.push({
|
|
502
|
-
id: pageId,
|
|
503
|
-
name: componentName,
|
|
504
|
-
file: normalizedFile,
|
|
505
|
-
path: componentImportPath,
|
|
506
|
-
export: componentImport.exportName,
|
|
507
|
-
});
|
|
508
|
-
/*
|
|
509
|
-
* Remove the server-side component import.
|
|
510
|
-
*/
|
|
511
|
-
if (!removedImportDeclarations.has(componentImport.declaration)) {
|
|
512
|
-
const importEdit = createImportRemovalEdit(componentImport.declaration, componentImport.specifier, code);
|
|
513
|
-
if (importEdit) {
|
|
514
|
-
edits.push(importEdit);
|
|
515
|
-
}
|
|
516
|
-
removedImportDeclarations.add(componentImport.declaration);
|
|
517
|
-
}
|
|
518
|
-
/*
|
|
519
|
-
* Make the containing handler async.
|
|
520
|
-
*/
|
|
521
|
-
const asyncEdit = createAsyncEdit(functionNode, code);
|
|
522
|
-
if (asyncEdit) {
|
|
523
|
-
edits.push(asyncEdit);
|
|
524
|
-
}
|
|
525
|
-
/*
|
|
526
|
-
* Preserve the same runtime contract
|
|
527
|
-
* used by the old Babel implementation:
|
|
528
|
-
*
|
|
529
|
-
* await xanixPage({
|
|
530
|
-
* component: async () => (
|
|
531
|
-
* await import("./Home")
|
|
532
|
-
* ),
|
|
533
|
-
* pageId,
|
|
534
|
-
* req,
|
|
535
|
-
* res,
|
|
536
|
-
* props
|
|
537
|
-
* })
|
|
538
|
-
*/
|
|
539
|
-
const pageCall = [
|
|
540
|
-
"await xanixPage({",
|
|
541
|
-
`component: async () => (await import(${JSON.stringify(componentImportPath)})),`,
|
|
542
|
-
`pageId: ${JSON.stringify(pageId)},`,
|
|
543
|
-
`req: ${requestParam.name},`,
|
|
544
|
-
`res: ${responseParam.name},`,
|
|
545
|
-
`props: ${props},`,
|
|
546
|
-
"})",
|
|
547
|
-
].join("\n");
|
|
548
|
-
edits.push({
|
|
549
|
-
start: argument.start,
|
|
550
|
-
end: argument.end,
|
|
551
|
-
content: pageCall,
|
|
552
|
-
});
|
|
553
|
-
transformedCalls.add(node);
|
|
554
|
-
});
|
|
555
|
-
if (!entries.length) {
|
|
556
|
-
return null;
|
|
557
|
-
}
|
|
558
|
-
/*
|
|
559
|
-
* Inject xanixPage import.
|
|
560
|
-
*/
|
|
561
|
-
const runtimeImport = createRuntimeImportEdit(ast, "xanixPage");
|
|
562
|
-
if (runtimeImport.content) {
|
|
563
|
-
edits.push(runtimeImport);
|
|
564
|
-
}
|
|
565
|
-
/*
|
|
566
|
-
* Apply edits backwards so offsets
|
|
567
|
-
* remain valid.
|
|
568
|
-
*/
|
|
569
|
-
edits.sort((a, b) => b.start - a.start);
|
|
570
|
-
let transformedCode = code;
|
|
571
|
-
let lastStart = Number.POSITIVE_INFINITY;
|
|
572
|
-
for (const edit of edits) {
|
|
573
|
-
/*
|
|
574
|
-
* Ignore overlapping edits.
|
|
575
|
-
*/
|
|
576
|
-
if (edit.end > lastStart) {
|
|
577
|
-
continue;
|
|
578
|
-
}
|
|
579
|
-
transformedCode =
|
|
580
|
-
transformedCode.slice(0, edit.start) +
|
|
581
|
-
edit.content +
|
|
582
|
-
transformedCode.slice(edit.end);
|
|
583
|
-
lastStart = edit.start;
|
|
584
|
-
}
|
|
585
|
-
return {
|
|
586
|
-
code: transformedCode,
|
|
587
|
-
entries,
|
|
588
|
-
};
|
|
589
|
-
}
|