@yamato-daiwa/automation 0.5.0-alpha.1 → 0.5.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/EntryPoint.js +672 -419
- package/package.json +14 -14
package/EntryPoint.js
CHANGED
|
@@ -3177,12 +3177,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3177
3177
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
3178
3178
|
};
|
|
3179
3179
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3180
|
+
exports["default"] = mustProvideIncrementalProjectBuilding;
|
|
3180
3181
|
const ConsumingProjectBuildingModes_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/Restrictions/ConsumingProjectBuildingModes */ "./ProjectBuilding/Common/Restrictions/ConsumingProjectBuildingModes.ts"));
|
|
3181
3182
|
function mustProvideIncrementalProjectBuilding(consumingProjectBuildingModes) {
|
|
3182
3183
|
return consumingProjectBuildingModes === ConsumingProjectBuildingModes_1.default.staticPreview ||
|
|
3183
3184
|
consumingProjectBuildingModes === ConsumingProjectBuildingModes_1.default.localDevelopment;
|
|
3184
3185
|
}
|
|
3185
|
-
exports["default"] = mustProvideIncrementalProjectBuilding;
|
|
3186
3186
|
|
|
3187
3187
|
|
|
3188
3188
|
/***/ }),
|
|
@@ -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
|
|
|
@@ -7379,13 +7442,9 @@ class ECMA_ScriptSourceCodeLinter extends LinterLikeTaskExecutor_1.default {
|
|
|
7379
7442
|
}),
|
|
7380
7443
|
es_extensions_nodejs_1.ImprovedGlob.buildExcludingOfDirectoryWithSubdirectoriesGlobSelector(es_extensions_nodejs_1.ImprovedPath.joinPathSegments([projectBuildingMasterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath, "node_modules"])),
|
|
7381
7444
|
/* [ ESLint theory ]
|
|
7382
|
-
*
|
|
7383
|
-
*
|
|
7384
|
-
|
|
7385
|
-
...ESLintLinterSpecialist_1.default.getGlobSelectorsOfExcludedFiles({
|
|
7386
|
-
consumingProjectRootDirectoryAbsolutePath: projectBuildingMasterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath,
|
|
7387
|
-
mustSkipNodeModulesDirectory: true
|
|
7388
|
-
})
|
|
7445
|
+
* In there are files and/or directories ignored in ESLint configuration they also must be excluded from
|
|
7446
|
+
* the Gulp pipelines otherwise ESLint will emit the warning for ignored files. */
|
|
7447
|
+
...ESLintLinterSpecialist_1.default.generateExcludingGlobSelectorsOfIgnoredFiles(projectBuildingMasterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath)
|
|
7389
7448
|
],
|
|
7390
7449
|
logging: {
|
|
7391
7450
|
pathsOfFilesWillBeProcessed: ecmaScriptLogicProcessingSettingsRepresentative.loggingSettings.filesPaths,
|
|
@@ -7973,7 +8032,6 @@ class WebpackConfigGenerator {
|
|
|
7973
8032
|
supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots.
|
|
7974
8033
|
map((fileNameExtensionWithoutDot) => `.${fileNameExtensionWithoutDot}`),
|
|
7975
8034
|
alias: {
|
|
7976
|
-
//
|
|
7977
8035
|
...WebpackSpecialist_1.default.convertPathsAliasesFromTypeScriptFormatToWebpackFormat({
|
|
7978
8036
|
typeScriptPathsSettings: typeScriptCompilerOptions.paths,
|
|
7979
8037
|
typeScriptBasicAbsolutePath: typeScriptCompilerOptions.baseUrl ??
|
|
@@ -8840,9 +8898,9 @@ class MarkupProcessor extends GulpStreamsBasedTaskExecutor_1.default {
|
|
|
8840
8898
|
dataHoldingSelfInstance.sourceCodeSelectiveReprocessingHelper = new SourceCodeSelectiveReprocessingHelper_1.default({
|
|
8841
8899
|
initialEntryPointsSourceFilesAbsolutePaths: markupProcessingSettingsRepresentative.
|
|
8842
8900
|
initialRelevantEntryPointsSourceFilesAbsolutePaths,
|
|
8843
|
-
|
|
8844
|
-
|
|
8845
|
-
|
|
8901
|
+
childrenFilesResolutionRules: {
|
|
8902
|
+
childrenFilesIncludingDeclarationsPatterns: PugPreProcessorSpecialist_1.default.partialFilesIncludingDeclarationPatterns,
|
|
8903
|
+
implicitFilesNamesExtensionsWithoutLeadingDotsOfChildrenFiles: PugPreProcessorSpecialist_1.default.
|
|
8846
8904
|
implicitFilesNamesExtensionsWithoutLeadingDotsOfPartials
|
|
8847
8905
|
},
|
|
8848
8906
|
isEntryPoint: markupProcessingSettingsRepresentative.isEntryPoint.bind(markupProcessingSettingsRepresentative),
|
|
@@ -12069,7 +12127,7 @@ class RoutingSettingsNormalizer {
|
|
|
12069
12127
|
occurrenceLocation: "RoutingSettingsNormalizer.normalizeDepthLevelWiseRecursively(...parameters)"
|
|
12070
12128
|
});
|
|
12071
12129
|
}
|
|
12072
|
-
RoutingSettingsNormalizer.routingPathSegments.push(RoutingSettingsNormalizer.routingPathSegments.length === 0 ? "" : "$children");
|
|
12130
|
+
RoutingSettingsNormalizer.routingPathSegments.push(...RoutingSettingsNormalizer.routingPathSegments.length === 0 ? [""] : ["$children", ""]);
|
|
12073
12131
|
for (const [routeKey, rawRoute] of Object.entries(rawRoutingOfSpecificDepthLevel)) {
|
|
12074
12132
|
RoutingSettingsNormalizer.routingPathSegments[RoutingSettingsNormalizer.routingPathSegments.length - 1] = routeKey;
|
|
12075
12133
|
if (!(0, es_extensions_1.isArbitraryObject)(rawRoute)) {
|
|
@@ -12093,7 +12151,6 @@ class RoutingSettingsNormalizer {
|
|
|
12093
12151
|
localization
|
|
12094
12152
|
})
|
|
12095
12153
|
} : null,
|
|
12096
|
-
// TODO ========================================================================================================
|
|
12097
12154
|
...(0, es_extensions_1.isArbitraryObject)(rawRoute.$sectioning) ? {
|
|
12098
12155
|
$sectioning: RoutingSettingsNormalizer.normalizeSectioning(rawRoute.$sectioning, routeURI, localization)
|
|
12099
12156
|
} : null
|
|
@@ -12220,57 +12277,81 @@ class RoutingSettingsNormalizer {
|
|
|
12220
12277
|
}
|
|
12221
12278
|
return headingWorkpiece;
|
|
12222
12279
|
}
|
|
12223
|
-
// TODO ==============================================================================================================
|
|
12224
12280
|
/* ━━━ Sectioning ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
12225
12281
|
static normalizeSectioning(rawSectioningSpecification, parentRouteURI, localization) {
|
|
12226
12282
|
RoutingSettingsNormalizer.routingPathSegments.push("$sectioning");
|
|
12283
|
+
if (!(0, es_extensions_1.isString)(parentRouteURI)) {
|
|
12284
|
+
es_extensions_1.Logger.throwErrorAndLog({
|
|
12285
|
+
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12286
|
+
customMessage: `The sectioning at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}" has been defined ` +
|
|
12287
|
+
"while the $URI of the parent route has not been. " +
|
|
12288
|
+
"It must be defined to compute the URI for each section."
|
|
12289
|
+
}),
|
|
12290
|
+
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12291
|
+
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)"
|
|
12292
|
+
});
|
|
12293
|
+
}
|
|
12227
12294
|
if (!(0, es_extensions_1.isNonEmptyString)(rawSectioningSpecification.$specificationFileRelativePath)) {
|
|
12228
12295
|
es_extensions_1.Logger.throwErrorAndLog({
|
|
12229
12296
|
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12230
|
-
customMessage:
|
|
12231
|
-
|
|
12297
|
+
customMessage: `Malformed routing at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}.` +
|
|
12298
|
+
"$specificationFileRelativePath\"." +
|
|
12232
12299
|
"The \"$sectioning.$specificationFileRelativePath\" must be defined with the valid file path relative " +
|
|
12233
|
-
|
|
12234
|
-
].join(" ")
|
|
12300
|
+
"to project top directory."
|
|
12235
12301
|
}),
|
|
12236
12302
|
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12237
|
-
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(
|
|
12303
|
+
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)"
|
|
12238
12304
|
});
|
|
12239
12305
|
}
|
|
12240
|
-
const
|
|
12241
|
-
|
|
12242
|
-
|
|
12243
|
-
|
|
12244
|
-
|
|
12245
|
-
|
|
12246
|
-
|
|
12247
|
-
|
|
12248
|
-
|
|
12306
|
+
const rawSectioningSchemaFileAbsolutePath = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
12307
|
+
RoutingSettingsNormalizer.projectRootDirectoryAbsolutePath,
|
|
12308
|
+
rawSectioningSpecification.$specificationFileRelativePath
|
|
12309
|
+
], { alwaysForwardSlashSeparators: true });
|
|
12310
|
+
let rawSectioningSchema;
|
|
12311
|
+
try {
|
|
12312
|
+
rawSectioningSchema = es_extensions_nodejs_1.ObjectDataFilesProcessor.processFile({
|
|
12313
|
+
filePath: es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
12314
|
+
RoutingSettingsNormalizer.projectRootDirectoryAbsolutePath,
|
|
12315
|
+
rawSectioningSpecification.$specificationFileRelativePath
|
|
12316
|
+
]),
|
|
12317
|
+
synchronously: true,
|
|
12318
|
+
schema: es_extensions_nodejs_1.ObjectDataFilesProcessor.SupportedSchemas.YAML
|
|
12319
|
+
});
|
|
12320
|
+
}
|
|
12321
|
+
catch (error) {
|
|
12249
12322
|
es_extensions_1.Logger.throwErrorAndLog({
|
|
12250
12323
|
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12251
|
-
customMessage:
|
|
12252
|
-
`
|
|
12253
|
-
`Must be an object while ${typeof rawSectioning} found.`
|
|
12254
|
-
].join(" ")
|
|
12324
|
+
customMessage: "The error has occurred during the reading of sectioning file at " +
|
|
12325
|
+
`"${rawSectioningSpecification.$specificationFileRelativePath}".`
|
|
12255
12326
|
}),
|
|
12256
12327
|
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12257
|
-
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(
|
|
12328
|
+
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)",
|
|
12329
|
+
innerError: error
|
|
12258
12330
|
});
|
|
12259
12331
|
}
|
|
12260
|
-
|
|
12332
|
+
RoutingSettingsNormalizer.cachedAbsolutePathsOfSectioning.add(rawSectioningSchemaFileAbsolutePath);
|
|
12333
|
+
if (!(0, es_extensions_1.isArbitraryObject)(rawSectioningSchema)) {
|
|
12261
12334
|
es_extensions_1.Logger.throwErrorAndLog({
|
|
12262
12335
|
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12263
|
-
customMessage: `
|
|
12264
|
-
|
|
12265
|
-
"It must be defined to compute the URI for each section."
|
|
12336
|
+
customMessage: `Malformed sectioning at "${rawSectioningSpecification.$specificationFileRelativePath}". ` +
|
|
12337
|
+
`Must be an object while ${typeof (0, es_extensions_1.nullToUndefined)(rawSectioningSchema)} found.`
|
|
12266
12338
|
}),
|
|
12267
12339
|
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12268
|
-
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(
|
|
12340
|
+
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)"
|
|
12269
12341
|
});
|
|
12270
12342
|
}
|
|
12271
12343
|
if ((0, es_extensions_1.isArbitraryObject)(rawSectioningSpecification.$localizations)) {
|
|
12272
12344
|
if ((0, es_extensions_1.isUndefined)(localization)) {
|
|
12273
|
-
|
|
12345
|
+
es_extensions_1.Logger.throwErrorAndLog({
|
|
12346
|
+
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12347
|
+
customMessage: "The $localizations has been specified for sectioning " +
|
|
12348
|
+
`"${RoutingSettingsNormalizer.routingPathSegments.join(".")}", but common localizations for ` +
|
|
12349
|
+
"routing has not been. " +
|
|
12350
|
+
"Specify the $localizations property also in routing configuration."
|
|
12351
|
+
}),
|
|
12352
|
+
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12353
|
+
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)"
|
|
12354
|
+
});
|
|
12274
12355
|
}
|
|
12275
12356
|
const targetLocalizationFileRelativePath = rawSectioningSpecification.$localizations[localization.locale];
|
|
12276
12357
|
RoutingSettingsNormalizer.routingPathSegments.push("$localizations", localization.locale);
|
|
@@ -12279,30 +12360,42 @@ class RoutingSettingsNormalizer {
|
|
|
12279
12360
|
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12280
12361
|
customMessage: "Invalid path to sectioning localization at " +
|
|
12281
12362
|
`"${RoutingSettingsNormalizer.routingPathSegments.join(".")}". ` +
|
|
12282
|
-
|
|
12363
|
+
"Must be the string with file path relative to project root directory, " +
|
|
12364
|
+
`${typeof (0, es_extensions_1.nullToUndefined)(targetLocalizationFileRelativePath)} found.`
|
|
12283
12365
|
}),
|
|
12284
12366
|
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12285
|
-
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(
|
|
12367
|
+
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)"
|
|
12286
12368
|
});
|
|
12287
12369
|
}
|
|
12288
|
-
const
|
|
12289
|
-
|
|
12290
|
-
|
|
12291
|
-
|
|
12292
|
-
|
|
12293
|
-
|
|
12294
|
-
|
|
12370
|
+
const targetLocalizationFileAbsolutePath = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([RoutingSettingsNormalizer.projectRootDirectoryAbsolutePath, targetLocalizationFileRelativePath], { alwaysForwardSlashSeparators: true });
|
|
12371
|
+
let sectioningRawLocalization;
|
|
12372
|
+
try {
|
|
12373
|
+
sectioningRawLocalization = es_extensions_nodejs_1.ObjectDataFilesProcessor.processFile({
|
|
12374
|
+
filePath: targetLocalizationFileAbsolutePath,
|
|
12375
|
+
synchronously: true,
|
|
12376
|
+
schema: es_extensions_nodejs_1.ObjectDataFilesProcessor.SupportedSchemas.YAML
|
|
12377
|
+
});
|
|
12378
|
+
}
|
|
12379
|
+
catch (error) {
|
|
12380
|
+
es_extensions_1.Logger.throwErrorAndLog({
|
|
12381
|
+
errorInstance: new es_extensions_1.FileReadingFailedError({ filePath: targetLocalizationFileAbsolutePath }),
|
|
12382
|
+
title: es_extensions_1.FileReadingFailedError.localization.defaultTitle,
|
|
12383
|
+
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)",
|
|
12384
|
+
innerError: error
|
|
12385
|
+
});
|
|
12386
|
+
}
|
|
12387
|
+
RoutingSettingsNormalizer.cachedAbsolutePathsOfSectioning.add(targetLocalizationFileAbsolutePath);
|
|
12295
12388
|
if (!(0, es_extensions_1.isArbitraryObject)(sectioningRawLocalization)) {
|
|
12296
12389
|
es_extensions_1.Logger.throwErrorAndLog({
|
|
12297
12390
|
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12298
|
-
customMessage: `Malformed sectioning localization at "${
|
|
12391
|
+
customMessage: `Malformed sectioning localization at "${targetLocalizationFileAbsolutePath}".`
|
|
12299
12392
|
}),
|
|
12300
12393
|
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12301
|
-
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(
|
|
12394
|
+
occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)"
|
|
12302
12395
|
});
|
|
12303
12396
|
}
|
|
12304
12397
|
const normalizedLocalizedSectioning = RoutingSettingsNormalizer.normalizeSectioningDepthLevelRecursively({
|
|
12305
|
-
rawSectioningOfSpecificDepthLevel:
|
|
12398
|
+
rawSectioningOfSpecificDepthLevel: rawSectioningSchema,
|
|
12306
12399
|
outputWorkpiece: {},
|
|
12307
12400
|
localization: {
|
|
12308
12401
|
locale: localization.locale,
|
|
@@ -12310,11 +12403,12 @@ class RoutingSettingsNormalizer {
|
|
|
12310
12403
|
},
|
|
12311
12404
|
parentRouteURI
|
|
12312
12405
|
});
|
|
12313
|
-
|
|
12406
|
+
/* eslint-disable-next-line @typescript-eslint/no-magic-numbers -- `$localizations` and `localization.locale` */
|
|
12407
|
+
RoutingSettingsNormalizer.routingPathSegments.splice(-2);
|
|
12314
12408
|
return normalizedLocalizedSectioning;
|
|
12315
12409
|
}
|
|
12316
12410
|
return RoutingSettingsNormalizer.normalizeSectioningDepthLevelRecursively({
|
|
12317
|
-
rawSectioningOfSpecificDepthLevel:
|
|
12411
|
+
rawSectioningOfSpecificDepthLevel: rawSectioningSchema,
|
|
12318
12412
|
outputWorkpiece: {},
|
|
12319
12413
|
parentRouteURI
|
|
12320
12414
|
});
|
|
@@ -12323,60 +12417,56 @@ class RoutingSettingsNormalizer {
|
|
|
12323
12417
|
if (!(0, es_extensions_1.isArbitraryObject)(rawSectioningOfSpecificDepthLevel)) {
|
|
12324
12418
|
es_extensions_1.Logger.throwErrorAndLog({
|
|
12325
12419
|
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(" ")
|
|
12420
|
+
customMessage: `Malformed routing at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}". ` +
|
|
12421
|
+
`Must be an object while ${typeof (0, es_extensions_1.nullToUndefined)(rawSectioningOfSpecificDepthLevel)} found.`
|
|
12333
12422
|
}),
|
|
12334
12423
|
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12335
|
-
occurrenceLocation: "RoutingSettingsNormalizer.normalizeDepthLevelWiseRecursively(
|
|
12424
|
+
occurrenceLocation: "RoutingSettingsNormalizer.normalizeDepthLevelWiseRecursively(compoundParameter)"
|
|
12336
12425
|
});
|
|
12337
12426
|
}
|
|
12427
|
+
RoutingSettingsNormalizer.routingPathSegments.push(
|
|
12428
|
+
/* eslint-disable-next-line @typescript-eslint/no-magic-numbers -- For the top level of sectioning case,
|
|
12429
|
+
the "$sectioning" element will be second from the end. */
|
|
12430
|
+
...RoutingSettingsNormalizer.routingPathSegments[RoutingSettingsNormalizer.routingPathSegments.length - 3] ===
|
|
12431
|
+
"$sectioning" ? [""] : ["$children", ""]);
|
|
12338
12432
|
RoutingSettingsNormalizer.routingPathSegments.push("");
|
|
12339
|
-
for (const [sectionKey,
|
|
12433
|
+
for (const [sectionKey, sectionRawMetadata] of Object.entries(rawSectioningOfSpecificDepthLevel)) {
|
|
12340
12434
|
RoutingSettingsNormalizer.routingPathSegments[RoutingSettingsNormalizer.routingPathSegments.length - 1] = sectionKey;
|
|
12341
|
-
if (!(0, es_extensions_1.isArbitraryObject)(
|
|
12435
|
+
if (!(0, es_extensions_1.isArbitraryObject)(sectionRawMetadata)) {
|
|
12342
12436
|
es_extensions_1.Logger.throwErrorAndLog({
|
|
12343
12437
|
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12344
|
-
customMessage:
|
|
12345
|
-
`
|
|
12346
|
-
`Must be an object while ${typeof rawSectionMetadata} found.`
|
|
12347
|
-
].join(" ")
|
|
12438
|
+
customMessage: `Malformed sectioning at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}".` +
|
|
12439
|
+
`Must be an object while ${typeof (0, es_extensions_1.nullToUndefined)(sectionRawMetadata)} found.`
|
|
12348
12440
|
}),
|
|
12349
12441
|
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12350
|
-
occurrenceLocation: "RoutingSettingsNormalizer.
|
|
12442
|
+
occurrenceLocation: "RoutingSettingsNormalizer.normalizeDepthLevelWiseRecursively(compoundParameter)"
|
|
12351
12443
|
});
|
|
12352
12444
|
}
|
|
12353
|
-
if (!(0, es_extensions_1.isString)(
|
|
12445
|
+
if (!(0, es_extensions_1.isString)(sectionRawMetadata.$anchor)) {
|
|
12354
12446
|
es_extensions_1.Logger.throwErrorAndLog({
|
|
12355
12447
|
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12356
|
-
customMessage:
|
|
12357
|
-
`
|
|
12358
|
-
`The property "$anchor" must be defined with string while ${typeof rawSectionMetadata} found.`
|
|
12359
|
-
].join(" ")
|
|
12448
|
+
customMessage: `Malformed sectioning at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}". ` +
|
|
12449
|
+
`The property "$anchor" must be defined with string while ${typeof sectionRawMetadata} found.`
|
|
12360
12450
|
}),
|
|
12361
12451
|
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12362
|
-
occurrenceLocation: "RoutingSettingsNormalizer.
|
|
12452
|
+
occurrenceLocation: "RoutingSettingsNormalizer.normalizeDepthLevelWiseRecursively(compoundParameter)"
|
|
12363
12453
|
});
|
|
12364
12454
|
}
|
|
12365
|
-
|
|
12366
|
-
$heading: RoutingSettingsNormalizer.normalizeHeading(
|
|
12367
|
-
$anchor:
|
|
12368
|
-
$URI: `${parentRouteURI}#${
|
|
12369
|
-
...(0, es_extensions_1.isArbitraryObject)(
|
|
12455
|
+
outputWorkpiece[sectionKey] = {
|
|
12456
|
+
$heading: RoutingSettingsNormalizer.normalizeHeading(sectionRawMetadata.$heading, localization),
|
|
12457
|
+
$anchor: sectionRawMetadata.$anchor,
|
|
12458
|
+
$URI: `${parentRouteURI}#${sectionRawMetadata.$anchor}`,
|
|
12459
|
+
...(0, es_extensions_1.isArbitraryObject)(sectionRawMetadata.$children) ? {
|
|
12370
12460
|
$children: RoutingSettingsNormalizer.normalizeSectioningDepthLevelRecursively({
|
|
12371
|
-
rawSectioningOfSpecificDepthLevel:
|
|
12461
|
+
rawSectioningOfSpecificDepthLevel: sectionRawMetadata.$children,
|
|
12372
12462
|
outputWorkpiece: {},
|
|
12373
12463
|
localization,
|
|
12374
12464
|
parentRouteURI
|
|
12375
12465
|
})
|
|
12376
12466
|
} : null
|
|
12377
12467
|
};
|
|
12378
|
-
outputWorkpiece[sectionKey] = normalizedSectionMetadata;
|
|
12379
12468
|
}
|
|
12469
|
+
RoutingSettingsNormalizer.routingPathSegments.pop();
|
|
12380
12470
|
return outputWorkpiece;
|
|
12381
12471
|
}
|
|
12382
12472
|
}
|
|
@@ -13313,9 +13403,9 @@ class StylesProcessor extends GulpStreamsBasedTaskExecutor_1.default {
|
|
|
13313
13403
|
dataHoldingSelfInstance.sourceCodeSelectiveReprocessingHelper = new SourceCodeSelectiveReprocessingHelper_1.default({
|
|
13314
13404
|
initialEntryPointsSourceFilesAbsolutePaths: stylesProcessingSettingsRepresentative.
|
|
13315
13405
|
initialRelevantEntryPointsSourceFilesAbsolutePaths,
|
|
13316
|
-
|
|
13317
|
-
|
|
13318
|
-
|
|
13406
|
+
childrenFilesResolutionRules: {
|
|
13407
|
+
childrenFilesIncludingDeclarationsPatterns: StylusPreProcessorSpecialist_1.default.partialFilesIncludingDeclarationPatterns,
|
|
13408
|
+
implicitFilesNamesExtensionsWithoutLeadingDotsOfChildrenFiles: StylusPreProcessorSpecialist_1.default.
|
|
13319
13409
|
implicitFilesNamesExtensionsWithoutLeadingDotsOfPartials
|
|
13320
13410
|
},
|
|
13321
13411
|
isEntryPoint: stylesProcessingSettingsRepresentative.isEntryPoint.bind(stylesProcessingSettingsRepresentative),
|
|
@@ -13599,11 +13689,11 @@ exports["default"] = ChokidarSpecialistLocalization__English;
|
|
|
13599
13689
|
|
|
13600
13690
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
13601
13691
|
class ECMA_ScriptSpecialist {
|
|
13602
|
-
/* [ Fiddle ] https://regex101.com/r/4X0mYk/
|
|
13692
|
+
/* [ Fiddle ] https://regex101.com/r/4X0mYk/7 */
|
|
13603
13693
|
static partialFilesIncludingDeclarationPatterns = [
|
|
13604
13694
|
/* eslint-disable-next-line prefer-named-capture-group --
|
|
13605
13695
|
* No simple way to know the capturing group name outside of this file. */
|
|
13606
|
-
/from\s+["']((?:\w
|
|
13696
|
+
/from\s+["']((?:\w|-|\.|\/|:|@|~)+)["']/gmu
|
|
13607
13697
|
];
|
|
13608
13698
|
}
|
|
13609
13699
|
exports["default"] = ECMA_ScriptSpecialist;
|
|
@@ -13622,25 +13712,108 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13622
13712
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13623
13713
|
};
|
|
13624
13714
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
13625
|
-
const fs_1 = __importDefault(__webpack_require__(/*! fs */ "fs"));
|
|
13626
13715
|
const path_1 = __importDefault(__webpack_require__(/*! path */ "path"));
|
|
13716
|
+
const fs_1 = __importDefault(__webpack_require__(/*! fs */ "fs"));
|
|
13627
13717
|
const es_extensions_nodejs_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions-nodejs */ "@yamato-daiwa/es-extensions-nodejs");
|
|
13718
|
+
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
13628
13719
|
class ESLintLinterSpecialist {
|
|
13629
|
-
static
|
|
13630
|
-
|
|
13631
|
-
|
|
13632
|
-
|
|
13633
|
-
|
|
13634
|
-
|
|
13635
|
-
|
|
13636
|
-
|
|
13637
|
-
|
|
13638
|
-
|
|
13639
|
-
|
|
13640
|
-
|
|
13641
|
-
|
|
13642
|
-
|
|
13643
|
-
|
|
13720
|
+
static SUPPORTED_CONFIGURATION_FILES_NAMES_WITH_EXTENSIONS = [
|
|
13721
|
+
"eslint.config.js",
|
|
13722
|
+
"eslint.config.mjs",
|
|
13723
|
+
"eslint.config.cjs",
|
|
13724
|
+
"eslint.config.ts",
|
|
13725
|
+
"eslint.config.mts",
|
|
13726
|
+
"eslint.config.cts"
|
|
13727
|
+
];
|
|
13728
|
+
static generateExcludingGlobSelectorsOfIgnoredFiles(consumingProjectRootDirectoryAbsolutePath) {
|
|
13729
|
+
let configurationFileContent;
|
|
13730
|
+
for (const potentialConfigurationFileNameWithExtension of ESLintLinterSpecialist.SUPPORTED_CONFIGURATION_FILES_NAMES_WITH_EXTENSIONS) {
|
|
13731
|
+
try {
|
|
13732
|
+
configurationFileContent = fs_1.default.readFileSync(es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
13733
|
+
consumingProjectRootDirectoryAbsolutePath,
|
|
13734
|
+
potentialConfigurationFileNameWithExtension
|
|
13735
|
+
], { alwaysForwardSlashSeparators: true }), "utf-8");
|
|
13736
|
+
break;
|
|
13737
|
+
}
|
|
13738
|
+
catch (error) {
|
|
13739
|
+
if ((0, es_extensions_nodejs_1.isErrnoException)(error) && error.code === "ENOENT") {
|
|
13740
|
+
continue;
|
|
13741
|
+
}
|
|
13742
|
+
es_extensions_1.Logger.logError({
|
|
13743
|
+
mustOutputIf: true,
|
|
13744
|
+
errorType: "FileReadingFailedError",
|
|
13745
|
+
title: "File Reading Failed",
|
|
13746
|
+
description: `Unable to read the file ${potentialConfigurationFileNameWithExtension} while this file seems to be exist`,
|
|
13747
|
+
occurrenceLocation: "ESLintLinterSpecialist.getGlobSelectorsOfExcludedFiles(compoundParameter)",
|
|
13748
|
+
caughtError: error
|
|
13749
|
+
});
|
|
13750
|
+
}
|
|
13751
|
+
}
|
|
13752
|
+
if ((0, es_extensions_1.isUndefined)(configurationFileContent)) {
|
|
13753
|
+
es_extensions_1.Logger.logWarning({
|
|
13754
|
+
title: "No Files Will be Ignored by ESLint",
|
|
13755
|
+
description: "ESLint configuration file not found thus unable to decide which files must be ignored.",
|
|
13756
|
+
occurrenceLocation: "className.methodName(compoundParameter)"
|
|
13757
|
+
});
|
|
13758
|
+
return [];
|
|
13759
|
+
}
|
|
13760
|
+
const filesIgnoringPatternsRawExpression = (0, es_extensions_1.getMatchingWithFirstRegularExpressionCapturingGroup)({
|
|
13761
|
+
targetString: configurationFileContent,
|
|
13762
|
+
regularExpression: /ignores:\s*(?<array>\[(?:.|\s)+?\])/gu
|
|
13763
|
+
});
|
|
13764
|
+
if ((0, es_extensions_1.isNull)(filesIgnoringPatternsRawExpression)) {
|
|
13765
|
+
return [];
|
|
13766
|
+
}
|
|
13767
|
+
let filesIgnoringPatterns;
|
|
13768
|
+
try {
|
|
13769
|
+
filesIgnoringPatterns = JSON.parse(filesIgnoringPatternsRawExpression.replace("'", "\""));
|
|
13770
|
+
}
|
|
13771
|
+
catch (error) {
|
|
13772
|
+
es_extensions_1.Logger.logError({
|
|
13773
|
+
errorType: es_extensions_1.InvalidExternalDataError.NAME,
|
|
13774
|
+
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
13775
|
+
description: "Invalid ignoring patters in ESLint configuration.",
|
|
13776
|
+
occurrenceLocation: "ESLintLinterSpecialist.getGlobSelectorsOfExcludedFiles(compoundParameter)",
|
|
13777
|
+
caughtError: error
|
|
13778
|
+
});
|
|
13779
|
+
return [];
|
|
13780
|
+
}
|
|
13781
|
+
const processingResult = es_extensions_1.RawObjectDataProcessor.process(filesIgnoringPatterns, {
|
|
13782
|
+
subtype: es_extensions_1.RawObjectDataProcessor.ObjectSubtypes.indexedArray,
|
|
13783
|
+
nameForLogging: "ESLint ignoring patterns",
|
|
13784
|
+
element: {
|
|
13785
|
+
type: String
|
|
13786
|
+
}
|
|
13787
|
+
});
|
|
13788
|
+
if (processingResult.rawDataIsInvalid) {
|
|
13789
|
+
es_extensions_1.Logger.logError({
|
|
13790
|
+
errorType: es_extensions_1.InvalidExternalDataError.NAME,
|
|
13791
|
+
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
13792
|
+
description: "Invalid ignoring patters in ESLint configuration.\n" +
|
|
13793
|
+
es_extensions_1.RawObjectDataProcessor.formatValidationErrorsList(processingResult.validationErrorsMessages),
|
|
13794
|
+
occurrenceLocation: "ESLintLinterSpecialist.getGlobSelectorsOfExcludedFiles(compoundParameter)"
|
|
13795
|
+
});
|
|
13796
|
+
return [];
|
|
13797
|
+
}
|
|
13798
|
+
/* [ Theory ] Known Patterns from ESLint Documentation & Experiments
|
|
13799
|
+
* 1. ".config/*": ignore subdirectory ".config" in directory below root, but not ".config" recursively
|
|
13800
|
+
* 2. ".config/": equivalent of 1
|
|
13801
|
+
* 2. ".config": equivalent of 1
|
|
13802
|
+
* 3. "**/.config/": recursive ignoring of ".config"
|
|
13803
|
+
* 4. config.js - ignoring of specific file
|
|
13804
|
+
* See https://eslint.org/docs/latest/use/configure/ignore#ignoring-files
|
|
13805
|
+
* */
|
|
13806
|
+
return processingResult.processedData.
|
|
13807
|
+
/* [ Theory ]
|
|
13808
|
+
* ESLint ignores "node_modules" as default, so it must be ignored whatever it has been specified in ESLint
|
|
13809
|
+
* configuration file or no. */
|
|
13810
|
+
filter((ignoredFilesPattern) => !ignoredFilesPattern.includes("node_module")).
|
|
13811
|
+
map((ignoredFilesPattern) => {
|
|
13812
|
+
if (ignoredFilesPattern.startsWith("**/")) {
|
|
13813
|
+
return es_extensions_nodejs_1.ImprovedGlob.buildExcludingOfDirectoryWithSubdirectoriesGlobSelector(path_1.default.join(consumingProjectRootDirectoryAbsolutePath, ignoredFilesPattern.replace(/^\*\*\//gu, "")));
|
|
13814
|
+
}
|
|
13815
|
+
return es_extensions_nodejs_1.ImprovedGlob.buildExcludingOfDirectoryWithSubdirectoriesGlobSelector(path_1.default.join(consumingProjectRootDirectoryAbsolutePath, ignoredFilesPattern.replace(/\*/gu, "")));
|
|
13816
|
+
});
|
|
13644
13817
|
}
|
|
13645
13818
|
}
|
|
13646
13819
|
exports["default"] = ESLintLinterSpecialist;
|
|
@@ -13940,6 +14113,7 @@ exports["default"] = WebpackSpecialist;
|
|
|
13940
14113
|
|
|
13941
14114
|
|
|
13942
14115
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
14116
|
+
exports["default"] = getExpectedToBeExistingMapValue;
|
|
13943
14117
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
13944
14118
|
function getExpectedToBeExistingMapValue(targetMap, targetKey) {
|
|
13945
14119
|
const targetValue = targetMap.get(targetKey);
|
|
@@ -13952,7 +14126,6 @@ function getExpectedToBeExistingMapValue(targetMap, targetKey) {
|
|
|
13952
14126
|
}
|
|
13953
14127
|
return targetValue;
|
|
13954
14128
|
}
|
|
13955
|
-
exports["default"] = getExpectedToBeExistingMapValue;
|
|
13956
14129
|
|
|
13957
14130
|
|
|
13958
14131
|
/***/ }),
|
|
@@ -14001,11 +14174,11 @@ exports["default"] = Stopwatch;
|
|
|
14001
14174
|
|
|
14002
14175
|
|
|
14003
14176
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
14177
|
+
exports["default"] = replaceLinesSeparators;
|
|
14004
14178
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
14005
14179
|
function replaceLinesSeparators(targetString, lineSeparators) {
|
|
14006
14180
|
return (0, es_extensions_1.explodeStringToLines)({ targetString, mustIgnoreCarriageReturn: false }).join(lineSeparators);
|
|
14007
14181
|
}
|
|
14008
|
-
exports["default"] = replaceLinesSeparators;
|
|
14009
14182
|
|
|
14010
14183
|
|
|
14011
14184
|
/***/ }),
|
|
@@ -14300,12 +14473,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
14300
14473
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
14301
14474
|
const es_extensions_nodejs_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions-nodejs */ "@yamato-daiwa/es-extensions-nodejs");
|
|
14302
14475
|
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. */
|
|
14476
|
+
const path_1 = __importDefault(__webpack_require__(/*! path */ "path"));
|
|
14309
14477
|
class SourceCodeSelectiveReprocessingHelper {
|
|
14310
14478
|
static DEBUGGING_MODE = false;
|
|
14311
14479
|
static cachedMetadataFileContentSpecification = {
|
|
@@ -14322,7 +14490,7 @@ class SourceCodeSelectiveReprocessingHelper {
|
|
|
14322
14490
|
type: String,
|
|
14323
14491
|
required: true
|
|
14324
14492
|
},
|
|
14325
|
-
|
|
14493
|
+
directChildrenFilesRelativePaths: {
|
|
14326
14494
|
type: Array,
|
|
14327
14495
|
required: true,
|
|
14328
14496
|
element: { type: String }
|
|
@@ -14330,7 +14498,7 @@ class SourceCodeSelectiveReprocessingHelper {
|
|
|
14330
14498
|
}
|
|
14331
14499
|
}
|
|
14332
14500
|
},
|
|
14333
|
-
|
|
14501
|
+
childrenFiles: {
|
|
14334
14502
|
type: es_extensions_1.RawObjectDataProcessor.ValuesTypesIDs.associativeArrayOfUniformTypeValues,
|
|
14335
14503
|
required: true,
|
|
14336
14504
|
value: {
|
|
@@ -14340,7 +14508,7 @@ class SourceCodeSelectiveReprocessingHelper {
|
|
|
14340
14508
|
type: String,
|
|
14341
14509
|
required: true
|
|
14342
14510
|
},
|
|
14343
|
-
|
|
14511
|
+
directChildrenFilesRelativePaths: {
|
|
14344
14512
|
type: Array,
|
|
14345
14513
|
required: true,
|
|
14346
14514
|
element: { type: String }
|
|
@@ -14357,183 +14525,208 @@ class SourceCodeSelectiveReprocessingHelper {
|
|
|
14357
14525
|
};
|
|
14358
14526
|
entryPointsMetadata = new Map();
|
|
14359
14527
|
isEntryPoint;
|
|
14360
|
-
|
|
14361
|
-
|
|
14362
|
-
|
|
14528
|
+
childrenFilesMetadata = new Map();
|
|
14529
|
+
resolvedAliasedPaths = new Map();
|
|
14530
|
+
childrenFilesResolutionRules;
|
|
14531
|
+
absolutePathsOfChildrenFilesWhichHasBeenScannedDuringCurrentPass = new Set();
|
|
14532
|
+
directoriesAliasesAndTheirAbsolutePatsMap;
|
|
14363
14533
|
CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH;
|
|
14364
14534
|
CACHED_METADATA_FILE_ABSOLUTE_PATH;
|
|
14365
14535
|
TARGET_FILES_TYPE_IN_SINGULAR_FORM;
|
|
14536
|
+
/* ━━━ Constructor ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
14366
14537
|
constructor(initializationProperties) {
|
|
14367
14538
|
this.isEntryPoint = initializationProperties.isEntryPoint;
|
|
14368
|
-
this.
|
|
14539
|
+
this.childrenFilesResolutionRules = initializationProperties.childrenFilesResolutionRules;
|
|
14540
|
+
this.directoriesAliasesAndTheirAbsolutePatsMap =
|
|
14541
|
+
initializationProperties.directoriesAliasesAndTheirAbsolutePatsMap ?? new Map();
|
|
14369
14542
|
this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH = initializationProperties.consumingProjectRootDirectoryAbsolutePath;
|
|
14370
14543
|
this.CACHED_METADATA_FILE_ABSOLUTE_PATH = initializationProperties.cacheFileAbsolutePath;
|
|
14371
14544
|
this.TARGET_FILES_TYPE_IN_SINGULAR_FORM = initializationProperties.logging.targetFilesTypeInSingularForm;
|
|
14372
|
-
|
|
14545
|
+
/* [ Theory ] The cached metadata from previous YDA launches could be. */
|
|
14546
|
+
this.retrieveCacheFromFileAndApplyIfItExists();
|
|
14547
|
+
this.scanFilesHierarchyTreeForEntryPoints(new Set(initializationProperties.initialEntryPointsSourceFilesAbsolutePaths.map((entryPointFileAbsolutePath__potentiallyWithOperationingSystemDependentPathSeparators) => es_extensions_nodejs_1.ImprovedPath.replacePathSeparatorsToForwardSlashes(entryPointFileAbsolutePath__potentiallyWithOperationingSystemDependentPathSeparators))));
|
|
14373
14548
|
if (initializationProperties.logging.mustEnable) {
|
|
14374
|
-
this.
|
|
14549
|
+
this.logChildrenFilesAndEntryPointsRelationships();
|
|
14375
14550
|
}
|
|
14376
|
-
this.
|
|
14551
|
+
this.saveCachedFilesMetadataMapsToFile();
|
|
14377
14552
|
}
|
|
14378
|
-
|
|
14379
|
-
|
|
14380
|
-
|
|
14381
|
-
|
|
14382
|
-
|
|
14383
|
-
|
|
14553
|
+
/* ━━━ Public Methods ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
14554
|
+
getAbsolutePathsOfEntryPointsWhichMustBeProcessed(absolutePathsOfFilesWithChangedStatus__forwardSlashSeparators) {
|
|
14555
|
+
const absolutePathsOfEntryPointsWhichMustBeProcessed__forwardSlashSeparators = new Set();
|
|
14556
|
+
const absolutePathsOfChildrenFilesWhichParentEntryPointsMustBeProcessed__forwardSlashSeparators = new Set();
|
|
14557
|
+
for (const absolutePathOfFileWithChangedStatus__forwardSlashSeparators of absolutePathsOfFilesWithChangedStatus__forwardSlashSeparators) {
|
|
14558
|
+
const pathRelativeRelativeToConsumingProjectRootDirectoryOfFileWithChangedStatus__forwardSlashSeparators = es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
|
|
14559
|
+
basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
|
|
14560
|
+
comparedPath: absolutePathOfFileWithChangedStatus__forwardSlashSeparators,
|
|
14561
|
+
alwaysForwardSlashSeparators: true
|
|
14562
|
+
});
|
|
14563
|
+
if (fs_1.default.existsSync(absolutePathOfFileWithChangedStatus__forwardSlashSeparators)) {
|
|
14564
|
+
if (this.isEntryPoint(absolutePathOfFileWithChangedStatus__forwardSlashSeparators)) {
|
|
14565
|
+
absolutePathsOfEntryPointsWhichMustBeProcessed__forwardSlashSeparators.
|
|
14566
|
+
add(absolutePathOfFileWithChangedStatus__forwardSlashSeparators);
|
|
14384
14567
|
}
|
|
14385
14568
|
else {
|
|
14386
|
-
|
|
14387
|
-
|
|
14388
|
-
comparedPath: absolutePathOfFileWithChangesStatus,
|
|
14389
|
-
alwaysForwardSlashSeparators: true
|
|
14390
|
-
}));
|
|
14569
|
+
absolutePathsOfChildrenFilesWhichParentEntryPointsMustBeProcessed__forwardSlashSeparators.
|
|
14570
|
+
add(absolutePathOfFileWithChangedStatus__forwardSlashSeparators);
|
|
14391
14571
|
}
|
|
14392
14572
|
}
|
|
14393
14573
|
else {
|
|
14394
|
-
|
|
14395
|
-
|
|
14396
|
-
|
|
14397
|
-
|
|
14574
|
+
this.clearFileMetadataPathFromCache(pathRelativeRelativeToConsumingProjectRootDirectoryOfFileWithChangedStatus__forwardSlashSeparators);
|
|
14575
|
+
}
|
|
14576
|
+
}
|
|
14577
|
+
this.scanFilesHierarchyTreeForEntryPoints(absolutePathsOfEntryPointsWhichMustBeProcessed__forwardSlashSeparators);
|
|
14578
|
+
this.saveCachedFilesMetadataMapsToFile();
|
|
14579
|
+
for (const absolutePathOfChildFile__forwardSlashSeparators of absolutePathsOfChildrenFilesWhichParentEntryPointsMustBeProcessed__forwardSlashSeparators) {
|
|
14580
|
+
const pathOfChildFileRelativeToConsumingProjectRootDirectory__forwardSlashSeparators = es_extensions_nodejs_1.ImprovedPath.
|
|
14581
|
+
computeRelativePath({
|
|
14582
|
+
basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
|
|
14583
|
+
comparedPath: absolutePathOfChildFile__forwardSlashSeparators,
|
|
14584
|
+
alwaysForwardSlashSeparators: true
|
|
14585
|
+
});
|
|
14586
|
+
(0, es_extensions_1.addMultipleElementsToSet)(absolutePathsOfEntryPointsWhichMustBeProcessed__forwardSlashSeparators, Array.from(this.childrenFilesMetadata.get(pathOfChildFileRelativeToConsumingProjectRootDirectory__forwardSlashSeparators)?.parentEntryPointsAbsolutePaths ??
|
|
14587
|
+
new Set()));
|
|
14588
|
+
}
|
|
14589
|
+
return Array.from(absolutePathsOfEntryPointsWhichMustBeProcessed__forwardSlashSeparators);
|
|
14590
|
+
}
|
|
14591
|
+
/* ━━━ Private Methods ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
14592
|
+
/* ─── Initial Pass ─────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
14593
|
+
retrieveCacheFromFileAndApplyIfItExists() {
|
|
14594
|
+
let cachedRawMetadata;
|
|
14595
|
+
try {
|
|
14596
|
+
cachedRawMetadata = es_extensions_nodejs_1.ObjectDataFilesProcessor.processFile({
|
|
14597
|
+
filePath: this.CACHED_METADATA_FILE_ABSOLUTE_PATH,
|
|
14598
|
+
validDataSpecification: SourceCodeSelectiveReprocessingHelper.cachedMetadataFileContentSpecification,
|
|
14599
|
+
synchronously: true
|
|
14600
|
+
});
|
|
14601
|
+
}
|
|
14602
|
+
catch (error) {
|
|
14603
|
+
if (!(error instanceof es_extensions_nodejs_1.FileNotFoundError)) {
|
|
14604
|
+
es_extensions_1.Logger.logError({
|
|
14605
|
+
mustOutputIf: true || 0,
|
|
14606
|
+
errorType: "CachedDataRetrievingFailedError",
|
|
14607
|
+
title: "Cached Data Retrieving Failed",
|
|
14608
|
+
description: `Unable to read the existing cache file at "${this.CACHED_METADATA_FILE_ABSOLUTE_PATH}".`,
|
|
14609
|
+
occurrenceLocation: "sourceCodeSelectiveReprocessingHelper.retrieveCacheFromFileAndApplyIfItExists()",
|
|
14610
|
+
caughtError: error
|
|
14398
14611
|
});
|
|
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
14612
|
}
|
|
14613
|
+
return;
|
|
14614
|
+
}
|
|
14615
|
+
for (const [entryPointPathRelativeToConsumingProjectRootDirectory, entryPointRawMetadata] of Object.entries(cachedRawMetadata.entryPoints)) {
|
|
14616
|
+
this.entryPointsMetadata.set(entryPointPathRelativeToConsumingProjectRootDirectory, {
|
|
14617
|
+
modificationDate__ISO8601: entryPointRawMetadata.modificationDate__ISO8601,
|
|
14618
|
+
directChildrenFilesRelativePaths: new Set(entryPointRawMetadata.directChildrenFilesRelativePaths)
|
|
14619
|
+
});
|
|
14620
|
+
}
|
|
14621
|
+
for (const [childFilePathRelativeToConsumingProjectRootDirectory, childFileMetadata] of Object.entries(cachedRawMetadata.childrenFiles)) {
|
|
14622
|
+
this.childrenFilesMetadata.set(childFilePathRelativeToConsumingProjectRootDirectory, {
|
|
14623
|
+
modificationDateTime__ISO8601: childFileMetadata.modificationDate__ISO8601,
|
|
14624
|
+
directChildrenFilesRelativePaths: new Set(childFileMetadata.directChildrenFilesRelativePaths),
|
|
14625
|
+
parentEntryPointsAbsolutePaths: new Set(childFileMetadata.parentEntryPointsRelativePaths.map((parentEntryPointsRelativePath) => es_extensions_nodejs_1.ImprovedPath.joinPathSegments([this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH, parentEntryPointsRelativePath], { alwaysForwardSlashSeparators: true })))
|
|
14626
|
+
});
|
|
14406
14627
|
}
|
|
14407
|
-
return Array.from(absolutePathsOfEntryPointsWhichMustBeProcessed);
|
|
14408
14628
|
}
|
|
14409
|
-
/*
|
|
14410
|
-
|
|
14411
|
-
|
|
14412
|
-
|
|
14413
|
-
|
|
14414
|
-
const entryPointDirectoryAbsolutePath = es_extensions_nodejs_1.ImprovedPath.extractDirectoryFromFilePath({
|
|
14415
|
-
targetPath: entryPointFileAbsolutePath,
|
|
14416
|
-
alwaysForwardSlashSeparators: true,
|
|
14629
|
+
/* ─── All Passes ───────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
14630
|
+
scanFilesHierarchyTreeForEntryPoints(targetEntryPointsAbsolutePaths__forwardSlashSeparators) {
|
|
14631
|
+
for (const entryPointAbsolutePath__forwardSlashSeparators of targetEntryPointsAbsolutePaths__forwardSlashSeparators) {
|
|
14632
|
+
const entryPointDirectoryAbsolutePath__forwardSlashSeparators = es_extensions_nodejs_1.ImprovedPath.extractDirectoryFromFilePath({
|
|
14633
|
+
targetPath: entryPointAbsolutePath__forwardSlashSeparators,
|
|
14417
14634
|
ambiguitiesResolution: {
|
|
14418
14635
|
mustConsiderLastSegmentStartingWithDotAsDirectory: false,
|
|
14419
14636
|
mustConsiderLastSegmentWithNonLeadingDotAsDirectory: false,
|
|
14420
14637
|
mustConsiderLastSegmentWihtoutDotsAsFileNameWithoutExtension: true
|
|
14421
|
-
}
|
|
14638
|
+
},
|
|
14639
|
+
alwaysForwardSlashSeparators: true
|
|
14422
14640
|
});
|
|
14423
|
-
const
|
|
14641
|
+
const entryPointPathRelativeToConsumingProjectRootDirectory__forwardSlashSeparators = es_extensions_nodejs_1.ImprovedPath.
|
|
14642
|
+
computeRelativePath({
|
|
14424
14643
|
basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
|
|
14425
|
-
comparedPath:
|
|
14644
|
+
comparedPath: entryPointAbsolutePath__forwardSlashSeparators,
|
|
14426
14645
|
alwaysForwardSlashSeparators: true
|
|
14427
14646
|
});
|
|
14428
|
-
let
|
|
14647
|
+
let entryPointLastModificationDateTime__ISO8601;
|
|
14429
14648
|
try {
|
|
14430
|
-
|
|
14649
|
+
entryPointLastModificationDateTime__ISO8601 = fs_1.default.statSync(entryPointAbsolutePath__forwardSlashSeparators).
|
|
14650
|
+
mtime.
|
|
14651
|
+
toISOString();
|
|
14431
14652
|
}
|
|
14432
14653
|
catch (error) {
|
|
14433
14654
|
if ((0, es_extensions_nodejs_1.isErrnoException)(error) && error.code === "ENOENT") {
|
|
14434
|
-
this.entryPointsMetadata.delete(
|
|
14655
|
+
this.entryPointsMetadata.delete(entryPointPathRelativeToConsumingProjectRootDirectory__forwardSlashSeparators);
|
|
14435
14656
|
continue;
|
|
14436
14657
|
}
|
|
14437
14658
|
es_extensions_1.Logger.logError({
|
|
14438
14659
|
mustOutputIf: true || 0,
|
|
14439
14660
|
errorType: "FileStatisticsRetrievingFailedError",
|
|
14440
14661
|
title: "File Statistics Retrieving Failed Error",
|
|
14441
|
-
description:
|
|
14662
|
+
description: "Unable to retrieve the statistics of file " +
|
|
14663
|
+
`"${entryPointPathRelativeToConsumingProjectRootDirectory__forwardSlashSeparators}". ` +
|
|
14442
14664
|
"This file will not be mapped.",
|
|
14443
|
-
occurrenceLocation: "sourceCodeSelectiveReprocessingHelper.
|
|
14665
|
+
occurrenceLocation: "sourceCodeSelectiveReprocessingHelper." +
|
|
14666
|
+
"scanFilesHierarchyTreeForEntryPoints(targetEntryPointsAbsolutePaths__forwardSlashSeparators)",
|
|
14444
14667
|
caughtError: error
|
|
14445
14668
|
});
|
|
14446
14669
|
continue;
|
|
14447
14670
|
}
|
|
14448
|
-
|
|
14449
|
-
let
|
|
14450
|
-
|
|
14451
|
-
|
|
14452
|
-
|
|
14453
|
-
|
|
14454
|
-
|
|
14455
|
-
|
|
14456
|
-
|
|
14457
|
-
|
|
14458
|
-
|
|
14671
|
+
let cachedMetadataOfCurrentEntryPoint = this.entryPointsMetadata.get(entryPointPathRelativeToConsumingProjectRootDirectory__forwardSlashSeparators);
|
|
14672
|
+
let absolutePathsOfExistingDirectChildrenFilesOfCurrentEntryPoint__forwardSlashSeparators = new Set();
|
|
14673
|
+
/* [ Theory ] This condition will could be truthy (but not always) only on initial pass. */
|
|
14674
|
+
if (cachedMetadataOfCurrentEntryPoint?.modificationDate__ISO8601 === entryPointLastModificationDateTime__ISO8601) {
|
|
14675
|
+
/* [ Theory ]
|
|
14676
|
+
* Although the entry point file is existing and has not changed since last scan, its children files could
|
|
14677
|
+
* be added or deleted. */
|
|
14678
|
+
for (const pathRelativeToConsumingProjectRootDirectoryOfChildFileOfCurrentEntryPoint__forwardSlashSeparators of cachedMetadataOfCurrentEntryPoint.directChildrenFilesRelativePaths) {
|
|
14679
|
+
const absolutePathOfChildFileOfCurrentEntryPoint__forwardSlashSeparators = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
14680
|
+
this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
|
|
14681
|
+
pathRelativeToConsumingProjectRootDirectoryOfChildFileOfCurrentEntryPoint__forwardSlashSeparators
|
|
14682
|
+
], { alwaysForwardSlashSeparators: true });
|
|
14683
|
+
if (!fs_1.default.existsSync(absolutePathOfChildFileOfCurrentEntryPoint__forwardSlashSeparators)) {
|
|
14684
|
+
this.clearFileMetadataPathFromCache(pathRelativeToConsumingProjectRootDirectoryOfChildFileOfCurrentEntryPoint__forwardSlashSeparators);
|
|
14459
14685
|
}
|
|
14460
|
-
|
|
14686
|
+
absolutePathsOfExistingDirectChildrenFilesOfCurrentEntryPoint__forwardSlashSeparators = new Set(Array.from(cachedMetadataOfCurrentEntryPoint.directChildrenFilesRelativePaths));
|
|
14461
14687
|
}
|
|
14462
14688
|
}
|
|
14463
14689
|
else {
|
|
14464
|
-
|
|
14465
|
-
|
|
14466
|
-
|
|
14467
|
-
|
|
14690
|
+
/* [ Maintainability ] Keep this variable for debugging. */
|
|
14691
|
+
absolutePathsOfExistingDirectChildrenFilesOfCurrentEntryPoint__forwardSlashSeparators = this.
|
|
14692
|
+
getAbsolutePathsOfExistingChildrenFilesOfExistingTargetFile__forwardSlashSeparators({
|
|
14693
|
+
targetFileAbsolutePath__forwardSlashSeparators: entryPointAbsolutePath__forwardSlashSeparators,
|
|
14694
|
+
preComputedTargetFileDirectoryAbsolutePath__forwardSlashSeparators: entryPointDirectoryAbsolutePath__forwardSlashSeparators
|
|
14468
14695
|
});
|
|
14469
|
-
|
|
14470
|
-
modificationDate__ISO8601:
|
|
14471
|
-
|
|
14696
|
+
cachedMetadataOfCurrentEntryPoint = {
|
|
14697
|
+
modificationDate__ISO8601: entryPointLastModificationDateTime__ISO8601,
|
|
14698
|
+
directChildrenFilesRelativePaths: (0, es_extensions_1.createSetBasedOnOtherSet)(absolutePathsOfExistingDirectChildrenFilesOfCurrentEntryPoint__forwardSlashSeparators, (absolutePathOfExistingDirectChildFileOfCurrentEntryPoint__forwardSlashSeparators) => es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
|
|
14472
14699
|
basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
|
|
14473
|
-
comparedPath:
|
|
14700
|
+
comparedPath: absolutePathOfExistingDirectChildFileOfCurrentEntryPoint__forwardSlashSeparators,
|
|
14474
14701
|
alwaysForwardSlashSeparators: true
|
|
14475
14702
|
}))
|
|
14476
|
-
}
|
|
14703
|
+
};
|
|
14704
|
+
this.entryPointsMetadata.set(entryPointPathRelativeToConsumingProjectRootDirectory__forwardSlashSeparators, cachedMetadataOfCurrentEntryPoint);
|
|
14477
14705
|
}
|
|
14478
14706
|
es_extensions_1.Logger.logGeneric({
|
|
14479
14707
|
mustOutputIf: SourceCodeSelectiveReprocessingHelper.DEBUGGING_MODE,
|
|
14480
14708
|
badge: { customText: "Debug" },
|
|
14481
|
-
title: "SourceCodeSelectiveReprocessingHelper,
|
|
14482
|
-
description:
|
|
14483
|
-
|
|
14484
|
-
});
|
|
14485
|
-
for (const
|
|
14486
|
-
this.
|
|
14487
|
-
|
|
14488
|
-
|
|
14709
|
+
title: "SourceCodeSelectiveReprocessingHelper, Entry Point Analysis Complete.",
|
|
14710
|
+
description: entryPointPathRelativeToConsumingProjectRootDirectory__forwardSlashSeparators,
|
|
14711
|
+
additionalData: cachedMetadataOfCurrentEntryPoint
|
|
14712
|
+
});
|
|
14713
|
+
for (const absolutePathOfDirectExistingChildFileOfCurrentEntryPoint__forwardSlashSeparators of absolutePathsOfExistingDirectChildrenFilesOfCurrentEntryPoint__forwardSlashSeparators) {
|
|
14714
|
+
this.updateMetadataForExistingChildFile({
|
|
14715
|
+
targetChildFileAbsolutePath__forwardSlashSeparators: absolutePathOfDirectExistingChildFileOfCurrentEntryPoint__forwardSlashSeparators,
|
|
14716
|
+
parentEntryPointAbsolutePath__forwardSlashSeparators: entryPointAbsolutePath__forwardSlashSeparators
|
|
14489
14717
|
});
|
|
14490
|
-
this.
|
|
14491
|
-
add(
|
|
14718
|
+
this.absolutePathsOfChildrenFilesWhichHasBeenScannedDuringCurrentPass.
|
|
14719
|
+
add(absolutePathOfDirectExistingChildFileOfCurrentEntryPoint__forwardSlashSeparators);
|
|
14492
14720
|
}
|
|
14493
14721
|
}
|
|
14494
|
-
this.
|
|
14722
|
+
this.absolutePathsOfChildrenFilesWhichHasBeenScannedDuringCurrentPass.clear();
|
|
14495
14723
|
}
|
|
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();
|
|
14724
|
+
/* [ Approach ] The target file could be either entry point or not. */
|
|
14725
|
+
getAbsolutePathsOfExistingChildrenFilesOfExistingTargetFile__forwardSlashSeparators({ targetFileAbsolutePath__forwardSlashSeparators, preComputedTargetFileDirectoryAbsolutePath__forwardSlashSeparators }) {
|
|
14726
|
+
const absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators = new Set();
|
|
14534
14727
|
let fileContent;
|
|
14535
14728
|
try {
|
|
14536
|
-
fileContent = fs_1.default.readFileSync(
|
|
14729
|
+
fileContent = fs_1.default.readFileSync(targetFileAbsolutePath__forwardSlashSeparators, "utf-8");
|
|
14537
14730
|
}
|
|
14538
14731
|
catch (error) {
|
|
14539
14732
|
if ((0, es_extensions_nodejs_1.isErrnoException)(error) && error.code === "ENOENT") {
|
|
@@ -14541,231 +14734,291 @@ class SourceCodeSelectiveReprocessingHelper {
|
|
|
14541
14734
|
mustOutputIf: true || 0,
|
|
14542
14735
|
errorType: es_extensions_1.UnexpectedEventError.NAME,
|
|
14543
14736
|
title: es_extensions_1.UnexpectedEventError.localization.defaultTitle,
|
|
14544
|
-
description: `
|
|
14545
|
-
"
|
|
14737
|
+
description: `Contrary to expectations, "${targetFileAbsolutePath__forwardSlashSeparators}" file does not exist. ` +
|
|
14738
|
+
"Skipping this file.",
|
|
14546
14739
|
occurrenceLocation: "sourceCodeSelectiveReprocessingHelper." +
|
|
14547
|
-
"
|
|
14740
|
+
"getAbsolutePathsOfExistingChildrenFilesOfExistingTargetFile__forwardSlashSeparators(compoundParameter)",
|
|
14548
14741
|
caughtError: error
|
|
14549
14742
|
});
|
|
14550
|
-
return
|
|
14743
|
+
return absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators;
|
|
14551
14744
|
}
|
|
14552
14745
|
es_extensions_1.Logger.logError({
|
|
14553
14746
|
mustOutputIf: true || 0,
|
|
14554
14747
|
errorType: es_extensions_1.FileReadingFailedError.NAME,
|
|
14555
14748
|
title: es_extensions_1.FileReadingFailedError.localization.defaultTitle,
|
|
14556
|
-
description: es_extensions_1.FileReadingFailedError.localization.
|
|
14749
|
+
description: es_extensions_1.FileReadingFailedError.localization.
|
|
14750
|
+
generateDescription({ filePath: targetFileAbsolutePath__forwardSlashSeparators }),
|
|
14557
14751
|
occurrenceLocation: "sourceCodeSelectiveReprocessingHelper." +
|
|
14558
|
-
"
|
|
14752
|
+
"getAbsolutePathsOfExistingChildrenFilesOfExistingTargetFile__forwardSlashSeparators(compoundParameter)",
|
|
14559
14753
|
caughtError: error
|
|
14560
14754
|
});
|
|
14561
|
-
return
|
|
14755
|
+
return absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators;
|
|
14562
14756
|
}
|
|
14563
|
-
for (const fileIncludingDeclarationPattern of this.
|
|
14757
|
+
for (const fileIncludingDeclarationPattern of this.childrenFilesResolutionRules.childrenFilesIncludingDeclarationsPatterns) {
|
|
14564
14758
|
/* [ Theory ] Same file could be included for the multiple times.
|
|
14565
14759
|
* Occasionally it is even meaningful, but we are not need the duplicated here. */
|
|
14566
|
-
const
|
|
14760
|
+
const childrenFilesRawPaths = new Set(Array.from(fileContent.matchAll(fileIncludingDeclarationPattern)).
|
|
14567
14761
|
map((regularExpressionMatchingData) => regularExpressionMatchingData[1]).
|
|
14568
|
-
filter((
|
|
14569
|
-
|
|
14570
|
-
|
|
14571
|
-
|
|
14572
|
-
|
|
14762
|
+
filter((childFileRawPath) => (0, es_extensions_1.isNonEmptyString)(childFileRawPath)));
|
|
14763
|
+
const targetChildFileDirectoryAbsolutePath__forwardSlashSeparators = preComputedTargetFileDirectoryAbsolutePath__forwardSlashSeparators ??
|
|
14764
|
+
es_extensions_nodejs_1.ImprovedPath.extractDirectoryFromFilePath({
|
|
14765
|
+
targetPath: targetFileAbsolutePath__forwardSlashSeparators,
|
|
14766
|
+
ambiguitiesResolution: {
|
|
14767
|
+
mustConsiderLastSegmentStartingWithDotAsDirectory: false,
|
|
14768
|
+
mustConsiderLastSegmentWithNonLeadingDotAsDirectory: false,
|
|
14769
|
+
mustConsiderLastSegmentWihtoutDotsAsFileNameWithoutExtension: true
|
|
14770
|
+
},
|
|
14771
|
+
alwaysForwardSlashSeparators: true
|
|
14772
|
+
});
|
|
14773
|
+
for (const childFileRawPath of childrenFilesRawPaths) {
|
|
14774
|
+
const childFileNormalizedPath = this.computeAbsolutePathOfChildFileIfItExists({
|
|
14775
|
+
childFileRawPath,
|
|
14776
|
+
parentFileDirectoryAbsolutePath__forwardSlashSeparators: targetChildFileDirectoryAbsolutePath__forwardSlashSeparators
|
|
14573
14777
|
});
|
|
14574
|
-
if ((0, es_extensions_1.isNotNull)(
|
|
14575
|
-
|
|
14778
|
+
if ((0, es_extensions_1.isNotNull)(childFileNormalizedPath)) {
|
|
14779
|
+
absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators.add(childFileNormalizedPath);
|
|
14576
14780
|
}
|
|
14577
14781
|
}
|
|
14578
14782
|
}
|
|
14579
|
-
return
|
|
14783
|
+
return absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators;
|
|
14580
14784
|
}
|
|
14581
|
-
|
|
14582
|
-
|
|
14785
|
+
computeAbsolutePathOfChildFileIfItExists({ childFileRawPath, parentFileDirectoryAbsolutePath__forwardSlashSeparators }) {
|
|
14786
|
+
let possibleIntermediatePathsOfChildFileWithResolvedAlias = new Set();
|
|
14787
|
+
const segmentsOfChildFileRawPath = es_extensions_nodejs_1.ImprovedPath.explodePathToSegments(childFileRawPath);
|
|
14788
|
+
const firstSegmentOfChildFileRawPath = segmentsOfChildFileRawPath[0];
|
|
14789
|
+
if ((0, es_extensions_1.isNonEmptyString)(firstSegmentOfChildFileRawPath)) {
|
|
14790
|
+
possibleIntermediatePathsOfChildFileWithResolvedAlias = (0, es_extensions_1.createSetBasedOnOtherSet)(this.directoriesAliasesAndTheirAbsolutePatsMap.get(firstSegmentOfChildFileRawPath) ?? new Set(), (absolutePathOfDirectoryOnWhichAliasedFirstPathSegmentCouldRefer) => es_extensions_nodejs_1.ImprovedPath.joinPathSegments((0, es_extensions_1.replaceArrayElementsByIndexesImmutably)({
|
|
14791
|
+
targetArray: segmentsOfChildFileRawPath,
|
|
14792
|
+
index: 0,
|
|
14793
|
+
newElement: absolutePathOfDirectoryOnWhichAliasedFirstPathSegmentCouldRefer
|
|
14794
|
+
}), { alwaysForwardSlashSeparators: true }));
|
|
14795
|
+
}
|
|
14796
|
+
let isChildFileRawPathAliased;
|
|
14797
|
+
if (possibleIntermediatePathsOfChildFileWithResolvedAlias.size > 0) {
|
|
14798
|
+
const previouslyResolvedPathFromAliasedOne = this.resolvedAliasedPaths.get(childFileRawPath);
|
|
14799
|
+
if ((0, es_extensions_1.isString)(previouslyResolvedPathFromAliasedOne)) {
|
|
14800
|
+
try {
|
|
14801
|
+
if (fs_1.default.existsSync(previouslyResolvedPathFromAliasedOne)) {
|
|
14802
|
+
return previouslyResolvedPathFromAliasedOne;
|
|
14803
|
+
}
|
|
14804
|
+
}
|
|
14805
|
+
catch (error) {
|
|
14806
|
+
if (true) {
|
|
14807
|
+
es_extensions_1.Logger.logError({
|
|
14808
|
+
errorType: "FileCheckingError",
|
|
14809
|
+
title: "File Checking Error",
|
|
14810
|
+
description: `The error occurred during the checking of the file ${previouslyResolvedPathFromAliasedOne}` +
|
|
14811
|
+
"for existence.",
|
|
14812
|
+
occurrenceLocation: "sourceCodeSelectiveReprocessingHelper." +
|
|
14813
|
+
"computeAbsolutePathOfChildFileIfItExists(compoundParameter)",
|
|
14814
|
+
caughtError: error
|
|
14815
|
+
});
|
|
14816
|
+
}
|
|
14817
|
+
}
|
|
14818
|
+
this.resolvedAliasedPaths.delete(childFileRawPath);
|
|
14819
|
+
}
|
|
14820
|
+
isChildFileRawPathAliased = true;
|
|
14821
|
+
}
|
|
14822
|
+
else {
|
|
14823
|
+
isChildFileRawPathAliased = false;
|
|
14824
|
+
possibleIntermediatePathsOfChildFileWithResolvedAlias = new Set([childFileRawPath]);
|
|
14825
|
+
}
|
|
14826
|
+
const possibleAbsolutePathsOfTargetChildFile__forwardSlashSeparators = new Set();
|
|
14827
|
+
const explicitlySpecifiedLastFileNameExtensionInChildrenFileRawPath = (0, es_extensions_1.extractLastExtensionOfFileName)({ targetPath: childFileRawPath, withLeadingDot: false });
|
|
14828
|
+
/* [ Approach ]
|
|
14829
|
+
* The second condition of if-branch is aimed to the processing of paths with multiple files names extensions.
|
|
14830
|
+
* For example, in the Pug preprocessor case, the file "ProductCard.static.pug" could be referred as
|
|
14831
|
+
* `include ProductCard.static`. */
|
|
14832
|
+
if ((0, es_extensions_1.isNull)(explicitlySpecifiedLastFileNameExtensionInChildrenFileRawPath) ||
|
|
14833
|
+
!this.childrenFilesResolutionRules.implicitFilesNamesExtensionsWithoutLeadingDotsOfChildrenFiles.
|
|
14834
|
+
includes(explicitlySpecifiedLastFileNameExtensionInChildrenFileRawPath)) {
|
|
14835
|
+
for (const possibleIntermediatePathOfChildFileWithResolvedAlias of possibleIntermediatePathsOfChildFileWithResolvedAlias) {
|
|
14836
|
+
(0, es_extensions_1.addMultipleElementsToSet)(possibleAbsolutePathsOfTargetChildFile__forwardSlashSeparators, this.childrenFilesResolutionRules.implicitFilesNamesExtensionsWithoutLeadingDotsOfChildrenFiles.map((childFileNameImplicitExtension) => es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
14837
|
+
...path_1.default.isAbsolute(possibleIntermediatePathOfChildFileWithResolvedAlias) ?
|
|
14838
|
+
[] : [parentFileDirectoryAbsolutePath__forwardSlashSeparators],
|
|
14839
|
+
`${possibleIntermediatePathOfChildFileWithResolvedAlias}.${childFileNameImplicitExtension}`
|
|
14840
|
+
], { alwaysForwardSlashSeparators: true })));
|
|
14841
|
+
}
|
|
14842
|
+
}
|
|
14843
|
+
else {
|
|
14844
|
+
for (const possibleIntermediatePathOfChildFileWithResolvedAlias of possibleIntermediatePathsOfChildFileWithResolvedAlias) {
|
|
14845
|
+
possibleAbsolutePathsOfTargetChildFile__forwardSlashSeparators.add(es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
14846
|
+
...path_1.default.isAbsolute(possibleIntermediatePathOfChildFileWithResolvedAlias) ?
|
|
14847
|
+
[] : [parentFileDirectoryAbsolutePath__forwardSlashSeparators],
|
|
14848
|
+
possibleIntermediatePathOfChildFileWithResolvedAlias
|
|
14849
|
+
], { alwaysForwardSlashSeparators: true }));
|
|
14850
|
+
}
|
|
14851
|
+
}
|
|
14852
|
+
for (const possibleAbsolutePathOfTargetChildFile of possibleAbsolutePathsOfTargetChildFile__forwardSlashSeparators) {
|
|
14853
|
+
try {
|
|
14854
|
+
if (fs_1.default.existsSync(possibleAbsolutePathOfTargetChildFile)) {
|
|
14855
|
+
if (isChildFileRawPathAliased) {
|
|
14856
|
+
this.resolvedAliasedPaths.set(childFileRawPath, possibleAbsolutePathOfTargetChildFile);
|
|
14857
|
+
}
|
|
14858
|
+
return possibleAbsolutePathOfTargetChildFile;
|
|
14859
|
+
}
|
|
14860
|
+
}
|
|
14861
|
+
catch (error) {
|
|
14862
|
+
if (true) {
|
|
14863
|
+
es_extensions_1.Logger.logError({
|
|
14864
|
+
errorType: "FileCheckingError",
|
|
14865
|
+
title: "File Checking Error",
|
|
14866
|
+
description: `The error occurred during the checking of the file ${possibleAbsolutePathOfTargetChildFile}` +
|
|
14867
|
+
"for existence.",
|
|
14868
|
+
occurrenceLocation: "sourceCodeSelectiveReprocessingHelper." +
|
|
14869
|
+
"computeAbsolutePathOfChildFileIfItExists(compoundParameter)",
|
|
14870
|
+
caughtError: error
|
|
14871
|
+
});
|
|
14872
|
+
}
|
|
14873
|
+
return null;
|
|
14874
|
+
}
|
|
14875
|
+
}
|
|
14876
|
+
return null;
|
|
14877
|
+
}
|
|
14878
|
+
updateMetadataForExistingChildFile({ targetChildFileAbsolutePath__forwardSlashSeparators, parentEntryPointAbsolutePath__forwardSlashSeparators }) {
|
|
14879
|
+
const targetChildFileRelativePath__forwardSlashSeparators = es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
|
|
14583
14880
|
basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
|
|
14584
|
-
comparedPath:
|
|
14881
|
+
comparedPath: targetChildFileAbsolutePath__forwardSlashSeparators,
|
|
14585
14882
|
alwaysForwardSlashSeparators: true
|
|
14586
14883
|
});
|
|
14587
|
-
const
|
|
14884
|
+
const cachedMetadataOfCurrentChildFile = this.childrenFilesMetadata.get(targetChildFileRelativePath__forwardSlashSeparators);
|
|
14588
14885
|
es_extensions_1.Logger.logGeneric({
|
|
14589
14886
|
mustOutputIf: SourceCodeSelectiveReprocessingHelper.DEBUGGING_MODE,
|
|
14590
14887
|
badge: { customText: "Debug" },
|
|
14591
|
-
title: "SourceCodeSelectiveReprocessingHelper,
|
|
14592
|
-
description:
|
|
14888
|
+
title: "SourceCodeSelectiveReprocessingHelper, Updating of Children Files Metadata",
|
|
14889
|
+
description: targetChildFileRelativePath__forwardSlashSeparators,
|
|
14593
14890
|
additionalData: {
|
|
14594
|
-
absolutePathsOfAffiliatedFilesWhichHasBeenScannedDuringCurrentPass: this.
|
|
14891
|
+
absolutePathsOfAffiliatedFilesWhichHasBeenScannedDuringCurrentPass: this.absolutePathsOfChildrenFilesWhichHasBeenScannedDuringCurrentPass
|
|
14595
14892
|
}
|
|
14596
14893
|
});
|
|
14597
|
-
/* [ Approach ] If the file has been scanned it must be in the
|
|
14598
|
-
*
|
|
14599
|
-
|
|
14600
|
-
|
|
14601
|
-
|
|
14894
|
+
/* [ Approach ] If the child file has been scanned it must be in the `childrenFilesMetadata` however for the
|
|
14895
|
+
* TypeScript type checking the non-undefined check of "cachedMetadataOfCurrentAffiliatedFile" additionally
|
|
14896
|
+
* required. */
|
|
14897
|
+
if (this.absolutePathsOfChildrenFilesWhichHasBeenScannedDuringCurrentPass.
|
|
14898
|
+
has(targetChildFileRelativePath__forwardSlashSeparators) &&
|
|
14899
|
+
(0, es_extensions_1.isNotUndefined)(cachedMetadataOfCurrentChildFile)) {
|
|
14900
|
+
cachedMetadataOfCurrentChildFile.parentEntryPointsAbsolutePaths.
|
|
14901
|
+
add(parentEntryPointAbsolutePath__forwardSlashSeparators);
|
|
14602
14902
|
this.registerEntryPointAsParentTo({
|
|
14603
|
-
|
|
14604
|
-
|
|
14903
|
+
cachedMetadataOfTargetChildFile: cachedMetadataOfCurrentChildFile,
|
|
14904
|
+
parentEntryPointAbsolutePath__forwardSlashSeparators
|
|
14605
14905
|
});
|
|
14606
14906
|
return;
|
|
14607
14907
|
}
|
|
14608
|
-
let
|
|
14908
|
+
let targetChildFileModificationDateTime__ISO8601;
|
|
14609
14909
|
try {
|
|
14610
|
-
|
|
14611
|
-
statSync(
|
|
14910
|
+
targetChildFileModificationDateTime__ISO8601 = fs_1.default.
|
|
14911
|
+
statSync(targetChildFileAbsolutePath__forwardSlashSeparators).mtime.toISOString();
|
|
14612
14912
|
}
|
|
14613
14913
|
catch (error) {
|
|
14614
14914
|
es_extensions_1.Logger.logError({
|
|
14615
14915
|
errorType: "FileStatisticsRetrievingFailedError",
|
|
14616
|
-
title: "File
|
|
14617
|
-
description: `Unable to retrieve the statistics of file "${
|
|
14916
|
+
title: "File Statistics Retrieving Failed Error",
|
|
14917
|
+
description: `Unable to retrieve the statistics of file "${targetChildFileAbsolutePath__forwardSlashSeparators}". ` +
|
|
14618
14918
|
"This file will not be mapped.",
|
|
14619
|
-
occurrenceLocation: "sourceCodeSelectiveReprocessingHelper."
|
|
14620
|
-
"updateMetadataMapForExistingAffiliatedFile(propertiesObject)",
|
|
14919
|
+
occurrenceLocation: "sourceCodeSelectiveReprocessingHelper.updateMetadataForExistingChildFile(compoundParameter)",
|
|
14621
14920
|
caughtError: error
|
|
14622
14921
|
});
|
|
14623
14922
|
return;
|
|
14624
14923
|
}
|
|
14625
|
-
let
|
|
14626
|
-
if (
|
|
14627
|
-
|
|
14628
|
-
|
|
14629
|
-
/* [ Theory ] Although the affiliated file is existing and has not changed since last mapping, its affiliated
|
|
14924
|
+
let absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators;
|
|
14925
|
+
if (cachedMetadataOfCurrentChildFile?.modificationDateTime__ISO8601 === targetChildFileModificationDateTime__ISO8601) {
|
|
14926
|
+
absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators = new Set();
|
|
14927
|
+
/* [ Theory ] Although the children file is existing and has not changed since last mapping, its children
|
|
14630
14928
|
* files could be added or deleted. */
|
|
14631
|
-
for (const
|
|
14632
|
-
const
|
|
14633
|
-
if (!fs_1.default.existsSync(
|
|
14634
|
-
|
|
14635
|
-
delete(relativePathOfAffiliatedFileOfCurrentOne);
|
|
14929
|
+
for (const relativePathOfChildFileOfCurrentOne of cachedMetadataOfCurrentChildFile.directChildrenFilesRelativePaths) {
|
|
14930
|
+
const absolutePathOfChildFileOfCurrentOne__forwardSlashSeparators = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH, relativePathOfChildFileOfCurrentOne], { alwaysForwardSlashSeparators: true });
|
|
14931
|
+
if (!fs_1.default.existsSync(absolutePathOfChildFileOfCurrentOne__forwardSlashSeparators)) {
|
|
14932
|
+
cachedMetadataOfCurrentChildFile.directChildrenFilesRelativePaths.delete(relativePathOfChildFileOfCurrentOne);
|
|
14636
14933
|
}
|
|
14637
|
-
|
|
14934
|
+
absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators = new Set(Array.from(cachedMetadataOfCurrentChildFile.directChildrenFilesRelativePaths));
|
|
14638
14935
|
}
|
|
14639
|
-
|
|
14936
|
+
cachedMetadataOfCurrentChildFile.parentEntryPointsAbsolutePaths.
|
|
14937
|
+
add(parentEntryPointAbsolutePath__forwardSlashSeparators);
|
|
14640
14938
|
}
|
|
14641
14939
|
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({
|
|
14940
|
+
absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators = this.
|
|
14941
|
+
getAbsolutePathsOfExistingChildrenFilesOfExistingTargetFile__forwardSlashSeparators({
|
|
14942
|
+
targetFileAbsolutePath__forwardSlashSeparators: targetChildFileAbsolutePath__forwardSlashSeparators
|
|
14943
|
+
});
|
|
14944
|
+
this.childrenFilesMetadata.set(targetChildFileRelativePath__forwardSlashSeparators, {
|
|
14945
|
+
parentEntryPointsAbsolutePaths: new Set([parentEntryPointAbsolutePath__forwardSlashSeparators]),
|
|
14946
|
+
modificationDateTime__ISO8601: targetChildFileModificationDateTime__ISO8601,
|
|
14947
|
+
directChildrenFilesRelativePaths: (0, es_extensions_1.createSetBasedOnOtherSet)(absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators, (absolutePathOfExistingAffiliatedFileOfCurrentOne) => es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
|
|
14659
14948
|
basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
|
|
14660
14949
|
comparedPath: absolutePathOfExistingAffiliatedFileOfCurrentOne,
|
|
14661
14950
|
alwaysForwardSlashSeparators: true
|
|
14662
14951
|
}))
|
|
14663
14952
|
});
|
|
14664
14953
|
}
|
|
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
|
|
14954
|
+
this.absolutePathsOfChildrenFilesWhichHasBeenScannedDuringCurrentPass.
|
|
14955
|
+
add(targetChildFileRelativePath__forwardSlashSeparators);
|
|
14956
|
+
for (const absolutePathOfExistingAffiliatedFileOfTargetOne__forwardSlashSeparators of absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators) {
|
|
14957
|
+
this.updateMetadataForExistingChildFile({
|
|
14958
|
+
targetChildFileAbsolutePath__forwardSlashSeparators: absolutePathOfExistingAffiliatedFileOfTargetOne__forwardSlashSeparators,
|
|
14959
|
+
parentEntryPointAbsolutePath__forwardSlashSeparators
|
|
14680
14960
|
});
|
|
14681
14961
|
}
|
|
14682
14962
|
}
|
|
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)) {
|
|
14963
|
+
registerEntryPointAsParentTo({ cachedMetadataOfTargetChildFile, parentEntryPointAbsolutePath__forwardSlashSeparators }) {
|
|
14964
|
+
for (const relativePathsOfDirectChildFileOfCurrentOne__forwardSlashSeparators of cachedMetadataOfTargetChildFile.directChildrenFilesRelativePaths) {
|
|
14965
|
+
const cachedMetadataOfChildFileOfCurrentOne = this.childrenFilesMetadata.get(relativePathsOfDirectChildFileOfCurrentOne__forwardSlashSeparators);
|
|
14966
|
+
if ((0, es_extensions_1.isUndefined)(cachedMetadataOfChildFileOfCurrentOne)) {
|
|
14725
14967
|
continue;
|
|
14726
14968
|
}
|
|
14727
|
-
|
|
14969
|
+
cachedMetadataOfChildFileOfCurrentOne.parentEntryPointsAbsolutePaths.
|
|
14970
|
+
add(parentEntryPointAbsolutePath__forwardSlashSeparators);
|
|
14728
14971
|
this.registerEntryPointAsParentTo({
|
|
14729
|
-
|
|
14730
|
-
|
|
14972
|
+
cachedMetadataOfTargetChildFile: cachedMetadataOfChildFileOfCurrentOne,
|
|
14973
|
+
parentEntryPointAbsolutePath__forwardSlashSeparators
|
|
14731
14974
|
});
|
|
14732
14975
|
}
|
|
14733
14976
|
}
|
|
14734
|
-
|
|
14735
|
-
|
|
14977
|
+
clearFileMetadataPathFromCache(targetFileRelativePath__forwardSlashesPathSeparators) {
|
|
14978
|
+
this.entryPointsMetadata.delete(targetFileRelativePath__forwardSlashesPathSeparators);
|
|
14979
|
+
for (const entryPointMetadata of this.entryPointsMetadata.values()) {
|
|
14980
|
+
entryPointMetadata.directChildrenFilesRelativePaths.delete(targetFileRelativePath__forwardSlashesPathSeparators);
|
|
14981
|
+
}
|
|
14982
|
+
this.childrenFilesMetadata.delete(targetFileRelativePath__forwardSlashesPathSeparators);
|
|
14983
|
+
for (const childFileMetadata of this.childrenFilesMetadata.values()) {
|
|
14984
|
+
childFileMetadata.directChildrenFilesRelativePaths.delete(targetFileRelativePath__forwardSlashesPathSeparators);
|
|
14985
|
+
childFileMetadata.parentEntryPointsAbsolutePaths.delete(targetFileRelativePath__forwardSlashesPathSeparators);
|
|
14986
|
+
}
|
|
14987
|
+
}
|
|
14988
|
+
/* ─── Cache File ───────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
14989
|
+
saveCachedFilesMetadataMapsToFile() {
|
|
14736
14990
|
const outputData = {
|
|
14737
14991
|
entryPoints: Array.from(this.entryPointsMetadata.entries()).
|
|
14738
14992
|
reduce((entryPointsMetadata, [entryPointPathRelativeToConsumingProjectRootDirectory, entryPointMetadata]) => {
|
|
14739
14993
|
entryPointsMetadata[entryPointPathRelativeToConsumingProjectRootDirectory] = {
|
|
14740
14994
|
modificationDate__ISO8601: entryPointMetadata.modificationDate__ISO8601,
|
|
14741
|
-
|
|
14995
|
+
directChildrenFilesRelativePaths: Array.from(entryPointMetadata.directChildrenFilesRelativePaths)
|
|
14742
14996
|
};
|
|
14743
14997
|
return entryPointsMetadata;
|
|
14744
14998
|
}, {}),
|
|
14745
|
-
|
|
14746
|
-
reduce((
|
|
14747
|
-
|
|
14748
|
-
modificationDate__ISO8601:
|
|
14749
|
-
|
|
14750
|
-
parentEntryPointsRelativePaths: Array.from(
|
|
14999
|
+
childrenFiles: Array.from(this.childrenFilesMetadata.entries()).
|
|
15000
|
+
reduce((childrenFilesMetadata, [childFilePathRelativeToConsumingProjectRootDirectory, childFileMetadata]) => {
|
|
15001
|
+
childrenFilesMetadata[childFilePathRelativeToConsumingProjectRootDirectory] = {
|
|
15002
|
+
modificationDate__ISO8601: childFileMetadata.modificationDateTime__ISO8601,
|
|
15003
|
+
directChildrenFilesRelativePaths: Array.from(childFileMetadata.directChildrenFilesRelativePaths),
|
|
15004
|
+
parentEntryPointsRelativePaths: Array.from(childFileMetadata.parentEntryPointsAbsolutePaths).
|
|
14751
15005
|
map((parentEntryPointsAbsolutePath) => es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
|
|
14752
15006
|
basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
|
|
14753
15007
|
comparedPath: parentEntryPointsAbsolutePath,
|
|
14754
15008
|
alwaysForwardSlashSeparators: true
|
|
14755
15009
|
}))
|
|
14756
15010
|
};
|
|
14757
|
-
return
|
|
15011
|
+
return childrenFilesMetadata;
|
|
14758
15012
|
}, {})
|
|
14759
15013
|
};
|
|
14760
15014
|
fs_1.default.writeFileSync(this.CACHED_METADATA_FILE_ABSOLUTE_PATH, (0, es_extensions_1.stringifyAndFormatArbitraryValue)(outputData));
|
|
14761
15015
|
}
|
|
14762
|
-
/*
|
|
14763
|
-
|
|
14764
|
-
logAffiliatedFilesAndEntryPointsRelationships() {
|
|
15016
|
+
/* ─── Logging ──────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
15017
|
+
logChildrenFilesAndEntryPointsRelationships() {
|
|
14765
15018
|
let accumulatingString = "";
|
|
14766
|
-
for (const [
|
|
14767
|
-
accumulatingString = `${accumulatingString}File: "${
|
|
14768
|
-
for (const entryPointFileAbsolutePath of
|
|
15019
|
+
for (const [childFileRelativePath, childFileMetadata] of this.childrenFilesMetadata.entries()) {
|
|
15020
|
+
accumulatingString = `${accumulatingString}File: "${childFileRelativePath}" has parents:\n`;
|
|
15021
|
+
for (const entryPointFileAbsolutePath of childFileMetadata.parentEntryPointsAbsolutePaths) {
|
|
14769
15022
|
accumulatingString = `${accumulatingString} ● ${es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
|
|
14770
15023
|
basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
|
|
14771
15024
|
comparedPath: entryPointFileAbsolutePath,
|
|
@@ -14774,8 +15027,8 @@ class SourceCodeSelectiveReprocessingHelper {
|
|
|
14774
15027
|
}
|
|
14775
15028
|
}
|
|
14776
15029
|
es_extensions_1.Logger.logInfo({
|
|
14777
|
-
title: `${this.TARGET_FILES_TYPE_IN_SINGULAR_FORM}
|
|
14778
|
-
description: accumulatingString.length > 0 ? accumulatingString : "No existing
|
|
15030
|
+
title: `${this.TARGET_FILES_TYPE_IN_SINGULAR_FORM} Children Files and Respective Parent Entry Points Relationships`,
|
|
15031
|
+
description: accumulatingString.length > 0 ? accumulatingString : "No existing children files has been found."
|
|
14779
15032
|
});
|
|
14780
15033
|
}
|
|
14781
15034
|
}
|
|
@@ -14858,11 +15111,11 @@ exports["default"] = VinylFileClass;
|
|
|
14858
15111
|
|
|
14859
15112
|
|
|
14860
15113
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
15114
|
+
exports["default"] = createImmediatelyEndingEmptyStream;
|
|
14861
15115
|
const stream_1 = __webpack_require__(/*! stream */ "stream");
|
|
14862
15116
|
function createImmediatelyEndingEmptyStream() {
|
|
14863
15117
|
return () => new stream_1.PassThrough().end();
|
|
14864
15118
|
}
|
|
14865
|
-
exports["default"] = createImmediatelyEndingEmptyStream;
|
|
14866
15119
|
|
|
14867
15120
|
|
|
14868
15121
|
/***/ }),
|
|
@@ -14875,6 +15128,7 @@ exports["default"] = createImmediatelyEndingEmptyStream;
|
|
|
14875
15128
|
|
|
14876
15129
|
|
|
14877
15130
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
15131
|
+
exports["default"] = extractStringifiedContentFromVinylFile;
|
|
14878
15132
|
function extractStringifiedContentFromVinylFile(targetFile) {
|
|
14879
15133
|
if (targetFile.contents === null) {
|
|
14880
15134
|
return "";
|
|
@@ -14884,7 +15138,6 @@ function extractStringifiedContentFromVinylFile(targetFile) {
|
|
|
14884
15138
|
}
|
|
14885
15139
|
return targetFile.contents.toString();
|
|
14886
15140
|
}
|
|
14887
|
-
exports["default"] = extractStringifiedContentFromVinylFile;
|
|
14888
15141
|
|
|
14889
15142
|
|
|
14890
15143
|
/***/ }),
|
|
@@ -15321,7 +15574,7 @@ function revisionHash(data) {
|
|
|
15321
15574
|
\***********************/
|
|
15322
15575
|
/***/ ((module) => {
|
|
15323
15576
|
|
|
15324
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@yamato-daiwa/automation","version":"0.5.0-alpha.
|
|
15577
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@yamato-daiwa/automation","version":"0.5.0-alpha.3","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":"2.8.0","@typescript-eslint/eslint-plugin":"8.8.0","@typescript-eslint/parser":"8.8.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.3.0-alpha.8","autoprefixer":"10.4.19","browser-sync":"3.0.2","css-loader":"7.1.2","cssnano":"7.0.2","eslint":"9.12.0","eslint-plugin-import":"2.31.0","eslint-plugin-n":"17.10.3","eslint-plugin-react":"7.37.1","eslint-plugin-vue":"9.28.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":"7.0.3","@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.5.4","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
15578
|
|
|
15326
15579
|
/***/ })
|
|
15327
15580
|
|