@netlify/zip-it-and-ship-it 4.28.2 → 4.28.3
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.
|
@@ -20,15 +20,13 @@ const unixify_1 = __importDefault(require("unixify"));
|
|
|
20
20
|
const fs_1 = require("../../../../utils/fs");
|
|
21
21
|
const base_path_1 = require("../../utils/base_path");
|
|
22
22
|
const included_files_1 = require("../../utils/included_files");
|
|
23
|
-
const es_modules_1 = require("./es_modules");
|
|
24
|
-
const transpile_1 = require("./transpile");
|
|
25
23
|
// Paths that will be excluded from the tracing process.
|
|
26
24
|
const ignore = ['node_modules/aws-sdk/**'];
|
|
27
25
|
const appearsToBeModuleName = (name) => !name.startsWith('.');
|
|
28
26
|
const bundle = ({ basePath, config, mainFile, pluginsModulesPath, repositoryRoot = basePath, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
27
|
const { includedFiles = [], includedFilesBasePath } = config;
|
|
30
28
|
const { exclude: excludedPaths, paths: includedFilePaths } = yield (0, included_files_1.getPathsOfIncludedFiles)(includedFiles, includedFilesBasePath || basePath);
|
|
31
|
-
const { paths: dependencyPaths
|
|
29
|
+
const { paths: dependencyPaths } = yield traceFilesAndTranspile({
|
|
32
30
|
basePath: repositoryRoot,
|
|
33
31
|
config,
|
|
34
32
|
mainFile,
|
|
@@ -42,7 +40,6 @@ const bundle = ({ basePath, config, mainFile, pluginsModulesPath, repositoryRoot
|
|
|
42
40
|
basePath: (0, base_path_1.getBasePath)(dirnames),
|
|
43
41
|
inputs: dependencyPaths,
|
|
44
42
|
mainFile,
|
|
45
|
-
rewrites,
|
|
46
43
|
srcFiles,
|
|
47
44
|
};
|
|
48
45
|
});
|
|
@@ -51,10 +48,10 @@ const ignoreFunction = (path) => {
|
|
|
51
48
|
const shouldIgnore = ignore.some((expression) => (0, minimatch_1.default)(normalizedPath, expression));
|
|
52
49
|
return shouldIgnore;
|
|
53
50
|
};
|
|
54
|
-
const traceFilesAndTranspile = function ({ basePath,
|
|
51
|
+
const traceFilesAndTranspile = function ({ basePath, mainFile, pluginsModulesPath, }) {
|
|
55
52
|
return __awaiter(this, void 0, void 0, function* () {
|
|
56
53
|
const fsCache = {};
|
|
57
|
-
const { fileList: dependencyPaths
|
|
54
|
+
const { fileList: dependencyPaths } = yield (0, nft_1.nodeFileTrace)([mainFile], {
|
|
58
55
|
base: basePath,
|
|
59
56
|
ignore: ignoreFunction,
|
|
60
57
|
readFile: (path) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -86,13 +83,8 @@ const traceFilesAndTranspile = function ({ basePath, config, mainFile, pluginsMo
|
|
|
86
83
|
}),
|
|
87
84
|
});
|
|
88
85
|
const normalizedDependencyPaths = [...dependencyPaths].map((path) => basePath ? (0, path_1.resolve)(basePath, path) : (0, path_1.resolve)(path));
|
|
89
|
-
const esmPaths = [...esmFileList].map((path) => (basePath ? (0, path_1.resolve)(basePath, path) : (0, path_1.resolve)(path)));
|
|
90
|
-
const transpiledPaths = yield (0, transpile_1.transpileMany)(esmPaths, config);
|
|
91
|
-
const patchedESMPackages = yield (0, es_modules_1.getPatchedESMPackages)(esmFileList, reasons, fsCache, basePath);
|
|
92
|
-
const rewrites = new Map([...transpiledPaths, ...patchedESMPackages]);
|
|
93
86
|
return {
|
|
94
87
|
paths: normalizedDependencyPaths,
|
|
95
|
-
rewrites,
|
|
96
88
|
};
|
|
97
89
|
});
|
|
98
90
|
};
|