@yamato-daiwa/automation 0.0.8 → 0.1.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 +386 -340
- package/package.json +13 -13
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
|
|
@@ -1932,7 +1942,7 @@ class SourceCodeProcessingRawSettingsNormalizer {
|
|
|
1932
1942
|
}
|
|
1933
1943
|
createNormalizedEntryPointsGroupsSettings(entryPointsGroupsSettings__rawValid, completeEntryPointsGroupNormalizedSettingsGeneralPropertiesUntilSpecificEntryPointsGroupNormalizedSettings) {
|
|
1934
1944
|
const entryPointsGroupsSettings__normalized = new Map();
|
|
1935
|
-
/* [ Approach ] This case could be both valid (e.
|
|
1945
|
+
/* [ Approach ] This case could be both valid (e.g. if inside the project markup is being declared only inside
|
|
1936
1946
|
Vue components) or invalid. */
|
|
1937
1947
|
if ((0, es_extensions_1.isUndefined)(entryPointsGroupsSettings__rawValid)) {
|
|
1938
1948
|
return entryPointsGroupsSettings__normalized;
|
|
@@ -2323,7 +2333,6 @@ const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "
|
|
|
2323
2333
|
class GulpStreamsBasedAssetsProcessor extends GulpStreamsBasedTaskExecutor_1.default {
|
|
2324
2334
|
static WAITING_FOR_OTHER_FILES_WILL_BE_SAVED_PERIOD__SECONDS = 1;
|
|
2325
2335
|
associatedAssetsProcessingConfigRepresentative;
|
|
2326
|
-
sourceFilesThoseAlwaysWillBeWatchedGlobSelectors = [];
|
|
2327
2336
|
filesWhichStatusHasBeenChangedAbsolutePathsQueueToProcessing = new Set();
|
|
2328
2337
|
waitingForOtherFilesWillBeSavedDuration = null;
|
|
2329
2338
|
constructor(masterConfigRepresentative, certainAssetsManagementConfigRepresentative) {
|
|
@@ -2331,7 +2340,7 @@ class GulpStreamsBasedAssetsProcessor extends GulpStreamsBasedTaskExecutor_1.def
|
|
|
2331
2340
|
this.associatedAssetsProcessingConfigRepresentative = certainAssetsManagementConfigRepresentative;
|
|
2332
2341
|
}
|
|
2333
2342
|
initializeOrUpdateSourceFilesWatcher() {
|
|
2334
|
-
gulp_1.default.watch(this.
|
|
2343
|
+
gulp_1.default.watch(this.associatedAssetsProcessingConfigRepresentative.relevantSourceFilesGlobSelectors).
|
|
2335
2344
|
on("all", (eventName, fileOrDirectoryPath) => {
|
|
2336
2345
|
es_extensions_1.Logger.logInfo({
|
|
2337
2346
|
title: `${this.SOURCE_FILES_TYPE_LABEL_FOR_LOGGING} files watcher`,
|
|
@@ -2353,7 +2362,7 @@ class GulpStreamsBasedAssetsProcessor extends GulpStreamsBasedTaskExecutor_1.def
|
|
|
2353
2362
|
this.filesWhichStatusHasBeenChangedAbsolutePathsQueueToProcessing.add(fileOrDirectoryPath);
|
|
2354
2363
|
this.waitingForOtherFilesWillBeSavedDuration = setTimeout(() => {
|
|
2355
2364
|
if (this.filesWhichStatusHasBeenChangedAbsolutePathsQueueToProcessing.size > 0) {
|
|
2356
|
-
this.processAssets(Array.from(this.filesWhichStatusHasBeenChangedAbsolutePathsQueueToProcessing));
|
|
2365
|
+
this.processAssets(Array.from(this.filesWhichStatusHasBeenChangedAbsolutePathsQueueToProcessing))();
|
|
2357
2366
|
}
|
|
2358
2367
|
this.filesWhichStatusHasBeenChangedAbsolutePathsQueueToProcessing.clear();
|
|
2359
2368
|
}, (0, es_extensions_1.secondsToMilliseconds)(GulpStreamsBasedAssetsProcessor.WAITING_FOR_OTHER_FILES_WILL_BE_SAVED_PERIOD__SECONDS));
|
|
@@ -2900,6 +2909,7 @@ const ProjectBuildingConfigFromFileDefaultLocalization = {
|
|
|
2900
2909
|
browserLiveReloading: "browserLiveReloading"
|
|
2901
2910
|
},
|
|
2902
2911
|
consumingProjectPreDefinedBuildingModes: {
|
|
2912
|
+
staticPreview: "STATIC_PREVIEW",
|
|
2903
2913
|
development: "DEVELOPMENT",
|
|
2904
2914
|
testing: "TESTING",
|
|
2905
2915
|
staging: "STAGING",
|
|
@@ -3405,6 +3415,9 @@ class ProjectBuildingMasterConfigRepresentative {
|
|
|
3405
3415
|
}
|
|
3406
3416
|
/* --- Project building mode -------------------------------------------------------------------------------------- */
|
|
3407
3417
|
get consumingProjectBuildingMode() { return this.commonSettings.projectBuildingMode; }
|
|
3418
|
+
get isStaticPreviewBuildingMode() {
|
|
3419
|
+
return this.commonSettings.projectBuildingMode === ConsumingProjectPreDefinedBuildingModes_1.default.staticPreview;
|
|
3420
|
+
}
|
|
3408
3421
|
get isDevelopmentBuildingMode() {
|
|
3409
3422
|
return this.commonSettings.projectBuildingMode === ConsumingProjectPreDefinedBuildingModes_1.default.development;
|
|
3410
3423
|
}
|
|
@@ -3445,7 +3458,8 @@ class ProjectBuildingMasterConfigRepresentative {
|
|
|
3445
3458
|
return (0, es_extensions_1.isNotUndefined)(this.videosProcessingSettingsRepresentative);
|
|
3446
3459
|
}
|
|
3447
3460
|
get mustProvideBrowserLiveReloading() {
|
|
3448
|
-
return (0, es_extensions_1.isNotUndefined)(this.browserLiveReloadingSettingsRepresentative) &&
|
|
3461
|
+
return (0, es_extensions_1.isNotUndefined)(this.browserLiveReloadingSettingsRepresentative) &&
|
|
3462
|
+
(this.isStaticPreviewBuildingMode || this.isDevelopmentBuildingMode);
|
|
3449
3463
|
}
|
|
3450
3464
|
/* --- Debugging -------------------------------------------------------------------------------------------------- */
|
|
3451
3465
|
get mustDebugEntryPointsAndPartialFiles() {
|
|
@@ -3715,7 +3729,8 @@ exports["default"] = {
|
|
|
3715
3729
|
mustExecute(namedParameters) {
|
|
3716
3730
|
if (namedParameters.targetRuntimeType === SupportedECMA_ScriptRuntimesTypes.browser ||
|
|
3717
3731
|
namedParameters.targetRuntimeType === SupportedECMA_ScriptRuntimesTypes.webWorker) {
|
|
3718
|
-
return namedParameters.consumingProjectBuildingMode !== ConsumingProjectPreDefinedBuildingModes_1.default.
|
|
3732
|
+
return namedParameters.consumingProjectBuildingMode !== ConsumingProjectPreDefinedBuildingModes_1.default.staticPreview &&
|
|
3733
|
+
namedParameters.consumingProjectBuildingMode !== ConsumingProjectPreDefinedBuildingModes_1.default.development;
|
|
3719
3734
|
}
|
|
3720
3735
|
return false;
|
|
3721
3736
|
},
|
|
@@ -3914,11 +3929,9 @@ var ECMA_ScriptLogicProcessingSettings__FromFile__RawValid;
|
|
|
3914
3929
|
newName: "buildingModeDependent",
|
|
3915
3930
|
type: es_extensions_1.RawObjectDataProcessor.ValuesTypesIDs.associativeArrayOfUniformTypeValues,
|
|
3916
3931
|
required: true,
|
|
3917
|
-
|
|
3918
|
-
consumingProjectLocalizedPreDefinedBuildingModes.development,
|
|
3919
|
-
consumingProjectLocalizedPreDefinedBuildingModes.production
|
|
3920
|
-
],
|
|
3932
|
+
minimalEntriesCount: 1,
|
|
3921
3933
|
keysRenamings: {
|
|
3934
|
+
[consumingProjectLocalizedPreDefinedBuildingModes.staticPreview]: ConsumingProjectPreDefinedBuildingModes_1.default.staticPreview,
|
|
3922
3935
|
[consumingProjectLocalizedPreDefinedBuildingModes.development]: ConsumingProjectPreDefinedBuildingModes_1.default.development,
|
|
3923
3936
|
[consumingProjectLocalizedPreDefinedBuildingModes.testing]: ConsumingProjectPreDefinedBuildingModes_1.default.testing,
|
|
3924
3937
|
[consumingProjectLocalizedPreDefinedBuildingModes.production]: ConsumingProjectPreDefinedBuildingModes_1.default.production
|
|
@@ -4025,7 +4038,8 @@ class ECMA_ScriptLogicProcessor extends TaskExecutor_1.default {
|
|
|
4025
4038
|
});
|
|
4026
4039
|
}
|
|
4027
4040
|
/** 〔 納品版のみ理由 〕 開発版で同じ事をすれば、gulpが落ちる */
|
|
4028
|
-
if (dataHoldingSelfInstance.masterConfigRepresentative.
|
|
4041
|
+
if ((dataHoldingSelfInstance.masterConfigRepresentative.isStagingBuildingMode ||
|
|
4042
|
+
dataHoldingSelfInstance.masterConfigRepresentative.isProductionBuildingMode) &&
|
|
4029
4043
|
(0, es_extensions_1.isNotUndefined)(finalErrorMessageDynamicPart)) {
|
|
4030
4044
|
es_extensions_1.Logger.logError({
|
|
4031
4045
|
errorType: "ECMA_ScriptLogicProcessingError",
|
|
@@ -4156,7 +4170,6 @@ const webpack_1 = __importDefault(__webpack_require__(/*! webpack */ "webpack"))
|
|
|
4156
4170
|
const vue_loader_1 = __webpack_require__(/*! vue-loader */ "vue-loader");
|
|
4157
4171
|
const fork_ts_checker_webpack_plugin_1 = __importDefault(__webpack_require__(/*! fork-ts-checker-webpack-plugin */ "fork-ts-checker-webpack-plugin"));
|
|
4158
4172
|
const eslint_webpack_plugin_1 = __importDefault(__webpack_require__(/*! eslint-webpack-plugin */ "eslint-webpack-plugin"));
|
|
4159
|
-
const typescript_declaration_webpack_plugin_1 = __importDefault(__webpack_require__(/*! typescript-declaration-webpack-plugin */ "typescript-declaration-webpack-plugin"));
|
|
4160
4173
|
const webpack_node_externals_1 = __importDefault(__webpack_require__(/*! webpack-node-externals */ "webpack-node-externals"));
|
|
4161
4174
|
/* --- General utils ------------------------------------------------------------------------------------------------ */
|
|
4162
4175
|
const path_1 = __importDefault(__webpack_require__(/*! path */ "path"));
|
|
@@ -4207,11 +4220,11 @@ class WebpackConfigGenerator {
|
|
|
4207
4220
|
return null;
|
|
4208
4221
|
}
|
|
4209
4222
|
const webpackPublicPath = this.computePublicPathIfPossible(entryPointsGroupSettings);
|
|
4210
|
-
const
|
|
4223
|
+
const willBrowserJS_LibraryBeBuilt = entryPointsGroupSettings.distributing?.exposingOfExportsFromEntryPoints.mustExpose === true &&
|
|
4211
4224
|
entryPointsGroupSettings.targetRuntime.type === SupportedECMA_ScriptRuntimesTypes.browser;
|
|
4212
|
-
const
|
|
4225
|
+
const willNodeJS_LibraryBeBuilt = entryPointsGroupSettings.distributing?.exposingOfExportsFromEntryPoints.mustExpose === true &&
|
|
4213
4226
|
entryPointsGroupSettings.targetRuntime.type === SupportedECMA_ScriptRuntimesTypes.nodeJS;
|
|
4214
|
-
const
|
|
4227
|
+
const willPugLibraryBeBuilt = entryPointsGroupSettings.distributing?.exposingOfExportsFromEntryPoints.mustExpose === true &&
|
|
4215
4228
|
entryPointsGroupSettings.targetRuntime.type === SupportedECMA_ScriptRuntimesTypes.pug;
|
|
4216
4229
|
return {
|
|
4217
4230
|
name: entryPointsGroupSettings.ID,
|
|
@@ -4251,22 +4264,35 @@ class WebpackConfigGenerator {
|
|
|
4251
4264
|
type: (() => {
|
|
4252
4265
|
switch (entryPointsGroupSettings.targetRuntime.type) {
|
|
4253
4266
|
case SupportedECMA_ScriptRuntimesTypes.browser: return "module";
|
|
4254
|
-
case SupportedECMA_ScriptRuntimesTypes.webWorker: return "module";
|
|
4255
4267
|
case SupportedECMA_ScriptRuntimesTypes.nodeJS: return "commonjs";
|
|
4256
4268
|
case SupportedECMA_ScriptRuntimesTypes.pug: return "umd";
|
|
4269
|
+
default: {
|
|
4270
|
+
es_extensions_1.Logger.throwErrorAndLog({
|
|
4271
|
+
errorInstance: new es_extensions_1.UnexpectedEventError("The web worker could not be the library, while the computing of 'output.library.type' has been " +
|
|
4272
|
+
"requested"),
|
|
4273
|
+
title: es_extensions_1.UnexpectedEventError.localization.defaultTitle,
|
|
4274
|
+
occurrenceLocation: "webpackConfigGenerator." +
|
|
4275
|
+
"generateSingleWebpackConfigurationIfAtLeastOneTargetEntryPointFileExists(entryPointsGroupSettings)"
|
|
4276
|
+
});
|
|
4277
|
+
}
|
|
4257
4278
|
}
|
|
4258
4279
|
})(),
|
|
4259
|
-
...
|
|
4280
|
+
...willNodeJS_LibraryBeBuilt || willPugLibraryBeBuilt ? {
|
|
4260
4281
|
name: entryPointsGroupSettings.distributing.exposingOfExportsFromEntryPoints.namespace
|
|
4261
4282
|
} : null
|
|
4262
4283
|
}
|
|
4263
4284
|
} : null,
|
|
4264
|
-
...
|
|
4285
|
+
...willPugLibraryBeBuilt ? { globalObject: "globalThis" } : null
|
|
4265
4286
|
},
|
|
4266
|
-
...
|
|
4267
|
-
mode: this.masterConfigRepresentative.
|
|
4268
|
-
|
|
4269
|
-
|
|
4287
|
+
...willBrowserJS_LibraryBeBuilt ? { experiments: { outputModule: true } } : null,
|
|
4288
|
+
mode: this.masterConfigRepresentative.isStaticPreviewBuildingMode ||
|
|
4289
|
+
this.masterConfigRepresentative.isDevelopmentBuildingMode ?
|
|
4290
|
+
"development" : "production",
|
|
4291
|
+
watch: this.masterConfigRepresentative.isStaticPreviewBuildingMode ||
|
|
4292
|
+
this.masterConfigRepresentative.isDevelopmentBuildingMode,
|
|
4293
|
+
devtool: this.masterConfigRepresentative.isStaticPreviewBuildingMode ||
|
|
4294
|
+
this.masterConfigRepresentative.isDevelopmentBuildingMode ?
|
|
4295
|
+
"eval" : false,
|
|
4270
4296
|
...entryPointsGroupSettings.targetRuntime.type === SupportedECMA_ScriptRuntimesTypes.nodeJS ? {
|
|
4271
4297
|
node: {
|
|
4272
4298
|
__dirname: true,
|
|
@@ -4422,16 +4448,17 @@ class WebpackConfigGenerator {
|
|
|
4422
4448
|
new vue_loader_1.VueLoaderPlugin(),
|
|
4423
4449
|
new eslint_webpack_plugin_1.default({
|
|
4424
4450
|
extensions: ["js", "ts", "vue"],
|
|
4425
|
-
failOnError: this.masterConfigRepresentative.
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
[new typescript_declaration_webpack_plugin_1.default({})] : []
|
|
4451
|
+
failOnError: this.masterConfigRepresentative.isStagingBuildingMode ||
|
|
4452
|
+
this.masterConfigRepresentative.isProductionBuildingMode,
|
|
4453
|
+
failOnWarning: this.masterConfigRepresentative.isStagingBuildingMode ||
|
|
4454
|
+
this.masterConfigRepresentative.isProductionBuildingMode
|
|
4455
|
+
})
|
|
4431
4456
|
],
|
|
4432
4457
|
optimization: {
|
|
4433
|
-
minimize: this.masterConfigRepresentative.
|
|
4434
|
-
|
|
4458
|
+
minimize: this.masterConfigRepresentative.isStagingBuildingMode ||
|
|
4459
|
+
this.masterConfigRepresentative.isProductionBuildingMode,
|
|
4460
|
+
emitOnErrors: this.masterConfigRepresentative.isStaticPreviewBuildingMode ||
|
|
4461
|
+
this.masterConfigRepresentative.isDevelopmentBuildingMode
|
|
4435
4462
|
}
|
|
4436
4463
|
};
|
|
4437
4464
|
}
|
|
@@ -4454,11 +4481,11 @@ class WebpackConfigGenerator {
|
|
|
4454
4481
|
* [ path at search string of browser ] + publicPath + chunkFilename
|
|
4455
4482
|
* */
|
|
4456
4483
|
computePublicPathIfPossible(ECMA_ScriptLogicEntryPointsGroupSettings__normalized) {
|
|
4457
|
-
if (!this.masterConfigRepresentative.
|
|
4484
|
+
if (!this.masterConfigRepresentative.isStaticPreviewBuildingMode &&
|
|
4485
|
+
!this.masterConfigRepresentative.isDevelopmentBuildingMode) {
|
|
4458
4486
|
return "/";
|
|
4459
4487
|
}
|
|
4460
4488
|
return ECMA_ScriptLogicEntryPointsGroupSettings__normalized.ID.replace(ECMA_ScriptLogicEntryPointsGroupSettings__normalized.ID, "/");
|
|
4461
|
-
// Return "/";
|
|
4462
4489
|
}
|
|
4463
4490
|
static getWebpackEntryObjectRespectiveToSpecifiedEntryPointsGroupSettings({ ECMA_ScriptLogicEntryPointsGroupSettings__normalized, webpackContext }) {
|
|
4464
4491
|
/* [ Reference ] https://webpack.js.org/configuration/entry-context/#entry */
|
|
@@ -4544,9 +4571,7 @@ class MarkupProcessingRawSettingsNormalizer extends SourceCodeProcessingRawSetti
|
|
|
4544
4571
|
lintingCommonSettings;
|
|
4545
4572
|
static normalize({ markupProcessingSettings__fromFile__rawValid, commonSettings__normalized }) {
|
|
4546
4573
|
const lintingCommonSettings = (0, es_extensions_1.isUndefined)(markupProcessingSettings__fromFile__rawValid.linting) ?
|
|
4547
|
-
{
|
|
4548
|
-
isCompletelyDisabled: !MarkupProcessingSettings__Default_1.default.linting.mustExecute
|
|
4549
|
-
} :
|
|
4574
|
+
{ isCompletelyDisabled: !MarkupProcessingSettings__Default_1.default.linting.mustExecute } :
|
|
4550
4575
|
{
|
|
4551
4576
|
isCompletelyDisabled: markupProcessingSettings__fromFile__rawValid.linting.disableCompletely === true ?
|
|
4552
4577
|
true : !MarkupProcessingSettings__Default_1.default.linting.mustExecute,
|
|
@@ -4574,7 +4599,7 @@ class MarkupProcessingRawSettingsNormalizer extends SourceCodeProcessingRawSetti
|
|
|
4574
4599
|
MarkupProcessingSettings__Default_1.default.waitingForOtherFilesWillBeSavedPeriod__seconds
|
|
4575
4600
|
},
|
|
4576
4601
|
linting: lintingCommonSettings,
|
|
4577
|
-
|
|
4602
|
+
relevantEntryPointsGroups: dataHoldingSelfInstance.createNormalizedEntryPointsGroupsSettings(markupProcessingSettings__fromFile__rawValid.entryPointsGroups, dataHoldingSelfInstance.
|
|
4578
4603
|
completeEntryPointsGroupNormalizedSettingsCommonPropertiesUntilMarkupEntryPointsGroupNormalizedSettings.
|
|
4579
4604
|
bind(dataHoldingSelfInstance))
|
|
4580
4605
|
};
|
|
@@ -4584,15 +4609,6 @@ class MarkupProcessingRawSettingsNormalizer extends SourceCodeProcessingRawSetti
|
|
|
4584
4609
|
this.lintingCommonSettings = namedParameters.lintingCommonSettings;
|
|
4585
4610
|
}
|
|
4586
4611
|
completeEntryPointsGroupNormalizedSettingsCommonPropertiesUntilMarkupEntryPointsGroupNormalizedSettings(entryPointsGroupGenericSettings__normalized, entryPointsGroupSettings__rawValid) {
|
|
4587
|
-
const entryPointsGroupSettings__buildingModeDependent__rawValid = entryPointsGroupSettings__rawValid.buildingModeDependent[this.consumingProjectBuildingMode];
|
|
4588
|
-
if ((0, es_extensions_1.isUndefined)(entryPointsGroupSettings__buildingModeDependent__rawValid)) {
|
|
4589
|
-
es_extensions_1.Logger.throwErrorAndLog({
|
|
4590
|
-
errorInstance: new es_extensions_1.AlgorithmMismatchError(`プロジェクト構成モード:「${this.consumingProjectBuildingMode}」に該当する生入点設定が発見されず。`),
|
|
4591
|
-
occurrenceLocation: "MarkupProcessingRawSettingsNormalizer" +
|
|
4592
|
-
"completeEntryPointsGroupNormalizedSettingsCommonPropertiesUntilMarkupEntryPointsGroupNormalizedSettings",
|
|
4593
|
-
title: es_extensions_1.AlgorithmMismatchError.localization.defaultTitle
|
|
4594
|
-
});
|
|
4595
|
-
}
|
|
4596
4612
|
return {
|
|
4597
4613
|
...entryPointsGroupGenericSettings__normalized,
|
|
4598
4614
|
HTML_Validation: {
|
|
@@ -4663,12 +4679,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4663
4679
|
};
|
|
4664
4680
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4665
4681
|
const GulpStreamBasedSourceCodeProcessingConfigRepresentative_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/SettingsRepresentatives/GulpStreamBasedSourceCodeProcessingConfigRepresentative */ "./ProjectBuilding/Common/SettingsRepresentatives/GulpStreamBasedSourceCodeProcessingConfigRepresentative.ts"));
|
|
4666
|
-
/* --- Utils -------------------------------------------------------------------------------------------------------- */
|
|
4667
|
-
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
4668
4682
|
class MarkupProcessingSettingsRepresentative extends GulpStreamBasedSourceCodeProcessingConfigRepresentative_1.default {
|
|
4669
|
-
TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM = "Markup";
|
|
4670
4683
|
supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots;
|
|
4684
|
+
TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM = "Markup";
|
|
4685
|
+
TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM = "Markup";
|
|
4686
|
+
prefixOfEntryPointsGroupReference = "@";
|
|
4671
4687
|
waitingForTheOtherFilesWillBeSavedPeriod__seconds;
|
|
4688
|
+
entryPointsGroupsNormalizedSettingsMappedByReferences;
|
|
4672
4689
|
sourceCodeLintingCommonSettings;
|
|
4673
4690
|
sourceAndOutputFilesAbsolutePathsCorrespondenceMap = new Map();
|
|
4674
4691
|
relevantEntryPointsGroupsSettings;
|
|
@@ -4677,21 +4694,15 @@ class MarkupProcessingSettingsRepresentative extends GulpStreamBasedSourceCodePr
|
|
|
4677
4694
|
super(projectBuildingMasterConfigRepresentative);
|
|
4678
4695
|
this.sourceCodeProcessingCommonSettings = normalizedMarkupProcessingSettings.common;
|
|
4679
4696
|
this.sourceCodeLintingCommonSettings = normalizedMarkupProcessingSettings.linting;
|
|
4680
|
-
this.relevantEntryPointsGroupsSettings = normalizedMarkupProcessingSettings.
|
|
4681
|
-
entryPointsGroupsActualForCurrentProjectBuildingMode;
|
|
4682
|
-
if (this.relevantEntryPointsGroupsSettings.size === 0) {
|
|
4683
|
-
es_extensions_1.Logger.logWarning({
|
|
4684
|
-
title: "Styles processing idle",
|
|
4685
|
-
description: "Styles processing idle",
|
|
4686
|
-
occurrenceLocation: "No markup processing settings has been specified for project building mode " +
|
|
4687
|
-
`'${this.masterConfigRepresentative.consumingProjectBuildingMode}' and/or current ` +
|
|
4688
|
-
"selective execution."
|
|
4689
|
-
});
|
|
4690
|
-
}
|
|
4697
|
+
this.relevantEntryPointsGroupsSettings = normalizedMarkupProcessingSettings.relevantEntryPointsGroups;
|
|
4691
4698
|
this.supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots = normalizedMarkupProcessingSettings.common.
|
|
4692
4699
|
supportedSourceFileNameExtensionsWithoutLeadingDots;
|
|
4693
4700
|
this.waitingForTheOtherFilesWillBeSavedPeriod__seconds = normalizedMarkupProcessingSettings.common.
|
|
4694
4701
|
waitingForSubsequentFilesWillBeSavedPeriod__seconds;
|
|
4702
|
+
this.entryPointsGroupsNormalizedSettingsMappedByReferences = new Map(Array.from(this.relevantEntryPointsGroupsSettings.values()).map((entryPointsGroupSettings) => [
|
|
4703
|
+
`${this.prefixOfEntryPointsGroupReference}${entryPointsGroupSettings.ID}`,
|
|
4704
|
+
entryPointsGroupSettings
|
|
4705
|
+
]));
|
|
4695
4706
|
super.initializeOrUpdatePartialFilesAndEntryPointsRelationsMap();
|
|
4696
4707
|
}
|
|
4697
4708
|
}
|
|
@@ -4712,7 +4723,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4712
4723
|
};
|
|
4713
4724
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4714
4725
|
const MarkupProcessingRestrictions_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/MarkupProcessingRestrictions */ "./ProjectBuilding/SourceCodeProcessing/Markup/MarkupProcessingRestrictions.ts"));
|
|
4715
|
-
|
|
4726
|
+
const MarkupProcessingSettings__Default = {
|
|
4716
4727
|
waitingForOtherFilesWillBeSavedPeriod__seconds: 1,
|
|
4717
4728
|
linting: {
|
|
4718
4729
|
mustExecute: true,
|
|
@@ -4726,6 +4737,7 @@ exports["default"] = {
|
|
|
4726
4737
|
standard: MarkupProcessingRestrictions_1.default.SupportedAccessibilityStandards.WCAG2AAA
|
|
4727
4738
|
}
|
|
4728
4739
|
};
|
|
4740
|
+
exports["default"] = MarkupProcessingSettings__Default;
|
|
4729
4741
|
|
|
4730
4742
|
|
|
4731
4743
|
/***/ }),
|
|
@@ -4780,6 +4792,7 @@ var MarkupProcessingSettings__FromFile__RawValid;
|
|
|
4780
4792
|
newName: "entryPointsGroups",
|
|
4781
4793
|
type: es_extensions_1.RawObjectDataProcessor.ValuesTypesIDs.associativeArrayOfUniformTypeValues,
|
|
4782
4794
|
required: true,
|
|
4795
|
+
minimalEntriesCount: 1,
|
|
4783
4796
|
value: {
|
|
4784
4797
|
type: Object,
|
|
4785
4798
|
properties: {
|
|
@@ -4833,11 +4846,9 @@ var MarkupProcessingSettings__FromFile__RawValid;
|
|
|
4833
4846
|
newName: "buildingModeDependent",
|
|
4834
4847
|
type: es_extensions_1.RawObjectDataProcessor.ValuesTypesIDs.associativeArrayOfUniformTypeValues,
|
|
4835
4848
|
required: true,
|
|
4836
|
-
|
|
4837
|
-
consumingProjectLocalizedPreDefinedBuildingModes.development,
|
|
4838
|
-
consumingProjectLocalizedPreDefinedBuildingModes.production
|
|
4839
|
-
],
|
|
4849
|
+
minimalEntriesCount: 1,
|
|
4840
4850
|
keysRenamings: {
|
|
4851
|
+
[consumingProjectLocalizedPreDefinedBuildingModes.staticPreview]: ConsumingProjectPreDefinedBuildingModes_1.default.staticPreview,
|
|
4841
4852
|
[consumingProjectLocalizedPreDefinedBuildingModes.development]: ConsumingProjectPreDefinedBuildingModes_1.default.development,
|
|
4842
4853
|
[consumingProjectLocalizedPreDefinedBuildingModes.testing]: ConsumingProjectPreDefinedBuildingModes_1.default.testing,
|
|
4843
4854
|
[consumingProjectLocalizedPreDefinedBuildingModes.production]: ConsumingProjectPreDefinedBuildingModes_1.default.production
|
|
@@ -4886,7 +4897,7 @@ const gulp_pug_1 = __importDefault(__webpack_require__(/*! gulp-pug */ "gulp-pug
|
|
|
4886
4897
|
const gulp_intercept_1 = __importDefault(__webpack_require__(/*! gulp-intercept */ "gulp-intercept"));
|
|
4887
4898
|
const gulp_html_prettify_1 = __importDefault(__webpack_require__(/*! gulp-html-prettify */ "gulp-html-prettify"));
|
|
4888
4899
|
/* --- Applied utils ------------------------------------------------------------------------------------------------ */
|
|
4889
|
-
const
|
|
4900
|
+
const ResourcesReferencesResolverForHTML_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/Plugins/ResourcesReferencesResolverForHTML/ResourcesReferencesResolverForHTML */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/ResourcesReferencesResolverForHTML/ResourcesReferencesResolverForHTML.ts"));
|
|
4890
4901
|
const HTML_Validator_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/Plugins/HTML_Validator/HTML_Validator */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_Validator.ts"));
|
|
4891
4902
|
const AccessibilityInspector_1 = __importDefault(__webpack_require__(/*! ./Plugins/AccessibilityInspector/AccessibilityInspector */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/AccessibilityInspector/AccessibilityInspector.ts"));
|
|
4892
4903
|
const removeExtraSpacesFromJapaneseText_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/Plugins/removeExtraSpacesFromJapaneseText */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/removeExtraSpacesFromJapaneseText.ts"));
|
|
@@ -4903,7 +4914,8 @@ class MarkupProcessor extends GulpStreamsBasedSourceCodeProcessor_1.default {
|
|
|
4903
4914
|
return () => new stream_1.PassThrough().end();
|
|
4904
4915
|
}
|
|
4905
4916
|
const dataHoldingSelfInstance = new MarkupProcessor(masterConfigRepresentative, markupProcessingSettingsRepresentative);
|
|
4906
|
-
if (masterConfigRepresentative.
|
|
4917
|
+
if (masterConfigRepresentative.isStaticPreviewBuildingMode ||
|
|
4918
|
+
masterConfigRepresentative.isDevelopmentBuildingMode) {
|
|
4907
4919
|
dataHoldingSelfInstance.initializeSourceFilesDirectoriesWhichAlwaysWillBeBeingWatchedGlobSelectors();
|
|
4908
4920
|
dataHoldingSelfInstance.initializeOrUpdateWatchedSourceFilesGlobSelectors();
|
|
4909
4921
|
dataHoldingSelfInstance.initializeOrUpdateSourceFilesWatcher();
|
|
@@ -4927,6 +4939,7 @@ class MarkupProcessor extends GulpStreamsBasedSourceCodeProcessor_1.default {
|
|
|
4927
4939
|
pipe((0, gulp_intercept_1.default)(this.addActualSourceCodeProcessingSettingsToVinylFile.bind(this))).
|
|
4928
4940
|
pipe((0, gulp_pug_1.default)({
|
|
4929
4941
|
locals: {
|
|
4942
|
+
__IS_STATIC_PREVIEW_BUILDING_MODE__: this.masterConfigRepresentative.isStaticPreviewBuildingMode,
|
|
4930
4943
|
__IS_DEVELOPMENT_BUILDING_MODE__: this.masterConfigRepresentative.isDevelopmentBuildingMode,
|
|
4931
4944
|
__IS_TESTING_BUILDING_MODE__: this.masterConfigRepresentative.isTestingBuildingMode,
|
|
4932
4945
|
__IS_STAGING_BUILDING_MODE__: this.masterConfigRepresentative.isStagingBuildingMode,
|
|
@@ -4951,11 +4964,14 @@ class MarkupProcessor extends GulpStreamsBasedSourceCodeProcessor_1.default {
|
|
|
4951
4964
|
}
|
|
4952
4965
|
onRawOutputCode(_compiledHTML_File) {
|
|
4953
4966
|
const compiledHTML_File = _compiledHTML_File;
|
|
4954
|
-
compiledHTML_File.contents = Buffer.from(
|
|
4967
|
+
compiledHTML_File.contents = Buffer.from(ResourcesReferencesResolverForHTML_1.default.resolve(compiledHTML_File, this.masterConfigRepresentative));
|
|
4955
4968
|
return compiledHTML_File;
|
|
4956
4969
|
}
|
|
4957
4970
|
onPostProcessedCode(_compiledHTML_File) {
|
|
4958
4971
|
const compiledHTML_File = _compiledHTML_File;
|
|
4972
|
+
this.markupProcessingConfigRepresentative.
|
|
4973
|
+
sourceAndOutputFilesAbsolutePathsCorrespondenceMap.
|
|
4974
|
+
set(ImprovedPath_1.default.replacePathSeparatorsToForwardSlashes(compiledHTML_File.sourceAbsolutePath), ImprovedPath_1.default.joinPathSegments(compiledHTML_File.outputDirectoryAbsolutePath, compiledHTML_File.basename));
|
|
4959
4975
|
if (compiledHTML_File.processingSettings.HTML_Validation.mustExecute) {
|
|
4960
4976
|
HTML_Validator_1.default.validateHTML(compiledHTML_File, this.masterConfigRepresentative);
|
|
4961
4977
|
}
|
|
@@ -4989,7 +5005,6 @@ const access_sniff_1 = __importDefault(__webpack_require__(/*! access-sniff */ "
|
|
|
4989
5005
|
const node_notifier_1 = __importDefault(__webpack_require__(/*! node-notifier */ "node-notifier"));
|
|
4990
5006
|
const getExpectedToBeNonNullStringifiedContentOfVinylFile_1 = __importDefault(__webpack_require__(/*! @Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile */ "./Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile.ts"));
|
|
4991
5007
|
const isCompiledHTML_ContentEmpty_1 = __importDefault(__webpack_require__(/*! @Utils/isCompiledHTML_ContentEmpty */ "./Utils/isCompiledHTML_ContentEmpty.ts"));
|
|
4992
|
-
/* --- General utils ------------------------------------------------------------------------------------------------ */
|
|
4993
5008
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
4994
5009
|
const ImprovedPath_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/ImprovedPath/ImprovedPath */ "./UtilsIncubator/ImprovedPath/ImprovedPath.ts"));
|
|
4995
5010
|
const Stopwatch_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/Stopwatch */ "./UtilsIncubator/Stopwatch.ts"));
|
|
@@ -5042,7 +5057,7 @@ class AccessibilityInspector {
|
|
|
5042
5057
|
}
|
|
5043
5058
|
es_extensions_1.Logger.logErrorLikeMessage(AccessibilityInspector.localization.generateIssuesFoundErrorLog({
|
|
5044
5059
|
targetFileRelativePath,
|
|
5045
|
-
|
|
5060
|
+
formattedErrorsAndWarnings: formattedErrors.join("\n\n")
|
|
5046
5061
|
}));
|
|
5047
5062
|
});
|
|
5048
5063
|
}
|
|
@@ -5060,85 +5075,259 @@ exports["default"] = AccessibilityInspector;
|
|
|
5060
5075
|
|
|
5061
5076
|
|
|
5062
5077
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5063
|
-
const
|
|
5078
|
+
const accessibilityInspectorLocalization__english = {
|
|
5064
5079
|
generateFileIsEmptyWarningLog: (namedParameters) => ({
|
|
5065
|
-
title: "
|
|
5066
|
-
description: `File '${namedParameters.targetFileRelativePath}' is empty,
|
|
5080
|
+
title: "HTML code accessibility inspection terminated",
|
|
5081
|
+
description: `File '${namedParameters.targetFileRelativePath}' is empty, nothing to inspect.`
|
|
5067
5082
|
}),
|
|
5068
5083
|
generateInspectionStartedInfoLog: (namedParameters) => ({
|
|
5069
|
-
title: "
|
|
5070
|
-
description: `Begin the inspection of file '${namedParameters.targetFileRelativePath}' ...`
|
|
5084
|
+
title: "HTML code accessibility inspection started",
|
|
5085
|
+
description: `Begin the accessibility inspection of HTML code in the file '${namedParameters.targetFileRelativePath}' ...`
|
|
5071
5086
|
}),
|
|
5072
5087
|
generateInspectionFinishedWithNoIssuesFoundSuccessLog: (namedParameters) => ({
|
|
5073
|
-
title: "
|
|
5074
|
-
description: `
|
|
5088
|
+
title: "HTML code accessibility inspection finished",
|
|
5089
|
+
description: `The HTML code in file '${namedParameters.targetFileRelativePath}' has not the accessibility issues.\n` +
|
|
5075
5090
|
`${namedParameters.secondsElapsed} seconds elapsed.`
|
|
5076
5091
|
}),
|
|
5077
5092
|
issuesFoundNotification: {
|
|
5078
|
-
title: "
|
|
5079
|
-
message: "Accessibility issues detected.
|
|
5093
|
+
title: "HTML code accessibility inspection, issue(s) found",
|
|
5094
|
+
message: "Accessibility issues detected in one or more HTML files. Please check the console for the details."
|
|
5080
5095
|
},
|
|
5081
5096
|
generateIssueOccurrenceLocationIndication: (namedParameters) => `Line ${namedParameters.lineNumber}, column ${namedParameters.columnNumber}`,
|
|
5082
5097
|
generateIssuesFoundErrorLog: (namedParameters) => ({
|
|
5083
|
-
customBadgeText: "
|
|
5084
|
-
title: "
|
|
5085
|
-
description: `
|
|
5086
|
-
`${namedParameters.
|
|
5098
|
+
customBadgeText: "HTML code accessibility inspection not passed",
|
|
5099
|
+
title: "HTML code accessibility inspection, issue(s) found",
|
|
5100
|
+
description: `HTML file '${namedParameters.targetFileRelativePath}' is including the following accessibility issues:\n\n` +
|
|
5101
|
+
`${namedParameters.formattedErrorsAndWarnings}\n\n`
|
|
5087
5102
|
}),
|
|
5088
5103
|
formattedError: {
|
|
5089
5104
|
violatedGuidelineItem: "Violated rule",
|
|
5090
5105
|
keyAndValueSeparator: ":"
|
|
5091
5106
|
}
|
|
5092
5107
|
};
|
|
5093
|
-
exports["default"] =
|
|
5108
|
+
exports["default"] = accessibilityInspectorLocalization__english;
|
|
5094
5109
|
|
|
5095
5110
|
|
|
5096
5111
|
/***/ }),
|
|
5097
5112
|
|
|
5098
|
-
/***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/
|
|
5099
|
-
|
|
5100
|
-
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/
|
|
5101
|
-
|
|
5113
|
+
/***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_Validator.ts":
|
|
5114
|
+
/*!**********************************************************************************************!*\
|
|
5115
|
+
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_Validator.ts ***!
|
|
5116
|
+
\**********************************************************************************************/
|
|
5117
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
5118
|
+
|
|
5119
|
+
|
|
5120
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5121
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5122
|
+
};
|
|
5123
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5124
|
+
/* --- Assets ------------------------------------------------------------------------------------------------------- */
|
|
5125
|
+
const HTML_ValidatorLocalization_english_1 = __importDefault(__webpack_require__(/*! ./HTML_ValidatorLocalization.english */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_ValidatorLocalization.english.ts"));
|
|
5126
|
+
/* --- Applied utils ------------------------------------------------------------------------------------------------ */
|
|
5127
|
+
const html_validator_1 = __importDefault(__webpack_require__(/*! html-validator */ "html-validator"));
|
|
5128
|
+
const getExpectedToBeNonNullStringifiedContentOfVinylFile_1 = __importDefault(__webpack_require__(/*! @Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile */ "./Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile.ts"));
|
|
5129
|
+
const isCompiledHTML_ContentEmpty_1 = __importDefault(__webpack_require__(/*! @Utils/isCompiledHTML_ContentEmpty */ "./Utils/isCompiledHTML_ContentEmpty.ts"));
|
|
5130
|
+
const node_notifier_1 = __importDefault(__webpack_require__(/*! node-notifier */ "node-notifier"));
|
|
5131
|
+
/* --- General utils ------------------------------------------------------------------------------------------------ */
|
|
5132
|
+
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
5133
|
+
const ImprovedPath_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/ImprovedPath/ImprovedPath */ "./UtilsIncubator/ImprovedPath/ImprovedPath.ts"));
|
|
5134
|
+
const Stopwatch_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/Stopwatch */ "./UtilsIncubator/Stopwatch.ts"));
|
|
5135
|
+
class HTML_Validator {
|
|
5136
|
+
static localization = HTML_ValidatorLocalization_english_1.default;
|
|
5137
|
+
static validateHTML(compiledHTML_File, masterConfigRepresentative) {
|
|
5138
|
+
const extractedHTML_Code = (0, getExpectedToBeNonNullStringifiedContentOfVinylFile_1.default)(compiledHTML_File);
|
|
5139
|
+
const targetFileRelativePath = ImprovedPath_1.default.computeRelativePath({
|
|
5140
|
+
basePath: masterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath,
|
|
5141
|
+
comparedPath: compiledHTML_File.path
|
|
5142
|
+
});
|
|
5143
|
+
if ((0, isCompiledHTML_ContentEmpty_1.default)(extractedHTML_Code)) {
|
|
5144
|
+
es_extensions_1.Logger.logWarning(HTML_Validator.localization.generateFileIsEmptyWarningLog({ targetFileRelativePath }));
|
|
5145
|
+
return;
|
|
5146
|
+
}
|
|
5147
|
+
const validationTimeMeasuringStopwatch = new Stopwatch_1.default().startOrRestart();
|
|
5148
|
+
es_extensions_1.Logger.logInfo(HTML_Validator.localization.generateValidationStartedInfoLog({ targetFileRelativePath }));
|
|
5149
|
+
(0, html_validator_1.default)({
|
|
5150
|
+
/* eslint-disable-next-line id-denylist --
|
|
5151
|
+
* From the viewpoint of TypeScript, the property name does not conflict with imported names.
|
|
5152
|
+
* ESLint community has declined to fix this.
|
|
5153
|
+
* https://github.com/eslint/eslint/issues/15504 */
|
|
5154
|
+
data: extractedHTML_Code,
|
|
5155
|
+
format: "json"
|
|
5156
|
+
}).
|
|
5157
|
+
then((validationResults) => {
|
|
5158
|
+
const validationPeriod__seconds = validationTimeMeasuringStopwatch.stop().seconds;
|
|
5159
|
+
const filteredIssues = (0, es_extensions_1.removeArrayElementsByPredicates)({
|
|
5160
|
+
targetArray: validationResults.messages,
|
|
5161
|
+
predicates: HTML_Validator.getPredicatesForHTML_ValidationIssuesFiltering(),
|
|
5162
|
+
mutably: false
|
|
5163
|
+
}).updatedArray;
|
|
5164
|
+
if (filteredIssues.length === 0) {
|
|
5165
|
+
es_extensions_1.Logger.logSuccess(HTML_Validator.localization.generateValidationFinishedWithNoIssuesFoundSuccessLog({
|
|
5166
|
+
targetFileRelativePath,
|
|
5167
|
+
secondsElapsed: validationPeriod__seconds
|
|
5168
|
+
}));
|
|
5169
|
+
return;
|
|
5170
|
+
}
|
|
5171
|
+
node_notifier_1.default.notify(HTML_Validator.localization.issuesFoundNotification);
|
|
5172
|
+
const formattedErrors = [];
|
|
5173
|
+
for (const issue of filteredIssues) {
|
|
5174
|
+
let accumulatingFormattedError = "";
|
|
5175
|
+
if (HTML_Validator.isValidationMessageLocationObject(issue)) {
|
|
5176
|
+
const codeFragmentPartWhichMustBeHighlighted = issue.extract.substring(issue.hiliteStart, issue.hiliteStart + issue.hiliteLength);
|
|
5177
|
+
accumulatingFormattedError = `${issue.extract.replace(codeFragmentPartWhichMustBeHighlighted, es_extensions_1.Logger.highlightText(codeFragmentPartWhichMustBeHighlighted))}\n${HTML_Validator.localization.generateIssueOccurrenceLocationIndication({
|
|
5178
|
+
lineNumber: issue.lastLine, startingColumnNumber: issue.firstColumn, lastColumnNumber: issue.lastColumn
|
|
5179
|
+
})}\n`;
|
|
5180
|
+
}
|
|
5181
|
+
switch (issue.type) {
|
|
5182
|
+
case "error": {
|
|
5183
|
+
accumulatingFormattedError = `${accumulatingFormattedError}` +
|
|
5184
|
+
`${HTML_Validator.localization.issuesTypesTitles.grossViolation}` +
|
|
5185
|
+
`${HTML_Validator.localization.issuesTypesTitles.keyAndValueSeparator}`;
|
|
5186
|
+
break;
|
|
5187
|
+
}
|
|
5188
|
+
case "info": {
|
|
5189
|
+
accumulatingFormattedError =
|
|
5190
|
+
`${accumulatingFormattedError}` +
|
|
5191
|
+
`${HTML_Validator.localization.issuesTypesTitles.recommendationDisregard}` +
|
|
5192
|
+
`${HTML_Validator.localization.issuesTypesTitles.keyAndValueSeparator}`;
|
|
5193
|
+
break;
|
|
5194
|
+
}
|
|
5195
|
+
default: {
|
|
5196
|
+
accumulatingFormattedError = `${accumulatingFormattedError}` +
|
|
5197
|
+
`${HTML_Validator.localization.issuesTypesTitles.other}` +
|
|
5198
|
+
`${HTML_Validator.localization.issuesTypesTitles.keyAndValueSeparator}`;
|
|
5199
|
+
break;
|
|
5200
|
+
}
|
|
5201
|
+
}
|
|
5202
|
+
accumulatingFormattedError = `${accumulatingFormattedError}${issue.message}`;
|
|
5203
|
+
formattedErrors.push(accumulatingFormattedError);
|
|
5204
|
+
}
|
|
5205
|
+
es_extensions_1.Logger.logErrorLikeMessage(HTML_Validator.localization.generateIssuesFoundErrorLog({
|
|
5206
|
+
targetFileRelativePath,
|
|
5207
|
+
formattedErrorsAndWarnings: formattedErrors.join("\n\n")
|
|
5208
|
+
}));
|
|
5209
|
+
}).
|
|
5210
|
+
catch((error) => {
|
|
5211
|
+
es_extensions_1.Logger.logError({
|
|
5212
|
+
errorType: es_extensions_1.DataRetrievingFailedError.localization.defaultTitle,
|
|
5213
|
+
...HTML_Validator.localization.validationFailedErrorLog,
|
|
5214
|
+
occurrenceLocation: "HTML_Validator.validateHTML(...parameters)",
|
|
5215
|
+
caughtError: error
|
|
5216
|
+
});
|
|
5217
|
+
});
|
|
5218
|
+
}
|
|
5219
|
+
static getPredicatesForHTML_ValidationIssuesFiltering() {
|
|
5220
|
+
return [
|
|
5221
|
+
(HTML_ValidationIssue) => HTML_ValidationIssue.message === "Attribute “webkitdirectory” not allowed on element “input” at this point."
|
|
5222
|
+
];
|
|
5223
|
+
}
|
|
5224
|
+
static isValidationMessageLocationObject(violation) {
|
|
5225
|
+
return (0, es_extensions_1.isArbitraryObject)(violation) &&
|
|
5226
|
+
(0, es_extensions_1.isNotUndefined)(violation.extract) &&
|
|
5227
|
+
(0, es_extensions_1.isNotUndefined)(violation.lastLine) &&
|
|
5228
|
+
(0, es_extensions_1.isNotUndefined)(violation.firstColumn) &&
|
|
5229
|
+
(0, es_extensions_1.isNotUndefined)(violation.lastColumn);
|
|
5230
|
+
}
|
|
5231
|
+
}
|
|
5232
|
+
exports["default"] = HTML_Validator;
|
|
5233
|
+
|
|
5234
|
+
|
|
5235
|
+
/***/ }),
|
|
5236
|
+
|
|
5237
|
+
/***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_ValidatorLocalization.english.ts":
|
|
5238
|
+
/*!******************************************************************************************************************!*\
|
|
5239
|
+
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_ValidatorLocalization.english.ts ***!
|
|
5240
|
+
\******************************************************************************************************************/
|
|
5241
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
5242
|
+
|
|
5243
|
+
|
|
5244
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5245
|
+
const HTML_ValidatorLocalization__english = {
|
|
5246
|
+
generateFileIsEmptyWarningLog: (namedParameters) => ({
|
|
5247
|
+
title: "HTML code validation terminated",
|
|
5248
|
+
description: `File '${namedParameters.targetFileRelativePath}' is empty, no HTML to validate.`
|
|
5249
|
+
}),
|
|
5250
|
+
generateValidationStartedInfoLog: (namedParameters) => ({
|
|
5251
|
+
title: "HTML code validation started",
|
|
5252
|
+
description: `Begin the validation of HTML code in the file '${namedParameters.targetFileRelativePath}' ...`
|
|
5253
|
+
}),
|
|
5254
|
+
generateValidationFinishedWithNoIssuesFoundSuccessLog: (namedParameters) => ({
|
|
5255
|
+
title: "HTML validation finished",
|
|
5256
|
+
description: `File '${namedParameters.targetFileRelativePath}' is fully obeying to W3C rules and recommendations.\n` +
|
|
5257
|
+
`${namedParameters.secondsElapsed} seconds elapsed.`
|
|
5258
|
+
}),
|
|
5259
|
+
issuesFoundNotification: {
|
|
5260
|
+
title: "HTML validation, issue(s) found",
|
|
5261
|
+
message: "W3C rules violations and / or recommendations neglect detected. Check the console for the details."
|
|
5262
|
+
},
|
|
5263
|
+
generateIssueOccurrenceLocationIndication: (namedParameters) => `Line ${namedParameters.lineNumber}, ` +
|
|
5264
|
+
`columns ${namedParameters.startingColumnNumber}-${namedParameters.lastColumnNumber}`,
|
|
5265
|
+
issuesTypesTitles: {
|
|
5266
|
+
grossViolation: "Gross violation",
|
|
5267
|
+
recommendationDisregard: "Recommendation disregard",
|
|
5268
|
+
other: "Other issue",
|
|
5269
|
+
keyAndValueSeparator: ": "
|
|
5270
|
+
},
|
|
5271
|
+
generateIssuesFoundErrorLog: (namedParameters) => ({
|
|
5272
|
+
customBadgeText: "HTML validation not passed",
|
|
5273
|
+
title: "HTML validation, issue(s) found",
|
|
5274
|
+
description: `File '${namedParameters.targetFileRelativePath}' is including the following HTML validity issues:\n\n` +
|
|
5275
|
+
`${namedParameters.formattedErrorsAndWarnings}\n\n`
|
|
5276
|
+
}),
|
|
5277
|
+
validationFailedErrorLog: {
|
|
5278
|
+
title: "HTML validation failed",
|
|
5279
|
+
description: "The error occurred during HTML validation"
|
|
5280
|
+
}
|
|
5281
|
+
};
|
|
5282
|
+
exports["default"] = HTML_ValidatorLocalization__english;
|
|
5283
|
+
|
|
5284
|
+
|
|
5285
|
+
/***/ }),
|
|
5286
|
+
|
|
5287
|
+
/***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/ResourcesReferencesResolverForHTML/ResourcesReferencesResolverForHTML.english.ts":
|
|
5288
|
+
/*!**********************************************************************************************************************************************!*\
|
|
5289
|
+
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/ResourcesReferencesResolverForHTML/ResourcesReferencesResolverForHTML.english.ts ***!
|
|
5290
|
+
\**********************************************************************************************************************************************/
|
|
5102
5291
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
5103
5292
|
|
|
5104
5293
|
|
|
5105
5294
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5106
5295
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
5107
|
-
const
|
|
5108
|
-
|
|
5296
|
+
const resourcesReferencesResolverForHTML_Localization__english = {
|
|
5297
|
+
generateUnableToResolveShortenedAbsolutePathWarningLog: (namedParameters) => ({
|
|
5109
5298
|
title: `${(0, es_extensions_1.capitalizeFirstCharacter)(namedParameters.filesType__singularForm)} file, unable to resolve the absolute path`,
|
|
5110
5299
|
description: `Unable to resolve the shortened absolute path for the ${namedParameters.filesType__singularForm} file ` +
|
|
5111
5300
|
`because no public path has been specified for '${namedParameters.projectBuildingMode}' project building mode. ` +
|
|
5112
5301
|
"Relative path will be used instead."
|
|
5113
5302
|
}),
|
|
5114
|
-
|
|
5115
|
-
title:
|
|
5116
|
-
description: `The
|
|
5117
|
-
`'${namedParameters.pickedPathOfTargetResourceFile}'
|
|
5118
|
-
|
|
5303
|
+
generateUnknownResourceGroupReferenceWarningLog: (namedParameters) => ({
|
|
5304
|
+
title: `Unknown reference to ${namedParameters.fileType__pluralForm} files group`,
|
|
5305
|
+
description: `The reference '${namedParameters.firstPathSegment}' in path ` +
|
|
5306
|
+
`'${namedParameters.pickedPathOfTargetResourceFile}' refers to unknown resources group. ` +
|
|
5307
|
+
`Below references are available for ${namedParameters.fileType__pluralForm} files: \n` +
|
|
5119
5308
|
`${namedParameters.formattedSourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap}`
|
|
5120
5309
|
}),
|
|
5121
|
-
|
|
5310
|
+
generateNoMatchingsForAliasedFilePathWithoutFilenameExtensionWarningLog: (namedParameters) => ({
|
|
5122
5311
|
title: `Unknown path to ${namedParameters.fileType__singularForm} file`,
|
|
5123
5312
|
description: `The aliased path '${namedParameters.pickedPathOfTargetResourceFile}' without filename extension ` +
|
|
5124
|
-
"refers to unknown file. Tried to search with all supported filename extensions: " +
|
|
5313
|
+
"refers to unknown file. Tried to search at path with all supported filename extensions: " +
|
|
5125
5314
|
`${namedParameters.checkedAbsolutePaths__formatted}.`
|
|
5126
5315
|
}),
|
|
5127
|
-
|
|
5316
|
+
generateNoOutputFileExistingForSpecifiedSourceFilePathWarningLog: (namedParameters) => ({
|
|
5128
5317
|
title: `Unknown path to ${namedParameters.fileType__singularForm} file`,
|
|
5129
|
-
description: `No ${namedParameters.fileType__singularForm} output file has been found for specified
|
|
5130
|
-
`file path '${namedParameters.pickedPathOfTargetResourceFile}'.`
|
|
5318
|
+
description: `No ${namedParameters.fileType__singularForm} output file has been found for specified source ` +
|
|
5319
|
+
`file path '${namedParameters.pickedPathOfTargetResourceFile}' including reference.`
|
|
5131
5320
|
})
|
|
5132
5321
|
};
|
|
5133
|
-
exports["default"] =
|
|
5322
|
+
exports["default"] = resourcesReferencesResolverForHTML_Localization__english;
|
|
5134
5323
|
|
|
5135
5324
|
|
|
5136
5325
|
/***/ }),
|
|
5137
5326
|
|
|
5138
|
-
/***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/
|
|
5139
|
-
|
|
5140
|
-
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/
|
|
5141
|
-
|
|
5327
|
+
/***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/ResourcesReferencesResolverForHTML/ResourcesReferencesResolverForHTML.ts":
|
|
5328
|
+
/*!**************************************************************************************************************************************!*\
|
|
5329
|
+
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/ResourcesReferencesResolverForHTML/ResourcesReferencesResolverForHTML.ts ***!
|
|
5330
|
+
\**************************************************************************************************************************************/
|
|
5142
5331
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
5143
5332
|
|
|
5144
5333
|
|
|
@@ -5147,27 +5336,28 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5147
5336
|
};
|
|
5148
5337
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5149
5338
|
/* --- Assets ------------------------------------------------------------------------------------------------------- */
|
|
5150
|
-
const
|
|
5339
|
+
const ResourcesReferencesResolverForHTML_english_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/Plugins/ResourcesReferencesResolverForHTML/ResourcesReferencesResolverForHTML.english */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/ResourcesReferencesResolverForHTML/ResourcesReferencesResolverForHTML.english.ts"));
|
|
5151
5340
|
/* --- Applied auxiliaries ------------------------------------------------------------------------------------------ */
|
|
5152
5341
|
const cheerio_1 = __importDefault(__webpack_require__(/*! cheerio */ "cheerio"));
|
|
5153
5342
|
const getExpectedToBeNonNullStringifiedContentOfVinylFile_1 = __importDefault(__webpack_require__(/*! @Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile */ "./Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile.ts"));
|
|
5154
5343
|
/* --- General auxiliaries ------------------------------------------------------------------------------------------ */
|
|
5155
5344
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
5156
5345
|
const ImprovedPath_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/ImprovedPath/ImprovedPath */ "./UtilsIncubator/ImprovedPath/ImprovedPath.ts"));
|
|
5157
|
-
class
|
|
5158
|
-
static localization =
|
|
5346
|
+
class ResourcesReferencesResolverForHTML {
|
|
5347
|
+
static localization = ResourcesReferencesResolverForHTML_english_1.default;
|
|
5159
5348
|
compiledHTML_File;
|
|
5160
5349
|
HTML_FileContentCheerioCapturing;
|
|
5161
5350
|
masterConfigRepresentative;
|
|
5162
|
-
static
|
|
5163
|
-
return new
|
|
5351
|
+
static resolve(compiledHTML_File, masterConfigRepresentative) {
|
|
5352
|
+
return new ResourcesReferencesResolverForHTML(compiledHTML_File, masterConfigRepresentative).
|
|
5353
|
+
resolveInternalLinks().
|
|
5164
5354
|
resolveStylesheetsPathsAliases().
|
|
5165
5355
|
resoleScriptsPathsAliases().
|
|
5166
5356
|
resolveImagesPathsAliases().
|
|
5167
5357
|
resolveVideosPathsAliases().
|
|
5168
5358
|
resolveAudiosPathsAliases().
|
|
5169
5359
|
/* [ Theory ] Without '{ decodeEntities: false }' all ideographic characters will be converted to entities
|
|
5170
|
-
* like '文' what could cause some troubles during HTML code
|
|
5360
|
+
* like '文' what could cause some troubles during post-processing of HTML code. */
|
|
5171
5361
|
HTML_FileContentCheerioCapturing.
|
|
5172
5362
|
html({ decodeEntities: false });
|
|
5173
5363
|
}
|
|
@@ -5176,14 +5366,50 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5176
5366
|
this.HTML_FileContentCheerioCapturing = cheerio_1.default.load((0, getExpectedToBeNonNullStringifiedContentOfVinylFile_1.default)(compiledHTML_File));
|
|
5177
5367
|
this.masterConfigRepresentative = masterConfigRepresentative;
|
|
5178
5368
|
}
|
|
5369
|
+
resolveInternalLinks() {
|
|
5370
|
+
if ((0, es_extensions_1.isUndefined)(this.masterConfigRepresentative.markupProcessingSettingsRepresentative)) {
|
|
5371
|
+
return this;
|
|
5372
|
+
}
|
|
5373
|
+
const markupProcessingSettingsRepresentative = this.masterConfigRepresentative.markupProcessingSettingsRepresentative;
|
|
5374
|
+
for (const anchorElement of Array.from(this.HTML_FileContentCheerioCapturing("a"))) {
|
|
5375
|
+
const anchorCheerioElement = this.HTML_FileContentCheerioCapturing(anchorElement);
|
|
5376
|
+
const hrefAttributeValue = anchorCheerioElement.attr("href");
|
|
5377
|
+
if (!(0, es_extensions_1.isNonEmptyString)(hrefAttributeValue)) {
|
|
5378
|
+
continue;
|
|
5379
|
+
}
|
|
5380
|
+
const resolvedURI = this.resolveOutputResourceFileAbsolutePathIfPossible({
|
|
5381
|
+
pickedPathOfTargetResourceFile: hrefAttributeValue,
|
|
5382
|
+
prefixOfAliasOfTopDirectoryOfResourcesGroup: markupProcessingSettingsRepresentative.prefixOfEntryPointsGroupReference,
|
|
5383
|
+
sourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap: (0, es_extensions_1.createMapBasedOnOtherMap)(markupProcessingSettingsRepresentative.entryPointsGroupsNormalizedSettingsMappedByReferences, (pathAlias, markupEntryPointsGroupNormalizedSettings) => [
|
|
5384
|
+
pathAlias,
|
|
5385
|
+
markupEntryPointsGroupNormalizedSettings.isSingeEntryPointGroup ?
|
|
5386
|
+
markupEntryPointsGroupNormalizedSettings.sourceFilesGlobSelectors[0] :
|
|
5387
|
+
markupEntryPointsGroupNormalizedSettings.sourceFilesTopDirectoryAbsolutePath
|
|
5388
|
+
]),
|
|
5389
|
+
supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots: markupProcessingSettingsRepresentative.
|
|
5390
|
+
supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots,
|
|
5391
|
+
sourceAndOutputFilesAbsolutePathsCorrespondenceMap: markupProcessingSettingsRepresentative.sourceAndOutputFilesAbsolutePathsCorrespondenceMap,
|
|
5392
|
+
fileTypeForLogging__singularForm: markupProcessingSettingsRepresentative.TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM,
|
|
5393
|
+
fileTypeForLogging__pluralForm: markupProcessingSettingsRepresentative.TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM
|
|
5394
|
+
});
|
|
5395
|
+
if ((0, es_extensions_1.isNull)(resolvedURI)) {
|
|
5396
|
+
continue;
|
|
5397
|
+
}
|
|
5398
|
+
anchorCheerioElement.attr("href", this.buildResourceFileFinalPath({
|
|
5399
|
+
resolvedOutputAbsolutePathOfResourceFile: resolvedURI,
|
|
5400
|
+
resourceFileType__singularForm: markupProcessingSettingsRepresentative.TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM
|
|
5401
|
+
}));
|
|
5402
|
+
}
|
|
5403
|
+
return this;
|
|
5404
|
+
}
|
|
5179
5405
|
resolveStylesheetsPathsAliases() {
|
|
5180
5406
|
if ((0, es_extensions_1.isUndefined)(this.masterConfigRepresentative.stylesProcessingSettingsRepresentative)) {
|
|
5181
5407
|
return this;
|
|
5182
5408
|
}
|
|
5183
5409
|
const stylesProcessingSettingsRepresentative = this.masterConfigRepresentative.stylesProcessingSettingsRepresentative;
|
|
5184
5410
|
for (const linkElement of Array.from(this.HTML_FileContentCheerioCapturing("link[rel='stylesheet']"))) {
|
|
5185
|
-
const
|
|
5186
|
-
const hrefAttributeValue =
|
|
5411
|
+
const linkCheerioElement = this.HTML_FileContentCheerioCapturing(linkElement);
|
|
5412
|
+
const hrefAttributeValue = linkCheerioElement.attr("href");
|
|
5187
5413
|
if (!(0, es_extensions_1.isNonEmptyString)(hrefAttributeValue)) {
|
|
5188
5414
|
continue;
|
|
5189
5415
|
}
|
|
@@ -5206,7 +5432,7 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5206
5432
|
if ((0, es_extensions_1.isNull)(resolvedOutputAbsolutePathOfStylesheet)) {
|
|
5207
5433
|
continue;
|
|
5208
5434
|
}
|
|
5209
|
-
|
|
5435
|
+
linkCheerioElement.attr("href", this.buildResourceFileFinalPath({
|
|
5210
5436
|
resolvedOutputAbsolutePathOfResourceFile: resolvedOutputAbsolutePathOfStylesheet,
|
|
5211
5437
|
resourceFileType__singularForm: stylesProcessingSettingsRepresentative.TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM
|
|
5212
5438
|
}));
|
|
@@ -5219,8 +5445,8 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5219
5445
|
}
|
|
5220
5446
|
const ECMA_ScriptLogicProcessingConfigRepresentative = this.masterConfigRepresentative.ECMA_ScriptLogicProcessingSettingsRepresentative;
|
|
5221
5447
|
for (const scriptElement of Array.from(this.HTML_FileContentCheerioCapturing("script"))) {
|
|
5222
|
-
const
|
|
5223
|
-
const srcAttributeValue =
|
|
5448
|
+
const scriptCheerioElement = this.HTML_FileContentCheerioCapturing(scriptElement);
|
|
5449
|
+
const srcAttributeValue = scriptCheerioElement.attr("src");
|
|
5224
5450
|
if (!(0, es_extensions_1.isNonEmptyString)(srcAttributeValue)) {
|
|
5225
5451
|
continue;
|
|
5226
5452
|
}
|
|
@@ -5244,7 +5470,7 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5244
5470
|
if ((0, es_extensions_1.isNull)(resolvedOutputAbsolutePathOfScript)) {
|
|
5245
5471
|
continue;
|
|
5246
5472
|
}
|
|
5247
|
-
|
|
5473
|
+
scriptCheerioElement.attr("src", this.buildResourceFileFinalPath({
|
|
5248
5474
|
resolvedOutputAbsolutePathOfResourceFile: resolvedOutputAbsolutePathOfScript,
|
|
5249
5475
|
resourceFileType__singularForm: ECMA_ScriptLogicProcessingConfigRepresentative.
|
|
5250
5476
|
TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM
|
|
@@ -5258,8 +5484,8 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5258
5484
|
}
|
|
5259
5485
|
const imagesProcessingConfigRepresentative = this.masterConfigRepresentative.imagesProcessingSettingsRepresentative;
|
|
5260
5486
|
for (const imageElement of Array.from(this.HTML_FileContentCheerioCapturing("img"))) {
|
|
5261
|
-
const
|
|
5262
|
-
const srcAttributeValue =
|
|
5487
|
+
const imageCheerioElement = this.HTML_FileContentCheerioCapturing(imageElement);
|
|
5488
|
+
const srcAttributeValue = imageCheerioElement.attr("src");
|
|
5263
5489
|
if (!(0, es_extensions_1.isNonEmptyString)(srcAttributeValue)) {
|
|
5264
5490
|
continue;
|
|
5265
5491
|
}
|
|
@@ -5276,14 +5502,14 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5276
5502
|
if ((0, es_extensions_1.isNull)(resolvedOutputAbsolutePathOfImage)) {
|
|
5277
5503
|
continue;
|
|
5278
5504
|
}
|
|
5279
|
-
|
|
5505
|
+
imageCheerioElement.attr("src", this.buildResourceFileFinalPath({
|
|
5280
5506
|
resolvedOutputAbsolutePathOfResourceFile: resolvedOutputAbsolutePathOfImage,
|
|
5281
5507
|
resourceFileType__singularForm: imagesProcessingConfigRepresentative.TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM
|
|
5282
5508
|
}));
|
|
5283
5509
|
}
|
|
5284
5510
|
for (const linkElement of Array.from(this.HTML_FileContentCheerioCapturing("link[type='image/x-icon']"))) {
|
|
5285
|
-
const
|
|
5286
|
-
const hrefAttributeValue =
|
|
5511
|
+
const linkCheerioElement = this.HTML_FileContentCheerioCapturing(linkElement);
|
|
5512
|
+
const hrefAttributeValue = linkCheerioElement.attr("href");
|
|
5287
5513
|
if ((0, es_extensions_1.isUndefined)(hrefAttributeValue)) {
|
|
5288
5514
|
continue;
|
|
5289
5515
|
}
|
|
@@ -5302,7 +5528,7 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5302
5528
|
if ((0, es_extensions_1.isNull)(imageResolvedOutputAbsolutePath)) {
|
|
5303
5529
|
continue;
|
|
5304
5530
|
}
|
|
5305
|
-
|
|
5531
|
+
linkCheerioElement.attr("href", this.buildResourceFileFinalPath({
|
|
5306
5532
|
resolvedOutputAbsolutePathOfResourceFile: imageResolvedOutputAbsolutePath,
|
|
5307
5533
|
resourceFileType__singularForm: imagesProcessingConfigRepresentative.TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM
|
|
5308
5534
|
}));
|
|
@@ -5315,8 +5541,8 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5315
5541
|
}
|
|
5316
5542
|
const videosProcessingConfigRepresentative = this.masterConfigRepresentative.videosProcessingSettingsRepresentative;
|
|
5317
5543
|
for (const sourceElement of Array.from(this.HTML_FileContentCheerioCapturing("video > source"))) {
|
|
5318
|
-
const
|
|
5319
|
-
const srcAttributeValue =
|
|
5544
|
+
const sourceCheerioElement = this.HTML_FileContentCheerioCapturing(sourceElement);
|
|
5545
|
+
const srcAttributeValue = sourceCheerioElement.attr("src");
|
|
5320
5546
|
if (!(0, es_extensions_1.isNonEmptyString)(srcAttributeValue)) {
|
|
5321
5547
|
continue;
|
|
5322
5548
|
}
|
|
@@ -5333,7 +5559,7 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5333
5559
|
if ((0, es_extensions_1.isNull)(resolvedOutputAbsolutePathOfVideo)) {
|
|
5334
5560
|
continue;
|
|
5335
5561
|
}
|
|
5336
|
-
|
|
5562
|
+
sourceCheerioElement.attr("src", this.buildResourceFileFinalPath({
|
|
5337
5563
|
resolvedOutputAbsolutePathOfResourceFile: resolvedOutputAbsolutePathOfVideo,
|
|
5338
5564
|
resourceFileType__singularForm: videosProcessingConfigRepresentative.TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM
|
|
5339
5565
|
}));
|
|
@@ -5346,8 +5572,8 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5346
5572
|
}
|
|
5347
5573
|
const audiosProcessingConfigRepresentative = this.masterConfigRepresentative.audiosProcessingSettingsRepresentative;
|
|
5348
5574
|
for (const sourceElement of Array.from(this.HTML_FileContentCheerioCapturing("audio > source"))) {
|
|
5349
|
-
const
|
|
5350
|
-
const srcAttributeValue =
|
|
5575
|
+
const sourceCheerioElement = this.HTML_FileContentCheerioCapturing(sourceElement);
|
|
5576
|
+
const srcAttributeValue = sourceCheerioElement.attr("src");
|
|
5351
5577
|
if ((0, es_extensions_1.isUndefined)(srcAttributeValue)) {
|
|
5352
5578
|
continue;
|
|
5353
5579
|
}
|
|
@@ -5364,7 +5590,7 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5364
5590
|
if ((0, es_extensions_1.isNull)(resolvedOutputAbsolutePathOfVideo)) {
|
|
5365
5591
|
continue;
|
|
5366
5592
|
}
|
|
5367
|
-
|
|
5593
|
+
sourceCheerioElement.attr("src", this.buildResourceFileFinalPath({
|
|
5368
5594
|
resolvedOutputAbsolutePathOfResourceFile: resolvedOutputAbsolutePathOfVideo,
|
|
5369
5595
|
resourceFileType__singularForm: audiosProcessingConfigRepresentative.TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM
|
|
5370
5596
|
}));
|
|
@@ -5383,8 +5609,8 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5383
5609
|
}
|
|
5384
5610
|
const sourceFilesTopDirectoryAbsolutePathOfCurrentAlias = sourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap.get(firstSegmentOfPickedPath);
|
|
5385
5611
|
if ((0, es_extensions_1.isUndefined)(sourceFilesTopDirectoryAbsolutePathOfCurrentAlias)) {
|
|
5386
|
-
es_extensions_1.Logger.logWarning(
|
|
5387
|
-
|
|
5612
|
+
es_extensions_1.Logger.logWarning(ResourcesReferencesResolverForHTML.localization.generateUnknownResourceGroupReferenceWarningLog({
|
|
5613
|
+
fileType__pluralForm: fileTypeForLogging__pluralForm,
|
|
5388
5614
|
firstPathSegment: firstSegmentOfPickedPath,
|
|
5389
5615
|
pickedPathOfTargetResourceFile,
|
|
5390
5616
|
formattedSourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap: (0, es_extensions_1.stringifyAndFormatArbitraryValue)(Array.from(sourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap.entries()))
|
|
@@ -5399,8 +5625,8 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5399
5625
|
`${supportedStylesheetFileNameExtensionWithoutLeadingDot}`);
|
|
5400
5626
|
const searchingResultsInSourceFilesAbsolutePathsAndOutputFilesActualPathsMap = (0, es_extensions_1.filterMap)(sourceAndOutputFilesAbsolutePathsCorrespondenceMap, (sourceFileAbsolutePath) => possibleAbsolutePathsOfTargetSourceFile.includes(sourceFileAbsolutePath));
|
|
5401
5627
|
if (searchingResultsInSourceFilesAbsolutePathsAndOutputFilesActualPathsMap.size === 0) {
|
|
5402
|
-
es_extensions_1.Logger.logWarning(
|
|
5403
|
-
|
|
5628
|
+
es_extensions_1.Logger.logWarning(ResourcesReferencesResolverForHTML.localization.
|
|
5629
|
+
generateNoMatchingsForAliasedFilePathWithoutFilenameExtensionWarningLog({
|
|
5404
5630
|
pickedPathOfTargetResourceFile,
|
|
5405
5631
|
fileType__singularForm: fileTypeForLogging__pluralForm,
|
|
5406
5632
|
checkedAbsolutePaths__formatted: (0, es_extensions_1.stringifyAndFormatArbitraryValue)(possibleAbsolutePathsOfTargetSourceFile)
|
|
@@ -5412,7 +5638,7 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5412
5638
|
const resolvedFileOutputAbsolutePath = sourceAndOutputFilesAbsolutePathsCorrespondenceMap.
|
|
5413
5639
|
get(sourceFileComputedAbsolutePathPossiblyWithoutFileNameExtension);
|
|
5414
5640
|
if ((0, es_extensions_1.isUndefined)(resolvedFileOutputAbsolutePath)) {
|
|
5415
|
-
es_extensions_1.Logger.logWarning(
|
|
5641
|
+
es_extensions_1.Logger.logWarning(ResourcesReferencesResolverForHTML.localization.generateNoOutputFileExistingForSpecifiedSourceFilePathWarningLog({
|
|
5416
5642
|
pickedPathOfTargetResourceFile,
|
|
5417
5643
|
fileType__singularForm: fileTypeForLogging__pluralForm
|
|
5418
5644
|
}));
|
|
@@ -5421,12 +5647,13 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5421
5647
|
return resolvedFileOutputAbsolutePath;
|
|
5422
5648
|
}
|
|
5423
5649
|
buildResourceFileFinalPath({ resolvedOutputAbsolutePathOfResourceFile, resourceFileType__singularForm }) {
|
|
5424
|
-
if (this.masterConfigRepresentative.
|
|
5650
|
+
if (this.masterConfigRepresentative.isStaticPreviewBuildingMode ||
|
|
5425
5651
|
(0, es_extensions_1.isUndefined)(this.masterConfigRepresentative.actualPublicDirectoryAbsolutePath)) {
|
|
5426
|
-
if (!this.masterConfigRepresentative.
|
|
5652
|
+
if (!this.masterConfigRepresentative.isStaticPreviewBuildingMode &&
|
|
5427
5653
|
(0, es_extensions_1.isUndefined)(this.masterConfigRepresentative.actualPublicDirectoryAbsolutePath)) {
|
|
5428
|
-
es_extensions_1.Logger.logWarning(
|
|
5654
|
+
es_extensions_1.Logger.logWarning(ResourcesReferencesResolverForHTML.localization.generateUnableToResolveShortenedAbsolutePathWarningLog({
|
|
5429
5655
|
projectBuildingMode: this.masterConfigRepresentative.consumingProjectBuildingMode,
|
|
5656
|
+
targetFileAbsolutePath: resolvedOutputAbsolutePathOfResourceFile,
|
|
5430
5657
|
filesType__singularForm: resourceFileType__singularForm
|
|
5431
5658
|
}));
|
|
5432
5659
|
}
|
|
@@ -5441,181 +5668,7 @@ class ResourceFilesPathsAliasesResolverForHTML {
|
|
|
5441
5668
|
})}`;
|
|
5442
5669
|
}
|
|
5443
5670
|
}
|
|
5444
|
-
exports["default"] =
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
/***/ }),
|
|
5448
|
-
|
|
5449
|
-
/***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_Validator.ts":
|
|
5450
|
-
/*!**********************************************************************************************!*\
|
|
5451
|
-
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_Validator.ts ***!
|
|
5452
|
-
\**********************************************************************************************/
|
|
5453
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5457
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5458
|
-
};
|
|
5459
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5460
|
-
/* --- Assets ------------------------------------------------------------------------------------------------------- */
|
|
5461
|
-
const HTML_ValidatorLocalization_english_1 = __importDefault(__webpack_require__(/*! ./HTML_ValidatorLocalization.english */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_ValidatorLocalization.english.ts"));
|
|
5462
|
-
/* --- Applied utils ------------------------------------------------------------------------------------------------ */
|
|
5463
|
-
const html_validator_1 = __importDefault(__webpack_require__(/*! html-validator */ "html-validator"));
|
|
5464
|
-
const getExpectedToBeNonNullStringifiedContentOfVinylFile_1 = __importDefault(__webpack_require__(/*! @Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile */ "./Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile.ts"));
|
|
5465
|
-
const isCompiledHTML_ContentEmpty_1 = __importDefault(__webpack_require__(/*! @Utils/isCompiledHTML_ContentEmpty */ "./Utils/isCompiledHTML_ContentEmpty.ts"));
|
|
5466
|
-
const node_notifier_1 = __importDefault(__webpack_require__(/*! node-notifier */ "node-notifier"));
|
|
5467
|
-
/* --- General utils ------------------------------------------------------------------------------------------------ */
|
|
5468
|
-
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
5469
|
-
const ImprovedPath_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/ImprovedPath/ImprovedPath */ "./UtilsIncubator/ImprovedPath/ImprovedPath.ts"));
|
|
5470
|
-
const Stopwatch_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/Stopwatch */ "./UtilsIncubator/Stopwatch.ts"));
|
|
5471
|
-
class HTML_Validator {
|
|
5472
|
-
static localization = HTML_ValidatorLocalization_english_1.default;
|
|
5473
|
-
static validateHTML(compiledHTML_File, masterConfigRepresentative) {
|
|
5474
|
-
const extractedHTML_Code = (0, getExpectedToBeNonNullStringifiedContentOfVinylFile_1.default)(compiledHTML_File);
|
|
5475
|
-
const targetFileRelativePath = ImprovedPath_1.default.computeRelativePath({
|
|
5476
|
-
basePath: masterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath,
|
|
5477
|
-
comparedPath: compiledHTML_File.path
|
|
5478
|
-
});
|
|
5479
|
-
if ((0, isCompiledHTML_ContentEmpty_1.default)(extractedHTML_Code)) {
|
|
5480
|
-
es_extensions_1.Logger.logWarning(HTML_Validator.localization.generateFileIsEmptyWarningLog({ targetFileRelativePath }));
|
|
5481
|
-
return;
|
|
5482
|
-
}
|
|
5483
|
-
const validationTimeMeasuringStopwatch = new Stopwatch_1.default().startOrRestart();
|
|
5484
|
-
es_extensions_1.Logger.logInfo(HTML_Validator.localization.generateValidationStartedInfoLog({ targetFileRelativePath }));
|
|
5485
|
-
(0, html_validator_1.default)({
|
|
5486
|
-
/* eslint-disable-next-line id-denylist --
|
|
5487
|
-
* From the viewpoint of TypeScript, the property name does not conflict with imported names.
|
|
5488
|
-
* ESLint community has declined to fix this.
|
|
5489
|
-
* https://github.com/eslint/eslint/issues/15504 */
|
|
5490
|
-
data: extractedHTML_Code,
|
|
5491
|
-
format: "json"
|
|
5492
|
-
}).
|
|
5493
|
-
then((validationResults) => {
|
|
5494
|
-
const validationPeriod__seconds = validationTimeMeasuringStopwatch.stop().seconds;
|
|
5495
|
-
const filteredIssues = (0, es_extensions_1.removeArrayElementsByPredicates)({
|
|
5496
|
-
targetArray: validationResults.messages,
|
|
5497
|
-
predicates: HTML_Validator.getPredicatesForHTML_ValidationIssuesFiltering(),
|
|
5498
|
-
mutably: false
|
|
5499
|
-
}).updatedArray;
|
|
5500
|
-
if (filteredIssues.length === 0) {
|
|
5501
|
-
es_extensions_1.Logger.logSuccess(HTML_Validator.localization.generateValidationFinishedWithNoIssuesFoundSuccessLog({
|
|
5502
|
-
targetFileRelativePath,
|
|
5503
|
-
secondsElapsed: validationPeriod__seconds
|
|
5504
|
-
}));
|
|
5505
|
-
return;
|
|
5506
|
-
}
|
|
5507
|
-
node_notifier_1.default.notify(HTML_Validator.localization.issuesFoundNotification);
|
|
5508
|
-
const formattedErrors = [];
|
|
5509
|
-
for (const issue of filteredIssues) {
|
|
5510
|
-
let accumulatingFormattedError = "";
|
|
5511
|
-
if (HTML_Validator.isValidationMessageLocationObject(issue)) {
|
|
5512
|
-
const codeFragmentPartWhichMustBeHighlighted = issue.extract.substring(issue.hiliteStart, issue.hiliteStart + issue.hiliteLength);
|
|
5513
|
-
accumulatingFormattedError = `${issue.extract.replace(codeFragmentPartWhichMustBeHighlighted, es_extensions_1.Logger.highlightText(codeFragmentPartWhichMustBeHighlighted))}\n${HTML_Validator.localization.generateIssueOccurrenceLocationIndication({
|
|
5514
|
-
lineNumber: issue.lastLine, startingColumnNumber: issue.firstColumn, lastColumnNumber: issue.lastColumn
|
|
5515
|
-
})}\n`;
|
|
5516
|
-
}
|
|
5517
|
-
switch (issue.type) {
|
|
5518
|
-
case "error": {
|
|
5519
|
-
accumulatingFormattedError = `${accumulatingFormattedError}` +
|
|
5520
|
-
`${HTML_Validator.localization.issuesTypesTitles.grossViolation}` +
|
|
5521
|
-
`${HTML_Validator.localization.issuesTypesTitles.keyAndValueSeparator}`;
|
|
5522
|
-
break;
|
|
5523
|
-
}
|
|
5524
|
-
case "info": {
|
|
5525
|
-
accumulatingFormattedError =
|
|
5526
|
-
`${accumulatingFormattedError}` +
|
|
5527
|
-
`${HTML_Validator.localization.issuesTypesTitles.recommendationDisregard}` +
|
|
5528
|
-
`${HTML_Validator.localization.issuesTypesTitles.keyAndValueSeparator}`;
|
|
5529
|
-
break;
|
|
5530
|
-
}
|
|
5531
|
-
default: {
|
|
5532
|
-
accumulatingFormattedError = `${accumulatingFormattedError}` +
|
|
5533
|
-
`${HTML_Validator.localization.issuesTypesTitles.other}` +
|
|
5534
|
-
`${HTML_Validator.localization.issuesTypesTitles.keyAndValueSeparator}`;
|
|
5535
|
-
break;
|
|
5536
|
-
}
|
|
5537
|
-
}
|
|
5538
|
-
accumulatingFormattedError = `${accumulatingFormattedError}${issue.message}`;
|
|
5539
|
-
formattedErrors.push(accumulatingFormattedError);
|
|
5540
|
-
}
|
|
5541
|
-
es_extensions_1.Logger.logErrorLikeMessage(HTML_Validator.localization.generateIssuesFoundErrorLog({
|
|
5542
|
-
targetFileRelativePath,
|
|
5543
|
-
formattedErrors: formattedErrors.join("\n\n")
|
|
5544
|
-
}));
|
|
5545
|
-
}).
|
|
5546
|
-
catch((error) => {
|
|
5547
|
-
es_extensions_1.Logger.logError({
|
|
5548
|
-
errorType: es_extensions_1.DataRetrievingFailedError.localization.defaultTitle,
|
|
5549
|
-
...HTML_Validator.localization.validationFailedErrorLog,
|
|
5550
|
-
occurrenceLocation: "HTML_Validator.validateHTML(...parameters)",
|
|
5551
|
-
caughtError: error
|
|
5552
|
-
});
|
|
5553
|
-
});
|
|
5554
|
-
}
|
|
5555
|
-
static getPredicatesForHTML_ValidationIssuesFiltering() {
|
|
5556
|
-
return [
|
|
5557
|
-
(HTML_ValidationIssue) => HTML_ValidationIssue.message === "Attribute “webkitdirectory” not allowed on element “input” at this point."
|
|
5558
|
-
];
|
|
5559
|
-
}
|
|
5560
|
-
static isValidationMessageLocationObject(violation) {
|
|
5561
|
-
return (0, es_extensions_1.isArbitraryObject)(violation) &&
|
|
5562
|
-
(0, es_extensions_1.isNotUndefined)(violation.extract) &&
|
|
5563
|
-
(0, es_extensions_1.isNotUndefined)(violation.lastLine) &&
|
|
5564
|
-
(0, es_extensions_1.isNotUndefined)(violation.firstColumn) &&
|
|
5565
|
-
(0, es_extensions_1.isNotUndefined)(violation.lastColumn);
|
|
5566
|
-
}
|
|
5567
|
-
}
|
|
5568
|
-
exports["default"] = HTML_Validator;
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
/***/ }),
|
|
5572
|
-
|
|
5573
|
-
/***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_ValidatorLocalization.english.ts":
|
|
5574
|
-
/*!******************************************************************************************************************!*\
|
|
5575
|
-
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_ValidatorLocalization.english.ts ***!
|
|
5576
|
-
\******************************************************************************************************************/
|
|
5577
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5581
|
-
const HTML_ValidatorLocalization__English = {
|
|
5582
|
-
generateFileIsEmptyWarningLog: (namedParameters) => ({
|
|
5583
|
-
title: "HTML validation terminated",
|
|
5584
|
-
description: `File '${namedParameters.targetFileRelativePath}' is empty, no HTML to inspect.`
|
|
5585
|
-
}),
|
|
5586
|
-
generateValidationStartedInfoLog: (namedParameters) => ({
|
|
5587
|
-
title: "HTML validation started",
|
|
5588
|
-
description: `Begin the inspection of file '${namedParameters.targetFileRelativePath}' ...`
|
|
5589
|
-
}),
|
|
5590
|
-
generateValidationFinishedWithNoIssuesFoundSuccessLog: (namedParameters) => ({
|
|
5591
|
-
title: "HTML validation finished",
|
|
5592
|
-
description: `File '${namedParameters.targetFileRelativePath}' is fully obeying to W3C rules and recommendations.\n` +
|
|
5593
|
-
`${namedParameters.secondsElapsed} seconds elapsed.`
|
|
5594
|
-
}),
|
|
5595
|
-
issuesFoundNotification: {
|
|
5596
|
-
title: "HTML validation, issue(s) found",
|
|
5597
|
-
message: "W3C rules violations and / or recommendations neglect detected. Check the console for the details."
|
|
5598
|
-
},
|
|
5599
|
-
generateIssueOccurrenceLocationIndication: (namedParameters) => `Line ${namedParameters.lineNumber}, ` +
|
|
5600
|
-
`columns ${namedParameters.startingColumnNumber}-${namedParameters.lastColumnNumber}`,
|
|
5601
|
-
issuesTypesTitles: {
|
|
5602
|
-
grossViolation: "Gross violation",
|
|
5603
|
-
recommendationDisregard: "Recommendation disregard",
|
|
5604
|
-
other: "Other issue",
|
|
5605
|
-
keyAndValueSeparator: ": "
|
|
5606
|
-
},
|
|
5607
|
-
generateIssuesFoundErrorLog: (namedParameters) => ({
|
|
5608
|
-
customBadgeText: "HTML validation not passed",
|
|
5609
|
-
title: "HTML validation, issue(s) found",
|
|
5610
|
-
description: `File '${namedParameters.targetFileRelativePath}' is including following HTML validity issues:\n\n` +
|
|
5611
|
-
`${namedParameters.formattedErrors}\n\n`
|
|
5612
|
-
}),
|
|
5613
|
-
validationFailedErrorLog: {
|
|
5614
|
-
title: "HTML validation failed",
|
|
5615
|
-
description: "The error occurred during HTML validation"
|
|
5616
|
-
}
|
|
5617
|
-
};
|
|
5618
|
-
exports["default"] = HTML_ValidatorLocalization__English;
|
|
5671
|
+
exports["default"] = ResourcesReferencesResolverForHTML;
|
|
5619
5672
|
|
|
5620
5673
|
|
|
5621
5674
|
/***/ }),
|
|
@@ -5898,7 +5951,8 @@ exports["default"] = {
|
|
|
5898
5951
|
waitingForSubsequentFilesWillBeSavedPeriod__seconds: 1,
|
|
5899
5952
|
filePathAliasNotation: "@",
|
|
5900
5953
|
revisioning: {
|
|
5901
|
-
mustExecute: (projectBuildingMode__possiblyCustom) => projectBuildingMode__possiblyCustom !== ConsumingProjectPreDefinedBuildingModes_1.default.
|
|
5954
|
+
mustExecute: (projectBuildingMode__possiblyCustom) => projectBuildingMode__possiblyCustom !== ConsumingProjectPreDefinedBuildingModes_1.default.staticPreview &&
|
|
5955
|
+
projectBuildingMode__possiblyCustom !== ConsumingProjectPreDefinedBuildingModes_1.default.development,
|
|
5902
5956
|
contentHashPostfixSeparator: "--"
|
|
5903
5957
|
},
|
|
5904
5958
|
linting: {
|
|
@@ -5987,11 +6041,9 @@ var StylesProcessingSettings__FromFile__RawValid;
|
|
|
5987
6041
|
preValidationModifications: es_extensions_1.nullToUndefined,
|
|
5988
6042
|
type: es_extensions_1.RawObjectDataProcessor.ValuesTypesIDs.associativeArrayOfUniformTypeValues,
|
|
5989
6043
|
required: true,
|
|
5990
|
-
|
|
5991
|
-
consumingProjectLocalizedPreDefinedBuildingModes.development,
|
|
5992
|
-
consumingProjectLocalizedPreDefinedBuildingModes.production
|
|
5993
|
-
],
|
|
6044
|
+
minimalEntriesCount: 1,
|
|
5994
6045
|
keysRenamings: {
|
|
6046
|
+
[consumingProjectLocalizedPreDefinedBuildingModes.development]: ConsumingProjectPreDefinedBuildingModes_1.default.staticPreview,
|
|
5995
6047
|
[consumingProjectLocalizedPreDefinedBuildingModes.development]: ConsumingProjectPreDefinedBuildingModes_1.default.development,
|
|
5996
6048
|
[consumingProjectLocalizedPreDefinedBuildingModes.testing]: ConsumingProjectPreDefinedBuildingModes_1.default.testing,
|
|
5997
6049
|
[consumingProjectLocalizedPreDefinedBuildingModes.production]: ConsumingProjectPreDefinedBuildingModes_1.default.production
|
|
@@ -6064,7 +6116,7 @@ class StylesProcessor extends GulpStreamsBasedSourceCodeProcessor_1.default {
|
|
|
6064
6116
|
return () => new stream_1.PassThrough().end();
|
|
6065
6117
|
}
|
|
6066
6118
|
const dataHoldingSelfInstance = new StylesProcessor(masterConfigRepresentative, stylesProcessingSettingsRepresentative);
|
|
6067
|
-
if (masterConfigRepresentative.isDevelopmentBuildingMode) {
|
|
6119
|
+
if (masterConfigRepresentative.isStaticPreviewBuildingMode || masterConfigRepresentative.isDevelopmentBuildingMode) {
|
|
6068
6120
|
dataHoldingSelfInstance.initializeSourceFilesDirectoriesWhichAlwaysWillBeBeingWatchedGlobSelectors();
|
|
6069
6121
|
dataHoldingSelfInstance.initializeOrUpdateWatchedSourceFilesGlobSelectors();
|
|
6070
6122
|
dataHoldingSelfInstance.initializeOrUpdateSourceFilesWatcher();
|
|
@@ -6086,7 +6138,8 @@ class StylesProcessor extends GulpStreamsBasedSourceCodeProcessor_1.default {
|
|
|
6086
6138
|
pipe(super.printProcessedFilesPathsAndQuantity()).
|
|
6087
6139
|
pipe(super.handleErrorIfItWillOccur()).
|
|
6088
6140
|
pipe((0, gulp_intercept_1.default)(this.addActualSourceCodeProcessingSettingsToVinylFile.bind(this))).
|
|
6089
|
-
pipe((0, gulp_if_1.default)(this.masterConfigRepresentative.
|
|
6141
|
+
pipe((0, gulp_if_1.default)(this.masterConfigRepresentative.isStaticPreviewBuildingMode ||
|
|
6142
|
+
this.masterConfigRepresentative.isDevelopmentBuildingMode, gulp_sourcemaps_1.default.init())).
|
|
6090
6143
|
pipe((0, gulp_if_1.default)((file) => file.mustBeProcessedByStylus, (0, gulp_stylus_1.default)({
|
|
6091
6144
|
/* [ Theory ] Allows to "@include XXX.css" which is critical for third-party libraries usage. */
|
|
6092
6145
|
"include css": true
|
|
@@ -6098,14 +6151,17 @@ class StylesProcessor extends GulpStreamsBasedSourceCodeProcessor_1.default {
|
|
|
6098
6151
|
preset: [
|
|
6099
6152
|
"default",
|
|
6100
6153
|
{
|
|
6101
|
-
normalizeWhitespace: !this.masterConfigRepresentative.
|
|
6102
|
-
|
|
6154
|
+
normalizeWhitespace: !this.masterConfigRepresentative.isStaticPreviewBuildingMode &&
|
|
6155
|
+
!this.masterConfigRepresentative.isDevelopmentBuildingMode,
|
|
6156
|
+
discardComments: !this.masterConfigRepresentative.isStaticPreviewBuildingMode &&
|
|
6157
|
+
!this.masterConfigRepresentative.isDevelopmentBuildingMode
|
|
6103
6158
|
}
|
|
6104
6159
|
]
|
|
6105
6160
|
})
|
|
6106
6161
|
]
|
|
6107
6162
|
}))).
|
|
6108
|
-
pipe((0, gulp_if_1.default)(this.masterConfigRepresentative.
|
|
6163
|
+
pipe((0, gulp_if_1.default)(this.masterConfigRepresentative.isStaticPreviewBuildingMode ||
|
|
6164
|
+
this.masterConfigRepresentative.isDevelopmentBuildingMode, gulp_sourcemaps_1.default.write())).
|
|
6109
6165
|
pipe((0, gulp_intercept_1.default)(this.onPostProcessedCode.bind(this))).
|
|
6110
6166
|
pipe(gulp_1.default.dest((targetFileInFinalState) => targetFileInFinalState.outputDirectoryAbsolutePath));
|
|
6111
6167
|
}
|
|
@@ -7371,16 +7427,6 @@ module.exports = require("node-notifier");
|
|
|
7371
7427
|
|
|
7372
7428
|
/***/ }),
|
|
7373
7429
|
|
|
7374
|
-
/***/ "typescript-declaration-webpack-plugin":
|
|
7375
|
-
/*!********************************************************!*\
|
|
7376
|
-
!*** external "typescript-declaration-webpack-plugin" ***!
|
|
7377
|
-
\********************************************************/
|
|
7378
|
-
/***/ ((module) => {
|
|
7379
|
-
|
|
7380
|
-
module.exports = require("typescript-declaration-webpack-plugin");
|
|
7381
|
-
|
|
7382
|
-
/***/ }),
|
|
7383
|
-
|
|
7384
7430
|
/***/ "vue-loader":
|
|
7385
7431
|
/*!*****************************!*\
|
|
7386
7432
|
!*** external "vue-loader" ***!
|