@yamato-daiwa/automation 0.5.0-alpha.1 → 0.5.0-alpha.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/EntryPoint.js +565 -391
- package/package.json +3 -3
package/EntryPoint.js
CHANGED
|
@@ -5000,7 +5000,11 @@ class PlainCopyingRawSettingsNormalizer {
|
|
|
5000
5000
|
], { alwaysForwardSlashSeparators: true });
|
|
5001
5001
|
sourceAndOutputFilesAbsolutePathsCorrespondenceMapForCurrentGroup.set(sourceFileAbsolutePath, outputFileAbsolutePath);
|
|
5002
5002
|
}
|
|
5003
|
-
(0, es_extensions_1.
|
|
5003
|
+
(0, es_extensions_1.addEntriesToMap)({
|
|
5004
|
+
targetMap: PlainCopyingSharedState_1.default.sourceFilesAbsolutePathsAndRespectiveFilesGroupSettingsCorrespondenceMap,
|
|
5005
|
+
newEntries: sourceAndOutputFilesAbsolutePathsCorrespondenceMapForCurrentGroup,
|
|
5006
|
+
mutably: true
|
|
5007
|
+
});
|
|
5004
5008
|
return {
|
|
5005
5009
|
aliasName,
|
|
5006
5010
|
sourceTopDirectoryAbsolutePath,
|
|
@@ -6571,7 +6575,16 @@ class ECMA_ScriptLogicProcessingRawSettingsNormalizer extends SourceCodeProcessi
|
|
|
6571
6575
|
static createDirectoriesAliasesAndCorrespondingAbsolutePathsMap(typeScriptConfigurationFileAbsolutePath, typeScriptCompilerOptions) {
|
|
6572
6576
|
/* [ TypeScript theory ] If `baseUrl` has been specified in configuration file, once parsed, it will be the
|
|
6573
6577
|
+ absolute path herewith forward slashes path separators. */
|
|
6574
|
-
const typeScriptBasicAbsolutePath = typeScriptCompilerOptions.baseUrl ??
|
|
6578
|
+
const typeScriptBasicAbsolutePath = typeScriptCompilerOptions.baseUrl ??
|
|
6579
|
+
es_extensions_nodejs_1.ImprovedPath.extractDirectoryFromFilePath({
|
|
6580
|
+
targetPath: typeScriptConfigurationFileAbsolutePath,
|
|
6581
|
+
alwaysForwardSlashSeparators: true,
|
|
6582
|
+
ambiguitiesResolution: {
|
|
6583
|
+
mustConsiderLastSegmentWihtoutDotsAsFileNameWithoutExtension: true,
|
|
6584
|
+
mustConsiderLastSegmentStartingWithDotAsDirectory: false,
|
|
6585
|
+
mustConsiderLastSegmentWithNonLeadingDotAsDirectory: false
|
|
6586
|
+
}
|
|
6587
|
+
});
|
|
6575
6588
|
return new Map(Object.entries(typeScriptCompilerOptions.paths ?? {}).map(([rawAlias, rawPaths]) => [
|
|
6576
6589
|
rawAlias.endsWith("/*") ? rawAlias.slice(0, -"/*".length) : rawAlias,
|
|
6577
6590
|
rawPaths.map((rawPath) => es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
@@ -7019,8 +7032,11 @@ const es_extensions_nodejs_1 = __webpack_require__(/*! @yamato-daiwa/es-extensio
|
|
|
7019
7032
|
class ECMA_ScriptLogicProcessor {
|
|
7020
7033
|
static ENTRY_POINTS_AND_PARTIAL_FILES_MAPPING_CACHE_FILE_NAME_WITH_EXTENSION = "ECMA_ScriptEntryPointsAndAffiliatedFilesMappingCache.json";
|
|
7021
7034
|
TASK_NAME_FOR_LOGGING = "ECMAScript logic processing";
|
|
7022
|
-
|
|
7035
|
+
projectBuildingMasterConfigRepresentative;
|
|
7023
7036
|
ECMA_ScriptLogicProcessingConfigRepresentative;
|
|
7037
|
+
webpackConfigurationsForExistingEntryPoints;
|
|
7038
|
+
webpackMultiCompiler;
|
|
7039
|
+
entryPointsSourceFilesAbsolutePathsAndWebpackConfigurationNamesMap;
|
|
7024
7040
|
absolutePathOfFilesWaitingForReProcessing = new Set();
|
|
7025
7041
|
sourceCodeSelectiveReprocessingHelper;
|
|
7026
7042
|
subsequentFilesStateChangeTimeout = null;
|
|
@@ -7030,57 +7046,66 @@ class ECMA_ScriptLogicProcessor {
|
|
|
7030
7046
|
return (callback) => { callback(); };
|
|
7031
7047
|
}
|
|
7032
7048
|
const dataHoldingSelfInstance = new ECMA_ScriptLogicProcessor(ecmaScriptLogicProcessingSettingsRepresentative, projectBuildingMasterConfigRepresentative);
|
|
7033
|
-
const webpackConfigurationsForExistingEntryPoints = [];
|
|
7034
|
-
const entryPointsSourceFilesAbsolutePathsAndWebpackConfigurationNamesMap = new Map();
|
|
7035
|
-
for (const [index, ECMA_ScriptLogicEntryPointsGroupSettings] of Array.from(ecmaScriptLogicProcessingSettingsRepresentative.relevantEntryPointsGroupsSettings.values()).entries()) {
|
|
7036
|
-
const entryPointsSourceFileAbsolutePaths = es_extensions_nodejs_1.ImprovedGlob.getFilesAbsolutePathsSynchronously(ECMA_ScriptLogicEntryPointsGroupSettings.sourceFilesGlobSelectors, { alwaysForwardSlashSeparators: true });
|
|
7037
|
-
if (entryPointsSourceFileAbsolutePaths.length === 0) {
|
|
7038
|
-
es_extensions_1.Logger.logWarning({
|
|
7039
|
-
title: "ECMAScript logic Entry Points Not Found",
|
|
7040
|
-
description: `No ECMAScript entry points has been found for group "${ECMA_ScriptLogicEntryPointsGroupSettings.ID}".` +
|
|
7041
|
-
"Please restart the project building once they will be added."
|
|
7042
|
-
});
|
|
7043
|
-
continue;
|
|
7044
|
-
}
|
|
7045
|
-
webpackConfigurationsForExistingEntryPoints.push(WebpackConfigGenerator_1.default.generateWebpackConfigurationForEntryPointsGroupWithExistingFiles({
|
|
7046
|
-
entryPointsSourceFilesAbsolutePaths: entryPointsSourceFileAbsolutePaths,
|
|
7047
|
-
ECMA_ScriptLogicEntryPointsGroupSettings,
|
|
7048
|
-
ECMA_ScriptLogicProcessingConfigRepresentative: ecmaScriptLogicProcessingSettingsRepresentative,
|
|
7049
|
-
masterConfigRepresentative: projectBuildingMasterConfigRepresentative,
|
|
7050
|
-
mustProvideTypeScriptTypeChecking: index === 0
|
|
7051
|
-
}));
|
|
7052
|
-
(0, es_extensions_1.addMultiplePairsToMap)(entryPointsSourceFilesAbsolutePathsAndWebpackConfigurationNamesMap, entryPointsSourceFileAbsolutePaths.map((entryPointsSourceFileAbsolutePath) => [entryPointsSourceFileAbsolutePath, ECMA_ScriptLogicEntryPointsGroupSettings.ID]));
|
|
7053
|
-
}
|
|
7054
7049
|
return (gulpCallback) => {
|
|
7055
7050
|
try {
|
|
7056
|
-
|
|
7057
|
-
(0, webpack_1.default)(webpackConfigurationsForExistingEntryPoints, dataHoldingSelfInstance.generateWebpackCallback(gulpCallback));
|
|
7051
|
+
dataHoldingSelfInstance.webpackMultiCompiler.run(dataHoldingSelfInstance.generateWebpackCallback(gulpCallback));
|
|
7058
7052
|
}
|
|
7059
7053
|
catch (error) {
|
|
7060
7054
|
/* [ Theory ] Once reached here, the Gulp tasks chain will collapse whatever will callback called to no. */
|
|
7061
7055
|
es_extensions_1.Logger.logError({
|
|
7062
7056
|
errorType: es_extensions_1.UnexpectedEventError.NAME,
|
|
7063
7057
|
title: es_extensions_1.UnexpectedEventError.localization.defaultTitle,
|
|
7064
|
-
description: "
|
|
7065
|
-
"
|
|
7058
|
+
description: "The error emitted by Webpack has been caught while no error catching required according the official" +
|
|
7059
|
+
"documentation: https://webpack.js.org/api/node/",
|
|
7066
7060
|
occurrenceLocation: "ECMA_ScriptLogicProcessor.provideLogicProcessing(projectBuildingMasterConfigRepresentative)",
|
|
7067
7061
|
caughtError: error
|
|
7068
7062
|
});
|
|
7069
7063
|
}
|
|
7064
|
+
gulpCallback();
|
|
7070
7065
|
};
|
|
7071
7066
|
}
|
|
7072
7067
|
constructor(ecmaScriptLogicProcessingConfigRepresentative, masterConfigRepresentative) {
|
|
7073
7068
|
this.ECMA_ScriptLogicProcessingConfigRepresentative = ecmaScriptLogicProcessingConfigRepresentative;
|
|
7074
|
-
this.
|
|
7075
|
-
|
|
7069
|
+
this.projectBuildingMasterConfigRepresentative = masterConfigRepresentative;
|
|
7070
|
+
const webpackConfigurationsForExistingEntryPoints = [];
|
|
7071
|
+
const entryPointsSourceFilesAbsolutePathsAndWebpackConfigurationNamesMap = new Map();
|
|
7072
|
+
for (const [index, ECMA_ScriptLogicEntryPointsGroupSettings] of Array.from(this.ECMA_ScriptLogicProcessingConfigRepresentative.relevantEntryPointsGroupsSettings.values()).entries()) {
|
|
7073
|
+
const entryPointsSourceFilesAbsolutePaths = es_extensions_nodejs_1.ImprovedGlob.getFilesAbsolutePathsSynchronously(ECMA_ScriptLogicEntryPointsGroupSettings.sourceFilesGlobSelectors, { alwaysForwardSlashSeparators: true });
|
|
7074
|
+
if (entryPointsSourceFilesAbsolutePaths.length === 0) {
|
|
7075
|
+
es_extensions_1.Logger.logWarning({
|
|
7076
|
+
title: "ECMAScript Logic Entry Points Not Found",
|
|
7077
|
+
description: `No ECMAScript entry points has been found for group "${ECMA_ScriptLogicEntryPointsGroupSettings.ID}". ` +
|
|
7078
|
+
"Please restart the project building once they will be added."
|
|
7079
|
+
});
|
|
7080
|
+
continue;
|
|
7081
|
+
}
|
|
7082
|
+
webpackConfigurationsForExistingEntryPoints.push(WebpackConfigGenerator_1.default.generateWebpackConfigurationForEntryPointsGroupWithExistingFiles({
|
|
7083
|
+
entryPointsSourceFilesAbsolutePaths,
|
|
7084
|
+
ECMA_ScriptLogicEntryPointsGroupSettings,
|
|
7085
|
+
ECMA_ScriptLogicProcessingConfigRepresentative: this.ECMA_ScriptLogicProcessingConfigRepresentative,
|
|
7086
|
+
masterConfigRepresentative: this.projectBuildingMasterConfigRepresentative,
|
|
7087
|
+
mustProvideTypeScriptTypeChecking: index === 0
|
|
7088
|
+
}));
|
|
7089
|
+
(0, es_extensions_1.addEntriesToMap)({
|
|
7090
|
+
targetMap: entryPointsSourceFilesAbsolutePathsAndWebpackConfigurationNamesMap,
|
|
7091
|
+
newEntries: entryPointsSourceFilesAbsolutePaths.map((entryPointsSourceFileAbsolutePath) => [entryPointsSourceFileAbsolutePath, ECMA_ScriptLogicEntryPointsGroupSettings.ID]),
|
|
7092
|
+
mutably: true
|
|
7093
|
+
});
|
|
7094
|
+
}
|
|
7095
|
+
this.webpackConfigurationsForExistingEntryPoints = webpackConfigurationsForExistingEntryPoints;
|
|
7096
|
+
this.webpackMultiCompiler = (0, webpack_1.default)(this.webpackConfigurationsForExistingEntryPoints);
|
|
7097
|
+
this.entryPointsSourceFilesAbsolutePathsAndWebpackConfigurationNamesMap =
|
|
7098
|
+
entryPointsSourceFilesAbsolutePathsAndWebpackConfigurationNamesMap;
|
|
7099
|
+
if (this.projectBuildingMasterConfigRepresentative.mustProvideIncrementalBuilding) {
|
|
7076
7100
|
this.sourceCodeSelectiveReprocessingHelper = new SourceCodeSelectiveReprocessingHelper_1.default({
|
|
7077
7101
|
initialEntryPointsSourceFilesAbsolutePaths: this.ECMA_ScriptLogicProcessingConfigRepresentative.initialRelevantEntryPointsSourceFilesAbsolutePaths,
|
|
7078
|
-
|
|
7079
|
-
|
|
7080
|
-
|
|
7102
|
+
childrenFilesResolutionRules: {
|
|
7103
|
+
childrenFilesIncludingDeclarationsPatterns: ECMA_ScriptSpecialist_1.default.partialFilesIncludingDeclarationPatterns,
|
|
7104
|
+
implicitFilesNamesExtensionsWithoutLeadingDotsOfChildrenFiles: this.ECMA_ScriptLogicProcessingConfigRepresentative.
|
|
7081
7105
|
supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots
|
|
7082
7106
|
},
|
|
7083
|
-
directoriesAliasesAndTheirAbsolutePatsMap:
|
|
7107
|
+
directoriesAliasesAndTheirAbsolutePatsMap: ECMA_ScriptLogicProcessor.
|
|
7108
|
+
generateUnifiedDirectoriesAliasesAndTheirAbsolutePatsMapForSourceCodeSelectiveReprocessingHelper(this.ECMA_ScriptLogicProcessingConfigRepresentative),
|
|
7084
7109
|
isEntryPoint: this.ECMA_ScriptLogicProcessingConfigRepresentative.
|
|
7085
7110
|
isEntryPoint.
|
|
7086
7111
|
bind(this.ECMA_ScriptLogicProcessingConfigRepresentative),
|
|
@@ -7090,7 +7115,7 @@ class ECMA_ScriptLogicProcessor {
|
|
|
7090
7115
|
targetFilesTypeInSingularForm: this.ECMA_ScriptLogicProcessingConfigRepresentative.
|
|
7091
7116
|
TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM
|
|
7092
7117
|
},
|
|
7093
|
-
consumingProjectRootDirectoryAbsolutePath: this.
|
|
7118
|
+
consumingProjectRootDirectoryAbsolutePath: this.projectBuildingMasterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath,
|
|
7094
7119
|
cacheFileAbsolutePath: es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
7095
7120
|
DotYDA_DirectoryManager_1.default.OPTIMIZATION_FILES_DIRECTORY_ABSOLUTE_PATH,
|
|
7096
7121
|
ECMA_ScriptLogicProcessor.ENTRY_POINTS_AND_PARTIAL_FILES_MAPPING_CACHE_FILE_NAME_WITH_EXTENSION
|
|
@@ -7099,7 +7124,7 @@ class ECMA_ScriptLogicProcessor {
|
|
|
7099
7124
|
ECMA_ScriptSourceFilesWatcher_1.default.
|
|
7100
7125
|
initializeIfRequiredAndGetInstance({
|
|
7101
7126
|
ecmaScriptLogicProcessingSettingsRepresentative: this.ECMA_ScriptLogicProcessingConfigRepresentative,
|
|
7102
|
-
projectBuildingMasterConfigRepresentative: this.
|
|
7127
|
+
projectBuildingMasterConfigRepresentative: this.projectBuildingMasterConfigRepresentative
|
|
7103
7128
|
}).
|
|
7104
7129
|
addOnAnyEventRelatedWithActualFilesHandler({
|
|
7105
7130
|
handlerID: "ON_ANY_EVENT_WITH_ECMA_SCRIPT_LOGIC_SOURCE_CODE_FILE--BY_ECMA_SCRIPT_LOGIC_PROCESSOR",
|
|
@@ -7123,8 +7148,16 @@ class ECMA_ScriptLogicProcessor {
|
|
|
7123
7148
|
clearTimeout(this.subsequentFilesStateChangeTimeout);
|
|
7124
7149
|
}
|
|
7125
7150
|
this.subsequentFilesStateChangeTimeout = setTimeout(() => {
|
|
7126
|
-
const
|
|
7151
|
+
const absolutePathOfEntryPointsWhichMustBeReprocessed__forwardSlashSeparators = this.sourceCodeSelectiveReprocessingHelper?.getAbsolutePathsOfEntryPointsWhichMustBeProcessed(this.absolutePathOfFilesWaitingForReProcessing) ??
|
|
7127
7152
|
[];
|
|
7153
|
+
const actualConfigurationsNames = Array.from((0, es_extensions_1.filterMap)(this.entryPointsSourceFilesAbsolutePathsAndWebpackConfigurationNamesMap, (targetEntryPointAbsolutePath__forwardSlashSeparators) => absolutePathOfEntryPointsWhichMustBeReprocessed__forwardSlashSeparators.
|
|
7154
|
+
includes(targetEntryPointAbsolutePath__forwardSlashSeparators)).values());
|
|
7155
|
+
if (actualConfigurationsNames.length === 1) {
|
|
7156
|
+
(0, es_extensions_1.getArrayElementSatisfiesThePredicateIfSuchElementIsExactlyOne)(this.webpackMultiCompiler.compilers, (webpackCompiler) => webpackCompiler.name === actualConfigurationsNames[0], { mustThrowErrorIfElementNotFoundOrMatchesAreMultiple: true }).run(this.generateWebpackCallback());
|
|
7157
|
+
}
|
|
7158
|
+
else if (actualConfigurationsNames.length > 1) {
|
|
7159
|
+
this.webpackMultiCompiler.run(this.generateWebpackCallback());
|
|
7160
|
+
}
|
|
7128
7161
|
this.absolutePathOfFilesWaitingForReProcessing.clear();
|
|
7129
7162
|
}, (0, es_extensions_1.secondsToMilliseconds)(1));
|
|
7130
7163
|
}
|
|
@@ -7135,7 +7168,15 @@ class ECMA_ScriptLogicProcessor {
|
|
|
7135
7168
|
}
|
|
7136
7169
|
let finalErrorMessageDynamicPart;
|
|
7137
7170
|
/* [ Webpack theory ] Even there is no hard error braking the build, there are could be the soft errors. */
|
|
7138
|
-
|
|
7171
|
+
let softErrors = [];
|
|
7172
|
+
if (statistics instanceof webpack_1.default.Stats) {
|
|
7173
|
+
softErrors = statistics.compilation.errors;
|
|
7174
|
+
/* [ Theory ]
|
|
7175
|
+
* `statistics instanceof Webpack.MultiStats` will fail because actually there is no `Webpack.MultiStats` class. */
|
|
7176
|
+
}
|
|
7177
|
+
else if ((0, es_extensions_1.isNotUndefined)(statistics)) {
|
|
7178
|
+
softErrors = statistics.stats[0]?.compilation.errors;
|
|
7179
|
+
}
|
|
7139
7180
|
if ((0, es_extensions_1.isNeitherUndefinedNorNull)(hardError)) {
|
|
7140
7181
|
finalErrorMessageDynamicPart = hardError.message;
|
|
7141
7182
|
}
|
|
@@ -7154,8 +7195,8 @@ class ECMA_ScriptLogicProcessor {
|
|
|
7154
7195
|
message: "Error has occurred. Please check the console."
|
|
7155
7196
|
});
|
|
7156
7197
|
}
|
|
7157
|
-
|
|
7158
|
-
|
|
7198
|
+
if (!this.projectBuildingMasterConfigRepresentative.mustProvideIncrementalBuilding &&
|
|
7199
|
+
(0, es_extensions_1.isNotUndefined)(finalErrorMessageDynamicPart)) {
|
|
7159
7200
|
es_extensions_1.Logger.logError({
|
|
7160
7201
|
errorType: "ECMA_ScriptLogicProcessingError",
|
|
7161
7202
|
title: "ECMAScript logic processing error",
|
|
@@ -7165,11 +7206,33 @@ class ECMA_ScriptLogicProcessor {
|
|
|
7165
7206
|
gulpCallback?.(new Error(finalErrorMessageDynamicPart));
|
|
7166
7207
|
}
|
|
7167
7208
|
else {
|
|
7168
|
-
(0, es_extensions_1.
|
|
7209
|
+
(0, es_extensions_1.addEntriesToMap)({
|
|
7210
|
+
targetMap: ECMA_ScriptLogicProcessingSharedState_1.default.sourceFilesAbsolutePathsAndOutputFilesActualPathsMap,
|
|
7211
|
+
newEntries: ECMA_ScriptLogicEntryPointsSourceFilesAbsolutePathsAndOutputFilesActualPathsMapGenerator_1.default.generate(this.ECMA_ScriptLogicProcessingConfigRepresentative),
|
|
7212
|
+
mutably: true
|
|
7213
|
+
});
|
|
7169
7214
|
gulpCallback?.();
|
|
7170
7215
|
}
|
|
7171
7216
|
};
|
|
7172
7217
|
}
|
|
7218
|
+
/* [ Theory ] Although it is a rare case, same directory alias (e.g. "@components") could refer to different
|
|
7219
|
+
* directory depending on entry points group. Because the `SourceCodeSelectiveReprocessingHelper` does not
|
|
7220
|
+
* respect the specific entry points group, all aliases definition must be merged herewith wihtout overwriting. */
|
|
7221
|
+
static generateUnifiedDirectoriesAliasesAndTheirAbsolutePatsMapForSourceCodeSelectiveReprocessingHelper(ecmaScriptLogicProcessingConfigRepresentative) {
|
|
7222
|
+
const unifiedDirectoriesAliasesAndTheirAbsolutePatsMap = new Map();
|
|
7223
|
+
for (const entryPointsGroup of ecmaScriptLogicProcessingConfigRepresentative.relevantEntryPointsGroupsSettings.values()) {
|
|
7224
|
+
for (const [directoryAlias, correspondingDirectoriesAbsolutePaths] of entryPointsGroup.directoriesAliasesAndCorrespondingAbsolutePathsMap) {
|
|
7225
|
+
const alreadyRegisteredCorrespondingDirectoriesAbsolutePaths = unifiedDirectoriesAliasesAndTheirAbsolutePatsMap.get(directoryAlias);
|
|
7226
|
+
if ((0, es_extensions_1.isUndefined)(alreadyRegisteredCorrespondingDirectoriesAbsolutePaths)) {
|
|
7227
|
+
unifiedDirectoriesAliasesAndTheirAbsolutePatsMap.set(directoryAlias, new Set(correspondingDirectoriesAbsolutePaths));
|
|
7228
|
+
}
|
|
7229
|
+
else {
|
|
7230
|
+
(0, es_extensions_1.addMultipleElementsToSet)(alreadyRegisteredCorrespondingDirectoriesAbsolutePaths, correspondingDirectoriesAbsolutePaths);
|
|
7231
|
+
}
|
|
7232
|
+
}
|
|
7233
|
+
}
|
|
7234
|
+
return unifiedDirectoriesAliasesAndTheirAbsolutePatsMap;
|
|
7235
|
+
}
|
|
7173
7236
|
}
|
|
7174
7237
|
exports["default"] = ECMA_ScriptLogicProcessor;
|
|
7175
7238
|
|
|
@@ -7973,7 +8036,6 @@ class WebpackConfigGenerator {
|
|
|
7973
8036
|
supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots.
|
|
7974
8037
|
map((fileNameExtensionWithoutDot) => `.${fileNameExtensionWithoutDot}`),
|
|
7975
8038
|
alias: {
|
|
7976
|
-
//
|
|
7977
8039
|
...WebpackSpecialist_1.default.convertPathsAliasesFromTypeScriptFormatToWebpackFormat({
|
|
7978
8040
|
typeScriptPathsSettings: typeScriptCompilerOptions.paths,
|
|
7979
8041
|
typeScriptBasicAbsolutePath: typeScriptCompilerOptions.baseUrl ??
|
|
@@ -8840,9 +8902,9 @@ class MarkupProcessor extends GulpStreamsBasedTaskExecutor_1.default {
|
|
|
8840
8902
|
dataHoldingSelfInstance.sourceCodeSelectiveReprocessingHelper = new SourceCodeSelectiveReprocessingHelper_1.default({
|
|
8841
8903
|
initialEntryPointsSourceFilesAbsolutePaths: markupProcessingSettingsRepresentative.
|
|
8842
8904
|
initialRelevantEntryPointsSourceFilesAbsolutePaths,
|
|
8843
|
-
|
|
8844
|
-
|
|
8845
|
-
|
|
8905
|
+
childrenFilesResolutionRules: {
|
|
8906
|
+
childrenFilesIncludingDeclarationsPatterns: PugPreProcessorSpecialist_1.default.partialFilesIncludingDeclarationPatterns,
|
|
8907
|
+
implicitFilesNamesExtensionsWithoutLeadingDotsOfChildrenFiles: PugPreProcessorSpecialist_1.default.
|
|
8846
8908
|
implicitFilesNamesExtensionsWithoutLeadingDotsOfPartials
|
|
8847
8909
|
},
|
|
8848
8910
|
isEntryPoint: markupProcessingSettingsRepresentative.isEntryPoint.bind(markupProcessingSettingsRepresentative),
|
|
@@ -12069,7 +12131,7 @@ class RoutingSettingsNormalizer {
|
|
|
12069
12131
|
occurrenceLocation: "RoutingSettingsNormalizer.normalizeDepthLevelWiseRecursively(...parameters)"
|
|
12070
12132
|
});
|
|
12071
12133
|
}
|
|
12072
|
-
RoutingSettingsNormalizer.routingPathSegments.push(RoutingSettingsNormalizer.routingPathSegments.length === 0 ? "" : "$children");
|
|
12134
|
+
RoutingSettingsNormalizer.routingPathSegments.push(...RoutingSettingsNormalizer.routingPathSegments.length === 0 ? [""] : ["$children", ""]);
|
|
12073
12135
|
for (const [routeKey, rawRoute] of Object.entries(rawRoutingOfSpecificDepthLevel)) {
|
|
12074
12136
|
RoutingSettingsNormalizer.routingPathSegments[RoutingSettingsNormalizer.routingPathSegments.length - 1] = routeKey;
|
|
12075
12137
|
if (!(0, es_extensions_1.isArbitraryObject)(rawRoute)) {
|
|
@@ -12093,7 +12155,6 @@ class RoutingSettingsNormalizer {
|
|
|
12093
12155
|
localization
|
|
12094
12156
|
})
|
|
12095
12157
|
} : null,
|
|
12096
|
-
// TODO ========================================================================================================
|
|
12097
12158
|
...(0, es_extensions_1.isArbitraryObject)(rawRoute.$sectioning) ? {
|
|
12098
12159
|
$sectioning: RoutingSettingsNormalizer.normalizeSectioning(rawRoute.$sectioning, routeURI, localization)
|
|
12099
12160
|
} : null
|
|
@@ -12220,57 +12281,81 @@ class RoutingSettingsNormalizer {
|
|
|
12220
12281
|
}
|
|
12221
12282
|
return headingWorkpiece;
|
|
12222
12283
|
}
|
|
12223
|
-
// TODO ==============================================================================================================
|
|
12224
12284
|
/* ━━━ Sectioning ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
12225
12285
|
static normalizeSectioning(rawSectioningSpecification, parentRouteURI, localization) {
|
|
12226
12286
|
RoutingSettingsNormalizer.routingPathSegments.push("$sectioning");
|
|
12287
|
+
if (!(0, es_extensions_1.isString)(parentRouteURI)) {
|
|
12288
|
+
es_extensions_1.Logger.throwErrorAndLog({
|
|
12289
|
+
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12290
|
+
customMessage: `The sectioning at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}" has been defined ` +
|
|
12291
|
+
"while the $URI of the parent route has not been. " +
|
|
12292
|
+
"It must be defined to compute the URI for each section."
|
|
12293
|
+
}),
|
|
12294
|
+
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12295
|
+
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)"
|
|
12296
|
+
});
|
|
12297
|
+
}
|
|
12227
12298
|
if (!(0, es_extensions_1.isNonEmptyString)(rawSectioningSpecification.$specificationFileRelativePath)) {
|
|
12228
12299
|
es_extensions_1.Logger.throwErrorAndLog({
|
|
12229
12300
|
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12230
|
-
customMessage:
|
|
12231
|
-
|
|
12301
|
+
customMessage: `Malformed routing at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}.` +
|
|
12302
|
+
"$specificationFileRelativePath\"." +
|
|
12232
12303
|
"The \"$sectioning.$specificationFileRelativePath\" must be defined with the valid file path relative " +
|
|
12233
|
-
|
|
12234
|
-
].join(" ")
|
|
12304
|
+
"to project top directory."
|
|
12235
12305
|
}),
|
|
12236
12306
|
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12237
|
-
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(
|
|
12307
|
+
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)"
|
|
12238
12308
|
});
|
|
12239
12309
|
}
|
|
12240
|
-
const
|
|
12241
|
-
|
|
12242
|
-
|
|
12243
|
-
|
|
12244
|
-
|
|
12245
|
-
|
|
12246
|
-
|
|
12247
|
-
|
|
12248
|
-
|
|
12310
|
+
const rawSectioningSchemaFileAbsolutePath = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
12311
|
+
RoutingSettingsNormalizer.projectRootDirectoryAbsolutePath,
|
|
12312
|
+
rawSectioningSpecification.$specificationFileRelativePath
|
|
12313
|
+
], { alwaysForwardSlashSeparators: true });
|
|
12314
|
+
let rawSectioningSchema;
|
|
12315
|
+
try {
|
|
12316
|
+
rawSectioningSchema = es_extensions_nodejs_1.ObjectDataFilesProcessor.processFile({
|
|
12317
|
+
filePath: es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
12318
|
+
RoutingSettingsNormalizer.projectRootDirectoryAbsolutePath,
|
|
12319
|
+
rawSectioningSpecification.$specificationFileRelativePath
|
|
12320
|
+
]),
|
|
12321
|
+
synchronously: true,
|
|
12322
|
+
schema: es_extensions_nodejs_1.ObjectDataFilesProcessor.SupportedSchemas.YAML
|
|
12323
|
+
});
|
|
12324
|
+
}
|
|
12325
|
+
catch (error) {
|
|
12249
12326
|
es_extensions_1.Logger.throwErrorAndLog({
|
|
12250
12327
|
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12251
|
-
customMessage:
|
|
12252
|
-
`
|
|
12253
|
-
`Must be an object while ${typeof rawSectioning} found.`
|
|
12254
|
-
].join(" ")
|
|
12328
|
+
customMessage: "The error has occurred during the reading of sectioning file at " +
|
|
12329
|
+
`"${rawSectioningSpecification.$specificationFileRelativePath}".`
|
|
12255
12330
|
}),
|
|
12256
12331
|
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12257
|
-
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(
|
|
12332
|
+
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)",
|
|
12333
|
+
innerError: error
|
|
12258
12334
|
});
|
|
12259
12335
|
}
|
|
12260
|
-
|
|
12336
|
+
RoutingSettingsNormalizer.cachedAbsolutePathsOfSectioning.add(rawSectioningSchemaFileAbsolutePath);
|
|
12337
|
+
if (!(0, es_extensions_1.isArbitraryObject)(rawSectioningSchema)) {
|
|
12261
12338
|
es_extensions_1.Logger.throwErrorAndLog({
|
|
12262
12339
|
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12263
|
-
customMessage: `
|
|
12264
|
-
|
|
12265
|
-
"It must be defined to compute the URI for each section."
|
|
12340
|
+
customMessage: `Malformed sectioning at "${rawSectioningSpecification.$specificationFileRelativePath}". ` +
|
|
12341
|
+
`Must be an object while ${typeof (0, es_extensions_1.nullToUndefined)(rawSectioningSchema)} found.`
|
|
12266
12342
|
}),
|
|
12267
12343
|
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12268
|
-
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(
|
|
12344
|
+
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)"
|
|
12269
12345
|
});
|
|
12270
12346
|
}
|
|
12271
12347
|
if ((0, es_extensions_1.isArbitraryObject)(rawSectioningSpecification.$localizations)) {
|
|
12272
12348
|
if ((0, es_extensions_1.isUndefined)(localization)) {
|
|
12273
|
-
|
|
12349
|
+
es_extensions_1.Logger.throwErrorAndLog({
|
|
12350
|
+
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12351
|
+
customMessage: "The $localizations has been specified for sectioning " +
|
|
12352
|
+
`"${RoutingSettingsNormalizer.routingPathSegments.join(".")}", but common localizations for ` +
|
|
12353
|
+
"routing has not been. " +
|
|
12354
|
+
"Specify the $localizations property also in routing configuration."
|
|
12355
|
+
}),
|
|
12356
|
+
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12357
|
+
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)"
|
|
12358
|
+
});
|
|
12274
12359
|
}
|
|
12275
12360
|
const targetLocalizationFileRelativePath = rawSectioningSpecification.$localizations[localization.locale];
|
|
12276
12361
|
RoutingSettingsNormalizer.routingPathSegments.push("$localizations", localization.locale);
|
|
@@ -12279,30 +12364,42 @@ class RoutingSettingsNormalizer {
|
|
|
12279
12364
|
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12280
12365
|
customMessage: "Invalid path to sectioning localization at " +
|
|
12281
12366
|
`"${RoutingSettingsNormalizer.routingPathSegments.join(".")}". ` +
|
|
12282
|
-
|
|
12367
|
+
"Must be the string with file path relative to project root directory, " +
|
|
12368
|
+
`${typeof (0, es_extensions_1.nullToUndefined)(targetLocalizationFileRelativePath)} found.`
|
|
12283
12369
|
}),
|
|
12284
12370
|
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12285
|
-
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(
|
|
12371
|
+
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)"
|
|
12286
12372
|
});
|
|
12287
12373
|
}
|
|
12288
|
-
const
|
|
12289
|
-
|
|
12290
|
-
|
|
12291
|
-
|
|
12292
|
-
|
|
12293
|
-
|
|
12294
|
-
|
|
12374
|
+
const targetLocalizationFileAbsolutePath = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([RoutingSettingsNormalizer.projectRootDirectoryAbsolutePath, targetLocalizationFileRelativePath], { alwaysForwardSlashSeparators: true });
|
|
12375
|
+
let sectioningRawLocalization;
|
|
12376
|
+
try {
|
|
12377
|
+
sectioningRawLocalization = es_extensions_nodejs_1.ObjectDataFilesProcessor.processFile({
|
|
12378
|
+
filePath: targetLocalizationFileAbsolutePath,
|
|
12379
|
+
synchronously: true,
|
|
12380
|
+
schema: es_extensions_nodejs_1.ObjectDataFilesProcessor.SupportedSchemas.YAML
|
|
12381
|
+
});
|
|
12382
|
+
}
|
|
12383
|
+
catch (error) {
|
|
12384
|
+
es_extensions_1.Logger.throwErrorAndLog({
|
|
12385
|
+
errorInstance: new es_extensions_1.FileReadingFailedError({ filePath: targetLocalizationFileAbsolutePath }),
|
|
12386
|
+
title: es_extensions_1.FileReadingFailedError.localization.defaultTitle,
|
|
12387
|
+
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)",
|
|
12388
|
+
innerError: error
|
|
12389
|
+
});
|
|
12390
|
+
}
|
|
12391
|
+
RoutingSettingsNormalizer.cachedAbsolutePathsOfSectioning.add(targetLocalizationFileAbsolutePath);
|
|
12295
12392
|
if (!(0, es_extensions_1.isArbitraryObject)(sectioningRawLocalization)) {
|
|
12296
12393
|
es_extensions_1.Logger.throwErrorAndLog({
|
|
12297
12394
|
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12298
|
-
customMessage: `Malformed sectioning localization at "${
|
|
12395
|
+
customMessage: `Malformed sectioning localization at "${targetLocalizationFileAbsolutePath}".`
|
|
12299
12396
|
}),
|
|
12300
12397
|
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12301
|
-
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(
|
|
12398
|
+
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)"
|
|
12302
12399
|
});
|
|
12303
12400
|
}
|
|
12304
12401
|
const normalizedLocalizedSectioning = RoutingSettingsNormalizer.normalizeSectioningDepthLevelRecursively({
|
|
12305
|
-
rawSectioningOfSpecificDepthLevel:
|
|
12402
|
+
rawSectioningOfSpecificDepthLevel: rawSectioningSchema,
|
|
12306
12403
|
outputWorkpiece: {},
|
|
12307
12404
|
localization: {
|
|
12308
12405
|
locale: localization.locale,
|
|
@@ -12310,11 +12407,12 @@ class RoutingSettingsNormalizer {
|
|
|
12310
12407
|
},
|
|
12311
12408
|
parentRouteURI
|
|
12312
12409
|
});
|
|
12313
|
-
|
|
12410
|
+
/* eslint-disable-next-line @typescript-eslint/no-magic-numbers -- `$localizations` and `localization.locale` */
|
|
12411
|
+
RoutingSettingsNormalizer.routingPathSegments.splice(-2);
|
|
12314
12412
|
return normalizedLocalizedSectioning;
|
|
12315
12413
|
}
|
|
12316
12414
|
return RoutingSettingsNormalizer.normalizeSectioningDepthLevelRecursively({
|
|
12317
|
-
rawSectioningOfSpecificDepthLevel:
|
|
12415
|
+
rawSectioningOfSpecificDepthLevel: rawSectioningSchema,
|
|
12318
12416
|
outputWorkpiece: {},
|
|
12319
12417
|
parentRouteURI
|
|
12320
12418
|
});
|
|
@@ -12323,60 +12421,56 @@ class RoutingSettingsNormalizer {
|
|
|
12323
12421
|
if (!(0, es_extensions_1.isArbitraryObject)(rawSectioningOfSpecificDepthLevel)) {
|
|
12324
12422
|
es_extensions_1.Logger.throwErrorAndLog({
|
|
12325
12423
|
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12326
|
-
customMessage:
|
|
12327
|
-
|
|
12328
|
-
RoutingSettingsNormalizer.routingPathSegments.length > 0 ?
|
|
12329
|
-
[` at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}".`] :
|
|
12330
|
-
["."],
|
|
12331
|
-
`Must be an object while ${typeof rawSectioningOfSpecificDepthLevel} found.`
|
|
12332
|
-
].join(" ")
|
|
12424
|
+
customMessage: `Malformed routing at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}". ` +
|
|
12425
|
+
`Must be an object while ${typeof (0, es_extensions_1.nullToUndefined)(rawSectioningOfSpecificDepthLevel)} found.`
|
|
12333
12426
|
}),
|
|
12334
12427
|
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12335
|
-
occurrenceLocation: "RoutingSettingsNormalizer.normalizeDepthLevelWiseRecursively(
|
|
12428
|
+
occurrenceLocation: "RoutingSettingsNormalizer.normalizeDepthLevelWiseRecursively(compoundParameter)"
|
|
12336
12429
|
});
|
|
12337
12430
|
}
|
|
12431
|
+
RoutingSettingsNormalizer.routingPathSegments.push(
|
|
12432
|
+
/* eslint-disable-next-line @typescript-eslint/no-magic-numbers -- For the top level of sectioning case,
|
|
12433
|
+
the "$sectioning" element will be second from the end. */
|
|
12434
|
+
...RoutingSettingsNormalizer.routingPathSegments[RoutingSettingsNormalizer.routingPathSegments.length - 3] ===
|
|
12435
|
+
"$sectioning" ? [""] : ["$children", ""]);
|
|
12338
12436
|
RoutingSettingsNormalizer.routingPathSegments.push("");
|
|
12339
|
-
for (const [sectionKey,
|
|
12437
|
+
for (const [sectionKey, sectionRawMetadata] of Object.entries(rawSectioningOfSpecificDepthLevel)) {
|
|
12340
12438
|
RoutingSettingsNormalizer.routingPathSegments[RoutingSettingsNormalizer.routingPathSegments.length - 1] = sectionKey;
|
|
12341
|
-
if (!(0, es_extensions_1.isArbitraryObject)(
|
|
12439
|
+
if (!(0, es_extensions_1.isArbitraryObject)(sectionRawMetadata)) {
|
|
12342
12440
|
es_extensions_1.Logger.throwErrorAndLog({
|
|
12343
12441
|
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12344
|
-
customMessage:
|
|
12345
|
-
`
|
|
12346
|
-
`Must be an object while ${typeof rawSectionMetadata} found.`
|
|
12347
|
-
].join(" ")
|
|
12442
|
+
customMessage: `Malformed sectioning at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}".` +
|
|
12443
|
+
`Must be an object while ${typeof (0, es_extensions_1.nullToUndefined)(sectionRawMetadata)} found.`
|
|
12348
12444
|
}),
|
|
12349
12445
|
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12350
|
-
occurrenceLocation: "RoutingSettingsNormalizer.
|
|
12446
|
+
occurrenceLocation: "RoutingSettingsNormalizer.normalizeDepthLevelWiseRecursively(compoundParameter)"
|
|
12351
12447
|
});
|
|
12352
12448
|
}
|
|
12353
|
-
if (!(0, es_extensions_1.isString)(
|
|
12449
|
+
if (!(0, es_extensions_1.isString)(sectionRawMetadata.$anchor)) {
|
|
12354
12450
|
es_extensions_1.Logger.throwErrorAndLog({
|
|
12355
12451
|
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12356
|
-
customMessage:
|
|
12357
|
-
`
|
|
12358
|
-
`The property "$anchor" must be defined with string while ${typeof rawSectionMetadata} found.`
|
|
12359
|
-
].join(" ")
|
|
12452
|
+
customMessage: `Malformed sectioning at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}". ` +
|
|
12453
|
+
`The property "$anchor" must be defined with string while ${typeof sectionRawMetadata} found.`
|
|
12360
12454
|
}),
|
|
12361
12455
|
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12362
|
-
occurrenceLocation: "RoutingSettingsNormalizer.
|
|
12456
|
+
occurrenceLocation: "RoutingSettingsNormalizer.normalizeDepthLevelWiseRecursively(compoundParameter)"
|
|
12363
12457
|
});
|
|
12364
12458
|
}
|
|
12365
|
-
|
|
12366
|
-
$heading: RoutingSettingsNormalizer.normalizeHeading(
|
|
12367
|
-
$anchor:
|
|
12368
|
-
$URI: `${parentRouteURI}#${
|
|
12369
|
-
...(0, es_extensions_1.isArbitraryObject)(
|
|
12459
|
+
outputWorkpiece[sectionKey] = {
|
|
12460
|
+
$heading: RoutingSettingsNormalizer.normalizeHeading(sectionRawMetadata.$heading, localization),
|
|
12461
|
+
$anchor: sectionRawMetadata.$anchor,
|
|
12462
|
+
$URI: `${parentRouteURI}#${sectionRawMetadata.$anchor}`,
|
|
12463
|
+
...(0, es_extensions_1.isArbitraryObject)(sectionRawMetadata.$children) ? {
|
|
12370
12464
|
$children: RoutingSettingsNormalizer.normalizeSectioningDepthLevelRecursively({
|
|
12371
|
-
rawSectioningOfSpecificDepthLevel:
|
|
12465
|
+
rawSectioningOfSpecificDepthLevel: sectionRawMetadata.$children,
|
|
12372
12466
|
outputWorkpiece: {},
|
|
12373
12467
|
localization,
|
|
12374
12468
|
parentRouteURI
|
|
12375
12469
|
})
|
|
12376
12470
|
} : null
|
|
12377
12471
|
};
|
|
12378
|
-
outputWorkpiece[sectionKey] = normalizedSectionMetadata;
|
|
12379
12472
|
}
|
|
12473
|
+
RoutingSettingsNormalizer.routingPathSegments.pop();
|
|
12380
12474
|
return outputWorkpiece;
|
|
12381
12475
|
}
|
|
12382
12476
|
}
|
|
@@ -13313,9 +13407,9 @@ class StylesProcessor extends GulpStreamsBasedTaskExecutor_1.default {
|
|
|
13313
13407
|
dataHoldingSelfInstance.sourceCodeSelectiveReprocessingHelper = new SourceCodeSelectiveReprocessingHelper_1.default({
|
|
13314
13408
|
initialEntryPointsSourceFilesAbsolutePaths: stylesProcessingSettingsRepresentative.
|
|
13315
13409
|
initialRelevantEntryPointsSourceFilesAbsolutePaths,
|
|
13316
|
-
|
|
13317
|
-
|
|
13318
|
-
|
|
13410
|
+
childrenFilesResolutionRules: {
|
|
13411
|
+
childrenFilesIncludingDeclarationsPatterns: StylusPreProcessorSpecialist_1.default.partialFilesIncludingDeclarationPatterns,
|
|
13412
|
+
implicitFilesNamesExtensionsWithoutLeadingDotsOfChildrenFiles: StylusPreProcessorSpecialist_1.default.
|
|
13319
13413
|
implicitFilesNamesExtensionsWithoutLeadingDotsOfPartials
|
|
13320
13414
|
},
|
|
13321
13415
|
isEntryPoint: stylesProcessingSettingsRepresentative.isEntryPoint.bind(stylesProcessingSettingsRepresentative),
|
|
@@ -13599,11 +13693,11 @@ exports["default"] = ChokidarSpecialistLocalization__English;
|
|
|
13599
13693
|
|
|
13600
13694
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
13601
13695
|
class ECMA_ScriptSpecialist {
|
|
13602
|
-
/* [ Fiddle ] https://regex101.com/r/4X0mYk/
|
|
13696
|
+
/* [ Fiddle ] https://regex101.com/r/4X0mYk/7 */
|
|
13603
13697
|
static partialFilesIncludingDeclarationPatterns = [
|
|
13604
13698
|
/* eslint-disable-next-line prefer-named-capture-group --
|
|
13605
13699
|
* No simple way to know the capturing group name outside of this file. */
|
|
13606
|
-
/from\s+["']((?:\w
|
|
13700
|
+
/from\s+["']((?:\w|-|\.|\/|:|@|~)+)["']/gmu
|
|
13607
13701
|
];
|
|
13608
13702
|
}
|
|
13609
13703
|
exports["default"] = ECMA_ScriptSpecialist;
|
|
@@ -14300,12 +14394,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
14300
14394
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
14301
14395
|
const es_extensions_nodejs_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions-nodejs */ "@yamato-daiwa/es-extensions-nodejs");
|
|
14302
14396
|
const fs_1 = __importDefault(__webpack_require__(/*! fs */ "fs"));
|
|
14303
|
-
|
|
14304
|
-
* With plain Gulp, we don't know the relations of entry points and affiliated files thus must to re-process all entry
|
|
14305
|
-
* points on any file changed. When files number is large, the performance impact will be tangible even for the local
|
|
14306
|
-
* development mode when the speed is negligible to certain extent. To optimize this, we need to know the parents entry
|
|
14307
|
-
* points of each file, herewith the hierarchy could be arbitrary large. Also, we need to avoid of the reading of same
|
|
14308
|
-
* file twice while its content not changed. */
|
|
14397
|
+
const path_1 = __importDefault(__webpack_require__(/*! path */ "path"));
|
|
14309
14398
|
class SourceCodeSelectiveReprocessingHelper {
|
|
14310
14399
|
static DEBUGGING_MODE = false;
|
|
14311
14400
|
static cachedMetadataFileContentSpecification = {
|
|
@@ -14322,7 +14411,7 @@ class SourceCodeSelectiveReprocessingHelper {
|
|
|
14322
14411
|
type: String,
|
|
14323
14412
|
required: true
|
|
14324
14413
|
},
|
|
14325
|
-
|
|
14414
|
+
directChildrenFilesRelativePaths: {
|
|
14326
14415
|
type: Array,
|
|
14327
14416
|
required: true,
|
|
14328
14417
|
element: { type: String }
|
|
@@ -14330,7 +14419,7 @@ class SourceCodeSelectiveReprocessingHelper {
|
|
|
14330
14419
|
}
|
|
14331
14420
|
}
|
|
14332
14421
|
},
|
|
14333
|
-
|
|
14422
|
+
childrenFiles: {
|
|
14334
14423
|
type: es_extensions_1.RawObjectDataProcessor.ValuesTypesIDs.associativeArrayOfUniformTypeValues,
|
|
14335
14424
|
required: true,
|
|
14336
14425
|
value: {
|
|
@@ -14340,7 +14429,7 @@ class SourceCodeSelectiveReprocessingHelper {
|
|
|
14340
14429
|
type: String,
|
|
14341
14430
|
required: true
|
|
14342
14431
|
},
|
|
14343
|
-
|
|
14432
|
+
directChildrenFilesRelativePaths: {
|
|
14344
14433
|
type: Array,
|
|
14345
14434
|
required: true,
|
|
14346
14435
|
element: { type: String }
|
|
@@ -14357,183 +14446,208 @@ class SourceCodeSelectiveReprocessingHelper {
|
|
|
14357
14446
|
};
|
|
14358
14447
|
entryPointsMetadata = new Map();
|
|
14359
14448
|
isEntryPoint;
|
|
14360
|
-
|
|
14361
|
-
|
|
14362
|
-
|
|
14449
|
+
childrenFilesMetadata = new Map();
|
|
14450
|
+
resolvedAliasedPaths = new Map();
|
|
14451
|
+
childrenFilesResolutionRules;
|
|
14452
|
+
absolutePathsOfChildrenFilesWhichHasBeenScannedDuringCurrentPass = new Set();
|
|
14453
|
+
directoriesAliasesAndTheirAbsolutePatsMap;
|
|
14363
14454
|
CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH;
|
|
14364
14455
|
CACHED_METADATA_FILE_ABSOLUTE_PATH;
|
|
14365
14456
|
TARGET_FILES_TYPE_IN_SINGULAR_FORM;
|
|
14457
|
+
/* ━━━ Constructor ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
14366
14458
|
constructor(initializationProperties) {
|
|
14367
14459
|
this.isEntryPoint = initializationProperties.isEntryPoint;
|
|
14368
|
-
this.
|
|
14460
|
+
this.childrenFilesResolutionRules = initializationProperties.childrenFilesResolutionRules;
|
|
14461
|
+
this.directoriesAliasesAndTheirAbsolutePatsMap =
|
|
14462
|
+
initializationProperties.directoriesAliasesAndTheirAbsolutePatsMap ?? new Map();
|
|
14369
14463
|
this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH = initializationProperties.consumingProjectRootDirectoryAbsolutePath;
|
|
14370
14464
|
this.CACHED_METADATA_FILE_ABSOLUTE_PATH = initializationProperties.cacheFileAbsolutePath;
|
|
14371
14465
|
this.TARGET_FILES_TYPE_IN_SINGULAR_FORM = initializationProperties.logging.targetFilesTypeInSingularForm;
|
|
14372
|
-
|
|
14466
|
+
/* [ Theory ] The cached metadata from previous YDA launches could be. */
|
|
14467
|
+
this.retrieveCacheFromFileAndApplyIfItExists();
|
|
14468
|
+
this.scanFilesHierarchyTreeForEntryPoints(new Set(initializationProperties.initialEntryPointsSourceFilesAbsolutePaths.map((entryPointFileAbsolutePath__potentiallyWithOperationingSystemDependentPathSeparators) => es_extensions_nodejs_1.ImprovedPath.replacePathSeparatorsToForwardSlashes(entryPointFileAbsolutePath__potentiallyWithOperationingSystemDependentPathSeparators))));
|
|
14373
14469
|
if (initializationProperties.logging.mustEnable) {
|
|
14374
|
-
this.
|
|
14470
|
+
this.logChildrenFilesAndEntryPointsRelationships();
|
|
14375
14471
|
}
|
|
14376
|
-
this.
|
|
14472
|
+
this.saveCachedFilesMetadataMapsToFile();
|
|
14377
14473
|
}
|
|
14378
|
-
|
|
14379
|
-
|
|
14380
|
-
|
|
14381
|
-
|
|
14382
|
-
|
|
14383
|
-
|
|
14474
|
+
/* ━━━ Public Methods ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
14475
|
+
getAbsolutePathsOfEntryPointsWhichMustBeProcessed(absolutePathsOfFilesWithChangedStatus__forwardSlashSeparators) {
|
|
14476
|
+
const absolutePathsOfEntryPointsWhichMustBeProcessed__forwardSlashSeparators = new Set();
|
|
14477
|
+
const absolutePathsOfChildrenFilesWhichParentEntryPointsMustBeProcessed__forwardSlashSeparators = new Set();
|
|
14478
|
+
for (const absolutePathOfFileWithChangedStatus__forwardSlashSeparators of absolutePathsOfFilesWithChangedStatus__forwardSlashSeparators) {
|
|
14479
|
+
const pathRelativeRelativeToConsumingProjectRootDirectoryOfFileWithChangedStatus__forwardSlashSeparators = es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
|
|
14480
|
+
basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
|
|
14481
|
+
comparedPath: absolutePathOfFileWithChangedStatus__forwardSlashSeparators,
|
|
14482
|
+
alwaysForwardSlashSeparators: true
|
|
14483
|
+
});
|
|
14484
|
+
if (fs_1.default.existsSync(absolutePathOfFileWithChangedStatus__forwardSlashSeparators)) {
|
|
14485
|
+
if (this.isEntryPoint(absolutePathOfFileWithChangedStatus__forwardSlashSeparators)) {
|
|
14486
|
+
absolutePathsOfEntryPointsWhichMustBeProcessed__forwardSlashSeparators.
|
|
14487
|
+
add(absolutePathOfFileWithChangedStatus__forwardSlashSeparators);
|
|
14384
14488
|
}
|
|
14385
14489
|
else {
|
|
14386
|
-
|
|
14387
|
-
|
|
14388
|
-
comparedPath: absolutePathOfFileWithChangesStatus,
|
|
14389
|
-
alwaysForwardSlashSeparators: true
|
|
14390
|
-
}));
|
|
14490
|
+
absolutePathsOfChildrenFilesWhichParentEntryPointsMustBeProcessed__forwardSlashSeparators.
|
|
14491
|
+
add(absolutePathOfFileWithChangedStatus__forwardSlashSeparators);
|
|
14391
14492
|
}
|
|
14392
14493
|
}
|
|
14393
14494
|
else {
|
|
14394
|
-
|
|
14395
|
-
|
|
14396
|
-
|
|
14397
|
-
|
|
14495
|
+
this.clearFileMetadataPathFromCache(pathRelativeRelativeToConsumingProjectRootDirectoryOfFileWithChangedStatus__forwardSlashSeparators);
|
|
14496
|
+
}
|
|
14497
|
+
}
|
|
14498
|
+
this.scanFilesHierarchyTreeForEntryPoints(absolutePathsOfEntryPointsWhichMustBeProcessed__forwardSlashSeparators);
|
|
14499
|
+
this.saveCachedFilesMetadataMapsToFile();
|
|
14500
|
+
for (const absolutePathOfChildFile__forwardSlashSeparators of absolutePathsOfChildrenFilesWhichParentEntryPointsMustBeProcessed__forwardSlashSeparators) {
|
|
14501
|
+
const pathOfChildFileRelativeToConsumingProjectRootDirectory__forwardSlashSeparators = es_extensions_nodejs_1.ImprovedPath.
|
|
14502
|
+
computeRelativePath({
|
|
14503
|
+
basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
|
|
14504
|
+
comparedPath: absolutePathOfChildFile__forwardSlashSeparators,
|
|
14505
|
+
alwaysForwardSlashSeparators: true
|
|
14506
|
+
});
|
|
14507
|
+
(0, es_extensions_1.addMultipleElementsToSet)(absolutePathsOfEntryPointsWhichMustBeProcessed__forwardSlashSeparators, Array.from(this.childrenFilesMetadata.get(pathOfChildFileRelativeToConsumingProjectRootDirectory__forwardSlashSeparators)?.parentEntryPointsAbsolutePaths ??
|
|
14508
|
+
new Set()));
|
|
14509
|
+
}
|
|
14510
|
+
return Array.from(absolutePathsOfEntryPointsWhichMustBeProcessed__forwardSlashSeparators);
|
|
14511
|
+
}
|
|
14512
|
+
/* ━━━ Private Methods ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
14513
|
+
/* ─── Initial Pass ─────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
14514
|
+
retrieveCacheFromFileAndApplyIfItExists() {
|
|
14515
|
+
let cachedRawMetadata;
|
|
14516
|
+
try {
|
|
14517
|
+
cachedRawMetadata = es_extensions_nodejs_1.ObjectDataFilesProcessor.processFile({
|
|
14518
|
+
filePath: this.CACHED_METADATA_FILE_ABSOLUTE_PATH,
|
|
14519
|
+
validDataSpecification: SourceCodeSelectiveReprocessingHelper.cachedMetadataFileContentSpecification,
|
|
14520
|
+
synchronously: true
|
|
14521
|
+
});
|
|
14522
|
+
}
|
|
14523
|
+
catch (error) {
|
|
14524
|
+
if (!(error instanceof es_extensions_nodejs_1.FileNotFoundError)) {
|
|
14525
|
+
es_extensions_1.Logger.logError({
|
|
14526
|
+
mustOutputIf: true || 0,
|
|
14527
|
+
errorType: "CachedDataRetrievingFailedError",
|
|
14528
|
+
title: "Cached Data Retrieving Failed",
|
|
14529
|
+
description: `Unable to read the existing cache file at "${this.CACHED_METADATA_FILE_ABSOLUTE_PATH}".`,
|
|
14530
|
+
occurrenceLocation: "sourceCodeSelectiveReprocessingHelper.retrieveCacheFromFileAndApplyIfItExists()",
|
|
14531
|
+
caughtError: error
|
|
14398
14532
|
});
|
|
14399
|
-
if (fs_1.default.existsSync(absolutePathOfFileWithChangesStatus)) {
|
|
14400
|
-
(0, es_extensions_1.addMultipleElementsToSet)(absolutePathsOfEntryPointsWhichMustBeProcessed, Array.from(this.affiliatedFilesMetadata.get(targetAffiliatedFileRelativePath)?.parentEntryPointsAbsolutePaths ?? []));
|
|
14401
|
-
}
|
|
14402
|
-
else {
|
|
14403
|
-
this.affiliatedFilesMetadata.delete(targetAffiliatedFileRelativePath);
|
|
14404
|
-
}
|
|
14405
14533
|
}
|
|
14534
|
+
return;
|
|
14535
|
+
}
|
|
14536
|
+
for (const [entryPointPathRelativeToConsumingProjectRootDirectory, entryPointRawMetadata] of Object.entries(cachedRawMetadata.entryPoints)) {
|
|
14537
|
+
this.entryPointsMetadata.set(entryPointPathRelativeToConsumingProjectRootDirectory, {
|
|
14538
|
+
modificationDate__ISO8601: entryPointRawMetadata.modificationDate__ISO8601,
|
|
14539
|
+
directChildrenFilesRelativePaths: new Set(entryPointRawMetadata.directChildrenFilesRelativePaths)
|
|
14540
|
+
});
|
|
14541
|
+
}
|
|
14542
|
+
for (const [childFilePathRelativeToConsumingProjectRootDirectory, childFileMetadata] of Object.entries(cachedRawMetadata.childrenFiles)) {
|
|
14543
|
+
this.childrenFilesMetadata.set(childFilePathRelativeToConsumingProjectRootDirectory, {
|
|
14544
|
+
modificationDateTime__ISO8601: childFileMetadata.modificationDate__ISO8601,
|
|
14545
|
+
directChildrenFilesRelativePaths: new Set(childFileMetadata.directChildrenFilesRelativePaths),
|
|
14546
|
+
parentEntryPointsAbsolutePaths: new Set(childFileMetadata.parentEntryPointsRelativePaths.map((parentEntryPointsRelativePath) => es_extensions_nodejs_1.ImprovedPath.joinPathSegments([this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH, parentEntryPointsRelativePath], { alwaysForwardSlashSeparators: true })))
|
|
14547
|
+
});
|
|
14406
14548
|
}
|
|
14407
|
-
return Array.from(absolutePathsOfEntryPointsWhichMustBeProcessed);
|
|
14408
14549
|
}
|
|
14409
|
-
/*
|
|
14410
|
-
|
|
14411
|
-
|
|
14412
|
-
|
|
14413
|
-
|
|
14414
|
-
const entryPointDirectoryAbsolutePath = es_extensions_nodejs_1.ImprovedPath.extractDirectoryFromFilePath({
|
|
14415
|
-
targetPath: entryPointFileAbsolutePath,
|
|
14416
|
-
alwaysForwardSlashSeparators: true,
|
|
14550
|
+
/* ─── All Passes ───────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
14551
|
+
scanFilesHierarchyTreeForEntryPoints(targetEntryPointsAbsolutePaths__forwardSlashSeparators) {
|
|
14552
|
+
for (const entryPointAbsolutePath__forwardSlashSeparators of targetEntryPointsAbsolutePaths__forwardSlashSeparators) {
|
|
14553
|
+
const entryPointDirectoryAbsolutePath__forwardSlashSeparators = es_extensions_nodejs_1.ImprovedPath.extractDirectoryFromFilePath({
|
|
14554
|
+
targetPath: entryPointAbsolutePath__forwardSlashSeparators,
|
|
14417
14555
|
ambiguitiesResolution: {
|
|
14418
14556
|
mustConsiderLastSegmentStartingWithDotAsDirectory: false,
|
|
14419
14557
|
mustConsiderLastSegmentWithNonLeadingDotAsDirectory: false,
|
|
14420
14558
|
mustConsiderLastSegmentWihtoutDotsAsFileNameWithoutExtension: true
|
|
14421
|
-
}
|
|
14559
|
+
},
|
|
14560
|
+
alwaysForwardSlashSeparators: true
|
|
14422
14561
|
});
|
|
14423
|
-
const
|
|
14562
|
+
const entryPointPathRelativeToConsumingProjectRootDirectory__forwardSlashSeparators = es_extensions_nodejs_1.ImprovedPath.
|
|
14563
|
+
computeRelativePath({
|
|
14424
14564
|
basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
|
|
14425
|
-
comparedPath:
|
|
14565
|
+
comparedPath: entryPointAbsolutePath__forwardSlashSeparators,
|
|
14426
14566
|
alwaysForwardSlashSeparators: true
|
|
14427
14567
|
});
|
|
14428
|
-
let
|
|
14568
|
+
let entryPointLastModificationDateTime__ISO8601;
|
|
14429
14569
|
try {
|
|
14430
|
-
|
|
14570
|
+
entryPointLastModificationDateTime__ISO8601 = fs_1.default.statSync(entryPointAbsolutePath__forwardSlashSeparators).
|
|
14571
|
+
mtime.
|
|
14572
|
+
toISOString();
|
|
14431
14573
|
}
|
|
14432
14574
|
catch (error) {
|
|
14433
14575
|
if ((0, es_extensions_nodejs_1.isErrnoException)(error) && error.code === "ENOENT") {
|
|
14434
|
-
this.entryPointsMetadata.delete(
|
|
14576
|
+
this.entryPointsMetadata.delete(entryPointPathRelativeToConsumingProjectRootDirectory__forwardSlashSeparators);
|
|
14435
14577
|
continue;
|
|
14436
14578
|
}
|
|
14437
14579
|
es_extensions_1.Logger.logError({
|
|
14438
14580
|
mustOutputIf: true || 0,
|
|
14439
14581
|
errorType: "FileStatisticsRetrievingFailedError",
|
|
14440
14582
|
title: "File Statistics Retrieving Failed Error",
|
|
14441
|
-
description:
|
|
14583
|
+
description: "Unable to retrieve the statistics of file " +
|
|
14584
|
+
`"${entryPointPathRelativeToConsumingProjectRootDirectory__forwardSlashSeparators}". ` +
|
|
14442
14585
|
"This file will not be mapped.",
|
|
14443
|
-
occurrenceLocation: "sourceCodeSelectiveReprocessingHelper.
|
|
14586
|
+
occurrenceLocation: "sourceCodeSelectiveReprocessingHelper." +
|
|
14587
|
+
"scanFilesHierarchyTreeForEntryPoints(targetEntryPointsAbsolutePaths__forwardSlashSeparators)",
|
|
14444
14588
|
caughtError: error
|
|
14445
14589
|
});
|
|
14446
14590
|
continue;
|
|
14447
14591
|
}
|
|
14448
|
-
|
|
14449
|
-
let
|
|
14450
|
-
|
|
14451
|
-
|
|
14452
|
-
|
|
14453
|
-
|
|
14454
|
-
|
|
14455
|
-
|
|
14456
|
-
|
|
14457
|
-
|
|
14458
|
-
|
|
14592
|
+
let cachedMetadataOfCurrentEntryPoint = this.entryPointsMetadata.get(entryPointPathRelativeToConsumingProjectRootDirectory__forwardSlashSeparators);
|
|
14593
|
+
let absolutePathsOfExistingDirectChildrenFilesOfCurrentEntryPoint__forwardSlashSeparators = new Set();
|
|
14594
|
+
/* [ Theory ] This condition will could be truthy (but not always) only on initial pass. */
|
|
14595
|
+
if (cachedMetadataOfCurrentEntryPoint?.modificationDate__ISO8601 === entryPointLastModificationDateTime__ISO8601) {
|
|
14596
|
+
/* [ Theory ]
|
|
14597
|
+
* Although the entry point file is existing and has not changed since last scan, its children files could
|
|
14598
|
+
* be added or deleted. */
|
|
14599
|
+
for (const pathRelativeToConsumingProjectRootDirectoryOfChildFileOfCurrentEntryPoint__forwardSlashSeparators of cachedMetadataOfCurrentEntryPoint.directChildrenFilesRelativePaths) {
|
|
14600
|
+
const absolutePathOfChildFileOfCurrentEntryPoint__forwardSlashSeparators = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
14601
|
+
this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
|
|
14602
|
+
pathRelativeToConsumingProjectRootDirectoryOfChildFileOfCurrentEntryPoint__forwardSlashSeparators
|
|
14603
|
+
], { alwaysForwardSlashSeparators: true });
|
|
14604
|
+
if (!fs_1.default.existsSync(absolutePathOfChildFileOfCurrentEntryPoint__forwardSlashSeparators)) {
|
|
14605
|
+
this.clearFileMetadataPathFromCache(pathRelativeToConsumingProjectRootDirectoryOfChildFileOfCurrentEntryPoint__forwardSlashSeparators);
|
|
14459
14606
|
}
|
|
14460
|
-
|
|
14607
|
+
absolutePathsOfExistingDirectChildrenFilesOfCurrentEntryPoint__forwardSlashSeparators = new Set(Array.from(cachedMetadataOfCurrentEntryPoint.directChildrenFilesRelativePaths));
|
|
14461
14608
|
}
|
|
14462
14609
|
}
|
|
14463
14610
|
else {
|
|
14464
|
-
|
|
14465
|
-
|
|
14466
|
-
|
|
14467
|
-
|
|
14611
|
+
/* [ Maintainability ] Keep this variable for debugging. */
|
|
14612
|
+
absolutePathsOfExistingDirectChildrenFilesOfCurrentEntryPoint__forwardSlashSeparators = this.
|
|
14613
|
+
getAbsolutePathsOfExistingChildrenFilesOfExistingTargetFile__forwardSlashSeparators({
|
|
14614
|
+
targetFileAbsolutePath__forwardSlashSeparators: entryPointAbsolutePath__forwardSlashSeparators,
|
|
14615
|
+
preComputedTargetFileDirectoryAbsolutePath__forwardSlashSeparators: entryPointDirectoryAbsolutePath__forwardSlashSeparators
|
|
14468
14616
|
});
|
|
14469
|
-
|
|
14470
|
-
modificationDate__ISO8601:
|
|
14471
|
-
|
|
14617
|
+
cachedMetadataOfCurrentEntryPoint = {
|
|
14618
|
+
modificationDate__ISO8601: entryPointLastModificationDateTime__ISO8601,
|
|
14619
|
+
directChildrenFilesRelativePaths: (0, es_extensions_1.createSetBasedOnOtherSet)(absolutePathsOfExistingDirectChildrenFilesOfCurrentEntryPoint__forwardSlashSeparators, (absolutePathOfExistingDirectChildFileOfCurrentEntryPoint__forwardSlashSeparators) => es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
|
|
14472
14620
|
basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
|
|
14473
|
-
comparedPath:
|
|
14621
|
+
comparedPath: absolutePathOfExistingDirectChildFileOfCurrentEntryPoint__forwardSlashSeparators,
|
|
14474
14622
|
alwaysForwardSlashSeparators: true
|
|
14475
14623
|
}))
|
|
14476
|
-
}
|
|
14624
|
+
};
|
|
14625
|
+
this.entryPointsMetadata.set(entryPointPathRelativeToConsumingProjectRootDirectory__forwardSlashSeparators, cachedMetadataOfCurrentEntryPoint);
|
|
14477
14626
|
}
|
|
14478
14627
|
es_extensions_1.Logger.logGeneric({
|
|
14479
14628
|
mustOutputIf: SourceCodeSelectiveReprocessingHelper.DEBUGGING_MODE,
|
|
14480
14629
|
badge: { customText: "Debug" },
|
|
14481
|
-
title: "SourceCodeSelectiveReprocessingHelper,
|
|
14482
|
-
description:
|
|
14483
|
-
|
|
14484
|
-
});
|
|
14485
|
-
for (const
|
|
14486
|
-
this.
|
|
14487
|
-
|
|
14488
|
-
|
|
14630
|
+
title: "SourceCodeSelectiveReprocessingHelper, Entry Point Analysis Complete.",
|
|
14631
|
+
description: entryPointPathRelativeToConsumingProjectRootDirectory__forwardSlashSeparators,
|
|
14632
|
+
additionalData: cachedMetadataOfCurrentEntryPoint
|
|
14633
|
+
});
|
|
14634
|
+
for (const absolutePathOfDirectExistingChildFileOfCurrentEntryPoint__forwardSlashSeparators of absolutePathsOfExistingDirectChildrenFilesOfCurrentEntryPoint__forwardSlashSeparators) {
|
|
14635
|
+
this.updateMetadataForExistingChildFile({
|
|
14636
|
+
targetChildFileAbsolutePath__forwardSlashSeparators: absolutePathOfDirectExistingChildFileOfCurrentEntryPoint__forwardSlashSeparators,
|
|
14637
|
+
parentEntryPointAbsolutePath__forwardSlashSeparators: entryPointAbsolutePath__forwardSlashSeparators
|
|
14489
14638
|
});
|
|
14490
|
-
this.
|
|
14491
|
-
add(
|
|
14639
|
+
this.absolutePathsOfChildrenFilesWhichHasBeenScannedDuringCurrentPass.
|
|
14640
|
+
add(absolutePathOfDirectExistingChildFileOfCurrentEntryPoint__forwardSlashSeparators);
|
|
14492
14641
|
}
|
|
14493
14642
|
}
|
|
14494
|
-
this.
|
|
14643
|
+
this.absolutePathsOfChildrenFilesWhichHasBeenScannedDuringCurrentPass.clear();
|
|
14495
14644
|
}
|
|
14496
|
-
|
|
14497
|
-
|
|
14498
|
-
|
|
14499
|
-
cachedRawMetadata = es_extensions_nodejs_1.ObjectDataFilesProcessor.processFile({
|
|
14500
|
-
filePath: this.CACHED_METADATA_FILE_ABSOLUTE_PATH,
|
|
14501
|
-
validDataSpecification: SourceCodeSelectiveReprocessingHelper.cachedMetadataFileContentSpecification,
|
|
14502
|
-
synchronously: true
|
|
14503
|
-
});
|
|
14504
|
-
}
|
|
14505
|
-
catch (error) {
|
|
14506
|
-
if (!(error instanceof es_extensions_nodejs_1.FileNotFoundError)) {
|
|
14507
|
-
es_extensions_1.Logger.logError({
|
|
14508
|
-
mustOutputIf: true || 0,
|
|
14509
|
-
errorType: "CachedDataRetrievingFailure",
|
|
14510
|
-
title: "Cached Data Retrieving Failure",
|
|
14511
|
-
description: `Unable to read the existing cache file "${this.CACHED_METADATA_FILE_ABSOLUTE_PATH}".`,
|
|
14512
|
-
occurrenceLocation: "sourceCodeSelectiveReprocessingHelper.extractCacheFromFileAndApplyIfItExists()",
|
|
14513
|
-
caughtError: error
|
|
14514
|
-
});
|
|
14515
|
-
}
|
|
14516
|
-
return;
|
|
14517
|
-
}
|
|
14518
|
-
for (const [entryPointPathRelativeToConsumingProjectRootDirectory, entryPointRawMetadata] of Object.entries(cachedRawMetadata.entryPoints)) {
|
|
14519
|
-
this.entryPointsMetadata.set(entryPointPathRelativeToConsumingProjectRootDirectory, {
|
|
14520
|
-
modificationDate__ISO8601: entryPointRawMetadata.modificationDate__ISO8601,
|
|
14521
|
-
directAffiliatedFilesRelativePaths: new Set(entryPointRawMetadata.directAffiliatedFilesRelativePaths)
|
|
14522
|
-
});
|
|
14523
|
-
}
|
|
14524
|
-
for (const [affiliatedFilePathRelativeToConsumingProjectRootDirectory, affiliatedFileMetadata] of Object.entries(cachedRawMetadata.affiliatedFiles)) {
|
|
14525
|
-
this.affiliatedFilesMetadata.set(affiliatedFilePathRelativeToConsumingProjectRootDirectory, {
|
|
14526
|
-
modificationDateTime__ISO8601: affiliatedFileMetadata.modificationDate__ISO8601,
|
|
14527
|
-
directAffiliatedFilesRelativePaths: new Set(affiliatedFileMetadata.directAffiliatedFilesRelativePaths),
|
|
14528
|
-
parentEntryPointsAbsolutePaths: new Set(affiliatedFileMetadata.parentEntryPointsRelativePaths.map((parentEntryPointsRelativePath) => es_extensions_nodejs_1.ImprovedPath.joinPathSegments([this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH, parentEntryPointsRelativePath], { alwaysForwardSlashSeparators: true })))
|
|
14529
|
-
});
|
|
14530
|
-
}
|
|
14531
|
-
}
|
|
14532
|
-
getAbsolutePathsOfExistingAffiliatedFilesOfExistingUpdatedTargetOne({ targetFileAbsolutePath, targetFileDirectoryAbsolutePath }) {
|
|
14533
|
-
const absolutePathsOfExistingAffiliatedFilesOfTargetOne = new Set();
|
|
14645
|
+
/* [ Approach ] The target file could be either entry point or not. */
|
|
14646
|
+
getAbsolutePathsOfExistingChildrenFilesOfExistingTargetFile__forwardSlashSeparators({ targetFileAbsolutePath__forwardSlashSeparators, preComputedTargetFileDirectoryAbsolutePath__forwardSlashSeparators }) {
|
|
14647
|
+
const absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators = new Set();
|
|
14534
14648
|
let fileContent;
|
|
14535
14649
|
try {
|
|
14536
|
-
fileContent = fs_1.default.readFileSync(
|
|
14650
|
+
fileContent = fs_1.default.readFileSync(targetFileAbsolutePath__forwardSlashSeparators, "utf-8");
|
|
14537
14651
|
}
|
|
14538
14652
|
catch (error) {
|
|
14539
14653
|
if ((0, es_extensions_nodejs_1.isErrnoException)(error) && error.code === "ENOENT") {
|
|
@@ -14541,231 +14655,291 @@ class SourceCodeSelectiveReprocessingHelper {
|
|
|
14541
14655
|
mustOutputIf: true || 0,
|
|
14542
14656
|
errorType: es_extensions_1.UnexpectedEventError.NAME,
|
|
14543
14657
|
title: es_extensions_1.UnexpectedEventError.localization.defaultTitle,
|
|
14544
|
-
description: `
|
|
14545
|
-
"
|
|
14658
|
+
description: `Contrary to expectations, "${targetFileAbsolutePath__forwardSlashSeparators}" file does not exist. ` +
|
|
14659
|
+
"Skipping this file.",
|
|
14546
14660
|
occurrenceLocation: "sourceCodeSelectiveReprocessingHelper." +
|
|
14547
|
-
"
|
|
14661
|
+
"getAbsolutePathsOfExistingChildrenFilesOfExistingTargetFile__forwardSlashSeparators(compoundParameter)",
|
|
14548
14662
|
caughtError: error
|
|
14549
14663
|
});
|
|
14550
|
-
return
|
|
14664
|
+
return absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators;
|
|
14551
14665
|
}
|
|
14552
14666
|
es_extensions_1.Logger.logError({
|
|
14553
14667
|
mustOutputIf: true || 0,
|
|
14554
14668
|
errorType: es_extensions_1.FileReadingFailedError.NAME,
|
|
14555
14669
|
title: es_extensions_1.FileReadingFailedError.localization.defaultTitle,
|
|
14556
|
-
description: es_extensions_1.FileReadingFailedError.localization.
|
|
14670
|
+
description: es_extensions_1.FileReadingFailedError.localization.
|
|
14671
|
+
generateDescription({ filePath: targetFileAbsolutePath__forwardSlashSeparators }),
|
|
14557
14672
|
occurrenceLocation: "sourceCodeSelectiveReprocessingHelper." +
|
|
14558
|
-
"
|
|
14673
|
+
"getAbsolutePathsOfExistingChildrenFilesOfExistingTargetFile__forwardSlashSeparators(compoundParameter)",
|
|
14559
14674
|
caughtError: error
|
|
14560
14675
|
});
|
|
14561
|
-
return
|
|
14676
|
+
return absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators;
|
|
14562
14677
|
}
|
|
14563
|
-
for (const fileIncludingDeclarationPattern of this.
|
|
14678
|
+
for (const fileIncludingDeclarationPattern of this.childrenFilesResolutionRules.childrenFilesIncludingDeclarationsPatterns) {
|
|
14564
14679
|
/* [ Theory ] Same file could be included for the multiple times.
|
|
14565
14680
|
* Occasionally it is even meaningful, but we are not need the duplicated here. */
|
|
14566
|
-
const
|
|
14681
|
+
const childrenFilesRawPaths = new Set(Array.from(fileContent.matchAll(fileIncludingDeclarationPattern)).
|
|
14567
14682
|
map((regularExpressionMatchingData) => regularExpressionMatchingData[1]).
|
|
14568
|
-
filter((
|
|
14569
|
-
|
|
14570
|
-
|
|
14571
|
-
|
|
14572
|
-
|
|
14683
|
+
filter((childFileRawPath) => (0, es_extensions_1.isNonEmptyString)(childFileRawPath)));
|
|
14684
|
+
const targetChildFileDirectoryAbsolutePath__forwardSlashSeparators = preComputedTargetFileDirectoryAbsolutePath__forwardSlashSeparators ??
|
|
14685
|
+
es_extensions_nodejs_1.ImprovedPath.extractDirectoryFromFilePath({
|
|
14686
|
+
targetPath: targetFileAbsolutePath__forwardSlashSeparators,
|
|
14687
|
+
ambiguitiesResolution: {
|
|
14688
|
+
mustConsiderLastSegmentStartingWithDotAsDirectory: false,
|
|
14689
|
+
mustConsiderLastSegmentWithNonLeadingDotAsDirectory: false,
|
|
14690
|
+
mustConsiderLastSegmentWihtoutDotsAsFileNameWithoutExtension: true
|
|
14691
|
+
},
|
|
14692
|
+
alwaysForwardSlashSeparators: true
|
|
14573
14693
|
});
|
|
14574
|
-
|
|
14575
|
-
|
|
14694
|
+
for (const childFileRawPath of childrenFilesRawPaths) {
|
|
14695
|
+
const childFileNormalizedPath = this.computeAbsolutePathOfChildFileIfItExists({
|
|
14696
|
+
childFileRawPath,
|
|
14697
|
+
parentFileDirectoryAbsolutePath__forwardSlashSeparators: targetChildFileDirectoryAbsolutePath__forwardSlashSeparators
|
|
14698
|
+
});
|
|
14699
|
+
if ((0, es_extensions_1.isNotNull)(childFileNormalizedPath)) {
|
|
14700
|
+
absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators.add(childFileNormalizedPath);
|
|
14701
|
+
}
|
|
14702
|
+
}
|
|
14703
|
+
}
|
|
14704
|
+
return absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators;
|
|
14705
|
+
}
|
|
14706
|
+
computeAbsolutePathOfChildFileIfItExists({ childFileRawPath, parentFileDirectoryAbsolutePath__forwardSlashSeparators }) {
|
|
14707
|
+
let possibleIntermediatePathsOfChildFileWithResolvedAlias = new Set();
|
|
14708
|
+
const segmentsOfChildFileRawPath = es_extensions_nodejs_1.ImprovedPath.explodePathToSegments(childFileRawPath);
|
|
14709
|
+
const firstSegmentOfChildFileRawPath = segmentsOfChildFileRawPath[0];
|
|
14710
|
+
if ((0, es_extensions_1.isNonEmptyString)(firstSegmentOfChildFileRawPath)) {
|
|
14711
|
+
possibleIntermediatePathsOfChildFileWithResolvedAlias = (0, es_extensions_1.createSetBasedOnOtherSet)(this.directoriesAliasesAndTheirAbsolutePatsMap.get(firstSegmentOfChildFileRawPath) ?? new Set(), (absolutePathOfDirectoryOnWhichAliasedFirstPathSegmentCouldRefer) => es_extensions_nodejs_1.ImprovedPath.joinPathSegments((0, es_extensions_1.replaceArrayElementsByIndexesImmutably)({
|
|
14712
|
+
targetArray: segmentsOfChildFileRawPath,
|
|
14713
|
+
index: 0,
|
|
14714
|
+
newElement: absolutePathOfDirectoryOnWhichAliasedFirstPathSegmentCouldRefer
|
|
14715
|
+
}), { alwaysForwardSlashSeparators: true }));
|
|
14716
|
+
}
|
|
14717
|
+
let isChildFileRawPathAliased;
|
|
14718
|
+
if (possibleIntermediatePathsOfChildFileWithResolvedAlias.size > 0) {
|
|
14719
|
+
const previouslyResolvedPathFromAliasedOne = this.resolvedAliasedPaths.get(childFileRawPath);
|
|
14720
|
+
if ((0, es_extensions_1.isString)(previouslyResolvedPathFromAliasedOne)) {
|
|
14721
|
+
try {
|
|
14722
|
+
if (fs_1.default.existsSync(previouslyResolvedPathFromAliasedOne)) {
|
|
14723
|
+
return previouslyResolvedPathFromAliasedOne;
|
|
14724
|
+
}
|
|
14725
|
+
}
|
|
14726
|
+
catch (error) {
|
|
14727
|
+
if (true) {
|
|
14728
|
+
es_extensions_1.Logger.logError({
|
|
14729
|
+
errorType: "FileCheckingError",
|
|
14730
|
+
title: "File Checking Error",
|
|
14731
|
+
description: `The error occurred during the checking of the file ${previouslyResolvedPathFromAliasedOne}` +
|
|
14732
|
+
"for existence.",
|
|
14733
|
+
occurrenceLocation: "sourceCodeSelectiveReprocessingHelper." +
|
|
14734
|
+
"computeAbsolutePathOfChildFileIfItExists(compoundParameter)",
|
|
14735
|
+
caughtError: error
|
|
14736
|
+
});
|
|
14737
|
+
}
|
|
14738
|
+
}
|
|
14739
|
+
this.resolvedAliasedPaths.delete(childFileRawPath);
|
|
14740
|
+
}
|
|
14741
|
+
isChildFileRawPathAliased = true;
|
|
14742
|
+
}
|
|
14743
|
+
else {
|
|
14744
|
+
isChildFileRawPathAliased = false;
|
|
14745
|
+
possibleIntermediatePathsOfChildFileWithResolvedAlias = new Set([childFileRawPath]);
|
|
14746
|
+
}
|
|
14747
|
+
const possibleAbsolutePathsOfTargetChildFile__forwardSlashSeparators = new Set();
|
|
14748
|
+
const explicitlySpecifiedLastFileNameExtensionInChildrenFileRawPath = (0, es_extensions_1.extractLastExtensionOfFileName)({ targetPath: childFileRawPath, withLeadingDot: false });
|
|
14749
|
+
/* [ Approach ]
|
|
14750
|
+
* The second condition of if-branch is aimed to the processing of paths with multiple files names extensions.
|
|
14751
|
+
* For example, in the Pug preprocessor case, the file "ProductCard.static.pug" could be referred as
|
|
14752
|
+
* `include ProductCard.static`. */
|
|
14753
|
+
if ((0, es_extensions_1.isNull)(explicitlySpecifiedLastFileNameExtensionInChildrenFileRawPath) ||
|
|
14754
|
+
!this.childrenFilesResolutionRules.implicitFilesNamesExtensionsWithoutLeadingDotsOfChildrenFiles.
|
|
14755
|
+
includes(explicitlySpecifiedLastFileNameExtensionInChildrenFileRawPath)) {
|
|
14756
|
+
for (const possibleIntermediatePathOfChildFileWithResolvedAlias of possibleIntermediatePathsOfChildFileWithResolvedAlias) {
|
|
14757
|
+
(0, es_extensions_1.addMultipleElementsToSet)(possibleAbsolutePathsOfTargetChildFile__forwardSlashSeparators, this.childrenFilesResolutionRules.implicitFilesNamesExtensionsWithoutLeadingDotsOfChildrenFiles.map((childFileNameImplicitExtension) => es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
14758
|
+
...path_1.default.isAbsolute(possibleIntermediatePathOfChildFileWithResolvedAlias) ?
|
|
14759
|
+
[] : [parentFileDirectoryAbsolutePath__forwardSlashSeparators],
|
|
14760
|
+
`${possibleIntermediatePathOfChildFileWithResolvedAlias}.${childFileNameImplicitExtension}`
|
|
14761
|
+
], { alwaysForwardSlashSeparators: true })));
|
|
14762
|
+
}
|
|
14763
|
+
}
|
|
14764
|
+
else {
|
|
14765
|
+
for (const possibleIntermediatePathOfChildFileWithResolvedAlias of possibleIntermediatePathsOfChildFileWithResolvedAlias) {
|
|
14766
|
+
possibleAbsolutePathsOfTargetChildFile__forwardSlashSeparators.add(es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
14767
|
+
...path_1.default.isAbsolute(possibleIntermediatePathOfChildFileWithResolvedAlias) ?
|
|
14768
|
+
[] : [parentFileDirectoryAbsolutePath__forwardSlashSeparators],
|
|
14769
|
+
possibleIntermediatePathOfChildFileWithResolvedAlias
|
|
14770
|
+
], { alwaysForwardSlashSeparators: true }));
|
|
14771
|
+
}
|
|
14772
|
+
}
|
|
14773
|
+
for (const possibleAbsolutePathOfTargetChildFile of possibleAbsolutePathsOfTargetChildFile__forwardSlashSeparators) {
|
|
14774
|
+
try {
|
|
14775
|
+
if (fs_1.default.existsSync(possibleAbsolutePathOfTargetChildFile)) {
|
|
14776
|
+
if (isChildFileRawPathAliased) {
|
|
14777
|
+
this.resolvedAliasedPaths.set(childFileRawPath, possibleAbsolutePathOfTargetChildFile);
|
|
14778
|
+
}
|
|
14779
|
+
return possibleAbsolutePathOfTargetChildFile;
|
|
14780
|
+
}
|
|
14781
|
+
}
|
|
14782
|
+
catch (error) {
|
|
14783
|
+
if (true) {
|
|
14784
|
+
es_extensions_1.Logger.logError({
|
|
14785
|
+
errorType: "FileCheckingError",
|
|
14786
|
+
title: "File Checking Error",
|
|
14787
|
+
description: `The error occurred during the checking of the file ${possibleAbsolutePathOfTargetChildFile}` +
|
|
14788
|
+
"for existence.",
|
|
14789
|
+
occurrenceLocation: "sourceCodeSelectiveReprocessingHelper." +
|
|
14790
|
+
"computeAbsolutePathOfChildFileIfItExists(compoundParameter)",
|
|
14791
|
+
caughtError: error
|
|
14792
|
+
});
|
|
14576
14793
|
}
|
|
14794
|
+
return null;
|
|
14577
14795
|
}
|
|
14578
14796
|
}
|
|
14579
|
-
return
|
|
14797
|
+
return null;
|
|
14580
14798
|
}
|
|
14581
|
-
|
|
14582
|
-
const
|
|
14799
|
+
updateMetadataForExistingChildFile({ targetChildFileAbsolutePath__forwardSlashSeparators, parentEntryPointAbsolutePath__forwardSlashSeparators }) {
|
|
14800
|
+
const targetChildFileRelativePath__forwardSlashSeparators = es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
|
|
14583
14801
|
basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
|
|
14584
|
-
comparedPath:
|
|
14802
|
+
comparedPath: targetChildFileAbsolutePath__forwardSlashSeparators,
|
|
14585
14803
|
alwaysForwardSlashSeparators: true
|
|
14586
14804
|
});
|
|
14587
|
-
const
|
|
14805
|
+
const cachedMetadataOfCurrentChildFile = this.childrenFilesMetadata.get(targetChildFileRelativePath__forwardSlashSeparators);
|
|
14588
14806
|
es_extensions_1.Logger.logGeneric({
|
|
14589
14807
|
mustOutputIf: SourceCodeSelectiveReprocessingHelper.DEBUGGING_MODE,
|
|
14590
14808
|
badge: { customText: "Debug" },
|
|
14591
|
-
title: "SourceCodeSelectiveReprocessingHelper,
|
|
14592
|
-
description:
|
|
14809
|
+
title: "SourceCodeSelectiveReprocessingHelper, Updating of Children Files Metadata",
|
|
14810
|
+
description: targetChildFileRelativePath__forwardSlashSeparators,
|
|
14593
14811
|
additionalData: {
|
|
14594
|
-
absolutePathsOfAffiliatedFilesWhichHasBeenScannedDuringCurrentPass: this.
|
|
14812
|
+
absolutePathsOfAffiliatedFilesWhichHasBeenScannedDuringCurrentPass: this.absolutePathsOfChildrenFilesWhichHasBeenScannedDuringCurrentPass
|
|
14595
14813
|
}
|
|
14596
14814
|
});
|
|
14597
|
-
/* [ Approach ] If the file has been scanned it must be in the
|
|
14598
|
-
*
|
|
14599
|
-
|
|
14600
|
-
|
|
14601
|
-
|
|
14815
|
+
/* [ Approach ] If the child file has been scanned it must be in the `childrenFilesMetadata` however for the
|
|
14816
|
+
* TypeScript type checking the non-undefined check of "cachedMetadataOfCurrentAffiliatedFile" additionally
|
|
14817
|
+
* required. */
|
|
14818
|
+
if (this.absolutePathsOfChildrenFilesWhichHasBeenScannedDuringCurrentPass.
|
|
14819
|
+
has(targetChildFileRelativePath__forwardSlashSeparators) &&
|
|
14820
|
+
(0, es_extensions_1.isNotUndefined)(cachedMetadataOfCurrentChildFile)) {
|
|
14821
|
+
cachedMetadataOfCurrentChildFile.parentEntryPointsAbsolutePaths.
|
|
14822
|
+
add(parentEntryPointAbsolutePath__forwardSlashSeparators);
|
|
14602
14823
|
this.registerEntryPointAsParentTo({
|
|
14603
|
-
|
|
14604
|
-
|
|
14824
|
+
cachedMetadataOfTargetChildFile: cachedMetadataOfCurrentChildFile,
|
|
14825
|
+
parentEntryPointAbsolutePath__forwardSlashSeparators
|
|
14605
14826
|
});
|
|
14606
14827
|
return;
|
|
14607
14828
|
}
|
|
14608
|
-
let
|
|
14829
|
+
let targetChildFileModificationDateTime__ISO8601;
|
|
14609
14830
|
try {
|
|
14610
|
-
|
|
14611
|
-
statSync(
|
|
14831
|
+
targetChildFileModificationDateTime__ISO8601 = fs_1.default.
|
|
14832
|
+
statSync(targetChildFileAbsolutePath__forwardSlashSeparators).mtime.toISOString();
|
|
14612
14833
|
}
|
|
14613
14834
|
catch (error) {
|
|
14614
14835
|
es_extensions_1.Logger.logError({
|
|
14615
14836
|
errorType: "FileStatisticsRetrievingFailedError",
|
|
14616
|
-
title: "File
|
|
14617
|
-
description: `Unable to retrieve the statistics of file "${
|
|
14837
|
+
title: "File Statistics Retrieving Failed Error",
|
|
14838
|
+
description: `Unable to retrieve the statistics of file "${targetChildFileAbsolutePath__forwardSlashSeparators}". ` +
|
|
14618
14839
|
"This file will not be mapped.",
|
|
14619
|
-
occurrenceLocation: "sourceCodeSelectiveReprocessingHelper."
|
|
14620
|
-
"updateMetadataMapForExistingAffiliatedFile(propertiesObject)",
|
|
14840
|
+
occurrenceLocation: "sourceCodeSelectiveReprocessingHelper.updateMetadataForExistingChildFile(compoundParameter)",
|
|
14621
14841
|
caughtError: error
|
|
14622
14842
|
});
|
|
14623
14843
|
return;
|
|
14624
14844
|
}
|
|
14625
|
-
let
|
|
14626
|
-
if (
|
|
14627
|
-
|
|
14628
|
-
|
|
14629
|
-
/* [ Theory ] Although the affiliated file is existing and has not changed since last mapping, its affiliated
|
|
14845
|
+
let absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators;
|
|
14846
|
+
if (cachedMetadataOfCurrentChildFile?.modificationDateTime__ISO8601 === targetChildFileModificationDateTime__ISO8601) {
|
|
14847
|
+
absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators = new Set();
|
|
14848
|
+
/* [ Theory ] Although the children file is existing and has not changed since last mapping, its children
|
|
14630
14849
|
* files could be added or deleted. */
|
|
14631
|
-
for (const
|
|
14632
|
-
const
|
|
14633
|
-
if (!fs_1.default.existsSync(
|
|
14634
|
-
|
|
14635
|
-
delete(relativePathOfAffiliatedFileOfCurrentOne);
|
|
14850
|
+
for (const relativePathOfChildFileOfCurrentOne of cachedMetadataOfCurrentChildFile.directChildrenFilesRelativePaths) {
|
|
14851
|
+
const absolutePathOfChildFileOfCurrentOne__forwardSlashSeparators = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH, relativePathOfChildFileOfCurrentOne], { alwaysForwardSlashSeparators: true });
|
|
14852
|
+
if (!fs_1.default.existsSync(absolutePathOfChildFileOfCurrentOne__forwardSlashSeparators)) {
|
|
14853
|
+
cachedMetadataOfCurrentChildFile.directChildrenFilesRelativePaths.delete(relativePathOfChildFileOfCurrentOne);
|
|
14636
14854
|
}
|
|
14637
|
-
|
|
14855
|
+
absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators = new Set(Array.from(cachedMetadataOfCurrentChildFile.directChildrenFilesRelativePaths));
|
|
14638
14856
|
}
|
|
14639
|
-
|
|
14857
|
+
cachedMetadataOfCurrentChildFile.parentEntryPointsAbsolutePaths.
|
|
14858
|
+
add(parentEntryPointAbsolutePath__forwardSlashSeparators);
|
|
14640
14859
|
}
|
|
14641
14860
|
else {
|
|
14642
|
-
|
|
14643
|
-
|
|
14644
|
-
|
|
14645
|
-
|
|
14646
|
-
|
|
14647
|
-
|
|
14648
|
-
|
|
14649
|
-
|
|
14650
|
-
mustConsiderLastSegmentWithNonLeadingDotAsDirectory: false,
|
|
14651
|
-
mustConsiderLastSegmentWihtoutDotsAsFileNameWithoutExtension: true
|
|
14652
|
-
}
|
|
14653
|
-
})
|
|
14654
|
-
});
|
|
14655
|
-
this.affiliatedFilesMetadata.set(targetAffiliatedFileRelativePath, {
|
|
14656
|
-
parentEntryPointsAbsolutePaths: new Set([parentEntryPointAbsolutePath]),
|
|
14657
|
-
modificationDateTime__ISO8601: targetAffiliatedFileModificationDateTime__ISO8601,
|
|
14658
|
-
directAffiliatedFilesRelativePaths: (0, es_extensions_1.createSetBasedOnOtherSet)(absolutePathsOfExistingAffiliatedFilesOfTargetOne, (absolutePathOfExistingAffiliatedFileOfCurrentOne) => es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
|
|
14861
|
+
absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators = this.
|
|
14862
|
+
getAbsolutePathsOfExistingChildrenFilesOfExistingTargetFile__forwardSlashSeparators({
|
|
14863
|
+
targetFileAbsolutePath__forwardSlashSeparators: targetChildFileAbsolutePath__forwardSlashSeparators
|
|
14864
|
+
});
|
|
14865
|
+
this.childrenFilesMetadata.set(targetChildFileRelativePath__forwardSlashSeparators, {
|
|
14866
|
+
parentEntryPointsAbsolutePaths: new Set([parentEntryPointAbsolutePath__forwardSlashSeparators]),
|
|
14867
|
+
modificationDateTime__ISO8601: targetChildFileModificationDateTime__ISO8601,
|
|
14868
|
+
directChildrenFilesRelativePaths: (0, es_extensions_1.createSetBasedOnOtherSet)(absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators, (absolutePathOfExistingAffiliatedFileOfCurrentOne) => es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
|
|
14659
14869
|
basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
|
|
14660
14870
|
comparedPath: absolutePathOfExistingAffiliatedFileOfCurrentOne,
|
|
14661
14871
|
alwaysForwardSlashSeparators: true
|
|
14662
14872
|
}))
|
|
14663
14873
|
});
|
|
14664
14874
|
}
|
|
14665
|
-
this.
|
|
14666
|
-
|
|
14667
|
-
|
|
14668
|
-
|
|
14669
|
-
|
|
14670
|
-
|
|
14671
|
-
additionalData: {
|
|
14672
|
-
affiliatedFilesMetadata: this.affiliatedFilesMetadata
|
|
14673
|
-
}
|
|
14674
|
-
});
|
|
14675
|
-
}
|
|
14676
|
-
for (const absolutePathOfExistingAffiliatedFileOfTargetOne of absolutePathsOfExistingAffiliatedFilesOfTargetOne) {
|
|
14677
|
-
this.updateMetadataMapForExistingAffiliatedFile({
|
|
14678
|
-
targetAffiliatedFileAbsolutePath: absolutePathOfExistingAffiliatedFileOfTargetOne,
|
|
14679
|
-
parentEntryPointAbsolutePath
|
|
14875
|
+
this.absolutePathsOfChildrenFilesWhichHasBeenScannedDuringCurrentPass.
|
|
14876
|
+
add(targetChildFileRelativePath__forwardSlashSeparators);
|
|
14877
|
+
for (const absolutePathOfExistingAffiliatedFileOfTargetOne__forwardSlashSeparators of absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators) {
|
|
14878
|
+
this.updateMetadataForExistingChildFile({
|
|
14879
|
+
targetChildFileAbsolutePath__forwardSlashSeparators: absolutePathOfExistingAffiliatedFileOfTargetOne__forwardSlashSeparators,
|
|
14880
|
+
parentEntryPointAbsolutePath__forwardSlashSeparators
|
|
14680
14881
|
});
|
|
14681
14882
|
}
|
|
14682
14883
|
}
|
|
14683
|
-
|
|
14684
|
-
const
|
|
14685
|
-
|
|
14686
|
-
|
|
14687
|
-
* The second condition is aimed to the processing of paths with multiple files names extensions.
|
|
14688
|
-
* For example, in the Pug preprocessor case, the file "ProductCard.static.pug" could be referred as
|
|
14689
|
-
* `include ProductCard.static`. */
|
|
14690
|
-
if ((0, es_extensions_1.isNull)(explicitlySpecifiedLastFileNameExtensionInAffiliatedFileRawPath) ||
|
|
14691
|
-
!this.affiliatedFilesResolutionRules.implicitFilesNamesExtensionsWithoutLeadingDotsOfAffiliatedFiles.
|
|
14692
|
-
includes(explicitlySpecifiedLastFileNameExtensionInAffiliatedFileRawPath)) {
|
|
14693
|
-
(0, es_extensions_1.addMultipleElementsToSet)(possibleAbsolutePathsOfTargetAffiliatedFile, this.affiliatedFilesResolutionRules.implicitFilesNamesExtensionsWithoutLeadingDotsOfAffiliatedFiles.map((affiliatedFileNameImplicitExtension) => es_extensions_nodejs_1.ImprovedPath.joinPathSegments([parentFileDirectoryAbsolutePath, `${affiliatedFileRawPath}.${affiliatedFileNameImplicitExtension}`], { alwaysForwardSlashSeparators: true })));
|
|
14694
|
-
}
|
|
14695
|
-
else {
|
|
14696
|
-
possibleAbsolutePathsOfTargetAffiliatedFile.add(es_extensions_nodejs_1.ImprovedPath.joinPathSegments([parentFileDirectoryAbsolutePath, affiliatedFileRawPath], { alwaysForwardSlashSeparators: true }));
|
|
14697
|
-
}
|
|
14698
|
-
for (const possibleAbsolutePathOfTargetAffiliatedFile of possibleAbsolutePathsOfTargetAffiliatedFile) {
|
|
14699
|
-
try {
|
|
14700
|
-
if (fs_1.default.existsSync(possibleAbsolutePathOfTargetAffiliatedFile)) {
|
|
14701
|
-
return possibleAbsolutePathOfTargetAffiliatedFile;
|
|
14702
|
-
}
|
|
14703
|
-
}
|
|
14704
|
-
catch (error) {
|
|
14705
|
-
if (true) {
|
|
14706
|
-
es_extensions_1.Logger.logError({
|
|
14707
|
-
errorType: "FileCheckingError",
|
|
14708
|
-
title: "File checking error",
|
|
14709
|
-
description: `The error occurred during the checking of the file ${possibleAbsolutePathOfTargetAffiliatedFile}` +
|
|
14710
|
-
"for existence.",
|
|
14711
|
-
occurrenceLocation: "sourceCodeSelectiveReprocessingHelper." +
|
|
14712
|
-
"computeAbsolutePathOfAffiliatedFileIfItExists(compoundParameter)",
|
|
14713
|
-
caughtError: error
|
|
14714
|
-
});
|
|
14715
|
-
}
|
|
14716
|
-
return null;
|
|
14717
|
-
}
|
|
14718
|
-
}
|
|
14719
|
-
return null;
|
|
14720
|
-
}
|
|
14721
|
-
registerEntryPointAsParentTo({ cachedMetadataOfCurrentAffiliatedFile, parentEntryPointAbsolutePath }) {
|
|
14722
|
-
for (const relativePathsOfDirectAffiliatedFileOfCurrentOne of cachedMetadataOfCurrentAffiliatedFile.directAffiliatedFilesRelativePaths) {
|
|
14723
|
-
const cachedMetadataOfAffiliatedFileOfCurrentOne = this.affiliatedFilesMetadata.get(relativePathsOfDirectAffiliatedFileOfCurrentOne);
|
|
14724
|
-
if ((0, es_extensions_1.isUndefined)(cachedMetadataOfAffiliatedFileOfCurrentOne)) {
|
|
14884
|
+
registerEntryPointAsParentTo({ cachedMetadataOfTargetChildFile, parentEntryPointAbsolutePath__forwardSlashSeparators }) {
|
|
14885
|
+
for (const relativePathsOfDirectChildFileOfCurrentOne__forwardSlashSeparators of cachedMetadataOfTargetChildFile.directChildrenFilesRelativePaths) {
|
|
14886
|
+
const cachedMetadataOfChildFileOfCurrentOne = this.childrenFilesMetadata.get(relativePathsOfDirectChildFileOfCurrentOne__forwardSlashSeparators);
|
|
14887
|
+
if ((0, es_extensions_1.isUndefined)(cachedMetadataOfChildFileOfCurrentOne)) {
|
|
14725
14888
|
continue;
|
|
14726
14889
|
}
|
|
14727
|
-
|
|
14890
|
+
cachedMetadataOfChildFileOfCurrentOne.parentEntryPointsAbsolutePaths.
|
|
14891
|
+
add(parentEntryPointAbsolutePath__forwardSlashSeparators);
|
|
14728
14892
|
this.registerEntryPointAsParentTo({
|
|
14729
|
-
|
|
14730
|
-
|
|
14893
|
+
cachedMetadataOfTargetChildFile: cachedMetadataOfChildFileOfCurrentOne,
|
|
14894
|
+
parentEntryPointAbsolutePath__forwardSlashSeparators
|
|
14731
14895
|
});
|
|
14732
14896
|
}
|
|
14733
14897
|
}
|
|
14734
|
-
|
|
14735
|
-
|
|
14898
|
+
clearFileMetadataPathFromCache(targetFileRelativePath__forwardSlashesPathSeparators) {
|
|
14899
|
+
this.entryPointsMetadata.delete(targetFileRelativePath__forwardSlashesPathSeparators);
|
|
14900
|
+
for (const entryPointMetadata of this.entryPointsMetadata.values()) {
|
|
14901
|
+
entryPointMetadata.directChildrenFilesRelativePaths.delete(targetFileRelativePath__forwardSlashesPathSeparators);
|
|
14902
|
+
}
|
|
14903
|
+
this.childrenFilesMetadata.delete(targetFileRelativePath__forwardSlashesPathSeparators);
|
|
14904
|
+
for (const childFileMetadata of this.childrenFilesMetadata.values()) {
|
|
14905
|
+
childFileMetadata.directChildrenFilesRelativePaths.delete(targetFileRelativePath__forwardSlashesPathSeparators);
|
|
14906
|
+
childFileMetadata.parentEntryPointsAbsolutePaths.delete(targetFileRelativePath__forwardSlashesPathSeparators);
|
|
14907
|
+
}
|
|
14908
|
+
}
|
|
14909
|
+
/* ─── Cache File ───────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
14910
|
+
saveCachedFilesMetadataMapsToFile() {
|
|
14736
14911
|
const outputData = {
|
|
14737
14912
|
entryPoints: Array.from(this.entryPointsMetadata.entries()).
|
|
14738
14913
|
reduce((entryPointsMetadata, [entryPointPathRelativeToConsumingProjectRootDirectory, entryPointMetadata]) => {
|
|
14739
14914
|
entryPointsMetadata[entryPointPathRelativeToConsumingProjectRootDirectory] = {
|
|
14740
14915
|
modificationDate__ISO8601: entryPointMetadata.modificationDate__ISO8601,
|
|
14741
|
-
|
|
14916
|
+
directChildrenFilesRelativePaths: Array.from(entryPointMetadata.directChildrenFilesRelativePaths)
|
|
14742
14917
|
};
|
|
14743
14918
|
return entryPointsMetadata;
|
|
14744
14919
|
}, {}),
|
|
14745
|
-
|
|
14746
|
-
reduce((
|
|
14747
|
-
|
|
14748
|
-
modificationDate__ISO8601:
|
|
14749
|
-
|
|
14750
|
-
parentEntryPointsRelativePaths: Array.from(
|
|
14920
|
+
childrenFiles: Array.from(this.childrenFilesMetadata.entries()).
|
|
14921
|
+
reduce((childrenFilesMetadata, [childFilePathRelativeToConsumingProjectRootDirectory, childFileMetadata]) => {
|
|
14922
|
+
childrenFilesMetadata[childFilePathRelativeToConsumingProjectRootDirectory] = {
|
|
14923
|
+
modificationDate__ISO8601: childFileMetadata.modificationDateTime__ISO8601,
|
|
14924
|
+
directChildrenFilesRelativePaths: Array.from(childFileMetadata.directChildrenFilesRelativePaths),
|
|
14925
|
+
parentEntryPointsRelativePaths: Array.from(childFileMetadata.parentEntryPointsAbsolutePaths).
|
|
14751
14926
|
map((parentEntryPointsAbsolutePath) => es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
|
|
14752
14927
|
basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
|
|
14753
14928
|
comparedPath: parentEntryPointsAbsolutePath,
|
|
14754
14929
|
alwaysForwardSlashSeparators: true
|
|
14755
14930
|
}))
|
|
14756
14931
|
};
|
|
14757
|
-
return
|
|
14932
|
+
return childrenFilesMetadata;
|
|
14758
14933
|
}, {})
|
|
14759
14934
|
};
|
|
14760
14935
|
fs_1.default.writeFileSync(this.CACHED_METADATA_FILE_ABSOLUTE_PATH, (0, es_extensions_1.stringifyAndFormatArbitraryValue)(outputData));
|
|
14761
14936
|
}
|
|
14762
|
-
/*
|
|
14763
|
-
|
|
14764
|
-
logAffiliatedFilesAndEntryPointsRelationships() {
|
|
14937
|
+
/* ─── Logging ──────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
14938
|
+
logChildrenFilesAndEntryPointsRelationships() {
|
|
14765
14939
|
let accumulatingString = "";
|
|
14766
|
-
for (const [
|
|
14767
|
-
accumulatingString = `${accumulatingString}File: "${
|
|
14768
|
-
for (const entryPointFileAbsolutePath of
|
|
14940
|
+
for (const [childFileRelativePath, childFileMetadata] of this.childrenFilesMetadata.entries()) {
|
|
14941
|
+
accumulatingString = `${accumulatingString}File: "${childFileRelativePath}" has parents:\n`;
|
|
14942
|
+
for (const entryPointFileAbsolutePath of childFileMetadata.parentEntryPointsAbsolutePaths) {
|
|
14769
14943
|
accumulatingString = `${accumulatingString} ● ${es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
|
|
14770
14944
|
basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
|
|
14771
14945
|
comparedPath: entryPointFileAbsolutePath,
|
|
@@ -14774,8 +14948,8 @@ class SourceCodeSelectiveReprocessingHelper {
|
|
|
14774
14948
|
}
|
|
14775
14949
|
}
|
|
14776
14950
|
es_extensions_1.Logger.logInfo({
|
|
14777
|
-
title: `${this.TARGET_FILES_TYPE_IN_SINGULAR_FORM}
|
|
14778
|
-
description: accumulatingString.length > 0 ? accumulatingString : "No existing
|
|
14951
|
+
title: `${this.TARGET_FILES_TYPE_IN_SINGULAR_FORM} Children Files and Respective Parent Entry Points Relationships`,
|
|
14952
|
+
description: accumulatingString.length > 0 ? accumulatingString : "No existing children files has been found."
|
|
14779
14953
|
});
|
|
14780
14954
|
}
|
|
14781
14955
|
}
|
|
@@ -15321,7 +15495,7 @@ function revisionHash(data) {
|
|
|
15321
15495
|
\***********************/
|
|
15322
15496
|
/***/ ((module) => {
|
|
15323
15497
|
|
|
15324
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@yamato-daiwa/automation","version":"0.5.0-alpha.
|
|
15498
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@yamato-daiwa/automation","version":"0.5.0-alpha.2","description":"The project building tool with declarative YAML configuration specializing on Pug, Stylus and TypeScript as source code languages.","keywords":["build","pug","stylus","tool","typescript"],"engines":{"node":">=18.18.0"},"bin":{"yda":"Executable"},"files":["EntryPoint.js"],"dependencies":{"@stylistic/eslint-plugin":"1.7.2","@typescript-eslint/eslint-plugin":"7.12.0","@typescript-eslint/parser":"7.12.0","@vue/compiler-sfc":"3.4.27","@webdiscus/pug-loader":"2.11.0","@yamato-daiwa/es-extensions":"1.8.0-alpha.2","@yamato-daiwa/es-extensions-nodejs":"1.8.0-alpha.1","@yamato-daiwa/style_guides":"0.2.7","autoprefixer":"10.4.19","browser-sync":"3.0.2","css-loader":"7.1.2","cssnano":"7.0.2","eslint":"8.57.0","eslint-plugin-import":"2.29.1","eslint-plugin-node":"11.1.0","eslint-plugin-react":"7.34.2","eslint-plugin-vue":"9.26.0","eslint-plugin-vue-pug":"0.6.2","fork-ts-checker-webpack-plugin":"7.3.0","gulp":"4.0.2","gulp-data":"1.3.1","gulp-html-prettify":"0.0.1","gulp-if":"3.0.0","gulp-imagemin":"7.1.0","gulp-nodemon":"2.5.0","gulp-plumber":"1.2.1","gulp-postcss":"10.0.0","gulp-pug":"5.0.0","gulp-sourcemaps":"3.0.0","gulp-stylus":"3.0.1","imagemin-pngquant":"9.0.2","json5-loader":"4.0.1","node-html-parser":"6.1.13","node-notifier":"10.0.1","pa11y":"8.0.0","probe-image-size":"7.2.3","pug3-ast-loader":"0.0.0","pug-lint":"2.7.0","puppeteer":"22.10.0","rev-hash":"4.1.0","stlint":"1.0.65","stream-combiner2":"1.1.1","style-loader":"4.0.0","stylus":"0.63.0","stylus-loader":"8.1.0","ts-loader":"9.5.1","vinyl":"2.2.1","vue-loader":"17.4.2","vue-style-loader":"4.1.3","w3c-html-validator":"0.8.1","webpack":"5.91.0","webpack-node-externals":"3.0.0","webpack-stream":"7.0.0","worker-loader":"3.0.8","yaml-loader":"0.8.1"},"devDependencies":{"@types/browser-sync":"2.29.0","@types/cssnano":"5.0.0","@types/gulp":"4.0.17","@types/gulp-html-prettify":"0.0.5","@types/gulp-if":"3.0.4","@types/gulp-imagemin":"8.0.6","@types/gulp-nodemon":"0.0.37","@types/gulp-plumber":"0.0.37","@types/gulp-postcss":"8.0.6","@types/gulp-sourcemaps":"0.0.38","@types/gulp-stylus":"2.7.8","@types/node":"20.14.2","@types/node-notifier":"8.0.5","@types/pa11y":"5.3.7","@types/probe-image-size":"7.2.4","@types/pug":"2.0.10","@types/webpack-node-externals":"3.0.4","@types/webpack-stream":"3.2.15","eslint-webpack-plugin":"4.2.0","ts-node":"10.9.2","typescript":"5.4.5","webpack-cli":"5.1.4"},"scripts":{"Incremental development building":"webpack --mode development","Production building":"webpack --mode production","Linting":"eslint Source","Tree diagram of source files generating":"tree Source /f"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/TokugawaTakeshi/Yamato-Daiwa-Automation.git"},"bugs":{"url":"https://github.com/TokugawaTakeshi/Yamato-Daiwa-Automation/issues","email":"tokugawa.takesi@gmail.com"}}');
|
|
15325
15499
|
|
|
15326
15500
|
/***/ })
|
|
15327
15501
|
|