@kontur.candy/generator 5.97.0-optimize-engine.0 → 5.97.0-watch-normalizers.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 +13 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -47768,7 +47768,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
47768
47768
|
/* harmony export */ ensureArrayHasLength: () => (/* binding */ ensureArrayHasLength),
|
|
47769
47769
|
/* harmony export */ ensureArrayIsNotEmpty: () => (/* binding */ ensureArrayIsNotEmpty),
|
|
47770
47770
|
/* harmony export */ ensureArrayLengthGreaterThenOrEqual: () => (/* binding */ ensureArrayLengthGreaterThenOrEqual),
|
|
47771
|
-
/* harmony export */ ensureHasFunctionType: () => (/* binding */ ensureHasFunctionType),
|
|
47772
47771
|
/* harmony export */ ensureIsArray: () => (/* binding */ ensureIsArray),
|
|
47773
47772
|
/* harmony export */ ensureNever: () => (/* binding */ ensureNever),
|
|
47774
47773
|
/* harmony export */ ensureNotNullOrUndefined: () => (/* binding */ ensureNotNullOrUndefined),
|
|
@@ -47796,14 +47795,9 @@ function stringifyUnknownError(error) {
|
|
|
47796
47795
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
47797
47796
|
return typeof error === "object" && (error === null || error === void 0 ? void 0 : error["message"]);
|
|
47798
47797
|
}
|
|
47799
|
-
function ensureNotNullOrUndefined(input
|
|
47798
|
+
function ensureNotNullOrUndefined(input) {
|
|
47800
47799
|
if (!isNotNullOrUndefined(input)) {
|
|
47801
|
-
throw new Error(
|
|
47802
|
-
}
|
|
47803
|
-
}
|
|
47804
|
-
function ensureHasFunctionType(input, message) {
|
|
47805
|
-
if (typeof input !== "function") {
|
|
47806
|
-
throw new Error(message !== null && message !== void 0 ? message : `Value must be defined`);
|
|
47800
|
+
throw new Error(`Value must be defined`);
|
|
47807
47801
|
}
|
|
47808
47802
|
}
|
|
47809
47803
|
function noop() {
|
|
@@ -72645,8 +72639,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
72645
72639
|
/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_3__);
|
|
72646
72640
|
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! chalk */ "./node_modules/chalk/source/index.js");
|
|
72647
72641
|
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_4__);
|
|
72648
|
-
/* harmony import */ var
|
|
72649
|
-
/* harmony import */ var
|
|
72642
|
+
/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! fs-extra */ "./node_modules/fs-extra/lib/index.js");
|
|
72643
|
+
/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(fs_extra__WEBPACK_IMPORTED_MODULE_12__);
|
|
72650
72644
|
/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! md5 */ "./node_modules/md5/md5.js");
|
|
72651
72645
|
/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(md5__WEBPACK_IMPORTED_MODULE_5__);
|
|
72652
72646
|
/* harmony import */ var recursive_readdir__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! recursive-readdir */ "./node_modules/recursive-readdir/index.js");
|
|
@@ -72654,7 +72648,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
72654
72648
|
/* harmony import */ var _common_ExtractSugarReferences__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/ExtractSugarReferences */ "./Generator/src/common/ExtractSugarReferences.ts");
|
|
72655
72649
|
/* harmony import */ var _Common_GetRngSchemaFileExtension__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../Common/GetRngSchemaFileExtension */ "./Common/GetRngSchemaFileExtension.ts");
|
|
72656
72650
|
/* harmony import */ var _Common_FormPathUtils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../Common/FormPathUtils */ "./Common/FormPathUtils.ts");
|
|
72657
|
-
/* harmony import */ var
|
|
72651
|
+
/* harmony import */ var _Common_WellKnownDirectories__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../Common/WellKnownDirectories */ "./Common/WellKnownDirectories.ts");
|
|
72652
|
+
/* harmony import */ var _FsUtils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./FsUtils */ "./Generator/src/generators/FsUtils.ts");
|
|
72653
|
+
|
|
72658
72654
|
|
|
72659
72655
|
|
|
72660
72656
|
|
|
@@ -72680,7 +72676,7 @@ async function readFormSources(formSourcesPath, farmDirectory) {
|
|
|
72680
72676
|
if (sugarReferences.fetchFunctionFiles.length === 0) {
|
|
72681
72677
|
// eslint-disable-next-line no-console
|
|
72682
72678
|
console.warn(chalk__WEBPACK_IMPORTED_MODULE_4___default().yellow(`[WARN] Форма не содержит ссылок на fetch-функции. Будут автоматически подключены функции из каталога legacyfetchfuctions\n` + `[WARN] В будущем необходимо явно прописывать ссылки на используемые fetch-функции`));
|
|
72683
|
-
const legacyfetchfunctionsDirectory = (await (0,
|
|
72679
|
+
const legacyfetchfunctionsDirectory = (await (0,fs_extra__WEBPACK_IMPORTED_MODULE_12__.pathExists)(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions"))) ? path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions") : path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "candy.farm", "legacyfetchfunctions");
|
|
72684
72680
|
sugarReferences.fetchFunctionFiles = (await readdirAsync(legacyfetchfunctionsDirectory)).map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(legacyfetchfunctionsDirectory, x));
|
|
72685
72681
|
}
|
|
72686
72682
|
const result = {
|
|
@@ -72745,7 +72741,7 @@ async function extractReferences(formSugarDirectoryPath) {
|
|
|
72745
72741
|
return (0,_common_ExtractSugarReferences__WEBPACK_IMPORTED_MODULE_7__.extractSugarReferences)(indexContent, filePath => readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, filePath), "utf-8"));
|
|
72746
72742
|
}
|
|
72747
72743
|
async function getAllFilePathsInDirectory(directoryPath, _filelist) {
|
|
72748
|
-
if (!(await (0,
|
|
72744
|
+
if (!(await (0,fs_extra__WEBPACK_IMPORTED_MODULE_12__.pathExists)(directoryPath))) {
|
|
72749
72745
|
return [];
|
|
72750
72746
|
}
|
|
72751
72747
|
const files = await readdirAsync(directoryPath);
|
|
@@ -72760,7 +72756,7 @@ async function getAllFilePathsInDirectory(directoryPath, _filelist) {
|
|
|
72760
72756
|
return filelist;
|
|
72761
72757
|
}
|
|
72762
72758
|
async function checkFileExists(filePath) {
|
|
72763
|
-
if (!(await (0,
|
|
72759
|
+
if (!(await (0,fs_extra__WEBPACK_IMPORTED_MODULE_12__.pathExists)(filePath))) {
|
|
72764
72760
|
return [];
|
|
72765
72761
|
}
|
|
72766
72762
|
return [filePath];
|
|
@@ -72769,10 +72765,10 @@ async function getAllDependencies(formSourcesPath, farmDirectory) {
|
|
|
72769
72765
|
const formSugarDirectoryPath = path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "sugar");
|
|
72770
72766
|
const sugarReferences = await extractReferences(formSugarDirectoryPath);
|
|
72771
72767
|
if (sugarReferences.fetchFunctionFiles.length === 0) {
|
|
72772
|
-
const legacyfetchfunctionsDirectory = (await (0,
|
|
72768
|
+
const legacyfetchfunctionsDirectory = (await (0,fs_extra__WEBPACK_IMPORTED_MODULE_12__.pathExists)(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions"))) ? path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions") : path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "candy.farm", "legacyfetchfunctions");
|
|
72773
72769
|
sugarReferences.fetchFunctionFiles = (await readdirAsync(legacyfetchfunctionsDirectory)).map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(legacyfetchfunctionsDirectory, x));
|
|
72774
72770
|
}
|
|
72775
|
-
return [path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, "index.sugar.xml"), ...sugarReferences.fetchFunctionFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x)), ...sugarReferences.sugarFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x + ".sugar.xml")), ...sugarReferences.resourceFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x)), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSourcesPath, "settings.json"))), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSourcesPath, "hooks.js"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "autocalc"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "helpers"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "converters"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "mergers"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "jsHelpers"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "xsltTemplates"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "validations"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "schemas"))), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "tour", "tour.js"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "controls"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "localization")))];
|
|
72771
|
+
return [path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSourcesPath, _Common_WellKnownDirectories__WEBPACK_IMPORTED_MODULE_10__.WellKnownDirectories.FormJsonFileName), path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, "index.sugar.xml"), ...sugarReferences.fetchFunctionFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x)), ...sugarReferences.sugarFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x + ".sugar.xml")), ...sugarReferences.resourceFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x)), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSourcesPath, "settings.json"))), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSourcesPath, "hooks.js"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "autocalc"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "helpers"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "converters"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "mergers"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "jsHelpers"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "xsltTemplates"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "validations"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "schemas"))), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "tour", "tour.js"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "controls"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "localization"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "normalizers")))];
|
|
72776
72772
|
}
|
|
72777
72773
|
async function getAllDependenciesHash(formSourcesPath, farmDirectory) {
|
|
72778
72774
|
const allDeps = await getAllDependencies(formSourcesPath, farmDirectory);
|
|
@@ -72800,7 +72796,7 @@ async function readSugarFiles(formSugarDirectoryPath, references) {
|
|
|
72800
72796
|
return result;
|
|
72801
72797
|
}
|
|
72802
72798
|
async function readCustomControlsFiles(formSugarDirectoryPath) {
|
|
72803
|
-
if (!(await (0,
|
|
72799
|
+
if (!(await (0,_FsUtils__WEBPACK_IMPORTED_MODULE_11__.isDirectoryExists)(formSugarDirectoryPath))) {
|
|
72804
72800
|
return {};
|
|
72805
72801
|
}
|
|
72806
72802
|
const fileNames = await recursive_readdir__WEBPACK_IMPORTED_MODULE_6___default()(formSugarDirectoryPath);
|