@yamato-daiwa/automation 0.5.0-alpha.0 → 0.5.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/EntryPoint.js +1232 -533
  2. package/package.json +3 -3
package/EntryPoint.js CHANGED
@@ -3948,10 +3948,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3948
3948
  return (mod && mod.__esModule) ? mod : { "default": mod };
3949
3949
  };
3950
3950
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3951
- /* ─── Settings representatives ──────────────────────────────────────────────────────────────────────────────────── */
3951
+ /* ─── Settings Representatives ───────────────────────────────────────────────────────────────────────────────────── */
3952
3952
  const AssetsProcessingSettingsRepresentative_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/SettingsRepresentatives/AssetsProcessingSettingsRepresentative */ "./ProjectBuilding/Common/SettingsRepresentatives/AssetsProcessingSettingsRepresentative.ts"));
3953
3953
  const VinylFileClass_1 = __importDefault(__webpack_require__(/*! @Utils/VinylFileClass */ "./Utils/VinylFileClass.ts"));
3954
- /* ─── Utils ─────────────────────────────────────────────────────────────────────────────────────────────────────── */
3954
+ /* ─── Utils ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
3955
3955
  const es_extensions_nodejs_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions-nodejs */ "@yamato-daiwa/es-extensions-nodejs");
3956
3956
  class AssetVinylFile extends VinylFileClass_1.default {
3957
3957
  sourceAbsolutePath;
@@ -4410,7 +4410,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4410
4410
  return (mod && mod.__esModule) ? mod : { "default": mod };
4411
4411
  };
4412
4412
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4413
- /* ─── Third-party Solutions Specialises ──────────────────────────────────────────────────────────────────────────── */
4413
+ /* ─── Third-party Solutions Specialists ──────────────────────────────────────────────────────────────────────────── */
4414
4414
  const ChokidarSpecialist_1 = __importDefault(__webpack_require__(/*! @ThirdPartySolutionsSpecialists/Chokidar/ChokidarSpecialist */ "./ThirdPartySolutionsSpecialists/Chokidar/ChokidarSpecialist.ts"));
4415
4415
  /* ─── General Utils ──────────────────────────────────────────────────────────────────────────────────────────────── */
4416
4416
  const gulp_1 = __importDefault(__webpack_require__(/*! gulp */ "gulp"));
@@ -5000,7 +5000,11 @@ class PlainCopyingRawSettingsNormalizer {
5000
5000
  ], { alwaysForwardSlashSeparators: true });
5001
5001
  sourceAndOutputFilesAbsolutePathsCorrespondenceMapForCurrentGroup.set(sourceFileAbsolutePath, outputFileAbsolutePath);
5002
5002
  }
5003
- (0, es_extensions_1.addMultiplePairsToMap)(PlainCopyingSharedState_1.default.sourceFilesAbsolutePathsAndRespectiveFilesGroupSettingsCorrespondenceMap, sourceAndOutputFilesAbsolutePathsCorrespondenceMapForCurrentGroup);
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,
@@ -6403,14 +6407,16 @@ var SupportedECMA_ScriptRuntimesTypes = ECMA_ScriptLogicProcessingRestrictions_1
6403
6407
  const ConsumingProjectBuildingModes_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/Restrictions/ConsumingProjectBuildingModes */ "./ProjectBuilding/Common/Restrictions/ConsumingProjectBuildingModes.ts"));
6404
6408
  /* ─── Default Settings ───────────────────────────────────────────────────────────────────────────────────────────── */
6405
6409
  const ECMA_ScriptLogicProcessingSettings__Default_1 = __importDefault(__webpack_require__(/*! @ECMA_ScriptProcessing/ECMA_ScriptLogicProcessingSettings__Default */ "./ProjectBuilding/SourceCodeProcessing/ECMA_Script/ECMA_ScriptLogicProcessingSettings__Default.ts"));
6406
- /* ─── Settings normalizers ───────────────────────────────────────────────────────────────────────────────────────── */
6410
+ /* ─── Settings Normalizers ───────────────────────────────────────────────────────────────────────────────────────── */
6407
6411
  const SourceCodeProcessingRawSettingsNormalizer_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding:Common/RawSettingsNormalizers/SourceCodeProcessingRawSettingsNormalizer */ "./ProjectBuilding/Common/RawSettingsNormalizers/SourceCodeProcessingRawSettingsNormalizer.ts"));
6408
6412
  const RevisioningSettingsNormalizer_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/RawSettingsNormalizers/Reusables/RevisioningSettingsNormalizer */ "./ProjectBuilding/Common/RawSettingsNormalizers/Reusables/RevisioningSettingsNormalizer.ts"));
6409
- /* ─── Utils ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
6413
+ /* ─── Third-party Solutions Specialists ──────────────────────────────────────────────────────────────────────────── */
6414
+ const TypeScriptSpecialist_1 = __importDefault(__webpack_require__(/*! @ThirdPartySolutionsSpecialists/TypeScriptSpecialist */ "./ThirdPartySolutionsSpecialists/TypeScriptSpecialist.ts"));
6410
6415
  const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
6411
6416
  const es_extensions_nodejs_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions-nodejs */ "@yamato-daiwa/es-extensions-nodejs");
6412
6417
  class ECMA_ScriptLogicProcessingRawSettingsNormalizer extends SourceCodeProcessingRawSettingsNormalizer_1.default {
6413
6418
  supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots = ECMA_ScriptLogicProcessingRestrictions_1.default.supportedSourceFilesNamesExtensionsWithoutLeadingDots;
6419
+ cachedTypeScriptConfigurationsFilesRelativePathsAndCorrespondingCompilersOptions = new Map();
6414
6420
  static normalize({ ECMA_ScriptLogicProcessingSettings__fromFile__rawValid, commonSettings__normalized }) {
6415
6421
  const dataHoldingSelfInstance = new ECMA_ScriptLogicProcessingRawSettingsNormalizer({
6416
6422
  projectBuildingCommonSettings__normalized: commonSettings__normalized,
@@ -6460,6 +6466,15 @@ class ECMA_ScriptLogicProcessingRawSettingsNormalizer extends SourceCodeProcessi
6460
6466
  }
6461
6467
  completeEntryPointsGroupNormalizedSettingsCommonPropertiesUntilECMA_ScriptLogicEntryPointsGroupNormalizedSettings(entryPointsGroupGenericSettings__normalized, entryPointsGroupSettings__rawValid) {
6462
6468
  const distributingSettings__rawValid = entryPointsGroupSettings__rawValid.distributing;
6469
+ const typeScriptConfigurationFileRelativePath = es_extensions_nodejs_1.ImprovedPath.replacePathSeparatorsToForwardSlashes(entryPointsGroupSettings__rawValid.typeScriptConfigurationFileRelativePath ??
6470
+ ECMA_ScriptLogicProcessingSettings__Default_1.default.typeScriptConfigurationFileRelativePath);
6471
+ const typeScriptConfigurationFileAbsolutePath = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([this.consumingProjectRootDirectoryAbsolutePath, typeScriptConfigurationFileRelativePath], { alwaysForwardSlashSeparators: true });
6472
+ const typeScriptCompilerOptions = this.cachedTypeScriptConfigurationsFilesRelativePathsAndCorrespondingCompilersOptions.
6473
+ get(typeScriptConfigurationFileRelativePath) ??
6474
+ this.readAndCacheTypeScriptCompilerOptions({
6475
+ typeScriptConfigurationFileAbsolutePath,
6476
+ typeScriptConfigurationFileRelativePath
6477
+ });
6463
6478
  return {
6464
6479
  ...entryPointsGroupGenericSettings__normalized,
6465
6480
  targetRuntime: (() => {
@@ -6498,11 +6513,10 @@ class ECMA_ScriptLogicProcessingRawSettingsNormalizer extends SourceCodeProcessi
6498
6513
  associatedMarkupEntryPointsGroupID_ForDynamicModulesLoadingWithoutDevelopmentServer: entryPointsGroupSettings__rawValid.
6499
6514
  associatedMarkupEntryPointsGroupID_ForDynamicModulesLoadingWithoutDevelopmentServer
6500
6515
  } : null,
6501
- typeScriptConfigurationFileAbsolutePath: es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
6502
- this.consumingProjectRootDirectoryAbsolutePath,
6503
- entryPointsGroupSettings__rawValid.typeScriptConfigurationFileRelativePath ??
6504
- ECMA_ScriptLogicProcessingSettings__Default_1.default.typeScriptConfigurationFileRelativePath
6505
- ], { alwaysForwardSlashSeparators: true }),
6516
+ typeScriptConfigurationFileAbsolutePath,
6517
+ typeScriptCompilerOptions,
6518
+ directoriesAliasesAndCorrespondingAbsolutePathsMap: ECMA_ScriptLogicProcessingRawSettingsNormalizer.
6519
+ createDirectoriesAliasesAndCorrespondingAbsolutePathsMap(typeScriptConfigurationFileAbsolutePath, typeScriptCompilerOptions),
6506
6520
  revisioning: RevisioningSettingsNormalizer_1.default.normalize({
6507
6521
  revisioningSettings__rawValid: entryPointsGroupSettings__rawValid.
6508
6522
  buildingModeDependent[this.consumingProjectBuildingMode].revisioning,
@@ -6552,6 +6566,33 @@ class ECMA_ScriptLogicProcessingRawSettingsNormalizer extends SourceCodeProcessi
6552
6566
  }
6553
6567
  };
6554
6568
  }
6569
+ readAndCacheTypeScriptCompilerOptions({ typeScriptConfigurationFileAbsolutePath, typeScriptConfigurationFileRelativePath }) {
6570
+ const typeScriptCompilerOptions = TypeScriptSpecialist_1.default.
6571
+ readTypeScriptConfigurationFileAndGetCompilerOptions(typeScriptConfigurationFileAbsolutePath);
6572
+ this.cachedTypeScriptConfigurationsFilesRelativePathsAndCorrespondingCompilersOptions.set(typeScriptConfigurationFileRelativePath, typeScriptCompilerOptions);
6573
+ return typeScriptCompilerOptions;
6574
+ }
6575
+ static createDirectoriesAliasesAndCorrespondingAbsolutePathsMap(typeScriptConfigurationFileAbsolutePath, typeScriptCompilerOptions) {
6576
+ /* [ TypeScript theory ] If `baseUrl` has been specified in configuration file, once parsed, it will be the
6577
+ + absolute path herewith forward slashes path separators. */
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
+ });
6588
+ return new Map(Object.entries(typeScriptCompilerOptions.paths ?? {}).map(([rawAlias, rawPaths]) => [
6589
+ rawAlias.endsWith("/*") ? rawAlias.slice(0, -"/*".length) : rawAlias,
6590
+ rawPaths.map((rawPath) => es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
6591
+ typeScriptBasicAbsolutePath,
6592
+ ...rawPath.endsWith("/*") ? [rawPath.slice(0, -"/*".length)] : [rawPath]
6593
+ ], { alwaysForwardSlashSeparators: true }))
6594
+ ]));
6595
+ }
6555
6596
  }
6556
6597
  exports["default"] = ECMA_ScriptLogicProcessingRawSettingsNormalizer;
6557
6598
 
@@ -6975,94 +7016,222 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
6975
7016
  };
6976
7017
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6977
7018
  const ECMA_ScriptLogicProcessingSharedState_1 = __importDefault(__webpack_require__(/*! @ECMA_ScriptProcessing/ECMA_ScriptLogicProcessingSharedState */ "./ProjectBuilding/SourceCodeProcessing/ECMA_Script/ECMA_ScriptLogicProcessingSharedState.ts"));
7019
+ /* ─── Third-party Solutions Specialists ──────────────────────────────────────────────────────────────────────────── */
7020
+ const ECMA_ScriptSpecialist_1 = __importDefault(__webpack_require__(/*! @ThirdPartySolutionsSpecialists/ECMA_ScriptSpecialist */ "./ThirdPartySolutionsSpecialists/ECMA_ScriptSpecialist.ts"));
6978
7021
  /* ─── Applied Utils ──────────────────────────────────────────────────────────────────────────────────────────────── */
6979
7022
  const webpack_1 = __importDefault(__webpack_require__(/*! webpack */ "webpack"));
6980
7023
  const WebpackConfigGenerator_1 = __importDefault(__webpack_require__(/*! @ECMA_ScriptProcessing/Utils/WebpackConfigGenerator */ "./ProjectBuilding/SourceCodeProcessing/ECMA_Script/Utils/WebpackConfigGenerator.ts"));
6981
7024
  const ECMA_ScriptLogicEntryPointsSourceFilesAbsolutePathsAndOutputFilesActualPathsMapGenerator_1 = __importDefault(__webpack_require__(/*! @ECMA_ScriptProcessing/Utils/ECMA_ScriptLogicEntryPointsSourceFilesAbsolutePathsAndOutputFilesActualPathsMapGenerator */ "./ProjectBuilding/SourceCodeProcessing/ECMA_Script/Utils/ECMA_ScriptLogicEntryPointsSourceFilesAbsolutePathsAndOutputFilesActualPathsMapGenerator.ts"));
6982
7025
  const ECMA_ScriptSourceFilesWatcher_1 = __importDefault(__webpack_require__(/*! @ECMA_ScriptProcessing/ECMA_ScriptSourceFilesWatcher */ "./ProjectBuilding/SourceCodeProcessing/ECMA_Script/ECMA_ScriptSourceFilesWatcher.ts"));
6983
7026
  const node_notifier_1 = __importDefault(__webpack_require__(/*! node-notifier */ "node-notifier"));
7027
+ const SourceCodeSelectiveReprocessingHelper_1 = __importDefault(__webpack_require__(/*! @Utils/SourceCodeSelectiveReprocessingHelper */ "./Utils/SourceCodeSelectiveReprocessingHelper.ts"));
7028
+ const DotYDA_DirectoryManager_1 = __importDefault(__webpack_require__(/*! @Utils/DotYDA_DirectoryManager */ "./Utils/DotYDA_DirectoryManager.ts"));
6984
7029
  /* ─── General Utils ──────────────────────────────────────────────────────────────────────────────────────────────── */
6985
7030
  const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
7031
+ const es_extensions_nodejs_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions-nodejs */ "@yamato-daiwa/es-extensions-nodejs");
6986
7032
  class ECMA_ScriptLogicProcessor {
7033
+ static ENTRY_POINTS_AND_PARTIAL_FILES_MAPPING_CACHE_FILE_NAME_WITH_EXTENSION = "ECMA_ScriptEntryPointsAndAffiliatedFilesMappingCache.json";
6987
7034
  TASK_NAME_FOR_LOGGING = "ECMAScript logic processing";
6988
- masterConfigRepresentative;
7035
+ projectBuildingMasterConfigRepresentative;
6989
7036
  ECMA_ScriptLogicProcessingConfigRepresentative;
7037
+ webpackConfigurationsForExistingEntryPoints;
7038
+ webpackMultiCompiler;
7039
+ entryPointsSourceFilesAbsolutePathsAndWebpackConfigurationNamesMap;
7040
+ absolutePathOfFilesWaitingForReProcessing = new Set();
7041
+ sourceCodeSelectiveReprocessingHelper;
7042
+ subsequentFilesStateChangeTimeout = null;
6990
7043
  static provideLogicProcessingIfMust(projectBuildingMasterConfigRepresentative) {
6991
7044
  const ecmaScriptLogicProcessingSettingsRepresentative = projectBuildingMasterConfigRepresentative.ECMA_ScriptLogicProcessingSettingsRepresentative;
6992
7045
  if ((0, es_extensions_1.isUndefined)(ecmaScriptLogicProcessingSettingsRepresentative)) {
6993
7046
  return (callback) => { callback(); };
6994
7047
  }
6995
7048
  const dataHoldingSelfInstance = new ECMA_ScriptLogicProcessor(ecmaScriptLogicProcessingSettingsRepresentative, projectBuildingMasterConfigRepresentative);
6996
- const webpackConfigurationSets = WebpackConfigGenerator_1.default.
6997
- generateWebpackConfigurationForEachEntryPointsGroup(ecmaScriptLogicProcessingSettingsRepresentative, projectBuildingMasterConfigRepresentative);
6998
- return (callback) => {
7049
+ return (gulpCallback) => {
6999
7050
  try {
7000
- /* [ Webpack theory ] Although there is no `null` hardError is type definitions, the `hardError` could be null. */
7001
- (0, webpack_1.default)(webpackConfigurationSets, (hardError, statistics) => {
7002
- if ((0, es_extensions_1.isNotUndefined)(statistics)) {
7003
- process.stdout.write(`${statistics.toString({ colors: true })}\n`);
7004
- }
7005
- let finalErrorMessageDynamicPart;
7006
- /* [ Webpack theory ] Even there is no hard error braking the build, there are could be the soft errors. */
7007
- const softErrors = (0, es_extensions_1.undefinedToEmptyArray)(statistics?.stats[0]?.compilation.errors);
7008
- if ((0, es_extensions_1.isNeitherUndefinedNorNull)(hardError)) {
7009
- finalErrorMessageDynamicPart = hardError.message;
7010
- }
7011
- else if (softErrors.length > 0) {
7012
- finalErrorMessageDynamicPart = softErrors.toString();
7013
- }
7014
- if ((0, es_extensions_1.isNotUndefined)(finalErrorMessageDynamicPart)) {
7015
- es_extensions_1.Logger.logError({
7016
- errorType: "ECMA_ScriptLogicProcessingError",
7017
- title: "ECMAScript logic processing error",
7018
- description: finalErrorMessageDynamicPart,
7019
- occurrenceLocation: "ECMA_ScriptLogicProcessor.provideLogicProcessing(projectBuildingMasterConfigRepresentative)"
7020
- });
7021
- node_notifier_1.default.notify({
7022
- title: "ECMAScript logic processing",
7023
- message: "Error has occurred. Please check the console."
7024
- });
7025
- }
7026
- if (dataHoldingSelfInstance.masterConfigRepresentative.mustProvideIncrementalBuilding) {
7027
- ECMA_ScriptSourceFilesWatcher_1.default.initializeIfRequiredAndGetInstance({
7028
- ecmaScriptLogicProcessingSettingsRepresentative: dataHoldingSelfInstance.
7029
- ECMA_ScriptLogicProcessingConfigRepresentative,
7030
- projectBuildingMasterConfigRepresentative: dataHoldingSelfInstance.masterConfigRepresentative
7031
- });
7032
- }
7033
- /** 〔 納品版のみ理由 〕 開発版で同じ事をすれば、gulpが落ちる */
7034
- if (!dataHoldingSelfInstance.masterConfigRepresentative.mustProvideIncrementalBuilding &&
7035
- (0, es_extensions_1.isNotUndefined)(finalErrorMessageDynamicPart)) {
7036
- es_extensions_1.Logger.logError({
7037
- errorType: "ECMA_ScriptLogicProcessingError",
7038
- title: "ECMAScript logic processing error",
7039
- description: "Unable to production build.",
7040
- occurrenceLocation: "ECMA_ScriptLogicProcessor.provideLogicProcessing(projectBuildingMasterConfigRepresentative)"
7041
- });
7042
- callback(new Error(finalErrorMessageDynamicPart));
7043
- }
7044
- else {
7045
- (0, es_extensions_1.addMultiplePairsToMap)(ECMA_ScriptLogicProcessingSharedState_1.default.sourceFilesAbsolutePathsAndOutputFilesActualPathsMap, ECMA_ScriptLogicEntryPointsSourceFilesAbsolutePathsAndOutputFilesActualPathsMapGenerator_1.default.generate(dataHoldingSelfInstance.ECMA_ScriptLogicProcessingConfigRepresentative));
7046
- callback();
7047
- }
7048
- });
7051
+ dataHoldingSelfInstance.webpackMultiCompiler.run(dataHoldingSelfInstance.generateWebpackCallback(gulpCallback));
7049
7052
  }
7050
7053
  catch (error) {
7051
7054
  /* [ Theory ] Once reached here, the Gulp tasks chain will collapse whatever will callback called to no. */
7052
7055
  es_extensions_1.Logger.logError({
7053
7056
  errorType: es_extensions_1.UnexpectedEventError.NAME,
7054
7057
  title: es_extensions_1.UnexpectedEventError.localization.defaultTitle,
7055
- description: "依存性の'Webpack'の実行中エラーが発生した。'webpack'関数の呼び出しを'try/catch'に包めなければいけない事に就いて説明書" +
7056
- "(https://webpack.js.org/api/node/)に書いてはないが、今は'catch'に当たった状態だ。'Gulp'課題鎖が崩れない様に、エラーを再投擲無しで捕まえた。",
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/",
7057
7060
  occurrenceLocation: "ECMA_ScriptLogicProcessor.provideLogicProcessing(projectBuildingMasterConfigRepresentative)",
7058
7061
  caughtError: error
7059
7062
  });
7060
7063
  }
7064
+ gulpCallback();
7061
7065
  };
7062
7066
  }
7063
7067
  constructor(ecmaScriptLogicProcessingConfigRepresentative, masterConfigRepresentative) {
7064
7068
  this.ECMA_ScriptLogicProcessingConfigRepresentative = ecmaScriptLogicProcessingConfigRepresentative;
7065
- this.masterConfigRepresentative = masterConfigRepresentative;
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) {
7100
+ this.sourceCodeSelectiveReprocessingHelper = new SourceCodeSelectiveReprocessingHelper_1.default({
7101
+ initialEntryPointsSourceFilesAbsolutePaths: this.ECMA_ScriptLogicProcessingConfigRepresentative.initialRelevantEntryPointsSourceFilesAbsolutePaths,
7102
+ childrenFilesResolutionRules: {
7103
+ childrenFilesIncludingDeclarationsPatterns: ECMA_ScriptSpecialist_1.default.partialFilesIncludingDeclarationPatterns,
7104
+ implicitFilesNamesExtensionsWithoutLeadingDotsOfChildrenFiles: this.ECMA_ScriptLogicProcessingConfigRepresentative.
7105
+ supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots
7106
+ },
7107
+ directoriesAliasesAndTheirAbsolutePatsMap: ECMA_ScriptLogicProcessor.
7108
+ generateUnifiedDirectoriesAliasesAndTheirAbsolutePatsMapForSourceCodeSelectiveReprocessingHelper(this.ECMA_ScriptLogicProcessingConfigRepresentative),
7109
+ isEntryPoint: this.ECMA_ScriptLogicProcessingConfigRepresentative.
7110
+ isEntryPoint.
7111
+ bind(this.ECMA_ScriptLogicProcessingConfigRepresentative),
7112
+ logging: {
7113
+ mustEnable: this.ECMA_ScriptLogicProcessingConfigRepresentative.loggingSettings.
7114
+ partialFilesAndParentEntryPointsCorrespondence,
7115
+ targetFilesTypeInSingularForm: this.ECMA_ScriptLogicProcessingConfigRepresentative.
7116
+ TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM
7117
+ },
7118
+ consumingProjectRootDirectoryAbsolutePath: this.projectBuildingMasterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath,
7119
+ cacheFileAbsolutePath: es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
7120
+ DotYDA_DirectoryManager_1.default.OPTIMIZATION_FILES_DIRECTORY_ABSOLUTE_PATH,
7121
+ ECMA_ScriptLogicProcessor.ENTRY_POINTS_AND_PARTIAL_FILES_MAPPING_CACHE_FILE_NAME_WITH_EXTENSION
7122
+ ])
7123
+ });
7124
+ ECMA_ScriptSourceFilesWatcher_1.default.
7125
+ initializeIfRequiredAndGetInstance({
7126
+ ecmaScriptLogicProcessingSettingsRepresentative: this.ECMA_ScriptLogicProcessingConfigRepresentative,
7127
+ projectBuildingMasterConfigRepresentative: this.projectBuildingMasterConfigRepresentative
7128
+ }).
7129
+ addOnAnyEventRelatedWithActualFilesHandler({
7130
+ handlerID: "ON_ANY_EVENT_WITH_ECMA_SCRIPT_LOGIC_SOURCE_CODE_FILE--BY_ECMA_SCRIPT_LOGIC_PROCESSOR",
7131
+ handler: this.onSourceFilesWatcherEmittedAnyEvent.bind(this)
7132
+ });
7133
+ // TODO
7134
+ // addOnEntryPointFileAddedEventHandler({
7135
+ // handlerID: "ON_MARKUP_ENTRY_POINT_FILE_ADDED--BY_MARKUP_PROCESSOR",
7136
+ // handler: dataHoldingSelfInstance.onEntryPointFileAdded.bind(dataHoldingSelfInstance)
7137
+ // }).
7138
+ // addOnEntryPointFileDeletedEventHandler({
7139
+ // handlerID: "ON_MARKUP_ENTRY_POINT_FILE_DELETED--BY_MARKUP_PROCESSOR",
7140
+ // handler: MarkupProcessor.onEntryPointFileDeleted
7141
+ // });
7142
+ }
7143
+ }
7144
+ /* ━━━ Rebuilding ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
7145
+ onSourceFilesWatcherEmittedAnyEvent(targetFileAbsolutePath) {
7146
+ this.absolutePathOfFilesWaitingForReProcessing.add(targetFileAbsolutePath);
7147
+ if ((0, es_extensions_1.isNotNull)(this.subsequentFilesStateChangeTimeout)) {
7148
+ clearTimeout(this.subsequentFilesStateChangeTimeout);
7149
+ }
7150
+ this.subsequentFilesStateChangeTimeout = setTimeout(() => {
7151
+ const absolutePathOfEntryPointsWhichMustBeReprocessed__forwardSlashSeparators = this.sourceCodeSelectiveReprocessingHelper?.getAbsolutePathsOfEntryPointsWhichMustBeProcessed(this.absolutePathOfFilesWaitingForReProcessing) ??
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
+ }
7161
+ this.absolutePathOfFilesWaitingForReProcessing.clear();
7162
+ }, (0, es_extensions_1.secondsToMilliseconds)(1));
7163
+ }
7164
+ generateWebpackCallback(gulpCallback) {
7165
+ return (hardError, statistics) => {
7166
+ if ((0, es_extensions_1.isNotUndefined)(statistics)) {
7167
+ process.stdout.write(`${statistics.toString({ colors: true })}\n`);
7168
+ }
7169
+ let finalErrorMessageDynamicPart;
7170
+ /* [ Webpack theory ] Even there is no hard error braking the build, there are could be the soft errors. */
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
+ }
7180
+ if ((0, es_extensions_1.isNeitherUndefinedNorNull)(hardError)) {
7181
+ finalErrorMessageDynamicPart = hardError.message;
7182
+ }
7183
+ else if (softErrors.length > 0) {
7184
+ finalErrorMessageDynamicPart = softErrors.toString();
7185
+ }
7186
+ if ((0, es_extensions_1.isNotUndefined)(finalErrorMessageDynamicPart)) {
7187
+ es_extensions_1.Logger.logError({
7188
+ errorType: "ECMA_ScriptLogicProcessingError",
7189
+ title: "ECMAScript logic processing error",
7190
+ description: finalErrorMessageDynamicPart,
7191
+ occurrenceLocation: "ECMA_ScriptLogicProcessor.provideLogicProcessing(projectBuildingMasterConfigRepresentative)"
7192
+ });
7193
+ node_notifier_1.default.notify({
7194
+ title: "ECMAScript logic processing",
7195
+ message: "Error has occurred. Please check the console."
7196
+ });
7197
+ }
7198
+ if (!this.projectBuildingMasterConfigRepresentative.mustProvideIncrementalBuilding &&
7199
+ (0, es_extensions_1.isNotUndefined)(finalErrorMessageDynamicPart)) {
7200
+ es_extensions_1.Logger.logError({
7201
+ errorType: "ECMA_ScriptLogicProcessingError",
7202
+ title: "ECMAScript logic processing error",
7203
+ description: "Unable to production build.",
7204
+ occurrenceLocation: "ECMA_ScriptLogicProcessor.provideLogicProcessing(projectBuildingMasterConfigRepresentative)"
7205
+ });
7206
+ gulpCallback?.(new Error(finalErrorMessageDynamicPart));
7207
+ }
7208
+ else {
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
+ });
7214
+ gulpCallback?.();
7215
+ }
7216
+ };
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;
7066
7235
  }
7067
7236
  }
7068
7237
  exports["default"] = ECMA_ScriptLogicProcessor;
@@ -7129,7 +7298,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
7129
7298
  const ECMA_ScriptSourceFilesWatcher_1 = __importDefault(__webpack_require__(/*! @ECMA_ScriptProcessing/ECMA_ScriptSourceFilesWatcher */ "./ProjectBuilding/SourceCodeProcessing/ECMA_Script/ECMA_ScriptSourceFilesWatcher.ts"));
7130
7299
  /* ─── Superclass ─────────────────────────────────────────────────────────────────────────────────────────────────── */
7131
7300
  const LinterLikeTaskExecutor_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/TasksExecutors/GulpStreamsBased/LinterLikeTaskExecutor */ "./ProjectBuilding/Common/TasksExecutors/GulpStreamsBased/LinterLikeTaskExecutor.ts"));
7132
- /* ─── Third-party Solutions Specialises ──────────────────────────────────────────────────────────────────────────── */
7301
+ /* ─── Third-party Solutions Specialists ──────────────────────────────────────────────────────────────────────────── */
7133
7302
  const ESLintLinterSpecialist_1 = __importDefault(__webpack_require__(/*! @ThirdPartySolutionsSpecialists/ESLintLinterSpecialist */ "./ThirdPartySolutionsSpecialists/ESLintLinterSpecialist.ts"));
7134
7303
  /* ─── Applied Utils ──────────────────────────────────────────────────────────────────────────────────────────────── */
7135
7304
  const eslint_1 = __webpack_require__(/*! eslint */ "eslint");
@@ -7378,18 +7547,19 @@ class ECMA_ScriptSourceCodeLinter extends LinterLikeTaskExecutor_1.default {
7378
7547
  targetArray: (0, es_extensions_1.replaceArrayElementsByIndexesImmutably)({
7379
7548
  targetArray: sourceCodeExplodedToLines,
7380
7549
  replacements: [
7381
- ...rawIssue.line === rawIssue.endLine ? [
7382
- {
7383
- index: rawIssue.line - 1,
7384
- newElement: (0, es_extensions_1.cropString)({
7385
- targetString: sourceCodeExplodedToLines[rawIssue.line - 1],
7386
- startingCharacterNumber__numerationFrom1: rawIssue.column,
7387
- endingCharacterNumber__numerationFrom1: rawIssue.column === rawIssue.endColumn ?
7388
- rawIssue.endColumn : rawIssue.endColumn - 1,
7389
- mustThrowErrorIfSpecifiedCharactersNumbersIsOutOfRange: true
7390
- })
7391
- }
7392
- ] : [
7550
+ ...rawIssue.line === rawIssue.endLine ?
7551
+ [
7552
+ {
7553
+ index: rawIssue.line - 1,
7554
+ newElement: (0, es_extensions_1.cropString)({
7555
+ targetString: sourceCodeExplodedToLines[rawIssue.line - 1],
7556
+ startingCharacterNumber__numerationFrom1: rawIssue.column,
7557
+ endingCharacterNumber__numerationFrom1: rawIssue.column === rawIssue.endColumn ?
7558
+ rawIssue.endColumn : rawIssue.endColumn - 1,
7559
+ mustThrowErrorIfSpecifiedCharactersNumbersIsOutOfRange: true
7560
+ })
7561
+ }
7562
+ ] : [
7393
7563
  {
7394
7564
  index: rawIssue.line - 1,
7395
7565
  newElement: (0, es_extensions_1.cropString)({
@@ -7399,16 +7569,19 @@ class ECMA_ScriptSourceCodeLinter extends LinterLikeTaskExecutor_1.default {
7399
7569
  mustThrowErrorIfSpecifiedCharactersNumbersIsOutOfRange: true
7400
7570
  })
7401
7571
  },
7402
- {
7403
- index: rawIssue.endLine - 1,
7404
- newElement: (0, es_extensions_1.cropString)({
7405
- targetString: sourceCodeExplodedToLines[rawIssue.endLine - 1],
7406
- fromStart: true,
7407
- endingCharacterNumber__numerationFrom1: rawIssue.column === rawIssue.endColumn ?
7408
- rawIssue.endColumn : rawIssue.endColumn - 1,
7409
- mustThrowErrorIfSpecifiedCharactersNumbersIsOutOfRange: true
7410
- })
7411
- }
7572
+ ...rawIssue.endColumn > 1 ?
7573
+ [
7574
+ {
7575
+ index: rawIssue.endLine - 1,
7576
+ newElement: (0, es_extensions_1.cropString)({
7577
+ targetString: sourceCodeExplodedToLines[rawIssue.endLine - 1],
7578
+ fromStart: true,
7579
+ endingCharacterNumber__numerationFrom1: rawIssue.column === rawIssue.endColumn ?
7580
+ rawIssue.endColumn : rawIssue.endColumn - 1,
7581
+ mustThrowErrorIfSpecifiedCharactersNumbersIsOutOfRange: true
7582
+ })
7583
+ }
7584
+ ] : []
7412
7585
  ]
7413
7586
  ]
7414
7587
  }),
@@ -7637,105 +7810,43 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
7637
7810
  return (mod && mod.__esModule) ? mod : { "default": mod };
7638
7811
  };
7639
7812
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7640
- /* --- Restrictions ------------------------------------------------------------------------------------------------- */
7813
+ /* ─── Restrictions ───────────────────────────────────────────────────────────────────────────────────────────────── */
7641
7814
  const ECMA_ScriptLogicProcessingRestrictions_1 = __importDefault(__webpack_require__(/*! @ECMA_ScriptProcessing/ECMA_ScriptLogicProcessingRestrictions */ "./ProjectBuilding/SourceCodeProcessing/ECMA_Script/ECMA_ScriptLogicProcessingRestrictions.ts"));
7642
7815
  var SupportedECMA_ScriptRuntimesTypes = ECMA_ScriptLogicProcessingRestrictions_1.default.SupportedECMA_ScriptRuntimesTypes;
7643
- /* --- Third-party solutions specialises ---------------------------------------------------------------------------- */
7816
+ /* ─── Third-party Solutions Specialists ──────────────────────────────────────────────────────────────────────────── */
7644
7817
  const WebpackSpecialist_1 = __importDefault(__webpack_require__(/*! @ThirdPartySolutionsSpecialists/WebpackSpecialist */ "./ThirdPartySolutionsSpecialists/WebpackSpecialist.ts"));
7645
7818
  const TypeScriptSpecialist_1 = __importDefault(__webpack_require__(/*! @ThirdPartySolutionsSpecialists/TypeScriptSpecialist */ "./ThirdPartySolutionsSpecialists/TypeScriptSpecialist.ts"));
7646
- /* --- Applied utils ------------------------------------------------------------------------------------------------ */
7819
+ /* ─── Applied Utils ──────────────────────────────────────────────────────────────────────────────────────────────── */
7647
7820
  const webpack_1 = __importDefault(__webpack_require__(/*! webpack */ "webpack"));
7648
7821
  const vue_loader_1 = __webpack_require__(/*! vue-loader */ "vue-loader");
7649
7822
  const fork_ts_checker_webpack_plugin_1 = __importDefault(__webpack_require__(/*! fork-ts-checker-webpack-plugin */ "fork-ts-checker-webpack-plugin"));
7650
7823
  const webpack_node_externals_1 = __importDefault(__webpack_require__(/*! webpack-node-externals */ "webpack-node-externals"));
7651
- /* --- General utils ------------------------------------------------------------------------------------------------ */
7824
+ /* ─── General Utils ──────────────────────────────────────────────────────────────────────────────────────────────── */
7652
7825
  const path_1 = __importDefault(__webpack_require__(/*! path */ "path"));
7653
7826
  const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
7654
7827
  const es_extensions_nodejs_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions-nodejs */ "@yamato-daiwa/es-extensions-nodejs");
7828
+ /* [ Approach ] Because of serious performance impact, the file watching has been delegated to external watcher. */
7655
7829
  class WebpackConfigGenerator {
7656
- ECMA_ScriptLogicProcessingConfigRepresentative;
7657
- masterConfigRepresentative;
7658
- typeScriptConfigurations = {};
7659
- hasTypeScriptTypeCheckingFunctionalityAlreadyBeenProvided = false;
7660
- static generateWebpackConfigurationForEachEntryPointsGroup(ECMA_ScriptLogicProcessingConfigRepresentative, masterConfigRepresentative) {
7661
- const dataHoldingSelfInstance = new WebpackConfigGenerator(ECMA_ScriptLogicProcessingConfigRepresentative, masterConfigRepresentative);
7662
- const webpackConfigurationForEachEntryPointsGroup = [];
7663
- for (const ECMA_ScriptLogicEntryPointsGroupSettings of dataHoldingSelfInstance.ECMA_ScriptLogicProcessingConfigRepresentative.relevantEntryPointsGroupsSettings.values()) {
7664
- const webpackConfiguration = dataHoldingSelfInstance.
7665
- generateSingleWebpackConfigurationIfAtLeastOneTargetEntryPointFileExists(ECMA_ScriptLogicEntryPointsGroupSettings);
7666
- if ((0, es_extensions_1.isNotNull)(webpackConfiguration)) {
7667
- webpackConfigurationForEachEntryPointsGroup.push(webpackConfiguration);
7668
- dataHoldingSelfInstance.hasTypeScriptTypeCheckingFunctionalityAlreadyBeenProvided = true;
7669
- }
7670
- }
7671
- return webpackConfigurationForEachEntryPointsGroup;
7672
- }
7673
- static getWebpackEntryObjectRespectiveToSpecifiedEntryPointsGroupSettings({ sourceFilesGlobSelectors, entryPointsGroupID_ForLogging, webpackContext }) {
7674
- /* [ Reference ] https://webpack.js.org/configuration/entry-context/#entry */
7675
- const webpackEntryPoints__objectSyntax = {};
7676
- const targetEntryPointsSourceFilesAbsolutePaths = es_extensions_nodejs_1.ImprovedGlob.
7677
- getFilesAbsolutePathsSynchronously(sourceFilesGlobSelectors);
7678
- if (targetEntryPointsSourceFilesAbsolutePaths.length === 0) {
7679
- es_extensions_1.Logger.logWarning({
7680
- title: "Restarting may required",
7681
- description: `No files has been found for the ECMAScript entry points group with id "${entryPointsGroupID_ForLogging}". ` +
7682
- "Please restart the building once these files will be added"
7683
- });
7684
- return null;
7685
- }
7686
- WebpackConfigGenerator.
7687
- checkForFilesWithSameDirectoryAndFileNameButDifferentExtensions(targetEntryPointsSourceFilesAbsolutePaths);
7688
- for (const entryPointSourceFileAbsolutePath of targetEntryPointsSourceFilesAbsolutePaths) {
7689
- const targetSourceFilePathRelativeToSourceEntryPointsTopDirectory = es_extensions_nodejs_1.ImprovedPath.
7690
- computeRelativePath({
7691
- comparedPath: entryPointSourceFileAbsolutePath,
7692
- basePath: webpackContext
7693
- });
7694
- const outputFilePathWithoutFilenameExtensionRelativeToBaseOutputDirectory = (0, es_extensions_1.removeAllFileNameExtensions)(targetSourceFilePathRelativeToSourceEntryPointsTopDirectory);
7695
- /* [ Webpack theory ] The key must be the output path without filename extension relative to 'output.path'.
7696
- * The value must the source file path (relative or absolute), for example
7697
- * { 'HikariFrontend/StarterPugTemplate/StarterPugTemplate':
7698
- * 'D:/PhpStorm/InHouseDevelopment/hikari-documentation/0-Source/HikariFrontend/StarterPugTemplate.ts',
7699
- * 'Minimal': 'D:/PhpStorm/InHouseDevelopment/hikari-documentation/0-Source/Minimal.ts',
7700
- * 'TopPage': 'D:/PhpStorm/InHouseDevelopment/hikari-documentation/0-Source/TopPage.ts'
7701
- * } */
7702
- webpackEntryPoints__objectSyntax[outputFilePathWithoutFilenameExtensionRelativeToBaseOutputDirectory] = entryPointSourceFileAbsolutePath;
7703
- }
7704
- return webpackEntryPoints__objectSyntax;
7705
- }
7706
- constructor(ECMA_ScriptLogicProcessingConfigRepresentative, masterConfigRepresentative) {
7707
- this.ECMA_ScriptLogicProcessingConfigRepresentative = ECMA_ScriptLogicProcessingConfigRepresentative;
7708
- this.masterConfigRepresentative = masterConfigRepresentative;
7709
- }
7710
- generateSingleWebpackConfigurationIfAtLeastOneTargetEntryPointFileExists(entryPointsGroupSettings) {
7830
+ static cachedTypeScriptConfigurations = {};
7831
+ /* [ Approach ] Although the parameter is excessive, its properties are been pre-computed externally for other needs,
7832
+ * so no need to compute them again. */
7833
+ static generateWebpackConfigurationForEntryPointsGroupWithExistingFiles({ entryPointsSourceFilesAbsolutePaths, ECMA_ScriptLogicEntryPointsGroupSettings: entryPointsGroupSettings, ECMA_ScriptLogicProcessingConfigRepresentative, masterConfigRepresentative, mustProvideTypeScriptTypeChecking }) {
7711
7834
  /* [ Reference ] https://webpack.js.org/configuration/entry-context/#context */
7712
7835
  const sourceFilesTopDirectoryAbsolutePath = entryPointsGroupSettings.sourceFilesTopDirectoryAbsolutePath;
7713
7836
  /** @see https://webpack.js.org/configuration/entry-context/#entry */
7714
- const webpackEntryPointsDefinition = WebpackConfigGenerator.getWebpackEntryObjectRespectiveToSpecifiedEntryPointsGroupSettings({
7715
- entryPointsGroupID_ForLogging: entryPointsGroupSettings.ID,
7716
- sourceFilesGlobSelectors: entryPointsGroupSettings.sourceFilesGlobSelectors,
7717
- webpackContext: sourceFilesTopDirectoryAbsolutePath
7718
- });
7719
- if ((0, es_extensions_1.isNull)(webpackEntryPointsDefinition)) {
7720
- es_extensions_1.Logger.logWarning({
7721
- title: "Empty entry point group",
7722
- description: `No files has been found for the group '${entryPointsGroupSettings.ID}' of ECMAScript ` +
7723
- "entry points. Please restart the build once new files will be added."
7724
- });
7725
- return null;
7726
- }
7837
+ const webpackEntryPointsDefinition = WebpackConfigGenerator.getWebpackEntryObjectRespectiveToExistingEntryPoints({ entryPointsSourceFilesAbsolutePaths, webpackContext: sourceFilesTopDirectoryAbsolutePath });
7727
7838
  let typeScriptCompilerOptions;
7728
- const cachedTypeScriptCompilerOptions = this.
7729
- typeScriptConfigurations[entryPointsGroupSettings.typeScriptConfigurationFileAbsolutePath];
7839
+ const cachedTypeScriptCompilerOptions = WebpackConfigGenerator.
7840
+ cachedTypeScriptConfigurations[entryPointsGroupSettings.typeScriptConfigurationFileAbsolutePath];
7730
7841
  if ((0, es_extensions_1.isUndefined)(cachedTypeScriptCompilerOptions)) {
7731
7842
  typeScriptCompilerOptions = TypeScriptSpecialist_1.default.readTypeScriptConfigurationFileAndGetCompilerOptions(entryPointsGroupSettings.typeScriptConfigurationFileAbsolutePath);
7732
- this.typeScriptConfigurations[entryPointsGroupSettings.typeScriptConfigurationFileAbsolutePath] =
7843
+ this.cachedTypeScriptConfigurations[entryPointsGroupSettings.typeScriptConfigurationFileAbsolutePath] =
7733
7844
  typeScriptCompilerOptions;
7734
7845
  }
7735
7846
  else {
7736
7847
  typeScriptCompilerOptions = cachedTypeScriptCompilerOptions;
7737
7848
  }
7738
- const webpackPublicPath = this.computePublicPathIfPossible(entryPointsGroupSettings);
7849
+ const webpackPublicPath = WebpackConfigGenerator.computePublicPath(entryPointsGroupSettings, masterConfigRepresentative);
7739
7850
  const willBrowserJS_LibraryBeBuilt = entryPointsGroupSettings.distributing?.exposingOfExportsFromEntryPoints.mustExpose === true &&
7740
7851
  entryPointsGroupSettings.targetRuntime.type === SupportedECMA_ScriptRuntimesTypes.browser;
7741
7852
  const willNodeJS_LibraryBeBuilt = entryPointsGroupSettings.distributing?.exposingOfExportsFromEntryPoints.mustExpose === true &&
@@ -7743,6 +7854,7 @@ class WebpackConfigGenerator {
7743
7854
  const willPugLibraryBeBuilt = entryPointsGroupSettings.distributing?.exposingOfExportsFromEntryPoints.mustExpose === true &&
7744
7855
  entryPointsGroupSettings.targetRuntime.type === SupportedECMA_ScriptRuntimesTypes.pug;
7745
7856
  const distributingSettings = entryPointsGroupSettings.distributing;
7857
+ // entryPointsGroupSettings.directoriesAliasesAndCorrespondingAbsolutePathsMap
7746
7858
  return {
7747
7859
  name: entryPointsGroupSettings.ID,
7748
7860
  /* [ Webpack theory ] In this case, path separators must be operating system dependent, otherwise following error
@@ -7811,20 +7923,12 @@ class WebpackConfigGenerator {
7811
7923
  }, {})
7812
7924
  } : null,
7813
7925
  ...willBrowserJS_LibraryBeBuilt ? { experiments: { outputModule: true } } : null,
7814
- mode: this.masterConfigRepresentative.isStaticPreviewBuildingMode ||
7815
- this.masterConfigRepresentative.isLocalDevelopmentBuildingMode ?
7926
+ mode: masterConfigRepresentative.mustProvideIncrementalBuilding ?
7816
7927
  "development" : "production",
7817
- watch: this.masterConfigRepresentative.isStaticPreviewBuildingMode ||
7818
- this.masterConfigRepresentative.isLocalDevelopmentBuildingMode,
7819
- watchOptions: {
7820
- ignored: ["node_modules"]
7821
- },
7822
7928
  /* [ Theory ] Although "cheap-module-source-map" causes both slow first building and slow rebuilding,
7823
7929
  * faster alternatives including "eval" could cause the errors related with security.
7824
7930
  * See https://stackoverflow.com/a/49100966. */
7825
- devtool: this.masterConfigRepresentative.isStaticPreviewBuildingMode ||
7826
- this.masterConfigRepresentative.isLocalDevelopmentBuildingMode ?
7827
- "cheap-module-source-map" : false,
7931
+ devtool: masterConfigRepresentative.mustProvideIncrementalBuilding ? "cheap-module-source-map" : false,
7828
7932
  ...entryPointsGroupSettings.targetRuntime.type === SupportedECMA_ScriptRuntimesTypes.nodeJS ? {
7829
7933
  node: {
7830
7934
  __dirname: true,
@@ -7833,7 +7937,7 @@ class WebpackConfigGenerator {
7833
7937
  } : null,
7834
7938
  module: {
7835
7939
  rules: [
7836
- /* --- Logic ---------------------------------------------------------------------------------------------- */
7940
+ /* ━━━ Logic ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
7837
7941
  {
7838
7942
  test: /\.tsx?$/u,
7839
7943
  loader: "ts-loader",
@@ -7848,7 +7952,7 @@ class WebpackConfigGenerator {
7848
7952
  test: /\.vue$/u,
7849
7953
  loader: "vue-loader"
7850
7954
  },
7851
- /* --- Data ----------------------------------------------------------------------------------------------- */
7955
+ /* ━━━ Data ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
7852
7956
  {
7853
7957
  test: /\.json5$/u,
7854
7958
  loader: "json5-loader"
@@ -7857,7 +7961,7 @@ class WebpackConfigGenerator {
7857
7961
  test: /\.(?:yml|yaml)$/u,
7858
7962
  use: ["yaml-loader"]
7859
7963
  },
7860
- /* --- Markup --------------------------------------------------------------------------------------------- */
7964
+ /* ━━━ Markup ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
7861
7965
  {
7862
7966
  test: /\.pug$/u,
7863
7967
  oneOf: [
@@ -7881,7 +7985,7 @@ class WebpackConfigGenerator {
7881
7985
  }
7882
7986
  ]
7883
7987
  },
7884
- /* --- 意匠設計記法 ----------------------------------------------------------------------------------------- */
7988
+ /* ━━━ Styles ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
7885
7989
  {
7886
7990
  test: /\.css$/u,
7887
7991
  oneOf: [
@@ -7928,12 +8032,11 @@ class WebpackConfigGenerator {
7928
8032
  ]
7929
8033
  },
7930
8034
  resolve: {
7931
- extensions: this.ECMA_ScriptLogicProcessingConfigRepresentative.
8035
+ extensions: ECMA_ScriptLogicProcessingConfigRepresentative.
7932
8036
  supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots.
7933
8037
  map((fileNameExtensionWithoutDot) => `.${fileNameExtensionWithoutDot}`),
7934
8038
  alias: {
7935
- ...WebpackSpecialist_1.default.
7936
- convertPathsAliasesFromTypeScriptFormatToWebpackFormat({
8039
+ ...WebpackSpecialist_1.default.convertPathsAliasesFromTypeScriptFormatToWebpackFormat({
7937
8040
  typeScriptPathsSettings: typeScriptCompilerOptions.paths,
7938
8041
  typeScriptBasicAbsolutePath: typeScriptCompilerOptions.baseUrl ??
7939
8042
  es_extensions_nodejs_1.ImprovedPath.extractDirectoryFromFilePath({
@@ -7951,16 +8054,16 @@ class WebpackConfigGenerator {
7951
8054
  }
7952
8055
  },
7953
8056
  resolveLoader: WebpackSpecialist_1.default.
7954
- generateLoadersResolvingSettings(this.masterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath),
8057
+ generateLoadersResolvingSettings(masterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath),
7955
8058
  ...entryPointsGroupSettings.targetRuntime.type === SupportedECMA_ScriptRuntimesTypes.nodeJS ? {
7956
8059
  externals: [(0, webpack_node_externals_1.default)()]
7957
8060
  } : null,
7958
8061
  plugins: [
7959
8062
  new webpack_1.default.DefinePlugin({
7960
- __IS_LOCAL_DEVELOPMENT_BUILDING_MODE__: this.masterConfigRepresentative.isLocalDevelopmentBuildingMode,
7961
- __IS_TESTING_BUILDING_MODE__: this.masterConfigRepresentative.isTestingBuildingMode,
7962
- __IS_STAGING_BUILDING_MODE__: this.masterConfigRepresentative.isStagingBuildingMode,
7963
- __IS_PRODUCTION_BUILDING_MODE__: this.masterConfigRepresentative.isProductionBuildingMode,
8063
+ __IS_LOCAL_DEVELOPMENT_BUILDING_MODE__: masterConfigRepresentative.isLocalDevelopmentBuildingMode,
8064
+ __IS_TESTING_BUILDING_MODE__: masterConfigRepresentative.isTestingBuildingMode,
8065
+ __IS_STAGING_BUILDING_MODE__: masterConfigRepresentative.isStagingBuildingMode,
8066
+ __IS_PRODUCTION_BUILDING_MODE__: masterConfigRepresentative.isProductionBuildingMode,
7964
8067
  /* [ Theory ] Settings for the Vue 3 which must be defined explicitly.
7965
8068
  * https://github.com/vuejs/core/tree/main/packages/vue#bundler-build-feature-flags */
7966
8069
  ...entryPointsGroupSettings.targetRuntime.type === SupportedECMA_ScriptRuntimesTypes.browser ? {
@@ -7969,8 +8072,8 @@ class WebpackConfigGenerator {
7969
8072
  __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false
7970
8073
  } : null
7971
8074
  }),
7972
- ...this.hasTypeScriptTypeCheckingFunctionalityAlreadyBeenProvided ?
7973
- [] :
8075
+ /* < === Temporary ========================================================================================== */
8076
+ ...mustProvideTypeScriptTypeChecking ?
7974
8077
  [
7975
8078
  new fork_ts_checker_webpack_plugin_1.default({
7976
8079
  typescript: {
@@ -7984,21 +8087,44 @@ class WebpackConfigGenerator {
7984
8087
  }
7985
8088
  }
7986
8089
  })
7987
- ],
8090
+ ] :
8091
+ [],
8092
+ /* === Temporary > ========================================================================================== */
7988
8093
  new vue_loader_1.VueLoaderPlugin()
7989
8094
  ],
7990
8095
  optimization: {
7991
- minimize: this.masterConfigRepresentative.isStagingBuildingMode ||
7992
- this.masterConfigRepresentative.isProductionBuildingMode,
7993
- emitOnErrors: this.masterConfigRepresentative.isStaticPreviewBuildingMode ||
7994
- this.masterConfigRepresentative.isLocalDevelopmentBuildingMode
8096
+ minimize: !masterConfigRepresentative.mustProvideIncrementalBuilding,
8097
+ emitOnErrors: masterConfigRepresentative.mustProvideIncrementalBuilding
7995
8098
  }
7996
8099
  };
7997
8100
  }
8101
+ static getWebpackEntryObjectRespectiveToExistingEntryPoints({ entryPointsSourceFilesAbsolutePaths, webpackContext }) {
8102
+ /* [ Reference ] https://webpack.js.org/configuration/entry-context/#entry */
8103
+ const webpackEntryPoints__objectSyntax = {};
8104
+ WebpackConfigGenerator.
8105
+ checkForFilesWithSameDirectoryAndFileNameButDifferentExtensions(entryPointsSourceFilesAbsolutePaths);
8106
+ for (const entryPointSourceFileAbsolutePath of entryPointsSourceFilesAbsolutePaths) {
8107
+ const targetSourceFilePathRelativeToSourceEntryPointsTopDirectory = es_extensions_nodejs_1.ImprovedPath.
8108
+ computeRelativePath({
8109
+ comparedPath: entryPointSourceFileAbsolutePath,
8110
+ basePath: webpackContext
8111
+ });
8112
+ const outputFilePathWithoutFilenameExtensionRelativeToBaseOutputDirectory = (0, es_extensions_1.removeAllFileNameExtensions)(targetSourceFilePathRelativeToSourceEntryPointsTopDirectory);
8113
+ /* [ Webpack theory ] The key must be the output path without filename extension relative to 'output.path'.
8114
+ * The value must the source file path (relative or absolute), for example
8115
+ * { 'HikariFrontend/StarterPugTemplate/StarterPugTemplate':
8116
+ * 'D:/PhpStorm/InHouseDevelopment/hikari-documentation/0-Source/HikariFrontend/StarterPugTemplate.ts',
8117
+ * 'Minimal': 'D:/PhpStorm/InHouseDevelopment/hikari-documentation/0-Source/Minimal.ts',
8118
+ * 'TopPage': 'D:/PhpStorm/InHouseDevelopment/hikari-documentation/0-Source/TopPage.ts'
8119
+ * } */
8120
+ webpackEntryPoints__objectSyntax[outputFilePathWithoutFilenameExtensionRelativeToBaseOutputDirectory] = entryPointSourceFileAbsolutePath;
8121
+ }
8122
+ return webpackEntryPoints__objectSyntax;
8123
+ }
7998
8124
  /* [ Webpack theory ] 'publicPath' computing
7999
8125
  *
8000
- * 1. For the production building mode, just "/" is enough.
8001
- * For the development building mode, everything must work without development server otherwise the customer
8126
+ * 1. For the production-like building modes, just "/" is enough.
8127
+ * For the incremental building modes, everything must work without development server otherwise the customer
8002
8128
  * could not check the application just by opening the HTML files ("/" will be resolved to the root of current hard drive).
8003
8129
  * The known solution is the relative path: it is required to match the path where Webpack chunks are being outputted
8004
8130
  * and the path where Webpack chunks are being searched (initially it could be different paths).
@@ -8013,12 +8139,10 @@ class WebpackConfigGenerator {
8013
8139
  * 3. Chunks will be searched in
8014
8140
  * [ path at search string of browser ] + publicPath + chunkFilename
8015
8141
  * */
8016
- computePublicPathIfPossible(ECMA_ScriptLogicEntryPointsGroupSettings__normalized) {
8017
- if (!this.masterConfigRepresentative.isStaticPreviewBuildingMode &&
8018
- !this.masterConfigRepresentative.isLocalDevelopmentBuildingMode) {
8019
- return "/";
8020
- }
8021
- return ECMA_ScriptLogicEntryPointsGroupSettings__normalized.ID.replace(ECMA_ScriptLogicEntryPointsGroupSettings__normalized.ID, "/");
8142
+ static computePublicPath(ECMA_ScriptLogicEntryPointsGroupSettings__normalized, masterConfigRepresentative) {
8143
+ return masterConfigRepresentative.mustProvideIncrementalBuilding ?
8144
+ ECMA_ScriptLogicEntryPointsGroupSettings__normalized.ID.replace(ECMA_ScriptLogicEntryPointsGroupSettings__normalized.ID, "/") :
8145
+ "/";
8022
8146
  }
8023
8147
  static checkForFilesWithSameDirectoryAndFileNameButDifferentExtensions(entryPointsSourceFilesAbsolutePaths) {
8024
8148
  const entryPointsSourceFiles = new Set();
@@ -8171,6 +8295,7 @@ class MarkupProcessingSettingsRepresentative extends GulpStreamBasedSourceCodePr
8171
8295
  sourceCodeLintingCommonSettings;
8172
8296
  importingFromTypeScriptSettings;
8173
8297
  staticPreviewSettings;
8298
+ routingSettings;
8174
8299
  relevantEntryPointsGroupsSettings;
8175
8300
  loggingSettings;
8176
8301
  mustValidateHTML;
@@ -8182,6 +8307,7 @@ class MarkupProcessingSettingsRepresentative extends GulpStreamBasedSourceCodePr
8182
8307
  this.sourceCodeLintingCommonSettings = normalizedMarkupProcessingSettings.linting;
8183
8308
  this.importingFromTypeScriptSettings = normalizedMarkupProcessingSettings.importingFromTypeScript;
8184
8309
  this.staticPreviewSettings = normalizedMarkupProcessingSettings.staticPreview;
8310
+ this.routingSettings = normalizedMarkupProcessingSettings.routing;
8185
8311
  this.relevantEntryPointsGroupsSettings = normalizedMarkupProcessingSettings.relevantEntryPointsGroups;
8186
8312
  this.loggingSettings = normalizedMarkupProcessingSettings.logging;
8187
8313
  this.supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots = normalizedMarkupProcessingSettings.common.
@@ -8437,6 +8563,35 @@ var MarkupProcessingSettings__FromFile__RawValid;
8437
8563
  }
8438
8564
  }
8439
8565
  },
8566
+ routing: {
8567
+ type: Object,
8568
+ required: false,
8569
+ preValidationModifications: es_extensions_1.nullToUndefined,
8570
+ properties: {
8571
+ $specificationFileRelativePath: {
8572
+ newName: "specificationFileRelativePath",
8573
+ type: String,
8574
+ required: true,
8575
+ minimalCharactersCount: 1
8576
+ },
8577
+ $variable: {
8578
+ newName: "variable",
8579
+ type: String,
8580
+ required: true,
8581
+ minimalCharactersCount: 1
8582
+ },
8583
+ $localizations: {
8584
+ newName: "localizations",
8585
+ type: es_extensions_1.RawObjectDataProcessor.ValuesTypesIDs.associativeArrayOfUniformTypeValues,
8586
+ required: false,
8587
+ preValidationModifications: es_extensions_1.nullToUndefined,
8588
+ value: {
8589
+ type: String,
8590
+ minimalCharactersCount: 1
8591
+ }
8592
+ }
8593
+ }
8594
+ },
8440
8595
  ...SourceCodeProcessingSettingsGenericProperties__FromFile__RawValid_1.default.getLocalizedPropertiesSpecification({
8441
8596
  sourceCodeProcessingSettingsGenericPropertiesLocalization,
8442
8597
  localizedConsumingProjectLocalizedPreDefinedBuildingModes,
@@ -8683,7 +8838,7 @@ const gulp_if_1 = __importDefault(__webpack_require__(/*! gulp-if */ "gulp-if"))
8683
8838
  const gulp_data_1 = __importDefault(__webpack_require__(/*! gulp-data */ "gulp-data"));
8684
8839
  const gulp_pug_1 = __importDefault(__webpack_require__(/*! gulp-pug */ "gulp-pug"));
8685
8840
  const gulp_html_prettify_1 = __importDefault(__webpack_require__(/*! gulp-html-prettify */ "gulp-html-prettify"));
8686
- /* ─── Third-party Solutions Specialises ──────────────────────────────────────────────────────────────────────────── */
8841
+ /* ─── Third-party Solutions Specialists ──────────────────────────────────────────────────────────────────────────── */
8687
8842
  const PugPreProcessorSpecialist_1 = __importDefault(__webpack_require__(/*! @ThirdPartySolutionsSpecialists/PugPreProcessorSpecialist */ "./ThirdPartySolutionsSpecialists/PugPreProcessorSpecialist.ts"));
8688
8843
  /* ─── Applied Utils ──────────────────────────────────────────────────────────────────────────────────────────────── */
8689
8844
  const GulpStreamModifier_1 = __importDefault(__webpack_require__(/*! @Utils/GulpStreamModifier */ "./Utils/GulpStreamModifier.ts"));
@@ -8747,9 +8902,9 @@ class MarkupProcessor extends GulpStreamsBasedTaskExecutor_1.default {
8747
8902
  dataHoldingSelfInstance.sourceCodeSelectiveReprocessingHelper = new SourceCodeSelectiveReprocessingHelper_1.default({
8748
8903
  initialEntryPointsSourceFilesAbsolutePaths: markupProcessingSettingsRepresentative.
8749
8904
  initialRelevantEntryPointsSourceFilesAbsolutePaths,
8750
- affiliatedFilesResolutionRules: {
8751
- affiliatedFilesIncludingDeclarationsPatterns: PugPreProcessorSpecialist_1.default.partialFilesIncludingDeclarationPatterns,
8752
- implicitFilesNamesExtensionsWithoutLeadingDotsOfAffiliatedFiles: PugPreProcessorSpecialist_1.default.
8905
+ childrenFilesResolutionRules: {
8906
+ childrenFilesIncludingDeclarationsPatterns: PugPreProcessorSpecialist_1.default.partialFilesIncludingDeclarationPatterns,
8907
+ implicitFilesNamesExtensionsWithoutLeadingDotsOfChildrenFiles: PugPreProcessorSpecialist_1.default.
8753
8908
  implicitFilesNamesExtensionsWithoutLeadingDotsOfPartials
8754
8909
  },
8755
8910
  isEntryPoint: markupProcessingSettingsRepresentative.isEntryPoint.bind(markupProcessingSettingsRepresentative),
@@ -8838,7 +8993,10 @@ class MarkupProcessor extends GulpStreamsBasedTaskExecutor_1.default {
8838
8993
  __IS_LOCAL_DEVELOPMENT_BUILDING_MODE__: this.projectBuildingMasterConfigRepresentative.isLocalDevelopmentBuildingMode,
8839
8994
  __IS_TESTING_BUILDING_MODE__: this.projectBuildingMasterConfigRepresentative.isTestingBuildingMode,
8840
8995
  __IS_STAGING_BUILDING_MODE__: this.projectBuildingMasterConfigRepresentative.isStagingBuildingMode,
8841
- __IS_PRODUCTION_BUILDING_MODE__: this.projectBuildingMasterConfigRepresentative.isProductionBuildingMode
8996
+ __IS_PRODUCTION_BUILDING_MODE__: this.projectBuildingMasterConfigRepresentative.isProductionBuildingMode,
8997
+ ...(0, es_extensions_1.isNotUndefined)(this.markupProcessingSettingsRepresentative.routingSettings) ? {
8998
+ [this.markupProcessingSettingsRepresentative.routingSettings.variable]: this.markupProcessingSettingsRepresentative.routingSettings.routes
8999
+ } : null
8842
9000
  },
8843
9001
  filters: {
8844
9002
  html_special_characters_to_html_entities: MarkupProcessor.convertApplicableCharactersToHTML_Entities,
@@ -11483,6 +11641,7 @@ const ConsumingProjectBuildingModes_1 = __importDefault(__webpack_require__(/*!
11483
11641
  const MarkupProcessingSettings__Default_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/MarkupProcessingSettings__Default */ "./ProjectBuilding/SourceCodeProcessing/Markup/MarkupProcessingSettings__Default.ts"));
11484
11642
  /* ─── Settings normalizers ───────────────────────────────────────────────────────────────────────────────────────── */
11485
11643
  const SourceCodeProcessingRawSettingsNormalizer_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/RawSettingsNormalizers/SourceCodeProcessingRawSettingsNormalizer */ "./ProjectBuilding/Common/RawSettingsNormalizers/SourceCodeProcessingRawSettingsNormalizer.ts"));
11644
+ const RoutingSettingsNormalizer_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/RawSettingsNormalizer/RoutingSettingsNormalizer */ "./ProjectBuilding/SourceCodeProcessing/Markup/RawSettingsNormalizer/RoutingSettingsNormalizer.ts"));
11486
11645
  /* ─── Utils ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
11487
11646
  const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
11488
11647
  const es_extensions_nodejs_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions-nodejs */ "@yamato-daiwa/es-extensions-nodejs");
@@ -11520,6 +11679,16 @@ class MarkupProcessingRawSettingsNormalizer extends SourceCodeProcessingRawSetti
11520
11679
  normalizeStaticPreviewStateDependentPageVariationsSpecification(),
11521
11680
  importsFromStaticDataFiles: dataHoldingSelfInstance.normalizeImportsFromStaticDataFiles()
11522
11681
  },
11682
+ ...(0, es_extensions_1.isNotUndefined)(markupProcessingSettings__fromFile__rawValid.routing) ? {
11683
+ routing: {
11684
+ variable: markupProcessingSettings__fromFile__rawValid.routing.variable,
11685
+ routes: RoutingSettingsNormalizer_1.default.normalize({
11686
+ routingSettings__fromFile__rawValid: markupProcessingSettings__fromFile__rawValid.routing,
11687
+ projectRootDirectoryAbsolutePath: commonSettings__normalized.projectRootDirectoryAbsolutePath,
11688
+ absolutePathsOfSectioningToCache: new Set() // TODO Replace mock
11689
+ })
11690
+ }
11691
+ } : null,
11523
11692
  relevantEntryPointsGroups: dataHoldingSelfInstance.createNormalizedEntryPointsGroupsSettings(markupProcessingSettings__fromFile__rawValid.entryPointsGroups, dataHoldingSelfInstance.
11524
11693
  completeEntryPointsGroupNormalizedSettingsCommonPropertiesUntilMarkupEntryPointsGroupNormalizedSettings.
11525
11694
  bind(dataHoldingSelfInstance)),
@@ -11881,55 +12050,485 @@ exports["default"] = markupProcessingRawSettingsNormalizerLocalization__english;
11881
12050
 
11882
12051
  /***/ }),
11883
12052
 
11884
- /***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Subtasks/CompiledTypeScriptImporterForPug.ts":
11885
- /*!**************************************************************************************************!*\
11886
- !*** ./ProjectBuilding/SourceCodeProcessing/Markup/Subtasks/CompiledTypeScriptImporterForPug.ts ***!
11887
- \**************************************************************************************************/
11888
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
12053
+ /***/ "./ProjectBuilding/SourceCodeProcessing/Markup/RawSettingsNormalizer/RoutingSettingsNormalizer.ts":
12054
+ /*!********************************************************************************************************!*\
12055
+ !*** ./ProjectBuilding/SourceCodeProcessing/Markup/RawSettingsNormalizer/RoutingSettingsNormalizer.ts ***!
12056
+ \********************************************************************************************************/
12057
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11889
12058
 
11890
12059
 
11891
- var __importDefault = (this && this.__importDefault) || function (mod) {
11892
- return (mod && mod.__esModule) ? mod : { "default": mod };
11893
- };
11894
12060
  Object.defineProperty(exports, "__esModule", ({ value: true }));
11895
- /* ─── Superclass ─────────────────────────────────────────────────────────────────────────────────────────────────── */
11896
- const GulpStreamsBasedTaskExecutor_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/TasksExecutors/GulpStreamsBased/GulpStreamsBasedTaskExecutor */ "./ProjectBuilding/Common/TasksExecutors/GulpStreamsBased/GulpStreamsBasedTaskExecutor.ts"));
11897
- /* ─── Shared State ───────────────────────────────────────────────────────────────────────────────────────────────── */
11898
- const MarkupProcessingSharedState_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/MarkupProcessingSharedState */ "./ProjectBuilding/SourceCodeProcessing/Markup/MarkupProcessingSharedState.ts"));
11899
- /* ─── Applied Utils ──────────────────────────────────────────────────────────────────────────────────────────────── */
11900
- const createImmediatelyEndingEmptyStream_1 = __importDefault(__webpack_require__(/*! @Utils/createImmediatelyEndingEmptyStream */ "./Utils/createImmediatelyEndingEmptyStream.ts"));
11901
- const gulp_1 = __importDefault(__webpack_require__(/*! gulp */ "gulp"));
11902
- const extractStringifiedContentFromVinylFile_1 = __importDefault(__webpack_require__(/*! @Utils/extractStringifiedContentFromVinylFile */ "./Utils/extractStringifiedContentFromVinylFile.ts"));
11903
- const GulpStreamModifier_1 = __importDefault(__webpack_require__(/*! @Utils/GulpStreamModifier */ "./Utils/GulpStreamModifier.ts"));
11904
- const webpack_1 = __importDefault(__webpack_require__(/*! webpack */ "webpack"));
11905
- const webpack_stream_1 = __importDefault(__webpack_require__(/*! webpack-stream */ "webpack-stream"));
11906
- const WebpackConfigGenerator_1 = __importDefault(__webpack_require__(/*! @ECMA_ScriptProcessing/Utils/WebpackConfigGenerator */ "./ProjectBuilding/SourceCodeProcessing/ECMA_Script/Utils/WebpackConfigGenerator.ts"));
11907
- const WebpackSpecialist_1 = __importDefault(__webpack_require__(/*! @ThirdPartySolutionsSpecialists/WebpackSpecialist */ "./ThirdPartySolutionsSpecialists/WebpackSpecialist.ts"));
11908
- const TypeScriptSpecialist_1 = __importDefault(__webpack_require__(/*! @ThirdPartySolutionsSpecialists/TypeScriptSpecialist */ "./ThirdPartySolutionsSpecialists/TypeScriptSpecialist.ts"));
11909
- /* ─── General Utils ──────────────────────────────────────────────────────────────────────────────────────────────── */
12061
+ /* ─── Utils ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
11910
12062
  const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
11911
12063
  const es_extensions_nodejs_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions-nodejs */ "@yamato-daiwa/es-extensions-nodejs");
11912
- class CompiledInlineTypeScriptImporterForPug extends GulpStreamsBasedTaskExecutor_1.default {
11913
- logging = {
11914
- pathsOfFilesWillBeProcessed: false,
11915
- quantityOfFilesWillBeProcessed: false
11916
- };
11917
- webpackConfiguration;
11918
- typeScriptSourceFileAbsolutePath;
11919
- importedNamespaceName;
11920
- static provideTypeScriptImportsForMarkupIfMust(projectBuildingMasterConfigRepresentative) {
11921
- const markupProcessingSettingsRepresentative = projectBuildingMasterConfigRepresentative.markupProcessingSettingsRepresentative;
11922
- if ((0, es_extensions_1.isUndefined)(markupProcessingSettingsRepresentative)) {
11923
- return (0, createImmediatelyEndingEmptyStream_1.default)();
12064
+ class RoutingSettingsNormalizer {
12065
+ static routingPathSegments = [];
12066
+ static projectRootDirectoryAbsolutePath;
12067
+ static cachedAbsolutePathsOfSectioning = new Set();
12068
+ static normalize({ routingSettings__fromFile__rawValid, projectRootDirectoryAbsolutePath, absolutePathsOfSectioningToCache }) {
12069
+ RoutingSettingsNormalizer.cachedAbsolutePathsOfSectioning = absolutePathsOfSectioningToCache;
12070
+ RoutingSettingsNormalizer.projectRootDirectoryAbsolutePath = projectRootDirectoryAbsolutePath;
12071
+ const rawRouting = es_extensions_nodejs_1.ObjectDataFilesProcessor.processFile({
12072
+ filePath: es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
12073
+ projectRootDirectoryAbsolutePath, routingSettings__fromFile__rawValid.specificationFileRelativePath
12074
+ ]),
12075
+ synchronously: true,
12076
+ schema: es_extensions_nodejs_1.ObjectDataFilesProcessor.SupportedSchemas.YAML
12077
+ });
12078
+ const rawLocalizations = {};
12079
+ for (const [locale, localizationFileRelativePath] of Object.entries(routingSettings__fromFile__rawValid.localizations ?? {})) {
12080
+ const routingLocalizationFileAbsolutePath = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([projectRootDirectoryAbsolutePath, localizationFileRelativePath], { alwaysForwardSlashSeparators: true });
12081
+ const routingLocalization = es_extensions_nodejs_1.ObjectDataFilesProcessor.processFile({
12082
+ filePath: routingLocalizationFileAbsolutePath,
12083
+ synchronously: true,
12084
+ schema: es_extensions_nodejs_1.ObjectDataFilesProcessor.SupportedSchemas.YAML
12085
+ });
12086
+ if (!(0, es_extensions_1.isArbitraryObject)(routingLocalization)) {
12087
+ es_extensions_1.Logger.throwErrorAndLog({
12088
+ errorInstance: new es_extensions_1.InvalidExternalDataError({
12089
+ customMessage: `Malformed routing localization at "${routingLocalizationFileAbsolutePath}".`
12090
+ }),
12091
+ title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
12092
+ occurrenceLocation: "RoutingSettingsNormalizer.normalize(compoundParameter)"
12093
+ });
12094
+ }
12095
+ rawLocalizations[locale] = routingLocalization;
11924
12096
  }
11925
- const importingFromTypeScriptSettings = markupProcessingSettingsRepresentative.importingFromTypeScriptSettings;
11926
- if ((0, es_extensions_1.isUndefined)(importingFromTypeScriptSettings)) {
11927
- return (0, createImmediatelyEndingEmptyStream_1.default)();
12097
+ if (Object.entries(rawLocalizations).length === 0) {
12098
+ return RoutingSettingsNormalizer.normalizeDepthLevelWiseRecursively({
12099
+ rawRoutingOfSpecificDepthLevel: rawRouting,
12100
+ outputWorkpiece: {}
12101
+ });
11928
12102
  }
11929
- const dataHoldingSelfInstance = new CompiledInlineTypeScriptImporterForPug(projectBuildingMasterConfigRepresentative, importingFromTypeScriptSettings);
11930
- return (callback) => dataHoldingSelfInstance.provideTypeScriptImports(callback);
11931
- }
11932
- constructor(projectBuildingMasterConfigRepresentative, compiledTypeScriptImportingSettings) {
12103
+ const normalizedRoutingWorkpiece = {};
12104
+ for (const locale of Object.keys(rawLocalizations)) {
12105
+ normalizedRoutingWorkpiece[locale] = {};
12106
+ RoutingSettingsNormalizer.normalizeDepthLevelWiseRecursively({
12107
+ rawRoutingOfSpecificDepthLevel: rawRouting,
12108
+ outputWorkpiece: normalizedRoutingWorkpiece[locale],
12109
+ localization: {
12110
+ locale,
12111
+ strings: rawLocalizations[locale]
12112
+ }
12113
+ });
12114
+ }
12115
+ RoutingSettingsNormalizer.cachedAbsolutePathsOfSectioning = new Set();
12116
+ return normalizedRoutingWorkpiece;
12117
+ }
12118
+ static normalizeDepthLevelWiseRecursively({ rawRoutingOfSpecificDepthLevel, outputWorkpiece, localization }) {
12119
+ if (!(0, es_extensions_1.isArbitraryObject)(rawRoutingOfSpecificDepthLevel)) {
12120
+ es_extensions_1.Logger.throwErrorAndLog({
12121
+ errorInstance: new es_extensions_1.InvalidExternalDataError({
12122
+ customMessage: [
12123
+ "Malformed routing",
12124
+ RoutingSettingsNormalizer.routingPathSegments.length > 0 ?
12125
+ [` at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}"`] : [],
12126
+ ". ",
12127
+ `Must be an object while ${typeof rawRoutingOfSpecificDepthLevel} found.`
12128
+ ].join(" ")
12129
+ }),
12130
+ title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
12131
+ occurrenceLocation: "RoutingSettingsNormalizer.normalizeDepthLevelWiseRecursively(...parameters)"
12132
+ });
12133
+ }
12134
+ RoutingSettingsNormalizer.routingPathSegments.push(...RoutingSettingsNormalizer.routingPathSegments.length === 0 ? [""] : ["$children", ""]);
12135
+ for (const [routeKey, rawRoute] of Object.entries(rawRoutingOfSpecificDepthLevel)) {
12136
+ RoutingSettingsNormalizer.routingPathSegments[RoutingSettingsNormalizer.routingPathSegments.length - 1] = routeKey;
12137
+ if (!(0, es_extensions_1.isArbitraryObject)(rawRoute)) {
12138
+ es_extensions_1.Logger.throwErrorAndLog({
12139
+ errorInstance: new es_extensions_1.InvalidExternalDataError({
12140
+ customMessage: `Malformed routing at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}". ` +
12141
+ `Must be an object while ${typeof (0, es_extensions_1.nullToUndefined)(rawRoute)} found.`
12142
+ }),
12143
+ title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
12144
+ occurrenceLocation: "RoutingSettingsNormalizer.normalizeDepthLevelWiseRecursively(...parameters)"
12145
+ });
12146
+ }
12147
+ const routeURI = RoutingSettingsNormalizer.normalizeURI_IfExists(rawRoute.$URI, localization);
12148
+ outputWorkpiece[routeKey] = {
12149
+ $heading: RoutingSettingsNormalizer.normalizeHeading(rawRoute.$heading, localization),
12150
+ ...(0, es_extensions_1.isNotNull)(routeURI) ? { $URI: routeURI } : null,
12151
+ ...(0, es_extensions_1.isArbitraryObject)(rawRoute.$children) ? {
12152
+ $children: RoutingSettingsNormalizer.normalizeDepthLevelWiseRecursively({
12153
+ rawRoutingOfSpecificDepthLevel: rawRoute.$children,
12154
+ outputWorkpiece: {},
12155
+ localization
12156
+ })
12157
+ } : null,
12158
+ ...(0, es_extensions_1.isArbitraryObject)(rawRoute.$sectioning) ? {
12159
+ $sectioning: RoutingSettingsNormalizer.normalizeSectioning(rawRoute.$sectioning, routeURI, localization)
12160
+ } : null
12161
+ };
12162
+ }
12163
+ RoutingSettingsNormalizer.routingPathSegments.pop();
12164
+ return outputWorkpiece;
12165
+ }
12166
+ static normalizeURI_IfExists(rawURI, localization) {
12167
+ if ((0, es_extensions_1.isEitherUndefinedOrNull)(rawURI)) {
12168
+ return null;
12169
+ }
12170
+ if (!(0, es_extensions_1.isString)(rawURI)) {
12171
+ es_extensions_1.Logger.throwErrorAndLog({
12172
+ errorInstance: new es_extensions_1.InvalidExternalDataError({
12173
+ customMessage: `Malformed routing at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}.$URI". ` +
12174
+ `Must be a string while ${typeof (0, es_extensions_1.nullToUndefined)(rawURI)} found.`
12175
+ }),
12176
+ title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
12177
+ occurrenceLocation: "RoutingSettingsNormalizer.normalizeURI_IfExists(rawURI, localization?)"
12178
+ });
12179
+ }
12180
+ let URI_Workpiece = rawURI;
12181
+ if (URI_Workpiece.startsWith("`")) {
12182
+ if ((0, es_extensions_1.isUndefined)(localization)) {
12183
+ es_extensions_1.Logger.throwErrorAndLog({
12184
+ errorInstance: new es_extensions_1.InvalidExternalDataError({
12185
+ customMessage: `Malformed routing at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}.$URI". ` +
12186
+ "The specified URI has been wrapped to backticks while no localization specified."
12187
+ }),
12188
+ title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
12189
+ occurrenceLocation: "RoutingSettingsNormalizer.normalizeURI_IfExists(rawURI, localization?)"
12190
+ });
12191
+ }
12192
+ URI_Workpiece = (0, es_extensions_1.removeSpecificCharacterFromCertainPosition)({
12193
+ targetString: URI_Workpiece,
12194
+ targetCharacter: "`",
12195
+ fromFirstPosition: true
12196
+ });
12197
+ URI_Workpiece = (0, es_extensions_1.removeSpecificCharacterFromCertainPosition)({
12198
+ targetString: URI_Workpiece,
12199
+ targetCharacter: "`",
12200
+ fromLastPosition: true
12201
+ });
12202
+ if (URI_Workpiece.includes("${")) {
12203
+ URI_Workpiece = (0, es_extensions_1.replaceMatchesWithRegularExpressionToDynamicValue)({
12204
+ targetString: URI_Workpiece,
12205
+ regularExpressionWithCapturingGroups: /(?<interpolation>\$\{\s*(?<variable>(?:\w|\.)+)\s*\})/gum,
12206
+ replacer(matching) {
12207
+ const variableSubstitution = (0, es_extensions_1.getObjectPropertySafely)(localization.strings, matching.namedCapturingGroups.variable);
12208
+ if (!(0, es_extensions_1.isString)(variableSubstitution) && !(0, es_extensions_1.isNumber)(variableSubstitution)) {
12209
+ return null;
12210
+ }
12211
+ return String(variableSubstitution);
12212
+ }
12213
+ });
12214
+ }
12215
+ if (URI_Workpiece.includes("$")) {
12216
+ const localeDependentURI = (0, es_extensions_1.getObjectPropertySafely)(localization.strings, URI_Workpiece);
12217
+ if (!(0, es_extensions_1.isString)(localeDependentURI)) {
12218
+ es_extensions_1.Logger.throwErrorAndLog({
12219
+ errorInstance: new es_extensions_1.InvalidExternalDataError({
12220
+ customMessage: `Malformed routing at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}.$URI". ` +
12221
+ "The specified URI is including backticks while no localization specified."
12222
+ }),
12223
+ title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
12224
+ occurrenceLocation: "RoutingSettingsNormalizer.normalizeURI_IfExists(rawURI, localization?)"
12225
+ });
12226
+ }
12227
+ return localeDependentURI;
12228
+ }
12229
+ }
12230
+ return URI_Workpiece;
12231
+ }
12232
+ static normalizeHeading(rawHeading, localization) {
12233
+ if (!(0, es_extensions_1.isString)(rawHeading)) {
12234
+ es_extensions_1.Logger.throwErrorAndLog({
12235
+ errorInstance: new es_extensions_1.InvalidExternalDataError({
12236
+ customMessage: [
12237
+ `Malformed routing at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}.$heading".`,
12238
+ `Must be a string while ${typeof (0, es_extensions_1.nullToUndefined)(rawHeading)} found.`
12239
+ ].join(" ")
12240
+ }),
12241
+ title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
12242
+ occurrenceLocation: "RoutingSettingsNormalizer.normalizeHeading(specification, localization?)"
12243
+ });
12244
+ }
12245
+ let headingWorkpiece = rawHeading;
12246
+ if (headingWorkpiece.startsWith("`")) {
12247
+ if ((0, es_extensions_1.isEitherUndefinedOrNull)(localization)) {
12248
+ es_extensions_1.Logger.throwErrorAndLog({
12249
+ errorInstance: new es_extensions_1.InvalidExternalDataError({
12250
+ customMessage: `Malformed routing at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}.$heading".` +
12251
+ "The specified URI is including backticks while no localization specified."
12252
+ }),
12253
+ title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
12254
+ occurrenceLocation: "RoutingSettingsNormalizer.normalizeHeading(specification, localization?)"
12255
+ });
12256
+ }
12257
+ headingWorkpiece = (0, es_extensions_1.removeSpecificCharacterFromCertainPosition)({
12258
+ targetString: headingWorkpiece,
12259
+ targetCharacter: "`",
12260
+ fromFirstPosition: true
12261
+ });
12262
+ headingWorkpiece = (0, es_extensions_1.removeSpecificCharacterFromCertainPosition)({
12263
+ targetString: headingWorkpiece,
12264
+ targetCharacter: "`",
12265
+ fromLastPosition: true
12266
+ });
12267
+ const localizedHeading = (0, es_extensions_1.getObjectPropertySafely)(localization.strings, headingWorkpiece);
12268
+ if (!(0, es_extensions_1.isString)(localizedHeading)) {
12269
+ es_extensions_1.Logger.throwErrorAndLog({
12270
+ errorInstance: new es_extensions_1.InvalidExternalDataError({
12271
+ customMessage: [
12272
+ `Malformed localized heading at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}.$heading".`,
12273
+ `Must be a string while ${typeof (0, es_extensions_1.nullToUndefined)(localizedHeading)} found.`
12274
+ ].join(" ")
12275
+ }),
12276
+ title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
12277
+ occurrenceLocation: "RoutingSettingsNormalizer.normalizeHeading(specification, localization?)"
12278
+ });
12279
+ }
12280
+ return localizedHeading;
12281
+ }
12282
+ return headingWorkpiece;
12283
+ }
12284
+ /* ━━━ Sectioning ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
12285
+ static normalizeSectioning(rawSectioningSpecification, parentRouteURI, localization) {
12286
+ RoutingSettingsNormalizer.routingPathSegments.push("$sectioning");
12287
+ if (!(0, es_extensions_1.isString)(parentRouteURI)) {
12288
+ es_extensions_1.Logger.throwErrorAndLog({
12289
+ errorInstance: new es_extensions_1.InvalidExternalDataError({
12290
+ customMessage: `The sectioning at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}" has been defined ` +
12291
+ "while the $URI of the parent route has not been. " +
12292
+ "It must be defined to compute the URI for each section."
12293
+ }),
12294
+ title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
12295
+ occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)"
12296
+ });
12297
+ }
12298
+ if (!(0, es_extensions_1.isNonEmptyString)(rawSectioningSpecification.$specificationFileRelativePath)) {
12299
+ es_extensions_1.Logger.throwErrorAndLog({
12300
+ errorInstance: new es_extensions_1.InvalidExternalDataError({
12301
+ customMessage: `Malformed routing at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}.` +
12302
+ "$specificationFileRelativePath\"." +
12303
+ "The \"$sectioning.$specificationFileRelativePath\" must be defined with the valid file path relative " +
12304
+ "to project top directory."
12305
+ }),
12306
+ title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
12307
+ occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)"
12308
+ });
12309
+ }
12310
+ const rawSectioningSchemaFileAbsolutePath = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
12311
+ RoutingSettingsNormalizer.projectRootDirectoryAbsolutePath,
12312
+ rawSectioningSpecification.$specificationFileRelativePath
12313
+ ], { alwaysForwardSlashSeparators: true });
12314
+ let rawSectioningSchema;
12315
+ try {
12316
+ rawSectioningSchema = es_extensions_nodejs_1.ObjectDataFilesProcessor.processFile({
12317
+ filePath: es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
12318
+ RoutingSettingsNormalizer.projectRootDirectoryAbsolutePath,
12319
+ rawSectioningSpecification.$specificationFileRelativePath
12320
+ ]),
12321
+ synchronously: true,
12322
+ schema: es_extensions_nodejs_1.ObjectDataFilesProcessor.SupportedSchemas.YAML
12323
+ });
12324
+ }
12325
+ catch (error) {
12326
+ es_extensions_1.Logger.throwErrorAndLog({
12327
+ errorInstance: new es_extensions_1.InvalidExternalDataError({
12328
+ customMessage: "The error has occurred during the reading of sectioning file at " +
12329
+ `"${rawSectioningSpecification.$specificationFileRelativePath}".`
12330
+ }),
12331
+ title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
12332
+ occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)",
12333
+ innerError: error
12334
+ });
12335
+ }
12336
+ RoutingSettingsNormalizer.cachedAbsolutePathsOfSectioning.add(rawSectioningSchemaFileAbsolutePath);
12337
+ if (!(0, es_extensions_1.isArbitraryObject)(rawSectioningSchema)) {
12338
+ es_extensions_1.Logger.throwErrorAndLog({
12339
+ errorInstance: new es_extensions_1.InvalidExternalDataError({
12340
+ customMessage: `Malformed sectioning at "${rawSectioningSpecification.$specificationFileRelativePath}". ` +
12341
+ `Must be an object while ${typeof (0, es_extensions_1.nullToUndefined)(rawSectioningSchema)} found.`
12342
+ }),
12343
+ title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
12344
+ occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)"
12345
+ });
12346
+ }
12347
+ if ((0, es_extensions_1.isArbitraryObject)(rawSectioningSpecification.$localizations)) {
12348
+ if ((0, es_extensions_1.isUndefined)(localization)) {
12349
+ es_extensions_1.Logger.throwErrorAndLog({
12350
+ errorInstance: new es_extensions_1.InvalidExternalDataError({
12351
+ customMessage: "The $localizations has been specified for sectioning " +
12352
+ `"${RoutingSettingsNormalizer.routingPathSegments.join(".")}", but common localizations for ` +
12353
+ "routing has not been. " +
12354
+ "Specify the $localizations property also in routing configuration."
12355
+ }),
12356
+ title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
12357
+ occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)"
12358
+ });
12359
+ }
12360
+ const targetLocalizationFileRelativePath = rawSectioningSpecification.$localizations[localization.locale];
12361
+ RoutingSettingsNormalizer.routingPathSegments.push("$localizations", localization.locale);
12362
+ if (!(0, es_extensions_1.isString)(targetLocalizationFileRelativePath)) {
12363
+ es_extensions_1.Logger.throwErrorAndLog({
12364
+ errorInstance: new es_extensions_1.InvalidExternalDataError({
12365
+ customMessage: "Invalid path to sectioning localization at " +
12366
+ `"${RoutingSettingsNormalizer.routingPathSegments.join(".")}". ` +
12367
+ "Must be the string with file path relative to project root directory, " +
12368
+ `${typeof (0, es_extensions_1.nullToUndefined)(targetLocalizationFileRelativePath)} found.`
12369
+ }),
12370
+ title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
12371
+ occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)"
12372
+ });
12373
+ }
12374
+ const targetLocalizationFileAbsolutePath = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([RoutingSettingsNormalizer.projectRootDirectoryAbsolutePath, targetLocalizationFileRelativePath], { alwaysForwardSlashSeparators: true });
12375
+ let sectioningRawLocalization;
12376
+ try {
12377
+ sectioningRawLocalization = es_extensions_nodejs_1.ObjectDataFilesProcessor.processFile({
12378
+ filePath: targetLocalizationFileAbsolutePath,
12379
+ synchronously: true,
12380
+ schema: es_extensions_nodejs_1.ObjectDataFilesProcessor.SupportedSchemas.YAML
12381
+ });
12382
+ }
12383
+ catch (error) {
12384
+ es_extensions_1.Logger.throwErrorAndLog({
12385
+ errorInstance: new es_extensions_1.FileReadingFailedError({ filePath: targetLocalizationFileAbsolutePath }),
12386
+ title: es_extensions_1.FileReadingFailedError.localization.defaultTitle,
12387
+ occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)",
12388
+ innerError: error
12389
+ });
12390
+ }
12391
+ RoutingSettingsNormalizer.cachedAbsolutePathsOfSectioning.add(targetLocalizationFileAbsolutePath);
12392
+ if (!(0, es_extensions_1.isArbitraryObject)(sectioningRawLocalization)) {
12393
+ es_extensions_1.Logger.throwErrorAndLog({
12394
+ errorInstance: new es_extensions_1.InvalidExternalDataError({
12395
+ customMessage: `Malformed sectioning localization at "${targetLocalizationFileAbsolutePath}".`
12396
+ }),
12397
+ title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
12398
+ occurrenceLocation: "RoutingSettingsNormalizer.normalizeSectioning(...parameters)"
12399
+ });
12400
+ }
12401
+ const normalizedLocalizedSectioning = RoutingSettingsNormalizer.normalizeSectioningDepthLevelRecursively({
12402
+ rawSectioningOfSpecificDepthLevel: rawSectioningSchema,
12403
+ outputWorkpiece: {},
12404
+ localization: {
12405
+ locale: localization.locale,
12406
+ strings: sectioningRawLocalization
12407
+ },
12408
+ parentRouteURI
12409
+ });
12410
+ /* eslint-disable-next-line @typescript-eslint/no-magic-numbers -- `$localizations` and `localization.locale` */
12411
+ RoutingSettingsNormalizer.routingPathSegments.splice(-2);
12412
+ return normalizedLocalizedSectioning;
12413
+ }
12414
+ return RoutingSettingsNormalizer.normalizeSectioningDepthLevelRecursively({
12415
+ rawSectioningOfSpecificDepthLevel: rawSectioningSchema,
12416
+ outputWorkpiece: {},
12417
+ parentRouteURI
12418
+ });
12419
+ }
12420
+ static normalizeSectioningDepthLevelRecursively({ rawSectioningOfSpecificDepthLevel, outputWorkpiece, localization, parentRouteURI }) {
12421
+ if (!(0, es_extensions_1.isArbitraryObject)(rawSectioningOfSpecificDepthLevel)) {
12422
+ es_extensions_1.Logger.throwErrorAndLog({
12423
+ errorInstance: new es_extensions_1.InvalidExternalDataError({
12424
+ customMessage: `Malformed routing at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}". ` +
12425
+ `Must be an object while ${typeof (0, es_extensions_1.nullToUndefined)(rawSectioningOfSpecificDepthLevel)} found.`
12426
+ }),
12427
+ title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
12428
+ occurrenceLocation: "RoutingSettingsNormalizer.normalizeDepthLevelWiseRecursively(compoundParameter)"
12429
+ });
12430
+ }
12431
+ RoutingSettingsNormalizer.routingPathSegments.push(
12432
+ /* eslint-disable-next-line @typescript-eslint/no-magic-numbers -- For the top level of sectioning case,
12433
+ the "$sectioning" element will be second from the end. */
12434
+ ...RoutingSettingsNormalizer.routingPathSegments[RoutingSettingsNormalizer.routingPathSegments.length - 3] ===
12435
+ "$sectioning" ? [""] : ["$children", ""]);
12436
+ RoutingSettingsNormalizer.routingPathSegments.push("");
12437
+ for (const [sectionKey, sectionRawMetadata] of Object.entries(rawSectioningOfSpecificDepthLevel)) {
12438
+ RoutingSettingsNormalizer.routingPathSegments[RoutingSettingsNormalizer.routingPathSegments.length - 1] = sectionKey;
12439
+ if (!(0, es_extensions_1.isArbitraryObject)(sectionRawMetadata)) {
12440
+ es_extensions_1.Logger.throwErrorAndLog({
12441
+ errorInstance: new es_extensions_1.InvalidExternalDataError({
12442
+ customMessage: `Malformed sectioning at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}".` +
12443
+ `Must be an object while ${typeof (0, es_extensions_1.nullToUndefined)(sectionRawMetadata)} found.`
12444
+ }),
12445
+ title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
12446
+ occurrenceLocation: "RoutingSettingsNormalizer.normalizeDepthLevelWiseRecursively(compoundParameter)"
12447
+ });
12448
+ }
12449
+ if (!(0, es_extensions_1.isString)(sectionRawMetadata.$anchor)) {
12450
+ es_extensions_1.Logger.throwErrorAndLog({
12451
+ errorInstance: new es_extensions_1.InvalidExternalDataError({
12452
+ customMessage: `Malformed sectioning at "${RoutingSettingsNormalizer.routingPathSegments.join(".")}". ` +
12453
+ `The property "$anchor" must be defined with string while ${typeof sectionRawMetadata} found.`
12454
+ }),
12455
+ title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
12456
+ occurrenceLocation: "RoutingSettingsNormalizer.normalizeDepthLevelWiseRecursively(compoundParameter)"
12457
+ });
12458
+ }
12459
+ outputWorkpiece[sectionKey] = {
12460
+ $heading: RoutingSettingsNormalizer.normalizeHeading(sectionRawMetadata.$heading, localization),
12461
+ $anchor: sectionRawMetadata.$anchor,
12462
+ $URI: `${parentRouteURI}#${sectionRawMetadata.$anchor}`,
12463
+ ...(0, es_extensions_1.isArbitraryObject)(sectionRawMetadata.$children) ? {
12464
+ $children: RoutingSettingsNormalizer.normalizeSectioningDepthLevelRecursively({
12465
+ rawSectioningOfSpecificDepthLevel: sectionRawMetadata.$children,
12466
+ outputWorkpiece: {},
12467
+ localization,
12468
+ parentRouteURI
12469
+ })
12470
+ } : null
12471
+ };
12472
+ }
12473
+ RoutingSettingsNormalizer.routingPathSegments.pop();
12474
+ return outputWorkpiece;
12475
+ }
12476
+ }
12477
+ exports["default"] = RoutingSettingsNormalizer;
12478
+
12479
+
12480
+ /***/ }),
12481
+
12482
+ /***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Subtasks/CompiledTypeScriptImporterForPug.ts":
12483
+ /*!**************************************************************************************************!*\
12484
+ !*** ./ProjectBuilding/SourceCodeProcessing/Markup/Subtasks/CompiledTypeScriptImporterForPug.ts ***!
12485
+ \**************************************************************************************************/
12486
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
12487
+
12488
+
12489
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12490
+ return (mod && mod.__esModule) ? mod : { "default": mod };
12491
+ };
12492
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
12493
+ /* ─── Superclass ─────────────────────────────────────────────────────────────────────────────────────────────────── */
12494
+ const GulpStreamsBasedTaskExecutor_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/TasksExecutors/GulpStreamsBased/GulpStreamsBasedTaskExecutor */ "./ProjectBuilding/Common/TasksExecutors/GulpStreamsBased/GulpStreamsBasedTaskExecutor.ts"));
12495
+ /* ─── Shared State ───────────────────────────────────────────────────────────────────────────────────────────────── */
12496
+ const MarkupProcessingSharedState_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/MarkupProcessingSharedState */ "./ProjectBuilding/SourceCodeProcessing/Markup/MarkupProcessingSharedState.ts"));
12497
+ /* ─── Applied Utils ──────────────────────────────────────────────────────────────────────────────────────────────── */
12498
+ const createImmediatelyEndingEmptyStream_1 = __importDefault(__webpack_require__(/*! @Utils/createImmediatelyEndingEmptyStream */ "./Utils/createImmediatelyEndingEmptyStream.ts"));
12499
+ const gulp_1 = __importDefault(__webpack_require__(/*! gulp */ "gulp"));
12500
+ const extractStringifiedContentFromVinylFile_1 = __importDefault(__webpack_require__(/*! @Utils/extractStringifiedContentFromVinylFile */ "./Utils/extractStringifiedContentFromVinylFile.ts"));
12501
+ const GulpStreamModifier_1 = __importDefault(__webpack_require__(/*! @Utils/GulpStreamModifier */ "./Utils/GulpStreamModifier.ts"));
12502
+ const webpack_1 = __importDefault(__webpack_require__(/*! webpack */ "webpack"));
12503
+ const webpack_stream_1 = __importDefault(__webpack_require__(/*! webpack-stream */ "webpack-stream"));
12504
+ const WebpackConfigGenerator_1 = __importDefault(__webpack_require__(/*! @ECMA_ScriptProcessing/Utils/WebpackConfigGenerator */ "./ProjectBuilding/SourceCodeProcessing/ECMA_Script/Utils/WebpackConfigGenerator.ts"));
12505
+ const WebpackSpecialist_1 = __importDefault(__webpack_require__(/*! @ThirdPartySolutionsSpecialists/WebpackSpecialist */ "./ThirdPartySolutionsSpecialists/WebpackSpecialist.ts"));
12506
+ const TypeScriptSpecialist_1 = __importDefault(__webpack_require__(/*! @ThirdPartySolutionsSpecialists/TypeScriptSpecialist */ "./ThirdPartySolutionsSpecialists/TypeScriptSpecialist.ts"));
12507
+ /* ─── General Utils ──────────────────────────────────────────────────────────────────────────────────────────────── */
12508
+ const fs_1 = __importDefault(__webpack_require__(/*! fs */ "fs"));
12509
+ const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
12510
+ const es_extensions_nodejs_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions-nodejs */ "@yamato-daiwa/es-extensions-nodejs");
12511
+ class CompiledInlineTypeScriptImporterForPug extends GulpStreamsBasedTaskExecutor_1.default {
12512
+ logging = {
12513
+ pathsOfFilesWillBeProcessed: false,
12514
+ quantityOfFilesWillBeProcessed: false
12515
+ };
12516
+ webpackConfiguration;
12517
+ typeScriptSourceFileAbsolutePath;
12518
+ importedNamespaceName;
12519
+ static provideTypeScriptImportsForMarkupIfMust(projectBuildingMasterConfigRepresentative) {
12520
+ const markupProcessingSettingsRepresentative = projectBuildingMasterConfigRepresentative.markupProcessingSettingsRepresentative;
12521
+ if ((0, es_extensions_1.isUndefined)(markupProcessingSettingsRepresentative)) {
12522
+ return (0, createImmediatelyEndingEmptyStream_1.default)();
12523
+ }
12524
+ const importingFromTypeScriptSettings = markupProcessingSettingsRepresentative.importingFromTypeScriptSettings;
12525
+ if ((0, es_extensions_1.isUndefined)(importingFromTypeScriptSettings)) {
12526
+ return (0, createImmediatelyEndingEmptyStream_1.default)();
12527
+ }
12528
+ const dataHoldingSelfInstance = new CompiledInlineTypeScriptImporterForPug(projectBuildingMasterConfigRepresentative, importingFromTypeScriptSettings);
12529
+ return (callback) => dataHoldingSelfInstance.provideTypeScriptImports(callback);
12530
+ }
12531
+ constructor(projectBuildingMasterConfigRepresentative, compiledTypeScriptImportingSettings) {
11933
12532
  super({
11934
12533
  projectBuildingMasterConfigRepresentative,
11935
12534
  taskTitleForLogging: "Exporting of TypeScript to Pug"
@@ -11950,23 +12549,22 @@ class CompiledInlineTypeScriptImporterForPug extends GulpStreamsBasedTaskExecuto
11950
12549
  }
11951
12550
  })
11952
12551
  });
11953
- /** @see https://webpack.js.org/configuration/entry-context/#entry */
11954
- const webpackEntryPointDefinition = WebpackConfigGenerator_1.default.getWebpackEntryObjectRespectiveToSpecifiedEntryPointsGroupSettings({
11955
- entryPointsGroupID_ForLogging: "IMPORTS_FOR_PUG",
11956
- sourceFilesGlobSelectors: [compiledTypeScriptImportingSettings.sourceFileAbsolutePath],
11957
- webpackContext: projectBuildingMasterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath
11958
- });
11959
- if ((0, es_extensions_1.isNull)(webpackEntryPointDefinition)) {
12552
+ if (!fs_1.default.existsSync(compiledTypeScriptImportingSettings.sourceFileAbsolutePath)) {
11960
12553
  es_extensions_1.Logger.throwErrorAndLog({
11961
12554
  errorInstance: new es_extensions_nodejs_1.FileNotFoundError({
11962
12555
  customMessage: `The TypeScript file "${compiledTypeScriptImportingSettings.sourceFileAbsolutePath}" for ` +
11963
- "the exporting to Pug was not found. " +
12556
+ "the exporting to Pug was found. " +
11964
12557
  "Please create this file and provide some exports from it."
11965
12558
  }),
11966
12559
  title: es_extensions_nodejs_1.FileNotFoundError.localization.defaultTitle,
11967
12560
  occurrenceLocation: "compiledInlineTypeScriptImporterForPug.constructor(...parameters)"
11968
12561
  });
11969
12562
  }
12563
+ /** @see https://webpack.js.org/configuration/entry-context/#entry */
12564
+ const webpackEntryPointDefinition = WebpackConfigGenerator_1.default.getWebpackEntryObjectRespectiveToExistingEntryPoints({
12565
+ entryPointsSourceFilesAbsolutePaths: [compiledTypeScriptImportingSettings.sourceFileAbsolutePath],
12566
+ webpackContext: projectBuildingMasterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath
12567
+ });
11970
12568
  this.webpackConfiguration = CompiledInlineTypeScriptImporterForPug.
11971
12569
  getWebpackEntryObjectRespectiveToSpecifiedEntryPointsGroupSettings({
11972
12570
  webpackEntryPointDefinition,
@@ -12079,7 +12677,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
12079
12677
  const MarkupSourceFilesWatcher_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/MarkupSourceFilesWatcher */ "./ProjectBuilding/SourceCodeProcessing/Markup/MarkupSourceFilesWatcher.ts"));
12080
12678
  /* ─── Superclass ─────────────────────────────────────────────────────────────────────────────────────────────────── */
12081
12679
  const LinterLikeTaskExecutor_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/TasksExecutors/GulpStreamsBased/LinterLikeTaskExecutor */ "./ProjectBuilding/Common/TasksExecutors/GulpStreamsBased/LinterLikeTaskExecutor.ts"));
12082
- /* ─── Third-party Solutions Specialises ──────────────────────────────────────────────────────────────────────────── */
12680
+ /* ─── Third-party Solutions Specialists ──────────────────────────────────────────────────────────────────────────── */
12083
12681
  const PugPreProcessorSpecialist_1 = __importDefault(__webpack_require__(/*! @ThirdPartySolutionsSpecialists/PugPreProcessorSpecialist */ "./ThirdPartySolutionsSpecialists/PugPreProcessorSpecialist.ts"));
12084
12682
  /* ─── Applied Utils ──────────────────────────────────────────────────────────────────────────────────────────────── */
12085
12683
  const pug_lint_1 = __importDefault(__webpack_require__(/*! pug-lint */ "pug-lint"));
@@ -12436,7 +13034,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
12436
13034
  const StylesProcessingRestrictions_1 = __importDefault(__webpack_require__(/*! @StylesProcessing/StylesProcessingRestrictions */ "./ProjectBuilding/SourceCodeProcessing/Styles/StylesProcessingRestrictions.ts"));
12437
13035
  /* ─── Default Settings ───────────────────────────────────────────────────────────────────────────────────────────── */
12438
13036
  const StylesProcessingSettings__Default_1 = __importDefault(__webpack_require__(/*! @StylesProcessing/StylesProcessingSettings__Default */ "./ProjectBuilding/SourceCodeProcessing/Styles/StylesProcessingSettings__Default.ts"));
12439
- /* ─── Third-party Solutions Specialises ──────────────────────────────────────────────────────────────────────────── */
13037
+ /* ─── Third-party Solutions Specialists ──────────────────────────────────────────────────────────────────────────── */
12440
13038
  const StlintLinterSpecialist_1 = __importDefault(__webpack_require__(/*! @ThirdPartySolutionsSpecialists/StlintLinterSpecialist */ "./ThirdPartySolutionsSpecialists/StlintLinterSpecialist.ts"));
12441
13039
  /* ─── Settings normalizers ───────────────────────────────────────────────────────────────────────────────────────── */
12442
13040
  const SourceCodeProcessingRawSettingsNormalizer_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding:Common/RawSettingsNormalizers/SourceCodeProcessingRawSettingsNormalizer */ "./ProjectBuilding/Common/RawSettingsNormalizers/SourceCodeProcessingRawSettingsNormalizer.ts"));
@@ -12779,7 +13377,7 @@ const gulp_stylus_1 = __importDefault(__webpack_require__(/*! gulp-stylus */ "gu
12779
13377
  const gulp_postcss_1 = __importDefault(__webpack_require__(/*! gulp-postcss */ "gulp-postcss"));
12780
13378
  const autoprefixer_1 = __importDefault(__webpack_require__(/*! autoprefixer */ "autoprefixer"));
12781
13379
  const cssnano_1 = __importDefault(__webpack_require__(/*! cssnano */ "cssnano"));
12782
- /* ─── Third-party Solutions Specialises ──────────────────────────────────────────────────────────────────────────── */
13380
+ /* ─── Third-party Solutions Specialists ──────────────────────────────────────────────────────────────────────────── */
12783
13381
  const StylusPreProcessorSpecialist_1 = __importDefault(__webpack_require__(/*! @ThirdPartySolutionsSpecialists/StylusPreProcessorSpecialist */ "./ThirdPartySolutionsSpecialists/StylusPreProcessorSpecialist.ts"));
12784
13382
  /* ─── Applied Utils ──────────────────────────────────────────────────────────────────────────────────────────────── */
12785
13383
  const GulpStreamModifier_1 = __importDefault(__webpack_require__(/*! @Utils/GulpStreamModifier */ "./Utils/GulpStreamModifier.ts"));
@@ -12809,9 +13407,9 @@ class StylesProcessor extends GulpStreamsBasedTaskExecutor_1.default {
12809
13407
  dataHoldingSelfInstance.sourceCodeSelectiveReprocessingHelper = new SourceCodeSelectiveReprocessingHelper_1.default({
12810
13408
  initialEntryPointsSourceFilesAbsolutePaths: stylesProcessingSettingsRepresentative.
12811
13409
  initialRelevantEntryPointsSourceFilesAbsolutePaths,
12812
- affiliatedFilesResolutionRules: {
12813
- affiliatedFilesIncludingDeclarationsPatterns: StylusPreProcessorSpecialist_1.default.partialFilesIncludingDeclarationPatterns,
12814
- implicitFilesNamesExtensionsWithoutLeadingDotsOfAffiliatedFiles: StylusPreProcessorSpecialist_1.default.
13410
+ childrenFilesResolutionRules: {
13411
+ childrenFilesIncludingDeclarationsPatterns: StylusPreProcessorSpecialist_1.default.partialFilesIncludingDeclarationPatterns,
13412
+ implicitFilesNamesExtensionsWithoutLeadingDotsOfChildrenFiles: StylusPreProcessorSpecialist_1.default.
12815
13413
  implicitFilesNamesExtensionsWithoutLeadingDotsOfPartials
12816
13414
  },
12817
13415
  isEntryPoint: stylesProcessingSettingsRepresentative.isEntryPoint.bind(stylesProcessingSettingsRepresentative),
@@ -13084,6 +13682,27 @@ const ChokidarSpecialistLocalization__English = {
13084
13682
  exports["default"] = ChokidarSpecialistLocalization__English;
13085
13683
 
13086
13684
 
13685
+ /***/ }),
13686
+
13687
+ /***/ "./ThirdPartySolutionsSpecialists/ECMA_ScriptSpecialist.ts":
13688
+ /*!*****************************************************************!*\
13689
+ !*** ./ThirdPartySolutionsSpecialists/ECMA_ScriptSpecialist.ts ***!
13690
+ \*****************************************************************/
13691
+ /***/ ((__unused_webpack_module, exports) => {
13692
+
13693
+
13694
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
13695
+ class ECMA_ScriptSpecialist {
13696
+ /* [ Fiddle ] https://regex101.com/r/4X0mYk/7 */
13697
+ static partialFilesIncludingDeclarationPatterns = [
13698
+ /* eslint-disable-next-line prefer-named-capture-group --
13699
+ * No simple way to know the capturing group name outside of this file. */
13700
+ /from\s+["']((?:\w|-|\.|\/|:|@|~)+)["']/gmu
13701
+ ];
13702
+ }
13703
+ exports["default"] = ECMA_ScriptSpecialist;
13704
+
13705
+
13087
13706
  /***/ }),
13088
13707
 
13089
13708
  /***/ "./ThirdPartySolutionsSpecialists/ESLintLinterSpecialist.ts":
@@ -13775,12 +14394,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
13775
14394
  const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
13776
14395
  const es_extensions_nodejs_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions-nodejs */ "@yamato-daiwa/es-extensions-nodejs");
13777
14396
  const fs_1 = __importDefault(__webpack_require__(/*! fs */ "fs"));
13778
- /* [ Theory ]
13779
- * With plain Gulp, we don't know the relations of entry points and affiliated files thus must to re-process all entry
13780
- * points on any file changed. When files number is large, the performance impact will be tangible even for the local
13781
- * development mode when the speed is negligible to certain extent. To optimize this, we need to know the parents entry
13782
- * points of each file, herewith the hierarchy could be arbitrary large. Also, we need to avoid of the reading of same
13783
- * file twice while its content not changed. */
14397
+ const path_1 = __importDefault(__webpack_require__(/*! path */ "path"));
13784
14398
  class SourceCodeSelectiveReprocessingHelper {
13785
14399
  static DEBUGGING_MODE = false;
13786
14400
  static cachedMetadataFileContentSpecification = {
@@ -13797,7 +14411,7 @@ class SourceCodeSelectiveReprocessingHelper {
13797
14411
  type: String,
13798
14412
  required: true
13799
14413
  },
13800
- directAffiliatedFilesRelativePaths: {
14414
+ directChildrenFilesRelativePaths: {
13801
14415
  type: Array,
13802
14416
  required: true,
13803
14417
  element: { type: String }
@@ -13805,7 +14419,7 @@ class SourceCodeSelectiveReprocessingHelper {
13805
14419
  }
13806
14420
  }
13807
14421
  },
13808
- affiliatedFiles: {
14422
+ childrenFiles: {
13809
14423
  type: es_extensions_1.RawObjectDataProcessor.ValuesTypesIDs.associativeArrayOfUniformTypeValues,
13810
14424
  required: true,
13811
14425
  value: {
@@ -13815,7 +14429,7 @@ class SourceCodeSelectiveReprocessingHelper {
13815
14429
  type: String,
13816
14430
  required: true
13817
14431
  },
13818
- directAffiliatedFilesRelativePaths: {
14432
+ directChildrenFilesRelativePaths: {
13819
14433
  type: Array,
13820
14434
  required: true,
13821
14435
  element: { type: String }
@@ -13832,183 +14446,208 @@ class SourceCodeSelectiveReprocessingHelper {
13832
14446
  };
13833
14447
  entryPointsMetadata = new Map();
13834
14448
  isEntryPoint;
13835
- affiliatedFilesMetadata = new Map();
13836
- affiliatedFilesResolutionRules;
13837
- absolutePathsOfAffiliatedFilesWhichHasBeenScannedDuringCurrentPass = new Set();
14449
+ childrenFilesMetadata = new Map();
14450
+ resolvedAliasedPaths = new Map();
14451
+ childrenFilesResolutionRules;
14452
+ absolutePathsOfChildrenFilesWhichHasBeenScannedDuringCurrentPass = new Set();
14453
+ directoriesAliasesAndTheirAbsolutePatsMap;
13838
14454
  CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH;
13839
14455
  CACHED_METADATA_FILE_ABSOLUTE_PATH;
13840
14456
  TARGET_FILES_TYPE_IN_SINGULAR_FORM;
14457
+ /* ━━━ Constructor ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
13841
14458
  constructor(initializationProperties) {
13842
14459
  this.isEntryPoint = initializationProperties.isEntryPoint;
13843
- this.affiliatedFilesResolutionRules = initializationProperties.affiliatedFilesResolutionRules;
14460
+ this.childrenFilesResolutionRules = initializationProperties.childrenFilesResolutionRules;
14461
+ this.directoriesAliasesAndTheirAbsolutePatsMap =
14462
+ initializationProperties.directoriesAliasesAndTheirAbsolutePatsMap ?? new Map();
13844
14463
  this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH = initializationProperties.consumingProjectRootDirectoryAbsolutePath;
13845
14464
  this.CACHED_METADATA_FILE_ABSOLUTE_PATH = initializationProperties.cacheFileAbsolutePath;
13846
14465
  this.TARGET_FILES_TYPE_IN_SINGULAR_FORM = initializationProperties.logging.targetFilesTypeInSingularForm;
13847
- this.generateInitialMetadataMaps(new Set(initializationProperties.initialEntryPointsSourceFilesAbsolutePaths.map((entryPointFileAbsolutePath__potentiallyWithOperationingSystemDependentPathSeparators) => es_extensions_nodejs_1.ImprovedPath.replacePathSeparatorsToForwardSlashes(entryPointFileAbsolutePath__potentiallyWithOperationingSystemDependentPathSeparators))));
14466
+ /* [ Theory ] The cached metadata from previous YDA launches could be. */
14467
+ this.retrieveCacheFromFileAndApplyIfItExists();
14468
+ this.scanFilesHierarchyTreeForEntryPoints(new Set(initializationProperties.initialEntryPointsSourceFilesAbsolutePaths.map((entryPointFileAbsolutePath__potentiallyWithOperationingSystemDependentPathSeparators) => es_extensions_nodejs_1.ImprovedPath.replacePathSeparatorsToForwardSlashes(entryPointFileAbsolutePath__potentiallyWithOperationingSystemDependentPathSeparators))));
13848
14469
  if (initializationProperties.logging.mustEnable) {
13849
- this.logAffiliatedFilesAndEntryPointsRelationships();
14470
+ this.logChildrenFilesAndEntryPointsRelationships();
13850
14471
  }
13851
- this.cacheFilesMetadataMapsToFile();
14472
+ this.saveCachedFilesMetadataMapsToFile();
13852
14473
  }
13853
- getAbsolutePathsOfEntryPointsWhichMustBeProcessed(absolutePathsOfFilesWithChangesStatus) {
13854
- const absolutePathsOfEntryPointsWhichMustBeProcessed = new Set();
13855
- for (const absolutePathOfFileWithChangesStatus of absolutePathsOfFilesWithChangesStatus) {
13856
- if (this.isEntryPoint(absolutePathOfFileWithChangesStatus)) {
13857
- if (fs_1.default.existsSync(absolutePathOfFileWithChangesStatus)) {
13858
- absolutePathsOfEntryPointsWhichMustBeProcessed.add(absolutePathOfFileWithChangesStatus);
14474
+ /* ━━━ Public Methods ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
14475
+ getAbsolutePathsOfEntryPointsWhichMustBeProcessed(absolutePathsOfFilesWithChangedStatus__forwardSlashSeparators) {
14476
+ const absolutePathsOfEntryPointsWhichMustBeProcessed__forwardSlashSeparators = new Set();
14477
+ const absolutePathsOfChildrenFilesWhichParentEntryPointsMustBeProcessed__forwardSlashSeparators = new Set();
14478
+ for (const absolutePathOfFileWithChangedStatus__forwardSlashSeparators of absolutePathsOfFilesWithChangedStatus__forwardSlashSeparators) {
14479
+ const pathRelativeRelativeToConsumingProjectRootDirectoryOfFileWithChangedStatus__forwardSlashSeparators = es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
14480
+ basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
14481
+ comparedPath: absolutePathOfFileWithChangedStatus__forwardSlashSeparators,
14482
+ alwaysForwardSlashSeparators: true
14483
+ });
14484
+ if (fs_1.default.existsSync(absolutePathOfFileWithChangedStatus__forwardSlashSeparators)) {
14485
+ if (this.isEntryPoint(absolutePathOfFileWithChangedStatus__forwardSlashSeparators)) {
14486
+ absolutePathsOfEntryPointsWhichMustBeProcessed__forwardSlashSeparators.
14487
+ add(absolutePathOfFileWithChangedStatus__forwardSlashSeparators);
13859
14488
  }
13860
14489
  else {
13861
- this.entryPointsMetadata.delete(es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
13862
- basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
13863
- comparedPath: absolutePathOfFileWithChangesStatus,
13864
- alwaysForwardSlashSeparators: true
13865
- }));
14490
+ absolutePathsOfChildrenFilesWhichParentEntryPointsMustBeProcessed__forwardSlashSeparators.
14491
+ add(absolutePathOfFileWithChangedStatus__forwardSlashSeparators);
13866
14492
  }
13867
14493
  }
13868
14494
  else {
13869
- const targetAffiliatedFileRelativePath = es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
13870
- basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
13871
- comparedPath: absolutePathOfFileWithChangesStatus,
13872
- alwaysForwardSlashSeparators: true
14495
+ this.clearFileMetadataPathFromCache(pathRelativeRelativeToConsumingProjectRootDirectoryOfFileWithChangedStatus__forwardSlashSeparators);
14496
+ }
14497
+ }
14498
+ this.scanFilesHierarchyTreeForEntryPoints(absolutePathsOfEntryPointsWhichMustBeProcessed__forwardSlashSeparators);
14499
+ this.saveCachedFilesMetadataMapsToFile();
14500
+ for (const absolutePathOfChildFile__forwardSlashSeparators of absolutePathsOfChildrenFilesWhichParentEntryPointsMustBeProcessed__forwardSlashSeparators) {
14501
+ const pathOfChildFileRelativeToConsumingProjectRootDirectory__forwardSlashSeparators = es_extensions_nodejs_1.ImprovedPath.
14502
+ computeRelativePath({
14503
+ basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
14504
+ comparedPath: absolutePathOfChildFile__forwardSlashSeparators,
14505
+ alwaysForwardSlashSeparators: true
14506
+ });
14507
+ (0, es_extensions_1.addMultipleElementsToSet)(absolutePathsOfEntryPointsWhichMustBeProcessed__forwardSlashSeparators, Array.from(this.childrenFilesMetadata.get(pathOfChildFileRelativeToConsumingProjectRootDirectory__forwardSlashSeparators)?.parentEntryPointsAbsolutePaths ??
14508
+ new Set()));
14509
+ }
14510
+ return Array.from(absolutePathsOfEntryPointsWhichMustBeProcessed__forwardSlashSeparators);
14511
+ }
14512
+ /* ━━━ Private Methods ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
14513
+ /* ─── Initial Pass ─────────────────────────────────────────────────────────────────────────────────────────────── */
14514
+ retrieveCacheFromFileAndApplyIfItExists() {
14515
+ let cachedRawMetadata;
14516
+ try {
14517
+ cachedRawMetadata = es_extensions_nodejs_1.ObjectDataFilesProcessor.processFile({
14518
+ filePath: this.CACHED_METADATA_FILE_ABSOLUTE_PATH,
14519
+ validDataSpecification: SourceCodeSelectiveReprocessingHelper.cachedMetadataFileContentSpecification,
14520
+ synchronously: true
14521
+ });
14522
+ }
14523
+ catch (error) {
14524
+ if (!(error instanceof es_extensions_nodejs_1.FileNotFoundError)) {
14525
+ es_extensions_1.Logger.logError({
14526
+ mustOutputIf: true || 0,
14527
+ errorType: "CachedDataRetrievingFailedError",
14528
+ title: "Cached Data Retrieving Failed",
14529
+ description: `Unable to read the existing cache file at "${this.CACHED_METADATA_FILE_ABSOLUTE_PATH}".`,
14530
+ occurrenceLocation: "sourceCodeSelectiveReprocessingHelper.retrieveCacheFromFileAndApplyIfItExists()",
14531
+ caughtError: error
13873
14532
  });
13874
- if (fs_1.default.existsSync(absolutePathOfFileWithChangesStatus)) {
13875
- (0, es_extensions_1.addMultipleElementsToSet)(absolutePathsOfEntryPointsWhichMustBeProcessed, Array.from(this.affiliatedFilesMetadata.get(targetAffiliatedFileRelativePath)?.parentEntryPointsAbsolutePaths ?? []));
13876
- }
13877
- else {
13878
- this.affiliatedFilesMetadata.delete(targetAffiliatedFileRelativePath);
13879
- }
13880
14533
  }
14534
+ return;
14535
+ }
14536
+ for (const [entryPointPathRelativeToConsumingProjectRootDirectory, entryPointRawMetadata] of Object.entries(cachedRawMetadata.entryPoints)) {
14537
+ this.entryPointsMetadata.set(entryPointPathRelativeToConsumingProjectRootDirectory, {
14538
+ modificationDate__ISO8601: entryPointRawMetadata.modificationDate__ISO8601,
14539
+ directChildrenFilesRelativePaths: new Set(entryPointRawMetadata.directChildrenFilesRelativePaths)
14540
+ });
14541
+ }
14542
+ for (const [childFilePathRelativeToConsumingProjectRootDirectory, childFileMetadata] of Object.entries(cachedRawMetadata.childrenFiles)) {
14543
+ this.childrenFilesMetadata.set(childFilePathRelativeToConsumingProjectRootDirectory, {
14544
+ modificationDateTime__ISO8601: childFileMetadata.modificationDate__ISO8601,
14545
+ directChildrenFilesRelativePaths: new Set(childFileMetadata.directChildrenFilesRelativePaths),
14546
+ parentEntryPointsAbsolutePaths: new Set(childFileMetadata.parentEntryPointsRelativePaths.map((parentEntryPointsRelativePath) => es_extensions_nodejs_1.ImprovedPath.joinPathSegments([this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH, parentEntryPointsRelativePath], { alwaysForwardSlashSeparators: true })))
14547
+ });
13881
14548
  }
13882
- return Array.from(absolutePathsOfEntryPointsWhichMustBeProcessed);
13883
14549
  }
13884
- /* ━━━ First Mapping Since Last YDA Launch ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
13885
- /* [ Theory ] The cached metadata from previous YDA launches could be. */
13886
- generateInitialMetadataMaps(initialEntryPointsAbsolutePaths) {
13887
- this.extractCacheFromFileAndApplyIfItExists();
13888
- for (const entryPointFileAbsolutePath of initialEntryPointsAbsolutePaths) {
13889
- const entryPointDirectoryAbsolutePath = es_extensions_nodejs_1.ImprovedPath.extractDirectoryFromFilePath({
13890
- targetPath: entryPointFileAbsolutePath,
13891
- alwaysForwardSlashSeparators: true,
14550
+ /* ─── All Passes ───────────────────────────────────────────────────────────────────────────────────────────────── */
14551
+ scanFilesHierarchyTreeForEntryPoints(targetEntryPointsAbsolutePaths__forwardSlashSeparators) {
14552
+ for (const entryPointAbsolutePath__forwardSlashSeparators of targetEntryPointsAbsolutePaths__forwardSlashSeparators) {
14553
+ const entryPointDirectoryAbsolutePath__forwardSlashSeparators = es_extensions_nodejs_1.ImprovedPath.extractDirectoryFromFilePath({
14554
+ targetPath: entryPointAbsolutePath__forwardSlashSeparators,
13892
14555
  ambiguitiesResolution: {
13893
14556
  mustConsiderLastSegmentStartingWithDotAsDirectory: false,
13894
14557
  mustConsiderLastSegmentWithNonLeadingDotAsDirectory: false,
13895
14558
  mustConsiderLastSegmentWihtoutDotsAsFileNameWithoutExtension: true
13896
- }
14559
+ },
14560
+ alwaysForwardSlashSeparators: true
13897
14561
  });
13898
- const entryPointFilePathRelativeToConsumingProjectRootDirectory = es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
14562
+ const entryPointPathRelativeToConsumingProjectRootDirectory__forwardSlashSeparators = es_extensions_nodejs_1.ImprovedPath.
14563
+ computeRelativePath({
13899
14564
  basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
13900
- comparedPath: entryPointFileAbsolutePath,
14565
+ comparedPath: entryPointAbsolutePath__forwardSlashSeparators,
13901
14566
  alwaysForwardSlashSeparators: true
13902
14567
  });
13903
- let entryPointModificationDateTime__ISO8601;
14568
+ let entryPointLastModificationDateTime__ISO8601;
13904
14569
  try {
13905
- entryPointModificationDateTime__ISO8601 = fs_1.default.statSync(entryPointFileAbsolutePath).mtime.toISOString();
14570
+ entryPointLastModificationDateTime__ISO8601 = fs_1.default.statSync(entryPointAbsolutePath__forwardSlashSeparators).
14571
+ mtime.
14572
+ toISOString();
13906
14573
  }
13907
14574
  catch (error) {
13908
14575
  if ((0, es_extensions_nodejs_1.isErrnoException)(error) && error.code === "ENOENT") {
13909
- this.entryPointsMetadata.delete(entryPointFilePathRelativeToConsumingProjectRootDirectory);
14576
+ this.entryPointsMetadata.delete(entryPointPathRelativeToConsumingProjectRootDirectory__forwardSlashSeparators);
13910
14577
  continue;
13911
14578
  }
13912
14579
  es_extensions_1.Logger.logError({
13913
14580
  mustOutputIf: true || 0,
13914
14581
  errorType: "FileStatisticsRetrievingFailedError",
13915
14582
  title: "File Statistics Retrieving Failed Error",
13916
- description: `Unable to retrieve the statistics of file "${entryPointFilePathRelativeToConsumingProjectRootDirectory}". ` +
14583
+ description: "Unable to retrieve the statistics of file " +
14584
+ `"${entryPointPathRelativeToConsumingProjectRootDirectory__forwardSlashSeparators}". ` +
13917
14585
  "This file will not be mapped.",
13918
- occurrenceLocation: "sourceCodeSelectiveReprocessingHelper.generateInitialMetadataMaps()",
14586
+ occurrenceLocation: "sourceCodeSelectiveReprocessingHelper." +
14587
+ "scanFilesHierarchyTreeForEntryPoints(targetEntryPointsAbsolutePaths__forwardSlashSeparators)",
13919
14588
  caughtError: error
13920
14589
  });
13921
14590
  continue;
13922
14591
  }
13923
- const cachedMetadataOfCurrentEntryPoint = this.entryPointsMetadata.get(entryPointFilePathRelativeToConsumingProjectRootDirectory);
13924
- let absolutePathsOfDirectExistingAffiliatedFilesOfCurrentEntryPoint;
13925
- if (cachedMetadataOfCurrentEntryPoint?.modificationDate__ISO8601 === entryPointModificationDateTime__ISO8601) {
13926
- /* [ Theory ] Although the entry point file is existing and has not changed since last mapping, its affiliated
13927
- * files could be added or deleted. */
13928
- absolutePathsOfDirectExistingAffiliatedFilesOfCurrentEntryPoint = new Set();
13929
- for (const relativePathOfAffiliatedFileOfCurrentEntryPoint of cachedMetadataOfCurrentEntryPoint.directAffiliatedFilesRelativePaths) {
13930
- const absolutePathOfAffiliatedFileOfCurrentEntryPoint = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH, relativePathOfAffiliatedFileOfCurrentEntryPoint], { alwaysForwardSlashSeparators: true });
13931
- if (!fs_1.default.existsSync(absolutePathOfAffiliatedFileOfCurrentEntryPoint)) {
13932
- cachedMetadataOfCurrentEntryPoint.directAffiliatedFilesRelativePaths.
13933
- delete(relativePathOfAffiliatedFileOfCurrentEntryPoint);
14592
+ let cachedMetadataOfCurrentEntryPoint = this.entryPointsMetadata.get(entryPointPathRelativeToConsumingProjectRootDirectory__forwardSlashSeparators);
14593
+ let absolutePathsOfExistingDirectChildrenFilesOfCurrentEntryPoint__forwardSlashSeparators = new Set();
14594
+ /* [ Theory ] This condition will could be truthy (but not always) only on initial pass. */
14595
+ if (cachedMetadataOfCurrentEntryPoint?.modificationDate__ISO8601 === entryPointLastModificationDateTime__ISO8601) {
14596
+ /* [ Theory ]
14597
+ * Although the entry point file is existing and has not changed since last scan, its children files could
14598
+ * be added or deleted. */
14599
+ for (const pathRelativeToConsumingProjectRootDirectoryOfChildFileOfCurrentEntryPoint__forwardSlashSeparators of cachedMetadataOfCurrentEntryPoint.directChildrenFilesRelativePaths) {
14600
+ const absolutePathOfChildFileOfCurrentEntryPoint__forwardSlashSeparators = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
14601
+ this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
14602
+ pathRelativeToConsumingProjectRootDirectoryOfChildFileOfCurrentEntryPoint__forwardSlashSeparators
14603
+ ], { alwaysForwardSlashSeparators: true });
14604
+ if (!fs_1.default.existsSync(absolutePathOfChildFileOfCurrentEntryPoint__forwardSlashSeparators)) {
14605
+ this.clearFileMetadataPathFromCache(pathRelativeToConsumingProjectRootDirectoryOfChildFileOfCurrentEntryPoint__forwardSlashSeparators);
13934
14606
  }
13935
- absolutePathsOfDirectExistingAffiliatedFilesOfCurrentEntryPoint = new Set(Array.from(cachedMetadataOfCurrentEntryPoint.directAffiliatedFilesRelativePaths));
14607
+ absolutePathsOfExistingDirectChildrenFilesOfCurrentEntryPoint__forwardSlashSeparators = new Set(Array.from(cachedMetadataOfCurrentEntryPoint.directChildrenFilesRelativePaths));
13936
14608
  }
13937
14609
  }
13938
14610
  else {
13939
- absolutePathsOfDirectExistingAffiliatedFilesOfCurrentEntryPoint = this.
13940
- getAbsolutePathsOfExistingAffiliatedFilesOfExistingUpdatedTargetOne({
13941
- targetFileAbsolutePath: entryPointFileAbsolutePath,
13942
- targetFileDirectoryAbsolutePath: entryPointDirectoryAbsolutePath
14611
+ /* [ Maintainability ] Keep this variable for debugging. */
14612
+ absolutePathsOfExistingDirectChildrenFilesOfCurrentEntryPoint__forwardSlashSeparators = this.
14613
+ getAbsolutePathsOfExistingChildrenFilesOfExistingTargetFile__forwardSlashSeparators({
14614
+ targetFileAbsolutePath__forwardSlashSeparators: entryPointAbsolutePath__forwardSlashSeparators,
14615
+ preComputedTargetFileDirectoryAbsolutePath__forwardSlashSeparators: entryPointDirectoryAbsolutePath__forwardSlashSeparators
13943
14616
  });
13944
- this.entryPointsMetadata.set(entryPointFilePathRelativeToConsumingProjectRootDirectory, {
13945
- modificationDate__ISO8601: entryPointModificationDateTime__ISO8601,
13946
- directAffiliatedFilesRelativePaths: (0, es_extensions_1.createSetBasedOnOtherSet)(absolutePathsOfDirectExistingAffiliatedFilesOfCurrentEntryPoint, (absolutePathOfExistingAffiliatedFileOfCurrentEntryPoint) => es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
14617
+ cachedMetadataOfCurrentEntryPoint = {
14618
+ modificationDate__ISO8601: entryPointLastModificationDateTime__ISO8601,
14619
+ directChildrenFilesRelativePaths: (0, es_extensions_1.createSetBasedOnOtherSet)(absolutePathsOfExistingDirectChildrenFilesOfCurrentEntryPoint__forwardSlashSeparators, (absolutePathOfExistingDirectChildFileOfCurrentEntryPoint__forwardSlashSeparators) => es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
13947
14620
  basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
13948
- comparedPath: absolutePathOfExistingAffiliatedFileOfCurrentEntryPoint,
14621
+ comparedPath: absolutePathOfExistingDirectChildFileOfCurrentEntryPoint__forwardSlashSeparators,
13949
14622
  alwaysForwardSlashSeparators: true
13950
14623
  }))
13951
- });
14624
+ };
14625
+ this.entryPointsMetadata.set(entryPointPathRelativeToConsumingProjectRootDirectory__forwardSlashSeparators, cachedMetadataOfCurrentEntryPoint);
13952
14626
  }
13953
14627
  es_extensions_1.Logger.logGeneric({
13954
14628
  mustOutputIf: SourceCodeSelectiveReprocessingHelper.DEBUGGING_MODE,
13955
14629
  badge: { customText: "Debug" },
13956
- title: "SourceCodeSelectiveReprocessingHelper, entry point has been analyzed.",
13957
- description: `The metadata of entry point "${entryPointFilePathRelativeToConsumingProjectRootDirectory}" ` +
13958
- `has been is:\n${(0, es_extensions_1.stringifyAndFormatArbitraryValue)(this.entryPointsMetadata)}\n`
13959
- });
13960
- for (const absolutePathOfDirectExistingAffiliatedFileOfCurrentEntryPoint of absolutePathsOfDirectExistingAffiliatedFilesOfCurrentEntryPoint) {
13961
- this.updateMetadataMapForExistingAffiliatedFile({
13962
- targetAffiliatedFileAbsolutePath: absolutePathOfDirectExistingAffiliatedFileOfCurrentEntryPoint,
13963
- parentEntryPointAbsolutePath: entryPointFileAbsolutePath
13964
- });
13965
- this.absolutePathsOfAffiliatedFilesWhichHasBeenScannedDuringCurrentPass.
13966
- add(absolutePathOfDirectExistingAffiliatedFileOfCurrentEntryPoint);
13967
- }
13968
- }
13969
- this.absolutePathsOfAffiliatedFilesWhichHasBeenScannedDuringCurrentPass.clear();
13970
- }
13971
- extractCacheFromFileAndApplyIfItExists() {
13972
- let cachedRawMetadata;
13973
- try {
13974
- cachedRawMetadata = es_extensions_nodejs_1.ObjectDataFilesProcessor.processFile({
13975
- filePath: this.CACHED_METADATA_FILE_ABSOLUTE_PATH,
13976
- validDataSpecification: SourceCodeSelectiveReprocessingHelper.cachedMetadataFileContentSpecification,
13977
- synchronously: true
14630
+ title: "SourceCodeSelectiveReprocessingHelper, Entry Point Analysis Complete.",
14631
+ description: entryPointPathRelativeToConsumingProjectRootDirectory__forwardSlashSeparators,
14632
+ additionalData: cachedMetadataOfCurrentEntryPoint
13978
14633
  });
13979
- }
13980
- catch (error) {
13981
- if (!(error instanceof es_extensions_nodejs_1.FileNotFoundError)) {
13982
- es_extensions_1.Logger.logError({
13983
- mustOutputIf: true || 0,
13984
- errorType: "CachedDataRetrievingFailure",
13985
- title: "Cached Data Retrieving Failure",
13986
- description: `Unable to read the existing cache file "${this.CACHED_METADATA_FILE_ABSOLUTE_PATH}".`,
13987
- occurrenceLocation: "sourceCodeSelectiveReprocessingHelper.extractCacheFromFileAndApplyIfItExists()",
13988
- caughtError: error
14634
+ for (const absolutePathOfDirectExistingChildFileOfCurrentEntryPoint__forwardSlashSeparators of absolutePathsOfExistingDirectChildrenFilesOfCurrentEntryPoint__forwardSlashSeparators) {
14635
+ this.updateMetadataForExistingChildFile({
14636
+ targetChildFileAbsolutePath__forwardSlashSeparators: absolutePathOfDirectExistingChildFileOfCurrentEntryPoint__forwardSlashSeparators,
14637
+ parentEntryPointAbsolutePath__forwardSlashSeparators: entryPointAbsolutePath__forwardSlashSeparators
13989
14638
  });
14639
+ this.absolutePathsOfChildrenFilesWhichHasBeenScannedDuringCurrentPass.
14640
+ add(absolutePathOfDirectExistingChildFileOfCurrentEntryPoint__forwardSlashSeparators);
13990
14641
  }
13991
- return;
13992
- }
13993
- for (const [entryPointPathRelativeToConsumingProjectRootDirectory, entryPointRawMetadata] of Object.entries(cachedRawMetadata.entryPoints)) {
13994
- this.entryPointsMetadata.set(entryPointPathRelativeToConsumingProjectRootDirectory, {
13995
- modificationDate__ISO8601: entryPointRawMetadata.modificationDate__ISO8601,
13996
- directAffiliatedFilesRelativePaths: new Set(entryPointRawMetadata.directAffiliatedFilesRelativePaths)
13997
- });
13998
- }
13999
- for (const [affiliatedFilePathRelativeToConsumingProjectRootDirectory, affiliatedFileMetadata] of Object.entries(cachedRawMetadata.affiliatedFiles)) {
14000
- this.affiliatedFilesMetadata.set(affiliatedFilePathRelativeToConsumingProjectRootDirectory, {
14001
- modificationDateTime__ISO8601: affiliatedFileMetadata.modificationDate__ISO8601,
14002
- directAffiliatedFilesRelativePaths: new Set(affiliatedFileMetadata.directAffiliatedFilesRelativePaths),
14003
- parentEntryPointsAbsolutePaths: new Set(affiliatedFileMetadata.parentEntryPointsRelativePaths.map((parentEntryPointsRelativePath) => es_extensions_nodejs_1.ImprovedPath.joinPathSegments([this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH, parentEntryPointsRelativePath], { alwaysForwardSlashSeparators: true })))
14004
- });
14005
14642
  }
14643
+ this.absolutePathsOfChildrenFilesWhichHasBeenScannedDuringCurrentPass.clear();
14006
14644
  }
14007
- getAbsolutePathsOfExistingAffiliatedFilesOfExistingUpdatedTargetOne({ targetFileAbsolutePath, targetFileDirectoryAbsolutePath }) {
14008
- const absolutePathsOfExistingAffiliatedFilesOfTargetOne = new Set();
14645
+ /* [ Approach ] The target file could be either entry point or not. */
14646
+ getAbsolutePathsOfExistingChildrenFilesOfExistingTargetFile__forwardSlashSeparators({ targetFileAbsolutePath__forwardSlashSeparators, preComputedTargetFileDirectoryAbsolutePath__forwardSlashSeparators }) {
14647
+ const absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators = new Set();
14009
14648
  let fileContent;
14010
14649
  try {
14011
- fileContent = fs_1.default.readFileSync(targetFileAbsolutePath, "utf-8");
14650
+ fileContent = fs_1.default.readFileSync(targetFileAbsolutePath__forwardSlashSeparators, "utf-8");
14012
14651
  }
14013
14652
  catch (error) {
14014
14653
  if ((0, es_extensions_nodejs_1.isErrnoException)(error) && error.code === "ENOENT") {
@@ -14016,231 +14655,291 @@ class SourceCodeSelectiveReprocessingHelper {
14016
14655
  mustOutputIf: true || 0,
14017
14656
  errorType: es_extensions_1.UnexpectedEventError.NAME,
14018
14657
  title: es_extensions_1.UnexpectedEventError.localization.defaultTitle,
14019
- description: `The existence of the file "${targetFileAbsolutePath}" has been confirmed one moment ago ` +
14020
- "but suddenly disappeared during reading. Skipping this file.",
14658
+ description: `Contrary to expectations, "${targetFileAbsolutePath__forwardSlashSeparators}" file does not exist. ` +
14659
+ "Skipping this file.",
14021
14660
  occurrenceLocation: "sourceCodeSelectiveReprocessingHelper." +
14022
- "getAbsolutePathsOfExistingAffiliatedFilesOfExistingUpdatedTargetOne(compoundParameter)",
14661
+ "getAbsolutePathsOfExistingChildrenFilesOfExistingTargetFile__forwardSlashSeparators(compoundParameter)",
14023
14662
  caughtError: error
14024
14663
  });
14025
- return absolutePathsOfExistingAffiliatedFilesOfTargetOne;
14664
+ return absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators;
14026
14665
  }
14027
14666
  es_extensions_1.Logger.logError({
14028
14667
  mustOutputIf: true || 0,
14029
14668
  errorType: es_extensions_1.FileReadingFailedError.NAME,
14030
14669
  title: es_extensions_1.FileReadingFailedError.localization.defaultTitle,
14031
- description: es_extensions_1.FileReadingFailedError.localization.generateDescription({ filePath: targetFileAbsolutePath }),
14670
+ description: es_extensions_1.FileReadingFailedError.localization.
14671
+ generateDescription({ filePath: targetFileAbsolutePath__forwardSlashSeparators }),
14032
14672
  occurrenceLocation: "sourceCodeSelectiveReprocessingHelper." +
14033
- "getAbsolutePathsOfExistingAffiliatedFilesOfExistingUpdatedTargetOne(compoundParameter)",
14673
+ "getAbsolutePathsOfExistingChildrenFilesOfExistingTargetFile__forwardSlashSeparators(compoundParameter)",
14034
14674
  caughtError: error
14035
14675
  });
14036
- return absolutePathsOfExistingAffiliatedFilesOfTargetOne;
14676
+ return absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators;
14037
14677
  }
14038
- for (const fileIncludingDeclarationPattern of this.affiliatedFilesResolutionRules.affiliatedFilesIncludingDeclarationsPatterns) {
14678
+ for (const fileIncludingDeclarationPattern of this.childrenFilesResolutionRules.childrenFilesIncludingDeclarationsPatterns) {
14039
14679
  /* [ Theory ] Same file could be included for the multiple times.
14040
14680
  * Occasionally it is even meaningful, but we are not need the duplicated here. */
14041
- const affiliatedFilesRawPaths = new Set(Array.from(fileContent.matchAll(fileIncludingDeclarationPattern)).
14681
+ const childrenFilesRawPaths = new Set(Array.from(fileContent.matchAll(fileIncludingDeclarationPattern)).
14042
14682
  map((regularExpressionMatchingData) => regularExpressionMatchingData[1]).
14043
- filter((affiliatedFileRawPath) => (0, es_extensions_1.isNonEmptyString)(affiliatedFileRawPath)));
14044
- for (const affiliatedFileRawPath of affiliatedFilesRawPaths) {
14045
- const affiliatedFileNormalizedPath = this.computeAbsolutePathOfAffiliatedFileIfItExists({
14046
- affiliatedFileRawPath,
14047
- parentFileDirectoryAbsolutePath: targetFileDirectoryAbsolutePath
14683
+ filter((childFileRawPath) => (0, es_extensions_1.isNonEmptyString)(childFileRawPath)));
14684
+ const targetChildFileDirectoryAbsolutePath__forwardSlashSeparators = preComputedTargetFileDirectoryAbsolutePath__forwardSlashSeparators ??
14685
+ es_extensions_nodejs_1.ImprovedPath.extractDirectoryFromFilePath({
14686
+ targetPath: targetFileAbsolutePath__forwardSlashSeparators,
14687
+ ambiguitiesResolution: {
14688
+ mustConsiderLastSegmentStartingWithDotAsDirectory: false,
14689
+ mustConsiderLastSegmentWithNonLeadingDotAsDirectory: false,
14690
+ mustConsiderLastSegmentWihtoutDotsAsFileNameWithoutExtension: true
14691
+ },
14692
+ alwaysForwardSlashSeparators: true
14693
+ });
14694
+ for (const childFileRawPath of childrenFilesRawPaths) {
14695
+ const childFileNormalizedPath = this.computeAbsolutePathOfChildFileIfItExists({
14696
+ childFileRawPath,
14697
+ parentFileDirectoryAbsolutePath__forwardSlashSeparators: targetChildFileDirectoryAbsolutePath__forwardSlashSeparators
14048
14698
  });
14049
- if ((0, es_extensions_1.isNotNull)(affiliatedFileNormalizedPath)) {
14050
- absolutePathsOfExistingAffiliatedFilesOfTargetOne.add(affiliatedFileNormalizedPath);
14699
+ if ((0, es_extensions_1.isNotNull)(childFileNormalizedPath)) {
14700
+ absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators.add(childFileNormalizedPath);
14051
14701
  }
14052
14702
  }
14053
14703
  }
14054
- return absolutePathsOfExistingAffiliatedFilesOfTargetOne;
14704
+ return absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators;
14055
14705
  }
14056
- updateMetadataMapForExistingAffiliatedFile({ targetAffiliatedFileAbsolutePath, parentEntryPointAbsolutePath }) {
14057
- const targetAffiliatedFileRelativePath = es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
14706
+ computeAbsolutePathOfChildFileIfItExists({ childFileRawPath, parentFileDirectoryAbsolutePath__forwardSlashSeparators }) {
14707
+ let possibleIntermediatePathsOfChildFileWithResolvedAlias = new Set();
14708
+ const segmentsOfChildFileRawPath = es_extensions_nodejs_1.ImprovedPath.explodePathToSegments(childFileRawPath);
14709
+ const firstSegmentOfChildFileRawPath = segmentsOfChildFileRawPath[0];
14710
+ if ((0, es_extensions_1.isNonEmptyString)(firstSegmentOfChildFileRawPath)) {
14711
+ possibleIntermediatePathsOfChildFileWithResolvedAlias = (0, es_extensions_1.createSetBasedOnOtherSet)(this.directoriesAliasesAndTheirAbsolutePatsMap.get(firstSegmentOfChildFileRawPath) ?? new Set(), (absolutePathOfDirectoryOnWhichAliasedFirstPathSegmentCouldRefer) => es_extensions_nodejs_1.ImprovedPath.joinPathSegments((0, es_extensions_1.replaceArrayElementsByIndexesImmutably)({
14712
+ targetArray: segmentsOfChildFileRawPath,
14713
+ index: 0,
14714
+ newElement: absolutePathOfDirectoryOnWhichAliasedFirstPathSegmentCouldRefer
14715
+ }), { alwaysForwardSlashSeparators: true }));
14716
+ }
14717
+ let isChildFileRawPathAliased;
14718
+ if (possibleIntermediatePathsOfChildFileWithResolvedAlias.size > 0) {
14719
+ const previouslyResolvedPathFromAliasedOne = this.resolvedAliasedPaths.get(childFileRawPath);
14720
+ if ((0, es_extensions_1.isString)(previouslyResolvedPathFromAliasedOne)) {
14721
+ try {
14722
+ if (fs_1.default.existsSync(previouslyResolvedPathFromAliasedOne)) {
14723
+ return previouslyResolvedPathFromAliasedOne;
14724
+ }
14725
+ }
14726
+ catch (error) {
14727
+ if (true) {
14728
+ es_extensions_1.Logger.logError({
14729
+ errorType: "FileCheckingError",
14730
+ title: "File Checking Error",
14731
+ description: `The error occurred during the checking of the file ${previouslyResolvedPathFromAliasedOne}` +
14732
+ "for existence.",
14733
+ occurrenceLocation: "sourceCodeSelectiveReprocessingHelper." +
14734
+ "computeAbsolutePathOfChildFileIfItExists(compoundParameter)",
14735
+ caughtError: error
14736
+ });
14737
+ }
14738
+ }
14739
+ this.resolvedAliasedPaths.delete(childFileRawPath);
14740
+ }
14741
+ isChildFileRawPathAliased = true;
14742
+ }
14743
+ else {
14744
+ isChildFileRawPathAliased = false;
14745
+ possibleIntermediatePathsOfChildFileWithResolvedAlias = new Set([childFileRawPath]);
14746
+ }
14747
+ const possibleAbsolutePathsOfTargetChildFile__forwardSlashSeparators = new Set();
14748
+ const explicitlySpecifiedLastFileNameExtensionInChildrenFileRawPath = (0, es_extensions_1.extractLastExtensionOfFileName)({ targetPath: childFileRawPath, withLeadingDot: false });
14749
+ /* [ Approach ]
14750
+ * The second condition of if-branch is aimed to the processing of paths with multiple files names extensions.
14751
+ * For example, in the Pug preprocessor case, the file "ProductCard.static.pug" could be referred as
14752
+ * `include ProductCard.static`. */
14753
+ if ((0, es_extensions_1.isNull)(explicitlySpecifiedLastFileNameExtensionInChildrenFileRawPath) ||
14754
+ !this.childrenFilesResolutionRules.implicitFilesNamesExtensionsWithoutLeadingDotsOfChildrenFiles.
14755
+ includes(explicitlySpecifiedLastFileNameExtensionInChildrenFileRawPath)) {
14756
+ for (const possibleIntermediatePathOfChildFileWithResolvedAlias of possibleIntermediatePathsOfChildFileWithResolvedAlias) {
14757
+ (0, es_extensions_1.addMultipleElementsToSet)(possibleAbsolutePathsOfTargetChildFile__forwardSlashSeparators, this.childrenFilesResolutionRules.implicitFilesNamesExtensionsWithoutLeadingDotsOfChildrenFiles.map((childFileNameImplicitExtension) => es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
14758
+ ...path_1.default.isAbsolute(possibleIntermediatePathOfChildFileWithResolvedAlias) ?
14759
+ [] : [parentFileDirectoryAbsolutePath__forwardSlashSeparators],
14760
+ `${possibleIntermediatePathOfChildFileWithResolvedAlias}.${childFileNameImplicitExtension}`
14761
+ ], { alwaysForwardSlashSeparators: true })));
14762
+ }
14763
+ }
14764
+ else {
14765
+ for (const possibleIntermediatePathOfChildFileWithResolvedAlias of possibleIntermediatePathsOfChildFileWithResolvedAlias) {
14766
+ possibleAbsolutePathsOfTargetChildFile__forwardSlashSeparators.add(es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
14767
+ ...path_1.default.isAbsolute(possibleIntermediatePathOfChildFileWithResolvedAlias) ?
14768
+ [] : [parentFileDirectoryAbsolutePath__forwardSlashSeparators],
14769
+ possibleIntermediatePathOfChildFileWithResolvedAlias
14770
+ ], { alwaysForwardSlashSeparators: true }));
14771
+ }
14772
+ }
14773
+ for (const possibleAbsolutePathOfTargetChildFile of possibleAbsolutePathsOfTargetChildFile__forwardSlashSeparators) {
14774
+ try {
14775
+ if (fs_1.default.existsSync(possibleAbsolutePathOfTargetChildFile)) {
14776
+ if (isChildFileRawPathAliased) {
14777
+ this.resolvedAliasedPaths.set(childFileRawPath, possibleAbsolutePathOfTargetChildFile);
14778
+ }
14779
+ return possibleAbsolutePathOfTargetChildFile;
14780
+ }
14781
+ }
14782
+ catch (error) {
14783
+ if (true) {
14784
+ es_extensions_1.Logger.logError({
14785
+ errorType: "FileCheckingError",
14786
+ title: "File Checking Error",
14787
+ description: `The error occurred during the checking of the file ${possibleAbsolutePathOfTargetChildFile}` +
14788
+ "for existence.",
14789
+ occurrenceLocation: "sourceCodeSelectiveReprocessingHelper." +
14790
+ "computeAbsolutePathOfChildFileIfItExists(compoundParameter)",
14791
+ caughtError: error
14792
+ });
14793
+ }
14794
+ return null;
14795
+ }
14796
+ }
14797
+ return null;
14798
+ }
14799
+ updateMetadataForExistingChildFile({ targetChildFileAbsolutePath__forwardSlashSeparators, parentEntryPointAbsolutePath__forwardSlashSeparators }) {
14800
+ const targetChildFileRelativePath__forwardSlashSeparators = es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
14058
14801
  basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
14059
- comparedPath: targetAffiliatedFileAbsolutePath,
14802
+ comparedPath: targetChildFileAbsolutePath__forwardSlashSeparators,
14060
14803
  alwaysForwardSlashSeparators: true
14061
14804
  });
14062
- const cachedMetadataOfCurrentAffiliatedFile = this.affiliatedFilesMetadata.get(targetAffiliatedFileRelativePath);
14805
+ const cachedMetadataOfCurrentChildFile = this.childrenFilesMetadata.get(targetChildFileRelativePath__forwardSlashSeparators);
14063
14806
  es_extensions_1.Logger.logGeneric({
14064
14807
  mustOutputIf: SourceCodeSelectiveReprocessingHelper.DEBUGGING_MODE,
14065
14808
  badge: { customText: "Debug" },
14066
- title: "SourceCodeSelectiveReprocessingHelper, updating of affiliated files metadata map.",
14067
- description: `The metadata of affiliated file "${targetAffiliatedFileRelativePath}" .\n`,
14809
+ title: "SourceCodeSelectiveReprocessingHelper, Updating of Children Files Metadata",
14810
+ description: targetChildFileRelativePath__forwardSlashSeparators,
14068
14811
  additionalData: {
14069
- absolutePathsOfAffiliatedFilesWhichHasBeenScannedDuringCurrentPass: this.absolutePathsOfAffiliatedFilesWhichHasBeenScannedDuringCurrentPass
14812
+ absolutePathsOfAffiliatedFilesWhichHasBeenScannedDuringCurrentPass: this.absolutePathsOfChildrenFilesWhichHasBeenScannedDuringCurrentPass
14070
14813
  }
14071
14814
  });
14072
- /* [ Approach ] If the file has been scanned it must be in the cache however for the TypeScript type checking
14073
- * the non-undefined check of "cachedMetadataOfCurrentAffiliatedFile" additionally required. */
14074
- if (this.absolutePathsOfAffiliatedFilesWhichHasBeenScannedDuringCurrentPass.has(targetAffiliatedFileRelativePath) &&
14075
- (0, es_extensions_1.isNotUndefined)(cachedMetadataOfCurrentAffiliatedFile)) {
14076
- cachedMetadataOfCurrentAffiliatedFile.parentEntryPointsAbsolutePaths.add(parentEntryPointAbsolutePath);
14815
+ /* [ Approach ] If the child file has been scanned it must be in the `childrenFilesMetadata` however for the
14816
+ * TypeScript type checking the non-undefined check of "cachedMetadataOfCurrentAffiliatedFile" additionally
14817
+ * required. */
14818
+ if (this.absolutePathsOfChildrenFilesWhichHasBeenScannedDuringCurrentPass.
14819
+ has(targetChildFileRelativePath__forwardSlashSeparators) &&
14820
+ (0, es_extensions_1.isNotUndefined)(cachedMetadataOfCurrentChildFile)) {
14821
+ cachedMetadataOfCurrentChildFile.parentEntryPointsAbsolutePaths.
14822
+ add(parentEntryPointAbsolutePath__forwardSlashSeparators);
14077
14823
  this.registerEntryPointAsParentTo({
14078
- cachedMetadataOfCurrentAffiliatedFile,
14079
- parentEntryPointAbsolutePath
14824
+ cachedMetadataOfTargetChildFile: cachedMetadataOfCurrentChildFile,
14825
+ parentEntryPointAbsolutePath__forwardSlashSeparators
14080
14826
  });
14081
14827
  return;
14082
14828
  }
14083
- let targetAffiliatedFileModificationDateTime__ISO8601;
14829
+ let targetChildFileModificationDateTime__ISO8601;
14084
14830
  try {
14085
- targetAffiliatedFileModificationDateTime__ISO8601 = fs_1.default.
14086
- statSync(targetAffiliatedFileAbsolutePath).mtime.toISOString();
14831
+ targetChildFileModificationDateTime__ISO8601 = fs_1.default.
14832
+ statSync(targetChildFileAbsolutePath__forwardSlashSeparators).mtime.toISOString();
14087
14833
  }
14088
14834
  catch (error) {
14089
14835
  es_extensions_1.Logger.logError({
14090
14836
  errorType: "FileStatisticsRetrievingFailedError",
14091
- title: "File statistics retrieving failed error",
14092
- description: `Unable to retrieve the statistics of file "${targetAffiliatedFileAbsolutePath}". ` +
14837
+ title: "File Statistics Retrieving Failed Error",
14838
+ description: `Unable to retrieve the statistics of file "${targetChildFileAbsolutePath__forwardSlashSeparators}". ` +
14093
14839
  "This file will not be mapped.",
14094
- occurrenceLocation: "sourceCodeSelectiveReprocessingHelper." +
14095
- "updateMetadataMapForExistingAffiliatedFile(propertiesObject)",
14840
+ occurrenceLocation: "sourceCodeSelectiveReprocessingHelper.updateMetadataForExistingChildFile(compoundParameter)",
14096
14841
  caughtError: error
14097
14842
  });
14098
14843
  return;
14099
14844
  }
14100
- let absolutePathsOfExistingAffiliatedFilesOfTargetOne;
14101
- if ((0, es_extensions_1.isNotUndefined)(cachedMetadataOfCurrentAffiliatedFile) &&
14102
- cachedMetadataOfCurrentAffiliatedFile.modificationDateTime__ISO8601 === targetAffiliatedFileModificationDateTime__ISO8601) {
14103
- absolutePathsOfExistingAffiliatedFilesOfTargetOne = new Set();
14104
- /* [ Theory ] Although the affiliated file is existing and has not changed since last mapping, its affiliated
14845
+ let absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators;
14846
+ if (cachedMetadataOfCurrentChildFile?.modificationDateTime__ISO8601 === targetChildFileModificationDateTime__ISO8601) {
14847
+ absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators = new Set();
14848
+ /* [ Theory ] Although the children file is existing and has not changed since last mapping, its children
14105
14849
  * files could be added or deleted. */
14106
- for (const relativePathOfAffiliatedFileOfCurrentOne of cachedMetadataOfCurrentAffiliatedFile.directAffiliatedFilesRelativePaths) {
14107
- const absolutePathOfAffiliatedFileOfCurrentOne = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH, relativePathOfAffiliatedFileOfCurrentOne], { alwaysForwardSlashSeparators: true });
14108
- if (!fs_1.default.existsSync(absolutePathOfAffiliatedFileOfCurrentOne)) {
14109
- cachedMetadataOfCurrentAffiliatedFile.directAffiliatedFilesRelativePaths.
14110
- delete(relativePathOfAffiliatedFileOfCurrentOne);
14850
+ for (const relativePathOfChildFileOfCurrentOne of cachedMetadataOfCurrentChildFile.directChildrenFilesRelativePaths) {
14851
+ const absolutePathOfChildFileOfCurrentOne__forwardSlashSeparators = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH, relativePathOfChildFileOfCurrentOne], { alwaysForwardSlashSeparators: true });
14852
+ if (!fs_1.default.existsSync(absolutePathOfChildFileOfCurrentOne__forwardSlashSeparators)) {
14853
+ cachedMetadataOfCurrentChildFile.directChildrenFilesRelativePaths.delete(relativePathOfChildFileOfCurrentOne);
14111
14854
  }
14112
- absolutePathsOfExistingAffiliatedFilesOfTargetOne = new Set(Array.from(cachedMetadataOfCurrentAffiliatedFile.directAffiliatedFilesRelativePaths));
14855
+ absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators = new Set(Array.from(cachedMetadataOfCurrentChildFile.directChildrenFilesRelativePaths));
14113
14856
  }
14114
- cachedMetadataOfCurrentAffiliatedFile.parentEntryPointsAbsolutePaths.add(parentEntryPointAbsolutePath);
14857
+ cachedMetadataOfCurrentChildFile.parentEntryPointsAbsolutePaths.
14858
+ add(parentEntryPointAbsolutePath__forwardSlashSeparators);
14115
14859
  }
14116
14860
  else {
14117
- absolutePathsOfExistingAffiliatedFilesOfTargetOne = this.
14118
- getAbsolutePathsOfExistingAffiliatedFilesOfExistingUpdatedTargetOne({
14119
- targetFileAbsolutePath: targetAffiliatedFileAbsolutePath,
14120
- targetFileDirectoryAbsolutePath: es_extensions_nodejs_1.ImprovedPath.extractDirectoryFromFilePath({
14121
- targetPath: targetAffiliatedFileAbsolutePath,
14122
- alwaysForwardSlashSeparators: true,
14123
- ambiguitiesResolution: {
14124
- mustConsiderLastSegmentStartingWithDotAsDirectory: false,
14125
- mustConsiderLastSegmentWithNonLeadingDotAsDirectory: false,
14126
- mustConsiderLastSegmentWihtoutDotsAsFileNameWithoutExtension: true
14127
- }
14128
- })
14861
+ absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators = this.
14862
+ getAbsolutePathsOfExistingChildrenFilesOfExistingTargetFile__forwardSlashSeparators({
14863
+ targetFileAbsolutePath__forwardSlashSeparators: targetChildFileAbsolutePath__forwardSlashSeparators
14129
14864
  });
14130
- this.affiliatedFilesMetadata.set(targetAffiliatedFileRelativePath, {
14131
- parentEntryPointsAbsolutePaths: new Set([parentEntryPointAbsolutePath]),
14132
- modificationDateTime__ISO8601: targetAffiliatedFileModificationDateTime__ISO8601,
14133
- directAffiliatedFilesRelativePaths: (0, es_extensions_1.createSetBasedOnOtherSet)(absolutePathsOfExistingAffiliatedFilesOfTargetOne, (absolutePathOfExistingAffiliatedFileOfCurrentOne) => es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
14865
+ this.childrenFilesMetadata.set(targetChildFileRelativePath__forwardSlashSeparators, {
14866
+ parentEntryPointsAbsolutePaths: new Set([parentEntryPointAbsolutePath__forwardSlashSeparators]),
14867
+ modificationDateTime__ISO8601: targetChildFileModificationDateTime__ISO8601,
14868
+ directChildrenFilesRelativePaths: (0, es_extensions_1.createSetBasedOnOtherSet)(absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators, (absolutePathOfExistingAffiliatedFileOfCurrentOne) => es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
14134
14869
  basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
14135
14870
  comparedPath: absolutePathOfExistingAffiliatedFileOfCurrentOne,
14136
14871
  alwaysForwardSlashSeparators: true
14137
14872
  }))
14138
14873
  });
14139
14874
  }
14140
- this.absolutePathsOfAffiliatedFilesWhichHasBeenScannedDuringCurrentPass.add(targetAffiliatedFileRelativePath);
14141
- if (SourceCodeSelectiveReprocessingHelper.DEBUGGING_MODE) {
14142
- es_extensions_1.Logger.logInfo({
14143
- badge: { customText: "Debug" },
14144
- title: "SourceCodeSelectiveReprocessingHelper, affiliated files scanning complete.",
14145
- description: `The metadata of affiliated file "${targetAffiliatedFileRelativePath}"has been updated.\n`,
14146
- additionalData: {
14147
- affiliatedFilesMetadata: this.affiliatedFilesMetadata
14148
- }
14149
- });
14150
- }
14151
- for (const absolutePathOfExistingAffiliatedFileOfTargetOne of absolutePathsOfExistingAffiliatedFilesOfTargetOne) {
14152
- this.updateMetadataMapForExistingAffiliatedFile({
14153
- targetAffiliatedFileAbsolutePath: absolutePathOfExistingAffiliatedFileOfTargetOne,
14154
- parentEntryPointAbsolutePath
14875
+ this.absolutePathsOfChildrenFilesWhichHasBeenScannedDuringCurrentPass.
14876
+ add(targetChildFileRelativePath__forwardSlashSeparators);
14877
+ for (const absolutePathOfExistingAffiliatedFileOfTargetOne__forwardSlashSeparators of absolutePathsOfExistingChildrenFilesOfTargetOne__forwardSlashSeparators) {
14878
+ this.updateMetadataForExistingChildFile({
14879
+ targetChildFileAbsolutePath__forwardSlashSeparators: absolutePathOfExistingAffiliatedFileOfTargetOne__forwardSlashSeparators,
14880
+ parentEntryPointAbsolutePath__forwardSlashSeparators
14155
14881
  });
14156
14882
  }
14157
14883
  }
14158
- computeAbsolutePathOfAffiliatedFileIfItExists({ affiliatedFileRawPath, parentFileDirectoryAbsolutePath }) {
14159
- const possibleAbsolutePathsOfTargetAffiliatedFile = new Set();
14160
- const explicitlySpecifiedLastFileNameExtensionInAffiliatedFileRawPath = (0, es_extensions_1.extractLastExtensionOfFileName)({ targetPath: affiliatedFileRawPath, withLeadingDot: false });
14161
- /* [ Approach ]
14162
- * The second condition is aimed to the processing of paths with multiple files names extensions.
14163
- * For example, in the Pug preprocessor case, the file "ProductCard.static.pug" could be referred as
14164
- * `include ProductCard.static`. */
14165
- if ((0, es_extensions_1.isNull)(explicitlySpecifiedLastFileNameExtensionInAffiliatedFileRawPath) ||
14166
- !this.affiliatedFilesResolutionRules.implicitFilesNamesExtensionsWithoutLeadingDotsOfAffiliatedFiles.
14167
- includes(explicitlySpecifiedLastFileNameExtensionInAffiliatedFileRawPath)) {
14168
- (0, es_extensions_1.addMultipleElementsToSet)(possibleAbsolutePathsOfTargetAffiliatedFile, this.affiliatedFilesResolutionRules.implicitFilesNamesExtensionsWithoutLeadingDotsOfAffiliatedFiles.map((affiliatedFileNameImplicitExtension) => es_extensions_nodejs_1.ImprovedPath.joinPathSegments([parentFileDirectoryAbsolutePath, `${affiliatedFileRawPath}.${affiliatedFileNameImplicitExtension}`], { alwaysForwardSlashSeparators: true })));
14169
- }
14170
- else {
14171
- possibleAbsolutePathsOfTargetAffiliatedFile.add(es_extensions_nodejs_1.ImprovedPath.joinPathSegments([parentFileDirectoryAbsolutePath, affiliatedFileRawPath], { alwaysForwardSlashSeparators: true }));
14172
- }
14173
- for (const possibleAbsolutePathOfTargetAffiliatedFile of possibleAbsolutePathsOfTargetAffiliatedFile) {
14174
- try {
14175
- if (fs_1.default.existsSync(possibleAbsolutePathOfTargetAffiliatedFile)) {
14176
- return possibleAbsolutePathOfTargetAffiliatedFile;
14177
- }
14178
- }
14179
- catch (error) {
14180
- if (true) {
14181
- es_extensions_1.Logger.logError({
14182
- errorType: "FileCheckingError",
14183
- title: "File checking error",
14184
- description: `The error occurred during the checking of the file ${possibleAbsolutePathOfTargetAffiliatedFile}` +
14185
- "for existence.",
14186
- occurrenceLocation: "sourceCodeSelectiveReprocessingHelper." +
14187
- "computeAbsolutePathOfAffiliatedFileIfItExists(compoundParameter)",
14188
- caughtError: error
14189
- });
14190
- }
14191
- return null;
14192
- }
14193
- }
14194
- return null;
14195
- }
14196
- registerEntryPointAsParentTo({ cachedMetadataOfCurrentAffiliatedFile, parentEntryPointAbsolutePath }) {
14197
- for (const relativePathsOfDirectAffiliatedFileOfCurrentOne of cachedMetadataOfCurrentAffiliatedFile.directAffiliatedFilesRelativePaths) {
14198
- const cachedMetadataOfAffiliatedFileOfCurrentOne = this.affiliatedFilesMetadata.get(relativePathsOfDirectAffiliatedFileOfCurrentOne);
14199
- if ((0, es_extensions_1.isUndefined)(cachedMetadataOfAffiliatedFileOfCurrentOne)) {
14884
+ registerEntryPointAsParentTo({ cachedMetadataOfTargetChildFile, parentEntryPointAbsolutePath__forwardSlashSeparators }) {
14885
+ for (const relativePathsOfDirectChildFileOfCurrentOne__forwardSlashSeparators of cachedMetadataOfTargetChildFile.directChildrenFilesRelativePaths) {
14886
+ const cachedMetadataOfChildFileOfCurrentOne = this.childrenFilesMetadata.get(relativePathsOfDirectChildFileOfCurrentOne__forwardSlashSeparators);
14887
+ if ((0, es_extensions_1.isUndefined)(cachedMetadataOfChildFileOfCurrentOne)) {
14200
14888
  continue;
14201
14889
  }
14202
- cachedMetadataOfAffiliatedFileOfCurrentOne.parentEntryPointsAbsolutePaths.add(parentEntryPointAbsolutePath);
14890
+ cachedMetadataOfChildFileOfCurrentOne.parentEntryPointsAbsolutePaths.
14891
+ add(parentEntryPointAbsolutePath__forwardSlashSeparators);
14203
14892
  this.registerEntryPointAsParentTo({
14204
- cachedMetadataOfCurrentAffiliatedFile: cachedMetadataOfAffiliatedFileOfCurrentOne,
14205
- parentEntryPointAbsolutePath
14893
+ cachedMetadataOfTargetChildFile: cachedMetadataOfChildFileOfCurrentOne,
14894
+ parentEntryPointAbsolutePath__forwardSlashSeparators
14206
14895
  });
14207
14896
  }
14208
14897
  }
14209
- /* === Cache file ================================================================================================= */
14210
- cacheFilesMetadataMapsToFile() {
14898
+ clearFileMetadataPathFromCache(targetFileRelativePath__forwardSlashesPathSeparators) {
14899
+ this.entryPointsMetadata.delete(targetFileRelativePath__forwardSlashesPathSeparators);
14900
+ for (const entryPointMetadata of this.entryPointsMetadata.values()) {
14901
+ entryPointMetadata.directChildrenFilesRelativePaths.delete(targetFileRelativePath__forwardSlashesPathSeparators);
14902
+ }
14903
+ this.childrenFilesMetadata.delete(targetFileRelativePath__forwardSlashesPathSeparators);
14904
+ for (const childFileMetadata of this.childrenFilesMetadata.values()) {
14905
+ childFileMetadata.directChildrenFilesRelativePaths.delete(targetFileRelativePath__forwardSlashesPathSeparators);
14906
+ childFileMetadata.parentEntryPointsAbsolutePaths.delete(targetFileRelativePath__forwardSlashesPathSeparators);
14907
+ }
14908
+ }
14909
+ /* ─── Cache File ───────────────────────────────────────────────────────────────────────────────────────────────── */
14910
+ saveCachedFilesMetadataMapsToFile() {
14211
14911
  const outputData = {
14212
14912
  entryPoints: Array.from(this.entryPointsMetadata.entries()).
14213
14913
  reduce((entryPointsMetadata, [entryPointPathRelativeToConsumingProjectRootDirectory, entryPointMetadata]) => {
14214
14914
  entryPointsMetadata[entryPointPathRelativeToConsumingProjectRootDirectory] = {
14215
14915
  modificationDate__ISO8601: entryPointMetadata.modificationDate__ISO8601,
14216
- directAffiliatedFilesRelativePaths: Array.from(entryPointMetadata.directAffiliatedFilesRelativePaths)
14916
+ directChildrenFilesRelativePaths: Array.from(entryPointMetadata.directChildrenFilesRelativePaths)
14217
14917
  };
14218
14918
  return entryPointsMetadata;
14219
14919
  }, {}),
14220
- affiliatedFiles: Array.from(this.affiliatedFilesMetadata.entries()).
14221
- reduce((affiliatedFilesMetadata, [affiliatedFilePathRelativeToConsumingProjectRootDirectory, affiliatedFileMetadata]) => {
14222
- affiliatedFilesMetadata[affiliatedFilePathRelativeToConsumingProjectRootDirectory] = {
14223
- modificationDate__ISO8601: affiliatedFileMetadata.modificationDateTime__ISO8601,
14224
- directAffiliatedFilesRelativePaths: Array.from(affiliatedFileMetadata.directAffiliatedFilesRelativePaths),
14225
- parentEntryPointsRelativePaths: Array.from(affiliatedFileMetadata.parentEntryPointsAbsolutePaths).
14920
+ childrenFiles: Array.from(this.childrenFilesMetadata.entries()).
14921
+ reduce((childrenFilesMetadata, [childFilePathRelativeToConsumingProjectRootDirectory, childFileMetadata]) => {
14922
+ childrenFilesMetadata[childFilePathRelativeToConsumingProjectRootDirectory] = {
14923
+ modificationDate__ISO8601: childFileMetadata.modificationDateTime__ISO8601,
14924
+ directChildrenFilesRelativePaths: Array.from(childFileMetadata.directChildrenFilesRelativePaths),
14925
+ parentEntryPointsRelativePaths: Array.from(childFileMetadata.parentEntryPointsAbsolutePaths).
14226
14926
  map((parentEntryPointsAbsolutePath) => es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
14227
14927
  basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
14228
14928
  comparedPath: parentEntryPointsAbsolutePath,
14229
14929
  alwaysForwardSlashSeparators: true
14230
14930
  }))
14231
14931
  };
14232
- return affiliatedFilesMetadata;
14932
+ return childrenFilesMetadata;
14233
14933
  }, {})
14234
14934
  };
14235
14935
  fs_1.default.writeFileSync(this.CACHED_METADATA_FILE_ABSOLUTE_PATH, (0, es_extensions_1.stringifyAndFormatArbitraryValue)(outputData));
14236
14936
  }
14237
- /* === Incremental remapping ====================================================================================== */
14238
- /* ━━━ Logging ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
14239
- logAffiliatedFilesAndEntryPointsRelationships() {
14937
+ /* ─── Logging ──────────────────────────────────────────────────────────────────────────────────────────────────── */
14938
+ logChildrenFilesAndEntryPointsRelationships() {
14240
14939
  let accumulatingString = "";
14241
- for (const [affiliatedFileRelativePath, affiliatedFileMetadata] of this.affiliatedFilesMetadata.entries()) {
14242
- accumulatingString = `${accumulatingString}File: "${affiliatedFileRelativePath}" has parents:\n`;
14243
- for (const entryPointFileAbsolutePath of affiliatedFileMetadata.parentEntryPointsAbsolutePaths) {
14940
+ for (const [childFileRelativePath, childFileMetadata] of this.childrenFilesMetadata.entries()) {
14941
+ accumulatingString = `${accumulatingString}File: "${childFileRelativePath}" has parents:\n`;
14942
+ for (const entryPointFileAbsolutePath of childFileMetadata.parentEntryPointsAbsolutePaths) {
14244
14943
  accumulatingString = `${accumulatingString} ● ${es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
14245
14944
  basePath: this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
14246
14945
  comparedPath: entryPointFileAbsolutePath,
@@ -14249,8 +14948,8 @@ class SourceCodeSelectiveReprocessingHelper {
14249
14948
  }
14250
14949
  }
14251
14950
  es_extensions_1.Logger.logInfo({
14252
- title: `${this.TARGET_FILES_TYPE_IN_SINGULAR_FORM} Affiliated Files and Respective Parent Entry Points Relationships`,
14253
- description: accumulatingString.length > 0 ? accumulatingString : "No existing affiliated files has been found."
14951
+ title: `${this.TARGET_FILES_TYPE_IN_SINGULAR_FORM} Children Files and Respective Parent Entry Points Relationships`,
14952
+ description: accumulatingString.length > 0 ? accumulatingString : "No existing children files has been found."
14254
14953
  });
14255
14954
  }
14256
14955
  }
@@ -14796,7 +15495,7 @@ function revisionHash(data) {
14796
15495
  \***********************/
14797
15496
  /***/ ((module) => {
14798
15497
 
14799
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@yamato-daiwa/automation","version":"0.5.0-alpha.0","description":"The project building tool with declarative YAML configuration specializing on Pug, Stylus and TypeScript as source code languages.","keywords":["build","pug","stylus","tool","typescript"],"engines":{"node":">=18.18.0"},"bin":{"yda":"Executable"},"files":["EntryPoint.js"],"dependencies":{"@stylistic/eslint-plugin":"1.7.2","@typescript-eslint/eslint-plugin":"7.12.0","@typescript-eslint/parser":"7.12.0","@vue/compiler-sfc":"3.4.27","@webdiscus/pug-loader":"2.11.0","@yamato-daiwa/es-extensions":"1.7.0-rc.2","@yamato-daiwa/es-extensions-nodejs":"1.7.0-alpha.10","@yamato-daiwa/style_guides":"0.2.7","autoprefixer":"10.4.19","browser-sync":"3.0.2","css-loader":"7.1.2","cssnano":"7.0.2","eslint":"8.57.0","eslint-plugin-import":"2.29.1","eslint-plugin-node":"11.1.0","eslint-plugin-react":"7.34.2","eslint-plugin-vue":"9.26.0","eslint-plugin-vue-pug":"0.6.2","fork-ts-checker-webpack-plugin":"7.3.0","gulp":"4.0.2","gulp-data":"1.3.1","gulp-html-prettify":"0.0.1","gulp-if":"3.0.0","gulp-imagemin":"7.1.0","gulp-nodemon":"2.5.0","gulp-plumber":"1.2.1","gulp-postcss":"10.0.0","gulp-pug":"5.0.0","gulp-sourcemaps":"3.0.0","gulp-stylus":"3.0.1","imagemin-pngquant":"9.0.2","json5-loader":"4.0.1","node-html-parser":"6.1.13","node-notifier":"10.0.1","pa11y":"8.0.0","probe-image-size":"7.2.3","pug3-ast-loader":"0.0.0","pug-lint":"2.7.0","puppeteer":"22.10.0","rev-hash":"4.1.0","stlint":"1.0.65","stream-combiner2":"1.1.1","style-loader":"4.0.0","stylus":"0.63.0","stylus-loader":"8.1.0","ts-loader":"9.5.1","vinyl":"2.2.1","vue-loader":"17.4.2","vue-style-loader":"4.1.3","w3c-html-validator":"0.8.1","webpack":"5.91.0","webpack-node-externals":"3.0.0","webpack-stream":"7.0.0","worker-loader":"3.0.8","yaml-loader":"0.8.1"},"devDependencies":{"@types/browser-sync":"2.29.0","@types/cssnano":"5.0.0","@types/gulp":"4.0.17","@types/gulp-html-prettify":"0.0.5","@types/gulp-if":"3.0.4","@types/gulp-imagemin":"8.0.6","@types/gulp-nodemon":"0.0.37","@types/gulp-plumber":"0.0.37","@types/gulp-postcss":"8.0.6","@types/gulp-sourcemaps":"0.0.38","@types/gulp-stylus":"2.7.8","@types/node":"20.14.2","@types/node-notifier":"8.0.5","@types/pa11y":"5.3.7","@types/probe-image-size":"7.2.4","@types/pug":"2.0.10","@types/webpack-node-externals":"3.0.4","@types/webpack-stream":"3.2.15","eslint-webpack-plugin":"4.2.0","ts-node":"10.9.2","typescript":"5.4.5","webpack-cli":"5.1.4"},"scripts":{"Incremental development building":"webpack --mode development","Production building":"webpack --mode production","Linting":"eslint Source","Tree diagram of source files generating":"tree Source /f"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/TokugawaTakeshi/Yamato-Daiwa-Automation.git"},"bugs":{"url":"https://github.com/TokugawaTakeshi/Yamato-Daiwa-Automation/issues","email":"tokugawa.takesi@gmail.com"}}');
15498
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@yamato-daiwa/automation","version":"0.5.0-alpha.2","description":"The project building tool with declarative YAML configuration specializing on Pug, Stylus and TypeScript as source code languages.","keywords":["build","pug","stylus","tool","typescript"],"engines":{"node":">=18.18.0"},"bin":{"yda":"Executable"},"files":["EntryPoint.js"],"dependencies":{"@stylistic/eslint-plugin":"1.7.2","@typescript-eslint/eslint-plugin":"7.12.0","@typescript-eslint/parser":"7.12.0","@vue/compiler-sfc":"3.4.27","@webdiscus/pug-loader":"2.11.0","@yamato-daiwa/es-extensions":"1.8.0-alpha.2","@yamato-daiwa/es-extensions-nodejs":"1.8.0-alpha.1","@yamato-daiwa/style_guides":"0.2.7","autoprefixer":"10.4.19","browser-sync":"3.0.2","css-loader":"7.1.2","cssnano":"7.0.2","eslint":"8.57.0","eslint-plugin-import":"2.29.1","eslint-plugin-node":"11.1.0","eslint-plugin-react":"7.34.2","eslint-plugin-vue":"9.26.0","eslint-plugin-vue-pug":"0.6.2","fork-ts-checker-webpack-plugin":"7.3.0","gulp":"4.0.2","gulp-data":"1.3.1","gulp-html-prettify":"0.0.1","gulp-if":"3.0.0","gulp-imagemin":"7.1.0","gulp-nodemon":"2.5.0","gulp-plumber":"1.2.1","gulp-postcss":"10.0.0","gulp-pug":"5.0.0","gulp-sourcemaps":"3.0.0","gulp-stylus":"3.0.1","imagemin-pngquant":"9.0.2","json5-loader":"4.0.1","node-html-parser":"6.1.13","node-notifier":"10.0.1","pa11y":"8.0.0","probe-image-size":"7.2.3","pug3-ast-loader":"0.0.0","pug-lint":"2.7.0","puppeteer":"22.10.0","rev-hash":"4.1.0","stlint":"1.0.65","stream-combiner2":"1.1.1","style-loader":"4.0.0","stylus":"0.63.0","stylus-loader":"8.1.0","ts-loader":"9.5.1","vinyl":"2.2.1","vue-loader":"17.4.2","vue-style-loader":"4.1.3","w3c-html-validator":"0.8.1","webpack":"5.91.0","webpack-node-externals":"3.0.0","webpack-stream":"7.0.0","worker-loader":"3.0.8","yaml-loader":"0.8.1"},"devDependencies":{"@types/browser-sync":"2.29.0","@types/cssnano":"5.0.0","@types/gulp":"4.0.17","@types/gulp-html-prettify":"0.0.5","@types/gulp-if":"3.0.4","@types/gulp-imagemin":"8.0.6","@types/gulp-nodemon":"0.0.37","@types/gulp-plumber":"0.0.37","@types/gulp-postcss":"8.0.6","@types/gulp-sourcemaps":"0.0.38","@types/gulp-stylus":"2.7.8","@types/node":"20.14.2","@types/node-notifier":"8.0.5","@types/pa11y":"5.3.7","@types/probe-image-size":"7.2.4","@types/pug":"2.0.10","@types/webpack-node-externals":"3.0.4","@types/webpack-stream":"3.2.15","eslint-webpack-plugin":"4.2.0","ts-node":"10.9.2","typescript":"5.4.5","webpack-cli":"5.1.4"},"scripts":{"Incremental development building":"webpack --mode development","Production building":"webpack --mode production","Linting":"eslint Source","Tree diagram of source files generating":"tree Source /f"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/TokugawaTakeshi/Yamato-Daiwa-Automation.git"},"bugs":{"url":"https://github.com/TokugawaTakeshi/Yamato-Daiwa-Automation/issues","email":"tokugawa.takesi@gmail.com"}}');
14800
15499
 
14801
15500
  /***/ })
14802
15501