@yamato-daiwa/automation 0.0.9 → 0.2.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/EntryPoint.js +414 -324
- package/package.json +13 -12
package/EntryPoint.js
CHANGED
|
@@ -72,6 +72,9 @@ const es_extensions_nodejs_1 = __webpack_require__(/*! @yamato-daiwa/es-extensio
|
|
|
72
72
|
const path_1 = __importDefault(__webpack_require__(/*! path */ "path"));
|
|
73
73
|
const yamljs_1 = __importDefault(__webpack_require__(/*! yamljs */ "yamljs"));
|
|
74
74
|
class EntryPoint {
|
|
75
|
+
static {
|
|
76
|
+
es_extensions_1.Logger.setImplementation(es_extensions_nodejs_1.ConsoleApplicationLogger);
|
|
77
|
+
}
|
|
75
78
|
static interpretAndExecuteConsoleCommand(rawConsoleCommand) {
|
|
76
79
|
const parsedConsoleCommand = es_extensions_nodejs_1.ConsoleCommandsParser.parse(rawConsoleCommand, ApplicationConsoleLineInterface_1.default.specification);
|
|
77
80
|
if (true) {
|
|
@@ -113,9 +116,6 @@ class EntryPoint {
|
|
|
113
116
|
}
|
|
114
117
|
}
|
|
115
118
|
}
|
|
116
|
-
static {
|
|
117
|
-
es_extensions_1.Logger.setImplementation(es_extensions_nodejs_1.ConsoleApplicationLogger);
|
|
118
|
-
}
|
|
119
119
|
}
|
|
120
120
|
exports["default"] = EntryPoint;
|
|
121
121
|
|
|
@@ -291,12 +291,14 @@ const AssetsProcessingSettingsRepresentative_1 = __importDefault(__webpack_requi
|
|
|
291
291
|
class AudiosProcessingSettingsRepresentative extends AssetsProcessingSettingsRepresentative_1.default {
|
|
292
292
|
TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM = "Audio";
|
|
293
293
|
TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM = "Audios";
|
|
294
|
+
relevantSourceFilesGlobSelectors;
|
|
294
295
|
assetsProcessingCommonSettings;
|
|
295
296
|
actualAssetsGroupsSettings;
|
|
296
297
|
constructor(audiosManagementSettings, masterConfigRepresentative) {
|
|
297
298
|
super(masterConfigRepresentative);
|
|
298
299
|
this.assetsProcessingCommonSettings = audiosManagementSettings.common;
|
|
299
300
|
this.actualAssetsGroupsSettings = audiosManagementSettings.assetsGroups;
|
|
301
|
+
this.relevantSourceFilesGlobSelectors = Array.from(this.actualAssetsGroupsSettings.values()).map((imagesGroupSettings) => imagesGroupSettings.sourceFilesGlobSelector);
|
|
300
302
|
}
|
|
301
303
|
}
|
|
302
304
|
exports["default"] = AudiosProcessingSettingsRepresentative;
|
|
@@ -497,13 +499,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
497
499
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
498
500
|
const AssetsProcessingSettingsRepresentative_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/SettingsRepresentatives/AssetsProcessingSettingsRepresentative */ "./ProjectBuilding/Common/SettingsRepresentatives/AssetsProcessingSettingsRepresentative.ts"));
|
|
499
501
|
class FontsProcessingSettingsRepresentative extends AssetsProcessingSettingsRepresentative_1.default {
|
|
502
|
+
TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM = "Font";
|
|
500
503
|
TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM = "Fonts";
|
|
504
|
+
relevantSourceFilesGlobSelectors;
|
|
501
505
|
assetsProcessingCommonSettings;
|
|
502
506
|
actualAssetsGroupsSettings;
|
|
503
507
|
constructor(imagesManagementSettings, masterConfigRepresentative) {
|
|
504
508
|
super(masterConfigRepresentative);
|
|
505
509
|
this.assetsProcessingCommonSettings = imagesManagementSettings.common;
|
|
506
510
|
this.actualAssetsGroupsSettings = imagesManagementSettings.assetsGroups;
|
|
511
|
+
this.relevantSourceFilesGlobSelectors = Array.from(this.actualAssetsGroupsSettings.values()).map((imagesGroupSettings) => imagesGroupSettings.sourceFilesGlobSelector);
|
|
507
512
|
}
|
|
508
513
|
}
|
|
509
514
|
exports["default"] = FontsProcessingSettingsRepresentative;
|
|
@@ -705,12 +710,14 @@ const AssetsProcessingSettingsRepresentative_1 = __importDefault(__webpack_requi
|
|
|
705
710
|
class ImagesProcessingSettingsRepresentative extends AssetsProcessingSettingsRepresentative_1.default {
|
|
706
711
|
TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM = "Image";
|
|
707
712
|
TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM = "Images";
|
|
713
|
+
relevantSourceFilesGlobSelectors;
|
|
708
714
|
assetsProcessingCommonSettings;
|
|
709
715
|
actualAssetsGroupsSettings;
|
|
710
716
|
constructor(imagesManagementSettings, masterConfigRepresentative) {
|
|
711
717
|
super(masterConfigRepresentative);
|
|
712
718
|
this.assetsProcessingCommonSettings = imagesManagementSettings.common;
|
|
713
719
|
this.actualAssetsGroupsSettings = imagesManagementSettings.assetsGroups;
|
|
720
|
+
this.relevantSourceFilesGlobSelectors = Array.from(this.actualAssetsGroupsSettings.values()).map((imagesGroupSettings) => imagesGroupSettings.sourceFilesGlobSelector);
|
|
714
721
|
}
|
|
715
722
|
}
|
|
716
723
|
exports["default"] = ImagesProcessingSettingsRepresentative;
|
|
@@ -803,7 +810,7 @@ class ImagesProcessor extends GulpStreamsBasedAssetsProcessor_1.default {
|
|
|
803
810
|
pipe(super.printProcessedFilesPathsAndQuantity()).
|
|
804
811
|
pipe(super.handleErrorIfItWillOccur()).
|
|
805
812
|
pipe((0, gulp_intercept_1.default)(this.addActualSourceCodeProcessingSettingsToVinylFile.bind(this))).
|
|
806
|
-
pipe((0, gulp_if_1.default)(this.masterConfigRepresentative.isProductionBuildingMode, (0, gulp_imagemin_1.default)([
|
|
813
|
+
pipe((0, gulp_if_1.default)(this.masterConfigRepresentative.isStagingBuildingMode || this.masterConfigRepresentative.isProductionBuildingMode, (0, gulp_imagemin_1.default)([
|
|
807
814
|
gulp_imagemin_1.default.mozjpeg({ progressive: true }),
|
|
808
815
|
gulp_imagemin_1.default.gifsicle({ interlaced: true }),
|
|
809
816
|
gulp_imagemin_1.default.svgo({}),
|
|
@@ -921,12 +928,14 @@ const AssetsProcessingSettingsRepresentative_1 = __importDefault(__webpack_requi
|
|
|
921
928
|
class VideosProcessingSettingsRepresentative extends AssetsProcessingSettingsRepresentative_1.default {
|
|
922
929
|
TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM = "Video";
|
|
923
930
|
TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM = "Videos";
|
|
931
|
+
relevantSourceFilesGlobSelectors;
|
|
924
932
|
assetsProcessingCommonSettings;
|
|
925
933
|
actualAssetsGroupsSettings;
|
|
926
934
|
constructor(videosManagementSettings, masterConfigRepresentative) {
|
|
927
935
|
super(masterConfigRepresentative);
|
|
928
936
|
this.assetsProcessingCommonSettings = videosManagementSettings.common;
|
|
929
937
|
this.actualAssetsGroupsSettings = videosManagementSettings.assetsGroups;
|
|
938
|
+
this.relevantSourceFilesGlobSelectors = Array.from(this.actualAssetsGroupsSettings.values()).map((imagesGroupSettings) => imagesGroupSettings.sourceFilesGlobSelector);
|
|
930
939
|
}
|
|
931
940
|
}
|
|
932
941
|
exports["default"] = VideosProcessingSettingsRepresentative;
|
|
@@ -1078,6 +1087,7 @@ class BrowserLiveReloader {
|
|
|
1078
1087
|
baseDir: browserLiveReloadingConfigRepresentative.targetFilesRootDirectoryAbsolutePath,
|
|
1079
1088
|
index: browserLiveReloadingConfigRepresentative.startingFilenameWithExtension
|
|
1080
1089
|
},
|
|
1090
|
+
browser: "chrome",
|
|
1081
1091
|
...(0, es_extensions_1.isNotNull)(browserLiveReloadingConfigRepresentative.customMainPort) ? {
|
|
1082
1092
|
port: browserLiveReloadingConfigRepresentative.customMainPort
|
|
1083
1093
|
} : {},
|
|
@@ -1349,7 +1359,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1349
1359
|
const ConsumingProjectPreDefinedBuildingModes_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/Defaults/ConsumingProjectPreDefinedBuildingModes */ "./ProjectBuilding/Common/Defaults/ConsumingProjectPreDefinedBuildingModes.ts"));
|
|
1350
1360
|
exports["default"] = {
|
|
1351
1361
|
revisioning: {
|
|
1352
|
-
mustExecute: (projectBuildingMode__possiblyCustom) => projectBuildingMode__possiblyCustom !== ConsumingProjectPreDefinedBuildingModes_1.default.
|
|
1362
|
+
mustExecute: (projectBuildingMode__possiblyCustom) => projectBuildingMode__possiblyCustom !== ConsumingProjectPreDefinedBuildingModes_1.default.staticPreview &&
|
|
1363
|
+
projectBuildingMode__possiblyCustom !== ConsumingProjectPreDefinedBuildingModes_1.default.development,
|
|
1353
1364
|
contentHashPostfixSeparator: "--"
|
|
1354
1365
|
}
|
|
1355
1366
|
};
|
|
@@ -1381,6 +1392,7 @@ exports["default"] = CONFIG_FILE_DEFAULT_NAME_WITH_EXTENSION;
|
|
|
1381
1392
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1382
1393
|
var ConsumingProjectPreDefinedBuildingModes;
|
|
1383
1394
|
(function (ConsumingProjectPreDefinedBuildingModes) {
|
|
1395
|
+
ConsumingProjectPreDefinedBuildingModes["staticPreview"] = "STATIC_PREVIEW";
|
|
1384
1396
|
ConsumingProjectPreDefinedBuildingModes["development"] = "DEVELOPMENT";
|
|
1385
1397
|
ConsumingProjectPreDefinedBuildingModes["testing"] = "TESTING";
|
|
1386
1398
|
ConsumingProjectPreDefinedBuildingModes["staging"] = "STAGING";
|
|
@@ -1491,11 +1503,9 @@ var AssetsProcessingSettingsGenericProperties__FromFile__RawValid;
|
|
|
1491
1503
|
newName: "buildingModeDependent",
|
|
1492
1504
|
type: es_extensions_1.RawObjectDataProcessor.ValuesTypesIDs.associativeArrayOfUniformTypeValues,
|
|
1493
1505
|
required: true,
|
|
1494
|
-
|
|
1495
|
-
consumingProjectLocalizedPreDefinedBuildingModes.development,
|
|
1496
|
-
consumingProjectLocalizedPreDefinedBuildingModes.production
|
|
1497
|
-
],
|
|
1506
|
+
minimalEntriesCount: 1,
|
|
1498
1507
|
keysRenamings: {
|
|
1508
|
+
[consumingProjectLocalizedPreDefinedBuildingModes.staticPreview]: ConsumingProjectPreDefinedBuildingModes_1.default.staticPreview,
|
|
1499
1509
|
[consumingProjectLocalizedPreDefinedBuildingModes.development]: ConsumingProjectPreDefinedBuildingModes_1.default.development,
|
|
1500
1510
|
[consumingProjectLocalizedPreDefinedBuildingModes.testing]: ConsumingProjectPreDefinedBuildingModes_1.default.testing,
|
|
1501
1511
|
[consumingProjectLocalizedPreDefinedBuildingModes.production]: ConsumingProjectPreDefinedBuildingModes_1.default.production
|
|
@@ -1587,10 +1597,15 @@ var ProjectBuildingTasksIDsForConfigFile;
|
|
|
1587
1597
|
/*!***********************************************************************************************!*\
|
|
1588
1598
|
!*** ./ProjectBuilding/Common/RawConfig/ProjectBuildingCommonSettings__FromFile__RawValid.ts ***!
|
|
1589
1599
|
\***********************************************************************************************/
|
|
1590
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
1600
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1591
1601
|
|
|
1592
1602
|
|
|
1603
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
1604
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
1605
|
+
};
|
|
1593
1606
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1607
|
+
/* --- Defaults ----------------------------------------------------------------------------------------------------- */
|
|
1608
|
+
const ConsumingProjectPreDefinedBuildingModes_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/Defaults/ConsumingProjectPreDefinedBuildingModes */ "./ProjectBuilding/Common/Defaults/ConsumingProjectPreDefinedBuildingModes.ts"));
|
|
1594
1609
|
const ProjectBuildingTasksIDsForConfigFile_1 = __webpack_require__(/*! @ProjectBuilding:Common/RawConfig/Enumerations/ProjectBuildingTasksIDsForConfigFile */ "./ProjectBuilding/Common/RawConfig/Enumerations/ProjectBuildingTasksIDsForConfigFile.ts");
|
|
1595
1610
|
/* --- General auxiliaries ------------------------------------------------------------------------------------------ */
|
|
1596
1611
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
@@ -1642,6 +1657,16 @@ var ProjectBuildingCommonSettings__FromFile__RawValid;
|
|
|
1642
1657
|
}
|
|
1643
1658
|
}
|
|
1644
1659
|
}
|
|
1660
|
+
},
|
|
1661
|
+
[projectBuildingCommonSettingsLocalization.publicDirectoriesRelativePaths.KEY]: {
|
|
1662
|
+
newName: "publicDirectoriesRelativePaths",
|
|
1663
|
+
type: es_extensions_1.RawObjectDataProcessor.ValuesTypesIDs.associativeArrayOfUniformTypeValues,
|
|
1664
|
+
required: false,
|
|
1665
|
+
allowedKeys: Object.values(ConsumingProjectPreDefinedBuildingModes_1.default),
|
|
1666
|
+
value: {
|
|
1667
|
+
type: String,
|
|
1668
|
+
minimalCharactersCount: 1
|
|
1669
|
+
}
|
|
1645
1670
|
}
|
|
1646
1671
|
};
|
|
1647
1672
|
}
|
|
@@ -1932,7 +1957,7 @@ class SourceCodeProcessingRawSettingsNormalizer {
|
|
|
1932
1957
|
}
|
|
1933
1958
|
createNormalizedEntryPointsGroupsSettings(entryPointsGroupsSettings__rawValid, completeEntryPointsGroupNormalizedSettingsGeneralPropertiesUntilSpecificEntryPointsGroupNormalizedSettings) {
|
|
1934
1959
|
const entryPointsGroupsSettings__normalized = new Map();
|
|
1935
|
-
/* [ Approach ] This case could be both valid (e.
|
|
1960
|
+
/* [ Approach ] This case could be both valid (e.g. if inside the project markup is being declared only inside
|
|
1936
1961
|
Vue components) or invalid. */
|
|
1937
1962
|
if ((0, es_extensions_1.isUndefined)(entryPointsGroupsSettings__rawValid)) {
|
|
1938
1963
|
return entryPointsGroupsSettings__normalized;
|
|
@@ -2323,7 +2348,6 @@ const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "
|
|
|
2323
2348
|
class GulpStreamsBasedAssetsProcessor extends GulpStreamsBasedTaskExecutor_1.default {
|
|
2324
2349
|
static WAITING_FOR_OTHER_FILES_WILL_BE_SAVED_PERIOD__SECONDS = 1;
|
|
2325
2350
|
associatedAssetsProcessingConfigRepresentative;
|
|
2326
|
-
sourceFilesThoseAlwaysWillBeWatchedGlobSelectors = [];
|
|
2327
2351
|
filesWhichStatusHasBeenChangedAbsolutePathsQueueToProcessing = new Set();
|
|
2328
2352
|
waitingForOtherFilesWillBeSavedDuration = null;
|
|
2329
2353
|
constructor(masterConfigRepresentative, certainAssetsManagementConfigRepresentative) {
|
|
@@ -2331,7 +2355,7 @@ class GulpStreamsBasedAssetsProcessor extends GulpStreamsBasedTaskExecutor_1.def
|
|
|
2331
2355
|
this.associatedAssetsProcessingConfigRepresentative = certainAssetsManagementConfigRepresentative;
|
|
2332
2356
|
}
|
|
2333
2357
|
initializeOrUpdateSourceFilesWatcher() {
|
|
2334
|
-
gulp_1.default.watch(this.
|
|
2358
|
+
gulp_1.default.watch(this.associatedAssetsProcessingConfigRepresentative.relevantSourceFilesGlobSelectors).
|
|
2335
2359
|
on("all", (eventName, fileOrDirectoryPath) => {
|
|
2336
2360
|
es_extensions_1.Logger.logInfo({
|
|
2337
2361
|
title: `${this.SOURCE_FILES_TYPE_LABEL_FOR_LOGGING} files watcher`,
|
|
@@ -2353,7 +2377,7 @@ class GulpStreamsBasedAssetsProcessor extends GulpStreamsBasedTaskExecutor_1.def
|
|
|
2353
2377
|
this.filesWhichStatusHasBeenChangedAbsolutePathsQueueToProcessing.add(fileOrDirectoryPath);
|
|
2354
2378
|
this.waitingForOtherFilesWillBeSavedDuration = setTimeout(() => {
|
|
2355
2379
|
if (this.filesWhichStatusHasBeenChangedAbsolutePathsQueueToProcessing.size > 0) {
|
|
2356
|
-
this.processAssets(Array.from(this.filesWhichStatusHasBeenChangedAbsolutePathsQueueToProcessing));
|
|
2380
|
+
this.processAssets(Array.from(this.filesWhichStatusHasBeenChangedAbsolutePathsQueueToProcessing))();
|
|
2357
2381
|
}
|
|
2358
2382
|
this.filesWhichStatusHasBeenChangedAbsolutePathsQueueToProcessing.clear();
|
|
2359
2383
|
}, (0, es_extensions_1.secondsToMilliseconds)(GulpStreamsBasedAssetsProcessor.WAITING_FOR_OTHER_FILES_WILL_BE_SAVED_PERIOD__SECONDS));
|
|
@@ -2900,6 +2924,7 @@ const ProjectBuildingConfigFromFileDefaultLocalization = {
|
|
|
2900
2924
|
browserLiveReloading: "browserLiveReloading"
|
|
2901
2925
|
},
|
|
2902
2926
|
consumingProjectPreDefinedBuildingModes: {
|
|
2927
|
+
staticPreview: "STATIC_PREVIEW",
|
|
2903
2928
|
development: "DEVELOPMENT",
|
|
2904
2929
|
testing: "TESTING",
|
|
2905
2930
|
staging: "STAGING",
|
|
@@ -2963,6 +2988,7 @@ const ProjectBuildingConfigFromFileDefaultLocalization = {
|
|
|
2963
2988
|
standard: { KEY: "standard" },
|
|
2964
2989
|
disable: { KEY: "disable" }
|
|
2965
2990
|
},
|
|
2991
|
+
convertToHandlebarsInNonStaticPreviewModes: { KEY: "convertToHandlebarsInNonStaticPreviewModes" },
|
|
2966
2992
|
buildingModeDependent: {
|
|
2967
2993
|
KEY: "buildingModeDependent",
|
|
2968
2994
|
outputBaseDirectoryRelativePath: { KEY: "outputBaseDirectoryRelativePath" }
|
|
@@ -3405,6 +3431,9 @@ class ProjectBuildingMasterConfigRepresentative {
|
|
|
3405
3431
|
}
|
|
3406
3432
|
/* --- Project building mode -------------------------------------------------------------------------------------- */
|
|
3407
3433
|
get consumingProjectBuildingMode() { return this.commonSettings.projectBuildingMode; }
|
|
3434
|
+
get isStaticPreviewBuildingMode() {
|
|
3435
|
+
return this.commonSettings.projectBuildingMode === ConsumingProjectPreDefinedBuildingModes_1.default.staticPreview;
|
|
3436
|
+
}
|
|
3408
3437
|
get isDevelopmentBuildingMode() {
|
|
3409
3438
|
return this.commonSettings.projectBuildingMode === ConsumingProjectPreDefinedBuildingModes_1.default.development;
|
|
3410
3439
|
}
|
|
@@ -3445,7 +3474,8 @@ class ProjectBuildingMasterConfigRepresentative {
|
|
|
3445
3474
|
return (0, es_extensions_1.isNotUndefined)(this.videosProcessingSettingsRepresentative);
|
|
3446
3475
|
}
|
|
3447
3476
|
get mustProvideBrowserLiveReloading() {
|
|
3448
|
-
return (0, es_extensions_1.isNotUndefined)(this.browserLiveReloadingSettingsRepresentative) &&
|
|
3477
|
+
return (0, es_extensions_1.isNotUndefined)(this.browserLiveReloadingSettingsRepresentative) &&
|
|
3478
|
+
(this.isStaticPreviewBuildingMode || this.isDevelopmentBuildingMode);
|
|
3449
3479
|
}
|
|
3450
3480
|
/* --- Debugging -------------------------------------------------------------------------------------------------- */
|
|
3451
3481
|
get mustDebugEntryPointsAndPartialFiles() {
|
|
@@ -3715,7 +3745,8 @@ exports["default"] = {
|
|
|
3715
3745
|
mustExecute(namedParameters) {
|
|
3716
3746
|
if (namedParameters.targetRuntimeType === SupportedECMA_ScriptRuntimesTypes.browser ||
|
|
3717
3747
|
namedParameters.targetRuntimeType === SupportedECMA_ScriptRuntimesTypes.webWorker) {
|
|
3718
|
-
return namedParameters.consumingProjectBuildingMode !== ConsumingProjectPreDefinedBuildingModes_1.default.
|
|
3748
|
+
return namedParameters.consumingProjectBuildingMode !== ConsumingProjectPreDefinedBuildingModes_1.default.staticPreview &&
|
|
3749
|
+
namedParameters.consumingProjectBuildingMode !== ConsumingProjectPreDefinedBuildingModes_1.default.development;
|
|
3719
3750
|
}
|
|
3720
3751
|
return false;
|
|
3721
3752
|
},
|
|
@@ -3914,11 +3945,9 @@ var ECMA_ScriptLogicProcessingSettings__FromFile__RawValid;
|
|
|
3914
3945
|
newName: "buildingModeDependent",
|
|
3915
3946
|
type: es_extensions_1.RawObjectDataProcessor.ValuesTypesIDs.associativeArrayOfUniformTypeValues,
|
|
3916
3947
|
required: true,
|
|
3917
|
-
|
|
3918
|
-
consumingProjectLocalizedPreDefinedBuildingModes.development,
|
|
3919
|
-
consumingProjectLocalizedPreDefinedBuildingModes.production
|
|
3920
|
-
],
|
|
3948
|
+
minimalEntriesCount: 1,
|
|
3921
3949
|
keysRenamings: {
|
|
3950
|
+
[consumingProjectLocalizedPreDefinedBuildingModes.staticPreview]: ConsumingProjectPreDefinedBuildingModes_1.default.staticPreview,
|
|
3922
3951
|
[consumingProjectLocalizedPreDefinedBuildingModes.development]: ConsumingProjectPreDefinedBuildingModes_1.default.development,
|
|
3923
3952
|
[consumingProjectLocalizedPreDefinedBuildingModes.testing]: ConsumingProjectPreDefinedBuildingModes_1.default.testing,
|
|
3924
3953
|
[consumingProjectLocalizedPreDefinedBuildingModes.production]: ConsumingProjectPreDefinedBuildingModes_1.default.production
|
|
@@ -4025,7 +4054,8 @@ class ECMA_ScriptLogicProcessor extends TaskExecutor_1.default {
|
|
|
4025
4054
|
});
|
|
4026
4055
|
}
|
|
4027
4056
|
/** 〔 納品版のみ理由 〕 開発版で同じ事をすれば、gulpが落ちる */
|
|
4028
|
-
if (dataHoldingSelfInstance.masterConfigRepresentative.
|
|
4057
|
+
if ((dataHoldingSelfInstance.masterConfigRepresentative.isStagingBuildingMode ||
|
|
4058
|
+
dataHoldingSelfInstance.masterConfigRepresentative.isProductionBuildingMode) &&
|
|
4029
4059
|
(0, es_extensions_1.isNotUndefined)(finalErrorMessageDynamicPart)) {
|
|
4030
4060
|
es_extensions_1.Logger.logError({
|
|
4031
4061
|
errorType: "ECMA_ScriptLogicProcessingError",
|
|
@@ -4250,9 +4280,17 @@ class WebpackConfigGenerator {
|
|
|
4250
4280
|
type: (() => {
|
|
4251
4281
|
switch (entryPointsGroupSettings.targetRuntime.type) {
|
|
4252
4282
|
case SupportedECMA_ScriptRuntimesTypes.browser: return "module";
|
|
4253
|
-
case SupportedECMA_ScriptRuntimesTypes.webWorker: return "module";
|
|
4254
4283
|
case SupportedECMA_ScriptRuntimesTypes.nodeJS: return "commonjs";
|
|
4255
4284
|
case SupportedECMA_ScriptRuntimesTypes.pug: return "umd";
|
|
4285
|
+
default: {
|
|
4286
|
+
es_extensions_1.Logger.throwErrorAndLog({
|
|
4287
|
+
errorInstance: new es_extensions_1.UnexpectedEventError("The web worker could not be the library, while the computing of 'output.library.type' has been " +
|
|
4288
|
+
"requested"),
|
|
4289
|
+
title: es_extensions_1.UnexpectedEventError.localization.defaultTitle,
|
|
4290
|
+
occurrenceLocation: "webpackConfigGenerator." +
|
|
4291
|
+
"generateSingleWebpackConfigurationIfAtLeastOneTargetEntryPointFileExists(entryPointsGroupSettings)"
|
|
4292
|
+
});
|
|
4293
|
+
}
|
|
4256
4294
|
}
|
|
4257
4295
|
})(),
|
|
4258
4296
|
...willNodeJS_LibraryBeBuilt || willPugLibraryBeBuilt ? {
|
|
@@ -4263,9 +4301,14 @@ class WebpackConfigGenerator {
|
|
|
4263
4301
|
...willPugLibraryBeBuilt ? { globalObject: "globalThis" } : null
|
|
4264
4302
|
},
|
|
4265
4303
|
...willBrowserJS_LibraryBeBuilt ? { experiments: { outputModule: true } } : null,
|
|
4266
|
-
mode: this.masterConfigRepresentative.
|
|
4267
|
-
|
|
4268
|
-
|
|
4304
|
+
mode: this.masterConfigRepresentative.isStaticPreviewBuildingMode ||
|
|
4305
|
+
this.masterConfigRepresentative.isDevelopmentBuildingMode ?
|
|
4306
|
+
"development" : "production",
|
|
4307
|
+
watch: this.masterConfigRepresentative.isStaticPreviewBuildingMode ||
|
|
4308
|
+
this.masterConfigRepresentative.isDevelopmentBuildingMode,
|
|
4309
|
+
devtool: this.masterConfigRepresentative.isStaticPreviewBuildingMode ||
|
|
4310
|
+
this.masterConfigRepresentative.isDevelopmentBuildingMode ?
|
|
4311
|
+
"eval" : false,
|
|
4269
4312
|
...entryPointsGroupSettings.targetRuntime.type === SupportedECMA_ScriptRuntimesTypes.nodeJS ? {
|
|
4270
4313
|
node: {
|
|
4271
4314
|
__dirname: true,
|
|
@@ -4421,13 +4464,17 @@ class WebpackConfigGenerator {
|
|
|
4421
4464
|
new vue_loader_1.VueLoaderPlugin(),
|
|
4422
4465
|
new eslint_webpack_plugin_1.default({
|
|
4423
4466
|
extensions: ["js", "ts", "vue"],
|
|
4424
|
-
failOnError: this.masterConfigRepresentative.
|
|
4425
|
-
|
|
4467
|
+
failOnError: this.masterConfigRepresentative.isStagingBuildingMode ||
|
|
4468
|
+
this.masterConfigRepresentative.isProductionBuildingMode,
|
|
4469
|
+
failOnWarning: this.masterConfigRepresentative.isStagingBuildingMode ||
|
|
4470
|
+
this.masterConfigRepresentative.isProductionBuildingMode
|
|
4426
4471
|
})
|
|
4427
4472
|
],
|
|
4428
4473
|
optimization: {
|
|
4429
|
-
minimize: this.masterConfigRepresentative.
|
|
4430
|
-
|
|
4474
|
+
minimize: this.masterConfigRepresentative.isStagingBuildingMode ||
|
|
4475
|
+
this.masterConfigRepresentative.isProductionBuildingMode,
|
|
4476
|
+
emitOnErrors: this.masterConfigRepresentative.isStaticPreviewBuildingMode ||
|
|
4477
|
+
this.masterConfigRepresentative.isDevelopmentBuildingMode
|
|
4431
4478
|
}
|
|
4432
4479
|
};
|
|
4433
4480
|
}
|
|
@@ -4450,7 +4497,8 @@ class WebpackConfigGenerator {
|
|
|
4450
4497
|
* [ path at search string of browser ] + publicPath + chunkFilename
|
|
4451
4498
|
* */
|
|
4452
4499
|
computePublicPathIfPossible(ECMA_ScriptLogicEntryPointsGroupSettings__normalized) {
|
|
4453
|
-
if (!this.masterConfigRepresentative.
|
|
4500
|
+
if (!this.masterConfigRepresentative.isStaticPreviewBuildingMode &&
|
|
4501
|
+
!this.masterConfigRepresentative.isDevelopmentBuildingMode) {
|
|
4454
4502
|
return "/";
|
|
4455
4503
|
}
|
|
4456
4504
|
return ECMA_ScriptLogicEntryPointsGroupSettings__normalized.ID.replace(ECMA_ScriptLogicEntryPointsGroupSettings__normalized.ID, "/");
|
|
@@ -4539,9 +4587,7 @@ class MarkupProcessingRawSettingsNormalizer extends SourceCodeProcessingRawSetti
|
|
|
4539
4587
|
lintingCommonSettings;
|
|
4540
4588
|
static normalize({ markupProcessingSettings__fromFile__rawValid, commonSettings__normalized }) {
|
|
4541
4589
|
const lintingCommonSettings = (0, es_extensions_1.isUndefined)(markupProcessingSettings__fromFile__rawValid.linting) ?
|
|
4542
|
-
{
|
|
4543
|
-
isCompletelyDisabled: !MarkupProcessingSettings__Default_1.default.linting.mustExecute
|
|
4544
|
-
} :
|
|
4590
|
+
{ isCompletelyDisabled: !MarkupProcessingSettings__Default_1.default.linting.mustExecute } :
|
|
4545
4591
|
{
|
|
4546
4592
|
isCompletelyDisabled: markupProcessingSettings__fromFile__rawValid.linting.disableCompletely === true ?
|
|
4547
4593
|
true : !MarkupProcessingSettings__Default_1.default.linting.mustExecute,
|
|
@@ -4569,7 +4615,7 @@ class MarkupProcessingRawSettingsNormalizer extends SourceCodeProcessingRawSetti
|
|
|
4569
4615
|
MarkupProcessingSettings__Default_1.default.waitingForOtherFilesWillBeSavedPeriod__seconds
|
|
4570
4616
|
},
|
|
4571
4617
|
linting: lintingCommonSettings,
|
|
4572
|
-
|
|
4618
|
+
relevantEntryPointsGroups: dataHoldingSelfInstance.createNormalizedEntryPointsGroupsSettings(markupProcessingSettings__fromFile__rawValid.entryPointsGroups, dataHoldingSelfInstance.
|
|
4573
4619
|
completeEntryPointsGroupNormalizedSettingsCommonPropertiesUntilMarkupEntryPointsGroupNormalizedSettings.
|
|
4574
4620
|
bind(dataHoldingSelfInstance))
|
|
4575
4621
|
};
|
|
@@ -4579,15 +4625,6 @@ class MarkupProcessingRawSettingsNormalizer extends SourceCodeProcessingRawSetti
|
|
|
4579
4625
|
this.lintingCommonSettings = namedParameters.lintingCommonSettings;
|
|
4580
4626
|
}
|
|
4581
4627
|
completeEntryPointsGroupNormalizedSettingsCommonPropertiesUntilMarkupEntryPointsGroupNormalizedSettings(entryPointsGroupGenericSettings__normalized, entryPointsGroupSettings__rawValid) {
|
|
4582
|
-
const entryPointsGroupSettings__buildingModeDependent__rawValid = entryPointsGroupSettings__rawValid.buildingModeDependent[this.consumingProjectBuildingMode];
|
|
4583
|
-
if ((0, es_extensions_1.isUndefined)(entryPointsGroupSettings__buildingModeDependent__rawValid)) {
|
|
4584
|
-
es_extensions_1.Logger.throwErrorAndLog({
|
|
4585
|
-
errorInstance: new es_extensions_1.AlgorithmMismatchError(`プロジェクト構成モード:「${this.consumingProjectBuildingMode}」に該当する生入点設定が発見されず。`),
|
|
4586
|
-
occurrenceLocation: "MarkupProcessingRawSettingsNormalizer" +
|
|
4587
|
-
"completeEntryPointsGroupNormalizedSettingsCommonPropertiesUntilMarkupEntryPointsGroupNormalizedSettings",
|
|
4588
|
-
title: es_extensions_1.AlgorithmMismatchError.localization.defaultTitle
|
|
4589
|
-
});
|
|
4590
|
-
}
|
|
4591
4628
|
return {
|
|
4592
4629
|
...entryPointsGroupGenericSettings__normalized,
|
|
4593
4630
|
HTML_Validation: {
|
|
@@ -4613,7 +4650,9 @@ class MarkupProcessingRawSettingsNormalizer extends SourceCodeProcessingRawSetti
|
|
|
4613
4650
|
MarkupProcessingSettings__Default_1.default.accessibilityInspection.mustExecute,
|
|
4614
4651
|
standard: entryPointsGroupSettings__rawValid.accessibilityInspection?.standard ??
|
|
4615
4652
|
MarkupProcessingSettings__Default_1.default.accessibilityInspection.standard
|
|
4616
|
-
}
|
|
4653
|
+
},
|
|
4654
|
+
mustConvertToHandlebarsInNonStaticPreviewModes: entryPointsGroupSettings__rawValid.
|
|
4655
|
+
convertToHandlebarsInNonStaticPreviewModes ?? false
|
|
4617
4656
|
};
|
|
4618
4657
|
}
|
|
4619
4658
|
}
|
|
@@ -4658,12 +4697,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4658
4697
|
};
|
|
4659
4698
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4660
4699
|
const GulpStreamBasedSourceCodeProcessingConfigRepresentative_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/SettingsRepresentatives/GulpStreamBasedSourceCodeProcessingConfigRepresentative */ "./ProjectBuilding/Common/SettingsRepresentatives/GulpStreamBasedSourceCodeProcessingConfigRepresentative.ts"));
|
|
4661
|
-
/* --- Utils -------------------------------------------------------------------------------------------------------- */
|
|
4662
|
-
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
4663
4700
|
class MarkupProcessingSettingsRepresentative extends GulpStreamBasedSourceCodeProcessingConfigRepresentative_1.default {
|
|
4664
|
-
TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM = "Markup";
|
|
4665
4701
|
supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots;
|
|
4702
|
+
TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM = "Markup";
|
|
4703
|
+
TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM = "Markup";
|
|
4704
|
+
prefixOfEntryPointsGroupReference = "@";
|
|
4666
4705
|
waitingForTheOtherFilesWillBeSavedPeriod__seconds;
|
|
4706
|
+
entryPointsGroupsNormalizedSettingsMappedByReferences;
|
|
4667
4707
|
sourceCodeLintingCommonSettings;
|
|
4668
4708
|
sourceAndOutputFilesAbsolutePathsCorrespondenceMap = new Map();
|
|
4669
4709
|
relevantEntryPointsGroupsSettings;
|
|
@@ -4672,21 +4712,15 @@ class MarkupProcessingSettingsRepresentative extends GulpStreamBasedSourceCodePr
|
|
|
4672
4712
|
super(projectBuildingMasterConfigRepresentative);
|
|
4673
4713
|
this.sourceCodeProcessingCommonSettings = normalizedMarkupProcessingSettings.common;
|
|
4674
4714
|
this.sourceCodeLintingCommonSettings = normalizedMarkupProcessingSettings.linting;
|
|
4675
|
-
this.relevantEntryPointsGroupsSettings = normalizedMarkupProcessingSettings.
|
|
4676
|
-
entryPointsGroupsActualForCurrentProjectBuildingMode;
|
|
4677
|
-
if (this.relevantEntryPointsGroupsSettings.size === 0) {
|
|
4678
|
-
es_extensions_1.Logger.logWarning({
|
|
4679
|
-
title: "Styles processing idle",
|
|
4680
|
-
description: "Styles processing idle",
|
|
4681
|
-
occurrenceLocation: "No markup processing settings has been specified for project building mode " +
|
|
4682
|
-
`'${this.masterConfigRepresentative.consumingProjectBuildingMode}' and/or current ` +
|
|
4683
|
-
"selective execution."
|
|
4684
|
-
});
|
|
4685
|
-
}
|
|
4715
|
+
this.relevantEntryPointsGroupsSettings = normalizedMarkupProcessingSettings.relevantEntryPointsGroups;
|
|
4686
4716
|
this.supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots = normalizedMarkupProcessingSettings.common.
|
|
4687
4717
|
supportedSourceFileNameExtensionsWithoutLeadingDots;
|
|
4688
4718
|
this.waitingForTheOtherFilesWillBeSavedPeriod__seconds = normalizedMarkupProcessingSettings.common.
|
|
4689
4719
|
waitingForSubsequentFilesWillBeSavedPeriod__seconds;
|
|
4720
|
+
this.entryPointsGroupsNormalizedSettingsMappedByReferences = new Map(Array.from(this.relevantEntryPointsGroupsSettings.values()).map((entryPointsGroupSettings) => [
|
|
4721
|
+
`${this.prefixOfEntryPointsGroupReference}${entryPointsGroupSettings.ID}`,
|
|
4722
|
+
entryPointsGroupSettings
|
|
4723
|
+
]));
|
|
4690
4724
|
super.initializeOrUpdatePartialFilesAndEntryPointsRelationsMap();
|
|
4691
4725
|
}
|
|
4692
4726
|
}
|
|
@@ -4707,7 +4741,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4707
4741
|
};
|
|
4708
4742
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4709
4743
|
const MarkupProcessingRestrictions_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/MarkupProcessingRestrictions */ "./ProjectBuilding/SourceCodeProcessing/Markup/MarkupProcessingRestrictions.ts"));
|
|
4710
|
-
|
|
4744
|
+
const MarkupProcessingSettings__Default = {
|
|
4711
4745
|
waitingForOtherFilesWillBeSavedPeriod__seconds: 1,
|
|
4712
4746
|
linting: {
|
|
4713
4747
|
mustExecute: true,
|
|
@@ -4721,6 +4755,7 @@ exports["default"] = {
|
|
|
4721
4755
|
standard: MarkupProcessingRestrictions_1.default.SupportedAccessibilityStandards.WCAG2AAA
|
|
4722
4756
|
}
|
|
4723
4757
|
};
|
|
4758
|
+
exports["default"] = MarkupProcessingSettings__Default;
|
|
4724
4759
|
|
|
4725
4760
|
|
|
4726
4761
|
/***/ }),
|
|
@@ -4775,6 +4810,7 @@ var MarkupProcessingSettings__FromFile__RawValid;
|
|
|
4775
4810
|
newName: "entryPointsGroups",
|
|
4776
4811
|
type: es_extensions_1.RawObjectDataProcessor.ValuesTypesIDs.associativeArrayOfUniformTypeValues,
|
|
4777
4812
|
required: true,
|
|
4813
|
+
minimalEntriesCount: 1,
|
|
4778
4814
|
value: {
|
|
4779
4815
|
type: Object,
|
|
4780
4816
|
properties: {
|
|
@@ -4824,15 +4860,18 @@ var MarkupProcessingSettings__FromFile__RawValid;
|
|
|
4824
4860
|
}
|
|
4825
4861
|
}
|
|
4826
4862
|
},
|
|
4863
|
+
[markupProcessingLocalization.entryPointsGroups.convertToHandlebarsInNonStaticPreviewModes.KEY]: {
|
|
4864
|
+
newName: "convertToHandlebarsInNonStaticPreviewModes",
|
|
4865
|
+
type: Boolean,
|
|
4866
|
+
required: false
|
|
4867
|
+
},
|
|
4827
4868
|
[markupProcessingLocalization.entryPointsGroups.buildingModeDependent.KEY]: {
|
|
4828
4869
|
newName: "buildingModeDependent",
|
|
4829
4870
|
type: es_extensions_1.RawObjectDataProcessor.ValuesTypesIDs.associativeArrayOfUniformTypeValues,
|
|
4830
4871
|
required: true,
|
|
4831
|
-
|
|
4832
|
-
consumingProjectLocalizedPreDefinedBuildingModes.development,
|
|
4833
|
-
consumingProjectLocalizedPreDefinedBuildingModes.production
|
|
4834
|
-
],
|
|
4872
|
+
minimalEntriesCount: 1,
|
|
4835
4873
|
keysRenamings: {
|
|
4874
|
+
[consumingProjectLocalizedPreDefinedBuildingModes.staticPreview]: ConsumingProjectPreDefinedBuildingModes_1.default.staticPreview,
|
|
4836
4875
|
[consumingProjectLocalizedPreDefinedBuildingModes.development]: ConsumingProjectPreDefinedBuildingModes_1.default.development,
|
|
4837
4876
|
[consumingProjectLocalizedPreDefinedBuildingModes.testing]: ConsumingProjectPreDefinedBuildingModes_1.default.testing,
|
|
4838
4877
|
[consumingProjectLocalizedPreDefinedBuildingModes.production]: ConsumingProjectPreDefinedBuildingModes_1.default.production
|
|
@@ -4881,7 +4920,7 @@ const gulp_pug_1 = __importDefault(__webpack_require__(/*! gulp-pug */ "gulp-pug
|
|
|
4881
4920
|
const gulp_intercept_1 = __importDefault(__webpack_require__(/*! gulp-intercept */ "gulp-intercept"));
|
|
4882
4921
|
const gulp_html_prettify_1 = __importDefault(__webpack_require__(/*! gulp-html-prettify */ "gulp-html-prettify"));
|
|
4883
4922
|
/* --- Applied utils ------------------------------------------------------------------------------------------------ */
|
|
4884
|
-
const
|
|
4923
|
+
const ResourcesReferencesResolverForHTML_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/Plugins/ResourcesReferencesResolverForHTML/ResourcesReferencesResolverForHTML */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/ResourcesReferencesResolverForHTML/ResourcesReferencesResolverForHTML.ts"));
|
|
4885
4924
|
const HTML_Validator_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/Plugins/HTML_Validator/HTML_Validator */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_Validator.ts"));
|
|
4886
4925
|
const AccessibilityInspector_1 = __importDefault(__webpack_require__(/*! ./Plugins/AccessibilityInspector/AccessibilityInspector */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/AccessibilityInspector/AccessibilityInspector.ts"));
|
|
4887
4926
|
const removeExtraSpacesFromJapaneseText_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/Plugins/removeExtraSpacesFromJapaneseText */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/removeExtraSpacesFromJapaneseText.ts"));
|
|
@@ -4898,7 +4937,8 @@ class MarkupProcessor extends GulpStreamsBasedSourceCodeProcessor_1.default {
|
|
|
4898
4937
|
return () => new stream_1.PassThrough().end();
|
|
4899
4938
|
}
|
|
4900
4939
|
const dataHoldingSelfInstance = new MarkupProcessor(masterConfigRepresentative, markupProcessingSettingsRepresentative);
|
|
4901
|
-
if (masterConfigRepresentative.
|
|
4940
|
+
if (masterConfigRepresentative.isStaticPreviewBuildingMode ||
|
|
4941
|
+
masterConfigRepresentative.isDevelopmentBuildingMode) {
|
|
4902
4942
|
dataHoldingSelfInstance.initializeSourceFilesDirectoriesWhichAlwaysWillBeBeingWatchedGlobSelectors();
|
|
4903
4943
|
dataHoldingSelfInstance.initializeOrUpdateWatchedSourceFilesGlobSelectors();
|
|
4904
4944
|
dataHoldingSelfInstance.initializeOrUpdateSourceFilesWatcher();
|
|
@@ -4922,6 +4962,7 @@ class MarkupProcessor extends GulpStreamsBasedSourceCodeProcessor_1.default {
|
|
|
4922
4962
|
pipe((0, gulp_intercept_1.default)(this.addActualSourceCodeProcessingSettingsToVinylFile.bind(this))).
|
|
4923
4963
|
pipe((0, gulp_pug_1.default)({
|
|
4924
4964
|
locals: {
|
|
4965
|
+
__IS_STATIC_PREVIEW_BUILDING_MODE__: this.masterConfigRepresentative.isStaticPreviewBuildingMode,
|
|
4925
4966
|
__IS_DEVELOPMENT_BUILDING_MODE__: this.masterConfigRepresentative.isDevelopmentBuildingMode,
|
|
4926
4967
|
__IS_TESTING_BUILDING_MODE__: this.masterConfigRepresentative.isTestingBuildingMode,
|
|
4927
4968
|
__IS_STAGING_BUILDING_MODE__: this.masterConfigRepresentative.isStagingBuildingMode,
|
|
@@ -4946,16 +4987,25 @@ class MarkupProcessor extends GulpStreamsBasedSourceCodeProcessor_1.default {
|
|
|
4946
4987
|
}
|
|
4947
4988
|
onRawOutputCode(_compiledHTML_File) {
|
|
4948
4989
|
const compiledHTML_File = _compiledHTML_File;
|
|
4949
|
-
compiledHTML_File.contents = Buffer.from(
|
|
4990
|
+
compiledHTML_File.contents = Buffer.from(ResourcesReferencesResolverForHTML_1.default.resolve(compiledHTML_File, this.masterConfigRepresentative));
|
|
4950
4991
|
return compiledHTML_File;
|
|
4951
4992
|
}
|
|
4952
4993
|
onPostProcessedCode(_compiledHTML_File) {
|
|
4953
4994
|
const compiledHTML_File = _compiledHTML_File;
|
|
4954
|
-
|
|
4955
|
-
|
|
4995
|
+
this.markupProcessingConfigRepresentative.
|
|
4996
|
+
sourceAndOutputFilesAbsolutePathsCorrespondenceMap.
|
|
4997
|
+
set(ImprovedPath_1.default.replacePathSeparatorsToForwardSlashes(compiledHTML_File.sourceAbsolutePath), ImprovedPath_1.default.joinPathSegments(compiledHTML_File.outputDirectoryAbsolutePath, compiledHTML_File.basename));
|
|
4998
|
+
if (compiledHTML_File.processingSettings.mustConvertToHandlebarsInNonStaticPreviewModes &&
|
|
4999
|
+
!this.masterConfigRepresentative.isStaticPreviewBuildingMode) {
|
|
5000
|
+
compiledHTML_File.extname = ".hbs";
|
|
4956
5001
|
}
|
|
4957
|
-
|
|
4958
|
-
|
|
5002
|
+
else {
|
|
5003
|
+
if (compiledHTML_File.processingSettings.HTML_Validation.mustExecute) {
|
|
5004
|
+
HTML_Validator_1.default.validateHTML(compiledHTML_File, this.masterConfigRepresentative);
|
|
5005
|
+
}
|
|
5006
|
+
if (compiledHTML_File.processingSettings.accessibilityInspection.mustExecute) {
|
|
5007
|
+
AccessibilityInspector_1.default.inspectAccessibility(compiledHTML_File, this.masterConfigRepresentative);
|
|
5008
|
+
}
|
|
4959
5009
|
}
|
|
4960
5010
|
return compiledHTML_File;
|
|
4961
5011
|
}
|
|
@@ -4984,7 +5034,6 @@ const access_sniff_1 = __importDefault(__webpack_require__(/*! access-sniff */ "
|
|
|
4984
5034
|
const node_notifier_1 = __importDefault(__webpack_require__(/*! node-notifier */ "node-notifier"));
|
|
4985
5035
|
const getExpectedToBeNonNullStringifiedContentOfVinylFile_1 = __importDefault(__webpack_require__(/*! @Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile */ "./Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile.ts"));
|
|
4986
5036
|
const isCompiledHTML_ContentEmpty_1 = __importDefault(__webpack_require__(/*! @Utils/isCompiledHTML_ContentEmpty */ "./Utils/isCompiledHTML_ContentEmpty.ts"));
|
|
4987
|
-
/* --- General utils ------------------------------------------------------------------------------------------------ */
|
|
4988
5037
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
4989
5038
|
const ImprovedPath_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/ImprovedPath/ImprovedPath */ "./UtilsIncubator/ImprovedPath/ImprovedPath.ts"));
|
|
4990
5039
|
const Stopwatch_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/Stopwatch */ "./UtilsIncubator/Stopwatch.ts"));
|
|
@@ -5037,7 +5086,7 @@ class AccessibilityInspector {
|
|
|
5037
5086
|
}
|
|
5038
5087
|
es_extensions_1.Logger.logErrorLikeMessage(AccessibilityInspector.localization.generateIssuesFoundErrorLog({
|
|
5039
5088
|
targetFileRelativePath,
|
|
5040
|
-
|
|
5089
|
+
formattedErrorsAndWarnings: formattedErrors.join("\n\n")
|
|
5041
5090
|
}));
|
|
5042
5091
|
});
|
|
5043
5092
|
}
|
|
@@ -5055,85 +5104,259 @@ exports["default"] = AccessibilityInspector;
|
|
|
5055
5104
|
|
|
5056
5105
|
|
|
5057
5106
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5058
|
-
const
|
|
5107
|
+
const accessibilityInspectorLocalization__english = {
|
|
5059
5108
|
generateFileIsEmptyWarningLog: (namedParameters) => ({
|
|
5060
|
-
title: "
|
|
5061
|
-
description: `File '${namedParameters.targetFileRelativePath}' is empty,
|
|
5109
|
+
title: "HTML code accessibility inspection terminated",
|
|
5110
|
+
description: `File '${namedParameters.targetFileRelativePath}' is empty, nothing to inspect.`
|
|
5062
5111
|
}),
|
|
5063
5112
|
generateInspectionStartedInfoLog: (namedParameters) => ({
|
|
5064
|
-
title: "
|
|
5065
|
-
description: `Begin the inspection of file '${namedParameters.targetFileRelativePath}' ...`
|
|
5113
|
+
title: "HTML code accessibility inspection started",
|
|
5114
|
+
description: `Begin the accessibility inspection of HTML code in the file '${namedParameters.targetFileRelativePath}' ...`
|
|
5066
5115
|
}),
|
|
5067
5116
|
generateInspectionFinishedWithNoIssuesFoundSuccessLog: (namedParameters) => ({
|
|
5068
|
-
title: "
|
|
5069
|
-
description: `
|
|
5117
|
+
title: "HTML code accessibility inspection finished",
|
|
5118
|
+
description: `The HTML code in file '${namedParameters.targetFileRelativePath}' has not the accessibility issues.\n` +
|
|
5070
5119
|
`${namedParameters.secondsElapsed} seconds elapsed.`
|
|
5071
5120
|
}),
|
|
5072
5121
|
issuesFoundNotification: {
|
|
5073
|
-
title: "
|
|
5074
|
-
message: "Accessibility issues detected.
|
|
5122
|
+
title: "HTML code accessibility inspection, issue(s) found",
|
|
5123
|
+
message: "Accessibility issues detected in one or more HTML files. Please check the console for the details."
|
|
5075
5124
|
},
|
|
5076
5125
|
generateIssueOccurrenceLocationIndication: (namedParameters) => `Line ${namedParameters.lineNumber}, column ${namedParameters.columnNumber}`,
|
|
5077
5126
|
generateIssuesFoundErrorLog: (namedParameters) => ({
|
|
5078
|
-
customBadgeText: "
|
|
5079
|
-
title: "
|
|
5080
|
-
description: `
|
|
5081
|
-
`${namedParameters.
|
|
5127
|
+
customBadgeText: "HTML code accessibility inspection not passed",
|
|
5128
|
+
title: "HTML code accessibility inspection, issue(s) found",
|
|
5129
|
+
description: `HTML file '${namedParameters.targetFileRelativePath}' is including the following accessibility issues:\n\n` +
|
|
5130
|
+
`${namedParameters.formattedErrorsAndWarnings}\n\n`
|
|
5082
5131
|
}),
|
|
5083
5132
|
formattedError: {
|
|
5084
5133
|
violatedGuidelineItem: "Violated rule",
|
|
5085
5134
|
keyAndValueSeparator: ":"
|
|
5086
5135
|
}
|
|
5087
5136
|
};
|
|
5088
|
-
exports["default"] =
|
|
5137
|
+
exports["default"] = accessibilityInspectorLocalization__english;
|
|
5138
|
+
|
|
5139
|
+
|
|
5140
|
+
/***/ }),
|
|
5141
|
+
|
|
5142
|
+
/***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_Validator.ts":
|
|
5143
|
+
/*!**********************************************************************************************!*\
|
|
5144
|
+
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_Validator.ts ***!
|
|
5145
|
+
\**********************************************************************************************/
|
|
5146
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
5147
|
+
|
|
5148
|
+
|
|
5149
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5150
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5151
|
+
};
|
|
5152
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5153
|
+
/* --- Assets ------------------------------------------------------------------------------------------------------- */
|
|
5154
|
+
const HTML_ValidatorLocalization_english_1 = __importDefault(__webpack_require__(/*! ./HTML_ValidatorLocalization.english */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_ValidatorLocalization.english.ts"));
|
|
5155
|
+
/* --- Applied utils ------------------------------------------------------------------------------------------------ */
|
|
5156
|
+
const html_validator_1 = __importDefault(__webpack_require__(/*! html-validator */ "html-validator"));
|
|
5157
|
+
const getExpectedToBeNonNullStringifiedContentOfVinylFile_1 = __importDefault(__webpack_require__(/*! @Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile */ "./Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile.ts"));
|
|
5158
|
+
const isCompiledHTML_ContentEmpty_1 = __importDefault(__webpack_require__(/*! @Utils/isCompiledHTML_ContentEmpty */ "./Utils/isCompiledHTML_ContentEmpty.ts"));
|
|
5159
|
+
const node_notifier_1 = __importDefault(__webpack_require__(/*! node-notifier */ "node-notifier"));
|
|
5160
|
+
/* --- General utils ------------------------------------------------------------------------------------------------ */
|
|
5161
|
+
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
5162
|
+
const ImprovedPath_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/ImprovedPath/ImprovedPath */ "./UtilsIncubator/ImprovedPath/ImprovedPath.ts"));
|
|
5163
|
+
const Stopwatch_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/Stopwatch */ "./UtilsIncubator/Stopwatch.ts"));
|
|
5164
|
+
class HTML_Validator {
|
|
5165
|
+
static localization = HTML_ValidatorLocalization_english_1.default;
|
|
5166
|
+
static validateHTML(compiledHTML_File, masterConfigRepresentative) {
|
|
5167
|
+
const extractedHTML_Code = (0, getExpectedToBeNonNullStringifiedContentOfVinylFile_1.default)(compiledHTML_File);
|
|
5168
|
+
const targetFileRelativePath = ImprovedPath_1.default.computeRelativePath({
|
|
5169
|
+
basePath: masterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath,
|
|
5170
|
+
comparedPath: compiledHTML_File.path
|
|
5171
|
+
});
|
|
5172
|
+
if ((0, isCompiledHTML_ContentEmpty_1.default)(extractedHTML_Code)) {
|
|
5173
|
+
es_extensions_1.Logger.logWarning(HTML_Validator.localization.generateFileIsEmptyWarningLog({ targetFileRelativePath }));
|
|
5174
|
+
return;
|
|
5175
|
+
}
|
|
5176
|
+
const validationTimeMeasuringStopwatch = new Stopwatch_1.default().startOrRestart();
|
|
5177
|
+
es_extensions_1.Logger.logInfo(HTML_Validator.localization.generateValidationStartedInfoLog({ targetFileRelativePath }));
|
|
5178
|
+
(0, html_validator_1.default)({
|
|
5179
|
+
/* eslint-disable-next-line id-denylist --
|
|
5180
|
+
* From the viewpoint of TypeScript, the property name does not conflict with imported names.
|
|
5181
|
+
* ESLint community has declined to fix this.
|
|
5182
|
+
* https://github.com/eslint/eslint/issues/15504 */
|
|
5183
|
+
data: extractedHTML_Code,
|
|
5184
|
+
format: "json"
|
|
5185
|
+
}).
|
|
5186
|
+
then((validationResults) => {
|
|
5187
|
+
const validationPeriod__seconds = validationTimeMeasuringStopwatch.stop().seconds;
|
|
5188
|
+
const filteredIssues = (0, es_extensions_1.removeArrayElementsByPredicates)({
|
|
5189
|
+
targetArray: validationResults.messages,
|
|
5190
|
+
predicates: HTML_Validator.getPredicatesForHTML_ValidationIssuesFiltering(),
|
|
5191
|
+
mutably: false
|
|
5192
|
+
}).updatedArray;
|
|
5193
|
+
if (filteredIssues.length === 0) {
|
|
5194
|
+
es_extensions_1.Logger.logSuccess(HTML_Validator.localization.generateValidationFinishedWithNoIssuesFoundSuccessLog({
|
|
5195
|
+
targetFileRelativePath,
|
|
5196
|
+
secondsElapsed: validationPeriod__seconds
|
|
5197
|
+
}));
|
|
5198
|
+
return;
|
|
5199
|
+
}
|
|
5200
|
+
node_notifier_1.default.notify(HTML_Validator.localization.issuesFoundNotification);
|
|
5201
|
+
const formattedErrors = [];
|
|
5202
|
+
for (const issue of filteredIssues) {
|
|
5203
|
+
let accumulatingFormattedError = "";
|
|
5204
|
+
if (HTML_Validator.isValidationMessageLocationObject(issue)) {
|
|
5205
|
+
const codeFragmentPartWhichMustBeHighlighted = issue.extract.substring(issue.hiliteStart, issue.hiliteStart + issue.hiliteLength);
|
|
5206
|
+
accumulatingFormattedError = `${issue.extract.replace(codeFragmentPartWhichMustBeHighlighted, es_extensions_1.Logger.highlightText(codeFragmentPartWhichMustBeHighlighted))}\n${HTML_Validator.localization.generateIssueOccurrenceLocationIndication({
|
|
5207
|
+
lineNumber: issue.lastLine, startingColumnNumber: issue.firstColumn, lastColumnNumber: issue.lastColumn
|
|
5208
|
+
})}\n`;
|
|
5209
|
+
}
|
|
5210
|
+
switch (issue.type) {
|
|
5211
|
+
case "error": {
|
|
5212
|
+
accumulatingFormattedError = `${accumulatingFormattedError}` +
|
|
5213
|
+
`${HTML_Validator.localization.issuesTypesTitles.grossViolation}` +
|
|
5214
|
+
`${HTML_Validator.localization.issuesTypesTitles.keyAndValueSeparator}`;
|
|
5215
|
+
break;
|
|
5216
|
+
}
|
|
5217
|
+
case "info": {
|
|
5218
|
+
accumulatingFormattedError =
|
|
5219
|
+
`${accumulatingFormattedError}` +
|
|
5220
|
+
`${HTML_Validator.localization.issuesTypesTitles.recommendationDisregard}` +
|
|
5221
|
+
`${HTML_Validator.localization.issuesTypesTitles.keyAndValueSeparator}`;
|
|
5222
|
+
break;
|
|
5223
|
+
}
|
|
5224
|
+
default: {
|
|
5225
|
+
accumulatingFormattedError = `${accumulatingFormattedError}` +
|
|
5226
|
+
`${HTML_Validator.localization.issuesTypesTitles.other}` +
|
|
5227
|
+
`${HTML_Validator.localization.issuesTypesTitles.keyAndValueSeparator}`;
|
|
5228
|
+
break;
|
|
5229
|
+
}
|
|
5230
|
+
}
|
|
5231
|
+
accumulatingFormattedError = `${accumulatingFormattedError}${issue.message}`;
|
|
5232
|
+
formattedErrors.push(accumulatingFormattedError);
|
|
5233
|
+
}
|
|
5234
|
+
es_extensions_1.Logger.logErrorLikeMessage(HTML_Validator.localization.generateIssuesFoundErrorLog({
|
|
5235
|
+
targetFileRelativePath,
|
|
5236
|
+
formattedErrorsAndWarnings: formattedErrors.join("\n\n")
|
|
5237
|
+
}));
|
|
5238
|
+
}).
|
|
5239
|
+
catch((error) => {
|
|
5240
|
+
es_extensions_1.Logger.logError({
|
|
5241
|
+
errorType: es_extensions_1.DataRetrievingFailedError.localization.defaultTitle,
|
|
5242
|
+
...HTML_Validator.localization.validationFailedErrorLog,
|
|
5243
|
+
occurrenceLocation: "HTML_Validator.validateHTML(...parameters)",
|
|
5244
|
+
caughtError: error
|
|
5245
|
+
});
|
|
5246
|
+
});
|
|
5247
|
+
}
|
|
5248
|
+
static getPredicatesForHTML_ValidationIssuesFiltering() {
|
|
5249
|
+
return [
|
|
5250
|
+
(HTML_ValidationIssue) => HTML_ValidationIssue.message === "Attribute “webkitdirectory” not allowed on element “input” at this point."
|
|
5251
|
+
];
|
|
5252
|
+
}
|
|
5253
|
+
static isValidationMessageLocationObject(violation) {
|
|
5254
|
+
return (0, es_extensions_1.isArbitraryObject)(violation) &&
|
|
5255
|
+
(0, es_extensions_1.isNotUndefined)(violation.extract) &&
|
|
5256
|
+
(0, es_extensions_1.isNotUndefined)(violation.lastLine) &&
|
|
5257
|
+
(0, es_extensions_1.isNotUndefined)(violation.firstColumn) &&
|
|
5258
|
+
(0, es_extensions_1.isNotUndefined)(violation.lastColumn);
|
|
5259
|
+
}
|
|
5260
|
+
}
|
|
5261
|
+
exports["default"] = HTML_Validator;
|
|
5089
5262
|
|
|
5090
5263
|
|
|
5091
5264
|
/***/ }),
|
|
5092
5265
|
|
|
5093
|
-
/***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/
|
|
5094
|
-
|
|
5095
|
-
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/
|
|
5096
|
-
|
|
5266
|
+
/***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_ValidatorLocalization.english.ts":
|
|
5267
|
+
/*!******************************************************************************************************************!*\
|
|
5268
|
+
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_ValidatorLocalization.english.ts ***!
|
|
5269
|
+
\******************************************************************************************************************/
|
|
5270
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
5271
|
+
|
|
5272
|
+
|
|
5273
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5274
|
+
const HTML_ValidatorLocalization__english = {
|
|
5275
|
+
generateFileIsEmptyWarningLog: (namedParameters) => ({
|
|
5276
|
+
title: "HTML code validation terminated",
|
|
5277
|
+
description: `File '${namedParameters.targetFileRelativePath}' is empty, no HTML to validate.`
|
|
5278
|
+
}),
|
|
5279
|
+
generateValidationStartedInfoLog: (namedParameters) => ({
|
|
5280
|
+
title: "HTML code validation started",
|
|
5281
|
+
description: `Begin the validation of HTML code in the file '${namedParameters.targetFileRelativePath}' ...`
|
|
5282
|
+
}),
|
|
5283
|
+
generateValidationFinishedWithNoIssuesFoundSuccessLog: (namedParameters) => ({
|
|
5284
|
+
title: "HTML validation finished",
|
|
5285
|
+
description: `File '${namedParameters.targetFileRelativePath}' is fully obeying to W3C rules and recommendations.\n` +
|
|
5286
|
+
`${namedParameters.secondsElapsed} seconds elapsed.`
|
|
5287
|
+
}),
|
|
5288
|
+
issuesFoundNotification: {
|
|
5289
|
+
title: "HTML validation, issue(s) found",
|
|
5290
|
+
message: "W3C rules violations and / or recommendations neglect detected. Check the console for the details."
|
|
5291
|
+
},
|
|
5292
|
+
generateIssueOccurrenceLocationIndication: (namedParameters) => `Line ${namedParameters.lineNumber}, ` +
|
|
5293
|
+
`columns ${namedParameters.startingColumnNumber}-${namedParameters.lastColumnNumber}`,
|
|
5294
|
+
issuesTypesTitles: {
|
|
5295
|
+
grossViolation: "Gross violation",
|
|
5296
|
+
recommendationDisregard: "Recommendation disregard",
|
|
5297
|
+
other: "Other issue",
|
|
5298
|
+
keyAndValueSeparator: ": "
|
|
5299
|
+
},
|
|
5300
|
+
generateIssuesFoundErrorLog: (namedParameters) => ({
|
|
5301
|
+
customBadgeText: "HTML validation not passed",
|
|
5302
|
+
title: "HTML validation, issue(s) found",
|
|
5303
|
+
description: `File '${namedParameters.targetFileRelativePath}' is including the following HTML validity issues:\n\n` +
|
|
5304
|
+
`${namedParameters.formattedErrorsAndWarnings}\n\n`
|
|
5305
|
+
}),
|
|
5306
|
+
validationFailedErrorLog: {
|
|
5307
|
+
title: "HTML validation failed",
|
|
5308
|
+
description: "The error occurred during HTML validation"
|
|
5309
|
+
}
|
|
5310
|
+
};
|
|
5311
|
+
exports["default"] = HTML_ValidatorLocalization__english;
|
|
5312
|
+
|
|
5313
|
+
|
|
5314
|
+
/***/ }),
|
|
5315
|
+
|
|
5316
|
+
/***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/ResourcesReferencesResolverForHTML/ResourcesReferencesResolverForHTML.english.ts":
|
|
5317
|
+
/*!**********************************************************************************************************************************************!*\
|
|
5318
|
+
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/ResourcesReferencesResolverForHTML/ResourcesReferencesResolverForHTML.english.ts ***!
|
|
5319
|
+
\**********************************************************************************************************************************************/
|
|
5097
5320
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
5098
5321
|
|
|
5099
5322
|
|
|
5100
5323
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5101
5324
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
5102
|
-
const
|
|
5103
|
-
|
|
5325
|
+
const resourcesReferencesResolverForHTML_Localization__english = {
|
|
5326
|
+
generateUnableToResolveShortenedAbsolutePathWarningLog: (namedParameters) => ({
|
|
5104
5327
|
title: `${(0, es_extensions_1.capitalizeFirstCharacter)(namedParameters.filesType__singularForm)} file, unable to resolve the absolute path`,
|
|
5105
5328
|
description: `Unable to resolve the shortened absolute path for the ${namedParameters.filesType__singularForm} file ` +
|
|
5106
5329
|
`because no public path has been specified for '${namedParameters.projectBuildingMode}' project building mode. ` +
|
|
5107
5330
|
"Relative path will be used instead."
|
|
5108
5331
|
}),
|
|
5109
|
-
|
|
5110
|
-
title:
|
|
5111
|
-
description: `The
|
|
5112
|
-
`'${namedParameters.pickedPathOfTargetResourceFile}'
|
|
5113
|
-
|
|
5332
|
+
generateUnknownResourceGroupReferenceWarningLog: (namedParameters) => ({
|
|
5333
|
+
title: `Unknown reference to ${namedParameters.fileType__pluralForm} files group`,
|
|
5334
|
+
description: `The reference '${namedParameters.firstPathSegment}' in path ` +
|
|
5335
|
+
`'${namedParameters.pickedPathOfTargetResourceFile}' refers to unknown resources group. ` +
|
|
5336
|
+
`Below references are available for ${namedParameters.fileType__pluralForm} files: \n` +
|
|
5114
5337
|
`${namedParameters.formattedSourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap}`
|
|
5115
5338
|
}),
|
|
5116
|
-
|
|
5339
|
+
generateNoMatchingsForAliasedFilePathWithoutFilenameExtensionWarningLog: (namedParameters) => ({
|
|
5117
5340
|
title: `Unknown path to ${namedParameters.fileType__singularForm} file`,
|
|
5118
5341
|
description: `The aliased path '${namedParameters.pickedPathOfTargetResourceFile}' without filename extension ` +
|
|
5119
|
-
"refers to unknown file. Tried to search with all supported filename extensions: " +
|
|
5342
|
+
"refers to unknown file. Tried to search at path with all supported filename extensions: " +
|
|
5120
5343
|
`${namedParameters.checkedAbsolutePaths__formatted}.`
|
|
5121
5344
|
}),
|
|
5122
|
-
|
|
5345
|
+
generateNoOutputFileExistingForSpecifiedSourceFilePathWarningLog: (namedParameters) => ({
|
|
5123
5346
|
title: `Unknown path to ${namedParameters.fileType__singularForm} file`,
|
|
5124
|
-
description: `No ${namedParameters.fileType__singularForm} output file has been found for specified
|
|
5125
|
-
`file path '${namedParameters.pickedPathOfTargetResourceFile}'.`
|
|
5347
|
+
description: `No ${namedParameters.fileType__singularForm} output file has been found for specified source ` +
|
|
5348
|
+
`file path '${namedParameters.pickedPathOfTargetResourceFile}' including reference.`
|
|
5126
5349
|
})
|
|
5127
5350
|
};
|
|
5128
|
-
exports["default"] =
|
|
5351
|
+
exports["default"] = resourcesReferencesResolverForHTML_Localization__english;
|
|
5129
5352
|
|
|
5130
5353
|
|
|
5131
5354
|
/***/ }),
|
|
5132
5355
|
|
|
5133
|
-
/***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/
|
|
5134
|
-
|
|
5135
|
-
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/
|
|
5136
|
-
|
|
5356
|
+
/***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/ResourcesReferencesResolverForHTML/ResourcesReferencesResolverForHTML.ts":
|
|
5357
|
+
/*!**************************************************************************************************************************************!*\
|
|
5358
|
+
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/ResourcesReferencesResolverForHTML/ResourcesReferencesResolverForHTML.ts ***!
|
|
5359
|
+
\**************************************************************************************************************************************/
|
|
5137
5360
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
5138
5361
|
|
|
5139
5362
|
|
|
@@ -5142,27 +5365,28 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5142
5365
|
};
|
|
5143
5366
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5144
5367
|
/* --- Assets ------------------------------------------------------------------------------------------------------- */
|
|
5145
|
-
const
|
|
5368
|
+
const ResourcesReferencesResolverForHTML_english_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/Plugins/ResourcesReferencesResolverForHTML/ResourcesReferencesResolverForHTML.english */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/ResourcesReferencesResolverForHTML/ResourcesReferencesResolverForHTML.english.ts"));
|
|
5146
5369
|
/* --- Applied auxiliaries ------------------------------------------------------------------------------------------ */
|
|
5147
5370
|
const cheerio_1 = __importDefault(__webpack_require__(/*! cheerio */ "cheerio"));
|
|
5148
5371
|
const getExpectedToBeNonNullStringifiedContentOfVinylFile_1 = __importDefault(__webpack_require__(/*! @Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile */ "./Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile.ts"));
|
|
5149
5372
|
/* --- General auxiliaries ------------------------------------------------------------------------------------------ */
|
|
5150
5373
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
5151
5374
|
const ImprovedPath_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/ImprovedPath/ImprovedPath */ "./UtilsIncubator/ImprovedPath/ImprovedPath.ts"));
|
|
5152
|
-
class
|
|
5153
|
-
static localization =
|
|
5375
|
+
class ResourcesReferencesResolverForHTML {
|
|
5376
|
+
static localization = ResourcesReferencesResolverForHTML_english_1.default;
|
|
5154
5377
|
compiledHTML_File;
|
|
5155
5378
|
HTML_FileContentCheerioCapturing;
|
|
5156
5379
|
masterConfigRepresentative;
|
|
5157
|
-
static
|
|
5158
|
-
return new
|
|
5380
|
+
static resolve(compiledHTML_File, masterConfigRepresentative) {
|
|
5381
|
+
return new ResourcesReferencesResolverForHTML(compiledHTML_File, masterConfigRepresentative).
|
|
5382
|
+
resolveInternalLinks().
|
|
5159
5383
|
resolveStylesheetsPathsAliases().
|
|
5160
5384
|
resoleScriptsPathsAliases().
|
|
5161
5385
|
resolveImagesPathsAliases().
|
|
5162
5386
|
resolveVideosPathsAliases().
|
|
5163
5387
|
resolveAudiosPathsAliases().
|
|
5164
5388
|
/* [ Theory ] Without '{ decodeEntities: false }' all ideographic characters will be converted to entities
|
|
5165
|
-
* like '文' what could cause some troubles during HTML code
|
|
5389
|
+
* like '文' what could cause some troubles during post-processing of HTML code. */
|
|
5166
5390
|
HTML_FileContentCheerioCapturing.
|
|
5167
5391
|
html({ decodeEntities: false });
|
|
5168
5392
|
}
|
|
@@ -5171,14 +5395,50 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5171
5395
|
this.HTML_FileContentCheerioCapturing = cheerio_1.default.load((0, getExpectedToBeNonNullStringifiedContentOfVinylFile_1.default)(compiledHTML_File));
|
|
5172
5396
|
this.masterConfigRepresentative = masterConfigRepresentative;
|
|
5173
5397
|
}
|
|
5398
|
+
resolveInternalLinks() {
|
|
5399
|
+
if ((0, es_extensions_1.isUndefined)(this.masterConfigRepresentative.markupProcessingSettingsRepresentative)) {
|
|
5400
|
+
return this;
|
|
5401
|
+
}
|
|
5402
|
+
const markupProcessingSettingsRepresentative = this.masterConfigRepresentative.markupProcessingSettingsRepresentative;
|
|
5403
|
+
for (const anchorElement of Array.from(this.HTML_FileContentCheerioCapturing("a"))) {
|
|
5404
|
+
const anchorCheerioElement = this.HTML_FileContentCheerioCapturing(anchorElement);
|
|
5405
|
+
const hrefAttributeValue = anchorCheerioElement.attr("href");
|
|
5406
|
+
if (!(0, es_extensions_1.isNonEmptyString)(hrefAttributeValue)) {
|
|
5407
|
+
continue;
|
|
5408
|
+
}
|
|
5409
|
+
const resolvedURI = this.resolveOutputResourceFileAbsolutePathIfPossible({
|
|
5410
|
+
pickedPathOfTargetResourceFile: hrefAttributeValue,
|
|
5411
|
+
prefixOfAliasOfTopDirectoryOfResourcesGroup: markupProcessingSettingsRepresentative.prefixOfEntryPointsGroupReference,
|
|
5412
|
+
sourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap: (0, es_extensions_1.createMapBasedOnOtherMap)(markupProcessingSettingsRepresentative.entryPointsGroupsNormalizedSettingsMappedByReferences, (pathAlias, markupEntryPointsGroupNormalizedSettings) => [
|
|
5413
|
+
pathAlias,
|
|
5414
|
+
markupEntryPointsGroupNormalizedSettings.isSingeEntryPointGroup ?
|
|
5415
|
+
markupEntryPointsGroupNormalizedSettings.sourceFilesGlobSelectors[0] :
|
|
5416
|
+
markupEntryPointsGroupNormalizedSettings.sourceFilesTopDirectoryAbsolutePath
|
|
5417
|
+
]),
|
|
5418
|
+
supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots: markupProcessingSettingsRepresentative.
|
|
5419
|
+
supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots,
|
|
5420
|
+
sourceAndOutputFilesAbsolutePathsCorrespondenceMap: markupProcessingSettingsRepresentative.sourceAndOutputFilesAbsolutePathsCorrespondenceMap,
|
|
5421
|
+
fileTypeForLogging__singularForm: markupProcessingSettingsRepresentative.TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM,
|
|
5422
|
+
fileTypeForLogging__pluralForm: markupProcessingSettingsRepresentative.TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM
|
|
5423
|
+
});
|
|
5424
|
+
if ((0, es_extensions_1.isNull)(resolvedURI)) {
|
|
5425
|
+
continue;
|
|
5426
|
+
}
|
|
5427
|
+
anchorCheerioElement.attr("href", this.buildResourceFileFinalPath({
|
|
5428
|
+
resolvedOutputAbsolutePathOfResourceFile: resolvedURI,
|
|
5429
|
+
resourceFileType__singularForm: markupProcessingSettingsRepresentative.TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM
|
|
5430
|
+
}));
|
|
5431
|
+
}
|
|
5432
|
+
return this;
|
|
5433
|
+
}
|
|
5174
5434
|
resolveStylesheetsPathsAliases() {
|
|
5175
5435
|
if ((0, es_extensions_1.isUndefined)(this.masterConfigRepresentative.stylesProcessingSettingsRepresentative)) {
|
|
5176
5436
|
return this;
|
|
5177
5437
|
}
|
|
5178
5438
|
const stylesProcessingSettingsRepresentative = this.masterConfigRepresentative.stylesProcessingSettingsRepresentative;
|
|
5179
5439
|
for (const linkElement of Array.from(this.HTML_FileContentCheerioCapturing("link[rel='stylesheet']"))) {
|
|
5180
|
-
const
|
|
5181
|
-
const hrefAttributeValue =
|
|
5440
|
+
const linkCheerioElement = this.HTML_FileContentCheerioCapturing(linkElement);
|
|
5441
|
+
const hrefAttributeValue = linkCheerioElement.attr("href");
|
|
5182
5442
|
if (!(0, es_extensions_1.isNonEmptyString)(hrefAttributeValue)) {
|
|
5183
5443
|
continue;
|
|
5184
5444
|
}
|
|
@@ -5201,7 +5461,7 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5201
5461
|
if ((0, es_extensions_1.isNull)(resolvedOutputAbsolutePathOfStylesheet)) {
|
|
5202
5462
|
continue;
|
|
5203
5463
|
}
|
|
5204
|
-
|
|
5464
|
+
linkCheerioElement.attr("href", this.buildResourceFileFinalPath({
|
|
5205
5465
|
resolvedOutputAbsolutePathOfResourceFile: resolvedOutputAbsolutePathOfStylesheet,
|
|
5206
5466
|
resourceFileType__singularForm: stylesProcessingSettingsRepresentative.TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM
|
|
5207
5467
|
}));
|
|
@@ -5214,8 +5474,8 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5214
5474
|
}
|
|
5215
5475
|
const ECMA_ScriptLogicProcessingConfigRepresentative = this.masterConfigRepresentative.ECMA_ScriptLogicProcessingSettingsRepresentative;
|
|
5216
5476
|
for (const scriptElement of Array.from(this.HTML_FileContentCheerioCapturing("script"))) {
|
|
5217
|
-
const
|
|
5218
|
-
const srcAttributeValue =
|
|
5477
|
+
const scriptCheerioElement = this.HTML_FileContentCheerioCapturing(scriptElement);
|
|
5478
|
+
const srcAttributeValue = scriptCheerioElement.attr("src");
|
|
5219
5479
|
if (!(0, es_extensions_1.isNonEmptyString)(srcAttributeValue)) {
|
|
5220
5480
|
continue;
|
|
5221
5481
|
}
|
|
@@ -5239,7 +5499,7 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5239
5499
|
if ((0, es_extensions_1.isNull)(resolvedOutputAbsolutePathOfScript)) {
|
|
5240
5500
|
continue;
|
|
5241
5501
|
}
|
|
5242
|
-
|
|
5502
|
+
scriptCheerioElement.attr("src", this.buildResourceFileFinalPath({
|
|
5243
5503
|
resolvedOutputAbsolutePathOfResourceFile: resolvedOutputAbsolutePathOfScript,
|
|
5244
5504
|
resourceFileType__singularForm: ECMA_ScriptLogicProcessingConfigRepresentative.
|
|
5245
5505
|
TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM
|
|
@@ -5253,8 +5513,8 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5253
5513
|
}
|
|
5254
5514
|
const imagesProcessingConfigRepresentative = this.masterConfigRepresentative.imagesProcessingSettingsRepresentative;
|
|
5255
5515
|
for (const imageElement of Array.from(this.HTML_FileContentCheerioCapturing("img"))) {
|
|
5256
|
-
const
|
|
5257
|
-
const srcAttributeValue =
|
|
5516
|
+
const imageCheerioElement = this.HTML_FileContentCheerioCapturing(imageElement);
|
|
5517
|
+
const srcAttributeValue = imageCheerioElement.attr("src");
|
|
5258
5518
|
if (!(0, es_extensions_1.isNonEmptyString)(srcAttributeValue)) {
|
|
5259
5519
|
continue;
|
|
5260
5520
|
}
|
|
@@ -5271,14 +5531,14 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5271
5531
|
if ((0, es_extensions_1.isNull)(resolvedOutputAbsolutePathOfImage)) {
|
|
5272
5532
|
continue;
|
|
5273
5533
|
}
|
|
5274
|
-
|
|
5534
|
+
imageCheerioElement.attr("src", this.buildResourceFileFinalPath({
|
|
5275
5535
|
resolvedOutputAbsolutePathOfResourceFile: resolvedOutputAbsolutePathOfImage,
|
|
5276
5536
|
resourceFileType__singularForm: imagesProcessingConfigRepresentative.TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM
|
|
5277
5537
|
}));
|
|
5278
5538
|
}
|
|
5279
5539
|
for (const linkElement of Array.from(this.HTML_FileContentCheerioCapturing("link[type='image/x-icon']"))) {
|
|
5280
|
-
const
|
|
5281
|
-
const hrefAttributeValue =
|
|
5540
|
+
const linkCheerioElement = this.HTML_FileContentCheerioCapturing(linkElement);
|
|
5541
|
+
const hrefAttributeValue = linkCheerioElement.attr("href");
|
|
5282
5542
|
if ((0, es_extensions_1.isUndefined)(hrefAttributeValue)) {
|
|
5283
5543
|
continue;
|
|
5284
5544
|
}
|
|
@@ -5297,7 +5557,7 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5297
5557
|
if ((0, es_extensions_1.isNull)(imageResolvedOutputAbsolutePath)) {
|
|
5298
5558
|
continue;
|
|
5299
5559
|
}
|
|
5300
|
-
|
|
5560
|
+
linkCheerioElement.attr("href", this.buildResourceFileFinalPath({
|
|
5301
5561
|
resolvedOutputAbsolutePathOfResourceFile: imageResolvedOutputAbsolutePath,
|
|
5302
5562
|
resourceFileType__singularForm: imagesProcessingConfigRepresentative.TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM
|
|
5303
5563
|
}));
|
|
@@ -5310,8 +5570,8 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5310
5570
|
}
|
|
5311
5571
|
const videosProcessingConfigRepresentative = this.masterConfigRepresentative.videosProcessingSettingsRepresentative;
|
|
5312
5572
|
for (const sourceElement of Array.from(this.HTML_FileContentCheerioCapturing("video > source"))) {
|
|
5313
|
-
const
|
|
5314
|
-
const srcAttributeValue =
|
|
5573
|
+
const sourceCheerioElement = this.HTML_FileContentCheerioCapturing(sourceElement);
|
|
5574
|
+
const srcAttributeValue = sourceCheerioElement.attr("src");
|
|
5315
5575
|
if (!(0, es_extensions_1.isNonEmptyString)(srcAttributeValue)) {
|
|
5316
5576
|
continue;
|
|
5317
5577
|
}
|
|
@@ -5328,7 +5588,7 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5328
5588
|
if ((0, es_extensions_1.isNull)(resolvedOutputAbsolutePathOfVideo)) {
|
|
5329
5589
|
continue;
|
|
5330
5590
|
}
|
|
5331
|
-
|
|
5591
|
+
sourceCheerioElement.attr("src", this.buildResourceFileFinalPath({
|
|
5332
5592
|
resolvedOutputAbsolutePathOfResourceFile: resolvedOutputAbsolutePathOfVideo,
|
|
5333
5593
|
resourceFileType__singularForm: videosProcessingConfigRepresentative.TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM
|
|
5334
5594
|
}));
|
|
@@ -5341,8 +5601,8 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5341
5601
|
}
|
|
5342
5602
|
const audiosProcessingConfigRepresentative = this.masterConfigRepresentative.audiosProcessingSettingsRepresentative;
|
|
5343
5603
|
for (const sourceElement of Array.from(this.HTML_FileContentCheerioCapturing("audio > source"))) {
|
|
5344
|
-
const
|
|
5345
|
-
const srcAttributeValue =
|
|
5604
|
+
const sourceCheerioElement = this.HTML_FileContentCheerioCapturing(sourceElement);
|
|
5605
|
+
const srcAttributeValue = sourceCheerioElement.attr("src");
|
|
5346
5606
|
if ((0, es_extensions_1.isUndefined)(srcAttributeValue)) {
|
|
5347
5607
|
continue;
|
|
5348
5608
|
}
|
|
@@ -5359,7 +5619,7 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5359
5619
|
if ((0, es_extensions_1.isNull)(resolvedOutputAbsolutePathOfVideo)) {
|
|
5360
5620
|
continue;
|
|
5361
5621
|
}
|
|
5362
|
-
|
|
5622
|
+
sourceCheerioElement.attr("src", this.buildResourceFileFinalPath({
|
|
5363
5623
|
resolvedOutputAbsolutePathOfResourceFile: resolvedOutputAbsolutePathOfVideo,
|
|
5364
5624
|
resourceFileType__singularForm: audiosProcessingConfigRepresentative.TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM
|
|
5365
5625
|
}));
|
|
@@ -5378,8 +5638,8 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5378
5638
|
}
|
|
5379
5639
|
const sourceFilesTopDirectoryAbsolutePathOfCurrentAlias = sourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap.get(firstSegmentOfPickedPath);
|
|
5380
5640
|
if ((0, es_extensions_1.isUndefined)(sourceFilesTopDirectoryAbsolutePathOfCurrentAlias)) {
|
|
5381
|
-
es_extensions_1.Logger.logWarning(
|
|
5382
|
-
|
|
5641
|
+
es_extensions_1.Logger.logWarning(ResourcesReferencesResolverForHTML.localization.generateUnknownResourceGroupReferenceWarningLog({
|
|
5642
|
+
fileType__pluralForm: fileTypeForLogging__pluralForm,
|
|
5383
5643
|
firstPathSegment: firstSegmentOfPickedPath,
|
|
5384
5644
|
pickedPathOfTargetResourceFile,
|
|
5385
5645
|
formattedSourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap: (0, es_extensions_1.stringifyAndFormatArbitraryValue)(Array.from(sourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap.entries()))
|
|
@@ -5394,8 +5654,8 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5394
5654
|
`${supportedStylesheetFileNameExtensionWithoutLeadingDot}`);
|
|
5395
5655
|
const searchingResultsInSourceFilesAbsolutePathsAndOutputFilesActualPathsMap = (0, es_extensions_1.filterMap)(sourceAndOutputFilesAbsolutePathsCorrespondenceMap, (sourceFileAbsolutePath) => possibleAbsolutePathsOfTargetSourceFile.includes(sourceFileAbsolutePath));
|
|
5396
5656
|
if (searchingResultsInSourceFilesAbsolutePathsAndOutputFilesActualPathsMap.size === 0) {
|
|
5397
|
-
es_extensions_1.Logger.logWarning(
|
|
5398
|
-
|
|
5657
|
+
es_extensions_1.Logger.logWarning(ResourcesReferencesResolverForHTML.localization.
|
|
5658
|
+
generateNoMatchingsForAliasedFilePathWithoutFilenameExtensionWarningLog({
|
|
5399
5659
|
pickedPathOfTargetResourceFile,
|
|
5400
5660
|
fileType__singularForm: fileTypeForLogging__pluralForm,
|
|
5401
5661
|
checkedAbsolutePaths__formatted: (0, es_extensions_1.stringifyAndFormatArbitraryValue)(possibleAbsolutePathsOfTargetSourceFile)
|
|
@@ -5407,7 +5667,7 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5407
5667
|
const resolvedFileOutputAbsolutePath = sourceAndOutputFilesAbsolutePathsCorrespondenceMap.
|
|
5408
5668
|
get(sourceFileComputedAbsolutePathPossiblyWithoutFileNameExtension);
|
|
5409
5669
|
if ((0, es_extensions_1.isUndefined)(resolvedFileOutputAbsolutePath)) {
|
|
5410
|
-
es_extensions_1.Logger.logWarning(
|
|
5670
|
+
es_extensions_1.Logger.logWarning(ResourcesReferencesResolverForHTML.localization.generateNoOutputFileExistingForSpecifiedSourceFilePathWarningLog({
|
|
5411
5671
|
pickedPathOfTargetResourceFile,
|
|
5412
5672
|
fileType__singularForm: fileTypeForLogging__pluralForm
|
|
5413
5673
|
}));
|
|
@@ -5416,12 +5676,13 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5416
5676
|
return resolvedFileOutputAbsolutePath;
|
|
5417
5677
|
}
|
|
5418
5678
|
buildResourceFileFinalPath({ resolvedOutputAbsolutePathOfResourceFile, resourceFileType__singularForm }) {
|
|
5419
|
-
if (this.masterConfigRepresentative.
|
|
5679
|
+
if (this.masterConfigRepresentative.isStaticPreviewBuildingMode ||
|
|
5420
5680
|
(0, es_extensions_1.isUndefined)(this.masterConfigRepresentative.actualPublicDirectoryAbsolutePath)) {
|
|
5421
|
-
if (!this.masterConfigRepresentative.
|
|
5681
|
+
if (!this.masterConfigRepresentative.isStaticPreviewBuildingMode &&
|
|
5422
5682
|
(0, es_extensions_1.isUndefined)(this.masterConfigRepresentative.actualPublicDirectoryAbsolutePath)) {
|
|
5423
|
-
es_extensions_1.Logger.logWarning(
|
|
5683
|
+
es_extensions_1.Logger.logWarning(ResourcesReferencesResolverForHTML.localization.generateUnableToResolveShortenedAbsolutePathWarningLog({
|
|
5424
5684
|
projectBuildingMode: this.masterConfigRepresentative.consumingProjectBuildingMode,
|
|
5685
|
+
targetFileAbsolutePath: resolvedOutputAbsolutePathOfResourceFile,
|
|
5425
5686
|
filesType__singularForm: resourceFileType__singularForm
|
|
5426
5687
|
}));
|
|
5427
5688
|
}
|
|
@@ -5436,181 +5697,7 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5436
5697
|
})}`;
|
|
5437
5698
|
}
|
|
5438
5699
|
}
|
|
5439
|
-
exports["default"] =
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
/***/ }),
|
|
5443
|
-
|
|
5444
|
-
/***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_Validator.ts":
|
|
5445
|
-
/*!**********************************************************************************************!*\
|
|
5446
|
-
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_Validator.ts ***!
|
|
5447
|
-
\**********************************************************************************************/
|
|
5448
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5452
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5453
|
-
};
|
|
5454
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5455
|
-
/* --- Assets ------------------------------------------------------------------------------------------------------- */
|
|
5456
|
-
const HTML_ValidatorLocalization_english_1 = __importDefault(__webpack_require__(/*! ./HTML_ValidatorLocalization.english */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_ValidatorLocalization.english.ts"));
|
|
5457
|
-
/* --- Applied utils ------------------------------------------------------------------------------------------------ */
|
|
5458
|
-
const html_validator_1 = __importDefault(__webpack_require__(/*! html-validator */ "html-validator"));
|
|
5459
|
-
const getExpectedToBeNonNullStringifiedContentOfVinylFile_1 = __importDefault(__webpack_require__(/*! @Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile */ "./Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile.ts"));
|
|
5460
|
-
const isCompiledHTML_ContentEmpty_1 = __importDefault(__webpack_require__(/*! @Utils/isCompiledHTML_ContentEmpty */ "./Utils/isCompiledHTML_ContentEmpty.ts"));
|
|
5461
|
-
const node_notifier_1 = __importDefault(__webpack_require__(/*! node-notifier */ "node-notifier"));
|
|
5462
|
-
/* --- General utils ------------------------------------------------------------------------------------------------ */
|
|
5463
|
-
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
5464
|
-
const ImprovedPath_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/ImprovedPath/ImprovedPath */ "./UtilsIncubator/ImprovedPath/ImprovedPath.ts"));
|
|
5465
|
-
const Stopwatch_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/Stopwatch */ "./UtilsIncubator/Stopwatch.ts"));
|
|
5466
|
-
class HTML_Validator {
|
|
5467
|
-
static localization = HTML_ValidatorLocalization_english_1.default;
|
|
5468
|
-
static validateHTML(compiledHTML_File, masterConfigRepresentative) {
|
|
5469
|
-
const extractedHTML_Code = (0, getExpectedToBeNonNullStringifiedContentOfVinylFile_1.default)(compiledHTML_File);
|
|
5470
|
-
const targetFileRelativePath = ImprovedPath_1.default.computeRelativePath({
|
|
5471
|
-
basePath: masterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath,
|
|
5472
|
-
comparedPath: compiledHTML_File.path
|
|
5473
|
-
});
|
|
5474
|
-
if ((0, isCompiledHTML_ContentEmpty_1.default)(extractedHTML_Code)) {
|
|
5475
|
-
es_extensions_1.Logger.logWarning(HTML_Validator.localization.generateFileIsEmptyWarningLog({ targetFileRelativePath }));
|
|
5476
|
-
return;
|
|
5477
|
-
}
|
|
5478
|
-
const validationTimeMeasuringStopwatch = new Stopwatch_1.default().startOrRestart();
|
|
5479
|
-
es_extensions_1.Logger.logInfo(HTML_Validator.localization.generateValidationStartedInfoLog({ targetFileRelativePath }));
|
|
5480
|
-
(0, html_validator_1.default)({
|
|
5481
|
-
/* eslint-disable-next-line id-denylist --
|
|
5482
|
-
* From the viewpoint of TypeScript, the property name does not conflict with imported names.
|
|
5483
|
-
* ESLint community has declined to fix this.
|
|
5484
|
-
* https://github.com/eslint/eslint/issues/15504 */
|
|
5485
|
-
data: extractedHTML_Code,
|
|
5486
|
-
format: "json"
|
|
5487
|
-
}).
|
|
5488
|
-
then((validationResults) => {
|
|
5489
|
-
const validationPeriod__seconds = validationTimeMeasuringStopwatch.stop().seconds;
|
|
5490
|
-
const filteredIssues = (0, es_extensions_1.removeArrayElementsByPredicates)({
|
|
5491
|
-
targetArray: validationResults.messages,
|
|
5492
|
-
predicates: HTML_Validator.getPredicatesForHTML_ValidationIssuesFiltering(),
|
|
5493
|
-
mutably: false
|
|
5494
|
-
}).updatedArray;
|
|
5495
|
-
if (filteredIssues.length === 0) {
|
|
5496
|
-
es_extensions_1.Logger.logSuccess(HTML_Validator.localization.generateValidationFinishedWithNoIssuesFoundSuccessLog({
|
|
5497
|
-
targetFileRelativePath,
|
|
5498
|
-
secondsElapsed: validationPeriod__seconds
|
|
5499
|
-
}));
|
|
5500
|
-
return;
|
|
5501
|
-
}
|
|
5502
|
-
node_notifier_1.default.notify(HTML_Validator.localization.issuesFoundNotification);
|
|
5503
|
-
const formattedErrors = [];
|
|
5504
|
-
for (const issue of filteredIssues) {
|
|
5505
|
-
let accumulatingFormattedError = "";
|
|
5506
|
-
if (HTML_Validator.isValidationMessageLocationObject(issue)) {
|
|
5507
|
-
const codeFragmentPartWhichMustBeHighlighted = issue.extract.substring(issue.hiliteStart, issue.hiliteStart + issue.hiliteLength);
|
|
5508
|
-
accumulatingFormattedError = `${issue.extract.replace(codeFragmentPartWhichMustBeHighlighted, es_extensions_1.Logger.highlightText(codeFragmentPartWhichMustBeHighlighted))}\n${HTML_Validator.localization.generateIssueOccurrenceLocationIndication({
|
|
5509
|
-
lineNumber: issue.lastLine, startingColumnNumber: issue.firstColumn, lastColumnNumber: issue.lastColumn
|
|
5510
|
-
})}\n`;
|
|
5511
|
-
}
|
|
5512
|
-
switch (issue.type) {
|
|
5513
|
-
case "error": {
|
|
5514
|
-
accumulatingFormattedError = `${accumulatingFormattedError}` +
|
|
5515
|
-
`${HTML_Validator.localization.issuesTypesTitles.grossViolation}` +
|
|
5516
|
-
`${HTML_Validator.localization.issuesTypesTitles.keyAndValueSeparator}`;
|
|
5517
|
-
break;
|
|
5518
|
-
}
|
|
5519
|
-
case "info": {
|
|
5520
|
-
accumulatingFormattedError =
|
|
5521
|
-
`${accumulatingFormattedError}` +
|
|
5522
|
-
`${HTML_Validator.localization.issuesTypesTitles.recommendationDisregard}` +
|
|
5523
|
-
`${HTML_Validator.localization.issuesTypesTitles.keyAndValueSeparator}`;
|
|
5524
|
-
break;
|
|
5525
|
-
}
|
|
5526
|
-
default: {
|
|
5527
|
-
accumulatingFormattedError = `${accumulatingFormattedError}` +
|
|
5528
|
-
`${HTML_Validator.localization.issuesTypesTitles.other}` +
|
|
5529
|
-
`${HTML_Validator.localization.issuesTypesTitles.keyAndValueSeparator}`;
|
|
5530
|
-
break;
|
|
5531
|
-
}
|
|
5532
|
-
}
|
|
5533
|
-
accumulatingFormattedError = `${accumulatingFormattedError}${issue.message}`;
|
|
5534
|
-
formattedErrors.push(accumulatingFormattedError);
|
|
5535
|
-
}
|
|
5536
|
-
es_extensions_1.Logger.logErrorLikeMessage(HTML_Validator.localization.generateIssuesFoundErrorLog({
|
|
5537
|
-
targetFileRelativePath,
|
|
5538
|
-
formattedErrors: formattedErrors.join("\n\n")
|
|
5539
|
-
}));
|
|
5540
|
-
}).
|
|
5541
|
-
catch((error) => {
|
|
5542
|
-
es_extensions_1.Logger.logError({
|
|
5543
|
-
errorType: es_extensions_1.DataRetrievingFailedError.localization.defaultTitle,
|
|
5544
|
-
...HTML_Validator.localization.validationFailedErrorLog,
|
|
5545
|
-
occurrenceLocation: "HTML_Validator.validateHTML(...parameters)",
|
|
5546
|
-
caughtError: error
|
|
5547
|
-
});
|
|
5548
|
-
});
|
|
5549
|
-
}
|
|
5550
|
-
static getPredicatesForHTML_ValidationIssuesFiltering() {
|
|
5551
|
-
return [
|
|
5552
|
-
(HTML_ValidationIssue) => HTML_ValidationIssue.message === "Attribute “webkitdirectory” not allowed on element “input” at this point."
|
|
5553
|
-
];
|
|
5554
|
-
}
|
|
5555
|
-
static isValidationMessageLocationObject(violation) {
|
|
5556
|
-
return (0, es_extensions_1.isArbitraryObject)(violation) &&
|
|
5557
|
-
(0, es_extensions_1.isNotUndefined)(violation.extract) &&
|
|
5558
|
-
(0, es_extensions_1.isNotUndefined)(violation.lastLine) &&
|
|
5559
|
-
(0, es_extensions_1.isNotUndefined)(violation.firstColumn) &&
|
|
5560
|
-
(0, es_extensions_1.isNotUndefined)(violation.lastColumn);
|
|
5561
|
-
}
|
|
5562
|
-
}
|
|
5563
|
-
exports["default"] = HTML_Validator;
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
/***/ }),
|
|
5567
|
-
|
|
5568
|
-
/***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_ValidatorLocalization.english.ts":
|
|
5569
|
-
/*!******************************************************************************************************************!*\
|
|
5570
|
-
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_ValidatorLocalization.english.ts ***!
|
|
5571
|
-
\******************************************************************************************************************/
|
|
5572
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5576
|
-
const HTML_ValidatorLocalization__English = {
|
|
5577
|
-
generateFileIsEmptyWarningLog: (namedParameters) => ({
|
|
5578
|
-
title: "HTML validation terminated",
|
|
5579
|
-
description: `File '${namedParameters.targetFileRelativePath}' is empty, no HTML to inspect.`
|
|
5580
|
-
}),
|
|
5581
|
-
generateValidationStartedInfoLog: (namedParameters) => ({
|
|
5582
|
-
title: "HTML validation started",
|
|
5583
|
-
description: `Begin the inspection of file '${namedParameters.targetFileRelativePath}' ...`
|
|
5584
|
-
}),
|
|
5585
|
-
generateValidationFinishedWithNoIssuesFoundSuccessLog: (namedParameters) => ({
|
|
5586
|
-
title: "HTML validation finished",
|
|
5587
|
-
description: `File '${namedParameters.targetFileRelativePath}' is fully obeying to W3C rules and recommendations.\n` +
|
|
5588
|
-
`${namedParameters.secondsElapsed} seconds elapsed.`
|
|
5589
|
-
}),
|
|
5590
|
-
issuesFoundNotification: {
|
|
5591
|
-
title: "HTML validation, issue(s) found",
|
|
5592
|
-
message: "W3C rules violations and / or recommendations neglect detected. Check the console for the details."
|
|
5593
|
-
},
|
|
5594
|
-
generateIssueOccurrenceLocationIndication: (namedParameters) => `Line ${namedParameters.lineNumber}, ` +
|
|
5595
|
-
`columns ${namedParameters.startingColumnNumber}-${namedParameters.lastColumnNumber}`,
|
|
5596
|
-
issuesTypesTitles: {
|
|
5597
|
-
grossViolation: "Gross violation",
|
|
5598
|
-
recommendationDisregard: "Recommendation disregard",
|
|
5599
|
-
other: "Other issue",
|
|
5600
|
-
keyAndValueSeparator: ": "
|
|
5601
|
-
},
|
|
5602
|
-
generateIssuesFoundErrorLog: (namedParameters) => ({
|
|
5603
|
-
customBadgeText: "HTML validation not passed",
|
|
5604
|
-
title: "HTML validation, issue(s) found",
|
|
5605
|
-
description: `File '${namedParameters.targetFileRelativePath}' is including following HTML validity issues:\n\n` +
|
|
5606
|
-
`${namedParameters.formattedErrors}\n\n`
|
|
5607
|
-
}),
|
|
5608
|
-
validationFailedErrorLog: {
|
|
5609
|
-
title: "HTML validation failed",
|
|
5610
|
-
description: "The error occurred during HTML validation"
|
|
5611
|
-
}
|
|
5612
|
-
};
|
|
5613
|
-
exports["default"] = HTML_ValidatorLocalization__English;
|
|
5700
|
+
exports["default"] = ResourcesReferencesResolverForHTML;
|
|
5614
5701
|
|
|
5615
5702
|
|
|
5616
5703
|
/***/ }),
|
|
@@ -5893,7 +5980,8 @@ exports["default"] = {
|
|
|
5893
5980
|
waitingForSubsequentFilesWillBeSavedPeriod__seconds: 1,
|
|
5894
5981
|
filePathAliasNotation: "@",
|
|
5895
5982
|
revisioning: {
|
|
5896
|
-
mustExecute: (projectBuildingMode__possiblyCustom) => projectBuildingMode__possiblyCustom !== ConsumingProjectPreDefinedBuildingModes_1.default.
|
|
5983
|
+
mustExecute: (projectBuildingMode__possiblyCustom) => projectBuildingMode__possiblyCustom !== ConsumingProjectPreDefinedBuildingModes_1.default.staticPreview &&
|
|
5984
|
+
projectBuildingMode__possiblyCustom !== ConsumingProjectPreDefinedBuildingModes_1.default.development,
|
|
5897
5985
|
contentHashPostfixSeparator: "--"
|
|
5898
5986
|
},
|
|
5899
5987
|
linting: {
|
|
@@ -5982,11 +6070,9 @@ var StylesProcessingSettings__FromFile__RawValid;
|
|
|
5982
6070
|
preValidationModifications: es_extensions_1.nullToUndefined,
|
|
5983
6071
|
type: es_extensions_1.RawObjectDataProcessor.ValuesTypesIDs.associativeArrayOfUniformTypeValues,
|
|
5984
6072
|
required: true,
|
|
5985
|
-
|
|
5986
|
-
consumingProjectLocalizedPreDefinedBuildingModes.development,
|
|
5987
|
-
consumingProjectLocalizedPreDefinedBuildingModes.production
|
|
5988
|
-
],
|
|
6073
|
+
minimalEntriesCount: 1,
|
|
5989
6074
|
keysRenamings: {
|
|
6075
|
+
[consumingProjectLocalizedPreDefinedBuildingModes.development]: ConsumingProjectPreDefinedBuildingModes_1.default.staticPreview,
|
|
5990
6076
|
[consumingProjectLocalizedPreDefinedBuildingModes.development]: ConsumingProjectPreDefinedBuildingModes_1.default.development,
|
|
5991
6077
|
[consumingProjectLocalizedPreDefinedBuildingModes.testing]: ConsumingProjectPreDefinedBuildingModes_1.default.testing,
|
|
5992
6078
|
[consumingProjectLocalizedPreDefinedBuildingModes.production]: ConsumingProjectPreDefinedBuildingModes_1.default.production
|
|
@@ -6059,7 +6145,7 @@ class StylesProcessor extends GulpStreamsBasedSourceCodeProcessor_1.default {
|
|
|
6059
6145
|
return () => new stream_1.PassThrough().end();
|
|
6060
6146
|
}
|
|
6061
6147
|
const dataHoldingSelfInstance = new StylesProcessor(masterConfigRepresentative, stylesProcessingSettingsRepresentative);
|
|
6062
|
-
if (masterConfigRepresentative.isDevelopmentBuildingMode) {
|
|
6148
|
+
if (masterConfigRepresentative.isStaticPreviewBuildingMode || masterConfigRepresentative.isDevelopmentBuildingMode) {
|
|
6063
6149
|
dataHoldingSelfInstance.initializeSourceFilesDirectoriesWhichAlwaysWillBeBeingWatchedGlobSelectors();
|
|
6064
6150
|
dataHoldingSelfInstance.initializeOrUpdateWatchedSourceFilesGlobSelectors();
|
|
6065
6151
|
dataHoldingSelfInstance.initializeOrUpdateSourceFilesWatcher();
|
|
@@ -6081,7 +6167,8 @@ class StylesProcessor extends GulpStreamsBasedSourceCodeProcessor_1.default {
|
|
|
6081
6167
|
pipe(super.printProcessedFilesPathsAndQuantity()).
|
|
6082
6168
|
pipe(super.handleErrorIfItWillOccur()).
|
|
6083
6169
|
pipe((0, gulp_intercept_1.default)(this.addActualSourceCodeProcessingSettingsToVinylFile.bind(this))).
|
|
6084
|
-
pipe((0, gulp_if_1.default)(this.masterConfigRepresentative.
|
|
6170
|
+
pipe((0, gulp_if_1.default)(this.masterConfigRepresentative.isStaticPreviewBuildingMode ||
|
|
6171
|
+
this.masterConfigRepresentative.isDevelopmentBuildingMode, gulp_sourcemaps_1.default.init())).
|
|
6085
6172
|
pipe((0, gulp_if_1.default)((file) => file.mustBeProcessedByStylus, (0, gulp_stylus_1.default)({
|
|
6086
6173
|
/* [ Theory ] Allows to "@include XXX.css" which is critical for third-party libraries usage. */
|
|
6087
6174
|
"include css": true
|
|
@@ -6093,14 +6180,17 @@ class StylesProcessor extends GulpStreamsBasedSourceCodeProcessor_1.default {
|
|
|
6093
6180
|
preset: [
|
|
6094
6181
|
"default",
|
|
6095
6182
|
{
|
|
6096
|
-
normalizeWhitespace: !this.masterConfigRepresentative.
|
|
6097
|
-
|
|
6183
|
+
normalizeWhitespace: !this.masterConfigRepresentative.isStaticPreviewBuildingMode &&
|
|
6184
|
+
!this.masterConfigRepresentative.isDevelopmentBuildingMode,
|
|
6185
|
+
discardComments: !this.masterConfigRepresentative.isStaticPreviewBuildingMode &&
|
|
6186
|
+
!this.masterConfigRepresentative.isDevelopmentBuildingMode
|
|
6098
6187
|
}
|
|
6099
6188
|
]
|
|
6100
6189
|
})
|
|
6101
6190
|
]
|
|
6102
6191
|
}))).
|
|
6103
|
-
pipe((0, gulp_if_1.default)(this.masterConfigRepresentative.
|
|
6192
|
+
pipe((0, gulp_if_1.default)(this.masterConfigRepresentative.isStaticPreviewBuildingMode ||
|
|
6193
|
+
this.masterConfigRepresentative.isDevelopmentBuildingMode, gulp_sourcemaps_1.default.write())).
|
|
6104
6194
|
pipe((0, gulp_intercept_1.default)(this.onPostProcessedCode.bind(this))).
|
|
6105
6195
|
pipe(gulp_1.default.dest((targetFileInFinalState) => targetFileInFinalState.outputDirectoryAbsolutePath));
|
|
6106
6196
|
}
|