@modern-js/app-tools 2.58.1-alpha.6 → 2.58.2
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/cjs/builder/builder-webpack/createCopyPattern.js +0 -1
- package/dist/cjs/builder/builder-webpack/index.js +1 -1
- package/dist/cjs/builder/generator/index.js +2 -2
- package/dist/cjs/builder/index.js +2 -2
- package/dist/cjs/builder/shared/bundlerPlugins/RouterPlugin.js +13 -4
- package/dist/cjs/commands/build.js +19 -0
- package/dist/cjs/commands/dev.js +9 -0
- package/dist/cjs/commands/index.js +8 -8
- package/dist/cjs/commands/inspect.js +1 -1
- package/dist/cjs/config/initialize/inits.js +4 -4
- package/dist/cjs/esm/esbuild-loader.mjs +20 -0
- package/dist/cjs/esm/register-esm.mjs +67 -0
- package/dist/cjs/esm/ts-node-loader.mjs +21 -0
- package/dist/cjs/esm/utils.mjs +43 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/plugins/analyze/index.js +3 -3
- package/dist/cjs/plugins/deploy/dependencies/index.js +2 -15
- package/dist/cjs/plugins/deploy/dependencies/utils.js +13 -78
- package/dist/cjs/plugins/deploy/platforms/netlify-entry.js +3 -0
- package/dist/cjs/plugins/deploy/platforms/netlify-entry.mjs +1 -0
- package/dist/cjs/plugins/deploy/platforms/{netlifyEntry.js → netlify-handler.js} +6 -4
- package/dist/cjs/plugins/deploy/platforms/netlify.js +14 -5
- package/dist/cjs/plugins/deploy/platforms/node.js +13 -4
- package/dist/cjs/plugins/deploy/platforms/vercel-entry.js +3 -0
- package/dist/cjs/plugins/deploy/platforms/vercel-entry.mjs +3 -0
- package/dist/cjs/plugins/deploy/platforms/{vercelEntry.js → vercel-handler.js} +4 -1
- package/dist/cjs/plugins/deploy/platforms/vercel.js +14 -5
- package/dist/cjs/utils/config.js +1 -1
- package/dist/cjs/utils/loadPlugins.js +1 -1
- package/dist/cjs/utils/register.js +50 -23
- package/dist/types/builder/builder-rspack/adapterCopy.d.ts +2 -2
- package/dist/types/builder/builder-rspack/index.d.ts +1 -1
- package/dist/types/builder/builder-webpack/adapterModern.d.ts +2 -2
- package/dist/types/builder/builder-webpack/index.d.ts +1 -1
- package/dist/types/builder/generator/index.d.ts +2 -2
- package/dist/types/builder/index.d.ts +1 -1
- package/dist/types/builder/shared/builderPlugins/adapterHtml.d.ts +1 -1
- package/dist/types/builder/shared/builderPlugins/adapterSSR.d.ts +1 -1
- package/dist/types/builder/shared/createCopyInfo.d.ts +1 -1
- package/dist/types/commands/build.d.ts +1 -1
- package/dist/types/commands/dev.d.ts +3 -3
- package/dist/types/commands/index.d.ts +3 -3
- package/dist/types/config/default.d.ts +1 -1
- package/dist/types/config/initialize/inits.d.ts +1 -1
- package/dist/types/config/legacy/createHtmlConfig.d.ts +1 -1
- package/dist/types/config/legacy/createOutputConfig.d.ts +1 -1
- package/dist/types/config/legacy/createSourceConfig.d.ts +1 -1
- package/dist/types/config/legacy/createToolsConfig.d.ts +1 -1
- package/dist/types/esm/esbuild-loader.d.mts +6 -0
- package/dist/types/esm/register-esm.d.mts +5 -0
- package/dist/types/esm/ts-node-loader.d.mts +6 -0
- package/dist/types/esm/utils.d.mts +6 -0
- package/dist/types/exports/server.d.ts +1 -1
- package/dist/types/hooks.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/plugins/analyze/getBundleEntry.d.ts +1 -1
- package/dist/types/plugins/analyze/getFileSystemEntry.d.ts +1 -1
- package/dist/types/plugins/analyze/index.d.ts +1 -1
- package/dist/types/plugins/deploy/dependencies/index.d.ts +3 -5
- package/dist/types/plugins/deploy/dependencies/utils.d.ts +2 -9
- package/dist/types/plugins/deploy/index.d.ts +2 -2
- package/dist/types/plugins/deploy/platforms/netlify-entry.d.cts +1 -0
- package/dist/types/plugins/deploy/platforms/netlify-entry.d.mts +1 -0
- package/dist/types/plugins/deploy/platforms/netlify-handler.d.cts +1 -0
- package/dist/types/plugins/deploy/platforms/netlify.d.ts +1 -1
- package/dist/types/plugins/deploy/platforms/node.d.ts +1 -1
- package/dist/types/plugins/deploy/platforms/platform.d.ts +2 -2
- package/dist/types/plugins/deploy/platforms/vercel-entry.d.mts +2 -0
- package/dist/types/plugins/deploy/platforms/vercel-entry.d.ts +2 -0
- package/dist/types/plugins/deploy/platforms/vercel-handler.d.cts +1 -0
- package/dist/types/plugins/deploy/platforms/vercel.d.ts +1 -1
- package/dist/types/plugins/deploy/utils.d.ts +1 -1
- package/dist/types/plugins/serverBuild.d.ts +1 -1
- package/dist/types/types/hooks.d.ts +1 -1
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/utils/createServer.d.ts +1 -1
- package/dist/types/utils/generateWatchFiles.d.ts +1 -1
- package/dist/types/utils/getSelectedEntries.d.ts +1 -1
- package/dist/types/utils/loadPlugins.d.ts +3 -3
- package/dist/types/utils/register.d.ts +2 -2
- package/dist/types/utils/restart.d.ts +2 -2
- package/lib/types.d.ts +15 -0
- package/package.json +20 -21
- package/dist/esm/builder/builder-rspack/adapterCopy.js +0 -166
- package/dist/esm/builder/builder-rspack/index.js +0 -34
- package/dist/esm/builder/builder-webpack/adapterModern.js +0 -29
- package/dist/esm/builder/builder-webpack/createCopyPattern.js +0 -44
- package/dist/esm/builder/builder-webpack/index.js +0 -52
- package/dist/esm/builder/generator/createBuilderProviderConfig.js +0 -37
- package/dist/esm/builder/generator/getBuilderEnvironments.js +0 -81
- package/dist/esm/builder/generator/index.js +0 -94
- package/dist/esm/builder/index.js +0 -45
- package/dist/esm/builder/shared/builderPlugins/adapterBasic.js +0 -85
- package/dist/esm/builder/shared/builderPlugins/adapterHtml.js +0 -126
- package/dist/esm/builder/shared/builderPlugins/adapterSSR.js +0 -270
- package/dist/esm/builder/shared/builderPlugins/adapterWorker.js +0 -43
- package/dist/esm/builder/shared/builderPlugins/index.js +0 -4
- package/dist/esm/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.js +0 -51
- package/dist/esm/builder/shared/bundlerPlugins/HtmlBottomTemplate.js +0 -37
- package/dist/esm/builder/shared/bundlerPlugins/RouterPlugin.js +0 -288
- package/dist/esm/builder/shared/bundlerPlugins/index.js +0 -3
- package/dist/esm/builder/shared/createCopyInfo.js +0 -14
- package/dist/esm/builder/shared/index.js +0 -3
- package/dist/esm/builder/shared/loaders/serverModuleLoader.js +0 -7
- package/dist/esm/builder/shared/types.js +0 -0
- package/dist/esm/commands/build.js +0 -117
- package/dist/esm/commands/deploy.js +0 -48
- package/dist/esm/commands/dev.js +0 -169
- package/dist/esm/commands/index.js +0 -411
- package/dist/esm/commands/inspect.js +0 -28
- package/dist/esm/commands/serve.js +0 -93
- package/dist/esm/config/default.js +0 -190
- package/dist/esm/config/index.js +0 -3
- package/dist/esm/config/initialize/index.js +0 -9
- package/dist/esm/config/initialize/inits.js +0 -85
- package/dist/esm/config/legacy/createHtmlConfig.js +0 -21
- package/dist/esm/config/legacy/createOutputConfig.js +0 -45
- package/dist/esm/config/legacy/createSourceConfig.js +0 -46
- package/dist/esm/config/legacy/createToolsConfig.js +0 -28
- package/dist/esm/config/legacy/index.js +0 -43
- package/dist/esm/defineConfig.js +0 -16
- package/dist/esm/exports/server.js +0 -4
- package/dist/esm/hooks.js +0 -34
- package/dist/esm/index.js +0 -239
- package/dist/esm/locale/en.js +0 -43
- package/dist/esm/locale/index.js +0 -12
- package/dist/esm/locale/zh.js +0 -43
- package/dist/esm/plugins/analyze/constants.js +0 -14
- package/dist/esm/plugins/analyze/getBundleEntry.js +0 -102
- package/dist/esm/plugins/analyze/getFileSystemEntry.js +0 -238
- package/dist/esm/plugins/analyze/getHtmlTemplate.js +0 -178
- package/dist/esm/plugins/analyze/getServerRoutes.js +0 -132
- package/dist/esm/plugins/analyze/index.js +0 -380
- package/dist/esm/plugins/analyze/isDefaultExportFunction.js +0 -49
- package/dist/esm/plugins/analyze/templates.js +0 -6
- package/dist/esm/plugins/analyze/utils.js +0 -101
- package/dist/esm/plugins/deploy/dependencies/index.js +0 -629
- package/dist/esm/plugins/deploy/dependencies/utils.js +0 -643
- package/dist/esm/plugins/deploy/exports.js +0 -4
- package/dist/esm/plugins/deploy/index.js +0 -135
- package/dist/esm/plugins/deploy/platforms/netlify.js +0 -299
- package/dist/esm/plugins/deploy/platforms/netlifyEntry.js +0 -203
- package/dist/esm/plugins/deploy/platforms/node.js +0 -133
- package/dist/esm/plugins/deploy/platforms/nodeEntry.js +0 -108
- package/dist/esm/plugins/deploy/platforms/platform.js +0 -0
- package/dist/esm/plugins/deploy/platforms/vercel.js +0 -233
- package/dist/esm/plugins/deploy/platforms/vercelEntry.js +0 -203
- package/dist/esm/plugins/deploy/utils.js +0 -47
- package/dist/esm/plugins/initialize/index.js +0 -119
- package/dist/esm/plugins/serverBuild.js +0 -87
- package/dist/esm/types/config/deploy.js +0 -0
- package/dist/esm/types/config/dev.js +0 -0
- package/dist/esm/types/config/experiments.js +0 -0
- package/dist/esm/types/config/html.js +0 -0
- package/dist/esm/types/config/index.js +0 -1
- package/dist/esm/types/config/output.js +0 -0
- package/dist/esm/types/config/performance.js +0 -0
- package/dist/esm/types/config/security.js +0 -0
- package/dist/esm/types/config/source.js +0 -0
- package/dist/esm/types/config/testing.js +0 -0
- package/dist/esm/types/config/tools.js +0 -0
- package/dist/esm/types/hooks.js +0 -0
- package/dist/esm/types/index.js +0 -3
- package/dist/esm/types/legacyConfig/deploy.js +0 -0
- package/dist/esm/types/legacyConfig/dev.js +0 -0
- package/dist/esm/types/legacyConfig/index.js +0 -0
- package/dist/esm/types/legacyConfig/output.js +0 -0
- package/dist/esm/types/legacyConfig/source.js +0 -0
- package/dist/esm/types/legacyConfig/testing.js +0 -0
- package/dist/esm/types/legacyConfig/tools.js +0 -0
- package/dist/esm/types/utils.js +0 -0
- package/dist/esm/utils/config.js +0 -122
- package/dist/esm/utils/createServer.js +0 -58
- package/dist/esm/utils/env.js +0 -16
- package/dist/esm/utils/generateWatchFiles.js +0 -71
- package/dist/esm/utils/getSelectedEntries.js +0 -67
- package/dist/esm/utils/loadPlugins.js +0 -69
- package/dist/esm/utils/printInstructions.js +0 -32
- package/dist/esm/utils/register.js +0 -129
- package/dist/esm/utils/restart.js +0 -67
- package/dist/esm/utils/routes.js +0 -42
- package/dist/esm/utils/types.js +0 -0
- package/dist/esm-node/builder/builder-rspack/adapterCopy.js +0 -67
- package/dist/esm-node/builder/builder-rspack/index.js +0 -12
- package/dist/esm-node/builder/builder-webpack/adapterModern.js +0 -26
- package/dist/esm-node/builder/builder-webpack/createCopyPattern.js +0 -42
- package/dist/esm-node/builder/builder-webpack/index.js +0 -20
- package/dist/esm-node/builder/generator/createBuilderProviderConfig.js +0 -44
- package/dist/esm-node/builder/generator/getBuilderEnvironments.js +0 -60
- package/dist/esm-node/builder/generator/index.js +0 -37
- package/dist/esm-node/builder/index.js +0 -11
- package/dist/esm-node/builder/shared/builderPlugins/adapterBasic.js +0 -48
- package/dist/esm-node/builder/shared/builderPlugins/adapterHtml.js +0 -60
- package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.js +0 -156
- package/dist/esm-node/builder/shared/builderPlugins/adapterWorker.js +0 -27
- package/dist/esm-node/builder/shared/builderPlugins/index.js +0 -4
- package/dist/esm-node/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.js +0 -30
- package/dist/esm-node/builder/shared/bundlerPlugins/HtmlBottomTemplate.js +0 -31
- package/dist/esm-node/builder/shared/bundlerPlugins/RouterPlugin.js +0 -219
- package/dist/esm-node/builder/shared/bundlerPlugins/index.js +0 -3
- package/dist/esm-node/builder/shared/createCopyInfo.js +0 -14
- package/dist/esm-node/builder/shared/index.js +0 -3
- package/dist/esm-node/builder/shared/loaders/serverModuleLoader.js +0 -7
- package/dist/esm-node/builder/shared/types.js +0 -0
- package/dist/esm-node/commands/build.js +0 -55
- package/dist/esm-node/commands/deploy.js +0 -12
- package/dist/esm-node/commands/dev.js +0 -95
- package/dist/esm-node/commands/index.js +0 -92
- package/dist/esm-node/commands/inspect.js +0 -15
- package/dist/esm-node/commands/serve.js +0 -51
- package/dist/esm-node/config/default.js +0 -197
- package/dist/esm-node/config/index.js +0 -3
- package/dist/esm-node/config/initialize/index.js +0 -9
- package/dist/esm-node/config/initialize/inits.js +0 -79
- package/dist/esm-node/config/legacy/createHtmlConfig.js +0 -21
- package/dist/esm-node/config/legacy/createOutputConfig.js +0 -45
- package/dist/esm-node/config/legacy/createSourceConfig.js +0 -29
- package/dist/esm-node/config/legacy/createToolsConfig.js +0 -28
- package/dist/esm-node/config/legacy/index.js +0 -43
- package/dist/esm-node/defineConfig.js +0 -13
- package/dist/esm-node/exports/server.js +0 -4
- package/dist/esm-node/hooks.js +0 -34
- package/dist/esm-node/index.js +0 -124
- package/dist/esm-node/locale/en.js +0 -43
- package/dist/esm-node/locale/index.js +0 -12
- package/dist/esm-node/locale/zh.js +0 -43
- package/dist/esm-node/plugins/analyze/constants.js +0 -14
- package/dist/esm-node/plugins/analyze/getBundleEntry.js +0 -61
- package/dist/esm-node/plugins/analyze/getFileSystemEntry.js +0 -100
- package/dist/esm-node/plugins/analyze/getHtmlTemplate.js +0 -74
- package/dist/esm-node/plugins/analyze/getServerRoutes.js +0 -132
- package/dist/esm-node/plugins/analyze/index.js +0 -166
- package/dist/esm-node/plugins/analyze/isDefaultExportFunction.js +0 -47
- package/dist/esm-node/plugins/analyze/templates.js +0 -24
- package/dist/esm-node/plugins/analyze/utils.js +0 -68
- package/dist/esm-node/plugins/deploy/dependencies/index.js +0 -215
- package/dist/esm-node/plugins/deploy/dependencies/utils.js +0 -202
- package/dist/esm-node/plugins/deploy/exports.js +0 -4
- package/dist/esm-node/plugins/deploy/index.js +0 -44
- package/dist/esm-node/plugins/deploy/platforms/netlify.js +0 -108
- package/dist/esm-node/plugins/deploy/platforms/netlifyEntry.js +0 -69
- package/dist/esm-node/plugins/deploy/platforms/node.js +0 -63
- package/dist/esm-node/plugins/deploy/platforms/nodeEntry.js +0 -44
- package/dist/esm-node/plugins/deploy/platforms/platform.js +0 -0
- package/dist/esm-node/plugins/deploy/platforms/vercel.js +0 -120
- package/dist/esm-node/plugins/deploy/platforms/vercelEntry.js +0 -69
- package/dist/esm-node/plugins/deploy/utils.js +0 -44
- package/dist/esm-node/plugins/initialize/index.js +0 -84
- package/dist/esm-node/plugins/serverBuild.js +0 -58
- package/dist/esm-node/types/config/deploy.js +0 -0
- package/dist/esm-node/types/config/dev.js +0 -0
- package/dist/esm-node/types/config/experiments.js +0 -0
- package/dist/esm-node/types/config/html.js +0 -0
- package/dist/esm-node/types/config/index.js +0 -1
- package/dist/esm-node/types/config/output.js +0 -0
- package/dist/esm-node/types/config/performance.js +0 -0
- package/dist/esm-node/types/config/security.js +0 -0
- package/dist/esm-node/types/config/source.js +0 -0
- package/dist/esm-node/types/config/testing.js +0 -0
- package/dist/esm-node/types/config/tools.js +0 -0
- package/dist/esm-node/types/hooks.js +0 -0
- package/dist/esm-node/types/index.js +0 -3
- package/dist/esm-node/types/legacyConfig/deploy.js +0 -0
- package/dist/esm-node/types/legacyConfig/dev.js +0 -0
- package/dist/esm-node/types/legacyConfig/index.js +0 -0
- package/dist/esm-node/types/legacyConfig/output.js +0 -0
- package/dist/esm-node/types/legacyConfig/source.js +0 -0
- package/dist/esm-node/types/legacyConfig/testing.js +0 -0
- package/dist/esm-node/types/legacyConfig/tools.js +0 -0
- package/dist/esm-node/types/utils.js +0 -0
- package/dist/esm-node/utils/config.js +0 -49
- package/dist/esm-node/utils/createServer.js +0 -26
- package/dist/esm-node/utils/env.js +0 -16
- package/dist/esm-node/utils/generateWatchFiles.js +0 -30
- package/dist/esm-node/utils/getSelectedEntries.js +0 -34
- package/dist/esm-node/utils/loadPlugins.js +0 -22
- package/dist/esm-node/utils/printInstructions.js +0 -11
- package/dist/esm-node/utils/register.js +0 -69
- package/dist/esm-node/utils/restart.js +0 -22
- package/dist/esm-node/utils/routes.js +0 -21
- package/dist/esm-node/utils/types.js +0 -0
- package/dist/types/plugins/deploy/platforms/netlifyEntry.d.ts +0 -2
- package/dist/types/plugins/deploy/platforms/vercelEntry.d.ts +0 -2
- /package/dist/cjs/plugins/deploy/platforms/{nodeEntry.js → node-entry.js} +0 -0
- /package/dist/types/plugins/deploy/platforms/{nodeEntry.d.ts → node-entry.d.ts} +0 -0
|
@@ -1,643 +0,0 @@
|
|
|
1
|
-
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
|
-
import { _ as _instanceof } from "@swc/helpers/_/_instanceof";
|
|
3
|
-
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
4
|
-
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
5
|
-
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
|
|
6
|
-
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
7
|
-
import path from "path";
|
|
8
|
-
import os from "node:os";
|
|
9
|
-
import { fs as fse } from "@modern-js/utils";
|
|
10
|
-
import { parseNodeModulePath } from "mlly";
|
|
11
|
-
import { nodeFileTrace } from "@vercel/nft";
|
|
12
|
-
function applyPublicCondition(pkg) {
|
|
13
|
-
var _pkg_publishConfig;
|
|
14
|
-
if (pkg === null || pkg === void 0 ? void 0 : (_pkg_publishConfig = pkg.publishConfig) === null || _pkg_publishConfig === void 0 ? void 0 : _pkg_publishConfig.exports) {
|
|
15
|
-
var _pkg_publishConfig1;
|
|
16
|
-
pkg.exports = pkg === null || pkg === void 0 ? void 0 : (_pkg_publishConfig1 = pkg.publishConfig) === null || _pkg_publishConfig1 === void 0 ? void 0 : _pkg_publishConfig1.exports;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
var writePackage = function() {
|
|
20
|
-
var _ref = _async_to_generator(function(options) {
|
|
21
|
-
var pkg, version, projectDir, _pkgPath, pkgPath, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, src, subpath, dest, dirname, subpath1, dest1, dirname1, err, pkgJSON, packageJsonPath;
|
|
22
|
-
return _ts_generator(this, function(_state) {
|
|
23
|
-
switch (_state.label) {
|
|
24
|
-
case 0:
|
|
25
|
-
pkg = options.pkg, version = options.version, projectDir = options.projectDir, _pkgPath = options._pkgPath;
|
|
26
|
-
pkgPath = _pkgPath || pkg.name;
|
|
27
|
-
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
28
|
-
_state.label = 1;
|
|
29
|
-
case 1:
|
|
30
|
-
_state.trys.push([
|
|
31
|
-
1,
|
|
32
|
-
10,
|
|
33
|
-
11,
|
|
34
|
-
12
|
|
35
|
-
]);
|
|
36
|
-
_iterator = pkg.versions[version].files[Symbol.iterator]();
|
|
37
|
-
_state.label = 2;
|
|
38
|
-
case 2:
|
|
39
|
-
if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done))
|
|
40
|
-
return [
|
|
41
|
-
3,
|
|
42
|
-
9
|
|
43
|
-
];
|
|
44
|
-
src = _step.value;
|
|
45
|
-
if (!src.includes("node_modules"))
|
|
46
|
-
return [
|
|
47
|
-
3,
|
|
48
|
-
5
|
|
49
|
-
];
|
|
50
|
-
subpath = parseNodeModulePath(src).subpath;
|
|
51
|
-
dest = path.join(projectDir, "node_modules", pkgPath, subpath);
|
|
52
|
-
dirname = path.dirname(dest);
|
|
53
|
-
return [
|
|
54
|
-
4,
|
|
55
|
-
fse.ensureDir(dirname)
|
|
56
|
-
];
|
|
57
|
-
case 3:
|
|
58
|
-
_state.sent();
|
|
59
|
-
return [
|
|
60
|
-
4,
|
|
61
|
-
fse.copyFile(src, dest)
|
|
62
|
-
];
|
|
63
|
-
case 4:
|
|
64
|
-
_state.sent();
|
|
65
|
-
return [
|
|
66
|
-
3,
|
|
67
|
-
8
|
|
68
|
-
];
|
|
69
|
-
case 5:
|
|
70
|
-
subpath1 = path.relative(pkg.versions[version].path, src);
|
|
71
|
-
dest1 = path.join(projectDir, "node_modules", pkgPath, subpath1);
|
|
72
|
-
dirname1 = path.dirname(dest1);
|
|
73
|
-
return [
|
|
74
|
-
4,
|
|
75
|
-
fse.ensureDir(dirname1)
|
|
76
|
-
];
|
|
77
|
-
case 6:
|
|
78
|
-
_state.sent();
|
|
79
|
-
return [
|
|
80
|
-
4,
|
|
81
|
-
fse.copyFile(src, dest1)
|
|
82
|
-
];
|
|
83
|
-
case 7:
|
|
84
|
-
_state.sent();
|
|
85
|
-
_state.label = 8;
|
|
86
|
-
case 8:
|
|
87
|
-
_iteratorNormalCompletion = true;
|
|
88
|
-
return [
|
|
89
|
-
3,
|
|
90
|
-
2
|
|
91
|
-
];
|
|
92
|
-
case 9:
|
|
93
|
-
return [
|
|
94
|
-
3,
|
|
95
|
-
12
|
|
96
|
-
];
|
|
97
|
-
case 10:
|
|
98
|
-
err = _state.sent();
|
|
99
|
-
_didIteratorError = true;
|
|
100
|
-
_iteratorError = err;
|
|
101
|
-
return [
|
|
102
|
-
3,
|
|
103
|
-
12
|
|
104
|
-
];
|
|
105
|
-
case 11:
|
|
106
|
-
try {
|
|
107
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
108
|
-
_iterator.return();
|
|
109
|
-
}
|
|
110
|
-
} finally {
|
|
111
|
-
if (_didIteratorError) {
|
|
112
|
-
throw _iteratorError;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return [
|
|
116
|
-
7
|
|
117
|
-
];
|
|
118
|
-
case 12:
|
|
119
|
-
pkgJSON = pkg.versions[version].pkgJSON;
|
|
120
|
-
applyPublicCondition(pkgJSON);
|
|
121
|
-
packageJsonPath = path.join(projectDir, "node_modules", pkgPath, "package.json");
|
|
122
|
-
return [
|
|
123
|
-
4,
|
|
124
|
-
fse.ensureDir(path.dirname(packageJsonPath))
|
|
125
|
-
];
|
|
126
|
-
case 13:
|
|
127
|
-
_state.sent();
|
|
128
|
-
return [
|
|
129
|
-
4,
|
|
130
|
-
fse.writeFile(packageJsonPath, JSON.stringify(pkgJSON, null, 2))
|
|
131
|
-
];
|
|
132
|
-
case 14:
|
|
133
|
-
_state.sent();
|
|
134
|
-
return [
|
|
135
|
-
2
|
|
136
|
-
];
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
return function writePackage2(options) {
|
|
141
|
-
return _ref.apply(this, arguments);
|
|
142
|
-
};
|
|
143
|
-
}();
|
|
144
|
-
var isWindows = os.platform() === "win32";
|
|
145
|
-
var linkPackage = function() {
|
|
146
|
-
var _ref = _async_to_generator(function(from, to, projectRootDir) {
|
|
147
|
-
var src, dest, dstStat, exists;
|
|
148
|
-
return _ts_generator(this, function(_state) {
|
|
149
|
-
switch (_state.label) {
|
|
150
|
-
case 0:
|
|
151
|
-
src = path.join(projectRootDir, "node_modules", from);
|
|
152
|
-
dest = path.join(projectRootDir, "node_modules", to);
|
|
153
|
-
return [
|
|
154
|
-
4,
|
|
155
|
-
fse.lstat(dest).catch(function() {
|
|
156
|
-
return null;
|
|
157
|
-
})
|
|
158
|
-
];
|
|
159
|
-
case 1:
|
|
160
|
-
dstStat = _state.sent();
|
|
161
|
-
exists = dstStat === null || dstStat === void 0 ? void 0 : dstStat.isSymbolicLink();
|
|
162
|
-
if (exists) {
|
|
163
|
-
return [
|
|
164
|
-
2
|
|
165
|
-
];
|
|
166
|
-
}
|
|
167
|
-
return [
|
|
168
|
-
4,
|
|
169
|
-
fse.mkdir(path.dirname(dest), {
|
|
170
|
-
recursive: true
|
|
171
|
-
})
|
|
172
|
-
];
|
|
173
|
-
case 2:
|
|
174
|
-
_state.sent();
|
|
175
|
-
return [
|
|
176
|
-
4,
|
|
177
|
-
fse.symlink(path.relative(path.dirname(dest), src), dest, isWindows ? "junction" : "dir").catch(function(error) {
|
|
178
|
-
console.error("Cannot link", from, "to", to, error);
|
|
179
|
-
})
|
|
180
|
-
];
|
|
181
|
-
case 3:
|
|
182
|
-
_state.sent();
|
|
183
|
-
return [
|
|
184
|
-
2
|
|
185
|
-
];
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
});
|
|
189
|
-
return function linkPackage2(from, to, projectRootDir) {
|
|
190
|
-
return _ref.apply(this, arguments);
|
|
191
|
-
};
|
|
192
|
-
}();
|
|
193
|
-
var readDirRecursive = function() {
|
|
194
|
-
var _ref = _async_to_generator(function(dir) {
|
|
195
|
-
var options, filter, files, filesAndDirs;
|
|
196
|
-
var _arguments = arguments;
|
|
197
|
-
return _ts_generator(this, function(_state) {
|
|
198
|
-
switch (_state.label) {
|
|
199
|
-
case 0:
|
|
200
|
-
options = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {};
|
|
201
|
-
filter = options.filter;
|
|
202
|
-
return [
|
|
203
|
-
4,
|
|
204
|
-
fse.readdir(dir, {
|
|
205
|
-
withFileTypes: true
|
|
206
|
-
})
|
|
207
|
-
];
|
|
208
|
-
case 1:
|
|
209
|
-
files = _state.sent();
|
|
210
|
-
return [
|
|
211
|
-
4,
|
|
212
|
-
Promise.all(files.map(function() {
|
|
213
|
-
var _ref2 = _async_to_generator(function(file) {
|
|
214
|
-
var resolvedPath;
|
|
215
|
-
return _ts_generator(this, function(_state2) {
|
|
216
|
-
resolvedPath = path.resolve(dir, file.name);
|
|
217
|
-
if (file.isDirectory()) {
|
|
218
|
-
return [
|
|
219
|
-
2,
|
|
220
|
-
readDirRecursive(resolvedPath, options)
|
|
221
|
-
];
|
|
222
|
-
} else {
|
|
223
|
-
return [
|
|
224
|
-
2,
|
|
225
|
-
filter && !filter(resolvedPath) ? [] : resolvedPath
|
|
226
|
-
];
|
|
227
|
-
}
|
|
228
|
-
return [
|
|
229
|
-
2
|
|
230
|
-
];
|
|
231
|
-
});
|
|
232
|
-
});
|
|
233
|
-
return function(file) {
|
|
234
|
-
return _ref2.apply(this, arguments);
|
|
235
|
-
};
|
|
236
|
-
}()))
|
|
237
|
-
];
|
|
238
|
-
case 2:
|
|
239
|
-
filesAndDirs = _state.sent();
|
|
240
|
-
return [
|
|
241
|
-
2,
|
|
242
|
-
filesAndDirs.flat()
|
|
243
|
-
];
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
});
|
|
247
|
-
return function readDirRecursive2(dir) {
|
|
248
|
-
return _ref.apply(this, arguments);
|
|
249
|
-
};
|
|
250
|
-
}();
|
|
251
|
-
var isFile = function() {
|
|
252
|
-
var _ref = _async_to_generator(function(file) {
|
|
253
|
-
var stat, error;
|
|
254
|
-
return _ts_generator(this, function(_state) {
|
|
255
|
-
switch (_state.label) {
|
|
256
|
-
case 0:
|
|
257
|
-
_state.trys.push([
|
|
258
|
-
0,
|
|
259
|
-
2,
|
|
260
|
-
,
|
|
261
|
-
3
|
|
262
|
-
]);
|
|
263
|
-
return [
|
|
264
|
-
4,
|
|
265
|
-
fse.stat(file)
|
|
266
|
-
];
|
|
267
|
-
case 1:
|
|
268
|
-
stat = _state.sent();
|
|
269
|
-
return [
|
|
270
|
-
2,
|
|
271
|
-
stat.isFile()
|
|
272
|
-
];
|
|
273
|
-
case 2:
|
|
274
|
-
error = _state.sent();
|
|
275
|
-
if (error.code === "ENOENT") {
|
|
276
|
-
return [
|
|
277
|
-
2,
|
|
278
|
-
false
|
|
279
|
-
];
|
|
280
|
-
}
|
|
281
|
-
throw error;
|
|
282
|
-
case 3:
|
|
283
|
-
return [
|
|
284
|
-
2
|
|
285
|
-
];
|
|
286
|
-
}
|
|
287
|
-
});
|
|
288
|
-
});
|
|
289
|
-
return function isFile2(file) {
|
|
290
|
-
return _ref.apply(this, arguments);
|
|
291
|
-
};
|
|
292
|
-
}();
|
|
293
|
-
var findEntryFiles = function() {
|
|
294
|
-
var _ref = _async_to_generator(function(rootDir, entryFilter) {
|
|
295
|
-
var files;
|
|
296
|
-
return _ts_generator(this, function(_state) {
|
|
297
|
-
switch (_state.label) {
|
|
298
|
-
case 0:
|
|
299
|
-
return [
|
|
300
|
-
4,
|
|
301
|
-
readDirRecursive(rootDir, {
|
|
302
|
-
filter: entryFilter
|
|
303
|
-
})
|
|
304
|
-
];
|
|
305
|
-
case 1:
|
|
306
|
-
files = _state.sent();
|
|
307
|
-
return [
|
|
308
|
-
2,
|
|
309
|
-
files.filter(function(file) {
|
|
310
|
-
return file.endsWith(".mjs") || file.endsWith(".cjs") || file.endsWith(".js");
|
|
311
|
-
})
|
|
312
|
-
];
|
|
313
|
-
}
|
|
314
|
-
});
|
|
315
|
-
});
|
|
316
|
-
return function findEntryFiles2(rootDir, entryFilter) {
|
|
317
|
-
return _ref.apply(this, arguments);
|
|
318
|
-
};
|
|
319
|
-
}();
|
|
320
|
-
var findPackageParents = function(pkg, version, tracedFiles) {
|
|
321
|
-
var versionFiles = pkg.versions[version].files.map(function(path2) {
|
|
322
|
-
return tracedFiles[path2];
|
|
323
|
-
});
|
|
324
|
-
var parentPkgs = _to_consumable_array(new Set(versionFiles.flatMap(function(file) {
|
|
325
|
-
return (
|
|
326
|
-
// Because it supports copyWholePackage configuration, not all files exist.
|
|
327
|
-
file === null || file === void 0 ? void 0 : file.parents.map(function(parentPath) {
|
|
328
|
-
var parentFile = tracedFiles[parentPath];
|
|
329
|
-
if (!parentFile || parentFile.pkgName === pkg.name) {
|
|
330
|
-
return null;
|
|
331
|
-
}
|
|
332
|
-
return "".concat(parentFile.pkgName, "@").concat(parentFile.pkgVersion);
|
|
333
|
-
}).filter(Boolean)
|
|
334
|
-
);
|
|
335
|
-
})));
|
|
336
|
-
return parentPkgs.filter(function(parentPkg) {
|
|
337
|
-
return parentPkg;
|
|
338
|
-
});
|
|
339
|
-
};
|
|
340
|
-
function serializeMap(map) {
|
|
341
|
-
return _serializeMap.apply(this, arguments);
|
|
342
|
-
}
|
|
343
|
-
function _serializeMap() {
|
|
344
|
-
_serializeMap = _async_to_generator(function(map) {
|
|
345
|
-
var resolvedMap;
|
|
346
|
-
return _ts_generator(this, function(_state) {
|
|
347
|
-
switch (_state.label) {
|
|
348
|
-
case 0:
|
|
349
|
-
resolvedMap = /* @__PURE__ */ new Map();
|
|
350
|
-
return [
|
|
351
|
-
4,
|
|
352
|
-
Promise.all(Array.from(map.entries()).map(function() {
|
|
353
|
-
var _ref = _async_to_generator(function(param) {
|
|
354
|
-
var _param, key, value, _, _tmp, _tmp1;
|
|
355
|
-
return _ts_generator(this, function(_state2) {
|
|
356
|
-
switch (_state2.label) {
|
|
357
|
-
case 0:
|
|
358
|
-
_param = _sliced_to_array(param, 2), key = _param[0], value = _param[1];
|
|
359
|
-
_ = resolvedMap.set;
|
|
360
|
-
_tmp = [
|
|
361
|
-
key
|
|
362
|
-
];
|
|
363
|
-
if (!_instanceof(value, Promise))
|
|
364
|
-
return [
|
|
365
|
-
3,
|
|
366
|
-
2
|
|
367
|
-
];
|
|
368
|
-
return [
|
|
369
|
-
4,
|
|
370
|
-
Promise.resolve(value)
|
|
371
|
-
];
|
|
372
|
-
case 1:
|
|
373
|
-
_tmp1 = _state2.sent();
|
|
374
|
-
return [
|
|
375
|
-
3,
|
|
376
|
-
3
|
|
377
|
-
];
|
|
378
|
-
case 2:
|
|
379
|
-
_tmp1 = value;
|
|
380
|
-
_state2.label = 3;
|
|
381
|
-
case 3:
|
|
382
|
-
_.apply(resolvedMap, _tmp.concat([
|
|
383
|
-
_tmp1
|
|
384
|
-
]));
|
|
385
|
-
return [
|
|
386
|
-
2
|
|
387
|
-
];
|
|
388
|
-
}
|
|
389
|
-
});
|
|
390
|
-
});
|
|
391
|
-
return function(_) {
|
|
392
|
-
return _ref.apply(this, arguments);
|
|
393
|
-
};
|
|
394
|
-
}()))
|
|
395
|
-
];
|
|
396
|
-
case 1:
|
|
397
|
-
_state.sent();
|
|
398
|
-
return [
|
|
399
|
-
2,
|
|
400
|
-
JSON.stringify(resolvedMap, function(key, value) {
|
|
401
|
-
if (value === null) {
|
|
402
|
-
return void 0;
|
|
403
|
-
}
|
|
404
|
-
if (_instanceof(value, Map)) {
|
|
405
|
-
return {
|
|
406
|
-
dataType: "Map",
|
|
407
|
-
value: Array.from(value.entries())
|
|
408
|
-
};
|
|
409
|
-
}
|
|
410
|
-
if (_instanceof(value, Set)) {
|
|
411
|
-
return {
|
|
412
|
-
dataType: "Set",
|
|
413
|
-
value: Array.from(value)
|
|
414
|
-
};
|
|
415
|
-
}
|
|
416
|
-
return value;
|
|
417
|
-
})
|
|
418
|
-
];
|
|
419
|
-
}
|
|
420
|
-
});
|
|
421
|
-
});
|
|
422
|
-
return _serializeMap.apply(this, arguments);
|
|
423
|
-
}
|
|
424
|
-
function deserializeMap(serializedData) {
|
|
425
|
-
return JSON.parse(serializedData, function(key, value) {
|
|
426
|
-
if (value && value.dataType === "Map") {
|
|
427
|
-
return new Map(value.value);
|
|
428
|
-
}
|
|
429
|
-
if (value && value.dataType === "Set") {
|
|
430
|
-
return new Set(value.value);
|
|
431
|
-
}
|
|
432
|
-
return value;
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
var loadCache = function() {
|
|
436
|
-
var _ref = _async_to_generator(function(filePath, enabled) {
|
|
437
|
-
var _tmp, data;
|
|
438
|
-
return _ts_generator(this, function(_state) {
|
|
439
|
-
switch (_state.label) {
|
|
440
|
-
case 0:
|
|
441
|
-
_tmp = enabled;
|
|
442
|
-
if (!_tmp)
|
|
443
|
-
return [
|
|
444
|
-
3,
|
|
445
|
-
2
|
|
446
|
-
];
|
|
447
|
-
return [
|
|
448
|
-
4,
|
|
449
|
-
fse.pathExists(filePath)
|
|
450
|
-
];
|
|
451
|
-
case 1:
|
|
452
|
-
_tmp = _state.sent();
|
|
453
|
-
_state.label = 2;
|
|
454
|
-
case 2:
|
|
455
|
-
if (!_tmp)
|
|
456
|
-
return [
|
|
457
|
-
3,
|
|
458
|
-
4
|
|
459
|
-
];
|
|
460
|
-
console.log("load cache:", filePath);
|
|
461
|
-
return [
|
|
462
|
-
4,
|
|
463
|
-
fse.readFile(filePath)
|
|
464
|
-
];
|
|
465
|
-
case 3:
|
|
466
|
-
data = _state.sent().toString();
|
|
467
|
-
return [
|
|
468
|
-
2,
|
|
469
|
-
deserializeMap(data)
|
|
470
|
-
];
|
|
471
|
-
case 4:
|
|
472
|
-
return [
|
|
473
|
-
2,
|
|
474
|
-
void 0
|
|
475
|
-
];
|
|
476
|
-
}
|
|
477
|
-
});
|
|
478
|
-
});
|
|
479
|
-
return function loadCache2(filePath, enabled) {
|
|
480
|
-
return _ref.apply(this, arguments);
|
|
481
|
-
};
|
|
482
|
-
}();
|
|
483
|
-
var writeCache = function() {
|
|
484
|
-
var _ref = _async_to_generator(function(filePath, cacheMap) {
|
|
485
|
-
var newCacheMap, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _step_value, key, value, _, _tmp;
|
|
486
|
-
return _ts_generator(this, function(_state) {
|
|
487
|
-
switch (_state.label) {
|
|
488
|
-
case 0:
|
|
489
|
-
newCacheMap = /* @__PURE__ */ new Map();
|
|
490
|
-
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
491
|
-
try {
|
|
492
|
-
for (_iterator = cacheMap.entries()[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
493
|
-
_step_value = _sliced_to_array(_step.value, 2), key = _step_value[0], value = _step_value[1];
|
|
494
|
-
if (key.includes("node_modules/")) {
|
|
495
|
-
newCacheMap.set(key, value);
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
} catch (err) {
|
|
499
|
-
_didIteratorError = true;
|
|
500
|
-
_iteratorError = err;
|
|
501
|
-
} finally {
|
|
502
|
-
try {
|
|
503
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
504
|
-
_iterator.return();
|
|
505
|
-
}
|
|
506
|
-
} finally {
|
|
507
|
-
if (_didIteratorError) {
|
|
508
|
-
throw _iteratorError;
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
_ = fse.writeFile;
|
|
513
|
-
_tmp = [
|
|
514
|
-
filePath
|
|
515
|
-
];
|
|
516
|
-
return [
|
|
517
|
-
4,
|
|
518
|
-
serializeMap(newCacheMap)
|
|
519
|
-
];
|
|
520
|
-
case 1:
|
|
521
|
-
return [
|
|
522
|
-
4,
|
|
523
|
-
_.apply(fse, _tmp.concat([
|
|
524
|
-
_state.sent()
|
|
525
|
-
]))
|
|
526
|
-
];
|
|
527
|
-
case 2:
|
|
528
|
-
_state.sent();
|
|
529
|
-
console.log("write ".concat(path.basename(filePath), " finish"));
|
|
530
|
-
return [
|
|
531
|
-
2
|
|
532
|
-
];
|
|
533
|
-
}
|
|
534
|
-
});
|
|
535
|
-
});
|
|
536
|
-
return function writeCache2(filePath, cacheMap) {
|
|
537
|
-
return _ref.apply(this, arguments);
|
|
538
|
-
};
|
|
539
|
-
}();
|
|
540
|
-
var traceFiles = function() {
|
|
541
|
-
var _ref = _async_to_generator(function(param) {
|
|
542
|
-
var entryFiles, serverRootDir, _param_base, base, cacheOptions, traceOptions, cacheDir, fileCache, analysisCache, symlinkCache, analysisCacheFile, fileCacheFile, symlinkCacheFile, cache, _tmp, res;
|
|
543
|
-
return _ts_generator(this, function(_state) {
|
|
544
|
-
switch (_state.label) {
|
|
545
|
-
case 0:
|
|
546
|
-
entryFiles = param.entryFiles, serverRootDir = param.serverRootDir, _param_base = param.base, base = _param_base === void 0 ? "/" : _param_base, cacheOptions = param.cacheOptions, traceOptions = param.traceOptions;
|
|
547
|
-
cacheDir = cacheOptions.cacheDir, fileCache = cacheOptions.fileCache, analysisCache = cacheOptions.analysisCache, symlinkCache = cacheOptions.symlinkCache;
|
|
548
|
-
analysisCacheFile = path.join(cacheDir, "analysis-cache.json");
|
|
549
|
-
fileCacheFile = path.join(cacheDir, "file-cache.json");
|
|
550
|
-
symlinkCacheFile = path.join(cacheDir, "symlink-cache.json");
|
|
551
|
-
_tmp = {};
|
|
552
|
-
return [
|
|
553
|
-
4,
|
|
554
|
-
loadCache(analysisCacheFile, analysisCache)
|
|
555
|
-
];
|
|
556
|
-
case 1:
|
|
557
|
-
_tmp.analysisCache = _state.sent();
|
|
558
|
-
return [
|
|
559
|
-
4,
|
|
560
|
-
loadCache(fileCacheFile, fileCache)
|
|
561
|
-
];
|
|
562
|
-
case 2:
|
|
563
|
-
_tmp.fileCache = _state.sent();
|
|
564
|
-
return [
|
|
565
|
-
4,
|
|
566
|
-
loadCache(symlinkCacheFile, symlinkCache)
|
|
567
|
-
];
|
|
568
|
-
case 3:
|
|
569
|
-
cache = (_tmp.symlinkCache = _state.sent(), _tmp);
|
|
570
|
-
return [
|
|
571
|
-
4,
|
|
572
|
-
nodeFileTrace(entryFiles, _object_spread({
|
|
573
|
-
base,
|
|
574
|
-
processCwd: serverRootDir,
|
|
575
|
-
cache
|
|
576
|
-
}, traceOptions))
|
|
577
|
-
];
|
|
578
|
-
case 4:
|
|
579
|
-
res = _state.sent();
|
|
580
|
-
if (!(analysisCache || fileCache || symlinkCache))
|
|
581
|
-
return [
|
|
582
|
-
3,
|
|
583
|
-
6
|
|
584
|
-
];
|
|
585
|
-
return [
|
|
586
|
-
4,
|
|
587
|
-
fse.ensureDir(cacheDir)
|
|
588
|
-
];
|
|
589
|
-
case 5:
|
|
590
|
-
_state.sent();
|
|
591
|
-
if (cache.analysisCache && analysisCache) {
|
|
592
|
-
writeCache(analysisCacheFile, cache.analysisCache);
|
|
593
|
-
}
|
|
594
|
-
if (cache.fileCache && fileCache) {
|
|
595
|
-
writeCache(fileCacheFile, cache.fileCache);
|
|
596
|
-
}
|
|
597
|
-
if (cache.symlinkCache && symlinkCache) {
|
|
598
|
-
writeCache(symlinkCacheFile, cache.symlinkCache);
|
|
599
|
-
}
|
|
600
|
-
_state.label = 6;
|
|
601
|
-
case 6:
|
|
602
|
-
return [
|
|
603
|
-
2,
|
|
604
|
-
res
|
|
605
|
-
];
|
|
606
|
-
}
|
|
607
|
-
});
|
|
608
|
-
});
|
|
609
|
-
return function traceFiles2(_) {
|
|
610
|
-
return _ref.apply(this, arguments);
|
|
611
|
-
};
|
|
612
|
-
}();
|
|
613
|
-
var resolveTracedPath = function() {
|
|
614
|
-
var _ref = _async_to_generator(function(base, p) {
|
|
615
|
-
return _ts_generator(this, function(_state) {
|
|
616
|
-
return [
|
|
617
|
-
2,
|
|
618
|
-
fse.realpath(path.resolve(base, p))
|
|
619
|
-
];
|
|
620
|
-
});
|
|
621
|
-
});
|
|
622
|
-
return function resolveTracedPath2(base, p) {
|
|
623
|
-
return _ref.apply(this, arguments);
|
|
624
|
-
};
|
|
625
|
-
}();
|
|
626
|
-
var isSubPath = function(parentPath, childPath) {
|
|
627
|
-
if (!parentPath || !childPath) {
|
|
628
|
-
return false;
|
|
629
|
-
}
|
|
630
|
-
var relative = path.relative(parentPath, childPath);
|
|
631
|
-
return relative && !relative.startsWith("..");
|
|
632
|
-
};
|
|
633
|
-
export {
|
|
634
|
-
findEntryFiles,
|
|
635
|
-
findPackageParents,
|
|
636
|
-
isFile,
|
|
637
|
-
isSubPath,
|
|
638
|
-
linkPackage,
|
|
639
|
-
readDirRecursive,
|
|
640
|
-
resolveTracedPath,
|
|
641
|
-
traceFiles,
|
|
642
|
-
writePackage
|
|
643
|
-
};
|