@yamato-daiwa/automation 0.6.3 → 0.7.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/EntryPoint.js +1054 -1112
- package/README.md +24 -7
- package/package.json +15 -15
package/EntryPoint.js
CHANGED
|
@@ -26,155 +26,6 @@ function revisionHash(data) {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
/***/ }),
|
|
30
|
-
|
|
31
|
-
/***/ "../node_modules/w3c-html-validator/dist/w3c-html-validator.js":
|
|
32
|
-
/*!*********************************************************************!*\
|
|
33
|
-
!*** ../node_modules/w3c-html-validator/dist/w3c-html-validator.js ***!
|
|
34
|
-
\*********************************************************************/
|
|
35
|
-
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
36
|
-
|
|
37
|
-
__webpack_require__.r(__webpack_exports__);
|
|
38
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
39
|
-
/* harmony export */ w3cHtmlValidator: () => (/* binding */ w3cHtmlValidator)
|
|
40
|
-
/* harmony export */ });
|
|
41
|
-
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! chalk */ "chalk");
|
|
42
|
-
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fs */ "fs");
|
|
43
|
-
/* harmony import */ var fancy_log__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! fancy-log */ "fancy-log");
|
|
44
|
-
/* harmony import */ var superagent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! superagent */ "superagent");
|
|
45
|
-
/* harmony import */ var slash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! slash */ "slash");
|
|
46
|
-
//! w3c-html-validator v1.8.2 ~~ https://github.com/center-key/w3c-html-validator ~~ MIT License
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const w3cHtmlValidator = {
|
|
54
|
-
version: '1.8.2',
|
|
55
|
-
validate(options) {
|
|
56
|
-
const defaults = {
|
|
57
|
-
checkUrl: 'https://validator.w3.org/nu/',
|
|
58
|
-
dryRun: false,
|
|
59
|
-
ignoreLevel: null,
|
|
60
|
-
ignoreMessages: [],
|
|
61
|
-
output: 'json',
|
|
62
|
-
};
|
|
63
|
-
const settings = { ...defaults, ...options };
|
|
64
|
-
if (!settings.html && !settings.filename && !settings.website)
|
|
65
|
-
throw new Error('[w3c-html-validator] Must specify the "html", "filename", or "website" option.');
|
|
66
|
-
if (![null, 'info', 'warning'].includes(settings.ignoreLevel))
|
|
67
|
-
throw new Error(`[w3c-html-validator] Invalid ignoreLevel option: ${settings.ignoreLevel}`);
|
|
68
|
-
if (settings.output !== 'json' && settings.output !== 'html')
|
|
69
|
-
throw new Error('[w3c-html-validator] Option "output" must be "json" or "html".');
|
|
70
|
-
const filename = settings.filename ? slash__WEBPACK_IMPORTED_MODULE_4__(settings.filename) : null;
|
|
71
|
-
const mode = settings.html ? 'html' : filename ? 'filename' : 'website';
|
|
72
|
-
const readFile = (filename) => fs__WEBPACK_IMPORTED_MODULE_1__.readFileSync(filename, 'utf-8').replace(/\r/g, '');
|
|
73
|
-
const inputHtml = settings.html ?? (filename ? readFile(filename) : null);
|
|
74
|
-
const makePostRequest = () => superagent__WEBPACK_IMPORTED_MODULE_3__.post(settings.checkUrl)
|
|
75
|
-
.set('Content-Type', 'text/html; encoding=utf-8')
|
|
76
|
-
.send(inputHtml);
|
|
77
|
-
const makeGetRequest = () => superagent__WEBPACK_IMPORTED_MODULE_3__.get(settings.checkUrl)
|
|
78
|
-
.query({ doc: settings.website });
|
|
79
|
-
const w3cRequest = inputHtml ? makePostRequest() : makeGetRequest();
|
|
80
|
-
w3cRequest.set('User-Agent', 'W3C HTML Validator ~ github.com/center-key/w3c-html-validator');
|
|
81
|
-
w3cRequest.query({ out: settings.output });
|
|
82
|
-
const json = settings.output === 'json';
|
|
83
|
-
const success = '<p class="success">';
|
|
84
|
-
const titleLookup = {
|
|
85
|
-
html: `HTML String (characters: ${inputHtml?.length})`,
|
|
86
|
-
filename: filename,
|
|
87
|
-
website: settings.website,
|
|
88
|
-
};
|
|
89
|
-
const filterMessages = (response) => {
|
|
90
|
-
const aboveInfo = (subType) => settings.ignoreLevel === 'info' && !!subType;
|
|
91
|
-
const aboveIgnoreLevel = (message) => !settings.ignoreLevel || message.type !== 'info' || aboveInfo(message.subType);
|
|
92
|
-
const matchesSkipPattern = (title) => settings.ignoreMessages.some(pattern => typeof pattern === 'string' ? title.includes(pattern) : pattern.test(title));
|
|
93
|
-
const isImportant = (message) => aboveIgnoreLevel(message) && !matchesSkipPattern(message.message);
|
|
94
|
-
if (json)
|
|
95
|
-
response.body.messages = response.body.messages?.filter(isImportant) ?? [];
|
|
96
|
-
return response;
|
|
97
|
-
};
|
|
98
|
-
const toValidatorResults = (response) => ({
|
|
99
|
-
validates: json ? !response.body.messages.length : !!response.text?.includes(success),
|
|
100
|
-
mode: mode,
|
|
101
|
-
title: titleLookup[mode],
|
|
102
|
-
html: inputHtml,
|
|
103
|
-
filename: filename,
|
|
104
|
-
website: settings.website || null,
|
|
105
|
-
output: settings.output,
|
|
106
|
-
status: response.statusCode || -1,
|
|
107
|
-
messages: json ? response.body.messages : null,
|
|
108
|
-
display: json ? null : response.text,
|
|
109
|
-
dryRun: settings.dryRun,
|
|
110
|
-
});
|
|
111
|
-
const handleError = (reason) => {
|
|
112
|
-
const errRes = reason.response ?? {};
|
|
113
|
-
const getMsg = () => [errRes.status, errRes.res.statusMessage, errRes.request.url];
|
|
114
|
-
const message = reason.response ? getMsg() : [reason.errno, reason.message];
|
|
115
|
-
errRes.body = { messages: [{ type: 'network-error', message: message.join(' ') }] };
|
|
116
|
-
return toValidatorResults(errRes);
|
|
117
|
-
};
|
|
118
|
-
const pseudoResponse = {
|
|
119
|
-
statusCode: 200,
|
|
120
|
-
body: { messages: [] },
|
|
121
|
-
text: 'Validation bypassed.',
|
|
122
|
-
};
|
|
123
|
-
const pseudoRequest = () => new Promise(resolve => resolve(pseudoResponse));
|
|
124
|
-
const validation = settings.dryRun ? pseudoRequest() : w3cRequest;
|
|
125
|
-
return validation.then(filterMessages).then(toValidatorResults).catch(handleError);
|
|
126
|
-
},
|
|
127
|
-
dryRunNotice() {
|
|
128
|
-
fancy_log__WEBPACK_IMPORTED_MODULE_2__(chalk__WEBPACK_IMPORTED_MODULE_0__.gray('w3c-html-validator'), chalk__WEBPACK_IMPORTED_MODULE_0__.yellowBright('dry run mode:'), chalk__WEBPACK_IMPORTED_MODULE_0__.whiteBright('validation being bypassed'));
|
|
129
|
-
},
|
|
130
|
-
summary(numFiles) {
|
|
131
|
-
fancy_log__WEBPACK_IMPORTED_MODULE_2__(chalk__WEBPACK_IMPORTED_MODULE_0__.gray('w3c-html-validator'), chalk__WEBPACK_IMPORTED_MODULE_0__.magenta('files: ' + String(numFiles)));
|
|
132
|
-
},
|
|
133
|
-
reporter(results, options) {
|
|
134
|
-
const defaults = {
|
|
135
|
-
continueOnFail: false,
|
|
136
|
-
maxMessageLen: null,
|
|
137
|
-
quiet: false,
|
|
138
|
-
title: null,
|
|
139
|
-
};
|
|
140
|
-
const settings = { ...defaults, ...options };
|
|
141
|
-
if (typeof results?.validates !== 'boolean')
|
|
142
|
-
throw new Error('[w3c-html-validator] Invalid results for reporter(): ' + String(results));
|
|
143
|
-
const messages = results.messages ?? [];
|
|
144
|
-
const title = settings.title ?? results.title;
|
|
145
|
-
const status = results.validates ? chalk__WEBPACK_IMPORTED_MODULE_0__.green.bold('✔ pass') : chalk__WEBPACK_IMPORTED_MODULE_0__.red.bold('✘ fail');
|
|
146
|
-
const count = results.validates ? '' : `(messages: ${messages.length})`;
|
|
147
|
-
if (!results.validates || !settings.quiet)
|
|
148
|
-
fancy_log__WEBPACK_IMPORTED_MODULE_2__(chalk__WEBPACK_IMPORTED_MODULE_0__.gray('w3c-html-validator'), status, chalk__WEBPACK_IMPORTED_MODULE_0__.blue.bold(title), chalk__WEBPACK_IMPORTED_MODULE_0__.white(count));
|
|
149
|
-
const typeColorMap = {
|
|
150
|
-
error: chalk__WEBPACK_IMPORTED_MODULE_0__.red.bold,
|
|
151
|
-
warning: chalk__WEBPACK_IMPORTED_MODULE_0__.yellow.bold,
|
|
152
|
-
info: chalk__WEBPACK_IMPORTED_MODULE_0__.white.bold,
|
|
153
|
-
};
|
|
154
|
-
const logMessage = (message) => {
|
|
155
|
-
const type = message.subType ?? message.type;
|
|
156
|
-
const typeColor = typeColorMap[type] ?? chalk__WEBPACK_IMPORTED_MODULE_0__.redBright.bold;
|
|
157
|
-
const location = `line ${message.lastLine}, column ${message.firstColumn}:`;
|
|
158
|
-
const lineText = message.extract?.replace(/\n/g, '\\n');
|
|
159
|
-
const maxLen = settings.maxMessageLen ?? undefined;
|
|
160
|
-
fancy_log__WEBPACK_IMPORTED_MODULE_2__(typeColor('HTML ' + type + ':'), message.message.substring(0, maxLen));
|
|
161
|
-
if (message.lastLine)
|
|
162
|
-
fancy_log__WEBPACK_IMPORTED_MODULE_2__(chalk__WEBPACK_IMPORTED_MODULE_0__.white(location), chalk__WEBPACK_IMPORTED_MODULE_0__.magenta(lineText));
|
|
163
|
-
};
|
|
164
|
-
messages.forEach(logMessage);
|
|
165
|
-
const failDetails = () => {
|
|
166
|
-
const toString = (message) => `${message.subType ?? message.type} line ${message.lastLine} column ${message.firstColumn}`;
|
|
167
|
-
const fileDetails = () => `${results.filename} -- ${results.messages.map(toString).join(', ')}`;
|
|
168
|
-
return !results.filename ? results.messages[0].message : fileDetails();
|
|
169
|
-
};
|
|
170
|
-
if (!settings.continueOnFail && !results.validates)
|
|
171
|
-
throw new Error('[w3c-html-validator] Failed: ' + failDetails());
|
|
172
|
-
return results;
|
|
173
|
-
},
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
29
|
/***/ }),
|
|
179
30
|
|
|
180
31
|
/***/ "../package.json":
|
|
@@ -183,7 +34,7 @@ const w3cHtmlValidator = {
|
|
|
183
34
|
\***********************/
|
|
184
35
|
/***/ ((module) => {
|
|
185
36
|
|
|
186
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@yamato-daiwa/automation","version":"0.
|
|
37
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@yamato-daiwa/automation","version":"0.7.0","description":"The project building tool with declarative YAML configuration specializing on Pug, Stylus and TypeScript as source code languages.","keywords":["build","pug","stylus","tool","typescript"],"engines":{"node":">=18.0.0"},"bin":{"yda":"Executable"},"files":["EntryPoint.js"],"dependencies":{"@eslint-community/eslint-plugin-eslint-comments":"4.5.0","@stylistic/eslint-plugin":"3.1.0","@typescript-eslint/eslint-plugin":"8.31.1","@typescript-eslint/parser":"8.31.1","@vue/compiler-sfc":"3.5.13","@webdiscus/pug-loader":"2.11.1","@yamato-daiwa/es-extensions":"1.8.0-alpha.9","@yamato-daiwa/es-extensions-nodejs":"1.8.0-alpha.9","@yamato-daiwa/style_guides":"0.6.6","autoprefixer":"10.4.21","browser-sync":"3.0.4","css-loader":"7.1.2","cssnano":"7.0.6","dotenv":"16.5.0","eslint":"9.26.0","eslint-plugin-import":"2.31.0","eslint-plugin-n":"17.17.0","eslint-plugin-react":"7.37.5","eslint-plugin-vue":"9.33.0","eslint-plugin-vue-pug":"0.6.2","fork-ts-checker-webpack-plugin":"7.3.0","gulp":"4.0.2","gulp-data":"1.3.1","gulp-if":"3.0.0","gulp-imagemin":"7.1.0","gulp-nodemon":"2.5.0","gulp-plumber":"1.2.1","gulp-postcss":"10.0.0","gulp-pug":"5.0.0","gulp-sourcemaps":"3.0.0","gulp-stylus":"3.0.1","imagemin-pngquant":"9.0.2","js-beautify":"1.15.4","json5-loader":"4.0.1","nanoid":"5.1.5","node-html-parser":"6.1.13","node-notifier":"10.0.1","pa11y":"8.0.0","probe-image-size":"7.2.3","pug-lint":"2.7.0","pug3-ast-loader":"0.0.0","puppeteer":"24.7.2","rev-hash":"4.1.0","stlint":"1.0.65","stream-combiner2":"1.1.1","style-loader":"4.0.0","stylus":"0.63.0","stylus-loader":"8.1.1","ts-loader":"9.5.2","vinyl":"2.2.1","vue-loader":"17.4.2","vue-style-loader":"4.1.3","webpack":"5.99.7","webpack-node-externals":"3.0.0","webpack-stream":"7.0.0","worker-loader":"3.0.8","yaml-loader":"0.8.1"},"devDependencies":{"@types/browser-sync":"2.29.0","@types/cssnano":"5.0.0","@types/gulp":"4.0.17","@types/gulp-if":"3.0.4","@types/gulp-imagemin":"7.0.3","@types/gulp-nodemon":"0.0.37","@types/gulp-plumber":"0.0.37","@types/gulp-postcss":"8.0.6","@types/gulp-sourcemaps":"0.0.38","@types/gulp-stylus":"2.7.8","@types/js-beautify":"1.14.3","@types/node":"22.15.2","@types/node-notifier":"8.0.5","@types/pa11y":"5.3.7","@types/probe-image-size":"7.2.5","@types/pug":"2.0.10","@types/vnu-jar":"17.11.2","@types/webpack-node-externals":"3.0.4","@types/webpack-stream":"3.2.15","eslint-webpack-plugin":"4.2.0","ts-node":"10.9.2","typescript":"5.8.2","vnu-jar":"24.10.17","webpack-cli":"6.0.1"},"scripts":{"Incremental Development Building":"webpack --mode development","Production Building":"webpack --mode production","Linting":"eslint Source"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/TokugawaTakeshi/Yamato-Daiwa-Automation.git"},"homepage":"https://automation.yamato-daiwa.com/","bugs":{"url":"https://github.com/TokugawaTakeshi/Yamato-Daiwa-Automation/issues","email":"tokugawa.takesi@gmail.com"}}');
|
|
187
38
|
|
|
188
39
|
/***/ }),
|
|
189
40
|
|
|
@@ -8685,23 +8536,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
8685
8536
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8686
8537
|
};
|
|
8687
8538
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8688
|
-
/* ─── Settings
|
|
8539
|
+
/* ─── Settings Representatives ───────────────────────────────────────────────────────────────────────────────────── */
|
|
8689
8540
|
const MarkupProcessingSettingsRepresentative_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/MarkupProcessingSettingsRepresentative */ "./ProjectBuilding/SourceCodeProcessing/Markup/MarkupProcessingSettingsRepresentative.ts"));
|
|
8541
|
+
/* ─── State Management ───────────────────────────────────────────────────────────────────────────────────────────── */
|
|
8542
|
+
const MarkupProcessingSharedState_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/MarkupProcessingSharedState */ "./ProjectBuilding/SourceCodeProcessing/Markup/MarkupProcessingSharedState.ts"));
|
|
8690
8543
|
/* ─── Vinyl FS ──────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
8691
8544
|
const vinyl_1 = __importDefault(__webpack_require__(/*! vinyl */ "vinyl"));
|
|
8692
8545
|
const VinylFileClass_1 = __importDefault(__webpack_require__(/*! @Utils/VinylFileClass */ "./Utils/VinylFileClass.ts"));
|
|
8546
|
+
/* ─── Utils ─────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
8693
8547
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
8694
8548
|
const es_extensions_nodejs_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions-nodejs */ "@yamato-daiwa/es-extensions-nodejs");
|
|
8695
|
-
const addPenultimateFileNameExtension_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/Strings/addPenultimateFileNameExtension */ "./UtilsIncubator/Strings/addPenultimateFileNameExtension.ts"));
|
|
8696
8549
|
class MarkupEntryPointVinylFile extends VinylFileClass_1.default {
|
|
8697
8550
|
sourceAbsolutePath;
|
|
8698
8551
|
outputDirectoryAbsolutePath;
|
|
8699
8552
|
actualEntryPointsGroupSettings;
|
|
8700
8553
|
pageStateDependentVariationData;
|
|
8701
|
-
|
|
8554
|
+
localizationData;
|
|
8702
8555
|
markupProcessingSettingsRepresentative;
|
|
8703
8556
|
pageStateDependentVariationsSpecification;
|
|
8704
|
-
constructor({ initialPlainVinylFile, markupProcessingSettingsRepresentative, pageStateDependentVariationData,
|
|
8557
|
+
constructor({ initialPlainVinylFile, markupProcessingSettingsRepresentative, pageStateDependentVariationData, localizationData }) {
|
|
8705
8558
|
super({
|
|
8706
8559
|
explicitlySpecifiedPathPart: initialPlainVinylFile.base,
|
|
8707
8560
|
path: initialPlainVinylFile.path,
|
|
@@ -8721,100 +8574,41 @@ class MarkupEntryPointVinylFile extends VinylFileClass_1.default {
|
|
|
8721
8574
|
else if ((0, es_extensions_1.isNotUndefined)(pageStateDependentVariationData)) {
|
|
8722
8575
|
this.pageStateDependentVariationData = pageStateDependentVariationData;
|
|
8723
8576
|
}
|
|
8724
|
-
if ((0, es_extensions_1.isNotUndefined)(
|
|
8725
|
-
this.
|
|
8577
|
+
if ((0, es_extensions_1.isNotUndefined)(localizationData)) {
|
|
8578
|
+
this.localizationData = localizationData;
|
|
8726
8579
|
}
|
|
8727
8580
|
}
|
|
8728
|
-
|
|
8729
|
-
|
|
8730
|
-
|
|
8731
|
-
|
|
8581
|
+
manageVariations() {
|
|
8582
|
+
const actualPageVariationsMetadata = (0, es_extensions_1.getExpectedToBeNonUndefinedMapValue)(MarkupProcessingSharedState_1.default.pagesVariationsMetadata, this.sourceAbsolutePath);
|
|
8583
|
+
if (actualPageVariationsMetadata.mustInitialFileBeKept &&
|
|
8584
|
+
actualPageVariationsMetadata.absoluteSourcePathsOfAllVariations.size === 1 &&
|
|
8585
|
+
actualPageVariationsMetadata.absoluteSourcePathsOfAllVariations.has(this.sourceAbsolutePath)) {
|
|
8732
8586
|
return {
|
|
8733
8587
|
newFiles: [],
|
|
8734
8588
|
mustInitialFileBeDeleted: false
|
|
8735
8589
|
};
|
|
8736
8590
|
}
|
|
8737
|
-
const { localizedStringResourcesConstantName, localeVariableName, locales } = localeDependentPagesVariationsSettings;
|
|
8738
|
-
const areLocaleDependentVariationsRequiredForCurrentFile = locales.size > 0 &&
|
|
8739
|
-
!localeDependentPagesVariationsSettings.excludedFilesAbsolutePaths.includes(this.sourceAbsolutePath);
|
|
8740
8591
|
const pageVariations = [];
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
pageVariations.push(new MarkupEntryPointVinylFile({
|
|
8744
|
-
initialPlainVinylFile: new vinyl_1.default({
|
|
8745
|
-
base: this.base,
|
|
8746
|
-
path: (0, addPenultimateFileNameExtension_1.default)({
|
|
8747
|
-
targetPath: this.sourceAbsolutePath,
|
|
8748
|
-
targetFileNamePenultimateExtensionWithOrWithoutLeadingDot: localeData.outputFileInterimNameExtensionWithoutDot,
|
|
8749
|
-
mustAppendDuplicateEvenIfTargetPenultimateFileNameExtensionAlreadyExist: true,
|
|
8750
|
-
mustAppendLastFileNameExtensionInsteadIfThereIsNoOne: true
|
|
8751
|
-
}),
|
|
8752
|
-
contents: this.contents
|
|
8753
|
-
}),
|
|
8754
|
-
markupProcessingSettingsRepresentative: this.markupProcessingSettingsRepresentative,
|
|
8755
|
-
staticPreviewLocalizationData: {
|
|
8756
|
-
...(0, es_extensions_1.isNotUndefined)(localeVariableName) && (0, es_extensions_1.isNotUndefined)(localeData.localeVariableValue) ?
|
|
8757
|
-
{ [localeVariableName]: localeData.localeVariableValue } : null,
|
|
8758
|
-
...(0, es_extensions_1.isNotUndefined)(localizedStringResourcesConstantName) && (0, es_extensions_1.isNotUndefined)(localeData.stringResources) ?
|
|
8759
|
-
{ [localizedStringResourcesConstantName]: localeData.stringResources } : null
|
|
8760
|
-
},
|
|
8761
|
-
...(0, es_extensions_1.isNotUndefined)(this.pageStateDependentVariationsSpecification) ?
|
|
8762
|
-
{
|
|
8763
|
-
pageStateDependentVariationData: {
|
|
8764
|
-
[this.pageStateDependentVariationsSpecification.stateVariableName]: {}
|
|
8765
|
-
}
|
|
8766
|
-
} :
|
|
8767
|
-
null
|
|
8768
|
-
}));
|
|
8769
|
-
}
|
|
8770
|
-
}
|
|
8771
|
-
if ((0, es_extensions_1.isUndefined)(this.pageStateDependentVariationsSpecification)) {
|
|
8772
|
-
return {
|
|
8773
|
-
newFiles: pageVariations,
|
|
8774
|
-
mustInitialFileBeDeleted: areLocaleDependentVariationsRequiredForCurrentFile
|
|
8775
|
-
};
|
|
8776
|
-
}
|
|
8777
|
-
for (const [derivedFileAbsolutePath, state] of this.pageStateDependentVariationsSpecification.derivedPagesAndStatesMap.entries()) {
|
|
8778
|
-
if (areLocaleDependentVariationsRequiredForCurrentFile) {
|
|
8779
|
-
for (const localeData of locales.values()) {
|
|
8780
|
-
pageVariations.push(new MarkupEntryPointVinylFile({
|
|
8781
|
-
initialPlainVinylFile: new vinyl_1.default({
|
|
8782
|
-
base: this.base,
|
|
8783
|
-
path: (0, addPenultimateFileNameExtension_1.default)({
|
|
8784
|
-
targetPath: derivedFileAbsolutePath,
|
|
8785
|
-
targetFileNamePenultimateExtensionWithOrWithoutLeadingDot: localeData.outputFileInterimNameExtensionWithoutDot,
|
|
8786
|
-
mustAppendDuplicateEvenIfTargetPenultimateFileNameExtensionAlreadyExist: true,
|
|
8787
|
-
mustAppendLastFileNameExtensionInsteadIfThereIsNoOne: true
|
|
8788
|
-
}),
|
|
8789
|
-
contents: this.contents
|
|
8790
|
-
}),
|
|
8791
|
-
markupProcessingSettingsRepresentative: this.markupProcessingSettingsRepresentative,
|
|
8792
|
-
pageStateDependentVariationData: {
|
|
8793
|
-
[this.pageStateDependentVariationsSpecification.stateVariableName]: state
|
|
8794
|
-
},
|
|
8795
|
-
staticPreviewLocalizationData: {
|
|
8796
|
-
...(0, es_extensions_1.isNotUndefined)(localeVariableName) && (0, es_extensions_1.isNotUndefined)(localeData.localeVariableValue) ?
|
|
8797
|
-
{ [localeVariableName]: localeData.localeVariableValue } : null,
|
|
8798
|
-
...(0, es_extensions_1.isNotUndefined)(localizedStringResourcesConstantName) && (0, es_extensions_1.isNotUndefined)(localeData.stringResources) ?
|
|
8799
|
-
{ [localizedStringResourcesConstantName]: localeData.stringResources } : null
|
|
8800
|
-
}
|
|
8801
|
-
}));
|
|
8802
|
-
}
|
|
8592
|
+
for (const [variationFileAbsolutePath__forwardSlashesPathSeparators, dataForPug] of actualPageVariationsMetadata.dataForPugBySourceFilesAbsolutePaths.entries()) {
|
|
8593
|
+
if (this.sourceAbsolutePath === variationFileAbsolutePath__forwardSlashesPathSeparators) {
|
|
8803
8594
|
continue;
|
|
8804
8595
|
}
|
|
8805
8596
|
pageVariations.push(new MarkupEntryPointVinylFile({
|
|
8806
8597
|
initialPlainVinylFile: new vinyl_1.default({
|
|
8807
8598
|
base: this.base,
|
|
8808
|
-
path:
|
|
8599
|
+
path: variationFileAbsolutePath__forwardSlashesPathSeparators,
|
|
8809
8600
|
contents: this.contents
|
|
8810
8601
|
}),
|
|
8811
8602
|
markupProcessingSettingsRepresentative: this.markupProcessingSettingsRepresentative,
|
|
8812
|
-
pageStateDependentVariationData: {
|
|
8603
|
+
pageStateDependentVariationData: {
|
|
8604
|
+
...dataForPug.localizationData ?? null,
|
|
8605
|
+
...dataForPug.pageStateDependentVariationData ?? null
|
|
8606
|
+
}
|
|
8813
8607
|
}));
|
|
8814
8608
|
}
|
|
8815
8609
|
return {
|
|
8816
8610
|
newFiles: pageVariations,
|
|
8817
|
-
mustInitialFileBeDeleted:
|
|
8611
|
+
mustInitialFileBeDeleted: !actualPageVariationsMetadata.mustInitialFileBeKept
|
|
8818
8612
|
};
|
|
8819
8613
|
}
|
|
8820
8614
|
}
|
|
@@ -8827,10 +8621,14 @@ exports["default"] = MarkupEntryPointVinylFile;
|
|
|
8827
8621
|
/*!*************************************************************************************!*\
|
|
8828
8622
|
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/MarkupProcessingRestrictions.ts ***!
|
|
8829
8623
|
\*************************************************************************************/
|
|
8830
|
-
/***/ ((__unused_webpack_module, exports)
|
|
8624
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
8831
8625
|
|
|
8832
8626
|
|
|
8627
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
8628
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8629
|
+
};
|
|
8833
8630
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8631
|
+
const addPenultimateFileNameExtension_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/Strings/addPenultimateFileNameExtension */ "./UtilsIncubator/Strings/addPenultimateFileNameExtension.ts"));
|
|
8834
8632
|
var MarkupProcessingRestrictions;
|
|
8835
8633
|
(function (MarkupProcessingRestrictions) {
|
|
8836
8634
|
MarkupProcessingRestrictions.supportedSourceFilesNamesExtensionsWithoutLeadingDots = ["pug"];
|
|
@@ -8847,6 +8645,23 @@ var MarkupProcessingRestrictions;
|
|
|
8847
8645
|
SupportedAccessibilityStandards["WCAG2AA"] = "WCAG2AA";
|
|
8848
8646
|
SupportedAccessibilityStandards["WCAG2AAA"] = "WCAG2AAA";
|
|
8849
8647
|
})(SupportedAccessibilityStandards = MarkupProcessingRestrictions.SupportedAccessibilityStandards || (MarkupProcessingRestrictions.SupportedAccessibilityStandards = {}));
|
|
8648
|
+
function addLocaleIdentifyingPenultimateFileNameToAbsolutePathOfMarkupEntryPointSourceFile({ initialAbsolutePathOfMarkupEntryPointSourceFile, localeIdentifyingPenultimateFileNameExtensionWithoutLeadingDot }) {
|
|
8649
|
+
return (0, addPenultimateFileNameExtension_1.default)({
|
|
8650
|
+
targetPath: initialAbsolutePathOfMarkupEntryPointSourceFile,
|
|
8651
|
+
targetFileNamePenultimateExtensionWithOrWithoutLeadingDot: localeIdentifyingPenultimateFileNameExtensionWithoutLeadingDot,
|
|
8652
|
+
mustAppendDuplicateEvenIfTargetPenultimateFileNameExtensionAlreadyExist: true,
|
|
8653
|
+
mustAppendLastFileNameExtensionInsteadIfThereIsNoOne: true
|
|
8654
|
+
});
|
|
8655
|
+
}
|
|
8656
|
+
MarkupProcessingRestrictions.addLocaleIdentifyingPenultimateFileNameToAbsolutePathOfMarkupEntryPointSourceFile = addLocaleIdentifyingPenultimateFileNameToAbsolutePathOfMarkupEntryPointSourceFile;
|
|
8657
|
+
function computeOutputFileNameWithAllExtensionsForLocalizedMarkupEntryPoint({ sourceFileNameWithoutLastExtension, localeIdentifyingPenultimateFileNameExtensionWithoutLeadingDot, outputFileNameWithLastExtensionWithLeadingDot }) {
|
|
8658
|
+
return [
|
|
8659
|
+
sourceFileNameWithoutLastExtension,
|
|
8660
|
+
localeIdentifyingPenultimateFileNameExtensionWithoutLeadingDot,
|
|
8661
|
+
outputFileNameWithLastExtensionWithLeadingDot
|
|
8662
|
+
].join(".");
|
|
8663
|
+
}
|
|
8664
|
+
MarkupProcessingRestrictions.computeOutputFileNameWithAllExtensionsForLocalizedMarkupEntryPoint = computeOutputFileNameWithAllExtensionsForLocalizedMarkupEntryPoint;
|
|
8850
8665
|
})(MarkupProcessingRestrictions || (MarkupProcessingRestrictions = {}));
|
|
8851
8666
|
exports["default"] = MarkupProcessingRestrictions;
|
|
8852
8667
|
|
|
@@ -8871,6 +8686,7 @@ const PLAIN_COPIED_FILES_POINTER_ALIAS_PREFIX_1 = __importDefault(__webpack_requ
|
|
|
8871
8686
|
const GulpStreamBasedSourceCodeProcessingConfigRepresentative_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/SettingsRepresentatives/GulpStreamBasedSourceCodeProcessingConfigRepresentative */ "./ProjectBuilding/Common/SettingsRepresentatives/GulpStreamBasedSourceCodeProcessingConfigRepresentative.ts"));
|
|
8872
8687
|
/* ─── Utils ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
8873
8688
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
8689
|
+
const es_extensions_nodejs_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions-nodejs */ "@yamato-daiwa/es-extensions-nodejs");
|
|
8874
8690
|
class MarkupProcessingSettingsRepresentative extends GulpStreamBasedSourceCodeProcessingConfigRepresentative_1.default {
|
|
8875
8691
|
/* [ Theory ] Below two fields could be even or not. */
|
|
8876
8692
|
supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots;
|
|
@@ -8944,9 +8760,6 @@ class MarkupProcessingSettingsRepresentative extends GulpStreamBasedSourceCodePr
|
|
|
8944
8760
|
return this.staticPreviewSettings.pagesVariations.stateDependent.
|
|
8945
8761
|
get((0, es_extensions_1.replaceDoubleBackslashesWithForwardSlashes)(targetFileAbsolutePath));
|
|
8946
8762
|
}
|
|
8947
|
-
get localeDependentPagesVariationsSettings() {
|
|
8948
|
-
return this.staticPreviewSettings.pagesVariations.localeDependent;
|
|
8949
|
-
}
|
|
8950
8763
|
get staticDataForStaticPreview() {
|
|
8951
8764
|
return this.staticPreviewSettings.importsFromStaticDataFiles;
|
|
8952
8765
|
}
|
|
@@ -8954,6 +8767,139 @@ class MarkupProcessingSettingsRepresentative extends GulpStreamBasedSourceCodePr
|
|
|
8954
8767
|
get mustLogSourceFilesWatcherEvents() {
|
|
8955
8768
|
return this.loggingSettings.filesWatcherEvents;
|
|
8956
8769
|
}
|
|
8770
|
+
/* ━━━ Pages Variations ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
8771
|
+
createPagesVariationsMetadata(sourceFilesAbsolutePaths__forwardSlashesSeparators) {
|
|
8772
|
+
return new Map(sourceFilesAbsolutePaths__forwardSlashesSeparators.map((sourceFileAbsolutePath__forwardSlashesSeparators) => [
|
|
8773
|
+
sourceFileAbsolutePath__forwardSlashesSeparators,
|
|
8774
|
+
this.createPageVariationsMetadata(sourceFileAbsolutePath__forwardSlashesSeparators)
|
|
8775
|
+
]));
|
|
8776
|
+
}
|
|
8777
|
+
createPageVariationsMetadata(sourceFileAbsolutePath__forwardSlashesSeparators) {
|
|
8778
|
+
const sourceAndOutputAbsolutePathsOfAllVariations = new Map();
|
|
8779
|
+
const absoluteSourcePathsOfAllVariations = new Set();
|
|
8780
|
+
const dataForPugBySourceFilesAbsolutePaths = new Map();
|
|
8781
|
+
const markupEntryPointsGroupSettingsActualForCurrentFile = this.getExpectedToExistEntryPointsGroupSettingsRelevantForSpecifiedSourceFileAbsolutePath(sourceFileAbsolutePath__forwardSlashesSeparators);
|
|
8782
|
+
const { localizedStringResourcesConstantName, localeConstantName, locales, excludedFilesAbsolutePaths, nameOfConstantForInterpolationToLangHTML_Attribute } = markupEntryPointsGroupSettingsActualForCurrentFile.localization;
|
|
8783
|
+
const areLocalizedVersionsRequiredForCurrentFile = locales.size > 0 &&
|
|
8784
|
+
!excludedFilesAbsolutePaths.includes(sourceFileAbsolutePath__forwardSlashesSeparators);
|
|
8785
|
+
const outputFileNameWithLastExtensionWithLeadingDot = this.computeOutputFileNameExtension({
|
|
8786
|
+
entryPointsGroupSettingsActualForTargetFile: markupEntryPointsGroupSettingsActualForCurrentFile,
|
|
8787
|
+
mustPrependDotToFileNameExtension: false
|
|
8788
|
+
});
|
|
8789
|
+
const outputDirectoryForCurrentMarkupFileAndDerivedOnes = MarkupProcessingSettingsRepresentative.
|
|
8790
|
+
computeRelevantOutputDirectoryAbsolutePathForTargetSourceFile(sourceFileAbsolutePath__forwardSlashesSeparators, markupEntryPointsGroupSettingsActualForCurrentFile);
|
|
8791
|
+
const entryPointStateDependentVariationsSpecification = this.getStateDependentVariationsForEntryPointWithAbsolutePath(sourceFileAbsolutePath__forwardSlashesSeparators);
|
|
8792
|
+
if (areLocalizedVersionsRequiredForCurrentFile) {
|
|
8793
|
+
for (const { outputFileInterimNameExtensionWithoutDot, localeConstantValue, stringResources, valueOfConstantForInterpolationToLangHTML_Attribute } of locales.values()) {
|
|
8794
|
+
const absolutePathOfLocalizedEntryPointSourceFile = MarkupProcessingRestrictions_1.default.
|
|
8795
|
+
addLocaleIdentifyingPenultimateFileNameToAbsolutePathOfMarkupEntryPointSourceFile({
|
|
8796
|
+
initialAbsolutePathOfMarkupEntryPointSourceFile: sourceFileAbsolutePath__forwardSlashesSeparators,
|
|
8797
|
+
localeIdentifyingPenultimateFileNameExtensionWithoutLeadingDot: outputFileInterimNameExtensionWithoutDot
|
|
8798
|
+
});
|
|
8799
|
+
sourceAndOutputAbsolutePathsOfAllVariations.set(absolutePathOfLocalizedEntryPointSourceFile, es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
8800
|
+
outputDirectoryForCurrentMarkupFileAndDerivedOnes,
|
|
8801
|
+
MarkupProcessingRestrictions_1.default.computeOutputFileNameWithAllExtensionsForLocalizedMarkupEntryPoint({
|
|
8802
|
+
sourceFileNameWithoutLastExtension: (0, es_extensions_1.extractFileNameWithoutLastExtension)(sourceFileAbsolutePath__forwardSlashesSeparators),
|
|
8803
|
+
localeIdentifyingPenultimateFileNameExtensionWithoutLeadingDot: outputFileInterimNameExtensionWithoutDot,
|
|
8804
|
+
outputFileNameWithLastExtensionWithLeadingDot
|
|
8805
|
+
})
|
|
8806
|
+
], { alwaysForwardSlashSeparators: true }));
|
|
8807
|
+
absoluteSourcePathsOfAllVariations.add(absolutePathOfLocalizedEntryPointSourceFile);
|
|
8808
|
+
dataForPugBySourceFilesAbsolutePaths.set(absolutePathOfLocalizedEntryPointSourceFile, {
|
|
8809
|
+
localizationData: {
|
|
8810
|
+
...(0, es_extensions_1.isNotUndefined)(localeConstantName) && (0, es_extensions_1.isNotUndefined)(localeConstantValue) ?
|
|
8811
|
+
{ [localeConstantName]: localeConstantValue } : null,
|
|
8812
|
+
...(0, es_extensions_1.isNotUndefined)(localizedStringResourcesConstantName) && (0, es_extensions_1.isNotUndefined)(stringResources) ?
|
|
8813
|
+
{ [localizedStringResourcesConstantName]: stringResources } : null,
|
|
8814
|
+
...(0, es_extensions_1.isNotUndefined)(nameOfConstantForInterpolationToLangHTML_Attribute) &&
|
|
8815
|
+
(0, es_extensions_1.isNotUndefined)(valueOfConstantForInterpolationToLangHTML_Attribute) ?
|
|
8816
|
+
{
|
|
8817
|
+
[nameOfConstantForInterpolationToLangHTML_Attribute]: valueOfConstantForInterpolationToLangHTML_Attribute
|
|
8818
|
+
} : null
|
|
8819
|
+
},
|
|
8820
|
+
...(0, es_extensions_1.isNotUndefined)(entryPointStateDependentVariationsSpecification) ?
|
|
8821
|
+
{
|
|
8822
|
+
pageStateDependentVariationData: {
|
|
8823
|
+
[entryPointStateDependentVariationsSpecification.stateVariableName]: {}
|
|
8824
|
+
}
|
|
8825
|
+
} :
|
|
8826
|
+
null
|
|
8827
|
+
});
|
|
8828
|
+
}
|
|
8829
|
+
}
|
|
8830
|
+
else {
|
|
8831
|
+
sourceAndOutputAbsolutePathsOfAllVariations.set(sourceFileAbsolutePath__forwardSlashesSeparators, es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
8832
|
+
outputDirectoryForCurrentMarkupFileAndDerivedOnes,
|
|
8833
|
+
`${(0, es_extensions_1.extractFileNameWithoutLastExtension)(sourceFileAbsolutePath__forwardSlashesSeparators)}.` +
|
|
8834
|
+
outputFileNameWithLastExtensionWithLeadingDot
|
|
8835
|
+
], { alwaysForwardSlashSeparators: true }));
|
|
8836
|
+
absoluteSourcePathsOfAllVariations.add(sourceFileAbsolutePath__forwardSlashesSeparators);
|
|
8837
|
+
}
|
|
8838
|
+
for (const derivedSourceFileAbsolutePath of (entryPointStateDependentVariationsSpecification?.derivedPagesAndStatesMap ?? new Map()).keys()) {
|
|
8839
|
+
if (areLocalizedVersionsRequiredForCurrentFile) {
|
|
8840
|
+
for (const { outputFileInterimNameExtensionWithoutDot, localeConstantValue, stringResources, valueOfConstantForInterpolationToLangHTML_Attribute } of locales.values()) {
|
|
8841
|
+
const absolutePathOfLocalizeEntryPointSourceFile = MarkupProcessingRestrictions_1.default.
|
|
8842
|
+
addLocaleIdentifyingPenultimateFileNameToAbsolutePathOfMarkupEntryPointSourceFile({
|
|
8843
|
+
initialAbsolutePathOfMarkupEntryPointSourceFile: derivedSourceFileAbsolutePath,
|
|
8844
|
+
localeIdentifyingPenultimateFileNameExtensionWithoutLeadingDot: outputFileInterimNameExtensionWithoutDot
|
|
8845
|
+
});
|
|
8846
|
+
sourceAndOutputAbsolutePathsOfAllVariations.set(absolutePathOfLocalizeEntryPointSourceFile, es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
8847
|
+
outputDirectoryForCurrentMarkupFileAndDerivedOnes,
|
|
8848
|
+
MarkupProcessingRestrictions_1.default.computeOutputFileNameWithAllExtensionsForLocalizedMarkupEntryPoint({
|
|
8849
|
+
sourceFileNameWithoutLastExtension: (0, es_extensions_1.extractFileNameWithoutLastExtension)(derivedSourceFileAbsolutePath),
|
|
8850
|
+
localeIdentifyingPenultimateFileNameExtensionWithoutLeadingDot: outputFileInterimNameExtensionWithoutDot,
|
|
8851
|
+
outputFileNameWithLastExtensionWithLeadingDot
|
|
8852
|
+
})
|
|
8853
|
+
], { alwaysForwardSlashSeparators: true }));
|
|
8854
|
+
absoluteSourcePathsOfAllVariations.add(absolutePathOfLocalizeEntryPointSourceFile);
|
|
8855
|
+
dataForPugBySourceFilesAbsolutePaths.set(absolutePathOfLocalizeEntryPointSourceFile, {
|
|
8856
|
+
localizationData: {
|
|
8857
|
+
...(0, es_extensions_1.isNotUndefined)(localeConstantName) && (0, es_extensions_1.isNotUndefined)(localeConstantValue) ?
|
|
8858
|
+
{ [localeConstantName]: localeConstantValue } : null,
|
|
8859
|
+
...(0, es_extensions_1.isNotUndefined)(localizedStringResourcesConstantName) && (0, es_extensions_1.isNotUndefined)(stringResources) ?
|
|
8860
|
+
{ [localizedStringResourcesConstantName]: stringResources } : null,
|
|
8861
|
+
...(0, es_extensions_1.isNotUndefined)(nameOfConstantForInterpolationToLangHTML_Attribute) &&
|
|
8862
|
+
(0, es_extensions_1.isNotUndefined)(valueOfConstantForInterpolationToLangHTML_Attribute) ?
|
|
8863
|
+
{
|
|
8864
|
+
[nameOfConstantForInterpolationToLangHTML_Attribute]: valueOfConstantForInterpolationToLangHTML_Attribute
|
|
8865
|
+
} : null
|
|
8866
|
+
},
|
|
8867
|
+
...(0, es_extensions_1.isNotUndefined)(entryPointStateDependentVariationsSpecification) ?
|
|
8868
|
+
{
|
|
8869
|
+
pageStateDependentVariationData: {
|
|
8870
|
+
[entryPointStateDependentVariationsSpecification.stateVariableName]: (0, es_extensions_1.getExpectedToBeNonUndefinedMapValue)(entryPointStateDependentVariationsSpecification.derivedPagesAndStatesMap, derivedSourceFileAbsolutePath)
|
|
8871
|
+
}
|
|
8872
|
+
} :
|
|
8873
|
+
null
|
|
8874
|
+
});
|
|
8875
|
+
}
|
|
8876
|
+
}
|
|
8877
|
+
else {
|
|
8878
|
+
sourceAndOutputAbsolutePathsOfAllVariations.set(derivedSourceFileAbsolutePath, es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
8879
|
+
outputDirectoryForCurrentMarkupFileAndDerivedOnes,
|
|
8880
|
+
`${(0, es_extensions_1.extractFileNameWithoutLastExtension)(derivedSourceFileAbsolutePath)}.` +
|
|
8881
|
+
outputFileNameWithLastExtensionWithLeadingDot
|
|
8882
|
+
], { alwaysForwardSlashSeparators: true }));
|
|
8883
|
+
absoluteSourcePathsOfAllVariations.add(derivedSourceFileAbsolutePath);
|
|
8884
|
+
dataForPugBySourceFilesAbsolutePaths.set(derivedSourceFileAbsolutePath, {
|
|
8885
|
+
localizationData: {},
|
|
8886
|
+
...(0, es_extensions_1.isNotUndefined)(entryPointStateDependentVariationsSpecification) ?
|
|
8887
|
+
{
|
|
8888
|
+
pageStateDependentVariationData: {
|
|
8889
|
+
[entryPointStateDependentVariationsSpecification.stateVariableName]: (0, es_extensions_1.getExpectedToBeNonUndefinedMapValue)(entryPointStateDependentVariationsSpecification.derivedPagesAndStatesMap, derivedSourceFileAbsolutePath)
|
|
8890
|
+
}
|
|
8891
|
+
} :
|
|
8892
|
+
null
|
|
8893
|
+
});
|
|
8894
|
+
}
|
|
8895
|
+
}
|
|
8896
|
+
return {
|
|
8897
|
+
mustInitialFileBeKept: !areLocalizedVersionsRequiredForCurrentFile,
|
|
8898
|
+
sourceAndOutputAbsolutePathsOfAllVariations,
|
|
8899
|
+
absoluteSourcePathsOfAllVariations,
|
|
8900
|
+
dataForPugBySourceFilesAbsolutePaths
|
|
8901
|
+
};
|
|
8902
|
+
}
|
|
8957
8903
|
}
|
|
8958
8904
|
exports["default"] = MarkupProcessingSettingsRepresentative;
|
|
8959
8905
|
|
|
@@ -9047,15 +8993,97 @@ const SourceCodeProcessingSettingsGenericProperties__FromFile__RawValid_1 = __im
|
|
|
9047
8993
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
9048
8994
|
var MarkupProcessingSettings__FromFile__RawValid;
|
|
9049
8995
|
(function (MarkupProcessingSettings__FromFile__RawValid) {
|
|
8996
|
+
function generateLocalizationPropertiesSpecification(additionalPropertiesSpecification = {}) {
|
|
8997
|
+
return {
|
|
8998
|
+
newName: "localization",
|
|
8999
|
+
type: Object,
|
|
9000
|
+
required: false,
|
|
9001
|
+
preValidationModifications: es_extensions_1.nullToUndefined,
|
|
9002
|
+
properties: {
|
|
9003
|
+
$stringResourcesFileRelativePath: {
|
|
9004
|
+
newName: "stringResourcesFileRelativePath",
|
|
9005
|
+
type: String,
|
|
9006
|
+
required: false,
|
|
9007
|
+
minimalCharactersCount: 1
|
|
9008
|
+
},
|
|
9009
|
+
$localizedStringResourcesConstantName: {
|
|
9010
|
+
newName: "localizedStringResourcesConstantName",
|
|
9011
|
+
type: String,
|
|
9012
|
+
required: false,
|
|
9013
|
+
minimalCharactersCount: 1
|
|
9014
|
+
},
|
|
9015
|
+
$localeConstantName: {
|
|
9016
|
+
newName: "localeConstantName",
|
|
9017
|
+
type: String,
|
|
9018
|
+
required: false,
|
|
9019
|
+
minimalCharactersCount: 1
|
|
9020
|
+
},
|
|
9021
|
+
$nameOfConstantForInterpolationToLangHTML_Attribute: {
|
|
9022
|
+
newName: "nameOfConstantForInterpolationToLangHTML_Attribute",
|
|
9023
|
+
type: String,
|
|
9024
|
+
required: false,
|
|
9025
|
+
minimalCharactersCount: 1
|
|
9026
|
+
},
|
|
9027
|
+
$locales: {
|
|
9028
|
+
newName: "locales",
|
|
9029
|
+
type: es_extensions_1.RawObjectDataProcessor.ValuesTypesIDs.associativeArrayOfUniformTypeValues,
|
|
9030
|
+
required: true,
|
|
9031
|
+
minimalEntriesCount: 1,
|
|
9032
|
+
value: {
|
|
9033
|
+
type: Object,
|
|
9034
|
+
properties: {
|
|
9035
|
+
$outputFileInterimNameExtensionWithoutDot: {
|
|
9036
|
+
newName: "outputFileInterimNameExtensionWithoutDot",
|
|
9037
|
+
type: String,
|
|
9038
|
+
required: true,
|
|
9039
|
+
minimalCharactersCount: 1
|
|
9040
|
+
},
|
|
9041
|
+
$localeConstantValue: {
|
|
9042
|
+
newName: "localeConstantValue",
|
|
9043
|
+
type: String,
|
|
9044
|
+
required: false,
|
|
9045
|
+
minimalCharactersCount: 1
|
|
9046
|
+
},
|
|
9047
|
+
$keyInLocalizedStringResourcesObject: {
|
|
9048
|
+
newName: "keyInLocalizedStringResourcesObject",
|
|
9049
|
+
type: String,
|
|
9050
|
+
required: false,
|
|
9051
|
+
minimalCharactersCount: 1
|
|
9052
|
+
},
|
|
9053
|
+
$valueOfConstantForInterpolationToLangHTML_Attribute: {
|
|
9054
|
+
newName: "valueOfConstantForInterpolationToLangHTML_Attribute",
|
|
9055
|
+
type: String,
|
|
9056
|
+
required: false,
|
|
9057
|
+
minimalCharactersCount: 1
|
|
9058
|
+
}
|
|
9059
|
+
}
|
|
9060
|
+
}
|
|
9061
|
+
},
|
|
9062
|
+
...additionalPropertiesSpecification
|
|
9063
|
+
}
|
|
9064
|
+
};
|
|
9065
|
+
}
|
|
9066
|
+
MarkupProcessingSettings__FromFile__RawValid.generateLocalizationPropertiesSpecification = generateLocalizationPropertiesSpecification;
|
|
9050
9067
|
function getLocalizedPropertiesSpecification({ markupProcessingPropertiesLocalization, localizedConsumingProjectLocalizedPreDefinedBuildingModes, lintingSettingsLocalizedPropertiesSpecification, sourceCodeProcessingSettingsGenericPropertiesLocalization, entryPointsGroupBuildingModeDependentOutputGenericSettingsLocalizedPropertiesSpecification }) {
|
|
9051
9068
|
return {
|
|
9052
9069
|
/* ━━━ Common ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
9053
9070
|
$common: {
|
|
9054
9071
|
newName: "common",
|
|
9055
|
-
preValidationModifications: es_extensions_1.nullToUndefined,
|
|
9056
9072
|
type: Object,
|
|
9057
9073
|
required: false,
|
|
9074
|
+
preValidationModifications: es_extensions_1.nullToUndefined,
|
|
9058
9075
|
properties: {
|
|
9076
|
+
$localization: generateLocalizationPropertiesSpecification({
|
|
9077
|
+
$excludedFilesPathsRelativeRelativeToProjectRootDirectory: {
|
|
9078
|
+
newName: "excludedFilesPathsRelativeRelativeToProjectRootDirectory",
|
|
9079
|
+
type: Array,
|
|
9080
|
+
required: false,
|
|
9081
|
+
element: {
|
|
9082
|
+
type: String,
|
|
9083
|
+
minimalCharactersCount: 1
|
|
9084
|
+
}
|
|
9085
|
+
}
|
|
9086
|
+
}),
|
|
9059
9087
|
$buildingModeDependent: {
|
|
9060
9088
|
newName: "buildingModeDependent",
|
|
9061
9089
|
type: es_extensions_1.RawObjectDataProcessor.ValuesTypesIDs.associativeArrayOfUniformTypeValues,
|
|
@@ -9099,89 +9127,17 @@ var MarkupProcessingSettings__FromFile__RawValid;
|
|
|
9099
9127
|
type: Object,
|
|
9100
9128
|
required: false,
|
|
9101
9129
|
properties: {
|
|
9102
|
-
$
|
|
9103
|
-
newName: "
|
|
9130
|
+
$stateDependentPagesVariations: {
|
|
9131
|
+
newName: "stateDependentPagesVariations",
|
|
9104
9132
|
type: Object,
|
|
9105
9133
|
required: false,
|
|
9106
9134
|
preValidationModifications: es_extensions_1.nullToUndefined,
|
|
9107
9135
|
properties: {
|
|
9108
|
-
$
|
|
9109
|
-
newName: "
|
|
9110
|
-
type:
|
|
9111
|
-
required:
|
|
9112
|
-
|
|
9113
|
-
properties: {
|
|
9114
|
-
$specificationFileRelativePath: {
|
|
9115
|
-
newName: "specificationFileRelativePath",
|
|
9116
|
-
type: String,
|
|
9117
|
-
required: true,
|
|
9118
|
-
minimalCharactersCount: 1
|
|
9119
|
-
}
|
|
9120
|
-
}
|
|
9121
|
-
},
|
|
9122
|
-
$localeDependent: {
|
|
9123
|
-
newName: "localeDependent",
|
|
9124
|
-
type: Object,
|
|
9125
|
-
required: false,
|
|
9126
|
-
preValidationModifications: es_extensions_1.nullToUndefined,
|
|
9127
|
-
properties: {
|
|
9128
|
-
$stringResourcesFileRelativePath: {
|
|
9129
|
-
newName: "stringResourcesFileRelativePath",
|
|
9130
|
-
type: String,
|
|
9131
|
-
required: false,
|
|
9132
|
-
minimalCharactersCount: 1
|
|
9133
|
-
},
|
|
9134
|
-
$localizedStringResourcesConstantName: {
|
|
9135
|
-
newName: "localizedStringResourcesConstantName",
|
|
9136
|
-
type: String,
|
|
9137
|
-
required: false,
|
|
9138
|
-
minimalCharactersCount: 1
|
|
9139
|
-
},
|
|
9140
|
-
$localeVariableName: {
|
|
9141
|
-
newName: "localeVariableName",
|
|
9142
|
-
type: String,
|
|
9143
|
-
required: false,
|
|
9144
|
-
minimalCharactersCount: 1
|
|
9145
|
-
},
|
|
9146
|
-
$locales: {
|
|
9147
|
-
newName: "locales",
|
|
9148
|
-
type: es_extensions_1.RawObjectDataProcessor.ValuesTypesIDs.associativeArrayOfUniformTypeValues,
|
|
9149
|
-
required: true,
|
|
9150
|
-
minimalEntriesCount: 1,
|
|
9151
|
-
value: {
|
|
9152
|
-
type: Object,
|
|
9153
|
-
properties: {
|
|
9154
|
-
$localeVariableValue: {
|
|
9155
|
-
newName: "localeVariableValue",
|
|
9156
|
-
type: String,
|
|
9157
|
-
required: false,
|
|
9158
|
-
minimalCharactersCount: 1
|
|
9159
|
-
},
|
|
9160
|
-
$keyInLocalizedStringResourcesObject: {
|
|
9161
|
-
newName: "keyInLocalizedStringResourcesObject",
|
|
9162
|
-
type: String,
|
|
9163
|
-
required: false,
|
|
9164
|
-
minimalCharactersCount: 1
|
|
9165
|
-
},
|
|
9166
|
-
$outputFileInterimNameExtensionWithoutDot: {
|
|
9167
|
-
newName: "outputFileInterimNameExtensionWithoutDot",
|
|
9168
|
-
type: String,
|
|
9169
|
-
required: true,
|
|
9170
|
-
minimalCharactersCount: 1
|
|
9171
|
-
}
|
|
9172
|
-
}
|
|
9173
|
-
}
|
|
9174
|
-
},
|
|
9175
|
-
$excludedFilesRelativePaths: {
|
|
9176
|
-
newName: "excludedFilesRelativePaths",
|
|
9177
|
-
type: Array,
|
|
9178
|
-
required: false,
|
|
9179
|
-
element: {
|
|
9180
|
-
type: String,
|
|
9181
|
-
minimalCharactersCount: 1
|
|
9182
|
-
}
|
|
9183
|
-
}
|
|
9184
|
-
}
|
|
9136
|
+
$specificationFileRelativePath: {
|
|
9137
|
+
newName: "specificationFileRelativePath",
|
|
9138
|
+
type: String,
|
|
9139
|
+
required: true,
|
|
9140
|
+
minimalCharactersCount: 1
|
|
9185
9141
|
}
|
|
9186
9142
|
}
|
|
9187
9143
|
},
|
|
@@ -9210,40 +9166,38 @@ var MarkupProcessingSettings__FromFile__RawValid;
|
|
|
9210
9166
|
}
|
|
9211
9167
|
}
|
|
9212
9168
|
},
|
|
9213
|
-
|
|
9214
|
-
[markupProcessingPropertiesLocalization.linting.KEY]: {
|
|
9169
|
+
$linting: {
|
|
9215
9170
|
newName: "linting",
|
|
9216
9171
|
preValidationModifications: es_extensions_1.nullToUndefined,
|
|
9217
9172
|
type: Object,
|
|
9218
9173
|
required: false,
|
|
9219
9174
|
properties: lintingSettingsLocalizedPropertiesSpecification
|
|
9220
9175
|
},
|
|
9221
|
-
|
|
9176
|
+
$importingFromTypeScript: {
|
|
9222
9177
|
newName: "importingFromTypeScript",
|
|
9223
9178
|
preValidationModifications: es_extensions_1.nullToUndefined,
|
|
9224
9179
|
type: Object,
|
|
9225
9180
|
required: false,
|
|
9226
9181
|
properties: {
|
|
9227
|
-
|
|
9182
|
+
$typeScriptConfigurationFileRelativePath: {
|
|
9228
9183
|
newName: "typeScriptConfigurationFileRelativePath",
|
|
9229
9184
|
type: String,
|
|
9230
9185
|
required: false,
|
|
9231
9186
|
minimalCharactersCount: 1
|
|
9232
9187
|
},
|
|
9233
|
-
|
|
9188
|
+
$importedNamespace: {
|
|
9234
9189
|
newName: "importedNamespace",
|
|
9235
9190
|
type: String,
|
|
9236
9191
|
required: true,
|
|
9237
9192
|
minimalCharactersCount: 1
|
|
9238
9193
|
},
|
|
9239
|
-
|
|
9194
|
+
$sourceFileRelativePath: {
|
|
9240
9195
|
newName: "sourceFileRelativePath",
|
|
9241
9196
|
type: String,
|
|
9242
9197
|
required: true,
|
|
9243
9198
|
minimalCharactersCount: 1
|
|
9244
9199
|
},
|
|
9245
|
-
|
|
9246
|
-
nameOfPugBlockToWhichTranspiledTypeScriptMustBeInjected.KEY]: {
|
|
9200
|
+
$nameOfPugBlockToWhichTranspiledTypeScriptMustBeInjected: {
|
|
9247
9201
|
newName: "nameOfPugBlockToWhichTranspiledTypeScriptMustBeInjected",
|
|
9248
9202
|
type: String,
|
|
9249
9203
|
required: true,
|
|
@@ -9251,6 +9205,7 @@ var MarkupProcessingSettings__FromFile__RawValid;
|
|
|
9251
9205
|
}
|
|
9252
9206
|
}
|
|
9253
9207
|
},
|
|
9208
|
+
// ━━━ TODO ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
9254
9209
|
routing: {
|
|
9255
9210
|
type: Object,
|
|
9256
9211
|
required: false,
|
|
@@ -9290,6 +9245,17 @@ var MarkupProcessingSettings__FromFile__RawValid;
|
|
|
9290
9245
|
allowedAlternatives: Object.values(MarkupProcessingRestrictions_1.default.OutputFormats),
|
|
9291
9246
|
required: false
|
|
9292
9247
|
},
|
|
9248
|
+
$localization: generateLocalizationPropertiesSpecification({
|
|
9249
|
+
$excludedFilesPathsRelativeToSourcesFilesTopDirectory: {
|
|
9250
|
+
newName: "excludedFilesPathsRelativeToSourcesFilesTopDirectory",
|
|
9251
|
+
type: Array,
|
|
9252
|
+
required: false,
|
|
9253
|
+
element: {
|
|
9254
|
+
type: String,
|
|
9255
|
+
minimalCharactersCount: 1
|
|
9256
|
+
}
|
|
9257
|
+
}
|
|
9258
|
+
}),
|
|
9293
9259
|
[markupProcessingPropertiesLocalization.entryPointsGroups.HTML_Validation.KEY]: {
|
|
9294
9260
|
newName: "HTML_Validation",
|
|
9295
9261
|
preValidationModifications: es_extensions_1.nullToUndefined,
|
|
@@ -9537,13 +9503,23 @@ exports["default"] = MarkupProcessingSettings__FromFile__RawValid;
|
|
|
9537
9503
|
/*!************************************************************************************!*\
|
|
9538
9504
|
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/MarkupProcessingSharedState.ts ***!
|
|
9539
9505
|
\************************************************************************************/
|
|
9540
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
9506
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
9541
9507
|
|
|
9542
9508
|
|
|
9543
9509
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
9510
|
+
/* ─── Utils ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
9511
|
+
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
9544
9512
|
class MarkupProcessingSharedState {
|
|
9545
|
-
static entryPointsSourceAndOutputFilesAbsolutePathsCorrespondenceMap = new Map();
|
|
9546
9513
|
static importingFromTypeScriptPugCodeGenerator;
|
|
9514
|
+
static pagesVariationsMetadata = new Map();
|
|
9515
|
+
static get entryPointsSourceAndOutputFilesAbsolutePathsCorrespondenceMap() {
|
|
9516
|
+
return Array.from(MarkupProcessingSharedState.pagesVariationsMetadata.values()).
|
|
9517
|
+
reduce((interimConcatenatedMap, { sourceAndOutputAbsolutePathsOfAllVariations }) => (0, es_extensions_1.addEntriesToMap)({
|
|
9518
|
+
targetMap: interimConcatenatedMap,
|
|
9519
|
+
mutably: true,
|
|
9520
|
+
newEntries: sourceAndOutputAbsolutePathsOfAllVariations
|
|
9521
|
+
}), new Map());
|
|
9522
|
+
}
|
|
9547
9523
|
}
|
|
9548
9524
|
exports["default"] = MarkupProcessingSharedState;
|
|
9549
9525
|
|
|
@@ -9563,7 +9539,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9563
9539
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
9564
9540
|
/* ─── Restrictions ───────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
9565
9541
|
const MarkupProcessingRestrictions_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/MarkupProcessingRestrictions */ "./ProjectBuilding/SourceCodeProcessing/Markup/MarkupProcessingRestrictions.ts"));
|
|
9566
|
-
const MarkupProcessingSettingsRepresentative_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/MarkupProcessingSettingsRepresentative */ "./ProjectBuilding/SourceCodeProcessing/Markup/MarkupProcessingSettingsRepresentative.ts"));
|
|
9567
9542
|
/* ─── Source Files Watcher ───────────────────────────────────────────────────────────────────────────────────────── */
|
|
9568
9543
|
const MarkupSourceFilesWatcher_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/MarkupSourceFilesWatcher */ "./ProjectBuilding/SourceCodeProcessing/Markup/MarkupSourceFilesWatcher.ts"));
|
|
9569
9544
|
/* ─── Superclass ─────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
@@ -9584,22 +9559,20 @@ const MarkupEntryPointVinylFile_1 = __importDefault(__webpack_require__(/*! @Mar
|
|
|
9584
9559
|
const SourceCodeSelectiveReprocessingHelper_1 = __importDefault(__webpack_require__(/*! @Utils/SourceCodeSelectiveReprocessingHelper */ "./Utils/SourceCodeSelectiveReprocessingHelper.ts"));
|
|
9585
9560
|
const DotYDA_DirectoryManager_1 = __importDefault(__webpack_require__(/*! @Utils/DotYDA_DirectoryManager */ "./Utils/DotYDA_DirectoryManager.ts"));
|
|
9586
9561
|
const rev_hash_1 = __importDefault(__webpack_require__(/*! rev-hash */ "../node_modules/rev-hash/index.js"));
|
|
9587
|
-
const HTML_Validator_1 = __importDefault(__webpack_require__(/*!
|
|
9562
|
+
const HTML_Validator_1 = __importDefault(__webpack_require__(/*! ./Plugins/HTML_Validator/HTML_Validator */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_Validator.ts"));
|
|
9588
9563
|
const ResourcesPointersResolverForHTML_1 = __importDefault(__webpack_require__(/*! ./Plugins/ResourcesPointersResolverForHTML/ResourcesPointersResolverForHTML */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/ResourcesPointersResolverForHTML/ResourcesPointersResolverForHTML.ts"));
|
|
9589
9564
|
const AccessibilityInspector_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/Plugins/AccessibilityInspector/AccessibilityInspector */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/AccessibilityInspector/AccessibilityInspector.ts"));
|
|
9590
9565
|
const ImagesAspectRatioAffixer_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/Plugins/ImagesAspectRatioAffixer */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/ImagesAspectRatioAffixer.ts"));
|
|
9591
9566
|
const SpacesNormalizerForCJK_Text_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/Plugins/SpacesNormalizerForCJK_Text */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/SpacesNormalizerForCJK_Text.ts"));
|
|
9592
9567
|
const CodeListingPugFilter_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/PugFilters/CodeListingPugFilter */ "./ProjectBuilding/SourceCodeProcessing/Markup/PugFilters/CodeListingPugFilter.ts"));
|
|
9568
|
+
/* ─── General Utils ──────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
9593
9569
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
9594
9570
|
const es_extensions_nodejs_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions-nodejs */ "@yamato-daiwa/es-extensions-nodejs");
|
|
9595
9571
|
const node_html_parser_1 = __webpack_require__(/*! node-html-parser */ "node-html-parser");
|
|
9596
|
-
const addPenultimateFileNameExtension_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/Strings/addPenultimateFileNameExtension */ "./UtilsIncubator/Strings/addPenultimateFileNameExtension.ts"));
|
|
9597
9572
|
class MarkupProcessor extends GulpStreamsBasedTaskExecutor_1.default {
|
|
9598
|
-
static CACHED_HTML_VALIDATION_RESULTS_DIRECTORY_NAME = "HTML_Validation";
|
|
9599
9573
|
static CACHED_ACCESSIBILITY_INSPECTION_RESULTS_DIRECTORY_NAME = "AccessibilityInspection";
|
|
9600
9574
|
static ENTRY_POINTS_AND_PARTIAL_FILES_MAPPING_CACHE_FILE_NAME_WITH_EXTENSION = "MarkupEntryPointsAndAffiliatedFilesMappingCache.json";
|
|
9601
9575
|
logging;
|
|
9602
|
-
CACHED_HTML_VALIDATION_RESULTS_DIRECTORY_ABSOLUTE_PATH;
|
|
9603
9576
|
CACHED_ACCESSIBILITY_INSPECTION_RESULTS_DIRECTORY_ABSOLUTE_PATH;
|
|
9604
9577
|
markupProcessingSettingsRepresentative;
|
|
9605
9578
|
absolutePathOfFilesWaitingForReProcessing = new Set();
|
|
@@ -9611,16 +9584,15 @@ class MarkupProcessor extends GulpStreamsBasedTaskExecutor_1.default {
|
|
|
9611
9584
|
return (0, createImmediatelyEndingEmptyStream_1.default)();
|
|
9612
9585
|
}
|
|
9613
9586
|
const dataHoldingSelfInstance = new MarkupProcessor(markupProcessingSettingsRepresentative, projectBuildingMasterConfigRepresentative);
|
|
9614
|
-
|
|
9587
|
+
MarkupProcessingSharedState_1.default.pagesVariationsMetadata = markupProcessingSettingsRepresentative.createPagesVariationsMetadata(es_extensions_nodejs_1.ImprovedGlob.getFilesAbsolutePathsSynchronously(markupProcessingSettingsRepresentative.initialRelevantEntryPointsSourceFilesAbsolutePaths, { alwaysForwardSlashSeparators: true }));
|
|
9615
9588
|
if (markupProcessingSettingsRepresentative.mustValidateHTML) {
|
|
9616
|
-
HTML_Validator_1.default.
|
|
9617
|
-
|
|
9618
|
-
|
|
9619
|
-
consumingProjectBuildingMode: projectBuildingMasterConfigRepresentative.consumingProjectBuildingMode,
|
|
9620
|
-
projectBuildingSelectiveExecutionID: projectBuildingMasterConfigRepresentative.selectiveExecutionID,
|
|
9589
|
+
HTML_Validator_1.default.initialize({
|
|
9590
|
+
temporaryFileDirectoryAbsolutePath: DotYDA_DirectoryManager_1.default.TEMPORARY_FILES_DIRECTORY_ABSOLUTE_PATH,
|
|
9591
|
+
projectBuildingMasterConfigRepresentative,
|
|
9621
9592
|
logging: {
|
|
9622
9593
|
validationStart: markupProcessingSettingsRepresentative.loggingSettings.HTML_Validation.starting,
|
|
9623
|
-
validationCompletionWithoutIssues: markupProcessingSettingsRepresentative.loggingSettings.HTML_Validation.
|
|
9594
|
+
validationCompletionWithoutIssues: markupProcessingSettingsRepresentative.loggingSettings.HTML_Validation.
|
|
9595
|
+
completionWithoutIssues
|
|
9624
9596
|
}
|
|
9625
9597
|
});
|
|
9626
9598
|
}
|
|
@@ -9687,10 +9659,6 @@ class MarkupProcessor extends GulpStreamsBasedTaskExecutor_1.default {
|
|
|
9687
9659
|
quantityOfFilesWillBeProcessed: markupProcessingSettingsRepresentative.loggingSettings.filesCount
|
|
9688
9660
|
};
|
|
9689
9661
|
this.markupProcessingSettingsRepresentative = markupProcessingSettingsRepresentative;
|
|
9690
|
-
this.CACHED_HTML_VALIDATION_RESULTS_DIRECTORY_ABSOLUTE_PATH = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
9691
|
-
DotYDA_DirectoryManager_1.default.OPTIMIZATION_FILES_DIRECTORY_ABSOLUTE_PATH,
|
|
9692
|
-
MarkupProcessor.CACHED_HTML_VALIDATION_RESULTS_DIRECTORY_NAME
|
|
9693
|
-
], { alwaysForwardSlashSeparators: true });
|
|
9694
9662
|
this.CACHED_ACCESSIBILITY_INSPECTION_RESULTS_DIRECTORY_ABSOLUTE_PATH = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
9695
9663
|
DotYDA_DirectoryManager_1.default.OPTIMIZATION_FILES_DIRECTORY_ABSOLUTE_PATH,
|
|
9696
9664
|
MarkupProcessor.CACHED_ACCESSIBILITY_INSPECTION_RESULTS_DIRECTORY_NAME
|
|
@@ -9716,13 +9684,13 @@ class MarkupProcessor extends GulpStreamsBasedTaskExecutor_1.default {
|
|
|
9716
9684
|
})).
|
|
9717
9685
|
pipe(GulpStreamModifier_1.default.modify({
|
|
9718
9686
|
onStreamStartedEventHandlersForSpecificFileTypes: new Map([
|
|
9719
|
-
[MarkupEntryPointVinylFile_1.default, MarkupProcessor.
|
|
9687
|
+
[MarkupEntryPointVinylFile_1.default, MarkupProcessor.managePageVariations]
|
|
9720
9688
|
])
|
|
9721
9689
|
})).
|
|
9722
9690
|
pipe(this.logProcessedFilesIfMust()).
|
|
9723
9691
|
pipe((0, gulp_data_1.default)((vinylFile) => ({
|
|
9724
9692
|
...vinylFile.pageStateDependentVariationData ?? null,
|
|
9725
|
-
...vinylFile.
|
|
9693
|
+
...vinylFile.localizationData ?? null,
|
|
9726
9694
|
...this.projectBuildingMasterConfigRepresentative.isStaticPreviewBuildingMode ?
|
|
9727
9695
|
this.markupProcessingSettingsRepresentative.staticDataForStaticPreview : null
|
|
9728
9696
|
}))).
|
|
@@ -9832,8 +9800,8 @@ class MarkupProcessor extends GulpStreamsBasedTaskExecutor_1.default {
|
|
|
9832
9800
|
}).join("\n"));
|
|
9833
9801
|
return Promise.resolve(GulpStreamModifier_1.default.CompletionSignals.PASSING_ON);
|
|
9834
9802
|
}
|
|
9835
|
-
static async
|
|
9836
|
-
const { newFiles, mustInitialFileBeDeleted } = markupEntryPointVinylFile.
|
|
9803
|
+
static async managePageVariations(markupEntryPointVinylFile, addNewFilesToStream) {
|
|
9804
|
+
const { newFiles, mustInitialFileBeDeleted } = markupEntryPointVinylFile.manageVariations();
|
|
9837
9805
|
addNewFilesToStream(newFiles);
|
|
9838
9806
|
return Promise.resolve(mustInitialFileBeDeleted ?
|
|
9839
9807
|
GulpStreamModifier_1.default.CompletionSignals.REMOVING_FILE_FROM_STREAM :
|
|
@@ -9862,11 +9830,14 @@ class MarkupProcessor extends GulpStreamsBasedTaskExecutor_1.default {
|
|
|
9862
9830
|
/* eslint-disable @typescript-eslint/member-ordering --
|
|
9863
9831
|
* From now, static and non-static methods are following by the usage order. */
|
|
9864
9832
|
async onOutputHTML_FileReady(processedEntryPointVinylFile) {
|
|
9865
|
-
const
|
|
9833
|
+
const entryPointFileContentRelativeToConsumingProjectRootDirectory__forwardSlashesSeparatorsOnly = es_extensions_nodejs_1.ImprovedPath.computeRelativePath({
|
|
9866
9834
|
basePath: this.projectBuildingMasterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath,
|
|
9867
9835
|
comparedPath: processedEntryPointVinylFile.path,
|
|
9868
9836
|
alwaysForwardSlashSeparators: true
|
|
9869
9837
|
});
|
|
9838
|
+
/** @description
|
|
9839
|
+
* Pug gives neither good formatting nor good minification, thus the `stringifiedContents` is neither of.
|
|
9840
|
+
* Depending on the settings, the `stringifiedContents` must be formatted or minified. */
|
|
9870
9841
|
let semiFinishedHTML_Code = processedEntryPointVinylFile.stringifiedContents;
|
|
9871
9842
|
const semiFinishedHTML_CodeMD5_Checksum = (0, rev_hash_1.default)(semiFinishedHTML_Code);
|
|
9872
9843
|
let rootHTML_Element = (0, node_html_parser_1.parse)(semiFinishedHTML_Code);
|
|
@@ -9900,49 +9871,34 @@ class MarkupProcessor extends GulpStreamsBasedTaskExecutor_1.default {
|
|
|
9900
9871
|
}
|
|
9901
9872
|
let formattedHTML_CodeForReports = processedEntryPointVinylFile.actualEntryPointsGroupSettings.outputCodeFormatting.mustExecute ?
|
|
9902
9873
|
semiFinishedHTML_Code : null;
|
|
9903
|
-
if (
|
|
9904
|
-
|
|
9905
|
-
formattedHTML_CodeForReports
|
|
9906
|
-
|
|
9907
|
-
|
|
9908
|
-
|
|
9874
|
+
if (processedEntryPointVinylFile.actualEntryPointsGroupSettings.HTML_Validation.mustExecute) {
|
|
9875
|
+
formattedHTML_CodeForReports =
|
|
9876
|
+
formattedHTML_CodeForReports ??
|
|
9877
|
+
MarkupProcessor.formatHTML_Code(processedEntryPointVinylFile);
|
|
9878
|
+
HTML_Validator_1.default.enqueueFileForValidation({
|
|
9879
|
+
formattedHTML_Content: formattedHTML_CodeForReports,
|
|
9880
|
+
HTML_ContentMD5_Hash: semiFinishedHTML_CodeMD5_Checksum,
|
|
9881
|
+
pathRelativeToConsumingProjectRoot__forwardSlashesSeparatorsOnly: entryPointFileContentRelativeToConsumingProjectRootDirectory__forwardSlashesSeparatorsOnly
|
|
9882
|
+
});
|
|
9883
|
+
}
|
|
9884
|
+
if (processedEntryPointVinylFile.actualEntryPointsGroupSettings.accessibilityInspection.mustExecute) {
|
|
9885
|
+
formattedHTML_CodeForReports =
|
|
9886
|
+
formattedHTML_CodeForReports ??
|
|
9887
|
+
MarkupProcessor.formatHTML_Code(processedEntryPointVinylFile);
|
|
9888
|
+
if (this.projectBuildingMasterConfigRepresentative.mustProvideIncrementalBuilding) {
|
|
9889
|
+
AccessibilityInspector_1.default.inspectAtBackgroundAndReportImmediatelyWithoutThrowingOfErrors({
|
|
9909
9890
|
HTML_Code: formattedHTML_CodeForReports,
|
|
9910
9891
|
HTML_CodeMD5Checksum: semiFinishedHTML_CodeMD5_Checksum,
|
|
9911
|
-
|
|
9892
|
+
accessibilityStandard: processedEntryPointVinylFile.actualEntryPointsGroupSettings.accessibilityInspection.standard,
|
|
9893
|
+
targetHTML_FilePathRelativeToConsumingProjectRootDirectory: entryPointFileContentRelativeToConsumingProjectRootDirectory__forwardSlashesSeparatorsOnly
|
|
9912
9894
|
});
|
|
9913
9895
|
}
|
|
9914
|
-
|
|
9915
|
-
formattedHTML_CodeForReports =
|
|
9916
|
-
formattedHTML_CodeForReports ??
|
|
9917
|
-
MarkupProcessor.formatHTML_Code(processedEntryPointVinylFile);
|
|
9918
|
-
AccessibilityInspector_1.default.inspectAtBackgroundAndReportImmideatlyWithoutThrowingOfErrors({
|
|
9919
|
-
HTML_Code: formattedHTML_CodeForReports,
|
|
9920
|
-
HTML_CodeMD5Checksum: semiFinishedHTML_CodeMD5_Checksum,
|
|
9921
|
-
accessibilityStandard: processedEntryPointVinylFile.actualEntryPointsGroupSettings.accessibilityInspection.standard,
|
|
9922
|
-
targetHTML_FilePathRelativeToConsumingProjectRootDirectory: entryPointFileContentRelativeToConsumingProjectRootDirectory
|
|
9923
|
-
});
|
|
9924
|
-
}
|
|
9925
|
-
}
|
|
9926
|
-
else {
|
|
9927
|
-
if (processedEntryPointVinylFile.actualEntryPointsGroupSettings.HTML_Validation.mustExecute) {
|
|
9928
|
-
formattedHTML_CodeForReports =
|
|
9929
|
-
formattedHTML_CodeForReports ??
|
|
9930
|
-
MarkupProcessor.formatHTML_Code(processedEntryPointVinylFile);
|
|
9931
|
-
HTML_Validator_1.default.validateAtBackgroundWithoutReporting({
|
|
9932
|
-
HTML_Code: formattedHTML_CodeForReports,
|
|
9933
|
-
HTML_CodeMD5Checksum: semiFinishedHTML_CodeMD5_Checksum,
|
|
9934
|
-
targetHTML_FilePathRelativeToConsumingProjectRootDirectory: entryPointFileContentRelativeToConsumingProjectRootDirectory
|
|
9935
|
-
});
|
|
9936
|
-
}
|
|
9937
|
-
if (processedEntryPointVinylFile.actualEntryPointsGroupSettings.accessibilityInspection.mustExecute) {
|
|
9938
|
-
formattedHTML_CodeForReports =
|
|
9939
|
-
formattedHTML_CodeForReports ??
|
|
9940
|
-
MarkupProcessor.formatHTML_Code(processedEntryPointVinylFile);
|
|
9896
|
+
else {
|
|
9941
9897
|
AccessibilityInspector_1.default.inspectAtBackgroundWithoutReporting({
|
|
9942
9898
|
HTML_Code: formattedHTML_CodeForReports,
|
|
9943
9899
|
HTML_CodeMD5Checksum: semiFinishedHTML_CodeMD5_Checksum,
|
|
9944
9900
|
accessibilityStandard: processedEntryPointVinylFile.actualEntryPointsGroupSettings.accessibilityInspection.standard,
|
|
9945
|
-
targetHTML_FilePathRelativeToConsumingProjectRootDirectory:
|
|
9901
|
+
targetHTML_FilePathRelativeToConsumingProjectRootDirectory: entryPointFileContentRelativeToConsumingProjectRootDirectory__forwardSlashesSeparatorsOnly
|
|
9946
9902
|
});
|
|
9947
9903
|
}
|
|
9948
9904
|
}
|
|
@@ -9950,18 +9906,18 @@ class MarkupProcessor extends GulpStreamsBasedTaskExecutor_1.default {
|
|
|
9950
9906
|
return GulpStreamModifier_1.default.CompletionSignals.PASSING_ON;
|
|
9951
9907
|
}
|
|
9952
9908
|
onStreamEnded() {
|
|
9909
|
+
if (this.markupProcessingSettingsRepresentative.mustValidateHTML) {
|
|
9910
|
+
HTML_Validator_1.default.validateQueuedFilesButReportAll();
|
|
9911
|
+
}
|
|
9953
9912
|
if (!this.projectBuildingMasterConfigRepresentative.mustProvideIncrementalBuilding) {
|
|
9954
|
-
if (this.markupProcessingSettingsRepresentative.mustValidateHTML) {
|
|
9955
|
-
HTML_Validator_1.default.reportCachedValidationsResultsAndFinalize();
|
|
9956
|
-
}
|
|
9957
9913
|
if (this.markupProcessingSettingsRepresentative.mustInspectAccessibility) {
|
|
9958
9914
|
AccessibilityInspector_1.default.reportCachedValidationsResultsAndFinalize();
|
|
9959
9915
|
}
|
|
9960
9916
|
}
|
|
9961
9917
|
}
|
|
9962
9918
|
/* ━━━ Rebuilding ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
9963
|
-
onSourceFilesWatcherEmitsAnyEvent(
|
|
9964
|
-
this.absolutePathOfFilesWaitingForReProcessing.add(
|
|
9919
|
+
onSourceFilesWatcherEmitsAnyEvent(targetFileAbsolutePath__forwardSlashesSeparators) {
|
|
9920
|
+
this.absolutePathOfFilesWaitingForReProcessing.add(targetFileAbsolutePath__forwardSlashesSeparators);
|
|
9965
9921
|
if ((0, es_extensions_1.isNotNull)(this.subsequentFilesStateChangeTimeout)) {
|
|
9966
9922
|
clearTimeout(this.subsequentFilesStateChangeTimeout);
|
|
9967
9923
|
}
|
|
@@ -9970,106 +9926,13 @@ class MarkupProcessor extends GulpStreamsBasedTaskExecutor_1.default {
|
|
|
9970
9926
|
this.absolutePathOfFilesWaitingForReProcessing.clear();
|
|
9971
9927
|
}, (0, es_extensions_1.secondsToMilliseconds)(this.markupProcessingSettingsRepresentative.WAITING_FOR_SUBSEQUENT_FILES_WILL_SAVED_PERIOD__SECONDS));
|
|
9972
9928
|
}
|
|
9973
|
-
onEntryPointFileAdded(
|
|
9974
|
-
|
|
9975
|
-
markupProcessingSettingsRepresentative.
|
|
9976
|
-
getExpectedToExistEntryPointsGroupSettingsRelevantForSpecifiedSourceFileAbsolutePath(targetEntryPointFileAbsolutePath);
|
|
9977
|
-
const outputFileNameWithExtensionWithLeadingDot = this.
|
|
9978
|
-
markupProcessingSettingsRepresentative.
|
|
9979
|
-
computeOutputFileNameExtension({
|
|
9980
|
-
entryPointsGroupSettingsActualForTargetFile: markupEntryPointsGroupSettingsActualForCurrentFile,
|
|
9981
|
-
mustPrependDotToFileNameExtension: false
|
|
9982
|
-
});
|
|
9983
|
-
MarkupProcessingSharedState_1.default.
|
|
9984
|
-
entryPointsSourceAndOutputFilesAbsolutePathsCorrespondenceMap.
|
|
9985
|
-
set(targetEntryPointFileAbsolutePath, es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
9986
|
-
MarkupProcessingSettingsRepresentative_1.default.computeRelevantOutputDirectoryAbsolutePathForTargetSourceFile(targetEntryPointFileAbsolutePath, markupEntryPointsGroupSettingsActualForCurrentFile),
|
|
9987
|
-
`${(0, es_extensions_1.extractFileNameWithoutLastExtension)(targetEntryPointFileAbsolutePath)}.` +
|
|
9988
|
-
outputFileNameWithExtensionWithLeadingDot
|
|
9989
|
-
], { alwaysForwardSlashSeparators: true }));
|
|
9929
|
+
onEntryPointFileAdded(targetFileAbsolutePath__forwardSlashesSeparators) {
|
|
9930
|
+
MarkupProcessingSharedState_1.default.pagesVariationsMetadata.set(targetFileAbsolutePath__forwardSlashesSeparators, this.markupProcessingSettingsRepresentative.createPageVariationsMetadata(targetFileAbsolutePath__forwardSlashesSeparators));
|
|
9990
9931
|
}
|
|
9991
|
-
static onEntryPointFileDeleted(
|
|
9992
|
-
MarkupProcessingSharedState_1.default.
|
|
9993
|
-
entryPointsSourceAndOutputFilesAbsolutePathsCorrespondenceMap.
|
|
9994
|
-
delete(targetEntryPointFileAbsolutePath);
|
|
9932
|
+
static onEntryPointFileDeleted(targetFileAbsolutePath__forwardSlashesSeparators) {
|
|
9933
|
+
MarkupProcessingSharedState_1.default.pagesVariationsMetadata.delete(targetFileAbsolutePath__forwardSlashesSeparators);
|
|
9995
9934
|
}
|
|
9996
9935
|
/* ━━━ Helpers ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
9997
|
-
initializeSourceAndOutputFilesAbsolutePathsCorrespondenceMap() {
|
|
9998
|
-
const localeDependentPagesVariationsSettings = this.markupProcessingSettingsRepresentative.localeDependentPagesVariationsSettings;
|
|
9999
|
-
const localesData = localeDependentPagesVariationsSettings?.locales ?? new Map();
|
|
10000
|
-
for (const markupSourceFileAbsolutePath of es_extensions_nodejs_1.ImprovedGlob.getFilesAbsolutePathsSynchronously(this.markupProcessingSettingsRepresentative.initialRelevantEntryPointsSourceFilesAbsolutePaths, { alwaysForwardSlashSeparators: true })) {
|
|
10001
|
-
const areLocaleDependentVariationsRequiredForCurrentFile = localesData.size > 0 &&
|
|
10002
|
-
localeDependentPagesVariationsSettings?.excludedFilesAbsolutePaths.includes(markupSourceFileAbsolutePath) === false;
|
|
10003
|
-
const markupEntryPointsGroupSettingsActualForCurrentFile = this.markupProcessingSettingsRepresentative.
|
|
10004
|
-
getExpectedToExistEntryPointsGroupSettingsRelevantForSpecifiedSourceFileAbsolutePath(markupSourceFileAbsolutePath);
|
|
10005
|
-
const outputFileNameWithLastExtensionWithLeadingDot = this.markupProcessingSettingsRepresentative.
|
|
10006
|
-
computeOutputFileNameExtension({
|
|
10007
|
-
entryPointsGroupSettingsActualForTargetFile: markupEntryPointsGroupSettingsActualForCurrentFile,
|
|
10008
|
-
mustPrependDotToFileNameExtension: false
|
|
10009
|
-
});
|
|
10010
|
-
const outputDirectoryForCurrentMarkupFileAndDerivedOnes = MarkupProcessingSettingsRepresentative_1.default.
|
|
10011
|
-
computeRelevantOutputDirectoryAbsolutePathForTargetSourceFile(markupSourceFileAbsolutePath, markupEntryPointsGroupSettingsActualForCurrentFile);
|
|
10012
|
-
if (areLocaleDependentVariationsRequiredForCurrentFile) {
|
|
10013
|
-
for (const localeData of localesData.values()) {
|
|
10014
|
-
MarkupProcessingSharedState_1.default.
|
|
10015
|
-
entryPointsSourceAndOutputFilesAbsolutePathsCorrespondenceMap.
|
|
10016
|
-
set((0, addPenultimateFileNameExtension_1.default)({
|
|
10017
|
-
targetPath: markupSourceFileAbsolutePath,
|
|
10018
|
-
targetFileNamePenultimateExtensionWithOrWithoutLeadingDot: localeData.outputFileInterimNameExtensionWithoutDot,
|
|
10019
|
-
mustAppendDuplicateEvenIfTargetPenultimateFileNameExtensionAlreadyExist: true,
|
|
10020
|
-
mustAppendLastFileNameExtensionInsteadIfThereIsNoOne: true
|
|
10021
|
-
}), es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
10022
|
-
outputDirectoryForCurrentMarkupFileAndDerivedOnes,
|
|
10023
|
-
[
|
|
10024
|
-
(0, es_extensions_1.extractFileNameWithoutLastExtension)(markupSourceFileAbsolutePath),
|
|
10025
|
-
localeData.outputFileInterimNameExtensionWithoutDot,
|
|
10026
|
-
outputFileNameWithLastExtensionWithLeadingDot
|
|
10027
|
-
].join(".")
|
|
10028
|
-
], { alwaysForwardSlashSeparators: true }));
|
|
10029
|
-
}
|
|
10030
|
-
}
|
|
10031
|
-
else {
|
|
10032
|
-
MarkupProcessingSharedState_1.default.
|
|
10033
|
-
entryPointsSourceAndOutputFilesAbsolutePathsCorrespondenceMap.
|
|
10034
|
-
set(markupSourceFileAbsolutePath, es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
10035
|
-
outputDirectoryForCurrentMarkupFileAndDerivedOnes,
|
|
10036
|
-
`${(0, es_extensions_1.extractFileNameWithoutLastExtension)(markupSourceFileAbsolutePath)}.` +
|
|
10037
|
-
outputFileNameWithLastExtensionWithLeadingDot
|
|
10038
|
-
], { alwaysForwardSlashSeparators: true }));
|
|
10039
|
-
}
|
|
10040
|
-
const entryPointStateDependentVariations = this.markupProcessingSettingsRepresentative.
|
|
10041
|
-
getStateDependentVariationsForEntryPointWithAbsolutePath(markupSourceFileAbsolutePath);
|
|
10042
|
-
for (const derivedSourceFileAbsolutePath of (entryPointStateDependentVariations?.derivedPagesAndStatesMap ?? new Map()).keys()) {
|
|
10043
|
-
if (areLocaleDependentVariationsRequiredForCurrentFile) {
|
|
10044
|
-
for (const localeData of localesData.values()) {
|
|
10045
|
-
MarkupProcessingSharedState_1.default.
|
|
10046
|
-
entryPointsSourceAndOutputFilesAbsolutePathsCorrespondenceMap.
|
|
10047
|
-
set((0, addPenultimateFileNameExtension_1.default)({
|
|
10048
|
-
targetPath: derivedSourceFileAbsolutePath,
|
|
10049
|
-
targetFileNamePenultimateExtensionWithOrWithoutLeadingDot: localeData.outputFileInterimNameExtensionWithoutDot,
|
|
10050
|
-
mustAppendDuplicateEvenIfTargetPenultimateFileNameExtensionAlreadyExist: true,
|
|
10051
|
-
mustAppendLastFileNameExtensionInsteadIfThereIsNoOne: true
|
|
10052
|
-
}), es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
10053
|
-
outputDirectoryForCurrentMarkupFileAndDerivedOnes,
|
|
10054
|
-
[
|
|
10055
|
-
(0, es_extensions_1.extractFileNameWithoutLastExtension)(derivedSourceFileAbsolutePath),
|
|
10056
|
-
localeData.outputFileInterimNameExtensionWithoutDot,
|
|
10057
|
-
"html"
|
|
10058
|
-
].join(".")
|
|
10059
|
-
], { alwaysForwardSlashSeparators: true }));
|
|
10060
|
-
}
|
|
10061
|
-
}
|
|
10062
|
-
else {
|
|
10063
|
-
MarkupProcessingSharedState_1.default.
|
|
10064
|
-
entryPointsSourceAndOutputFilesAbsolutePathsCorrespondenceMap.
|
|
10065
|
-
set(derivedSourceFileAbsolutePath, es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
10066
|
-
outputDirectoryForCurrentMarkupFileAndDerivedOnes,
|
|
10067
|
-
`${(0, es_extensions_1.extractFileNameWithoutLastExtension)(derivedSourceFileAbsolutePath)}.html`
|
|
10068
|
-
], { alwaysForwardSlashSeparators: true }));
|
|
10069
|
-
}
|
|
10070
|
-
}
|
|
10071
|
-
}
|
|
10072
|
-
}
|
|
10073
9936
|
static formatHTML_Code(markupVinylFile) {
|
|
10074
9937
|
const { outputCodeFormatting: outputCodeFormattingSettings } = markupVinylFile.actualEntryPointsGroupSettings;
|
|
10075
9938
|
return js_beautify_1.default.html(markupVinylFile.stringifiedContents, {
|
|
@@ -10277,13 +10140,13 @@ class AccessibilityInspector {
|
|
|
10277
10140
|
}
|
|
10278
10141
|
/* ─── Inspection ───────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
10279
10142
|
/** @description Designed for the modes with incremental building. */
|
|
10280
|
-
static
|
|
10143
|
+
static inspectAtBackgroundAndReportImmediatelyWithoutThrowingOfErrors(singleFileAccessibilityCheckingOrder) {
|
|
10281
10144
|
AccessibilityInspector.getInstanceOnceReady().
|
|
10282
10145
|
then(async (selfSoleInstance) => {
|
|
10283
10146
|
clearTimeout((0, es_extensions_1.nullToUndefined)(selfSoleInstance.waitingForStaringOfWritingOfCacheFileWithInspectionsResults));
|
|
10284
10147
|
return selfSoleInstance.inspectSingleFile({
|
|
10285
10148
|
...singleFileAccessibilityCheckingOrder,
|
|
10286
|
-
|
|
10149
|
+
mustLogIssuesImmediatelyAndSaveCacheToFileDuringDowntime: true
|
|
10287
10150
|
});
|
|
10288
10151
|
}).
|
|
10289
10152
|
catch((error) => {
|
|
@@ -10294,7 +10157,7 @@ class AccessibilityInspector {
|
|
|
10294
10157
|
description: "The error has been caught during the execution of asynchronous method \"inspectSingleFile\", " +
|
|
10295
10158
|
"while expected that all errors has been handled inside this method.",
|
|
10296
10159
|
occurrenceLocation: "AccessibilityInspector." +
|
|
10297
|
-
"
|
|
10160
|
+
"inspectAtBackgroundAndReportImmediatelyWithoutThrowingOfErrors(singleFileAccessibilityCheckingOrder)",
|
|
10298
10161
|
caughtError: error
|
|
10299
10162
|
});
|
|
10300
10163
|
}
|
|
@@ -10306,7 +10169,7 @@ class AccessibilityInspector {
|
|
|
10306
10169
|
then((selfSoleInstance) => {
|
|
10307
10170
|
selfSoleInstance.inspectionsInProgressForProductionLikeModes.push(selfSoleInstance.inspectSingleFile({
|
|
10308
10171
|
...singleFileAccessibilityCheckingOrder,
|
|
10309
|
-
|
|
10172
|
+
mustLogIssuesImmediatelyAndSaveCacheToFileDuringDowntime: false
|
|
10310
10173
|
}));
|
|
10311
10174
|
}).
|
|
10312
10175
|
catch((error) => {
|
|
@@ -10393,12 +10256,12 @@ class AccessibilityInspector {
|
|
|
10393
10256
|
this.logging = logging;
|
|
10394
10257
|
}
|
|
10395
10258
|
/* ━━━ Private methods ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
10396
|
-
async inspectSingleFile({ HTML_Code, HTML_CodeMD5Checksum, targetHTML_FilePathRelativeToConsumingProjectRootDirectory, accessibilityStandard,
|
|
10259
|
+
async inspectSingleFile({ HTML_Code, HTML_CodeMD5Checksum, targetHTML_FilePathRelativeToConsumingProjectRootDirectory, accessibilityStandard, mustLogIssuesImmediatelyAndSaveCacheToFileDuringDowntime }) {
|
|
10397
10260
|
const cachedInspectionsResultsForCurrentFile = this.cachedInspectionsResults.get(targetHTML_FilePathRelativeToConsumingProjectRootDirectory);
|
|
10398
10261
|
if (cachedInspectionsResultsForCurrentFile?.contentMD5Checksum === HTML_CodeMD5Checksum) {
|
|
10399
10262
|
this.relativePathsOfFilesWhichHasBeenInspectedCurrentDuringExecution.
|
|
10400
10263
|
add(targetHTML_FilePathRelativeToConsumingProjectRootDirectory);
|
|
10401
|
-
if (
|
|
10264
|
+
if (mustLogIssuesImmediatelyAndSaveCacheToFileDuringDowntime) {
|
|
10402
10265
|
this.logInspectionResultsForSingleFile({
|
|
10403
10266
|
targetHTML_FilePathRelativeToConsumingProjectRootDirectory,
|
|
10404
10267
|
normalizedInspectionIssues: cachedInspectionsResultsForCurrentFile.issues
|
|
@@ -10422,7 +10285,7 @@ class AccessibilityInspector {
|
|
|
10422
10285
|
}));
|
|
10423
10286
|
}
|
|
10424
10287
|
const inspectionTimeMeasuringStopwatch = new Stopwatch_1.default().startOrRestart();
|
|
10425
|
-
if (
|
|
10288
|
+
if (mustLogIssuesImmediatelyAndSaveCacheToFileDuringDowntime) {
|
|
10426
10289
|
this.relativePathsOfFilesWhichIsBeingInspected.add(targetHTML_FilePathRelativeToConsumingProjectRootDirectory);
|
|
10427
10290
|
}
|
|
10428
10291
|
let webBrowserPage;
|
|
@@ -10440,7 +10303,7 @@ class AccessibilityInspector {
|
|
|
10440
10303
|
occurrenceLocation: "AccessibilityInspector.inspectSingleFile(singleFileAccessibilityCheckingOrder)",
|
|
10441
10304
|
caughtError: error
|
|
10442
10305
|
});
|
|
10443
|
-
if (
|
|
10306
|
+
if (mustLogIssuesImmediatelyAndSaveCacheToFileDuringDowntime) {
|
|
10444
10307
|
this.relativePathsOfFilesWhichIsBeingInspected.delete(targetHTML_FilePathRelativeToConsumingProjectRootDirectory);
|
|
10445
10308
|
}
|
|
10446
10309
|
return;
|
|
@@ -10459,7 +10322,7 @@ class AccessibilityInspector {
|
|
|
10459
10322
|
occurrenceLocation: "AccessibilityInspector.inspectSingleFile(singleFileAccessibilityCheckingOrder)",
|
|
10460
10323
|
caughtError: error
|
|
10461
10324
|
});
|
|
10462
|
-
if (
|
|
10325
|
+
if (mustLogIssuesImmediatelyAndSaveCacheToFileDuringDowntime) {
|
|
10463
10326
|
this.relativePathsOfFilesWhichIsBeingInspected.delete(targetHTML_FilePathRelativeToConsumingProjectRootDirectory);
|
|
10464
10327
|
}
|
|
10465
10328
|
return;
|
|
@@ -10471,7 +10334,14 @@ class AccessibilityInspector {
|
|
|
10471
10334
|
page: webBrowserPage,
|
|
10472
10335
|
browser: this.webBrowser,
|
|
10473
10336
|
/* [ Reference ] https://stackoverflow.com/a/76537290/4818123 */
|
|
10474
|
-
ignoreUrl: true
|
|
10337
|
+
ignoreUrl: true,
|
|
10338
|
+
ignore: [
|
|
10339
|
+
/* [ Specification ]
|
|
10340
|
+
* Being the part of markup processing functionality, the AccessibilityInspector indented to be used only for
|
|
10341
|
+
* inspection of the accessibility of HTML code. The issues like contract ratio could not be simply fixed
|
|
10342
|
+
* because requires the involving of designer and/or customer.. */
|
|
10343
|
+
"WCAG2AAA.Principle1.Guideline1_4.1_4_6.G17.Fail"
|
|
10344
|
+
]
|
|
10475
10345
|
});
|
|
10476
10346
|
}
|
|
10477
10347
|
catch (error) {
|
|
@@ -10482,7 +10352,7 @@ class AccessibilityInspector {
|
|
|
10482
10352
|
occurrenceLocation: "AccessibilityInspector.inspectSingleFile(singleFileAccessibilityCheckingOrder)",
|
|
10483
10353
|
caughtError: error
|
|
10484
10354
|
});
|
|
10485
|
-
if (
|
|
10355
|
+
if (mustLogIssuesImmediatelyAndSaveCacheToFileDuringDowntime) {
|
|
10486
10356
|
this.relativePathsOfFilesWhichIsBeingInspected.delete(targetHTML_FilePathRelativeToConsumingProjectRootDirectory);
|
|
10487
10357
|
}
|
|
10488
10358
|
webBrowserPage.close().catch((potentialWebBrowserPageClosingError) => {
|
|
@@ -10508,7 +10378,7 @@ class AccessibilityInspector {
|
|
|
10508
10378
|
});
|
|
10509
10379
|
this.relativePathsOfFilesWhichHasBeenInspectedCurrentDuringExecution.
|
|
10510
10380
|
add(targetHTML_FilePathRelativeToConsumingProjectRootDirectory);
|
|
10511
|
-
if (!
|
|
10381
|
+
if (!mustLogIssuesImmediatelyAndSaveCacheToFileDuringDowntime) {
|
|
10512
10382
|
return;
|
|
10513
10383
|
}
|
|
10514
10384
|
this.relativePathsOfFilesWhichIsBeingInspected.delete(targetHTML_FilePathRelativeToConsumingProjectRootDirectory);
|
|
@@ -10680,8 +10550,8 @@ class AccessibilityInspector {
|
|
|
10680
10550
|
})}\n`,
|
|
10681
10551
|
...(0, es_extensions_1.isNonEmptyString)(issue.codeFragment.beforeHighlighting) ? [issue.codeFragment.beforeHighlighting] : [],
|
|
10682
10552
|
...(0, es_extensions_1.isNonEmptyString)(issue.codeFragment.beforeHighlighting) && (0, es_extensions_1.isNonEmptyString)(issue.codeFragment.afterHighlighting) ?
|
|
10683
|
-
es_extensions_1.Logger.highlightText(issue.codeFragment.highlighted) :
|
|
10684
|
-
issue.codeFragment.highlighted,
|
|
10553
|
+
[es_extensions_1.Logger.highlightText(issue.codeFragment.highlighted)] :
|
|
10554
|
+
[issue.codeFragment.highlighted],
|
|
10685
10555
|
...(0, es_extensions_1.isNonEmptyString)(issue.codeFragment.afterHighlighting) ? [issue.codeFragment.afterHighlighting] : [],
|
|
10686
10556
|
"\n",
|
|
10687
10557
|
`${"-".repeat(AccessibilityInspector.DISPLAYING_MAXIMAL_COLUMNS_COUNT_IN_LOG)}\n`,
|
|
@@ -10896,72 +10766,42 @@ exports["default"] = accessibilityInspectorLocalization__english;
|
|
|
10896
10766
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
10897
10767
|
|
|
10898
10768
|
|
|
10899
|
-
/* eslint-disable @typescript-eslint/member-ordering --
|
|
10900
|
-
* There is the processing order herewith some methods required the accessing to non-static fields, some - not. */
|
|
10901
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10902
|
-
if (k2 === undefined) k2 = k;
|
|
10903
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10904
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10905
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10906
|
-
}
|
|
10907
|
-
Object.defineProperty(o, k2, desc);
|
|
10908
|
-
}) : (function(o, m, k, k2) {
|
|
10909
|
-
if (k2 === undefined) k2 = k;
|
|
10910
|
-
o[k2] = m[k];
|
|
10911
|
-
}));
|
|
10912
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10913
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
10914
|
-
}) : function(o, v) {
|
|
10915
|
-
o["default"] = v;
|
|
10916
|
-
});
|
|
10917
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
10918
|
-
var ownKeys = function(o) {
|
|
10919
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
10920
|
-
var ar = [];
|
|
10921
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
10922
|
-
return ar;
|
|
10923
|
-
};
|
|
10924
|
-
return ownKeys(o);
|
|
10925
|
-
};
|
|
10926
|
-
return function (mod) {
|
|
10927
|
-
if (mod && mod.__esModule) return mod;
|
|
10928
|
-
var result = {};
|
|
10929
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
10930
|
-
__setModuleDefault(result, mod);
|
|
10931
|
-
return result;
|
|
10932
|
-
};
|
|
10933
|
-
})();
|
|
10769
|
+
/* eslint-disable @typescript-eslint/member-ordering -- Sorted by semantic categories. */
|
|
10934
10770
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10935
10771
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10936
10772
|
};
|
|
10937
10773
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10938
|
-
/* ━━━ Imports ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
10939
10774
|
/* ─── Assets ────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
10940
10775
|
const HTML_ValidatorLocalization_english_1 = __importDefault(__webpack_require__(/*! ./HTML_ValidatorLocalization.english */ "./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_ValidatorLocalization.english.ts"));
|
|
10941
|
-
/* ───
|
|
10776
|
+
/* ─── Applied Utils ──────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
10777
|
+
const vnu_jar_1 = __importDefault(__webpack_require__(/*! vnu-jar */ "vnu-jar"));
|
|
10778
|
+
const DotYDA_DirectoryManager_1 = __importDefault(__webpack_require__(/*! @Utils/DotYDA_DirectoryManager */ "./Utils/DotYDA_DirectoryManager.ts"));
|
|
10779
|
+
/* ─── Generals Utils ─────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
10942
10780
|
const fs_1 = __importDefault(__webpack_require__(/*! fs */ "fs"));
|
|
10781
|
+
const node_child_process_1 = __importDefault(__webpack_require__(/*! node:child_process */ "node:child_process"));
|
|
10782
|
+
const node_notifier_1 = __importDefault(__webpack_require__(/*! node-notifier */ "node-notifier"));
|
|
10943
10783
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
10944
10784
|
const es_extensions_nodejs_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions-nodejs */ "@yamato-daiwa/es-extensions-nodejs");
|
|
10945
|
-
const
|
|
10946
|
-
const node_notifier_1 = __importDefault(__webpack_require__(/*! node-notifier */ "node-notifier"));
|
|
10785
|
+
const nanoid_1 = __webpack_require__(/*! nanoid */ "nanoid");
|
|
10947
10786
|
class HTML_Validator {
|
|
10948
10787
|
/* ━━━ Fields ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
10949
|
-
|
|
10950
|
-
|
|
10951
|
-
|
|
10952
|
-
/* ───
|
|
10953
|
-
|
|
10954
|
-
static
|
|
10955
|
-
static
|
|
10788
|
+
static selfSingleInstance = null;
|
|
10789
|
+
/* ─── Work Variables ───────────────────────────────────────────────────────────────────────────────────────────── */
|
|
10790
|
+
queuedFilesMetadata = [];
|
|
10791
|
+
/* ─── Logging ──────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
10792
|
+
logging;
|
|
10793
|
+
static DISPLAYING_LINES_COUNT_BEFORE_ISSUE_IN_CODE_LISTING = 2;
|
|
10794
|
+
static DISPLAYING_LINES_COUNT_AFTER_ISSUE_IN_CODE_LISTING = 1;
|
|
10795
|
+
/* [ Theory ] 120 columns is about the half of the 1920x1080 screen. */
|
|
10796
|
+
static DISPLAYING_MAXIMAL_COLUMNS_COUNT_IN_LOG = 120;
|
|
10956
10797
|
/* ─── Caching ──────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
10957
|
-
/* [ Theory ]
|
|
10958
|
-
*
|
|
10959
|
-
*
|
|
10960
|
-
|
|
10798
|
+
/* [ Theory ]
|
|
10799
|
+
* Between 2 project buildings, the content of most HTML files could not change (especially since the project has
|
|
10800
|
+
* become mature). */
|
|
10801
|
+
static CACHED_HTML_VALIDATION_RESULTS_DIRECTORY_NAME = "HTML_Validation";
|
|
10961
10802
|
CACHED_VALIDATIONS_RESULTS_FILE_PARENT_DIRECTORY_ABSOLUTE_PATH;
|
|
10962
10803
|
CACHED_VALIDATIONS_RESULTS_FILE_ABSOLUTE_PATH;
|
|
10963
10804
|
cachedValidationsResults;
|
|
10964
|
-
relativePathsOfFilesWhichHasBeenValidatedDuringCurrentExecution = new Set();
|
|
10965
10805
|
static cachedValidationsResultsFileContentSpecification = {
|
|
10966
10806
|
nameForLogging: "HTML_Validator.CachedValidationResultsFileContentSpecification",
|
|
10967
10807
|
subtype: es_extensions_1.RawObjectDataProcessor.ObjectSubtypes.associativeArray,
|
|
@@ -11031,339 +10871,417 @@ class HTML_Validator {
|
|
|
11031
10871
|
}
|
|
11032
10872
|
}
|
|
11033
10873
|
};
|
|
11034
|
-
|
|
11035
|
-
|
|
11036
|
-
|
|
11037
|
-
|
|
11038
|
-
|
|
11039
|
-
|
|
11040
|
-
|
|
11041
|
-
|
|
11042
|
-
|
|
11043
|
-
|
|
11044
|
-
|
|
11045
|
-
|
|
10874
|
+
/* ─── Raw Validations Results Specification (Third-party Library Dependent) ────────────────────────────────────── */
|
|
10875
|
+
/** @description
|
|
10876
|
+
* ● The NuChecker output could change with new versions. The validation allows to be notified about them soon.
|
|
10877
|
+
* ● Being defined in third-parry solution, the following properties could not be renamed to more clear ones during
|
|
10878
|
+
* data reading.
|
|
10879
|
+
* ● The order of properties has been matched with output of parsed JSON to console. */
|
|
10880
|
+
static validationsResultsSpecification = {
|
|
10881
|
+
nameForLogging: "Nu HTML Checker (v.Nu) Output",
|
|
10882
|
+
subtype: es_extensions_1.RawObjectDataProcessor.ObjectSubtypes.fixedKeyAndValuePairsObject,
|
|
10883
|
+
properties: {
|
|
10884
|
+
messages: {
|
|
10885
|
+
type: Array,
|
|
10886
|
+
required: true,
|
|
10887
|
+
element: {
|
|
10888
|
+
type: Object,
|
|
10889
|
+
properties: {
|
|
10890
|
+
type: {
|
|
10891
|
+
type: String,
|
|
10892
|
+
required: true,
|
|
10893
|
+
allowedAlternatives: ["info", "error", "non-document-error", "network-error"]
|
|
10894
|
+
},
|
|
10895
|
+
url: {
|
|
10896
|
+
type: String,
|
|
10897
|
+
required: true,
|
|
10898
|
+
minimalCharactersCount: 7
|
|
10899
|
+
},
|
|
10900
|
+
lastLine: {
|
|
10901
|
+
type: Number,
|
|
10902
|
+
required: false,
|
|
10903
|
+
numbersSet: es_extensions_1.RawObjectDataProcessor.NumbersSets.naturalNumber
|
|
10904
|
+
},
|
|
10905
|
+
lastColumn: {
|
|
10906
|
+
type: Number,
|
|
10907
|
+
required: false,
|
|
10908
|
+
numbersSet: es_extensions_1.RawObjectDataProcessor.NumbersSets.naturalNumber
|
|
10909
|
+
},
|
|
10910
|
+
firstColumn: {
|
|
10911
|
+
type: Number,
|
|
10912
|
+
required: false,
|
|
10913
|
+
numbersSet: es_extensions_1.RawObjectDataProcessor.NumbersSets.naturalNumber
|
|
10914
|
+
},
|
|
10915
|
+
subType: {
|
|
10916
|
+
type: String,
|
|
10917
|
+
required: false,
|
|
10918
|
+
allowedAlternatives: ["warning", "fatal", "io", "schema", "internal"]
|
|
10919
|
+
},
|
|
10920
|
+
message: {
|
|
10921
|
+
type: String,
|
|
10922
|
+
required: true,
|
|
10923
|
+
minimalCharactersCount: 1
|
|
10924
|
+
},
|
|
10925
|
+
extract: {
|
|
10926
|
+
type: String,
|
|
10927
|
+
required: false
|
|
10928
|
+
},
|
|
10929
|
+
hiliteStart: {
|
|
10930
|
+
type: Number,
|
|
10931
|
+
required: false,
|
|
10932
|
+
numbersSet: es_extensions_1.RawObjectDataProcessor.NumbersSets.naturalNumber
|
|
10933
|
+
},
|
|
10934
|
+
hiliteLength: {
|
|
10935
|
+
type: Number,
|
|
10936
|
+
required: false,
|
|
10937
|
+
numbersSet: es_extensions_1.RawObjectDataProcessor.NumbersSets.naturalNumber
|
|
10938
|
+
}
|
|
10939
|
+
}
|
|
10940
|
+
}
|
|
10941
|
+
}
|
|
10942
|
+
}
|
|
10943
|
+
};
|
|
10944
|
+
/* ─── Temporary Files ──────────────────────────────────────────────────────────────────────────────────────────── */
|
|
10945
|
+
static TEMPORARY_FORMATTED_HTML_FILES_FOLDER_NAME = "HTML_Validation";
|
|
10946
|
+
TEMPORARY_FORMATTED_HTML_FILES_DIRECTORY_ABSOLUTE_PATH;
|
|
10947
|
+
TEMPORARY_FORMATTED_HTML_FILES_DIRECTORY_PATH_RELATIVE_TO_CONSUMING_PROJECT_ROOT;
|
|
10948
|
+
CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH;
|
|
11046
10949
|
/* ─── Localization ─────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
11047
10950
|
static localization = HTML_ValidatorLocalization_english_1.default;
|
|
11048
|
-
/* ━━━ Public
|
|
11049
|
-
|
|
11050
|
-
|
|
11051
|
-
static beginInitialization(configuration) {
|
|
11052
|
-
HTML_Validator.hasInitializationStarted = true;
|
|
11053
|
-
const cachedValidationsResultsFileAbsolutePath = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
11054
|
-
configuration.cachedValidationsResultsFileParentDirectoryAbsolutePath,
|
|
11055
|
-
"HTML_Validation." +
|
|
11056
|
-
(0, es_extensions_1.insertSubstring)(configuration.projectBuildingSelectiveExecutionID, { modifier: (projectBuildingSelectiveExecutionID) => `${projectBuildingSelectiveExecutionID}.` }) +
|
|
11057
|
-
`${(0, es_extensions_1.toLowerCamelCase)(configuration.consumingProjectBuildingMode)}.json`
|
|
11058
|
-
]);
|
|
11059
|
-
Promise.all([
|
|
11060
|
-
Promise.resolve().then(() => __importStar(__webpack_require__(/*! w3c-html-validator */ "../node_modules/w3c-html-validator/dist/w3c-html-validator.js"))),
|
|
11061
|
-
HTML_Validator.retrieveCachedPastValidationsResultsFromFileIfItExists({
|
|
11062
|
-
cachedValidationsResultsFileAbsolutePath,
|
|
11063
|
-
cachedValidationsResultsDirectoryAbsolutePath: configuration.cachedValidationsResultsFileParentDirectoryAbsolutePath
|
|
11064
|
-
})
|
|
11065
|
-
]).
|
|
11066
|
-
then(([dynamicallyLoadedHTML_ValidatorModule, cachedValidationsResults]) => {
|
|
11067
|
-
HTML_Validator.selfSoleInstance = new HTML_Validator({
|
|
11068
|
-
HTML_ValidationService: dynamicallyLoadedHTML_ValidatorModule.w3cHtmlValidator,
|
|
11069
|
-
cachedValidationsResults,
|
|
11070
|
-
cachedValidationsResultsFileAbsolutePath,
|
|
11071
|
-
...configuration
|
|
11072
|
-
});
|
|
11073
|
-
this.onSelfSoleInstanceReady(HTML_Validator.selfSoleInstance);
|
|
11074
|
-
}).
|
|
11075
|
-
catch((error) => {
|
|
10951
|
+
/* ━━━ Public Static Methods (Facade) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
10952
|
+
static initialize(requirements) {
|
|
10953
|
+
if ((0, es_extensions_1.isNotNull)(HTML_Validator.selfSingleInstance)) {
|
|
11076
10954
|
es_extensions_1.Logger.logError({
|
|
11077
|
-
errorType: es_extensions_1.
|
|
11078
|
-
title: es_extensions_1.
|
|
11079
|
-
description:
|
|
11080
|
-
|
|
11081
|
-
|
|
11082
|
-
|
|
11083
|
-
|
|
11084
|
-
}
|
|
11085
|
-
/* ─── Validation ───────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
11086
|
-
/** @description Designed for the modes with incremental building. */
|
|
11087
|
-
static validateAtBackgroundAndReportImmideatlyWithoutThrowingOfErrors(singleFileHTML_ValidationOrder) {
|
|
11088
|
-
HTML_Validator.getInstanceOnceReady().
|
|
11089
|
-
then(async (selfSoleInstance) => {
|
|
11090
|
-
clearTimeout((0, es_extensions_1.nullToUndefined)(selfSoleInstance.waitingForStaringOfWritingOfCacheFileWithValidationsResults));
|
|
11091
|
-
return selfSoleInstance.validateSingleFile({
|
|
11092
|
-
...singleFileHTML_ValidationOrder,
|
|
11093
|
-
mustLogIssuesImmideatlyAndSaveCacheToFileDuringDowntime: true
|
|
10955
|
+
errorType: es_extensions_1.ClassRedundantSubsequentInitializationError.NAME,
|
|
10956
|
+
title: es_extensions_1.ClassRedundantSubsequentInitializationError.localization.defaultTitle,
|
|
10957
|
+
description: es_extensions_1.ClassRedundantSubsequentInitializationError.localization.generateDescription({
|
|
10958
|
+
className: "HTML_Validator"
|
|
10959
|
+
}),
|
|
10960
|
+
occurrenceLocation: "HTML_Validator.initialize(configuration)",
|
|
10961
|
+
mustOutputIf: true
|
|
11094
10962
|
});
|
|
11095
|
-
|
|
11096
|
-
|
|
11097
|
-
|
|
11098
|
-
es_extensions_1.Logger.logError({
|
|
11099
|
-
errorType: es_extensions_1.AlgorithmMismatchError.NAME,
|
|
11100
|
-
title: es_extensions_1.AlgorithmMismatchError.localization.defaultTitle,
|
|
11101
|
-
description: "The error has been caught during the execution of asynchronous method \"validateSingleFile\", " +
|
|
11102
|
-
"while expected that all errors has been handled inside this method.",
|
|
11103
|
-
occurrenceLocation: "HTML_Validator." +
|
|
11104
|
-
"validateAtBackgroundAndReportImmideatlyWithoutThrowingOfErrors(singleFileHTML_ValidationOrder)",
|
|
11105
|
-
caughtError: error
|
|
11106
|
-
});
|
|
11107
|
-
}
|
|
11108
|
-
});
|
|
10963
|
+
return;
|
|
10964
|
+
}
|
|
10965
|
+
HTML_Validator.selfSingleInstance = new HTML_Validator(requirements);
|
|
11109
10966
|
}
|
|
11110
|
-
|
|
11111
|
-
|
|
11112
|
-
|
|
11113
|
-
|
|
11114
|
-
selfSoleInstance.validationsInProgressForProductionLikeModes.push(selfSoleInstance.validateSingleFile({
|
|
11115
|
-
...singleFileHTML_ValidationOrder,
|
|
11116
|
-
mustLogIssuesImmideatlyAndSaveCacheToFileDuringDowntime: false
|
|
11117
|
-
}));
|
|
11118
|
-
}).
|
|
11119
|
-
catch((error) => {
|
|
11120
|
-
if (true) {
|
|
11121
|
-
es_extensions_1.Logger.logError({
|
|
11122
|
-
errorType: es_extensions_1.AlgorithmMismatchError.NAME,
|
|
11123
|
-
title: es_extensions_1.AlgorithmMismatchError.localization.defaultTitle,
|
|
11124
|
-
description: "The error has been caught during the execution of asynchronous method \"validateSingleFile\", " +
|
|
11125
|
-
"while expected that all errors has been handled inside this method.",
|
|
11126
|
-
occurrenceLocation: "HTML_Validator." +
|
|
11127
|
-
"validateAtBackgroundAndReportImmideatlyWithoutThrowingOfErrors(singleFileHTML_ValidationOrder)",
|
|
11128
|
-
caughtError: error
|
|
11129
|
-
});
|
|
11130
|
-
}
|
|
11131
|
-
});
|
|
10967
|
+
static enqueueFileForValidation(targetFileMetadata) {
|
|
10968
|
+
const selfSingleInstance = HTML_Validator.
|
|
10969
|
+
getExpectedToBeInitializedSelfSingleInstance();
|
|
10970
|
+
selfSingleInstance.queuedFilesMetadata.push(targetFileMetadata);
|
|
11132
10971
|
}
|
|
11133
|
-
static
|
|
10972
|
+
static validateQueuedFilesButReportAll() {
|
|
11134
10973
|
HTML_Validator.
|
|
11135
|
-
|
|
11136
|
-
|
|
11137
|
-
|
|
11138
|
-
|
|
11139
|
-
|
|
11140
|
-
|
|
11141
|
-
|
|
11142
|
-
|
|
11143
|
-
|
|
11144
|
-
|
|
11145
|
-
|
|
11146
|
-
|
|
11147
|
-
|
|
11148
|
-
|
|
11149
|
-
|
|
11150
|
-
|
|
11151
|
-
|
|
11152
|
-
|
|
11153
|
-
|
|
11154
|
-
|
|
11155
|
-
|
|
11156
|
-
|
|
11157
|
-
|
|
11158
|
-
es_extensions_1.Logger.logErrorLikeMessage({
|
|
11159
|
-
title: HTML_Validator.localization.issuesFoundInOneOrMultipleFilesErrorLog.title,
|
|
11160
|
-
description: `\n${HTML_ValidityIssuesLogForEachFile.join("\n")}`
|
|
11161
|
-
});
|
|
11162
|
-
es_extensions_1.Logger.throwErrorAndLog({
|
|
11163
|
-
errorType: "InvalidHTMLCode_Error",
|
|
11164
|
-
...HTML_Validator.localization.issuesFoundInOneOrMultipleFilesErrorLog,
|
|
11165
|
-
occurrenceLocation: "HTML_Validator.reportCachedResultAndWriteItToFile"
|
|
10974
|
+
getExpectedToBeInitializedSelfSingleInstance().
|
|
10975
|
+
validateQueuedFilesButReportAll().
|
|
10976
|
+
catch(es_extensions_1.Logger.logPromiseError);
|
|
10977
|
+
}
|
|
10978
|
+
/* ━━━ Constructor ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
10979
|
+
constructor({ temporaryFileDirectoryAbsolutePath, projectBuildingMasterConfigRepresentative, logging }) {
|
|
10980
|
+
this.CACHED_VALIDATIONS_RESULTS_FILE_PARENT_DIRECTORY_ABSOLUTE_PATH = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
10981
|
+
DotYDA_DirectoryManager_1.default.OPTIMIZATION_FILES_DIRECTORY_ABSOLUTE_PATH,
|
|
10982
|
+
HTML_Validator.CACHED_HTML_VALIDATION_RESULTS_DIRECTORY_NAME
|
|
10983
|
+
], { alwaysForwardSlashSeparators: true });
|
|
10984
|
+
this.CACHED_VALIDATIONS_RESULTS_FILE_ABSOLUTE_PATH = HTML_Validator.
|
|
10985
|
+
computeActualCachedValidationsResultsFileParentDirectoryAbsolutePath({
|
|
10986
|
+
parentDirectoryAbsolutePath: this.CACHED_VALIDATIONS_RESULTS_FILE_PARENT_DIRECTORY_ABSOLUTE_PATH,
|
|
10987
|
+
projectBuildingSelectiveExecutionID: projectBuildingMasterConfigRepresentative.selectiveExecutionID,
|
|
10988
|
+
consumingProjectBuildingMode: projectBuildingMasterConfigRepresentative.consumingProjectBuildingMode
|
|
10989
|
+
});
|
|
10990
|
+
let cachedValidationsResults;
|
|
10991
|
+
try {
|
|
10992
|
+
cachedValidationsResults = es_extensions_nodejs_1.ObjectDataFilesProcessor.
|
|
10993
|
+
processFile({
|
|
10994
|
+
filePath: this.CACHED_VALIDATIONS_RESULTS_FILE_ABSOLUTE_PATH,
|
|
10995
|
+
validDataSpecification: HTML_Validator.cachedValidationsResultsFileContentSpecification,
|
|
10996
|
+
synchronously: true
|
|
11166
10997
|
});
|
|
11167
|
-
}
|
|
11168
|
-
|
|
11169
|
-
if (error instanceof
|
|
11170
|
-
|
|
10998
|
+
}
|
|
10999
|
+
catch (error) {
|
|
11000
|
+
if (!(error instanceof es_extensions_nodejs_1.FileNotFoundError)) {
|
|
11001
|
+
// TODO ① Extract textings
|
|
11002
|
+
es_extensions_1.Logger.logError({
|
|
11003
|
+
errorType: "CachedDataRetrievingFailure",
|
|
11004
|
+
title: "Cached data retrieving failure",
|
|
11005
|
+
description: `Unable to read the existing cache file "${this.CACHED_VALIDATIONS_RESULTS_FILE_ABSOLUTE_PATH}".`,
|
|
11006
|
+
occurrenceLocation: "HTML_Validator.retrieveCachedPastValidationsResultsFromFileIfItExists" +
|
|
11007
|
+
"(cachedValidationsResultsFileAbsolutePath)",
|
|
11008
|
+
caughtError: error,
|
|
11009
|
+
mustOutputIf: true
|
|
11010
|
+
});
|
|
11171
11011
|
}
|
|
11172
|
-
|
|
11173
|
-
|
|
11174
|
-
|
|
11175
|
-
|
|
11176
|
-
|
|
11177
|
-
|
|
11178
|
-
|
|
11012
|
+
}
|
|
11013
|
+
this.cachedValidationsResults = new Map(Object.entries(cachedValidationsResults ?? {}));
|
|
11014
|
+
this.TEMPORARY_FORMATTED_HTML_FILES_DIRECTORY_ABSOLUTE_PATH = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
11015
|
+
temporaryFileDirectoryAbsolutePath,
|
|
11016
|
+
HTML_Validator.TEMPORARY_FORMATTED_HTML_FILES_FOLDER_NAME
|
|
11017
|
+
]);
|
|
11018
|
+
this.TEMPORARY_FORMATTED_HTML_FILES_DIRECTORY_PATH_RELATIVE_TO_CONSUMING_PROJECT_ROOT = es_extensions_nodejs_1.ImprovedPath.
|
|
11019
|
+
computeRelativePath({
|
|
11020
|
+
basePath: projectBuildingMasterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath,
|
|
11021
|
+
comparedPath: this.TEMPORARY_FORMATTED_HTML_FILES_DIRECTORY_ABSOLUTE_PATH,
|
|
11022
|
+
alwaysForwardSlashSeparators: true
|
|
11179
11023
|
});
|
|
11180
|
-
|
|
11181
|
-
|
|
11182
|
-
constructor({ HTML_ValidationService, cachedValidationsResults, cachedValidationsResultsFileParentDirectoryAbsolutePath, cachedValidationsResultsFileAbsolutePath, logging }) {
|
|
11183
|
-
this.HTML_ValidationService = HTML_ValidationService;
|
|
11184
|
-
this.cachedValidationsResults = cachedValidationsResults ?? new Map();
|
|
11185
|
-
this.CACHED_VALIDATIONS_RESULTS_FILE_PARENT_DIRECTORY_ABSOLUTE_PATH = cachedValidationsResultsFileParentDirectoryAbsolutePath;
|
|
11186
|
-
this.CACHED_VALIDATIONS_RESULTS_FILE_ABSOLUTE_PATH = cachedValidationsResultsFileAbsolutePath;
|
|
11024
|
+
this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH =
|
|
11025
|
+
projectBuildingMasterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath;
|
|
11187
11026
|
this.logging = logging;
|
|
11188
11027
|
}
|
|
11189
|
-
/* ━━━ Private
|
|
11190
|
-
|
|
11191
|
-
|
|
11192
|
-
|
|
11193
|
-
|
|
11194
|
-
|
|
11195
|
-
|
|
11196
|
-
|
|
11197
|
-
|
|
11198
|
-
|
|
11199
|
-
|
|
11200
|
-
|
|
11201
|
-
|
|
11202
|
-
|
|
11203
|
-
|
|
11028
|
+
/* ━━━ Private Methods ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
11029
|
+
/* ─── Validation ───────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
11030
|
+
async validateQueuedFilesButReportAll() {
|
|
11031
|
+
const validationsResults = (0, es_extensions_1.createMapBasedOnOtherMap)(this.cachedValidationsResults, (filePathRelativeToConsumingProjectRootDirectory__forwardSlashesSeparatorsOnly, { issues }) => [filePathRelativeToConsumingProjectRootDirectory__forwardSlashesSeparatorsOnly, issues]);
|
|
11032
|
+
/* [ Approach ]
|
|
11033
|
+
* To get readable logs with code fragment, the original output HTML files could not be used because they could
|
|
11034
|
+
* contain the minified HTML code.
|
|
11035
|
+
* The saving of temporary HTML files with formatted HTML code could be the solution.
|
|
11036
|
+
* Anyway the Nu HTML Checker does not work with HTML strings — it accepts only relative paths of file saved to drive. */
|
|
11037
|
+
const formattedTemporaryHTML_FilesPathsRelativeToConsumingProjectRoot__forwardSlashesSeparatorsOnly = [];
|
|
11038
|
+
/* [ Theory ] How to understand for which file Nu HTML Checker issued the message?
|
|
11039
|
+
* By the output which will include the URI like
|
|
11040
|
+
* "file:/D:/IntelliJ%20IDEA/SampleProject/.yda/Temporary/HTML_Validation/4834cf5c-253f-4147-b00c-b8ca53922315.html"
|
|
11041
|
+
* It is the encoded (`encodeURI()` for ECMAScript) absolute path of temporary formatted HTML file with "file:/" prefix. */
|
|
11042
|
+
const temporaryFormattedHTML_FilesEncodedURIsAndOriginalHTML_FilesRelativePathsCorrespondence = new Map();
|
|
11043
|
+
/* [ Theory ]
|
|
11044
|
+
* Nu HTML Checker will not output the data for valid files while their paths is still required for summary. */
|
|
11045
|
+
const relativeToConsumingProjectRootPathsOfOriginalHTML_FilesWillBeValidated__forwardSlashesSeparatorsOnly = new Set();
|
|
11046
|
+
const cachedHTML_CodeSplitToLinesByFilesRelativePaths = new Map();
|
|
11047
|
+
const MD5_HashesOfHTML_ContentBySourceFilesRelativePaths = new Map();
|
|
11048
|
+
for (const { pathRelativeToConsumingProjectRoot__forwardSlashesSeparatorsOnly: originalHTML_FilePathRelativeToConsumingProjectRoot__forwardSlashesSeparatorsOnly, formattedHTML_Content, HTML_ContentMD5_Hash } of this.queuedFilesMetadata) {
|
|
11049
|
+
relativeToConsumingProjectRootPathsOfOriginalHTML_FilesWillBeValidated__forwardSlashesSeparatorsOnly.add(originalHTML_FilePathRelativeToConsumingProjectRoot__forwardSlashesSeparatorsOnly);
|
|
11050
|
+
const cachedValidationsResultsForCurrentFile = this.cachedValidationsResults.get(originalHTML_FilePathRelativeToConsumingProjectRoot__forwardSlashesSeparatorsOnly);
|
|
11051
|
+
MD5_HashesOfHTML_ContentBySourceFilesRelativePaths.set(originalHTML_FilePathRelativeToConsumingProjectRoot__forwardSlashesSeparatorsOnly, HTML_ContentMD5_Hash);
|
|
11052
|
+
if (cachedValidationsResultsForCurrentFile?.contentMD5Checksum === HTML_ContentMD5_Hash) {
|
|
11053
|
+
continue;
|
|
11204
11054
|
}
|
|
11205
|
-
|
|
11206
|
-
|
|
11207
|
-
|
|
11208
|
-
|
|
11209
|
-
|
|
11210
|
-
})
|
|
11211
|
-
|
|
11055
|
+
validationsResults.delete(originalHTML_FilePathRelativeToConsumingProjectRoot__forwardSlashesSeparatorsOnly);
|
|
11056
|
+
cachedHTML_CodeSplitToLinesByFilesRelativePaths.set(originalHTML_FilePathRelativeToConsumingProjectRoot__forwardSlashesSeparatorsOnly, (0, es_extensions_1.splitString)(formattedHTML_Content, "\n"));
|
|
11057
|
+
const temporaryHTML_FilePathRelativeToConsumingProjectRoot__forwardSlashesSeparatorsOnly = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
11058
|
+
this.TEMPORARY_FORMATTED_HTML_FILES_DIRECTORY_PATH_RELATIVE_TO_CONSUMING_PROJECT_ROOT,
|
|
11059
|
+
`${(0, nanoid_1.nanoid)()}.html`
|
|
11060
|
+
], { alwaysForwardSlashSeparators: true });
|
|
11061
|
+
formattedTemporaryHTML_FilesPathsRelativeToConsumingProjectRoot__forwardSlashesSeparatorsOnly.push(temporaryHTML_FilePathRelativeToConsumingProjectRoot__forwardSlashesSeparatorsOnly);
|
|
11062
|
+
const temporaryHTML_FileAbsolutePath__forwardSlashesSeparatorsOnly = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
11063
|
+
this.CONSUMING_PROJECT_ROOT_DIRECTORY_ABSOLUTE_PATH,
|
|
11064
|
+
temporaryHTML_FilePathRelativeToConsumingProjectRoot__forwardSlashesSeparatorsOnly
|
|
11065
|
+
], { alwaysForwardSlashSeparators: true });
|
|
11066
|
+
temporaryFormattedHTML_FilesEncodedURIsAndOriginalHTML_FilesRelativePathsCorrespondence.set(`file:/${encodeURI(temporaryHTML_FileAbsolutePath__forwardSlashesSeparatorsOnly)}`, originalHTML_FilePathRelativeToConsumingProjectRoot__forwardSlashesSeparatorsOnly);
|
|
11067
|
+
es_extensions_nodejs_1.ImprovedFileSystem.writeFileToPossiblyNotExistingDirectory({
|
|
11068
|
+
filePath: temporaryHTML_FileAbsolutePath__forwardSlashesSeparatorsOnly,
|
|
11069
|
+
content: formattedHTML_Content,
|
|
11070
|
+
synchronously: true
|
|
11071
|
+
});
|
|
11212
11072
|
}
|
|
11213
11073
|
if (this.logging.validationStart) {
|
|
11214
11074
|
es_extensions_1.Logger.logInfo(HTML_Validator.localization.generateValidationStartedInfoLog({
|
|
11215
|
-
|
|
11075
|
+
targetFileRelativePaths: this.queuedFilesMetadata.map((metadataOfQueuedFile) => metadataOfQueuedFile.pathRelativeToConsumingProjectRoot__forwardSlashesSeparatorsOnly)
|
|
11216
11076
|
}));
|
|
11217
11077
|
}
|
|
11218
|
-
|
|
11219
|
-
if (
|
|
11220
|
-
|
|
11221
|
-
|
|
11222
|
-
let validationRawResults;
|
|
11223
|
-
try {
|
|
11224
|
-
validationRawResults = await this.HTML_ValidationService.validate({
|
|
11225
|
-
html: HTML_Code,
|
|
11226
|
-
output: "json"
|
|
11227
|
-
});
|
|
11228
|
-
if ((0, es_extensions_1.isNotUndefined)(validationRawResults.messages?.find((rawValidationIssue) => rawValidationIssue.type === "network-error" && rawValidationIssue.message.includes("429 Too Many Requests")))) {
|
|
11229
|
-
es_extensions_1.Logger.throwErrorAndLog({
|
|
11230
|
-
errorType: "HTML_ValidationServiceRejectionError",
|
|
11231
|
-
title: "HTML Validation Rejection",
|
|
11232
|
-
description: "Sorry, the validation service has rejected the requests because of limit exceeding. ",
|
|
11233
|
-
occurrenceLocation: "HTML_Validator.validateSingleFile(compoundParameter)"
|
|
11234
|
-
});
|
|
11235
|
-
}
|
|
11078
|
+
/* [ Theory ] If pass no files to Nu HTML Checker, it will fail with error. */
|
|
11079
|
+
if (formattedTemporaryHTML_FilesPathsRelativeToConsumingProjectRoot__forwardSlashesSeparatorsOnly.length === 0) {
|
|
11080
|
+
HTML_Validator.reportValidationsResults(validationsResults);
|
|
11081
|
+
return;
|
|
11236
11082
|
}
|
|
11237
|
-
|
|
11238
|
-
|
|
11239
|
-
|
|
11240
|
-
|
|
11241
|
-
|
|
11083
|
+
const rawValidationsResults = await HTML_Validator.getRawValidationsResultsFromNuHTML_Checker(formattedTemporaryHTML_FilesPathsRelativeToConsumingProjectRoot__forwardSlashesSeparatorsOnly);
|
|
11084
|
+
// TODO ④ Improve Method
|
|
11085
|
+
es_extensions_nodejs_1.ImprovedFileSystem.removeDirectoryWithFiles({
|
|
11086
|
+
targetPath: this.TEMPORARY_FORMATTED_HTML_FILES_DIRECTORY_ABSOLUTE_PATH,
|
|
11087
|
+
mustThrowErrorIfOneOrMoreFilesCouldNotBeDeleted: false
|
|
11088
|
+
});
|
|
11089
|
+
const rawValidationsResultsInspectionOutput = es_extensions_1.RawObjectDataProcessor.process(rawValidationsResults, HTML_Validator.validationsResultsSpecification);
|
|
11090
|
+
if (rawValidationsResultsInspectionOutput.rawDataIsInvalid) {
|
|
11091
|
+
// TODO ③ Better Error
|
|
11242
11092
|
es_extensions_1.Logger.logError({
|
|
11243
|
-
errorType: es_extensions_1.
|
|
11244
|
-
|
|
11245
|
-
|
|
11246
|
-
|
|
11093
|
+
errorType: es_extensions_1.UnexpectedEventError.NAME,
|
|
11094
|
+
title: es_extensions_1.UnexpectedEventError.localization.defaultTitle,
|
|
11095
|
+
description: es_extensions_1.RawObjectDataProcessor.
|
|
11096
|
+
formatValidationErrorsList(rawValidationsResultsInspectionOutput.validationErrorsMessages),
|
|
11097
|
+
occurrenceLocation: "experimentalHTML_Validator.validateQueuedFilesButReportAll()"
|
|
11247
11098
|
});
|
|
11248
11099
|
return;
|
|
11249
11100
|
}
|
|
11250
|
-
|
|
11251
|
-
|
|
11252
|
-
|
|
11253
|
-
|
|
11254
|
-
|
|
11255
|
-
|
|
11256
|
-
|
|
11257
|
-
|
|
11258
|
-
|
|
11259
|
-
|
|
11101
|
+
/* [ Theory ]
|
|
11102
|
+
* The ones which called `messages` in Nu HTML Checker are not the messages.
|
|
11103
|
+
* The `messages` property is the array of objects each of which has `message` string property.
|
|
11104
|
+
* There are could be multiple objects for single file thus sorting by files required first. */
|
|
11105
|
+
for (const rawValidationIssue of rawValidationsResultsInspectionOutput.processedData.messages) {
|
|
11106
|
+
const filePathRelativeToConsumingProjectRoot__forwardSlashesSeparatorsOnly = (0, es_extensions_1.getExpectedToBeNonUndefinedMapValue)(temporaryFormattedHTML_FilesEncodedURIsAndOriginalHTML_FilesRelativePathsCorrespondence, rawValidationIssue.url);
|
|
11107
|
+
relativeToConsumingProjectRootPathsOfOriginalHTML_FilesWillBeValidated__forwardSlashesSeparatorsOnly.delete(filePathRelativeToConsumingProjectRoot__forwardSlashesSeparatorsOnly);
|
|
11108
|
+
const issuesOfCurrentFile = validationsResults.get(filePathRelativeToConsumingProjectRoot__forwardSlashesSeparatorsOnly);
|
|
11109
|
+
if ((0, es_extensions_1.isUndefined)(issuesOfCurrentFile)) {
|
|
11110
|
+
validationsResults.set(filePathRelativeToConsumingProjectRoot__forwardSlashesSeparatorsOnly, [
|
|
11111
|
+
HTML_Validator.normalizeRawValidationIssue(rawValidationIssue, (0, es_extensions_1.getExpectedToBeNonUndefinedMapValue)(cachedHTML_CodeSplitToLinesByFilesRelativePaths, filePathRelativeToConsumingProjectRoot__forwardSlashesSeparatorsOnly))
|
|
11112
|
+
]);
|
|
11113
|
+
continue;
|
|
11114
|
+
}
|
|
11115
|
+
issuesOfCurrentFile.push(HTML_Validator.normalizeRawValidationIssue(rawValidationIssue, (0, es_extensions_1.getExpectedToBeNonUndefinedMapValue)(cachedHTML_CodeSplitToLinesByFilesRelativePaths, filePathRelativeToConsumingProjectRoot__forwardSlashesSeparatorsOnly)));
|
|
11260
11116
|
}
|
|
11261
|
-
|
|
11262
|
-
|
|
11263
|
-
if (this.relativePathsOfFilesWhichIsBeingValidated.size === 0) {
|
|
11264
|
-
this.waitingForStaringOfWritingOfCacheFileWithValidationsResults = setTimeout(this.writeCacheToFile.bind(this), (0, es_extensions_1.secondsToMilliseconds)(HTML_Validator.WAITING_FOR_STARING_OF_WRITING_OF_CACHE_FILE_WITH_VALIDATION_RESULTS_PERIOD__SECONDS));
|
|
11117
|
+
for (const relativeToConsumingProjectRootPathOfOriginalValidHTML_Files__forwardSlashesSeparatorsOnly of relativeToConsumingProjectRootPathsOfOriginalHTML_FilesWillBeValidated__forwardSlashesSeparatorsOnly) {
|
|
11118
|
+
validationsResults.set(relativeToConsumingProjectRootPathOfOriginalValidHTML_Files__forwardSlashesSeparatorsOnly, []);
|
|
11265
11119
|
}
|
|
11266
|
-
|
|
11267
|
-
|
|
11268
|
-
|
|
11269
|
-
|
|
11120
|
+
HTML_Validator.reportValidationsResults(validationsResults);
|
|
11121
|
+
this.cachedValidationsResults = (0, es_extensions_1.createMapBasedOnOtherMap)(validationsResults, (filePathRelativeToConsumingProjectRootDirectory__forwardSlashesSeparatorsOnly, issues) => [
|
|
11122
|
+
filePathRelativeToConsumingProjectRootDirectory__forwardSlashesSeparatorsOnly,
|
|
11123
|
+
{
|
|
11124
|
+
issues,
|
|
11125
|
+
contentMD5Checksum: (0, es_extensions_1.getExpectedToBeNonUndefinedMapValue)(MD5_HashesOfHTML_ContentBySourceFilesRelativePaths, filePathRelativeToConsumingProjectRootDirectory__forwardSlashesSeparatorsOnly)
|
|
11126
|
+
}
|
|
11127
|
+
]);
|
|
11128
|
+
this.writeCacheToFile();
|
|
11129
|
+
}
|
|
11130
|
+
static async getRawValidationsResultsFromNuHTML_Checker(targetFilesPathRelativeToConsumingProjectRoot__forwardSlashesPathSeparators) {
|
|
11131
|
+
return new Promise((resolve, reject) => {
|
|
11132
|
+
/* [ Theory ] "vnu-jar" works only with relative paths. Absolute paths will not work with any path separators. */
|
|
11133
|
+
node_child_process_1.default.execFile("java", [
|
|
11134
|
+
"-jar",
|
|
11135
|
+
`"${vnu_jar_1.default}"`,
|
|
11136
|
+
"--format",
|
|
11137
|
+
"json",
|
|
11138
|
+
...targetFilesPathRelativeToConsumingProjectRoot__forwardSlashesPathSeparators
|
|
11139
|
+
], { shell: true }, (_error, _stdout, stderr) => {
|
|
11140
|
+
/* [ Theory ] vnu-jar
|
|
11141
|
+
* + All validation errors will be output to `stderr` herewith the first parameter will be non-null.
|
|
11142
|
+
* + It is possible to output the validation error to `stdout` instead if to specify the respective option,
|
|
11143
|
+
* but the first parameter will be non-null anyway.
|
|
11144
|
+
* + The reaction to non-existing file is completely same as to valid file: the stringified object
|
|
11145
|
+
* `{"messages":[]}` will be returned. */
|
|
11146
|
+
const stringifiedOutput = Buffer.isBuffer(stderr) ? stderr.toString("utf8") : stderr;
|
|
11147
|
+
try {
|
|
11148
|
+
resolve(JSON.parse(stringifiedOutput));
|
|
11149
|
+
}
|
|
11150
|
+
catch (error) {
|
|
11151
|
+
reject(error);
|
|
11152
|
+
}
|
|
11153
|
+
});
|
|
11270
11154
|
});
|
|
11271
11155
|
}
|
|
11272
|
-
|
|
11273
|
-
|
|
11274
|
-
|
|
11275
|
-
|
|
11276
|
-
|
|
11277
|
-
|
|
11278
|
-
|
|
11279
|
-
|
|
11280
|
-
|
|
11281
|
-
|
|
11282
|
-
|
|
11283
|
-
|
|
11284
|
-
|
|
11285
|
-
|
|
11286
|
-
|
|
11287
|
-
|
|
11288
|
-
|
|
11289
|
-
|
|
11290
|
-
|
|
11291
|
-
|
|
11292
|
-
|
|
11293
|
-
|
|
11294
|
-
|
|
11295
|
-
|
|
11296
|
-
|
|
11297
|
-
|
|
11298
|
-
|
|
11299
|
-
|
|
11300
|
-
|
|
11301
|
-
|
|
11302
|
-
|
|
11303
|
-
|
|
11304
|
-
|
|
11305
|
-
}).join("\n")}\n` +
|
|
11156
|
+
/* ─── Raw Issues Normalizing ───────────────────────────────────────────────────────────────────────────────────── */
|
|
11157
|
+
static normalizeRawValidationIssue({ type, subType, message, lastLine: lineNumberOfActualCodeFragment__numerationFrom1, firstColumn, lastColumn: numberOfEndingColumnOfHighlightedCodeFragment__numerationFrom1 }, HTML_CodeSplitToLines) {
|
|
11158
|
+
if ((0, es_extensions_1.isUndefined)(lineNumberOfActualCodeFragment__numerationFrom1) ||
|
|
11159
|
+
(0, es_extensions_1.isUndefined)(numberOfEndingColumnOfHighlightedCodeFragment__numerationFrom1)) {
|
|
11160
|
+
return {
|
|
11161
|
+
type,
|
|
11162
|
+
subType,
|
|
11163
|
+
message
|
|
11164
|
+
};
|
|
11165
|
+
}
|
|
11166
|
+
const actualLineOfCode = HTML_CodeSplitToLines[lineNumberOfActualCodeFragment__numerationFrom1 - 1];
|
|
11167
|
+
const numberOfStartingLineWhichWillBeExtractedFromCodeListingForLogging__numerationFrom1 = (0, es_extensions_1.limitMinimalValue)({
|
|
11168
|
+
targetNumber: lineNumberOfActualCodeFragment__numerationFrom1 -
|
|
11169
|
+
HTML_Validator.DISPLAYING_LINES_COUNT_BEFORE_ISSUE_IN_CODE_LISTING,
|
|
11170
|
+
minimalValue: 1
|
|
11171
|
+
});
|
|
11172
|
+
const numberOfEndingLineWhichWillBeExtractedFromCodeListingForLogging__numerationFrom1 = (0, es_extensions_1.limitMaximalValue)({
|
|
11173
|
+
targetNumber: lineNumberOfActualCodeFragment__numerationFrom1 +
|
|
11174
|
+
HTML_Validator.DISPLAYING_LINES_COUNT_AFTER_ISSUE_IN_CODE_LISTING,
|
|
11175
|
+
maximalValue: HTML_CodeSplitToLines.length
|
|
11176
|
+
});
|
|
11177
|
+
const numberOfStartingColumnOfHighlightedCodeFragment__numerationFrom1 = firstColumn ?? numberOfEndingColumnOfHighlightedCodeFragment__numerationFrom1;
|
|
11178
|
+
/* [ Maintainability ] Keep these variables for easier debugging. */
|
|
11179
|
+
const codeFragmentBeforeHighlighting = `${(0, es_extensions_1.cropArray)({
|
|
11180
|
+
targetArray: HTML_CodeSplitToLines,
|
|
11181
|
+
startingElementNumber__numerationFrom1: numberOfStartingLineWhichWillBeExtractedFromCodeListingForLogging__numerationFrom1,
|
|
11182
|
+
endingElementNumber__numerationFrom1: (0, es_extensions_1.limitMinimalValue)({
|
|
11183
|
+
targetNumber: lineNumberOfActualCodeFragment__numerationFrom1 - 1, minimalValue: 1
|
|
11184
|
+
}),
|
|
11185
|
+
mustThrowErrorIfSpecifiedElementsNumbersAreOutOfRange: false,
|
|
11186
|
+
mutably: false
|
|
11187
|
+
}).join("\n")}\n` +
|
|
11188
|
+
(numberOfStartingColumnOfHighlightedCodeFragment__numerationFrom1 > 1 ?
|
|
11306
11189
|
(0, es_extensions_1.cropString)({
|
|
11307
11190
|
targetString: actualLineOfCode,
|
|
11308
11191
|
startingCharacterNumber__numerationFrom1: 1,
|
|
11309
11192
|
endingCharacterNumber__numerationFrom1: numberOfStartingColumnOfHighlightedCodeFragment__numerationFrom1 - 1,
|
|
11310
11193
|
mustThrowErrorIfSpecifiedCharactersNumbersIsOutOfRange: false
|
|
11311
|
-
})
|
|
11312
|
-
|
|
11313
|
-
|
|
11314
|
-
|
|
11315
|
-
|
|
11316
|
-
|
|
11317
|
-
|
|
11318
|
-
|
|
11319
|
-
targetString: actualLineOfCode,
|
|
11320
|
-
startingCharacterNumber__numerationFrom1: numberOfEndingColumnOfHighlightedCodeFragment__numerationFrom1 + 1,
|
|
11321
|
-
endingCharacterNumber__numerationFrom1: actualLineOfCode.length,
|
|
11322
|
-
mustThrowErrorIfSpecifiedCharactersNumbersIsOutOfRange: false
|
|
11323
|
-
})}\n` +
|
|
11324
|
-
(0, es_extensions_1.cropArray)({
|
|
11325
|
-
targetArray: HTML_CodeSplitToLines,
|
|
11326
|
-
startingElementNumber__numerationFrom1: lineNumberOfActualCodeFragment__numerationFrom1 + 1,
|
|
11327
|
-
endingElementNumber__numerationFrom1: numberOfEndingLineWhichWillBeExtractedFromCodeListingForLogging__numerationFrom1,
|
|
11328
|
-
mustThrowErrorIfSpecifiedElementsNumbersAreOutOfRange: false,
|
|
11329
|
-
mutably: false
|
|
11330
|
-
}).join("\n");
|
|
11331
|
-
return {
|
|
11332
|
-
type: rawValidationIssue.type,
|
|
11333
|
-
subType: rawValidationIssue.subType,
|
|
11334
|
-
message: rawValidationIssue.message,
|
|
11335
|
-
lineNumber__numerationFrom1: lineNumberOfActualCodeFragment__numerationFrom1,
|
|
11336
|
-
startingColumnNumber__numerationFrom1: numberOfStartingColumnOfHighlightedCodeFragment__numerationFrom1,
|
|
11337
|
-
endingColumnNumber__numerationFrom1: numberOfEndingColumnOfHighlightedCodeFragment__numerationFrom1,
|
|
11338
|
-
codeFragment: {
|
|
11339
|
-
beforeHighlighting: codeFragmentBeforeHighlighting,
|
|
11340
|
-
highlighted: highlightedCodeFragment,
|
|
11341
|
-
afterHighlighting: codeFragmentAfterHighlighting
|
|
11342
|
-
}
|
|
11343
|
-
};
|
|
11194
|
+
}) :
|
|
11195
|
+
"");
|
|
11196
|
+
// ━━━ TODO ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
11197
|
+
const highlightedCodeFragment = (0, es_extensions_1.cropString)({
|
|
11198
|
+
targetString: actualLineOfCode,
|
|
11199
|
+
startingCharacterNumber__numerationFrom1: numberOfStartingColumnOfHighlightedCodeFragment__numerationFrom1,
|
|
11200
|
+
endingCharacterNumber__numerationFrom1: numberOfEndingColumnOfHighlightedCodeFragment__numerationFrom1,
|
|
11201
|
+
mustThrowErrorIfSpecifiedCharactersNumbersIsOutOfRange: false
|
|
11344
11202
|
});
|
|
11203
|
+
const codeFragmentAfterHighlighting = `${(0, es_extensions_1.cropString)({
|
|
11204
|
+
targetString: actualLineOfCode,
|
|
11205
|
+
startingCharacterNumber__numerationFrom1: numberOfEndingColumnOfHighlightedCodeFragment__numerationFrom1 + 1,
|
|
11206
|
+
endingCharacterNumber__numerationFrom1: actualLineOfCode.length,
|
|
11207
|
+
mustThrowErrorIfSpecifiedCharactersNumbersIsOutOfRange: false
|
|
11208
|
+
})}\n` +
|
|
11209
|
+
(0, es_extensions_1.cropArray)({
|
|
11210
|
+
targetArray: HTML_CodeSplitToLines,
|
|
11211
|
+
startingElementNumber__numerationFrom1: lineNumberOfActualCodeFragment__numerationFrom1 + 1,
|
|
11212
|
+
endingElementNumber__numerationFrom1: numberOfEndingLineWhichWillBeExtractedFromCodeListingForLogging__numerationFrom1,
|
|
11213
|
+
mustThrowErrorIfSpecifiedElementsNumbersAreOutOfRange: false,
|
|
11214
|
+
mutably: false
|
|
11215
|
+
}).join("\n");
|
|
11216
|
+
return {
|
|
11217
|
+
type,
|
|
11218
|
+
subType,
|
|
11219
|
+
message,
|
|
11220
|
+
lineNumber__numerationFrom1: lineNumberOfActualCodeFragment__numerationFrom1,
|
|
11221
|
+
startingColumnNumber__numerationFrom1: numberOfStartingColumnOfHighlightedCodeFragment__numerationFrom1,
|
|
11222
|
+
endingColumnNumber__numerationFrom1: numberOfEndingColumnOfHighlightedCodeFragment__numerationFrom1,
|
|
11223
|
+
codeFragment: {
|
|
11224
|
+
beforeHighlighting: codeFragmentBeforeHighlighting,
|
|
11225
|
+
highlighted: highlightedCodeFragment,
|
|
11226
|
+
afterHighlighting: codeFragmentAfterHighlighting
|
|
11227
|
+
}
|
|
11228
|
+
};
|
|
11345
11229
|
}
|
|
11346
|
-
/* ───
|
|
11347
|
-
|
|
11348
|
-
|
|
11349
|
-
|
|
11350
|
-
|
|
11351
|
-
|
|
11352
|
-
|
|
11353
|
-
|
|
11354
|
-
if (
|
|
11355
|
-
|
|
11356
|
-
|
|
11357
|
-
this.waitingForToastNotificationsWillBePermittedAgain = setTimeout(() => { this.isToastNotificationPermitted = true; }, (0, es_extensions_1.secondsToMilliseconds)(HTML_Validator.SUBSEQUENT_TOAST_NOTIFICATION_PROHIBITION_PERIOD__SECONDS));
|
|
11230
|
+
/* ─── Reporting ────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
11231
|
+
static reportValidationsResults(validationsResults) {
|
|
11232
|
+
// TODO Alphabet order
|
|
11233
|
+
let hasAtLeastOneFileWithInvalidHTML = false;
|
|
11234
|
+
const hasEachFileIssues = new Map();
|
|
11235
|
+
const formattedIssuesForEachFile = new Map();
|
|
11236
|
+
for (const [fileRelativePath__forwardPathSeparatorsOnly, issues] of validationsResults.entries()) {
|
|
11237
|
+
hasEachFileIssues.set(fileRelativePath__forwardPathSeparatorsOnly, issues.length > 0);
|
|
11238
|
+
if (issues.length > 0) {
|
|
11239
|
+
hasAtLeastOneFileWithInvalidHTML = true;
|
|
11240
|
+
formattedIssuesForEachFile.set(fileRelativePath__forwardPathSeparatorsOnly, HTML_Validator.formatValidationResultForSingleFile(issues));
|
|
11358
11241
|
}
|
|
11359
11242
|
}
|
|
11360
|
-
|
|
11361
|
-
|
|
11362
|
-
|
|
11363
|
-
|
|
11364
|
-
|
|
11243
|
+
const summary = `${(0, es_extensions_1.surroundLabelByOrnament)({
|
|
11244
|
+
label: " Summary ",
|
|
11245
|
+
ornamentPatten: "━",
|
|
11246
|
+
prependedPartCharactersCount: 3,
|
|
11247
|
+
totalCharactersCount: HTML_Validator.DISPLAYING_MAXIMAL_COLUMNS_COUNT_IN_LOG
|
|
11248
|
+
})}\n` +
|
|
11249
|
+
Array.from(hasEachFileIssues.entries()).
|
|
11250
|
+
map(([fileRelativePath__forwardPathSeparatorsOnly, hasAtLeastOneIssue]) => `${hasAtLeastOneIssue ? "❌" : "✅"} ${fileRelativePath__forwardPathSeparatorsOnly}`).
|
|
11251
|
+
join("\n");
|
|
11252
|
+
const detailedReport = `${(0, es_extensions_1.surroundLabelByOrnament)({
|
|
11253
|
+
label: " Details ",
|
|
11254
|
+
ornamentPatten: "━",
|
|
11255
|
+
prependedPartCharactersCount: 3,
|
|
11256
|
+
totalCharactersCount: HTML_Validator.DISPLAYING_MAXIMAL_COLUMNS_COUNT_IN_LOG
|
|
11257
|
+
})}\n` +
|
|
11258
|
+
Array.from(formattedIssuesForEachFile.entries()).
|
|
11259
|
+
map(([fileRelativePath__forwardPathSeparatorsOnly, formattedIssues]) => `${(0, es_extensions_1.surroundLabelByOrnament)({
|
|
11260
|
+
label: ` ${fileRelativePath__forwardPathSeparatorsOnly} `,
|
|
11261
|
+
ornamentPatten: "─",
|
|
11262
|
+
prependedPartCharactersCount: 3,
|
|
11263
|
+
totalCharactersCount: HTML_Validator.DISPLAYING_MAXIMAL_COLUMNS_COUNT_IN_LOG
|
|
11264
|
+
})}\n` +
|
|
11265
|
+
formattedIssues).
|
|
11266
|
+
join("\n");
|
|
11267
|
+
if (hasAtLeastOneFileWithInvalidHTML) {
|
|
11268
|
+
es_extensions_1.Logger.logErrorLikeMessage({
|
|
11269
|
+
title: "HTML Validation, Issue(s) Detected",
|
|
11270
|
+
description: `${summary}\n\n${detailedReport}`
|
|
11271
|
+
});
|
|
11272
|
+
node_notifier_1.default.notify(HTML_Validator.localization.issuesFoundToastNotification);
|
|
11273
|
+
return;
|
|
11365
11274
|
}
|
|
11275
|
+
es_extensions_1.Logger.logSuccess({
|
|
11276
|
+
title: "HTML Validation, All Valid",
|
|
11277
|
+
description: "All HTML files (except excluded ones if any) contains valid HTML. " +
|
|
11278
|
+
"The following files has been checked.\n" +
|
|
11279
|
+
Array.from(validationsResults.keys()).
|
|
11280
|
+
map((fileRelativePath__forwardPathSeparatorsOnly) => `● ${fileRelativePath__forwardPathSeparatorsOnly}`).
|
|
11281
|
+
join("\n")
|
|
11282
|
+
});
|
|
11366
11283
|
}
|
|
11284
|
+
/* ─── Formatting ───────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
11367
11285
|
static formatValidationResultForSingleFile(issues) {
|
|
11368
11286
|
const formattedIssues = [];
|
|
11369
11287
|
for (const [index, issue] of issues.entries()) {
|
|
@@ -11382,64 +11300,52 @@ class HTML_Validator {
|
|
|
11382
11300
|
formattedIssues.push([
|
|
11383
11301
|
`${(0, es_extensions_1.surroundLabelByOrnament)({
|
|
11384
11302
|
label: HTML_Validator.localization.generateIssueNumberLabel({ issueNumber: index + 1 }),
|
|
11385
|
-
ornamentPatten: "
|
|
11303
|
+
ornamentPatten: "┄",
|
|
11386
11304
|
prependedPartCharactersCount: 3,
|
|
11387
11305
|
totalCharactersCount: HTML_Validator.DISPLAYING_MAXIMAL_COLUMNS_COUNT_IN_LOG
|
|
11388
11306
|
})}\n`,
|
|
11389
|
-
issue.codeFragment
|
|
11390
|
-
|
|
11391
|
-
|
|
11307
|
+
...(0, es_extensions_1.isNotUndefined)(issue.codeFragment) ?
|
|
11308
|
+
[
|
|
11309
|
+
issue.codeFragment.beforeHighlighting,
|
|
11310
|
+
es_extensions_1.Logger.highlightText(issue.codeFragment.highlighted),
|
|
11311
|
+
`${issue.codeFragment.afterHighlighting}\n`
|
|
11312
|
+
] :
|
|
11313
|
+
[],
|
|
11392
11314
|
`${"-".repeat(HTML_Validator.DISPLAYING_MAXIMAL_COLUMNS_COUNT_IN_LOG)}\n`,
|
|
11393
11315
|
issue.message,
|
|
11394
11316
|
` (${(() => {
|
|
11395
11317
|
switch (issue.type) {
|
|
11396
|
-
case HTML_Validator.
|
|
11318
|
+
case HTML_Validator.NormalizedValidationsResults.Issue.Types.error:
|
|
11397
11319
|
return HTML_Validator.localization.issuesTypesTitles.grossViolation;
|
|
11398
|
-
case HTML_Validator.
|
|
11320
|
+
case HTML_Validator.NormalizedValidationsResults.Issue.Types.info:
|
|
11399
11321
|
return HTML_Validator.localization.issuesTypesTitles.recommendationDisregard;
|
|
11400
11322
|
default:
|
|
11401
11323
|
return HTML_Validator.localization.issuesTypesTitles.other;
|
|
11402
11324
|
}
|
|
11403
11325
|
})()})\n`,
|
|
11404
|
-
|
|
11405
|
-
|
|
11406
|
-
|
|
11407
|
-
|
|
11408
|
-
|
|
11326
|
+
...((0, es_extensions_1.isNotUndefined)(issue.lineNumber__numerationFrom1) &&
|
|
11327
|
+
(0, es_extensions_1.isNotUndefined)(issue.startingColumnNumber__numerationFrom1) &&
|
|
11328
|
+
(0, es_extensions_1.isNotUndefined)(issue.endingColumnNumber__numerationFrom1)) ?
|
|
11329
|
+
[
|
|
11330
|
+
HTML_Validator.localization.generateIssueOccurrenceLocationIndication({
|
|
11331
|
+
lineNumber: issue.lineNumber__numerationFrom1,
|
|
11332
|
+
startingColumnNumber: issue.startingColumnNumber__numerationFrom1,
|
|
11333
|
+
lastColumnNumber: issue.endingColumnNumber__numerationFrom1
|
|
11334
|
+
})
|
|
11335
|
+
] :
|
|
11336
|
+
[]
|
|
11409
11337
|
].join(""));
|
|
11410
11338
|
}
|
|
11411
11339
|
return formattedIssues.join("\n\n");
|
|
11412
11340
|
}
|
|
11413
11341
|
/* ─── Cache file ───────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
11414
|
-
static
|
|
11415
|
-
|
|
11416
|
-
|
|
11417
|
-
|
|
11418
|
-
|
|
11419
|
-
|
|
11420
|
-
|
|
11421
|
-
let cachedValidationResults;
|
|
11422
|
-
try {
|
|
11423
|
-
cachedValidationResults = await es_extensions_nodejs_1.ObjectDataFilesProcessor.processFile({
|
|
11424
|
-
filePath: cachedValidationsResultsFileAbsolutePath,
|
|
11425
|
-
validDataSpecification: HTML_Validator.cachedValidationsResultsFileContentSpecification,
|
|
11426
|
-
synchronously: false
|
|
11427
|
-
});
|
|
11428
|
-
}
|
|
11429
|
-
catch (error) {
|
|
11430
|
-
if (!(error instanceof es_extensions_nodejs_1.FileNotFoundError) && true) {
|
|
11431
|
-
es_extensions_1.Logger.logError({
|
|
11432
|
-
errorType: "CachedDataRetrievingFailure",
|
|
11433
|
-
title: "Cached data retrieving failure",
|
|
11434
|
-
description: `Unable to read the existing cache file "${cachedValidationsResultsFileAbsolutePath}".`,
|
|
11435
|
-
occurrenceLocation: "HTML_Validator.retrieveCachedPastValidationsResultsFromFileIfItExists" +
|
|
11436
|
-
"(cachedValidationsResultsFileAbsolutePath)",
|
|
11437
|
-
caughtError: error
|
|
11438
|
-
});
|
|
11439
|
-
}
|
|
11440
|
-
return null;
|
|
11441
|
-
}
|
|
11442
|
-
return new Map(Object.entries(cachedValidationResults));
|
|
11342
|
+
static computeActualCachedValidationsResultsFileParentDirectoryAbsolutePath({ parentDirectoryAbsolutePath, projectBuildingSelectiveExecutionID, consumingProjectBuildingMode }) {
|
|
11343
|
+
return es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
11344
|
+
parentDirectoryAbsolutePath,
|
|
11345
|
+
"HTML_Validation." +
|
|
11346
|
+
(0, es_extensions_1.insertSubstring)(projectBuildingSelectiveExecutionID, { modifier: (specifiedProjectBuildingSelectiveExecutionID) => `${specifiedProjectBuildingSelectiveExecutionID}.` }) +
|
|
11347
|
+
`${(0, es_extensions_1.toLowerCamelCase)(consumingProjectBuildingMode)}.json`
|
|
11348
|
+
]);
|
|
11443
11349
|
}
|
|
11444
11350
|
writeCacheToFile() {
|
|
11445
11351
|
es_extensions_nodejs_1.ImprovedFileSystem.createDirectory({
|
|
@@ -11447,41 +11353,29 @@ class HTML_Validator {
|
|
|
11447
11353
|
mustThrowErrorIfTargetDirectoryExists: false,
|
|
11448
11354
|
synchronously: true
|
|
11449
11355
|
});
|
|
11450
|
-
const cachedValidationsResultsFileContent = Array.from(
|
|
11451
|
-
has(filePathRelativeToConsumingProjectRootDirectory)).entries()).
|
|
11356
|
+
const cachedValidationsResultsFileContent = Array.from(this.cachedValidationsResults.entries()).
|
|
11452
11357
|
reduce((accumulatingValue, [filePathRelativeToConsumingProjectRootDirectory, cachedValidationRawResultsForSpecificFile]) => {
|
|
11453
11358
|
accumulatingValue[filePathRelativeToConsumingProjectRootDirectory] = cachedValidationRawResultsForSpecificFile;
|
|
11454
11359
|
return accumulatingValue;
|
|
11455
11360
|
}, {});
|
|
11456
|
-
fs_1.default.writeFileSync(this.CACHED_VALIDATIONS_RESULTS_FILE_ABSOLUTE_PATH, (
|
|
11457
|
-
}
|
|
11458
|
-
/* ─── Routines ─────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
11459
|
-
static onSelfSoleInstanceReady(selfSoleInstance) {
|
|
11460
|
-
for (const onSelfSoleInstanceReadyEventsHandler of HTML_Validator.onSelfSoleInstanceReadyEventsHandlers) {
|
|
11461
|
-
onSelfSoleInstanceReadyEventsHandler(selfSoleInstance);
|
|
11462
|
-
}
|
|
11463
|
-
HTML_Validator.onSelfSoleInstanceReadyEventsHandlers.clear();
|
|
11361
|
+
fs_1.default.writeFileSync(this.CACHED_VALIDATIONS_RESULTS_FILE_ABSOLUTE_PATH, JSON.stringify(cachedValidationsResultsFileContent, null, 2));
|
|
11464
11362
|
}
|
|
11465
|
-
|
|
11466
|
-
|
|
11363
|
+
/* ━━━ Routines ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
11364
|
+
static getExpectedToBeInitializedSelfSingleInstance() {
|
|
11365
|
+
return HTML_Validator.selfSingleInstance ??
|
|
11467
11366
|
es_extensions_1.Logger.throwErrorAndLog({
|
|
11468
11367
|
errorInstance: new es_extensions_1.ClassRequiredInitializationHasNotBeenExecutedError({
|
|
11469
|
-
className: "
|
|
11470
|
-
initializingMethodName: "
|
|
11368
|
+
className: "HTML_Validator",
|
|
11369
|
+
initializingMethodName: "initialize"
|
|
11471
11370
|
}),
|
|
11472
11371
|
title: es_extensions_1.ClassRequiredInitializationHasNotBeenExecutedError.localization.defaultTitle,
|
|
11473
|
-
occurrenceLocation: "
|
|
11474
|
-
});
|
|
11475
|
-
}
|
|
11476
|
-
return HTML_Validator.selfSoleInstance ??
|
|
11477
|
-
new Promise((resolve) => {
|
|
11478
|
-
HTML_Validator.onSelfSoleInstanceReadyEventsHandlers.add(resolve);
|
|
11372
|
+
occurrenceLocation: "HTML_Validator.getExpectedToBeInitializedSelfSingleInstance()"
|
|
11479
11373
|
});
|
|
11480
11374
|
}
|
|
11481
11375
|
}
|
|
11482
11376
|
(function (HTML_Validator) {
|
|
11483
|
-
let
|
|
11484
|
-
(function (
|
|
11377
|
+
let NormalizedValidationsResults;
|
|
11378
|
+
(function (NormalizedValidationsResults) {
|
|
11485
11379
|
let Issue;
|
|
11486
11380
|
(function (Issue) {
|
|
11487
11381
|
let Types;
|
|
@@ -11499,8 +11393,8 @@ class HTML_Validator {
|
|
|
11499
11393
|
Subtypes["schema"] = "schema";
|
|
11500
11394
|
Subtypes["internal"] = "internal";
|
|
11501
11395
|
})(Subtypes = Issue.Subtypes || (Issue.Subtypes = {}));
|
|
11502
|
-
})(Issue =
|
|
11503
|
-
})(
|
|
11396
|
+
})(Issue = NormalizedValidationsResults.Issue || (NormalizedValidationsResults.Issue = {}));
|
|
11397
|
+
})(NormalizedValidationsResults = HTML_Validator.NormalizedValidationsResults || (HTML_Validator.NormalizedValidationsResults = {}));
|
|
11504
11398
|
})(HTML_Validator || (HTML_Validator = {}));
|
|
11505
11399
|
exports["default"] = HTML_Validator;
|
|
11506
11400
|
|
|
@@ -11511,44 +11405,18 @@ exports["default"] = HTML_Validator;
|
|
|
11511
11405
|
/*!******************************************************************************************************************!*\
|
|
11512
11406
|
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/Plugins/HTML_Validator/HTML_ValidatorLocalization.english.ts ***!
|
|
11513
11407
|
\******************************************************************************************************************/
|
|
11514
|
-
/***/ ((__unused_webpack_module, exports
|
|
11408
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
11515
11409
|
|
|
11516
11410
|
|
|
11517
11411
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11518
|
-
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
11519
11412
|
const HTML_ValidatorLocalization__english = {
|
|
11520
|
-
|
|
11521
|
-
title: "HTML code validation terminated because of empty file",
|
|
11522
|
-
description: `File "${targetFileRelativePath}" is empty, no HTML to validate. ` +
|
|
11523
|
-
"Please note that at production-like modes the empty HTML files are being considered as invalid."
|
|
11524
|
-
}),
|
|
11525
|
-
generateValidationStartedInfoLog: ({ targetFileRelativePath }) => ({
|
|
11413
|
+
generateValidationStartedInfoLog: ({ targetFileRelativePaths }) => ({
|
|
11526
11414
|
title: "HTML code validation started",
|
|
11527
|
-
description:
|
|
11528
|
-
|
|
11529
|
-
|
|
11530
|
-
|
|
11531
|
-
description: "The error occurred during HTML validation. " +
|
|
11532
|
-
"It may be caused by the problems with the internet connection. " +
|
|
11533
|
-
"Well, we should not stop the project building because of this. " +
|
|
11534
|
-
"We believe that you will check the HTML validity afterwards and fix the issues if they will be."
|
|
11535
|
-
},
|
|
11536
|
-
generateValidationOfSingleFilesHasFinishedWithNoIssuesFoundSuccessLog: ({ targetFileRelativePath, secondsElapsed }) => ({
|
|
11537
|
-
title: "HTML validation of single file has finished with no issues found",
|
|
11538
|
-
description: `File "${targetFileRelativePath}" is fully obeying to W3C rules and recommendations.\n` +
|
|
11539
|
-
(0, es_extensions_1.isUndefined)(secondsElapsed) ?
|
|
11540
|
-
"(Cached result, no changes in output HTML code since last building)" :
|
|
11541
|
-
`${secondsElapsed} seconds taken.`
|
|
11542
|
-
}),
|
|
11543
|
-
generateIssuesFoundInSingleFileErrorLog: ({ targetFileRelativePath, formattedErrorsAndWarnings }) => ({
|
|
11544
|
-
title: "HTML validation, issue(s) found",
|
|
11545
|
-
description: `File "${targetFileRelativePath}" is including the following HTML validity issues:\n\n` +
|
|
11546
|
-
`${formattedErrorsAndWarnings}\n\n`
|
|
11415
|
+
description: "Begin the validation of the HTML code for the following files.\n" +
|
|
11416
|
+
targetFileRelativePaths.
|
|
11417
|
+
map((targetFileRelativePath) => `● ${targetFileRelativePath}`).
|
|
11418
|
+
join("\n")
|
|
11547
11419
|
}),
|
|
11548
|
-
validationOfAllFilesHasFinishedWithNoIssuesFoundSuccessLog: {
|
|
11549
|
-
title: "HTML validation, no issues found",
|
|
11550
|
-
description: "All files are fully obeying to W3C rules and recommendations."
|
|
11551
|
-
},
|
|
11552
11420
|
issuesFoundToastNotification: {
|
|
11553
11421
|
title: "HTML validation, issue(s) found",
|
|
11554
11422
|
message: "W3C rules violations and / or recommendations neglect detected. Check the console for the details."
|
|
@@ -11559,13 +11427,6 @@ const HTML_ValidatorLocalization__english = {
|
|
|
11559
11427
|
grossViolation: "Gross violation",
|
|
11560
11428
|
recommendationDisregard: "Recommendation disregard",
|
|
11561
11429
|
other: "Other issue"
|
|
11562
|
-
},
|
|
11563
|
-
issuesFoundInOneOrMultipleFilesErrorLog: {
|
|
11564
|
-
title: "HTML validation, issue(s) found",
|
|
11565
|
-
description: "The issue(s) has been found in one or more output HTML files. " +
|
|
11566
|
-
"Intended to be used for the high quality development, YDA can not accept the invalid HTML code on " +
|
|
11567
|
-
"production and production-like modes. " +
|
|
11568
|
-
"Its strongly recommended to fix these issue(s) instead of disabling of HTML validation."
|
|
11569
11430
|
}
|
|
11570
11431
|
};
|
|
11571
11432
|
exports["default"] = HTML_ValidatorLocalization__english;
|
|
@@ -12516,6 +12377,8 @@ const SourceCodeProcessingRawSettingsNormalizer_1 = __importDefault(__webpack_re
|
|
|
12516
12377
|
const RoutingSettingsNormalizer_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/RawSettingsNormalizer/RoutingSettingsNormalizer */ "./ProjectBuilding/SourceCodeProcessing/Markup/RawSettingsNormalizer/RoutingSettingsNormalizer.ts"));
|
|
12517
12378
|
/* ─── Utils ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
12518
12379
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
12380
|
+
const removeMultipleElementsFromSetByPredicate_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/Set/removeMultipleElementsFromSetByPredicate */ "./UtilsIncubator/Set/removeMultipleElementsFromSetByPredicate.ts"));
|
|
12381
|
+
const isSubdirectory_1 = __importDefault(__webpack_require__(/*! @UtilsIncubator/NodeJS/isSubdirectory */ "./UtilsIncubator/NodeJS/isSubdirectory.ts"));
|
|
12519
12382
|
const es_extensions_nodejs_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions-nodejs */ "@yamato-daiwa/es-extensions-nodejs");
|
|
12520
12383
|
/* ─── Localization ───────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
12521
12384
|
const MarkupProcessingRawSettingsNormalizerLocalization_english_1 = __importDefault(__webpack_require__(/*! ./MarkupProcessingRawSettingsNormalizerLocalization.english */ "./ProjectBuilding/SourceCodeProcessing/Markup/RawSettingsNormalizer/MarkupProcessingRawSettingsNormalizerLocalization.english.ts"));
|
|
@@ -12523,6 +12386,8 @@ class MarkupProcessingRawSettingsNormalizer extends SourceCodeProcessingRawSetti
|
|
|
12523
12386
|
static localization = MarkupProcessingRawSettingsNormalizerLocalization_english_1.default;
|
|
12524
12387
|
supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots = MarkupProcessingRestrictions_1.default.supportedSourceFilesNamesExtensionsWithoutLeadingDots;
|
|
12525
12388
|
markupProcessingSettings__fromFile__rawValid;
|
|
12389
|
+
unusedCommonlyExcludedFromLocalizationEntryPointsSourceFilesAbsolutePaths;
|
|
12390
|
+
commonStringResources;
|
|
12526
12391
|
static normalize({ markupProcessingSettings__fromFile__rawValid, commonSettings__normalized }) {
|
|
12527
12392
|
const dataHoldingSelfInstance = new MarkupProcessingRawSettingsNormalizer({
|
|
12528
12393
|
projectBuildingCommonSettings__normalized: commonSettings__normalized,
|
|
@@ -12573,6 +12438,14 @@ class MarkupProcessingRawSettingsNormalizer extends SourceCodeProcessingRawSetti
|
|
|
12573
12438
|
constructor(constructorParameter) {
|
|
12574
12439
|
super(constructorParameter);
|
|
12575
12440
|
this.markupProcessingSettings__fromFile__rawValid = constructorParameter.markupProcessingSettings__fromFile__rawValid;
|
|
12441
|
+
this.unusedCommonlyExcludedFromLocalizationEntryPointsSourceFilesAbsolutePaths = new Set((this.markupProcessingSettings__fromFile__rawValid.
|
|
12442
|
+
common?.
|
|
12443
|
+
localization?.
|
|
12444
|
+
excludedFilesPathsRelativeRelativeToProjectRootDirectory ??
|
|
12445
|
+
[]).map((excludedFilePathRelativeRelativeToProjectRootDirectory) => es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
12446
|
+
constructorParameter.projectBuildingCommonSettings__normalized.projectRootDirectoryAbsolutePath,
|
|
12447
|
+
excludedFilePathRelativeRelativeToProjectRootDirectory
|
|
12448
|
+
], { alwaysForwardSlashSeparators: true })));
|
|
12576
12449
|
}
|
|
12577
12450
|
computeMustResolveResourcesReferencesToAbsolutePathPropertyValue() {
|
|
12578
12451
|
const explicitlySpecifiedMustResolveResourceReferencesToRelativePathsPropertyValue = this.markupProcessingSettings__fromFile__rawValid.common?.
|
|
@@ -12632,103 +12505,120 @@ class MarkupProcessingRawSettingsNormalizer extends SourceCodeProcessingRawSetti
|
|
|
12632
12505
|
};
|
|
12633
12506
|
}
|
|
12634
12507
|
normalizeStaticPreviewPagesVariationsSettings() {
|
|
12635
|
-
const
|
|
12508
|
+
const stateDependentPagesVariationsSettings = this.markupProcessingSettings__fromFile__rawValid.staticPreview?.stateDependentPagesVariations;
|
|
12636
12509
|
const stateDependentPagesVariationsMetadata = new Map();
|
|
12637
|
-
if ((0, es_extensions_1.isUndefined)(
|
|
12510
|
+
if ((0, es_extensions_1.isUndefined)(stateDependentPagesVariationsSettings) ||
|
|
12638
12511
|
this.consumingProjectBuildingMode !== ConsumingProjectBuildingModes_1.default.staticPreview) {
|
|
12639
12512
|
return { stateDependent: stateDependentPagesVariationsMetadata };
|
|
12640
12513
|
}
|
|
12641
|
-
|
|
12642
|
-
|
|
12643
|
-
|
|
12644
|
-
|
|
12645
|
-
|
|
12646
|
-
|
|
12647
|
-
|
|
12648
|
-
|
|
12649
|
-
|
|
12650
|
-
|
|
12651
|
-
|
|
12652
|
-
|
|
12653
|
-
|
|
12654
|
-
|
|
12655
|
-
|
|
12656
|
-
|
|
12657
|
-
|
|
12514
|
+
const variationsByStatesSpecificationFileAbsolutePath = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
12515
|
+
this.consumingProjectRootDirectoryAbsolutePath,
|
|
12516
|
+
stateDependentPagesVariationsSettings.specificationFileRelativePath
|
|
12517
|
+
], { alwaysForwardSlashSeparators: true });
|
|
12518
|
+
/* [ Approach ] Currently, the `RawObjectDataProcessor` thus `ObjectDataFilesProcessor` are ignoring and not keep
|
|
12519
|
+
* the data which validation rules has not been specified. In this case, the state dependent object is
|
|
12520
|
+
* such data. */
|
|
12521
|
+
let rawPagesStateDependentVariationsSpecification;
|
|
12522
|
+
try {
|
|
12523
|
+
rawPagesStateDependentVariationsSpecification = es_extensions_nodejs_1.ObjectDataFilesProcessor.processFile({
|
|
12524
|
+
filePath: variationsByStatesSpecificationFileAbsolutePath,
|
|
12525
|
+
schema: es_extensions_nodejs_1.ObjectDataFilesProcessor.SupportedSchemas.YAML,
|
|
12526
|
+
synchronously: true
|
|
12527
|
+
});
|
|
12528
|
+
}
|
|
12529
|
+
catch (error) {
|
|
12530
|
+
es_extensions_1.Logger.throwErrorAndLog({
|
|
12531
|
+
errorInstance: new es_extensions_1.FileReadingFailedError({
|
|
12532
|
+
customMessage: MarkupProcessingRawSettingsNormalizer.localization.
|
|
12533
|
+
generateStaticPreviewStateDependentPagesVariationsSpecificationFileReadingFailedMessage({
|
|
12534
|
+
staticPreviewStateDependentPagesVariationsSpecificationFileAbsolutePath: variationsByStatesSpecificationFileAbsolutePath
|
|
12535
|
+
})
|
|
12536
|
+
}),
|
|
12537
|
+
title: es_extensions_1.FileReadingFailedError.localization.defaultTitle,
|
|
12538
|
+
occurrenceLocation: "MarkupProcessingRawSettingsNormalizer." +
|
|
12539
|
+
"normalizeStaticPreviewPagesVariationsSettings()",
|
|
12540
|
+
innerError: error
|
|
12541
|
+
});
|
|
12542
|
+
}
|
|
12543
|
+
if (!(0, es_extensions_1.isArbitraryObject)(rawPagesStateDependentVariationsSpecification)) {
|
|
12544
|
+
es_extensions_1.Logger.logError({
|
|
12545
|
+
errorType: es_extensions_1.InvalidExternalDataError.NAME,
|
|
12546
|
+
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12547
|
+
description: es_extensions_1.PoliteErrorsMessagesBuilder.buildMessage(MarkupProcessingRawSettingsNormalizer.localization.
|
|
12548
|
+
generateStaticPreviewStateDependentPagesVariationsSpecificationIsNotTheObjectErrorLog({
|
|
12549
|
+
staticPreviewStateDependentPagesVariationsSpecificationFileRelativePath: variationsByStatesSpecificationFileAbsolutePath,
|
|
12550
|
+
stringifiedRawData: (0, es_extensions_1.stringifyAndFormatArbitraryValue)(rawPagesStateDependentVariationsSpecification),
|
|
12551
|
+
rawDataActualType: typeof rawPagesStateDependentVariationsSpecification
|
|
12552
|
+
})),
|
|
12553
|
+
occurrenceLocation: "MarkupProcessingRawSettingsNormalizer." +
|
|
12554
|
+
"normalizeStaticPreviewPagesVariationsSettings()"
|
|
12555
|
+
});
|
|
12556
|
+
return {
|
|
12557
|
+
stateDependent: stateDependentPagesVariationsMetadata
|
|
12558
|
+
};
|
|
12559
|
+
}
|
|
12560
|
+
for (const [markupEntryPointSourceFileRelativePath__possiblyWithoutExtension, stateDependentPageVariationsData] of Object.entries(rawPagesStateDependentVariationsSpecification)) {
|
|
12561
|
+
const markupEntryPointSourceFileRelativePath = (0, es_extensions_1.appendLastFileNameExtension)({
|
|
12562
|
+
targetPath: markupEntryPointSourceFileRelativePath__possiblyWithoutExtension,
|
|
12563
|
+
targetFileNameExtensionWithOrWithoutLeadingDot: "pug",
|
|
12564
|
+
mustAppendDuplicateEvenIfTargetLastFileNameExtensionAlreadyPresentsAtSpecifiedPath: false
|
|
12565
|
+
});
|
|
12566
|
+
if (!(0, es_extensions_1.isArbitraryObject)(stateDependentPageVariationsData)) {
|
|
12658
12567
|
es_extensions_1.Logger.throwErrorAndLog({
|
|
12659
|
-
errorInstance: new es_extensions_1.
|
|
12568
|
+
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12660
12569
|
customMessage: MarkupProcessingRawSettingsNormalizer.localization.
|
|
12661
|
-
|
|
12662
|
-
|
|
12570
|
+
generateInvalidValueOfStaticPreviewStateDependentPagesVariationsSpecificationAssociativeArrayMessage({
|
|
12571
|
+
staticPreviewStateDependentPagesVariationsSpecificationFileRelativePath: stateDependentPagesVariationsSettings.specificationFileRelativePath,
|
|
12572
|
+
invalidEntryKey: markupEntryPointSourceFileRelativePath,
|
|
12573
|
+
invalidEntryValueType: typeof stateDependentPageVariationsData,
|
|
12574
|
+
invalidEntryStringifiedValue: (0, es_extensions_1.stringifyAndFormatArbitraryValue)(stateDependentPageVariationsData)
|
|
12663
12575
|
})
|
|
12664
12576
|
}),
|
|
12665
|
-
title: es_extensions_1.
|
|
12577
|
+
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12666
12578
|
occurrenceLocation: "MarkupProcessingRawSettingsNormalizer." +
|
|
12667
|
-
"normalizeStaticPreviewPagesVariationsSettings()"
|
|
12668
|
-
innerError: error
|
|
12579
|
+
"normalizeStaticPreviewPagesVariationsSettings()"
|
|
12669
12580
|
});
|
|
12670
12581
|
}
|
|
12671
|
-
if (!(0, es_extensions_1.
|
|
12672
|
-
es_extensions_1.Logger.
|
|
12673
|
-
|
|
12582
|
+
if (!(0, es_extensions_1.isNonEmptyString)(stateDependentPageVariationsData.$stateObjectTypeVariableName)) {
|
|
12583
|
+
es_extensions_1.Logger.throwErrorAndLog({
|
|
12584
|
+
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12585
|
+
customMessage: MarkupProcessingRawSettingsNormalizer.localization.generateInvalidPageStateVariableNameMessage({
|
|
12586
|
+
targetMarkupFileRelativePath: markupEntryPointSourceFileRelativePath,
|
|
12587
|
+
stringifiedValueOfSpecifiedVariableNameProperty: (0, es_extensions_1.stringifyAndFormatArbitraryValue)(stateDependentPageVariationsData.$stateObjectTypeVariableName),
|
|
12588
|
+
specifiedTypeOfVariableNameProperty: typeof stateDependentPageVariationsData.$stateObjectTypeVariableName
|
|
12589
|
+
})
|
|
12590
|
+
}),
|
|
12674
12591
|
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12675
|
-
description: es_extensions_1.PoliteErrorsMessagesBuilder.buildMessage(MarkupProcessingRawSettingsNormalizer.localization.
|
|
12676
|
-
generateStaticPreviewStateDependentPagesVariationsSpecificationIsNotTheObjectErrorLog({
|
|
12677
|
-
staticPreviewStateDependentPagesVariationsSpecificationFileRelativePath: variationsByStatesSpecificationFileAbsolutePath,
|
|
12678
|
-
stringifiedRawData: (0, es_extensions_1.stringifyAndFormatArbitraryValue)(rawPagesStateDependentVariationsSpecification),
|
|
12679
|
-
rawDataActualType: typeof rawPagesStateDependentVariationsSpecification
|
|
12680
|
-
})),
|
|
12681
12592
|
occurrenceLocation: "MarkupProcessingRawSettingsNormalizer." +
|
|
12682
12593
|
"normalizeStaticPreviewPagesVariationsSettings()"
|
|
12683
12594
|
});
|
|
12684
|
-
return {
|
|
12685
|
-
stateDependent: stateDependentPagesVariationsMetadata
|
|
12686
|
-
};
|
|
12687
12595
|
}
|
|
12688
|
-
|
|
12689
|
-
|
|
12690
|
-
|
|
12691
|
-
|
|
12692
|
-
|
|
12596
|
+
if (!(0, es_extensions_1.isArbitraryObject)(stateDependentPageVariationsData.$stateDependentVariations)) {
|
|
12597
|
+
es_extensions_1.Logger.throwErrorAndLog({
|
|
12598
|
+
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12599
|
+
customMessage: MarkupProcessingRawSettingsNormalizer.localization.
|
|
12600
|
+
generateInvalidPageStateDependentVariationsSpecificationMessage({
|
|
12601
|
+
targetMarkupFileRelativePath: markupEntryPointSourceFileRelativePath,
|
|
12602
|
+
actualType: typeof stateDependentPageVariationsData.$stateDependentVariations,
|
|
12603
|
+
actualStringifiedValue: (0, es_extensions_1.stringifyAndFormatArbitraryValue)(stateDependentPageVariationsData.$stateDependentVariations)
|
|
12604
|
+
})
|
|
12605
|
+
}),
|
|
12606
|
+
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12607
|
+
occurrenceLocation: "MarkupProcessingRawSettingsNormalizer." +
|
|
12608
|
+
"normalizeStaticPreviewPagesVariationsSettings()"
|
|
12693
12609
|
});
|
|
12694
|
-
|
|
12695
|
-
|
|
12696
|
-
|
|
12697
|
-
|
|
12698
|
-
|
|
12699
|
-
|
|
12700
|
-
invalidEntryKey: markupEntryPointSourceFileRelativePath,
|
|
12701
|
-
invalidEntryValueType: typeof stateDependentPageVariationsData,
|
|
12702
|
-
invalidEntryStringifiedValue: (0, es_extensions_1.stringifyAndFormatArbitraryValue)(stateDependentPageVariationsData)
|
|
12703
|
-
})
|
|
12704
|
-
}),
|
|
12705
|
-
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12706
|
-
occurrenceLocation: "MarkupProcessingRawSettingsNormalizer." +
|
|
12707
|
-
"normalizeStaticPreviewPagesVariationsSettings()"
|
|
12708
|
-
});
|
|
12709
|
-
}
|
|
12710
|
-
if (!(0, es_extensions_1.isNonEmptyString)(stateDependentPageVariationsData.$stateObjectTypeVariableName)) {
|
|
12711
|
-
es_extensions_1.Logger.throwErrorAndLog({
|
|
12712
|
-
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12713
|
-
customMessage: MarkupProcessingRawSettingsNormalizer.localization.generateInvalidPageStateVariableNameMessage({
|
|
12714
|
-
targetMarkupFileRelativePath: markupEntryPointSourceFileRelativePath,
|
|
12715
|
-
stringifiedValueOfSpecifiedVariableNameProperty: (0, es_extensions_1.stringifyAndFormatArbitraryValue)(stateDependentPageVariationsData.$stateObjectTypeVariableName),
|
|
12716
|
-
specifiedTypeOfVariableNameProperty: typeof stateDependentPageVariationsData.$stateObjectTypeVariableName
|
|
12717
|
-
})
|
|
12718
|
-
}),
|
|
12719
|
-
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12720
|
-
occurrenceLocation: "MarkupProcessingRawSettingsNormalizer." +
|
|
12721
|
-
"normalizeStaticPreviewPagesVariationsSettings()"
|
|
12722
|
-
});
|
|
12723
|
-
}
|
|
12724
|
-
if (!(0, es_extensions_1.isArbitraryObject)(stateDependentPageVariationsData.$stateDependentVariations)) {
|
|
12610
|
+
}
|
|
12611
|
+
const markupSourceFileFileAbsolutePath = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([this.consumingProjectRootDirectoryAbsolutePath, markupEntryPointSourceFileRelativePath], { alwaysForwardSlashSeparators: true });
|
|
12612
|
+
const derivedPagesAndStatesMap = new Map();
|
|
12613
|
+
for (const [fineNamePostfix, stateData] of Object.entries(stateDependentPageVariationsData.$stateDependentVariations)) {
|
|
12614
|
+
const derivedFileAbsolutePath = `${(0, es_extensions_1.removeAllFileNameExtensions)(markupSourceFileFileAbsolutePath)}${fineNamePostfix}.pug`;
|
|
12615
|
+
if (!(0, es_extensions_1.isArbitraryObject)(stateData)) {
|
|
12725
12616
|
es_extensions_1.Logger.throwErrorAndLog({
|
|
12726
12617
|
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12727
|
-
customMessage: MarkupProcessingRawSettingsNormalizer.localization.
|
|
12728
|
-
generateInvalidPageStateDependentVariationsSpecificationMessage({
|
|
12618
|
+
customMessage: MarkupProcessingRawSettingsNormalizer.localization.generateInvalidPageStateVariableMessage({
|
|
12729
12619
|
targetMarkupFileRelativePath: markupEntryPointSourceFileRelativePath,
|
|
12730
|
-
|
|
12731
|
-
|
|
12620
|
+
actualStringifiedValue: (0, es_extensions_1.stringifyAndFormatArbitraryValue)(stateData),
|
|
12621
|
+
actualType: typeof stateData
|
|
12732
12622
|
})
|
|
12733
12623
|
}),
|
|
12734
12624
|
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
@@ -12736,57 +12626,15 @@ class MarkupProcessingRawSettingsNormalizer extends SourceCodeProcessingRawSetti
|
|
|
12736
12626
|
"normalizeStaticPreviewPagesVariationsSettings()"
|
|
12737
12627
|
});
|
|
12738
12628
|
}
|
|
12739
|
-
|
|
12740
|
-
const derivedPagesAndStatesMap = new Map();
|
|
12741
|
-
for (const [fineNamePostfix, stateData] of Object.entries(stateDependentPageVariationsData.$stateDependentVariations)) {
|
|
12742
|
-
const derivedFileAbsolutePath = `${(0, es_extensions_1.removeAllFileNameExtensions)(markupSourceFileFileAbsolutePath)}${fineNamePostfix}.pug`;
|
|
12743
|
-
if (!(0, es_extensions_1.isArbitraryObject)(stateData)) {
|
|
12744
|
-
es_extensions_1.Logger.throwErrorAndLog({
|
|
12745
|
-
errorInstance: new es_extensions_1.InvalidExternalDataError({
|
|
12746
|
-
customMessage: MarkupProcessingRawSettingsNormalizer.localization.generateInvalidPageStateVariableMessage({
|
|
12747
|
-
targetMarkupFileRelativePath: markupEntryPointSourceFileRelativePath,
|
|
12748
|
-
actualStringifiedValue: (0, es_extensions_1.stringifyAndFormatArbitraryValue)(stateData),
|
|
12749
|
-
actualType: typeof stateData
|
|
12750
|
-
})
|
|
12751
|
-
}),
|
|
12752
|
-
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12753
|
-
occurrenceLocation: "MarkupProcessingRawSettingsNormalizer." +
|
|
12754
|
-
"normalizeStaticPreviewPagesVariationsSettings()"
|
|
12755
|
-
});
|
|
12756
|
-
}
|
|
12757
|
-
derivedPagesAndStatesMap.set(derivedFileAbsolutePath, stateData);
|
|
12758
|
-
}
|
|
12759
|
-
stateDependentPagesVariationsMetadata.set(es_extensions_nodejs_1.ImprovedPath.joinPathSegments([this.consumingProjectRootDirectoryAbsolutePath, markupEntryPointSourceFileRelativePath], { alwaysForwardSlashSeparators: true }), {
|
|
12760
|
-
stateVariableName: stateDependentPageVariationsData.$stateObjectTypeVariableName,
|
|
12761
|
-
derivedPagesAndStatesMap
|
|
12762
|
-
});
|
|
12629
|
+
derivedPagesAndStatesMap.set(derivedFileAbsolutePath, stateData);
|
|
12763
12630
|
}
|
|
12631
|
+
stateDependentPagesVariationsMetadata.set(es_extensions_nodejs_1.ImprovedPath.joinPathSegments([this.consumingProjectRootDirectoryAbsolutePath, markupEntryPointSourceFileRelativePath], { alwaysForwardSlashSeparators: true }), {
|
|
12632
|
+
stateVariableName: stateDependentPageVariationsData.$stateObjectTypeVariableName,
|
|
12633
|
+
derivedPagesAndStatesMap
|
|
12634
|
+
});
|
|
12764
12635
|
}
|
|
12765
|
-
if ((0, es_extensions_1.isUndefined)(staticPreviewPageVariationsSettings.localeDependent)) {
|
|
12766
|
-
return { stateDependent: stateDependentPagesVariationsMetadata };
|
|
12767
|
-
}
|
|
12768
|
-
const stringResources = this.getStringResourcesFromFileIfExist(staticPreviewPageVariationsSettings.localeDependent.stringResourcesFileRelativePath);
|
|
12769
|
-
const localeDependentPagesVariationsMetadata = {
|
|
12770
|
-
localizedStringResourcesConstantName: staticPreviewPageVariationsSettings.localeDependent.
|
|
12771
|
-
localizedStringResourcesConstantName,
|
|
12772
|
-
localeVariableName: staticPreviewPageVariationsSettings.localeDependent.localeVariableName,
|
|
12773
|
-
locales: new Map(Object.entries(staticPreviewPageVariationsSettings.localeDependent.locales).
|
|
12774
|
-
map(([localeKey, localeData]) => [
|
|
12775
|
-
localeKey,
|
|
12776
|
-
{
|
|
12777
|
-
...(0, es_extensions_1.isNotNull)(stringResources) && (0, es_extensions_1.isNotUndefined)(localeData.keyInLocalizedStringResourcesObject) ?
|
|
12778
|
-
{ stringResources: stringResources[localeData.keyInLocalizedStringResourcesObject] } : null,
|
|
12779
|
-
...(0, es_extensions_1.isNotUndefined)(localeData.localeVariableValue) ?
|
|
12780
|
-
{ localeVariableValue: localeData.localeVariableValue } : null,
|
|
12781
|
-
outputFileInterimNameExtensionWithoutDot: localeData.outputFileInterimNameExtensionWithoutDot
|
|
12782
|
-
}
|
|
12783
|
-
])),
|
|
12784
|
-
excludedFilesAbsolutePaths: staticPreviewPageVariationsSettings.localeDependent.excludedFilesRelativePaths?.
|
|
12785
|
-
map((excludedFileRelativePath) => es_extensions_nodejs_1.ImprovedPath.joinPathSegments([this.consumingProjectRootDirectoryAbsolutePath, excludedFileRelativePath], { alwaysForwardSlashSeparators: true })) ?? []
|
|
12786
|
-
};
|
|
12787
12636
|
return {
|
|
12788
|
-
stateDependent: stateDependentPagesVariationsMetadata
|
|
12789
|
-
localeDependent: localeDependentPagesVariationsMetadata
|
|
12637
|
+
stateDependent: stateDependentPagesVariationsMetadata
|
|
12790
12638
|
};
|
|
12791
12639
|
}
|
|
12792
12640
|
normalizeImportsFromStaticDataFiles() {
|
|
@@ -12822,6 +12670,7 @@ class MarkupProcessingRawSettingsNormalizer extends SourceCodeProcessingRawSetti
|
|
|
12822
12670
|
return {
|
|
12823
12671
|
...entryPointsGroupGenericSettings__normalized,
|
|
12824
12672
|
outputFormat,
|
|
12673
|
+
localization: this.normalizeEntryPointsGroupLocalizationsSettings(entryPointsGroupGenericSettings__normalized.sourceFilesTopDirectoryAbsolutePath, entryPointsGroupSettings__rawValid.localization),
|
|
12825
12674
|
HTML_Validation: {
|
|
12826
12675
|
mustExecute: entryPointsGroupSettings__rawValid.HTML_Validation?.disable === true ? false :
|
|
12827
12676
|
MarkupProcessingSettings__Default_1.default.HTML_Validation.mustExecute,
|
|
@@ -12888,10 +12737,66 @@ class MarkupProcessingRawSettingsNormalizer extends SourceCodeProcessingRawSetti
|
|
|
12888
12737
|
}
|
|
12889
12738
|
};
|
|
12890
12739
|
}
|
|
12891
|
-
|
|
12892
|
-
|
|
12893
|
-
|
|
12740
|
+
normalizeEntryPointsGroupLocalizationsSettings(sourceFilesTopDirectoryAbsolutePath, entryPointGroupLocalizationSettings__rawValid) {
|
|
12741
|
+
const localizedStringResourcesConstantName = entryPointGroupLocalizationSettings__rawValid?.localizedStringResourcesConstantName ??
|
|
12742
|
+
this.markupProcessingSettings__fromFile__rawValid.common?.localization?.localizedStringResourcesConstantName;
|
|
12743
|
+
const localeConstantName = entryPointGroupLocalizationSettings__rawValid?.localeConstantName ??
|
|
12744
|
+
this.markupProcessingSettings__fromFile__rawValid.common?.localization?.localeConstantName;
|
|
12745
|
+
const nameOfConstantForInterpolationToLangHTML_Attribute = entryPointGroupLocalizationSettings__rawValid?.nameOfConstantForInterpolationToLangHTML_Attribute ??
|
|
12746
|
+
this.markupProcessingSettings__fromFile__rawValid.common?.localization?.
|
|
12747
|
+
nameOfConstantForInterpolationToLangHTML_Attribute;
|
|
12748
|
+
if ((0, es_extensions_1.isUndefined)(this.commonStringResources) &&
|
|
12749
|
+
(0, es_extensions_1.isNotUndefined)(this.markupProcessingSettings__fromFile__rawValid.common?.localization?.stringResourcesFileRelativePath)) {
|
|
12750
|
+
this.commonStringResources = this.getStringResourcesFromFile(this.markupProcessingSettings__fromFile__rawValid.common.localization.stringResourcesFileRelativePath);
|
|
12751
|
+
}
|
|
12752
|
+
const entryPointGroupStringResources = (0, es_extensions_1.isNotUndefined)(entryPointGroupLocalizationSettings__rawValid?.stringResourcesFileRelativePath) ?
|
|
12753
|
+
this.getStringResourcesFromFile(entryPointGroupLocalizationSettings__rawValid.stringResourcesFileRelativePath) :
|
|
12754
|
+
this.commonStringResources;
|
|
12755
|
+
const locales = new Map();
|
|
12756
|
+
for (const [localeKey, { outputFileInterimNameExtensionWithoutDot, localeConstantValue, keyInLocalizedStringResourcesObject, valueOfConstantForInterpolationToLangHTML_Attribute }] of Object.entries(this.markupProcessingSettings__fromFile__rawValid.common?.localization?.locales ?? {})) {
|
|
12757
|
+
locales.set(localeKey, {
|
|
12758
|
+
outputFileInterimNameExtensionWithoutDot,
|
|
12759
|
+
...(0, es_extensions_1.isNotUndefined)(entryPointGroupStringResources) && (0, es_extensions_1.isNotUndefined)(keyInLocalizedStringResourcesObject) ? {
|
|
12760
|
+
stringResources: entryPointGroupStringResources[keyInLocalizedStringResourcesObject]
|
|
12761
|
+
} : null,
|
|
12762
|
+
...(0, es_extensions_1.isNotUndefined)(localeConstantValue) ? { localeConstantValue } : null,
|
|
12763
|
+
...(0, es_extensions_1.isNotUndefined)(valueOfConstantForInterpolationToLangHTML_Attribute) ?
|
|
12764
|
+
{ valueOfConstantForInterpolationToLangHTML_Attribute } : null
|
|
12765
|
+
});
|
|
12894
12766
|
}
|
|
12767
|
+
for (const [localeKey, { outputFileInterimNameExtensionWithoutDot, localeConstantValue, keyInLocalizedStringResourcesObject, valueOfConstantForInterpolationToLangHTML_Attribute }] of Object.entries(entryPointGroupLocalizationSettings__rawValid?.locales ?? {})) {
|
|
12768
|
+
const normalizedLocaleToOverride = locales.get(localeKey);
|
|
12769
|
+
locales.set(localeKey, {
|
|
12770
|
+
...normalizedLocaleToOverride ?? null,
|
|
12771
|
+
outputFileInterimNameExtensionWithoutDot,
|
|
12772
|
+
...(0, es_extensions_1.isNotUndefined)(entryPointGroupStringResources) && (0, es_extensions_1.isNotUndefined)(keyInLocalizedStringResourcesObject) ? {
|
|
12773
|
+
stringResources: entryPointGroupStringResources[keyInLocalizedStringResourcesObject]
|
|
12774
|
+
} : null,
|
|
12775
|
+
...(0, es_extensions_1.isNotUndefined)(localeConstantValue) ? { localeConstantValue } : null,
|
|
12776
|
+
...(0, es_extensions_1.isNotUndefined)(valueOfConstantForInterpolationToLangHTML_Attribute) ?
|
|
12777
|
+
{ valueOfConstantForInterpolationToLangHTML_Attribute } : null
|
|
12778
|
+
});
|
|
12779
|
+
}
|
|
12780
|
+
return {
|
|
12781
|
+
...(0, es_extensions_1.isNotUndefined)(localizedStringResourcesConstantName) ? { localizedStringResourcesConstantName } : null,
|
|
12782
|
+
...(0, es_extensions_1.isNotUndefined)(localeConstantName) ? { localeConstantName } : null,
|
|
12783
|
+
...(0, es_extensions_1.isNotUndefined)(nameOfConstantForInterpolationToLangHTML_Attribute) ?
|
|
12784
|
+
{ nameOfConstantForInterpolationToLangHTML_Attribute } : null,
|
|
12785
|
+
locales,
|
|
12786
|
+
excludedFilesAbsolutePaths: (entryPointGroupLocalizationSettings__rawValid?.
|
|
12787
|
+
excludedFilesPathsRelativeToSourcesFilesTopDirectory?.
|
|
12788
|
+
map((excludedFilePathRelativeRelativeToSourcesFileTopDirectory) => es_extensions_nodejs_1.ImprovedPath.joinPathSegments([sourceFilesTopDirectoryAbsolutePath, excludedFilePathRelativeRelativeToSourcesFileTopDirectory], { alwaysForwardSlashSeparators: true })) ??
|
|
12789
|
+
[]).
|
|
12790
|
+
concat(Array.from((0, removeMultipleElementsFromSetByPredicate_1.default)({
|
|
12791
|
+
targetSet: this.unusedCommonlyExcludedFromLocalizationEntryPointsSourceFilesAbsolutePaths,
|
|
12792
|
+
predicate: (commonlyExcludedFromLocalizationEntryPointsSourceFileAbsolutePath) => (0, isSubdirectory_1.default)({
|
|
12793
|
+
whichPath: commonlyExcludedFromLocalizationEntryPointsSourceFileAbsolutePath,
|
|
12794
|
+
ofWhichPath: sourceFilesTopDirectoryAbsolutePath
|
|
12795
|
+
})
|
|
12796
|
+
}).removedElements))
|
|
12797
|
+
};
|
|
12798
|
+
}
|
|
12799
|
+
getStringResourcesFromFile(stringResourcesFileRelativePath) {
|
|
12895
12800
|
const stringResourcesFileAbsolutePath = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([this.consumingProjectRootDirectoryAbsolutePath, stringResourcesFileRelativePath], { alwaysForwardSlashSeparators: true });
|
|
12896
12801
|
let stringResources;
|
|
12897
12802
|
try {
|
|
@@ -12918,7 +12823,7 @@ class MarkupProcessingRawSettingsNormalizer extends SourceCodeProcessingRawSetti
|
|
|
12918
12823
|
}),
|
|
12919
12824
|
title: es_extensions_1.InvalidExternalDataError.localization.defaultTitle,
|
|
12920
12825
|
occurrenceLocation: "markupProcessingRawSettingsNormalizer." +
|
|
12921
|
-
"getStringResourcesFromFileIfExist(stringResourcesFileRelativePath)"
|
|
12826
|
+
"getStringResourcesFromFileIfExist(stringResourcesFileRelativePath)"
|
|
12922
12827
|
});
|
|
12923
12828
|
}
|
|
12924
12829
|
return stringResources;
|
|
@@ -16079,6 +15984,53 @@ function extractStringifiedContentFromVinylFile(targetFile) {
|
|
|
16079
15984
|
}
|
|
16080
15985
|
|
|
16081
15986
|
|
|
15987
|
+
/***/ }),
|
|
15988
|
+
|
|
15989
|
+
/***/ "./UtilsIncubator/NodeJS/isSubdirectory.ts":
|
|
15990
|
+
/*!*************************************************!*\
|
|
15991
|
+
!*** ./UtilsIncubator/NodeJS/isSubdirectory.ts ***!
|
|
15992
|
+
\*************************************************/
|
|
15993
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
15994
|
+
|
|
15995
|
+
|
|
15996
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15997
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15998
|
+
};
|
|
15999
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
16000
|
+
exports["default"] = isSubdirectory;
|
|
16001
|
+
const path_1 = __importDefault(__webpack_require__(/*! path */ "path"));
|
|
16002
|
+
function isSubdirectory({ whichPath, ofWhichPath }) {
|
|
16003
|
+
const relativePath = path_1.default.relative(ofWhichPath, whichPath);
|
|
16004
|
+
return relativePath.length > 0 && !relativePath.startsWith("..") && !path_1.default.isAbsolute(relativePath);
|
|
16005
|
+
}
|
|
16006
|
+
|
|
16007
|
+
|
|
16008
|
+
/***/ }),
|
|
16009
|
+
|
|
16010
|
+
/***/ "./UtilsIncubator/Set/removeMultipleElementsFromSetByPredicate.ts":
|
|
16011
|
+
/*!************************************************************************!*\
|
|
16012
|
+
!*** ./UtilsIncubator/Set/removeMultipleElementsFromSetByPredicate.ts ***!
|
|
16013
|
+
\************************************************************************/
|
|
16014
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
16015
|
+
|
|
16016
|
+
|
|
16017
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
16018
|
+
exports["default"] = removeMultipleElementsFromSetByPredicate;
|
|
16019
|
+
function removeMultipleElementsFromSetByPredicate({ targetSet, predicate }) {
|
|
16020
|
+
const removedElements = [];
|
|
16021
|
+
for (const element of targetSet) {
|
|
16022
|
+
if (predicate(element)) {
|
|
16023
|
+
targetSet.delete(element);
|
|
16024
|
+
removedElements.push(element);
|
|
16025
|
+
}
|
|
16026
|
+
}
|
|
16027
|
+
return {
|
|
16028
|
+
updatedSet: targetSet,
|
|
16029
|
+
removedElements
|
|
16030
|
+
};
|
|
16031
|
+
}
|
|
16032
|
+
|
|
16033
|
+
|
|
16082
16034
|
/***/ }),
|
|
16083
16035
|
|
|
16084
16036
|
/***/ "./UtilsIncubator/Stopwatch.ts":
|
|
@@ -16209,16 +16161,6 @@ module.exports = require("browser-sync");
|
|
|
16209
16161
|
|
|
16210
16162
|
/***/ }),
|
|
16211
16163
|
|
|
16212
|
-
/***/ "chalk":
|
|
16213
|
-
/*!************************!*\
|
|
16214
|
-
!*** external "chalk" ***!
|
|
16215
|
-
\************************/
|
|
16216
|
-
/***/ ((module) => {
|
|
16217
|
-
|
|
16218
|
-
module.exports = require("chalk");
|
|
16219
|
-
|
|
16220
|
-
/***/ }),
|
|
16221
|
-
|
|
16222
16164
|
/***/ "cssnano":
|
|
16223
16165
|
/*!**************************!*\
|
|
16224
16166
|
!*** external "cssnano" ***!
|
|
@@ -16249,16 +16191,6 @@ module.exports = require("eslint");
|
|
|
16249
16191
|
|
|
16250
16192
|
/***/ }),
|
|
16251
16193
|
|
|
16252
|
-
/***/ "fancy-log":
|
|
16253
|
-
/*!****************************!*\
|
|
16254
|
-
!*** external "fancy-log" ***!
|
|
16255
|
-
\****************************/
|
|
16256
|
-
/***/ ((module) => {
|
|
16257
|
-
|
|
16258
|
-
module.exports = require("fancy-log");
|
|
16259
|
-
|
|
16260
|
-
/***/ }),
|
|
16261
|
-
|
|
16262
16194
|
/***/ "fork-ts-checker-webpack-plugin":
|
|
16263
16195
|
/*!*************************************************!*\
|
|
16264
16196
|
!*** external "fork-ts-checker-webpack-plugin" ***!
|
|
@@ -16399,6 +16331,16 @@ module.exports = require("js-beautify");
|
|
|
16399
16331
|
|
|
16400
16332
|
/***/ }),
|
|
16401
16333
|
|
|
16334
|
+
/***/ "nanoid":
|
|
16335
|
+
/*!*************************!*\
|
|
16336
|
+
!*** external "nanoid" ***!
|
|
16337
|
+
\*************************/
|
|
16338
|
+
/***/ ((module) => {
|
|
16339
|
+
|
|
16340
|
+
module.exports = require("nanoid");
|
|
16341
|
+
|
|
16342
|
+
/***/ }),
|
|
16343
|
+
|
|
16402
16344
|
/***/ "node-html-parser":
|
|
16403
16345
|
/*!***********************************!*\
|
|
16404
16346
|
!*** external "node-html-parser" ***!
|
|
@@ -16419,6 +16361,16 @@ module.exports = require("node-notifier");
|
|
|
16419
16361
|
|
|
16420
16362
|
/***/ }),
|
|
16421
16363
|
|
|
16364
|
+
/***/ "node:child_process":
|
|
16365
|
+
/*!*************************************!*\
|
|
16366
|
+
!*** external "node:child_process" ***!
|
|
16367
|
+
\*************************************/
|
|
16368
|
+
/***/ ((module) => {
|
|
16369
|
+
|
|
16370
|
+
module.exports = require("node:child_process");
|
|
16371
|
+
|
|
16372
|
+
/***/ }),
|
|
16373
|
+
|
|
16422
16374
|
/***/ "node:crypto":
|
|
16423
16375
|
/*!******************************!*\
|
|
16424
16376
|
!*** external "node:crypto" ***!
|
|
@@ -16509,16 +16461,6 @@ module.exports = require("puppeteer");
|
|
|
16509
16461
|
|
|
16510
16462
|
/***/ }),
|
|
16511
16463
|
|
|
16512
|
-
/***/ "slash":
|
|
16513
|
-
/*!************************!*\
|
|
16514
|
-
!*** external "slash" ***!
|
|
16515
|
-
\************************/
|
|
16516
|
-
/***/ ((module) => {
|
|
16517
|
-
|
|
16518
|
-
module.exports = require("slash");
|
|
16519
|
-
|
|
16520
|
-
/***/ }),
|
|
16521
|
-
|
|
16522
16464
|
/***/ "stream":
|
|
16523
16465
|
/*!*************************!*\
|
|
16524
16466
|
!*** external "stream" ***!
|
|
@@ -16539,16 +16481,6 @@ module.exports = require("stream-combiner2");
|
|
|
16539
16481
|
|
|
16540
16482
|
/***/ }),
|
|
16541
16483
|
|
|
16542
|
-
/***/ "superagent":
|
|
16543
|
-
/*!*****************************!*\
|
|
16544
|
-
!*** external "superagent" ***!
|
|
16545
|
-
\*****************************/
|
|
16546
|
-
/***/ ((module) => {
|
|
16547
|
-
|
|
16548
|
-
module.exports = require("superagent");
|
|
16549
|
-
|
|
16550
|
-
/***/ }),
|
|
16551
|
-
|
|
16552
16484
|
/***/ "typescript":
|
|
16553
16485
|
/*!*****************************!*\
|
|
16554
16486
|
!*** external "typescript" ***!
|
|
@@ -16569,6 +16501,16 @@ module.exports = require("vinyl");
|
|
|
16569
16501
|
|
|
16570
16502
|
/***/ }),
|
|
16571
16503
|
|
|
16504
|
+
/***/ "vnu-jar":
|
|
16505
|
+
/*!**************************!*\
|
|
16506
|
+
!*** external "vnu-jar" ***!
|
|
16507
|
+
\**************************/
|
|
16508
|
+
/***/ ((module) => {
|
|
16509
|
+
|
|
16510
|
+
module.exports = require("vnu-jar");
|
|
16511
|
+
|
|
16512
|
+
/***/ }),
|
|
16513
|
+
|
|
16572
16514
|
/***/ "vue-loader":
|
|
16573
16515
|
/*!*****************************!*\
|
|
16574
16516
|
!*** external "vue-loader" ***!
|