@kontur.candy/generator 5.73.4 → 5.73.5
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 +48 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -47023,6 +47023,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
47023
47023
|
/* harmony export */ WellKnownDirectories: () => (/* binding */ WellKnownDirectories)
|
|
47024
47024
|
/* harmony export */ });
|
|
47025
47025
|
class WellKnownDirectories {}
|
|
47026
|
+
WellKnownDirectories.ExternFormsDefaultCheckoutDirectory = "extern.forms";
|
|
47026
47027
|
WellKnownDirectories.FormsDirectory = "forms";
|
|
47027
47028
|
WellKnownDirectories.CandyFarmDirectory = "candy.farm";
|
|
47028
47029
|
WellKnownDirectories.CandySubdirectoryName = "Candy";
|
|
@@ -69405,6 +69406,44 @@ require('./webEntry')
|
|
|
69405
69406
|
|
|
69406
69407
|
/***/ }),
|
|
69407
69408
|
|
|
69409
|
+
/***/ "./Generator/src/generators/FsUtils.ts":
|
|
69410
|
+
/*!*********************************************!*\
|
|
69411
|
+
!*** ./Generator/src/generators/FsUtils.ts ***!
|
|
69412
|
+
\*********************************************/
|
|
69413
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
69414
|
+
|
|
69415
|
+
"use strict";
|
|
69416
|
+
__webpack_require__.r(__webpack_exports__);
|
|
69417
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
69418
|
+
/* harmony export */ isDirectoryExists: () => (/* binding */ isDirectoryExists),
|
|
69419
|
+
/* harmony export */ isDirectoryExistsSync: () => (/* binding */ isDirectoryExistsSync)
|
|
69420
|
+
/* harmony export */ });
|
|
69421
|
+
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fs */ "fs");
|
|
69422
|
+
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
|
|
69423
|
+
/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! util */ "util");
|
|
69424
|
+
/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_1__);
|
|
69425
|
+
|
|
69426
|
+
|
|
69427
|
+
const statAsync = (0,util__WEBPACK_IMPORTED_MODULE_1__.promisify)(fs__WEBPACK_IMPORTED_MODULE_0__.stat);
|
|
69428
|
+
async function isDirectoryExists(directoryPath) {
|
|
69429
|
+
try {
|
|
69430
|
+
const dirStat = await statAsync(directoryPath);
|
|
69431
|
+
return dirStat.isDirectory();
|
|
69432
|
+
} catch (ignoreError) {
|
|
69433
|
+
return false;
|
|
69434
|
+
}
|
|
69435
|
+
}
|
|
69436
|
+
function isDirectoryExistsSync(directoryPath) {
|
|
69437
|
+
try {
|
|
69438
|
+
const dirStat = fs__WEBPACK_IMPORTED_MODULE_0__.statSync(directoryPath);
|
|
69439
|
+
return dirStat.isDirectory();
|
|
69440
|
+
} catch (ignoreError) {
|
|
69441
|
+
return false;
|
|
69442
|
+
}
|
|
69443
|
+
}
|
|
69444
|
+
|
|
69445
|
+
/***/ }),
|
|
69446
|
+
|
|
69408
69447
|
/***/ "./Generator/src/generators/HelperFunctionsGenerator/AstToExportStatement.ts":
|
|
69409
69448
|
/*!***********************************************************************************!*\
|
|
69410
69449
|
!*** ./Generator/src/generators/HelperFunctionsGenerator/AstToExportStatement.ts ***!
|
|
@@ -70769,8 +70808,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
70769
70808
|
/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_3__);
|
|
70770
70809
|
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! chalk */ "./node_modules/chalk/source/index.js");
|
|
70771
70810
|
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_4__);
|
|
70772
|
-
/* harmony import */ var
|
|
70773
|
-
/* harmony import */ var
|
|
70811
|
+
/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! fs-extra */ "./node_modules/fs-extra/lib/index.js");
|
|
70812
|
+
/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(fs_extra__WEBPACK_IMPORTED_MODULE_11__);
|
|
70774
70813
|
/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! md5 */ "./node_modules/md5/md5.js");
|
|
70775
70814
|
/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(md5__WEBPACK_IMPORTED_MODULE_5__);
|
|
70776
70815
|
/* harmony import */ var recursive_readdir__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! recursive-readdir */ "./node_modules/recursive-readdir/index.js");
|
|
@@ -70778,6 +70817,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
70778
70817
|
/* harmony import */ var _common_ExtractSugarReferences__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/ExtractSugarReferences */ "./Generator/src/common/ExtractSugarReferences.ts");
|
|
70779
70818
|
/* harmony import */ var _Common_GetRngSchemaFileExtension__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../Common/GetRngSchemaFileExtension */ "./Common/GetRngSchemaFileExtension.ts");
|
|
70780
70819
|
/* harmony import */ var _Common_FormPathUtils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../Common/FormPathUtils */ "./Common/FormPathUtils.ts");
|
|
70820
|
+
/* harmony import */ var _FsUtils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./FsUtils */ "./Generator/src/generators/FsUtils.ts");
|
|
70821
|
+
|
|
70781
70822
|
|
|
70782
70823
|
|
|
70783
70824
|
|
|
@@ -70802,7 +70843,7 @@ async function readFormSources(formSourcesPath, farmDirectory) {
|
|
|
70802
70843
|
if (sugarReferences.fetchFunctionFiles.length === 0) {
|
|
70803
70844
|
// eslint-disable-next-line no-console
|
|
70804
70845
|
console.warn(chalk__WEBPACK_IMPORTED_MODULE_4___default().yellow(`[WARN] Форма не содержит ссылок на fetch-функции. Будут автоматически подключены функции из каталога legacyfetchfuctions\n` + `[WARN] В будущем необходимо явно прописывать ссылки на используемые fetch-функции`));
|
|
70805
|
-
const legacyfetchfunctionsDirectory = (await (0,
|
|
70846
|
+
const legacyfetchfunctionsDirectory = (await (0,fs_extra__WEBPACK_IMPORTED_MODULE_11__.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");
|
|
70806
70847
|
sugarReferences.fetchFunctionFiles = (await readdirAsync(legacyfetchfunctionsDirectory)).map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(legacyfetchfunctionsDirectory, x));
|
|
70807
70848
|
}
|
|
70808
70849
|
const result = {
|
|
@@ -70858,14 +70899,6 @@ function evalModule(moduleCode) {
|
|
|
70858
70899
|
return module.exports;
|
|
70859
70900
|
})()`);
|
|
70860
70901
|
}
|
|
70861
|
-
async function isDirectoryExists(directoryPath) {
|
|
70862
|
-
try {
|
|
70863
|
-
const dirStat = await statAsync(directoryPath);
|
|
70864
|
-
return dirStat.isDirectory();
|
|
70865
|
-
} catch (ignoreError) {
|
|
70866
|
-
return false;
|
|
70867
|
-
}
|
|
70868
|
-
}
|
|
70869
70902
|
async function readFiles(filePaths) {
|
|
70870
70903
|
const result = [];
|
|
70871
70904
|
for (const filePath of filePaths) {
|
|
@@ -70878,7 +70911,7 @@ async function extractReferences(formSugarDirectoryPath) {
|
|
|
70878
70911
|
return (0,_common_ExtractSugarReferences__WEBPACK_IMPORTED_MODULE_7__.extractSugarReferences)(indexContent, filePath => readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, filePath), "utf-8"));
|
|
70879
70912
|
}
|
|
70880
70913
|
async function getAllFilePathsInDirectory(directoryPath, _filelist) {
|
|
70881
|
-
if (!(await (0,
|
|
70914
|
+
if (!(await (0,fs_extra__WEBPACK_IMPORTED_MODULE_11__.pathExists)(directoryPath))) {
|
|
70882
70915
|
return [];
|
|
70883
70916
|
}
|
|
70884
70917
|
const files = await readdirAsync(directoryPath);
|
|
@@ -70893,7 +70926,7 @@ async function getAllFilePathsInDirectory(directoryPath, _filelist) {
|
|
|
70893
70926
|
return filelist;
|
|
70894
70927
|
}
|
|
70895
70928
|
async function checkFileExists(filePath) {
|
|
70896
|
-
if (!(await (0,
|
|
70929
|
+
if (!(await (0,fs_extra__WEBPACK_IMPORTED_MODULE_11__.pathExists)(filePath))) {
|
|
70897
70930
|
return [];
|
|
70898
70931
|
}
|
|
70899
70932
|
return [filePath];
|
|
@@ -70902,7 +70935,7 @@ async function getAllDependencies(formSourcesPath, farmDirectory) {
|
|
|
70902
70935
|
const formSugarDirectoryPath = path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "sugar");
|
|
70903
70936
|
const sugarReferences = await extractReferences(formSugarDirectoryPath);
|
|
70904
70937
|
if (sugarReferences.fetchFunctionFiles.length === 0) {
|
|
70905
|
-
const legacyfetchfunctionsDirectory = (await (0,
|
|
70938
|
+
const legacyfetchfunctionsDirectory = (await (0,fs_extra__WEBPACK_IMPORTED_MODULE_11__.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");
|
|
70906
70939
|
sugarReferences.fetchFunctionFiles = (await readdirAsync(legacyfetchfunctionsDirectory)).map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(legacyfetchfunctionsDirectory, x));
|
|
70907
70940
|
}
|
|
70908
70941
|
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")))];
|
|
@@ -70933,7 +70966,7 @@ async function readSugarFiles(formSugarDirectoryPath, references) {
|
|
|
70933
70966
|
return result;
|
|
70934
70967
|
}
|
|
70935
70968
|
async function readCustomControlsFiles(formSugarDirectoryPath) {
|
|
70936
|
-
if (!(await isDirectoryExists(formSugarDirectoryPath))) {
|
|
70969
|
+
if (!(await (0,_FsUtils__WEBPACK_IMPORTED_MODULE_10__.isDirectoryExists)(formSugarDirectoryPath))) {
|
|
70937
70970
|
return {};
|
|
70938
70971
|
}
|
|
70939
70972
|
const fileNames = await recursive_readdir__WEBPACK_IMPORTED_MODULE_6___default()(formSugarDirectoryPath);
|