@yamato-daiwa/automation 0.0.2 → 0.0.4
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 +281 -226
- package/README.md +12 -2
- package/package.json +10 -8
package/EntryPoint.js
CHANGED
|
@@ -289,6 +289,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
289
289
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
290
290
|
const AssetsProcessingSettingsRepresentative_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/SettingsRepresentatives/AssetsProcessingSettingsRepresentative */ "./ProjectBuilding/Common/SettingsRepresentatives/AssetsProcessingSettingsRepresentative.ts"));
|
|
291
291
|
class AudiosProcessingSettingsRepresentative extends AssetsProcessingSettingsRepresentative_1.default {
|
|
292
|
+
TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM = "Audio";
|
|
292
293
|
TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM = "Audios";
|
|
293
294
|
assetsProcessingCommonSettings;
|
|
294
295
|
actualAssetsGroupsSettings;
|
|
@@ -345,6 +346,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
345
346
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
346
347
|
};
|
|
347
348
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
349
|
+
const AudiosProcessingSettingsRepresentative_1 = __importDefault(__webpack_require__(/*! @AudiosProcessing/AudiosProcessingSettingsRepresentative */ "./ProjectBuilding/AssetsProcessing/Audios/AudiosProcessingSettingsRepresentative.ts"));
|
|
348
350
|
/* --- Tasks executors ---------------------------------------------------------------------------------------------- */
|
|
349
351
|
const GulpStreamsBasedAssetsProcessor_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/TasksExecutors/GulpStreamsBasedAssetsProcessor */ "./ProjectBuilding/Common/TasksExecutors/GulpStreamsBasedAssetsProcessor.ts"));
|
|
350
352
|
/* --- Applied utils ------------------------------------------------------------------------------------------------ */
|
|
@@ -394,7 +396,7 @@ class AudiosProcessor extends GulpStreamsBasedAssetsProcessor_1.default {
|
|
|
394
396
|
/* [ Theory ] The value of 'path' could change during file processing. */
|
|
395
397
|
fileInInitialState.sourceAbsolutePath = fileInInitialState.path;
|
|
396
398
|
fileInInitialState.outputDirectoryAbsolutePath =
|
|
397
|
-
|
|
399
|
+
AudiosProcessingSettingsRepresentative_1.default.computeActualOutputDirectoryAbsolutePathForTargetSourceFile({
|
|
398
400
|
targetSourceFileAbsolutePath: fileInInitialState.path,
|
|
399
401
|
respectiveAssetsGroupNormalizedSettings: normalizedAudiosGroupSettingsActualForCurrentFile
|
|
400
402
|
});
|
|
@@ -551,6 +553,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
551
553
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
552
554
|
};
|
|
553
555
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
556
|
+
const FontsProcessingSettingsRepresentative_1 = __importDefault(__webpack_require__(/*! @FontsProcessing/FontsProcessingSettingsRepresentative */ "./ProjectBuilding/AssetsProcessing/Fonts/FontsProcessingSettingsRepresentative.ts"));
|
|
554
557
|
/* --- Tasks executor ----------------------------------------------------------------------------------------------- */
|
|
555
558
|
const GulpStreamsBasedAssetsProcessor_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/TasksExecutors/GulpStreamsBasedAssetsProcessor */ "./ProjectBuilding/Common/TasksExecutors/GulpStreamsBasedAssetsProcessor.ts"));
|
|
556
559
|
/* --- Applied utils ------------------------------------------------------------------------------------------------ */
|
|
@@ -599,7 +602,7 @@ class FontsProcessor extends GulpStreamsBasedAssetsProcessor_1.default {
|
|
|
599
602
|
fileInInitialState.processingSettings = normalizedFontsGroupSettingsActualForCurrentFile;
|
|
600
603
|
/* [ Theory ] The value of 'path' could change during file processing. */
|
|
601
604
|
fileInInitialState.sourceAbsolutePath = fileInInitialState.path;
|
|
602
|
-
fileInInitialState.outputDirectoryAbsolutePath =
|
|
605
|
+
fileInInitialState.outputDirectoryAbsolutePath = FontsProcessingSettingsRepresentative_1.default.
|
|
603
606
|
computeActualOutputDirectoryAbsolutePathForTargetSourceFile({
|
|
604
607
|
targetSourceFileAbsolutePath: fileInInitialState.path,
|
|
605
608
|
respectiveAssetsGroupNormalizedSettings: normalizedFontsGroupSettingsActualForCurrentFile
|
|
@@ -700,6 +703,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
700
703
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
701
704
|
const AssetsProcessingSettingsRepresentative_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/SettingsRepresentatives/AssetsProcessingSettingsRepresentative */ "./ProjectBuilding/Common/SettingsRepresentatives/AssetsProcessingSettingsRepresentative.ts"));
|
|
702
705
|
class ImagesProcessingSettingsRepresentative extends AssetsProcessingSettingsRepresentative_1.default {
|
|
706
|
+
TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM = "Image";
|
|
703
707
|
TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM = "Images";
|
|
704
708
|
assetsProcessingCommonSettings;
|
|
705
709
|
actualAssetsGroupsSettings;
|
|
@@ -756,6 +760,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
756
760
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
757
761
|
};
|
|
758
762
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
763
|
+
const ImagesProcessingSettingsRepresentative_1 = __importDefault(__webpack_require__(/*! @ImagesProcessing/ImagesProcessingSettingsRepresentative */ "./ProjectBuilding/AssetsProcessing/Images/ImagesProcessingSettingsRepresentative.ts"));
|
|
759
764
|
/* --- Tasks executor ----------------------------------------------------------------------------------------------- */
|
|
760
765
|
const GulpStreamsBasedAssetsProcessor_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/TasksExecutors/GulpStreamsBasedAssetsProcessor */ "./ProjectBuilding/Common/TasksExecutors/GulpStreamsBasedAssetsProcessor.ts"));
|
|
761
766
|
/* --- Applied utils ------------------------------------------------------------------------------------------------ */
|
|
@@ -813,7 +818,7 @@ class ImagesProcessor extends GulpStreamsBasedAssetsProcessor_1.default {
|
|
|
813
818
|
fileInInitialState.processingSettings = normalizedImagesGroupSettingsActualForCurrentFile;
|
|
814
819
|
/* [ Theory ] The value of 'path' could change during file processing. */
|
|
815
820
|
fileInInitialState.sourceAbsolutePath = fileInInitialState.path;
|
|
816
|
-
fileInInitialState.outputDirectoryAbsolutePath =
|
|
821
|
+
fileInInitialState.outputDirectoryAbsolutePath = ImagesProcessingSettingsRepresentative_1.default.
|
|
817
822
|
computeActualOutputDirectoryAbsolutePathForTargetSourceFile({
|
|
818
823
|
targetSourceFileAbsolutePath: fileInInitialState.path,
|
|
819
824
|
respectiveAssetsGroupNormalizedSettings: normalizedImagesGroupSettingsActualForCurrentFile
|
|
@@ -914,6 +919,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
914
919
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
915
920
|
const AssetsProcessingSettingsRepresentative_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/SettingsRepresentatives/AssetsProcessingSettingsRepresentative */ "./ProjectBuilding/Common/SettingsRepresentatives/AssetsProcessingSettingsRepresentative.ts"));
|
|
916
921
|
class VideosProcessingSettingsRepresentative extends AssetsProcessingSettingsRepresentative_1.default {
|
|
922
|
+
TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM = "Video";
|
|
917
923
|
TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM = "Videos";
|
|
918
924
|
assetsProcessingCommonSettings;
|
|
919
925
|
actualAssetsGroupsSettings;
|
|
@@ -970,6 +976,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
970
976
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
971
977
|
};
|
|
972
978
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
979
|
+
const VideosProcessingSettingsRepresentative_1 = __importDefault(__webpack_require__(/*! @VideosProcessing/VideosProcessingSettingsRepresentative */ "./ProjectBuilding/AssetsProcessing/Videos/VideosProcessingSettingsRepresentative.ts"));
|
|
973
980
|
/* --- Tasks executor ----------------------------------------------------------------------------------------------- */
|
|
974
981
|
const GulpStreamsBasedAssetsProcessor_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/TasksExecutors/GulpStreamsBasedAssetsProcessor */ "./ProjectBuilding/Common/TasksExecutors/GulpStreamsBasedAssetsProcessor.ts"));
|
|
975
982
|
/* --- Applied utils ------------------------------------------------------------------------------------------------ */
|
|
@@ -1018,7 +1025,7 @@ class VideosProcessor extends GulpStreamsBasedAssetsProcessor_1.default {
|
|
|
1018
1025
|
fileInInitialState.processingSettings = normalizedVideosGroupSettingsActualForCurrentFile;
|
|
1019
1026
|
/* [ Theory ] The value of 'path' could change during file processing. */
|
|
1020
1027
|
fileInInitialState.sourceAbsolutePath = fileInInitialState.path;
|
|
1021
|
-
fileInInitialState.outputDirectoryAbsolutePath =
|
|
1028
|
+
fileInInitialState.outputDirectoryAbsolutePath = VideosProcessingSettingsRepresentative_1.default.
|
|
1022
1029
|
computeActualOutputDirectoryAbsolutePathForTargetSourceFile({
|
|
1023
1030
|
targetSourceFileAbsolutePath: fileInInitialState.path,
|
|
1024
1031
|
respectiveAssetsGroupNormalizedSettings: normalizedVideosGroupSettingsActualForCurrentFile
|
|
@@ -2076,27 +2083,9 @@ const ImprovedPath_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/I
|
|
|
2076
2083
|
const ImprovedGlob_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/ImprovedGlob */ "./UtilsIncubator/ImprovedGlob.ts"));
|
|
2077
2084
|
class AssetsProcessingSettingsRepresentative {
|
|
2078
2085
|
sourceFilesAbsolutePathsAndOutputFilesActualPathsMap = new Map();
|
|
2079
|
-
|
|
2086
|
+
prefixOfAliasOfTopDirectoryOfEntryPointsGroup = "@";
|
|
2080
2087
|
masterConfigRepresentative;
|
|
2081
|
-
|
|
2082
|
-
this.masterConfigRepresentative = masterConfigRepresentative;
|
|
2083
|
-
}
|
|
2084
|
-
get supportedSourceFilesNamesExtensionsWithoutLeadingDots() {
|
|
2085
|
-
return this.assetsProcessingCommonSettings.supportedSourceFilesNamesExtensionsWithoutLeadingDots;
|
|
2086
|
-
}
|
|
2087
|
-
get hasAtLeastOneActualAssetsGroup() {
|
|
2088
|
-
return this.actualAssetsGroupsSettings.size > 0;
|
|
2089
|
-
}
|
|
2090
|
-
get actualAssetsSourceFilesAbsolutePaths() {
|
|
2091
|
-
const assetsSourceFilesAbsolutePaths = [];
|
|
2092
|
-
this.actualAssetsGroupsSettings.forEach((assetsGroupSettings) => {
|
|
2093
|
-
assetsSourceFilesAbsolutePaths.push(...ImprovedGlob_1.default.getFilesAbsolutePathsSynchronously([
|
|
2094
|
-
assetsGroupSettings.sourceFilesGlobSelector
|
|
2095
|
-
]));
|
|
2096
|
-
});
|
|
2097
|
-
return assetsSourceFilesAbsolutePaths;
|
|
2098
|
-
}
|
|
2099
|
-
computeActualOutputDirectoryAbsolutePathForTargetSourceFile({ targetSourceFileAbsolutePath, respectiveAssetsGroupNormalizedSettings }) {
|
|
2088
|
+
static computeActualOutputDirectoryAbsolutePathForTargetSourceFile({ targetSourceFileAbsolutePath, respectiveAssetsGroupNormalizedSettings }) {
|
|
2100
2089
|
let outputDirectoryAbsolutePathForCurrentSourceFile = ImprovedPath_1.default.buildAbsolutePath([
|
|
2101
2090
|
respectiveAssetsGroupNormalizedSettings.outputFilesTopDirectoryAbsolutePath,
|
|
2102
2091
|
ImprovedPath_1.default.computeRelativePath({
|
|
@@ -2124,6 +2113,24 @@ class AssetsProcessingSettingsRepresentative {
|
|
|
2124
2113
|
}
|
|
2125
2114
|
return outputDirectoryAbsolutePathForCurrentSourceFile;
|
|
2126
2115
|
}
|
|
2116
|
+
constructor(masterConfigRepresentative) {
|
|
2117
|
+
this.masterConfigRepresentative = masterConfigRepresentative;
|
|
2118
|
+
}
|
|
2119
|
+
get supportedSourceFilesNamesExtensionsWithoutLeadingDots() {
|
|
2120
|
+
return this.assetsProcessingCommonSettings.supportedSourceFilesNamesExtensionsWithoutLeadingDots;
|
|
2121
|
+
}
|
|
2122
|
+
get hasAtLeastOneActualAssetsGroup() {
|
|
2123
|
+
return this.actualAssetsGroupsSettings.size > 0;
|
|
2124
|
+
}
|
|
2125
|
+
get actualAssetsSourceFilesAbsolutePaths() {
|
|
2126
|
+
const assetsSourceFilesAbsolutePaths = [];
|
|
2127
|
+
this.actualAssetsGroupsSettings.forEach((assetsGroupSettings) => {
|
|
2128
|
+
assetsSourceFilesAbsolutePaths.push(...ImprovedGlob_1.default.getFilesAbsolutePathsSynchronously([
|
|
2129
|
+
assetsGroupSettings.sourceFilesGlobSelector
|
|
2130
|
+
]));
|
|
2131
|
+
});
|
|
2132
|
+
return assetsSourceFilesAbsolutePaths;
|
|
2133
|
+
}
|
|
2127
2134
|
getAssetsNormalizedSettingsActualForTargetSourceFile(targetSourceFileAbsolutePath) {
|
|
2128
2135
|
const assetsNormalizedSettingsActualForTargetSourceFile = Array.from(this.actualAssetsGroupsSettings.values()).
|
|
2129
2136
|
find((assetsGroupNormalizedSettings) => ImprovedGlob_1.default.isFileMatchingWithGlobSelector({
|
|
@@ -2183,6 +2190,19 @@ class GulpStreamBasedSourceCodeProcessingConfigRepresentative extends SourceCode
|
|
|
2183
2190
|
static #localization = GulpStreamBasedSourceCodeProcessingConfigRepresentative.getDefaultLocalization();
|
|
2184
2191
|
partialFilesAndEntryPointsRelationsMap = new Map();
|
|
2185
2192
|
onPartialFilesAndEntryPointsRelationsMapUpdatedEventSubscribers = [];
|
|
2193
|
+
/* === Static helpers ============================================================================================= */
|
|
2194
|
+
static computeRelevantOutputDirectoryAbsolutePathForTargetSourceFile(targetSourceFileAbsolutePath, respectiveEntryPointsGroupSettings) {
|
|
2195
|
+
if (respectiveEntryPointsGroupSettings.isSingeEntryPointGroup) {
|
|
2196
|
+
return respectiveEntryPointsGroupSettings.outputFilesTopDirectoryAbsolutePath;
|
|
2197
|
+
}
|
|
2198
|
+
return ImprovedPath_1.default.buildAbsolutePath([
|
|
2199
|
+
respectiveEntryPointsGroupSettings.outputFilesTopDirectoryAbsolutePath,
|
|
2200
|
+
ImprovedPath_1.default.computeRelativePath({
|
|
2201
|
+
basePath: respectiveEntryPointsGroupSettings.sourceFilesTopDirectoryAbsolutePath,
|
|
2202
|
+
comparedPath: ImprovedPath_1.default.extractDirectoryFromFilePath(targetSourceFileAbsolutePath)
|
|
2203
|
+
})
|
|
2204
|
+
], { forwardSlashOnlySeparators: true });
|
|
2205
|
+
}
|
|
2186
2206
|
static setLocalization(newLocalization) {
|
|
2187
2207
|
this.#localization = newLocalization;
|
|
2188
2208
|
}
|
|
@@ -2223,20 +2243,6 @@ class GulpStreamBasedSourceCodeProcessingConfigRepresentative extends SourceCode
|
|
|
2223
2243
|
}
|
|
2224
2244
|
return entryPointsGroupsNormalizedSettingsRelevantForTargetSourceFile;
|
|
2225
2245
|
}
|
|
2226
|
-
/* eslint-disable-next-line class-methods-use-this --
|
|
2227
|
-
* Intended to be inherited and used by inheritors. */
|
|
2228
|
-
computeRelevantOutputDirectoryAbsolutePathForTargetSourceFile(targetSourceFileAbsolutePath, respectiveEntryPointsGroupSettings) {
|
|
2229
|
-
if (respectiveEntryPointsGroupSettings.isSingeEntryPointGroup) {
|
|
2230
|
-
return respectiveEntryPointsGroupSettings.outputFilesTopDirectoryAbsolutePath;
|
|
2231
|
-
}
|
|
2232
|
-
return ImprovedPath_1.default.buildAbsolutePath([
|
|
2233
|
-
respectiveEntryPointsGroupSettings.outputFilesTopDirectoryAbsolutePath,
|
|
2234
|
-
ImprovedPath_1.default.computeRelativePath({
|
|
2235
|
-
basePath: respectiveEntryPointsGroupSettings.sourceFilesTopDirectoryAbsolutePath,
|
|
2236
|
-
comparedPath: ImprovedPath_1.default.extractDirectoryFromFilePath(targetSourceFileAbsolutePath)
|
|
2237
|
-
})
|
|
2238
|
-
], { forwardSlashOnlySeparators: true });
|
|
2239
|
-
}
|
|
2240
2246
|
/* === Partial files and entry points relations map ============================================================= */
|
|
2241
2247
|
initializeOrUpdatePartialFilesAndEntryPointsRelationsMap() {
|
|
2242
2248
|
this.partialFilesAndEntryPointsRelationsMap.clear();
|
|
@@ -2252,7 +2258,7 @@ class GulpStreamBasedSourceCodeProcessingConfigRepresentative extends SourceCode
|
|
|
2252
2258
|
subscribeOnPartialFilesAndEntryPointsRelationsMapUpdatedEvent(subscriber) {
|
|
2253
2259
|
this.onPartialFilesAndEntryPointsRelationsMapUpdatedEventSubscribers.push(subscriber);
|
|
2254
2260
|
}
|
|
2255
|
-
/* === Localization
|
|
2261
|
+
/* === Localization =============================================================================================== */
|
|
2256
2262
|
static getDefaultLocalization() {
|
|
2257
2263
|
return {
|
|
2258
2264
|
generateEntryPointsGroupNormalizedSettingsNotFoundForSpecifiedFilePath: ({ targetSourceFileAbsolutePath }) => `No normalized config found for file '${targetSourceFileAbsolutePath}'.'`
|
|
@@ -3616,7 +3622,9 @@ const SourceCodeProcessingConfigRepresentative_1 = __importDefault(__webpack_req
|
|
|
3616
3622
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
3617
3623
|
class ECMA_ScriptLogicProcessingSettingsRepresentative extends SourceCodeProcessingConfigRepresentative_1.default {
|
|
3618
3624
|
supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots;
|
|
3625
|
+
TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM = "Script";
|
|
3619
3626
|
TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM = "Scripts";
|
|
3627
|
+
prefixOfAliasOfTopDirectoryOfEntryPointsGroup = "@";
|
|
3620
3628
|
relevantEntryPointsGroupsSettings;
|
|
3621
3629
|
entryPointsSourceFilesAbsolutePathsAndOutputFilesActualPathsMap = new Map();
|
|
3622
3630
|
sourceCodeProcessingCommonSettings;
|
|
@@ -4028,6 +4036,10 @@ class ECMA_ScriptLogicEntryPointsSourceFilesAbsolutePathsAndOutputFilesActualPat
|
|
|
4028
4036
|
else {
|
|
4029
4037
|
correspondingOutputFileAbsolutePath = ImprovedPath_1.default.buildAbsolutePath([
|
|
4030
4038
|
entryPointsGroupNormalizedSettings.outputFilesTopDirectoryAbsolutePath,
|
|
4039
|
+
ImprovedPath_1.default.computeRelativePath({
|
|
4040
|
+
comparedPath: ImprovedPath_1.default.extractDirectoryFromFilePath(sourceFileAbsolutePath),
|
|
4041
|
+
basePath: entryPointsGroupNormalizedSettings.sourceFilesTopDirectoryAbsolutePath
|
|
4042
|
+
}),
|
|
4031
4043
|
`${ImprovedPath_1.default.extractFileNameWithoutExtensionFromPath(sourceFileAbsolutePath)}.js`
|
|
4032
4044
|
], { forwardSlashOnlySeparators: true });
|
|
4033
4045
|
}
|
|
@@ -4755,6 +4767,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4755
4767
|
};
|
|
4756
4768
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4757
4769
|
exports.MarkupProcessor = void 0;
|
|
4770
|
+
const MarkupProcessingSettingsRepresentative_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/MarkupProcessingSettingsRepresentative */ "./ProjectBuilding/SourceCodeProcessing/Markup/MarkupProcessingSettingsRepresentative.ts"));
|
|
4758
4771
|
/* --- Tasks executors ---------------------------------------------------------------------------------------------- */
|
|
4759
4772
|
const GulpStreamsBasedSourceCodeProcessor_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/TasksExecutors/GulpStreamsBasedSourceCodeProcessor */ "./ProjectBuilding/Common/TasksExecutors/GulpStreamsBasedSourceCodeProcessor.ts"));
|
|
4760
4773
|
/* --- Gulp plugins ------------------------------------------------------------------------------------------------- */
|
|
@@ -4763,7 +4776,7 @@ const gulp_pug_1 = __importDefault(__webpack_require__(/*! gulp-pug */ "gulp-pug
|
|
|
4763
4776
|
const gulp_intercept_1 = __importDefault(__webpack_require__(/*! gulp-intercept */ "gulp-intercept"));
|
|
4764
4777
|
const gulp_html_prettify_1 = __importDefault(__webpack_require__(/*! gulp-html-prettify */ "gulp-html-prettify"));
|
|
4765
4778
|
/* --- Applied utils ------------------------------------------------------------------------------------------------ */
|
|
4766
|
-
const
|
|
4779
|
+
const ResourceFilesPathsAliasesResolverForHTML_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/Plugins/AssetsPathsAliasesResolverForHTML/ResourceFilesPathsAliasesResolverForHTML */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/AssetsPathsAliasesResolverForHTML/ResourceFilesPathsAliasesResolverForHTML.ts"));
|
|
4767
4780
|
const HTML_Validator_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/Plugins/HTML_Validator/HTML_Validator */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_Validator.ts"));
|
|
4768
4781
|
const AccessibilityInspector_1 = __importDefault(__webpack_require__(/*! ./Plugins/AccessibilityInspector/AccessibilityInspector */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/AccessibilityInspector/AccessibilityInspector.ts"));
|
|
4769
4782
|
const removeExtraSpacesFromJapaneseText_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/Plugins/removeExtraSpacesFromJapaneseText */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/removeExtraSpacesFromJapaneseText.ts"));
|
|
@@ -4822,13 +4835,13 @@ class MarkupProcessor extends GulpStreamsBasedSourceCodeProcessor_1.default {
|
|
|
4822
4835
|
fileInInitialState.processingSettings = markupEntryPointsGroupSettingsActualForCurrentFile;
|
|
4823
4836
|
/* [ Theory ] The value of 'path' could change during file processing. */
|
|
4824
4837
|
fileInInitialState.sourceAbsolutePath = ImprovedPath_1.default.replacePathSeparatorsToForwardSlashes(fileInInitialState.path);
|
|
4825
|
-
fileInInitialState.outputDirectoryAbsolutePath =
|
|
4838
|
+
fileInInitialState.outputDirectoryAbsolutePath = MarkupProcessingSettingsRepresentative_1.default.
|
|
4826
4839
|
computeRelevantOutputDirectoryAbsolutePathForTargetSourceFile(fileInInitialState.path, markupEntryPointsGroupSettingsActualForCurrentFile);
|
|
4827
4840
|
return fileInInitialState;
|
|
4828
4841
|
}
|
|
4829
4842
|
onRawOutputCode(_compiledHTML_File) {
|
|
4830
4843
|
const compiledHTML_File = _compiledHTML_File;
|
|
4831
|
-
compiledHTML_File.contents = Buffer.from(
|
|
4844
|
+
compiledHTML_File.contents = Buffer.from(ResourceFilesPathsAliasesResolverForHTML_1.default.resolvePathAliases(compiledHTML_File, this.masterConfigRepresentative));
|
|
4832
4845
|
return compiledHTML_File;
|
|
4833
4846
|
}
|
|
4834
4847
|
onPostProcessedCode(_compiledHTML_File) {
|
|
@@ -4864,7 +4877,7 @@ const AccessibilityInspectorLocalization_english_1 = __importDefault(__webpack_r
|
|
|
4864
4877
|
/* --- Applied utils ------------------------------------------------------------------------------------------------ */
|
|
4865
4878
|
const access_sniff_1 = __importDefault(__webpack_require__(/*! access-sniff */ "access-sniff"));
|
|
4866
4879
|
const node_notifier_1 = __importDefault(__webpack_require__(/*! node-notifier */ "node-notifier"));
|
|
4867
|
-
const
|
|
4880
|
+
const getExpectedToBeNonNullStringifiedContentOfVinylFile_1 = __importDefault(__webpack_require__(/*! @Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile */ "./Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile.ts"));
|
|
4868
4881
|
const isCompiledHTML_ContentEmpty_1 = __importDefault(__webpack_require__(/*! @Utils/isCompiledHTML_ContentEmpty */ "./Utils/isCompiledHTML_ContentEmpty.ts"));
|
|
4869
4882
|
/* --- General utils ------------------------------------------------------------------------------------------------ */
|
|
4870
4883
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
@@ -4873,7 +4886,7 @@ const Stopwatch_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/Stop
|
|
|
4873
4886
|
class AccessibilityInspector {
|
|
4874
4887
|
static localization = AccessibilityInspectorLocalization_english_1.default;
|
|
4875
4888
|
static inspectAccessibility(compiledHTML_File, masterConfigRepresentative) {
|
|
4876
|
-
const extractedHTML_Code = (0,
|
|
4889
|
+
const extractedHTML_Code = (0, getExpectedToBeNonNullStringifiedContentOfVinylFile_1.default)(compiledHTML_File);
|
|
4877
4890
|
const targetFileRelativePath = ImprovedPath_1.default.computeRelativePath({
|
|
4878
4891
|
basePath: masterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath,
|
|
4879
4892
|
comparedPath: compiledHTML_File.path
|
|
@@ -4888,7 +4901,7 @@ class AccessibilityInspector {
|
|
|
4888
4901
|
* 1. With '{ verbose: true }' (default) it will be a lot of recommendations which never disappear. The output pollution.
|
|
4889
4902
|
* 2. In `import AccessSniff, { reports } from 'access-sniff';`, the 'reports' are 'undefined',
|
|
4890
4903
|
* 3. In 'then(function(report) {}}', the 'report' is an empty object. */
|
|
4891
|
-
(0, access_sniff_1.default)((0,
|
|
4904
|
+
(0, access_sniff_1.default)((0, getExpectedToBeNonNullStringifiedContentOfVinylFile_1.default)(compiledHTML_File), {
|
|
4892
4905
|
verbose: false,
|
|
4893
4906
|
accessibilityLevel: compiledHTML_File.processingSettings.accessibilityInspection.standard
|
|
4894
4907
|
}).
|
|
@@ -4972,10 +4985,50 @@ exports["default"] = AccessibilityInspectorLocalization__English;
|
|
|
4972
4985
|
|
|
4973
4986
|
/***/ }),
|
|
4974
4987
|
|
|
4975
|
-
/***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/AssetsPathsAliasesResolverForHTML/
|
|
4976
|
-
|
|
4977
|
-
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/AssetsPathsAliasesResolverForHTML/
|
|
4978
|
-
|
|
4988
|
+
/***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/AssetsPathsAliasesResolverForHTML/AssetsPathsAliasesResolverForHTML_Localization.english.ts":
|
|
4989
|
+
/*!*********************************************************************************************************************************************************!*\
|
|
4990
|
+
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/AssetsPathsAliasesResolverForHTML/AssetsPathsAliasesResolverForHTML_Localization.english.ts ***!
|
|
4991
|
+
\*********************************************************************************************************************************************************/
|
|
4992
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4993
|
+
|
|
4994
|
+
|
|
4995
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4996
|
+
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
4997
|
+
const assetsPathsAliasesResolverForHTML_Localization__english = {
|
|
4998
|
+
generateUnableToResolveShortenedAbsolutePathWarning: (namedParameters) => ({
|
|
4999
|
+
title: `${(0, es_extensions_1.capitalizeFirstCharacter)(namedParameters.filesType__singularForm)} file, unable to resolve the absolute path`,
|
|
5000
|
+
description: `Unable to resolve the shortened absolute path for the ${namedParameters.filesType__singularForm} file ` +
|
|
5001
|
+
`because no public path has been specified for '${namedParameters.projectBuildingMode}' project building mode. ` +
|
|
5002
|
+
"Relative path will be used instead."
|
|
5003
|
+
}),
|
|
5004
|
+
generateUnknownSourceFileTopDirectoryAliasWarning: (namedParameters) => ({
|
|
5005
|
+
title: `${namedParameters.fileType__singularForm} file, unknown directory path alias`,
|
|
5006
|
+
description: `The alias '${namedParameters.firstPathSegment}' in path ` +
|
|
5007
|
+
`'${namedParameters.pickedPathOfTargetResourceFile}' has not been specified neither explicitly nor implicitly ` +
|
|
5008
|
+
"(via resources group name). Below directories paths' aliases are available for usage: \n" +
|
|
5009
|
+
`${namedParameters.formattedSourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap}`
|
|
5010
|
+
}),
|
|
5011
|
+
generateNoMatchingsForAliasedFilePathWithoutFilenameExtensionWarning: (namedParameters) => ({
|
|
5012
|
+
title: `Unknown path to ${namedParameters.fileType__singularForm} file`,
|
|
5013
|
+
description: `The aliased path '${namedParameters.pickedPathOfTargetResourceFile}' without filename extension ` +
|
|
5014
|
+
"refers to unknown file. Tried to search with all supported filename extensions: " +
|
|
5015
|
+
`${namedParameters.checkedAbsolutePaths__formatted}.`
|
|
5016
|
+
}),
|
|
5017
|
+
generateNoOutputFileExistingForSpecifiedSourceFilePath: (namedParameters) => ({
|
|
5018
|
+
title: `Unknown path to ${namedParameters.fileType__singularForm} file`,
|
|
5019
|
+
description: `No ${namedParameters.fileType__singularForm} output file has been found for specified aliased source ` +
|
|
5020
|
+
`file path '${namedParameters.pickedPathOfTargetResourceFile}'.`
|
|
5021
|
+
})
|
|
5022
|
+
};
|
|
5023
|
+
exports["default"] = assetsPathsAliasesResolverForHTML_Localization__english;
|
|
5024
|
+
|
|
5025
|
+
|
|
5026
|
+
/***/ }),
|
|
5027
|
+
|
|
5028
|
+
/***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/AssetsPathsAliasesResolverForHTML/ResourceFilesPathsAliasesResolverForHTML.ts":
|
|
5029
|
+
/*!*******************************************************************************************************************************************!*\
|
|
5030
|
+
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/AssetsPathsAliasesResolverForHTML/ResourceFilesPathsAliasesResolverForHTML.ts ***!
|
|
5031
|
+
\*******************************************************************************************************************************************/
|
|
4979
5032
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
4980
5033
|
|
|
4981
5034
|
|
|
@@ -4987,60 +5040,66 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
4987
5040
|
const AssetsPathsAliasesResolverForHTML_Localization_english_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/Plugins/AssetsPathsAliasesResolverForHTML/AssetsPathsAliasesResolverForHTML_Localization.english */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/AssetsPathsAliasesResolverForHTML/AssetsPathsAliasesResolverForHTML_Localization.english.ts"));
|
|
4988
5041
|
/* --- Applied auxiliaries ------------------------------------------------------------------------------------------ */
|
|
4989
5042
|
const cheerio_1 = __importDefault(__webpack_require__(/*! cheerio */ "cheerio"));
|
|
4990
|
-
const
|
|
5043
|
+
const getExpectedToBeNonNullStringifiedContentOfVinylFile_1 = __importDefault(__webpack_require__(/*! @Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile */ "./Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile.ts"));
|
|
4991
5044
|
/* --- General auxiliaries ------------------------------------------------------------------------------------------ */
|
|
4992
5045
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
4993
5046
|
const ImprovedPath_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/ImprovedPath/ImprovedPath */ "./UtilsIncubator/ImprovedPath/ImprovedPath.ts"));
|
|
4994
|
-
class
|
|
5047
|
+
class ResourceFilesPathsAliasesResolverForHTML {
|
|
4995
5048
|
static localization = AssetsPathsAliasesResolverForHTML_Localization_english_1.default;
|
|
4996
5049
|
compiledHTML_File;
|
|
4997
|
-
|
|
5050
|
+
HTML_FileContentCheerioCapturing;
|
|
4998
5051
|
masterConfigRepresentative;
|
|
4999
|
-
static
|
|
5000
|
-
return new
|
|
5052
|
+
static resolvePathAliases(compiledHTML_File, masterConfigRepresentative) {
|
|
5053
|
+
return new ResourceFilesPathsAliasesResolverForHTML(compiledHTML_File, masterConfigRepresentative).
|
|
5001
5054
|
resolveStylesheetsPathsAliases().
|
|
5002
5055
|
resoleScriptsPathsAliases().
|
|
5003
5056
|
resolveImagesPathsAliases().
|
|
5004
5057
|
resolveVideosPathsAliases().
|
|
5005
5058
|
resolveAudiosPathsAliases().
|
|
5006
|
-
/*
|
|
5007
|
-
|
|
5059
|
+
/* [ Theory ] Without '{ decodeEntities: false }' all ideographic characters will be converted to entities
|
|
5060
|
+
* like '文' what could cause some troubles during HTML code post-processing. */
|
|
5061
|
+
HTML_FileContentCheerioCapturing.
|
|
5062
|
+
html({ decodeEntities: false });
|
|
5008
5063
|
}
|
|
5009
5064
|
constructor(compiledHTML_File, masterConfigRepresentative) {
|
|
5010
5065
|
this.compiledHTML_File = compiledHTML_File;
|
|
5011
|
-
this
|
|
5066
|
+
this.HTML_FileContentCheerioCapturing = cheerio_1.default.load((0, getExpectedToBeNonNullStringifiedContentOfVinylFile_1.default)(compiledHTML_File));
|
|
5012
5067
|
this.masterConfigRepresentative = masterConfigRepresentative;
|
|
5013
5068
|
}
|
|
5014
5069
|
resolveStylesheetsPathsAliases() {
|
|
5015
5070
|
if ((0, es_extensions_1.isUndefined)(this.masterConfigRepresentative.stylesProcessingSettingsRepresentative)) {
|
|
5016
5071
|
return this;
|
|
5017
5072
|
}
|
|
5018
|
-
const
|
|
5019
|
-
for (const linkElement of Array.from(this
|
|
5020
|
-
const $
|
|
5021
|
-
const hrefAttributeValue = $
|
|
5022
|
-
if ((0, es_extensions_1.
|
|
5073
|
+
const stylesProcessingSettingsRepresentative = this.masterConfigRepresentative.stylesProcessingSettingsRepresentative;
|
|
5074
|
+
for (const linkElement of Array.from(this.HTML_FileContentCheerioCapturing("link[rel='stylesheet']"))) {
|
|
5075
|
+
const $linkElement = this.HTML_FileContentCheerioCapturing(linkElement);
|
|
5076
|
+
const hrefAttributeValue = $linkElement.attr("href");
|
|
5077
|
+
if (!(0, es_extensions_1.isNonEmptyString)(hrefAttributeValue)) {
|
|
5023
5078
|
continue;
|
|
5024
5079
|
}
|
|
5025
|
-
const
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
sourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap: (0, es_extensions_1.createMapBasedOnOtherMap)(
|
|
5080
|
+
const resolvedOutputAbsolutePathOfStylesheet = this.resolveOutputResourceFileAbsolutePathIfPossible({
|
|
5081
|
+
pickedPathOfTargetResourceFile: hrefAttributeValue,
|
|
5082
|
+
prefixOfAliasOfTopDirectoryOfResourcesGroup: stylesProcessingSettingsRepresentative.
|
|
5083
|
+
prefixOfAliasOfTopDirectoryOfEntryPointsGroup,
|
|
5084
|
+
sourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap: (0, es_extensions_1.createMapBasedOnOtherMap)(stylesProcessingSettingsRepresentative.entryPointsGroupsNormalizedSettingsMappedByPathAliases, (pathAlias, stylesEntryPointsGroupNormalizedSettings) => [
|
|
5030
5085
|
pathAlias,
|
|
5031
5086
|
stylesEntryPointsGroupNormalizedSettings.isSingeEntryPointGroup ?
|
|
5032
5087
|
stylesEntryPointsGroupNormalizedSettings.sourceFilesGlobSelectors[0] :
|
|
5033
5088
|
stylesEntryPointsGroupNormalizedSettings.sourceFilesTopDirectoryAbsolutePath
|
|
5034
5089
|
]),
|
|
5035
|
-
supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots:
|
|
5090
|
+
supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots: stylesProcessingSettingsRepresentative.
|
|
5036
5091
|
supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots,
|
|
5037
|
-
sourceAndOutputFilesAbsolutePathsCorrespondenceMap:
|
|
5038
|
-
|
|
5092
|
+
sourceAndOutputFilesAbsolutePathsCorrespondenceMap: stylesProcessingSettingsRepresentative.sourceAndOutputFilesAbsolutePathsCorrespondenceMap,
|
|
5093
|
+
fileTypeForLogging__singularForm: stylesProcessingSettingsRepresentative.TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM,
|
|
5094
|
+
fileTypeForLogging__pluralForm: stylesProcessingSettingsRepresentative.TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM
|
|
5039
5095
|
});
|
|
5040
|
-
if ((0, es_extensions_1.isNull)(
|
|
5096
|
+
if ((0, es_extensions_1.isNull)(resolvedOutputAbsolutePathOfStylesheet)) {
|
|
5041
5097
|
continue;
|
|
5042
5098
|
}
|
|
5043
|
-
$
|
|
5099
|
+
$linkElement.attr("href", this.buildResourceFileFinalPath({
|
|
5100
|
+
resolvedOutputAbsolutePathOfResourceFile: resolvedOutputAbsolutePathOfStylesheet,
|
|
5101
|
+
resourceFileType__singularForm: stylesProcessingSettingsRepresentative.TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM
|
|
5102
|
+
}));
|
|
5044
5103
|
}
|
|
5045
5104
|
return this;
|
|
5046
5105
|
}
|
|
@@ -5049,16 +5108,16 @@ class AssetsPathsAliasesResolverForHTML {
|
|
|
5049
5108
|
return this;
|
|
5050
5109
|
}
|
|
5051
5110
|
const ECMA_ScriptLogicProcessingConfigRepresentative = this.masterConfigRepresentative.ECMA_ScriptLogicProcessingSettingsRepresentative;
|
|
5052
|
-
for (const scriptElement of Array.from(this
|
|
5053
|
-
const $
|
|
5054
|
-
const srcAttributeValue = $
|
|
5055
|
-
if ((0, es_extensions_1.
|
|
5111
|
+
for (const scriptElement of Array.from(this.HTML_FileContentCheerioCapturing("script"))) {
|
|
5112
|
+
const $scriptElement = this.HTML_FileContentCheerioCapturing(scriptElement);
|
|
5113
|
+
const srcAttributeValue = $scriptElement.attr("src");
|
|
5114
|
+
if (!(0, es_extensions_1.isNonEmptyString)(srcAttributeValue)) {
|
|
5056
5115
|
continue;
|
|
5057
5116
|
}
|
|
5058
|
-
const
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5117
|
+
const resolvedOutputAbsolutePathOfScript = this.resolveOutputResourceFileAbsolutePathIfPossible({
|
|
5118
|
+
pickedPathOfTargetResourceFile: srcAttributeValue,
|
|
5119
|
+
prefixOfAliasOfTopDirectoryOfResourcesGroup: ECMA_ScriptLogicProcessingConfigRepresentative.
|
|
5120
|
+
prefixOfAliasOfTopDirectoryOfEntryPointsGroup,
|
|
5062
5121
|
sourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap: (0, es_extensions_1.createMapBasedOnOtherMap)(ECMA_ScriptLogicProcessingConfigRepresentative.entryPointsGroupsNormalizedSettingsMappedByPathAliases, (pathAlias, entryPointsGroupNormalizedSettings) => [
|
|
5063
5122
|
pathAlias,
|
|
5064
5123
|
entryPointsGroupNormalizedSettings.isSingeEntryPointGroup ?
|
|
@@ -5067,12 +5126,19 @@ class AssetsPathsAliasesResolverForHTML {
|
|
|
5067
5126
|
]),
|
|
5068
5127
|
supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots: ECMA_ScriptLogicProcessingConfigRepresentative.supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots,
|
|
5069
5128
|
sourceAndOutputFilesAbsolutePathsCorrespondenceMap: ECMA_ScriptLogicProcessingConfigRepresentative.entryPointsSourceFilesAbsolutePathsAndOutputFilesActualPathsMap,
|
|
5070
|
-
|
|
5129
|
+
fileTypeForLogging__singularForm: ECMA_ScriptLogicProcessingConfigRepresentative.
|
|
5130
|
+
TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM,
|
|
5131
|
+
fileTypeForLogging__pluralForm: ECMA_ScriptLogicProcessingConfigRepresentative.
|
|
5132
|
+
TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM
|
|
5071
5133
|
});
|
|
5072
|
-
if ((0, es_extensions_1.isNull)(
|
|
5134
|
+
if ((0, es_extensions_1.isNull)(resolvedOutputAbsolutePathOfScript)) {
|
|
5073
5135
|
continue;
|
|
5074
5136
|
}
|
|
5075
|
-
$
|
|
5137
|
+
$scriptElement.attr("src", this.buildResourceFileFinalPath({
|
|
5138
|
+
resolvedOutputAbsolutePathOfResourceFile: resolvedOutputAbsolutePathOfScript,
|
|
5139
|
+
resourceFileType__singularForm: ECMA_ScriptLogicProcessingConfigRepresentative.
|
|
5140
|
+
TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM
|
|
5141
|
+
}));
|
|
5076
5142
|
}
|
|
5077
5143
|
return this;
|
|
5078
5144
|
}
|
|
@@ -5081,47 +5147,55 @@ class AssetsPathsAliasesResolverForHTML {
|
|
|
5081
5147
|
return this;
|
|
5082
5148
|
}
|
|
5083
5149
|
const imagesProcessingConfigRepresentative = this.masterConfigRepresentative.imagesProcessingSettingsRepresentative;
|
|
5084
|
-
for (const imageElement of Array.from(this
|
|
5085
|
-
const $
|
|
5086
|
-
const srcAttributeValue = $
|
|
5087
|
-
if ((0, es_extensions_1.
|
|
5150
|
+
for (const imageElement of Array.from(this.HTML_FileContentCheerioCapturing("img"))) {
|
|
5151
|
+
const $imageElement = this.HTML_FileContentCheerioCapturing(imageElement);
|
|
5152
|
+
const srcAttributeValue = $imageElement.attr("src");
|
|
5153
|
+
if (!(0, es_extensions_1.isNonEmptyString)(srcAttributeValue)) {
|
|
5088
5154
|
continue;
|
|
5089
5155
|
}
|
|
5090
|
-
const
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5156
|
+
const resolvedOutputAbsolutePathOfImage = this.resolveOutputResourceFileAbsolutePathIfPossible({
|
|
5157
|
+
pickedPathOfTargetResourceFile: srcAttributeValue,
|
|
5158
|
+
prefixOfAliasOfTopDirectoryOfResourcesGroup: imagesProcessingConfigRepresentative.
|
|
5159
|
+
prefixOfAliasOfTopDirectoryOfEntryPointsGroup,
|
|
5094
5160
|
sourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap: (0, es_extensions_1.createMapBasedOnOtherMap)(imagesProcessingConfigRepresentative.assetsGroupsNormalizedSettingsMappedByAssetAliases, (pathAlias, stylesEntryPointsGroupNormalizedSettings) => [pathAlias, stylesEntryPointsGroupNormalizedSettings.sourceFilesTopDirectoryAbsolutePath]),
|
|
5095
5161
|
supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots: imagesProcessingConfigRepresentative.supportedSourceFilesNamesExtensionsWithoutLeadingDots,
|
|
5096
5162
|
sourceAndOutputFilesAbsolutePathsCorrespondenceMap: imagesProcessingConfigRepresentative.sourceFilesAbsolutePathsAndOutputFilesActualPathsMap,
|
|
5097
|
-
|
|
5163
|
+
fileTypeForLogging__singularForm: imagesProcessingConfigRepresentative.TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM,
|
|
5164
|
+
fileTypeForLogging__pluralForm: imagesProcessingConfigRepresentative.TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM
|
|
5098
5165
|
});
|
|
5099
|
-
if ((0, es_extensions_1.isNull)(
|
|
5166
|
+
if ((0, es_extensions_1.isNull)(resolvedOutputAbsolutePathOfImage)) {
|
|
5100
5167
|
continue;
|
|
5101
5168
|
}
|
|
5102
|
-
$
|
|
5169
|
+
$imageElement.attr("src", this.buildResourceFileFinalPath({
|
|
5170
|
+
resolvedOutputAbsolutePathOfResourceFile: resolvedOutputAbsolutePathOfImage,
|
|
5171
|
+
resourceFileType__singularForm: imagesProcessingConfigRepresentative.TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM
|
|
5172
|
+
}));
|
|
5103
5173
|
}
|
|
5104
|
-
for (const linkElement of Array.from(this
|
|
5105
|
-
const $
|
|
5106
|
-
const hrefAttributeValue = $
|
|
5174
|
+
for (const linkElement of Array.from(this.HTML_FileContentCheerioCapturing("link[type='image/x-icon']"))) {
|
|
5175
|
+
const $linkElement = this.HTML_FileContentCheerioCapturing(linkElement);
|
|
5176
|
+
const hrefAttributeValue = $linkElement.attr("href");
|
|
5107
5177
|
if ((0, es_extensions_1.isUndefined)(hrefAttributeValue)) {
|
|
5108
5178
|
continue;
|
|
5109
5179
|
}
|
|
5110
|
-
const imageResolvedOutputAbsolutePath =
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5180
|
+
const imageResolvedOutputAbsolutePath = this.resolveOutputResourceFileAbsolutePathIfPossible({
|
|
5181
|
+
pickedPathOfTargetResourceFile: hrefAttributeValue,
|
|
5182
|
+
prefixOfAliasOfTopDirectoryOfResourcesGroup: imagesProcessingConfigRepresentative.
|
|
5183
|
+
prefixOfAliasOfTopDirectoryOfEntryPointsGroup,
|
|
5114
5184
|
sourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap: (0, es_extensions_1.createMapBasedOnOtherMap)(imagesProcessingConfigRepresentative.assetsGroupsNormalizedSettingsMappedByAssetAliases, (pathAlias, stylesEntryPointsGroupNormalizedSettings) => [
|
|
5115
5185
|
pathAlias, stylesEntryPointsGroupNormalizedSettings.sourceFilesTopDirectoryAbsolutePath
|
|
5116
5186
|
]),
|
|
5117
5187
|
supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots: imagesProcessingConfigRepresentative.supportedSourceFilesNamesExtensionsWithoutLeadingDots,
|
|
5118
5188
|
sourceAndOutputFilesAbsolutePathsCorrespondenceMap: imagesProcessingConfigRepresentative.sourceFilesAbsolutePathsAndOutputFilesActualPathsMap,
|
|
5119
|
-
|
|
5189
|
+
fileTypeForLogging__singularForm: imagesProcessingConfigRepresentative.TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM,
|
|
5190
|
+
fileTypeForLogging__pluralForm: imagesProcessingConfigRepresentative.TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM
|
|
5120
5191
|
});
|
|
5121
5192
|
if ((0, es_extensions_1.isNull)(imageResolvedOutputAbsolutePath)) {
|
|
5122
5193
|
continue;
|
|
5123
5194
|
}
|
|
5124
|
-
$
|
|
5195
|
+
$linkElement.attr("href", this.buildResourceFileFinalPath({
|
|
5196
|
+
resolvedOutputAbsolutePathOfResourceFile: imageResolvedOutputAbsolutePath,
|
|
5197
|
+
resourceFileType__singularForm: imagesProcessingConfigRepresentative.TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM
|
|
5198
|
+
}));
|
|
5125
5199
|
}
|
|
5126
5200
|
return this;
|
|
5127
5201
|
}
|
|
@@ -5130,159 +5204,134 @@ class AssetsPathsAliasesResolverForHTML {
|
|
|
5130
5204
|
return this;
|
|
5131
5205
|
}
|
|
5132
5206
|
const videosProcessingConfigRepresentative = this.masterConfigRepresentative.videosProcessingSettingsRepresentative;
|
|
5133
|
-
for (const sourceElement of Array.from(this
|
|
5134
|
-
const $
|
|
5135
|
-
const srcAttributeValue = $
|
|
5136
|
-
if ((0, es_extensions_1.
|
|
5207
|
+
for (const sourceElement of Array.from(this.HTML_FileContentCheerioCapturing("video > source"))) {
|
|
5208
|
+
const $sourceElement = this.HTML_FileContentCheerioCapturing(sourceElement);
|
|
5209
|
+
const srcAttributeValue = $sourceElement.attr("src");
|
|
5210
|
+
if (!(0, es_extensions_1.isNonEmptyString)(srcAttributeValue)) {
|
|
5137
5211
|
continue;
|
|
5138
5212
|
}
|
|
5139
|
-
const
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5213
|
+
const resolvedOutputAbsolutePathOfVideo = this.resolveOutputResourceFileAbsolutePathIfPossible({
|
|
5214
|
+
pickedPathOfTargetResourceFile: srcAttributeValue,
|
|
5215
|
+
prefixOfAliasOfTopDirectoryOfResourcesGroup: videosProcessingConfigRepresentative.
|
|
5216
|
+
prefixOfAliasOfTopDirectoryOfEntryPointsGroup,
|
|
5143
5217
|
sourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap: (0, es_extensions_1.createMapBasedOnOtherMap)(videosProcessingConfigRepresentative.assetsGroupsNormalizedSettingsMappedByAssetAliases, (pathAlias, stylesEntryPointsGroupNormalizedSettings) => [pathAlias, stylesEntryPointsGroupNormalizedSettings.sourceFilesTopDirectoryAbsolutePath]),
|
|
5144
5218
|
supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots: videosProcessingConfigRepresentative.supportedSourceFilesNamesExtensionsWithoutLeadingDots,
|
|
5145
5219
|
sourceAndOutputFilesAbsolutePathsCorrespondenceMap: videosProcessingConfigRepresentative.sourceFilesAbsolutePathsAndOutputFilesActualPathsMap,
|
|
5146
|
-
|
|
5220
|
+
fileTypeForLogging__singularForm: videosProcessingConfigRepresentative.TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM,
|
|
5221
|
+
fileTypeForLogging__pluralForm: videosProcessingConfigRepresentative.TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM
|
|
5147
5222
|
});
|
|
5148
|
-
if ((0, es_extensions_1.isNull)(
|
|
5223
|
+
if ((0, es_extensions_1.isNull)(resolvedOutputAbsolutePathOfVideo)) {
|
|
5149
5224
|
continue;
|
|
5150
5225
|
}
|
|
5151
|
-
$
|
|
5226
|
+
$sourceElement.attr("src", this.buildResourceFileFinalPath({
|
|
5227
|
+
resolvedOutputAbsolutePathOfResourceFile: resolvedOutputAbsolutePathOfVideo,
|
|
5228
|
+
resourceFileType__singularForm: videosProcessingConfigRepresentative.TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM
|
|
5229
|
+
}));
|
|
5152
5230
|
}
|
|
5153
5231
|
return this;
|
|
5154
5232
|
}
|
|
5155
|
-
/* --- 録音 -------------------------------------------------------------------------------------------------------- */
|
|
5156
5233
|
resolveAudiosPathsAliases() {
|
|
5157
5234
|
if ((0, es_extensions_1.isUndefined)(this.masterConfigRepresentative.audiosProcessingSettingsRepresentative)) {
|
|
5158
5235
|
return this;
|
|
5159
5236
|
}
|
|
5160
5237
|
const audiosProcessingConfigRepresentative = this.masterConfigRepresentative.audiosProcessingSettingsRepresentative;
|
|
5161
|
-
for (const sourceElement of Array.from(this
|
|
5162
|
-
const $
|
|
5163
|
-
const srcAttributeValue = $
|
|
5238
|
+
for (const sourceElement of Array.from(this.HTML_FileContentCheerioCapturing("audio > source"))) {
|
|
5239
|
+
const $sourceElement = this.HTML_FileContentCheerioCapturing(sourceElement);
|
|
5240
|
+
const srcAttributeValue = $sourceElement.attr("src");
|
|
5164
5241
|
if ((0, es_extensions_1.isUndefined)(srcAttributeValue)) {
|
|
5165
5242
|
continue;
|
|
5166
5243
|
}
|
|
5167
|
-
const
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5244
|
+
const resolvedOutputAbsolutePathOfVideo = this.resolveOutputResourceFileAbsolutePathIfPossible({
|
|
5245
|
+
pickedPathOfTargetResourceFile: srcAttributeValue,
|
|
5246
|
+
prefixOfAliasOfTopDirectoryOfResourcesGroup: audiosProcessingConfigRepresentative.
|
|
5247
|
+
prefixOfAliasOfTopDirectoryOfEntryPointsGroup,
|
|
5171
5248
|
sourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap: (0, es_extensions_1.createMapBasedOnOtherMap)(audiosProcessingConfigRepresentative.assetsGroupsNormalizedSettingsMappedByAssetAliases, (pathAlias, stylesEntryPointsGroupNormalizedSettings) => [pathAlias, stylesEntryPointsGroupNormalizedSettings.sourceFilesTopDirectoryAbsolutePath]),
|
|
5172
5249
|
supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots: audiosProcessingConfigRepresentative.supportedSourceFilesNamesExtensionsWithoutLeadingDots,
|
|
5173
5250
|
sourceAndOutputFilesAbsolutePathsCorrespondenceMap: audiosProcessingConfigRepresentative.sourceFilesAbsolutePathsAndOutputFilesActualPathsMap,
|
|
5174
|
-
|
|
5251
|
+
fileTypeForLogging__singularForm: audiosProcessingConfigRepresentative.TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM,
|
|
5252
|
+
fileTypeForLogging__pluralForm: audiosProcessingConfigRepresentative.TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM
|
|
5175
5253
|
});
|
|
5176
|
-
if ((0, es_extensions_1.isNull)(
|
|
5254
|
+
if ((0, es_extensions_1.isNull)(resolvedOutputAbsolutePathOfVideo)) {
|
|
5177
5255
|
continue;
|
|
5178
5256
|
}
|
|
5179
|
-
$
|
|
5257
|
+
$sourceElement.attr("src", this.buildResourceFileFinalPath({
|
|
5258
|
+
resolvedOutputAbsolutePathOfResourceFile: resolvedOutputAbsolutePathOfVideo,
|
|
5259
|
+
resourceFileType__singularForm: audiosProcessingConfigRepresentative.TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM
|
|
5260
|
+
}));
|
|
5180
5261
|
}
|
|
5181
5262
|
return this;
|
|
5182
5263
|
}
|
|
5183
5264
|
/* --- Helpers ---------------------------------------------------------------------------------------------------- */
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
filesTypeForLogging: assetTypeForLogging
|
|
5192
|
-
}));
|
|
5193
|
-
}
|
|
5194
|
-
return ImprovedPath_1.default.computeRelativePath({
|
|
5195
|
-
basePath: this.compiledHTML_File.outputDirectoryAbsolutePath,
|
|
5196
|
-
comparedPath: assetResolvedOutputAbsolutePath
|
|
5197
|
-
});
|
|
5198
|
-
}
|
|
5199
|
-
return `/${ImprovedPath_1.default.computeRelativePath({
|
|
5200
|
-
basePath: this.masterConfigRepresentative.actualPublicDirectoryAbsolutePath,
|
|
5201
|
-
comparedPath: assetResolvedOutputAbsolutePath
|
|
5202
|
-
})}`;
|
|
5203
|
-
}
|
|
5204
|
-
static resolveOutputAssetFileAbsolutePathIfPossible({ pickedURL, filePathAliasPrefix, sourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap, supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots, sourceAndOutputFilesAbsolutePathsCorrespondenceMap, fileTypeForLogging }) {
|
|
5205
|
-
const pickedURL_Segments = ImprovedPath_1.default.splitPathToSegments(pickedURL);
|
|
5206
|
-
const firstURL_Segment__possiblyPathAlias = pickedURL_Segments[0];
|
|
5207
|
-
if ((0, es_extensions_1.isUndefined)(firstURL_Segment__possiblyPathAlias) ||
|
|
5208
|
-
!firstURL_Segment__possiblyPathAlias.startsWith(filePathAliasPrefix)) {
|
|
5265
|
+
/* eslint-disable-next-line class-methods-use-this --
|
|
5266
|
+
* The method is being used before non-static "buildResourceFileFinalPath", so in this case it has been declared first. */
|
|
5267
|
+
resolveOutputResourceFileAbsolutePathIfPossible({ pickedPathOfTargetResourceFile, prefixOfAliasOfTopDirectoryOfResourcesGroup, sourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap, supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots, sourceAndOutputFilesAbsolutePathsCorrespondenceMap, fileTypeForLogging__pluralForm }) {
|
|
5268
|
+
const segmentsOfPickedPath = ImprovedPath_1.default.splitPathToSegments(pickedPathOfTargetResourceFile);
|
|
5269
|
+
const firstSegmentOfPickedPath = segmentsOfPickedPath[0];
|
|
5270
|
+
if ((0, es_extensions_1.isUndefined)(firstSegmentOfPickedPath) ||
|
|
5271
|
+
!firstSegmentOfPickedPath.startsWith(prefixOfAliasOfTopDirectoryOfResourcesGroup)) {
|
|
5209
5272
|
return null;
|
|
5210
5273
|
}
|
|
5211
|
-
const
|
|
5212
|
-
if ((0, es_extensions_1.isUndefined)(
|
|
5213
|
-
es_extensions_1.Logger.logWarning(
|
|
5214
|
-
|
|
5215
|
-
firstPathSegment:
|
|
5216
|
-
|
|
5274
|
+
const sourceFilesTopDirectoryAbsolutePathOfCurrentAlias = sourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap.get(firstSegmentOfPickedPath);
|
|
5275
|
+
if ((0, es_extensions_1.isUndefined)(sourceFilesTopDirectoryAbsolutePathOfCurrentAlias)) {
|
|
5276
|
+
es_extensions_1.Logger.logWarning(ResourceFilesPathsAliasesResolverForHTML.localization.generateUnknownSourceFileTopDirectoryAliasWarning({
|
|
5277
|
+
fileType__singularForm: fileTypeForLogging__pluralForm,
|
|
5278
|
+
firstPathSegment: firstSegmentOfPickedPath,
|
|
5279
|
+
pickedPathOfTargetResourceFile,
|
|
5217
5280
|
formattedSourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap: (0, es_extensions_1.stringifyAndFormatArbitraryValue)(Array.from(sourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap.entries()))
|
|
5218
5281
|
}));
|
|
5219
5282
|
return null;
|
|
5220
5283
|
}
|
|
5221
|
-
const
|
|
5284
|
+
const sourceFileComputedAbsolutePathPossiblyWithoutFileNameExtension = ImprovedPath_1.default.joinPathSegments(sourceFilesTopDirectoryAbsolutePathOfCurrentAlias, ...segmentsOfPickedPath.slice(1));
|
|
5222
5285
|
const explicitlySpecifiedSourceFilenameExtension = ImprovedPath_1.default.
|
|
5223
|
-
extractLastFilenameExtensionWithoutFirstDot(
|
|
5286
|
+
extractLastFilenameExtensionWithoutFirstDot(sourceFileComputedAbsolutePathPossiblyWithoutFileNameExtension);
|
|
5224
5287
|
if ((0, es_extensions_1.isNull)(explicitlySpecifiedSourceFilenameExtension)) {
|
|
5225
|
-
const
|
|
5226
|
-
`${
|
|
5227
|
-
const
|
|
5228
|
-
if (
|
|
5229
|
-
es_extensions_1.Logger.logWarning(
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
}
|
|
5236
|
-
else if (searchResultsInSourceFilesAbsolutePathsAndOutputFilesActualPathsMap.size > 1) {
|
|
5237
|
-
es_extensions_1.Logger.logWarning({
|
|
5238
|
-
title: `${fileTypeForLogging}ファイル、漠然パスアリアス`,
|
|
5239
|
-
description: `${fileTypeForLogging}ファイル:「${pickedURL}」に在るアリアス:${firstURL_Segment__possiblyPathAlias}は複数` +
|
|
5240
|
-
`のファイルに該当している:\n${(0, es_extensions_1.stringifyAndFormatArbitraryValue)(Array.from(searchResultsInSourceFilesAbsolutePathsAndOutputFilesActualPathsMap.values()))}\n其の場合は、源ファイルのファイル名拡張子を明示的に指定するのが必要。`
|
|
5241
|
-
});
|
|
5288
|
+
const possibleAbsolutePathsOfTargetSourceFile = supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots.map((supportedStylesheetFileNameExtensionWithoutLeadingDot) => `${sourceFileComputedAbsolutePathPossiblyWithoutFileNameExtension}.` +
|
|
5289
|
+
`${supportedStylesheetFileNameExtensionWithoutLeadingDot}`);
|
|
5290
|
+
const searchingResultsInSourceFilesAbsolutePathsAndOutputFilesActualPathsMap = (0, es_extensions_1.filterMap)(sourceAndOutputFilesAbsolutePathsCorrespondenceMap, (sourceFileAbsolutePath) => possibleAbsolutePathsOfTargetSourceFile.includes(sourceFileAbsolutePath));
|
|
5291
|
+
if (searchingResultsInSourceFilesAbsolutePathsAndOutputFilesActualPathsMap.size === 0) {
|
|
5292
|
+
es_extensions_1.Logger.logWarning(ResourceFilesPathsAliasesResolverForHTML.localization.
|
|
5293
|
+
generateNoMatchingsForAliasedFilePathWithoutFilenameExtensionWarning({
|
|
5294
|
+
pickedPathOfTargetResourceFile,
|
|
5295
|
+
fileType__singularForm: fileTypeForLogging__pluralForm,
|
|
5296
|
+
checkedAbsolutePaths__formatted: (0, es_extensions_1.stringifyAndFormatArbitraryValue)(possibleAbsolutePathsOfTargetSourceFile)
|
|
5297
|
+
}));
|
|
5242
5298
|
return null;
|
|
5243
5299
|
}
|
|
5244
|
-
return Array.from(
|
|
5300
|
+
return Array.from(searchingResultsInSourceFilesAbsolutePathsAndOutputFilesActualPathsMap.values())[0];
|
|
5245
5301
|
}
|
|
5246
|
-
const resolvedFileOutputAbsolutePath = sourceAndOutputFilesAbsolutePathsCorrespondenceMap.
|
|
5302
|
+
const resolvedFileOutputAbsolutePath = sourceAndOutputFilesAbsolutePathsCorrespondenceMap.
|
|
5303
|
+
get(sourceFileComputedAbsolutePathPossiblyWithoutFileNameExtension);
|
|
5247
5304
|
if ((0, es_extensions_1.isUndefined)(resolvedFileOutputAbsolutePath)) {
|
|
5248
|
-
es_extensions_1.Logger.logWarning({
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
});
|
|
5305
|
+
es_extensions_1.Logger.logWarning(ResourceFilesPathsAliasesResolverForHTML.localization.generateNoOutputFileExistingForSpecifiedSourceFilePath({
|
|
5306
|
+
pickedPathOfTargetResourceFile,
|
|
5307
|
+
fileType__singularForm: fileTypeForLogging__pluralForm
|
|
5308
|
+
}));
|
|
5253
5309
|
return null;
|
|
5254
5310
|
}
|
|
5255
5311
|
return resolvedFileOutputAbsolutePath;
|
|
5256
5312
|
}
|
|
5313
|
+
buildResourceFileFinalPath({ resolvedOutputAbsolutePathOfResourceFile, resourceFileType__singularForm }) {
|
|
5314
|
+
if (this.masterConfigRepresentative.isDevelopmentBuildingMode ||
|
|
5315
|
+
(0, es_extensions_1.isUndefined)(this.masterConfigRepresentative.actualPublicDirectoryAbsolutePath)) {
|
|
5316
|
+
if (!this.masterConfigRepresentative.isDevelopmentBuildingMode &&
|
|
5317
|
+
(0, es_extensions_1.isUndefined)(this.masterConfigRepresentative.actualPublicDirectoryAbsolutePath)) {
|
|
5318
|
+
es_extensions_1.Logger.logWarning(ResourceFilesPathsAliasesResolverForHTML.localization.generateUnableToResolveShortenedAbsolutePathWarning({
|
|
5319
|
+
projectBuildingMode: this.masterConfigRepresentative.consumingProjectBuildingMode,
|
|
5320
|
+
filesType__singularForm: resourceFileType__singularForm
|
|
5321
|
+
}));
|
|
5322
|
+
}
|
|
5323
|
+
return ImprovedPath_1.default.computeRelativePath({
|
|
5324
|
+
basePath: this.compiledHTML_File.outputDirectoryAbsolutePath,
|
|
5325
|
+
comparedPath: resolvedOutputAbsolutePathOfResourceFile
|
|
5326
|
+
});
|
|
5327
|
+
}
|
|
5328
|
+
return `/${ImprovedPath_1.default.computeRelativePath({
|
|
5329
|
+
basePath: this.masterConfigRepresentative.actualPublicDirectoryAbsolutePath,
|
|
5330
|
+
comparedPath: resolvedOutputAbsolutePathOfResourceFile
|
|
5331
|
+
})}`;
|
|
5332
|
+
}
|
|
5257
5333
|
}
|
|
5258
|
-
exports["default"] =
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
/***/ }),
|
|
5262
|
-
|
|
5263
|
-
/***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/AssetsPathsAliasesResolverForHTML/AssetsPathsAliasesResolverForHTML_Localization.english.ts":
|
|
5264
|
-
/*!*********************************************************************************************************************************************************!*\
|
|
5265
|
-
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/AssetsPathsAliasesResolverForHTML/AssetsPathsAliasesResolverForHTML_Localization.english.ts ***!
|
|
5266
|
-
\*********************************************************************************************************************************************************/
|
|
5267
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5271
|
-
const assetsPathsAliasesResolverForHTML_Localization__english = {
|
|
5272
|
-
generateUnableToComputeShortenedAbsolutePathWarning: (namedParameters) => ({
|
|
5273
|
-
title: `${namedParameters.filesTypeForLogging} files, unable to generate the absolute path`,
|
|
5274
|
-
description: `Unable to generate the shortened absolute path for the ${namedParameters.filesTypeForLogging} files ` +
|
|
5275
|
-
`because no public path has been specified for '${namedParameters.projectBuildingMode}' mode. Relative path ` +
|
|
5276
|
-
"will be generated instead."
|
|
5277
|
-
}),
|
|
5278
|
-
generateUnknownSourceFileTopDirectoryAliasWarning: (namedParameters) => ({
|
|
5279
|
-
title: `${namedParameters.fileTypeForLogging} files, unknown path alias`,
|
|
5280
|
-
description: `The alias '${namedParameters.firstPathSegment}' in path '${namedParameters.pickedPath}' has not been ` +
|
|
5281
|
-
"specified neither explicitly nor implicitly. Below aliases are available for usage: \n" +
|
|
5282
|
-
`${namedParameters.formattedSourceFilesTopDirectoriesAliasesAndRespectiveAbsolutePathsMap}`
|
|
5283
|
-
})
|
|
5284
|
-
};
|
|
5285
|
-
exports["default"] = assetsPathsAliasesResolverForHTML_Localization__english;
|
|
5334
|
+
exports["default"] = ResourceFilesPathsAliasesResolverForHTML;
|
|
5286
5335
|
|
|
5287
5336
|
|
|
5288
5337
|
/***/ }),
|
|
@@ -5302,7 +5351,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
5302
5351
|
const HTML_ValidatorLocalization_english_1 = __importDefault(__webpack_require__(/*! ./HTML_ValidatorLocalization.english */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_ValidatorLocalization.english.ts"));
|
|
5303
5352
|
/* --- Applied utils ------------------------------------------------------------------------------------------------ */
|
|
5304
5353
|
const html_validator_1 = __importDefault(__webpack_require__(/*! html-validator */ "html-validator"));
|
|
5305
|
-
const
|
|
5354
|
+
const getExpectedToBeNonNullStringifiedContentOfVinylFile_1 = __importDefault(__webpack_require__(/*! @Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile */ "./Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile.ts"));
|
|
5306
5355
|
const isCompiledHTML_ContentEmpty_1 = __importDefault(__webpack_require__(/*! @Utils/isCompiledHTML_ContentEmpty */ "./Utils/isCompiledHTML_ContentEmpty.ts"));
|
|
5307
5356
|
const node_notifier_1 = __importDefault(__webpack_require__(/*! node-notifier */ "node-notifier"));
|
|
5308
5357
|
/* --- General utils ------------------------------------------------------------------------------------------------ */
|
|
@@ -5312,7 +5361,7 @@ const Stopwatch_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/Stop
|
|
|
5312
5361
|
class HTML_Validator {
|
|
5313
5362
|
static localization = HTML_ValidatorLocalization_english_1.default;
|
|
5314
5363
|
static validateHTML(compiledHTML_File, masterConfigRepresentative) {
|
|
5315
|
-
const extractedHTML_Code = (0,
|
|
5364
|
+
const extractedHTML_Code = (0, getExpectedToBeNonNullStringifiedContentOfVinylFile_1.default)(compiledHTML_File);
|
|
5316
5365
|
const targetFileRelativePath = ImprovedPath_1.default.computeRelativePath({
|
|
5317
5366
|
basePath: masterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath,
|
|
5318
5367
|
comparedPath: compiledHTML_File.path
|
|
@@ -5443,7 +5492,7 @@ const HTML_ValidatorLocalization__English = {
|
|
|
5443
5492
|
grossViolation: "Gross violation",
|
|
5444
5493
|
recommendationDisregard: "Recommendation disregard",
|
|
5445
5494
|
other: "Other issue",
|
|
5446
|
-
keyAndValueSeparator: ":"
|
|
5495
|
+
keyAndValueSeparator: ": "
|
|
5447
5496
|
},
|
|
5448
5497
|
generateIssuesFoundErrorLog: (namedParameters) => ({
|
|
5449
5498
|
customBadgeText: "HTML validation not passed",
|
|
@@ -5472,12 +5521,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5472
5521
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5473
5522
|
};
|
|
5474
5523
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5475
|
-
const
|
|
5524
|
+
const getExpectedToBeNonNullStringifiedContentOfVinylFile_1 = __importDefault(__webpack_require__(/*! @Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile */ "./Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile.ts"));
|
|
5476
5525
|
const cheerio_1 = __importDefault(__webpack_require__(/*! cheerio */ "cheerio"));
|
|
5477
5526
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
5478
5527
|
function removeExtraSpacesFromJapaneseText(compiledHTML_File) {
|
|
5479
5528
|
const $HTML_FileContentCheerioCapturing = cheerio_1.default.
|
|
5480
|
-
load((0,
|
|
5529
|
+
load((0, getExpectedToBeNonNullStringifiedContentOfVinylFile_1.default)(compiledHTML_File), { decodeEntities: false });
|
|
5481
5530
|
for (const targetElement of Array.from($HTML_FileContentCheerioCapturing("p"))) {
|
|
5482
5531
|
const $TargetElement = $HTML_FileContentCheerioCapturing(targetElement);
|
|
5483
5532
|
const targetElementHTML = $TargetElement.html();
|
|
@@ -5633,7 +5682,10 @@ const ImprovedPath_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/I
|
|
|
5633
5682
|
const PoliteErrorsMessagesBuilder_1 = __importDefault(__webpack_require__(/*! @Utils/PoliteErrorsMessagesBuilder */ "./Utils/PoliteErrorsMessagesBuilder.ts"));
|
|
5634
5683
|
class StylesProcessingSettingsRepresentative extends GulpStreamBasedSourceCodeProcessingConfigRepresentative_1.default {
|
|
5635
5684
|
static #localization = {
|
|
5636
|
-
|
|
5685
|
+
targetFilesType: {
|
|
5686
|
+
singularForm: "stylesheet",
|
|
5687
|
+
pluralForm: "stylesheets"
|
|
5688
|
+
},
|
|
5637
5689
|
errorsMessagesData: {
|
|
5638
5690
|
unableToDecideMustFileBePrecessedByStylusPreProcessorBecauseFileNameExtensionIsMissing: {
|
|
5639
5691
|
generateTechnicalDetails({ filePath }) {
|
|
@@ -5660,9 +5712,12 @@ class StylesProcessingSettingsRepresentative extends GulpStreamBasedSourceCodePr
|
|
|
5660
5712
|
}
|
|
5661
5713
|
};
|
|
5662
5714
|
supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots;
|
|
5715
|
+
TARGET_FILES_KIND_FOR_LOGGING__SINGULAR_FORM = StylesProcessingSettingsRepresentative.#localization.
|
|
5716
|
+
targetFilesType.singularForm;
|
|
5663
5717
|
TARGET_FILES_KIND_FOR_LOGGING__PLURAL_FORM = StylesProcessingSettingsRepresentative.#localization.
|
|
5664
|
-
|
|
5718
|
+
targetFilesType.pluralForm;
|
|
5665
5719
|
waitingForTheOtherFilesWillBeSavedPeriod__seconds;
|
|
5720
|
+
prefixOfAliasOfTopDirectoryOfEntryPointsGroup = "@";
|
|
5666
5721
|
sourceCodeLintingCommonSettings;
|
|
5667
5722
|
sourceAndOutputFilesAbsolutePathsCorrespondenceMap = new Map();
|
|
5668
5723
|
relevantEntryPointsGroupsSettings;
|
|
@@ -5951,7 +6006,7 @@ class StylesProcessor extends GulpStreamsBasedSourceCodeProcessor_1.default {
|
|
|
5951
6006
|
fileInInitialState.processingSettings = normalizedStylesEntryPointsGroupSettingsActualForCurrentFile;
|
|
5952
6007
|
/* [ Theory ] The value of 'path' could change during file processing. */
|
|
5953
6008
|
fileInInitialState.sourceAbsolutePath = ImprovedPath_1.default.replacePathSeparatorsToForwardSlashes(fileInInitialState.path);
|
|
5954
|
-
fileInInitialState.outputDirectoryAbsolutePath =
|
|
6009
|
+
fileInInitialState.outputDirectoryAbsolutePath = StylesProcessingSettingsRepresentative_1.default.
|
|
5955
6010
|
computeRelevantOutputDirectoryAbsolutePathForTargetSourceFile(fileInInitialState.path, normalizedStylesEntryPointsGroupSettingsActualForCurrentFile);
|
|
5956
6011
|
fileInInitialState.mustBeProcessedByStylus = StylesProcessingSettingsRepresentative_1.default.
|
|
5957
6012
|
mustFileBeProcessedByStylus(fileInInitialState.path);
|
|
@@ -6895,21 +6950,21 @@ exports["default"] = PoliteErrorsMessagesBuilder;
|
|
|
6895
6950
|
|
|
6896
6951
|
/***/ }),
|
|
6897
6952
|
|
|
6898
|
-
/***/ "./Utils/
|
|
6899
|
-
|
|
6900
|
-
!*** ./Utils/
|
|
6901
|
-
|
|
6953
|
+
/***/ "./Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile.ts":
|
|
6954
|
+
/*!**********************************************************************!*\
|
|
6955
|
+
!*** ./Utils/getExpectedToBeNonNullStringifiedContentOfVinylFile.ts ***!
|
|
6956
|
+
\**********************************************************************/
|
|
6902
6957
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6903
6958
|
|
|
6904
6959
|
|
|
6905
6960
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6906
6961
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
6907
|
-
function
|
|
6962
|
+
function getExpectedToBeNonNullStringifiedContentOfVinylFile(targetFile) {
|
|
6908
6963
|
if (targetFile.contents === null) {
|
|
6909
6964
|
es_extensions_1.Logger.throwErrorAndLog({
|
|
6910
6965
|
errorInstance: new es_extensions_1.UnexpectedEventError(`目標的Vinylファイル:「${targetFile.path}」の'contents'プロパティは'null'と成っている。`),
|
|
6911
6966
|
title: es_extensions_1.UnexpectedEventError.localization.defaultTitle,
|
|
6912
|
-
occurrenceLocation: "
|
|
6967
|
+
occurrenceLocation: "extractExpectedToBeNonNullStringifiedContentFromVinylFile(targetFile)",
|
|
6913
6968
|
additionalData: targetFile
|
|
6914
6969
|
});
|
|
6915
6970
|
}
|
|
@@ -6917,13 +6972,13 @@ function extractStringifiedContentFromVinylFile(targetFile) {
|
|
|
6917
6972
|
es_extensions_1.Logger.throwErrorAndLog({
|
|
6918
6973
|
errorInstance: new es_extensions_1.UnexpectedEventError(`目標的Vinylファイル:「${targetFile.path}」の'contents'プロパティは'Buffer'のインスタンスではない為、内容を抽出出来ません。`),
|
|
6919
6974
|
title: es_extensions_1.UnexpectedEventError.localization.defaultTitle,
|
|
6920
|
-
occurrenceLocation: "
|
|
6975
|
+
occurrenceLocation: "extractExpectedToBeNonNullStringifiedContentFromVinylFile(targetFile)",
|
|
6921
6976
|
additionalData: targetFile
|
|
6922
6977
|
});
|
|
6923
6978
|
}
|
|
6924
6979
|
return targetFile.contents.toString();
|
|
6925
6980
|
}
|
|
6926
|
-
exports["default"] =
|
|
6981
|
+
exports["default"] = getExpectedToBeNonNullStringifiedContentOfVinylFile;
|
|
6927
6982
|
|
|
6928
6983
|
|
|
6929
6984
|
/***/ }),
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Yamato
|
|
1
|
+
# Yamato Daiwa Automation 〔YDA〕
|
|
2
2
|
|
|
3
3
|
The project building tool with declarative YAML configuration based on Gulp and Webpack.
|
|
4
4
|
Specializing on Pug, Stylus and TypeScript as source code languages; also works with images, fonts, videos and audios.
|
|
@@ -124,6 +124,13 @@ npm i @yamato-daiwa/automation -D -E
|
|
|
124
124
|
<dt>ts-loader</dt>
|
|
125
125
|
<dd>Used to provide the integration of TypeScript and Webpack</dd>
|
|
126
126
|
|
|
127
|
+
<dt>vinyl</dt>
|
|
128
|
+
<dd>
|
|
129
|
+
Used to create new Gulp plugins.
|
|
130
|
+
Although this package is being installed indirectly, the importing of this package without manual installing will cause
|
|
131
|
+
"node/no-extraneous-import" ESLint issue and there is no reason to mute it.
|
|
132
|
+
</dd>
|
|
133
|
+
|
|
127
134
|
<dt>vue-style-loader</dt>
|
|
128
135
|
<dd>Used to provide the dynamical loading of CSS written in Vue Single File Components to HTML document</dd>
|
|
129
136
|
|
|
@@ -168,6 +175,9 @@ All **@types** are the TypeScript types definitions that required for normal tra
|
|
|
168
175
|
<dl>
|
|
169
176
|
|
|
170
177
|
<dt>glob</dt>
|
|
171
|
-
<dd>Used by <b>ImprovedGlob</b> which will be moved to <b>@yamato-daiwa/es-extensions-nodejs</b> and used as dependency</dd>
|
|
178
|
+
<dd>Used by <b>ImprovedGlob</b> which will be moved to <b>@yamato-daiwa/es-extensions-nodejs</b> and used as dependency </dd>
|
|
179
|
+
|
|
180
|
+
<dt>minimatch</dt>
|
|
181
|
+
<dd>used by <b>ImprovedGlob</b> which will be moved to <b>@yamato-daiwa/es-extensions-nodejs</b> and used as dependency </dd>
|
|
172
182
|
|
|
173
183
|
</dl>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamato-daiwa/automation",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "The project building tool with declarative YAML configuration specializing on Pug, Stylus and TypeScript as source code languages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"build",
|
|
@@ -19,19 +19,19 @@
|
|
|
19
19
|
"EntryPoint.js"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
23
|
-
"@typescript-eslint/parser": "5.
|
|
22
|
+
"@typescript-eslint/eslint-plugin": "5.30.5",
|
|
23
|
+
"@typescript-eslint/parser": "5.30.5",
|
|
24
24
|
"@vue/compiler-sfc": "3.2.37",
|
|
25
|
-
"@yamato-daiwa/es-extensions": "1.5.
|
|
26
|
-
"@yamato-daiwa/es-extensions-nodejs": "1.5.0
|
|
27
|
-
"@yamato-daiwa/style_guides": "0.0.
|
|
25
|
+
"@yamato-daiwa/es-extensions": "1.5.1",
|
|
26
|
+
"@yamato-daiwa/es-extensions-nodejs": "1.5.0",
|
|
27
|
+
"@yamato-daiwa/style_guides": "0.0.16",
|
|
28
28
|
"access-sniff": "3.2.0",
|
|
29
29
|
"autoprefixer": "10.4.7",
|
|
30
30
|
"browser-sync": "2.27.10",
|
|
31
31
|
"cheerio": "1.0.0-rc.1",
|
|
32
32
|
"css-loader": "6.7.1",
|
|
33
33
|
"cssnano": "5.1.10",
|
|
34
|
-
"eslint": "8.
|
|
34
|
+
"eslint": "8.19.0",
|
|
35
35
|
"eslint-plugin-import": "2.26.0",
|
|
36
36
|
"eslint-plugin-node": "11.1.0",
|
|
37
37
|
"eslint-webpack-plugin": "3.1.1",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"html-validator": "6.0.1",
|
|
53
53
|
"imagemin-pngquant": "9.0.2",
|
|
54
54
|
"json5-loader": "4.0.1",
|
|
55
|
+
"minimatch": "5.1.0",
|
|
55
56
|
"node-notifier": "10.0.1",
|
|
56
57
|
"pug-html-loader": "1.1.5",
|
|
57
58
|
"pug-plain-loader": "1.1.0",
|
|
@@ -60,6 +61,7 @@
|
|
|
60
61
|
"style-loader": "3.3.1",
|
|
61
62
|
"stylus-loader": "6.2.0",
|
|
62
63
|
"ts-loader": "9.3.0",
|
|
64
|
+
"vinyl": "2.2.1",
|
|
63
65
|
"vue": "3.2.37",
|
|
64
66
|
"vue-loader": "17.0.0",
|
|
65
67
|
"vue-style-loader": "4.1.3",
|
|
@@ -90,7 +92,7 @@
|
|
|
90
92
|
"@types/webpack-node-externals": "2.5.3",
|
|
91
93
|
"@types/yamljs": "0.2.31",
|
|
92
94
|
"ts-node": "10.8.1",
|
|
93
|
-
"typescript": "4.7.
|
|
95
|
+
"typescript": "4.7.4",
|
|
94
96
|
"webpack-cli": "4.10.0"
|
|
95
97
|
},
|
|
96
98
|
"scripts": {
|