@kontur.candy/generator 4.281.0 → 4.282.0-fs-7386.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/dist/index.js +58 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -131142,6 +131142,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
131142
131142
|
/* harmony import */ var _LazyLoadDeclarationGenerator_LazyLoadDeclarationGenerator__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./LazyLoadDeclarationGenerator/LazyLoadDeclarationGenerator */ "./Generator/src/generators/LazyLoadDeclarationGenerator/LazyLoadDeclarationGenerator.ts");
|
|
131143
131143
|
/* harmony import */ var _ServerSideFLangNormalization_FormulaOnlyNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./ServerSideFLangNormalization/FormulaOnlyNormalizationRuleGenerator */ "./Generator/src/generators/ServerSideFLangNormalization/FormulaOnlyNormalizationRuleGenerator.ts");
|
|
131144
131144
|
/* harmony import */ var _HelperFunctionsGenerator_CommonHelperFunctionsGenerator__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./HelperFunctionsGenerator/CommonHelperFunctionsGenerator */ "./Generator/src/generators/HelperFunctionsGenerator/CommonHelperFunctionsGenerator.ts");
|
|
131145
|
+
/* harmony import */ var _ServerSideFLangNormalization_AdditionalNormalizerFile__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./ServerSideFLangNormalization/AdditionalNormalizerFile */ "./Generator/src/generators/ServerSideFLangNormalization/AdditionalNormalizerFile.ts");
|
|
131146
|
+
|
|
131145
131147
|
|
|
131146
131148
|
|
|
131147
131149
|
|
|
@@ -131229,11 +131231,22 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
131229
131231
|
|
|
131230
131232
|
const normalizationRules = normalizationRulesGenerator.generateRules(resourcesHash);
|
|
131231
131233
|
const formulaNormalizationRules = (_additionalContent$fo5 = additionalContent.formJsonSettings) !== null && _additionalContent$fo5 !== void 0 && _additionalContent$fo5.disableFlangRulesForEnableAutoFieldFeature ? "" : formlulaOnlyNormalizationRulesGenerator.generateRules(resourcesHash);
|
|
131232
|
-
const
|
|
131234
|
+
const additionalNormalizationRules = formulaNormalizationRules != "" ? [{
|
|
131233
131235
|
content: formulaNormalizationRules,
|
|
131234
131236
|
normalizerId: "formulas"
|
|
131235
131237
|
}] : [];
|
|
131236
|
-
|
|
131238
|
+
|
|
131239
|
+
if (additionalContent.additionalNormalizers) {
|
|
131240
|
+
for (const additionalNormalizer of additionalContent.additionalNormalizers) {
|
|
131241
|
+
const isDefault = additionalNormalizer.filenameWithoutExtension.toLowerCase() === _ServerSideFLangNormalization_AdditionalNormalizerFile__WEBPACK_IMPORTED_MODULE_32__.defaultNormalizerFilename.toLowerCase();
|
|
131242
|
+
additionalNormalizationRules.push({
|
|
131243
|
+
content: additionalNormalizer.content,
|
|
131244
|
+
normalizerId: isDefault ? undefined : additionalNormalizer.filenameWithoutExtension
|
|
131245
|
+
});
|
|
131246
|
+
}
|
|
131247
|
+
}
|
|
131248
|
+
|
|
131249
|
+
const resultRules = combineFlangRules(normalizationRules, ...additionalNormalizationRules);
|
|
131237
131250
|
builder.addServerSideResource("ServerSide.normalize", resultRules);
|
|
131238
131251
|
}
|
|
131239
131252
|
|
|
@@ -131280,7 +131293,9 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
131280
131293
|
}
|
|
131281
131294
|
|
|
131282
131295
|
function combineFlangRules(baseRules, ...rules) {
|
|
131283
|
-
|
|
131296
|
+
const customNormalizeRules = rules.filter(r => r.normalizerId).map(x => `--${x.normalizerId}--\n${x.content}`);
|
|
131297
|
+
const additionalBaseRules = rules.filter(r => !r.normalizerId).map(r => r.content);
|
|
131298
|
+
return [baseRules].concat(additionalBaseRules).concat(customNormalizeRules).join("\n");
|
|
131284
131299
|
}
|
|
131285
131300
|
|
|
131286
131301
|
function getReferencedFetchFunctions(fetchFunctionSources) {
|
|
@@ -131412,7 +131427,8 @@ async function readFormSources(formSourcesPath, farmDirectory) {
|
|
|
131412
131427
|
customControlsContent: await readCustomControlsFiles(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "controls")),
|
|
131413
131428
|
fetchFunctionSources: await readFiles(sugarReferences.fetchFunctionFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x))),
|
|
131414
131429
|
localization: await connectJSFilesWithNames(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "localization")),
|
|
131415
|
-
importedFiles: await readImportedFiles(formSourcesPath)
|
|
131430
|
+
importedFiles: await readImportedFiles(formSourcesPath),
|
|
131431
|
+
additionalNormalizers: await readAdditionalNormalizersFiles(formSourcesPath)
|
|
131416
131432
|
}
|
|
131417
131433
|
};
|
|
131418
131434
|
|
|
@@ -131583,6 +131599,29 @@ async function readImportedFiles(rootPath) {
|
|
|
131583
131599
|
}
|
|
131584
131600
|
}
|
|
131585
131601
|
|
|
131602
|
+
async function readAdditionalNormalizersFiles(rootPath) {
|
|
131603
|
+
try {
|
|
131604
|
+
const normalizersDirectoryName = "normalizers";
|
|
131605
|
+
const files = await readdirAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(rootPath, normalizersDirectoryName));
|
|
131606
|
+
const normalizerFiles = [];
|
|
131607
|
+
|
|
131608
|
+
for (const filename of files) {
|
|
131609
|
+
const content = await readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(rootPath, normalizersDirectoryName, filename), "utf-8");
|
|
131610
|
+
const normalizerFile = {
|
|
131611
|
+
filenameWithoutExtension: path__WEBPACK_IMPORTED_MODULE_1___default().parse(filename).name,
|
|
131612
|
+
content: content
|
|
131613
|
+
};
|
|
131614
|
+
normalizerFiles.push(normalizerFile);
|
|
131615
|
+
}
|
|
131616
|
+
|
|
131617
|
+
return normalizerFiles;
|
|
131618
|
+
} catch (error) {
|
|
131619
|
+
// eslint-disable-next-line no-console
|
|
131620
|
+
console.warn(chalk__WEBPACK_IMPORTED_MODULE_3___default().yellow(`Error while reading normalizers at ${rootPath}`, error));
|
|
131621
|
+
return [];
|
|
131622
|
+
}
|
|
131623
|
+
}
|
|
131624
|
+
|
|
131586
131625
|
async function readJavaScriptFilesWithNames(formJavaScriptFilesPath) {
|
|
131587
131626
|
try {
|
|
131588
131627
|
const files = await readdirAsync(formJavaScriptFilesPath);
|
|
@@ -131703,6 +131742,21 @@ function getRequisitesFromEvaluableProps(...evaluablePropValues) {
|
|
|
131703
131742
|
|
|
131704
131743
|
/***/ }),
|
|
131705
131744
|
|
|
131745
|
+
/***/ "./Generator/src/generators/ServerSideFLangNormalization/AdditionalNormalizerFile.ts":
|
|
131746
|
+
/*!*******************************************************************************************!*\
|
|
131747
|
+
!*** ./Generator/src/generators/ServerSideFLangNormalization/AdditionalNormalizerFile.ts ***!
|
|
131748
|
+
\*******************************************************************************************/
|
|
131749
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
131750
|
+
|
|
131751
|
+
"use strict";
|
|
131752
|
+
__webpack_require__.r(__webpack_exports__);
|
|
131753
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
131754
|
+
/* harmony export */ "defaultNormalizerFilename": () => (/* binding */ defaultNormalizerFilename)
|
|
131755
|
+
/* harmony export */ });
|
|
131756
|
+
const defaultNormalizerFilename = "defaultNormalizeRules";
|
|
131757
|
+
|
|
131758
|
+
/***/ }),
|
|
131759
|
+
|
|
131706
131760
|
/***/ "./Generator/src/generators/ServerSideFLangNormalization/FLangValidationBuildContext.ts":
|
|
131707
131761
|
/*!**********************************************************************************************!*\
|
|
131708
131762
|
!*** ./Generator/src/generators/ServerSideFLangNormalization/FLangValidationBuildContext.ts ***!
|