@kontur.candy/tools 2.250.0 → 2.251.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.
Files changed (53) hide show
  1. package/distr/Common/hashUtils.js +9 -0
  2. package/distr/Common/hashUtils.js.map +1 -1
  3. package/distr/Tools/src/BuildTasks/ClientJS/BuildClientJsTask.js +2 -12
  4. package/distr/Tools/src/BuildTasks/ClientJS/BuildClientJsTask.js.map +1 -1
  5. package/distr/Tools/src/BuildTasks/Engine/BuildLocalEngineTask.js +2 -3
  6. package/distr/Tools/src/BuildTasks/Engine/BuildLocalEngineTask.js.map +1 -1
  7. package/distr/Tools/src/BuildTasks/EngineStructureUtils.js +2 -27
  8. package/distr/Tools/src/BuildTasks/EngineStructureUtils.js.map +1 -1
  9. package/distr/Tools/src/BuildTasks/Form/GenerateForm.js +2 -2
  10. package/distr/Tools/src/BuildTasks/Form/GenerateForm.js.map +1 -1
  11. package/distr/Tools/src/BuildTasks/Form/NullFormGenerator.js +0 -3
  12. package/distr/Tools/src/BuildTasks/Form/NullFormGenerator.js.map +1 -1
  13. package/distr/Tools/src/BuildTasks/Form/WriteFLangNormalizationFiles.js +0 -6
  14. package/distr/Tools/src/BuildTasks/Form/WriteFLangNormalizationFiles.js.map +1 -1
  15. package/distr/Tools/src/BuildTasks/FormSource.js +6 -0
  16. package/distr/Tools/src/BuildTasks/FormSource.js.map +1 -0
  17. package/distr/Tools/src/BuildTasks/Generator/BuildGeneratorFromSourcesTask.js +3 -10
  18. package/distr/Tools/src/BuildTasks/Generator/BuildGeneratorFromSourcesTask.js.map +1 -1
  19. package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/CreateAsyncGenerator.js +18 -70
  20. package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/CreateAsyncGenerator.js.map +1 -1
  21. package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/GeneratorRequireUtils.js +17 -67
  22. package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/GeneratorRequireUtils.js.map +1 -1
  23. package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/ReadSourcesAndProcessSugarWorker.js +5 -5
  24. package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/ReadSourcesAndProcessSugarWorker.js.map +1 -1
  25. package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/RequireUncached.js +0 -9
  26. package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/RequireUncached.js.map +1 -1
  27. package/distr/Tools/src/CLICommands/BuildForms/RunBuildForms.js +3 -3
  28. package/distr/Tools/src/CLICommands/BuildForms/RunBuildForms.js.map +1 -1
  29. package/distr/Tools/src/CLICommands/BuildServer/ResourcesControllers/BuildServerBuildFormsController.js +4 -9
  30. package/distr/Tools/src/CLICommands/BuildServer/ResourcesControllers/BuildServerBuildFormsController.js.map +1 -1
  31. package/distr/Tools/src/CLICommands/BuildServer/ResourcesControllers/DevServers/BuildFormDevServer.js +2 -8
  32. package/distr/Tools/src/CLICommands/BuildServer/ResourcesControllers/DevServers/BuildFormDevServer.js.map +1 -1
  33. package/distr/Tools/src/CLICommands/DevBuild/RunDevBuild.js +4 -4
  34. package/distr/Tools/src/CLICommands/DevBuild/RunDevBuild.js.map +1 -1
  35. package/distr/Tools/src/CLICommands/Localization/RunLocalization.js +2 -2
  36. package/distr/Tools/src/CLICommands/Localization/RunLocalization.js.map +1 -1
  37. package/distr/Tools/src/CLICommands/SugarExtractor/ExtractTextsFromSugarController.js +1 -2
  38. package/distr/Tools/src/CLICommands/SugarExtractor/ExtractTextsFromSugarController.js.map +1 -1
  39. package/distr/Tools/src/CLICommands/SugarExtractor/Utils.js +1 -3
  40. package/distr/Tools/src/CLICommands/SugarExtractor/Utils.js.map +1 -1
  41. package/distr/Tools/src/CandyCLI.js +3 -3
  42. package/distr/Tools/src/CandyCLI.js.map +1 -1
  43. package/distr/Tools/src/LocalServerFrontEndDist/index.js +1 -1
  44. package/distr/Tools/src/LocalServerFrontEndDist/index.js.map +1 -1
  45. package/distr/Tools/src/ReadFarmConfig.js +1 -2
  46. package/distr/Tools/src/ReadFarmConfig.js.map +1 -1
  47. package/package.json +1 -1
  48. package/distr/Tools/src/BuildTasks/ClientJS/IsWebpack5.js +0 -14
  49. package/distr/Tools/src/BuildTasks/ClientJS/IsWebpack5.js.map +0 -1
  50. package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/ProcessSugarWorker.js +0 -46
  51. package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/ProcessSugarWorker.js.map +0 -1
  52. package/distr/Tools/src/BuildTasks/ReadFormSource.js +0 -114
  53. package/distr/Tools/src/BuildTasks/ReadFormSource.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"RunBuildForms.js","names":["_path","_interopRequireDefault","require","_chalk","_fsExtra","_nodeNotifier","_AcquireFormEngine","_EngineSource","_CompileForm","_GenerateForm","_NullFormGenerator","_WriteFLangNormalizationFiles","_FSTask","_AcquireFormGenerator","_PublishedVersionUtils","_ResolveFormInfo","_WriteFormMeta","_FormGlobsUtils","_StaticLogger","_Observe","_SingleValueProducer","_TimingUtils","_CacheAssetsPlugin","_TypingUtils","_WriteAttachmentPathFiles","_EmptyProducer","_GetRngSchemaFileExtension","_FormPathUtils","_WellKnownDirectories","_WriteAttachmentPathByGfvFiles","_WriteKClangFiles","_WriteExtendedSchemaFiles","_EngineStructureUtils","_BuildCandyWidgetTask","getGeneratorVersion","generatorSource","type","version","Error","runBuildForms","context","options","farmDirectory","resourcesDirectory","engineDirectory","candyModulesDirectory","hlFarmDirectoryPath","buildOptions","pickListsChain","Observe","files","path","join","do","x","FSTask","copyRecursively","logger","withPrefix","formInfos","FormGlobs","resolveGfvGlobs","formGlobs","staticResourcesForProductionChain","__dirname","getLogger","resourcesExternalConvertersChain","empty","copiedEngines","Set","repositoryRoot","buildCache","BuildCache","buildCacheMode","createChainForForm","formRelativePath","gfv","extractGfvFromFormPath","formDirPath","pathExists","WellKnownDirectories","FormJsonFileName","warning","value","formSchemasDirPath","rngSchemaMask","getRngSchemaFileExtension","rngSchemaExtension","file","transform","formJsonFile","resolveFormInfo","upgradeFormJson","useLastStableVersion","usePrereleaseVersion","fi","mode","FormBuildMode","NormalBuild","generatorVersion","undefined","engineVersion","resolveGeneratorVersion","engineSource","resolveEngineVersion","attach","SingleValueProducer","NullFormGenerator","generatorFactory","useVersionFromCache","y","generator","getGeneratorSourceKey","engineFactory","has","getEngineSourceKey","add","watch","formSourcesPath","dependenciesHash","supportsDependenciesExtraction","getAllDependenciesHash","buildCacheExist","exists","_fi$dependenciesHash","log","generateForm","skipCodeReformatting","skipGeneratedCodeReformatting","resourcesHash","_fi$dependenciesHash2","_fi$dependenciesHash3","extract","buildCacheOptions","depsHash","compileForm","formName","reject","writeFormMeta","themes","writeFLangNormalizationFiles","writeKClangFiles","writeExtendedSchemaFiles","writeAttachmentPathFiles","writeAttachmentPathByGfvFiles","modifier","content","replace","modifyFilesContent","notifier","notify","title","message","buildFormsChain","fixedFormDirectories","map","relative","formPath","splitToParallelChains","candyWidgetsConfigTask","createClientViteConfigTask","buildCandyWidgetChain","buildCandyWidget","EmptyProducer","chainWith","p","BuildCandyWidgetTask","clean","cleanTargetDirectory","stopObserve1","observe","stopObserve2","stopObserve3","stopObserve5","waitForExit","startDate","Date","now","currentValue","console","chalk","greenBright","totalTime","printTime","emptyDir"],"sources":["../../../../../src/CLICommands/BuildForms/RunBuildForms.ts"],"sourcesContent":["import path from \"path\";\n\nimport chalk from \"chalk\";\nimport { emptyDir, pathExists } from \"fs-extra\";\nimport notifier from \"node-notifier\";\n\nimport { engineFactory } from \"../../BuildTasks/Engine/AcquireFormEngine\";\nimport { getEngineSourceKey } from \"../../BuildTasks/Engine/EngineSource\";\nimport { compileForm } from \"../../BuildTasks/Form/CompileForm\";\nimport { generateForm } from \"../../BuildTasks/Form/GenerateForm\";\nimport { NullFormGenerator } from \"../../BuildTasks/Form/NullFormGenerator\";\nimport { writeFLangNormalizationFiles } from \"../../BuildTasks/Form/WriteFLangNormalizationFiles\";\nimport { FSTask } from \"../../BuildTasks/FSTask\";\nimport {\n generatorFactory,\n GeneratorSource,\n getGeneratorSourceKey,\n} from \"../../BuildTasks/Generator/AcquireFormGenerator\";\nimport { resolveEngineVersion, resolveGeneratorVersion } from \"../../BuildTasks/PublishedVersionUtils\";\nimport { FormBuildMode, resolveFormInfo } from \"../../BuildTasks/ResolveFormInfo\";\nimport { writeFormMeta } from \"../../BuildTasks/WriteFormMeta\";\nimport { ConsoleApplicationContext } from \"../../Commons/ConsoleApplication/ConsoleApplicationContext\";\nimport { FormGlobs } from \"../../Commons/FormGlobsUtils\";\nimport { ILogger } from \"../../Commons/Logging/ILogger\";\nimport { getLogger } from \"../../Commons/Logging/StaticLogger\";\nimport { Observe } from \"../../Commons/TasksCore/Observe\";\nimport { SingleValueProducer } from \"../../Commons/TasksCore/SingleValueProducer\";\nimport { printTime } from \"../../Commons/TimingUtils\";\nimport { BuildCache } from \"../../FormWebpackConfiguration/CacheAssetsPlugin\";\nimport { reject } from \"../../../../Common/TypingUtils\";\nimport { writeAttachmentPathFiles } from \"../../BuildTasks/Form/WriteAttachmentPathFiles\";\nimport { ChainableValueProducer } from \"../../Commons/TasksCore/ChainableValueProducer\";\nimport { EmptyProducer } from \"../../Commons/TasksCore/EmptyProducer\";\nimport { getRngSchemaFileExtension } from \"../../../../Common/GetRngSchemaFileExtension\";\nimport { extractGfvFromFormPath } from \"../../../../Common/FormPathUtils\";\nimport { WellKnownDirectories } from \"../../../../Common/WellKnownDirectories\";\nimport { writeAttachmentPathByGfvFiles } from \"../../BuildTasks/Form/WriteAttachmentPathByGfvFiles\";\nimport { writeKClangFiles } from \"../../BuildTasks/Form/WriteKClangFiles\";\nimport { writeExtendedSchemaFiles } from \"../../BuildTasks/Form/WriteExtendedSchemaFiles\";\nimport { createClientViteConfigTask } from \"../../BuildTasks/EngineStructureUtils\";\nimport { BuildCandyWidgetTask } from \"../../BuildTasks/CandyWidget/BuildCandyWidgetTask\";\n\nimport { BuildFormsOptions } from \"./BuildFormsOptions\";\n\nfunction getGeneratorVersion(generatorSource: GeneratorSource): string {\n if (generatorSource.type === \"PublishedGenerator\") {\n return generatorSource.version;\n } else {\n throw new Error(\"InvalidProgramState\");\n }\n}\n\nexport async function runBuildForms(\n context: ConsoleApplicationContext,\n options: BuildFormsOptions,\n farmDirectory: string,\n resourcesDirectory: string,\n engineDirectory: string,\n candyModulesDirectory: string,\n hlFarmDirectoryPath: string\n): Promise<void> {\n const buildOptions = options;\n\n const pickListsChain = Observe.files(path.join(farmDirectory, \"picklists\"), \"*.json\").do(x =>\n FSTask.copyRecursively(context.logger.withPrefix(\"PICKLISTS\"), x, path.join(resourcesDirectory, \"picklists\"))\n );\n\n const formInfos = await FormGlobs.resolveGfvGlobs(options.formGlobs, farmDirectory);\n\n const staticResourcesForProductionChain = Observe.files(\n path.join(__dirname, \"..\", \"..\", \"StaticFilesForProductionResourcesDir\"),\n \"*.js\",\n \"*.js.map\"\n ).do(x =>\n FSTask.copyRecursively(getLogger().withPrefix(\"STATICS\"), x, path.join(resourcesDirectory, \"public\", \"scripts\"))\n );\n\n /** Конвертеры описи для форм, которые пока не реализованы на кенди, сама механика описи перенесена в формы в кенди апи, поэтому они должны быть в candy.resources\n * Реализуется только при общем билде форм: candy build *\n * */\n let resourcesExternalConvertersChain: ChainableValueProducer<string> | EmptyProducer = Observe.empty();\n if (options.formGlobs[0] === \"*\") {\n resourcesExternalConvertersChain = Observe.files(path.join(farmDirectory, \"externalConverters\"), \"*.xslt\").do(\n x =>\n FSTask.copyRecursively(\n getLogger().withPrefix(\"EXTERNAL-CONVERTERS\"),\n x,\n path.join(resourcesDirectory, \"converters\")\n )\n );\n }\n\n const copiedEngines = new Set<string>();\n\n const repositoryRoot = path.join(farmDirectory, \"..\");\n const buildCache = new BuildCache(farmDirectory, options.buildCacheMode);\n\n const createChainForForm = async (formRelativePath: string) => {\n const gfv = extractGfvFromFormPath(formRelativePath);\n const formDirPath = path.join(repositoryRoot, formRelativePath);\n\n if (!(await pathExists(path.join(formDirPath, WellKnownDirectories.FormJsonFileName)))) {\n context.logger.warning(\n `Form ${gfv} does not have form.json file. To include this form to build process restart build`\n );\n return Observe.value({});\n }\n const formSchemasDirPath = path.join(formDirPath, \"schemas\");\n const rngSchemaMask = `*${getRngSchemaFileExtension(formSchemasDirPath, gfv)}`;\n const rngSchemaExtension = getRngSchemaFileExtension(formSchemasDirPath, gfv);\n\n if (rngSchemaExtension == \".rng.xml\") {\n throw new Error(\n `Недопустимое название схемы ${gfv + rngSchemaExtension} используй команду candy rename ${gfv} в каталоге candy.farm`\n );\n }\n if (await pathExists(path.join(formDirPath, \"presentations.json\"))) {\n throw new Error(\n `presentations.json больше не используется, удали его из ${formDirPath} или используй команду candy rename ${gfv} в каталоге candy.farm`\n );\n }\n\n return Observe.file(path.join(formDirPath, WellKnownDirectories.FormJsonFileName))\n .transform(formJsonFile =>\n resolveFormInfo(\n formJsonFile,\n formDirPath,\n engineDirectory,\n context.logger.withPrefix(`FORM:${gfv}`),\n options.upgradeFormJson,\n options.useLastStableVersion,\n options.usePrereleaseVersion\n )\n )\n .transform(async fi => {\n if (fi.mode === FormBuildMode.NormalBuild) {\n if (fi.generatorVersion == undefined) {\n throw new Error(\"generatorVersion is not defined\");\n }\n if (fi.engineVersion == undefined) {\n throw new Error(\"engineVersion is not defined\");\n }\n return {\n ...fi,\n generatorSource: await resolveGeneratorVersion(\n fi.generatorVersion,\n context.logger.withPrefix(gfv)\n ),\n engineSource: await resolveEngineVersion(fi.engineVersion, context.logger.withPrefix(gfv)),\n };\n } else {\n return {\n ...fi,\n generatorSource: undefined,\n engineSource: undefined,\n };\n }\n })\n .attach(\n async fi => {\n if (fi.generatorSource == undefined) {\n return new SingleValueProducer(new NullFormGenerator());\n } else {\n return generatorFactory(fi.generatorSource, candyModulesDirectory, options.useVersionFromCache);\n }\n },\n async (fi, y) => ({ ...fi, generator: y }),\n async fi =>\n fi.generatorSource != undefined ? getGeneratorSourceKey(fi.generatorSource) : \"NullFormGenerator\"\n )\n .attach(\n async fi => {\n if (fi.engineSource === undefined) {\n return new SingleValueProducer(\"NullEngine\");\n }\n return engineFactory(fi.engineSource, candyModulesDirectory, options.useVersionFromCache).do(\n async x => {\n if (!copiedEngines.has(getEngineSourceKey(fi.engineSource))) {\n await FSTask.copyRecursively(\n getLogger().withPrefix(\"ENGINE\"),\n x,\n path.join(resourcesDirectory, \"public\")\n );\n copiedEngines.add(getEngineSourceKey(fi.engineSource));\n }\n }\n );\n },\n async fi => fi,\n async fi => (fi.engineSource != undefined ? getEngineSourceKey(fi.engineSource) : \"NullEngine\")\n )\n .attach(async fi =>\n buildOptions.watch\n ? Observe.files(\n fi.formSourcesPath,\n \"../../controls/**/*\",\n \"../../xsltTemplates/**/*\",\n \"../../jsHelpers/**/*\",\n `./${WellKnownDirectories.FormJsonFileName}`,\n \"schemas/**/*\",\n \"sugar/**/*\",\n \"controls/**/*\",\n \"autocalc/**/*\",\n \"helpers/**/*\",\n \"normalizers/**/*\",\n \"validations/**/*\",\n \"localization/**/*\"\n )\n : Observe.value(fi.formSourcesPath)\n )\n .transform(async fi => {\n let dependenciesHash: undefined | string;\n if (fi.mode !== FormBuildMode.NormalBuild) {\n return {\n ...fi,\n dependenciesHash: undefined,\n };\n }\n if (await fi.generator.supportsDependenciesExtraction()) {\n dependenciesHash = await fi.generator.getAllDependenciesHash(\n formDirPath,\n farmDirectory,\n hlFarmDirectoryPath\n );\n }\n return {\n ...fi,\n dependenciesHash: dependenciesHash,\n };\n })\n .transform(async fi => {\n let buildCacheExist: boolean = false;\n if (fi.dependenciesHash != undefined && fi.generatorSource != undefined) {\n buildCacheExist = await buildCache.exists(fi.generatorSource, gfv, fi.dependenciesHash);\n }\n return {\n ...fi,\n buildCacheExist: buildCacheExist,\n };\n })\n .do(async fi => {\n if (fi.generatorSource == undefined) {\n return undefined;\n }\n if (fi.buildCacheExist) {\n context.logger.withPrefix(`GENERATE:${gfv}`).log(\"Skipped due build cache exits\");\n return undefined;\n }\n\n return generateForm(fi.formSourcesPath, farmDirectory, hlFarmDirectoryPath, fi.generator, undefined, {\n skipCodeReformatting: options.skipGeneratedCodeReformatting,\n resourcesHash: fi.dependenciesHash ?? \"UndefinedResourcesHash\",\n });\n })\n .attach(async () =>\n buildOptions.watch\n ? Observe.files(path.join(formDirPath, \"form\"), \"**/*\")\n : Observe.value(path.join(formDirPath, \"form\"))\n )\n .do(async fi => {\n if (fi.generatorSource == undefined) {\n return;\n }\n if (fi.dependenciesHash != undefined && fi.buildCacheExist) {\n context.logger.withPrefix(`COMPILE:${gfv}`).log(\"Skipped due build cache exists\");\n await buildCache.extract(fi.generatorSource, gfv, fi.dependenciesHash, resourcesDirectory);\n return;\n }\n const buildCacheOptions =\n fi.dependenciesHash != undefined\n ? {\n depsHash: fi.dependenciesHash,\n generatorVersion: getGeneratorVersion(fi.generatorSource),\n gfv: gfv,\n mode: options.buildCacheMode,\n farmDirectory: farmDirectory,\n }\n : undefined;\n\n await compileForm(\n fi.formName,\n formDirPath,\n resourcesDirectory,\n fi.dependenciesHash ??\n reject(\n \"This version of generator is not supported due to dependencies extraction is not supported\"\n ),\n false,\n undefined,\n options.mode === \"production\",\n buildCacheOptions\n );\n\n await writeFormMeta(\n resourcesDirectory,\n gfv,\n fi.engineSource,\n fi.dependenciesHash ??\n reject(\n \"This version of generator is not supported due to dependencies extraction is not supported\"\n ),\n fi.themes,\n buildCache,\n buildCacheOptions\n );\n })\n .do(async fi => {\n if (fi.generatorSource == undefined) {\n return;\n }\n const buildCacheOptions =\n fi.dependenciesHash != undefined\n ? {\n depsHash: fi.dependenciesHash,\n generatorVersion: getGeneratorVersion(fi.generatorSource),\n gfv: gfv,\n mode: options.buildCacheMode,\n farmDirectory: farmDirectory,\n }\n : undefined;\n await writeFLangNormalizationFiles(\n fi.formName,\n formDirPath,\n resourcesDirectory,\n undefined,\n buildCache,\n buildCacheOptions,\n fi.buildCacheExist\n );\n await writeKClangFiles(\n fi.formName,\n formDirPath,\n resourcesDirectory,\n undefined,\n buildCache,\n buildCacheOptions,\n fi.buildCacheExist\n );\n await writeExtendedSchemaFiles(\n fi.formName,\n formDirPath,\n resourcesDirectory,\n undefined,\n buildCache,\n buildCacheOptions,\n fi.buildCacheExist\n );\n await writeAttachmentPathFiles(\n fi.formName,\n formDirPath,\n resourcesDirectory,\n undefined,\n buildCache,\n buildCacheOptions\n );\n await writeAttachmentPathByGfvFiles(\n fi.formName,\n formDirPath,\n resourcesDirectory,\n undefined,\n buildCache,\n buildCacheOptions\n );\n })\n .attach(async fi =>\n Observe.files(path.join(fi.formSourcesPath, \"schemas\"), rngSchemaMask).do(x =>\n FSTask.copyRecursively(\n getLogger().withPrefix(\"SCHEMAS\"),\n x,\n path.join(resourcesDirectory, \"schemas\")\n )\n )\n )\n .attach(async fi =>\n Observe.files(path.join(fi.formSourcesPath, \"converters\"), \"*\").do(x =>\n FSTask.copyRecursively(\n getLogger().withPrefix(\"CONVERTERS\"),\n x,\n path.join(resourcesDirectory, \"converters\")\n )\n )\n )\n .attach(async fi =>\n Observe.files(path.join(fi.formSourcesPath, \"mergers\"), \"*\").do(x =>\n FSTask.copyRecursively(\n getLogger().withPrefix(\"MERGERS\"),\n x,\n path.join(resourcesDirectory, \"mergers\")\n )\n )\n )\n .attach(async fi => {\n const modifier = (content: string): string =>\n content.replace(/<x:include href=\"[./]+/g, '<x:include href=\"');\n return Observe.files(path.join(fi.formSourcesPath, \"converters\"), \"*\").do(x =>\n FSTask.modifyFilesContent(\n getLogger().withPrefix(\"FIX-XSLT-INCLUDE\"),\n x,\n path.join(resourcesDirectory, \"converters\"),\n \"**/*.xslt\",\n modifier\n )\n );\n })\n .attach(async fi =>\n Observe.files(path.join(fi.formSourcesPath, \"..\", \"..\", \"xsltTemplates\"), \"*\").do(x =>\n FSTask.copyRecursively(\n getLogger().withPrefix(\"XSLT-TEMPLATES\"),\n x,\n path.join(resourcesDirectory, \"converters\", \"xsltTemplates\")\n )\n )\n )\n .attach(async fi =>\n Observe.files(path.join(fi.formSourcesPath, \"normalize\"), \"*.xml\").do(x =>\n FSTask.copyRecursively(\n getLogger().withPrefix(\"NORMALIZE\"),\n x,\n path.join(resourcesDirectory, \"normalize\")\n )\n )\n )\n .attach(async fi =>\n Observe.files(path.join(fi.formSourcesPath, \"patch\"), \"*.xslt\").do(x =>\n FSTask.copyRecursively(getLogger().withPrefix(\"PATCH\"), x, path.join(resourcesDirectory, \"patch\"))\n )\n )\n .attach(async fi =>\n Observe.files(path.join(fi.formSourcesPath, \"map\"), \"*.xml\").do(x =>\n FSTask.copyRecursively(getLogger().withPrefix(\"MAP\"), x, path.join(resourcesDirectory, \"map\"))\n )\n )\n .attach(async fi =>\n Observe.files(path.join(fi.formSourcesPath, \"unmap\"), \"*.xml\").do(x =>\n FSTask.copyRecursively(getLogger().withPrefix(\"UNMAP\"), x, path.join(resourcesDirectory, \"unmap\"))\n )\n )\n .do(async fi => {\n if (buildOptions.watch) {\n notifier.notify({\n title: `${fi.formName}: сборка завершена`,\n message: `Engine: ${\n fi.engineSource == undefined\n ? \"[NoEngine]\"\n : fi.engineSource.type === \"LocalEngineSources\"\n ? \"local\"\n : fi.engineSource.version\n }`,\n });\n }\n });\n };\n\n const buildFormsChain = Observe.fixedFormDirectories(\n formInfos.map(x => path.relative(repositoryRoot, x.formPath))\n ).splitToParallelChains(\n x => x,\n x => x,\n createChainForForm\n );\n\n const candyWidgetsConfigTask = await createClientViteConfigTask(engineDirectory);\n const buildCandyWidgetChain = !options.buildCandyWidget\n ? new EmptyProducer()\n : candyWidgetsConfigTask.chainWith(p => new BuildCandyWidgetTask(p));\n\n if (options.clean) {\n await cleanTargetDirectory(resourcesDirectory, context.logger);\n }\n\n if (buildOptions.watch) {\n const stopObserve1 = await pickListsChain.observe();\n const stopObserve2 = await buildFormsChain.observe();\n const stopObserve3 = await staticResourcesForProductionChain.observe();\n const stopObserve5 = await resourcesExternalConvertersChain.observe();\n await context.waitForExit();\n if (stopObserve3 != undefined) {\n await stopObserve3();\n }\n if (stopObserve5 != undefined) {\n await stopObserve5();\n }\n await stopObserve2();\n await stopObserve1();\n } else {\n const startDate = Date.now();\n try {\n await pickListsChain.currentValue;\n await resourcesExternalConvertersChain.currentValue;\n await staticResourcesForProductionChain.currentValue;\n await buildFormsChain.currentValue;\n await buildCandyWidgetChain.currentValue;\n // eslint-disable-next-line no-console\n console.log(chalk.greenBright(\"Build success\"));\n } finally {\n const totalTime = Date.now() - startDate;\n // eslint-disable-next-line no-console\n console.log(`Total time: ${printTime(totalTime)}`);\n }\n }\n}\n\nasync function cleanTargetDirectory(resourcesDirectory: string, logger: ILogger): Promise<void> {\n logger.log(\"Cleaning resource directory. \" + resourcesDirectory);\n await emptyDir(resourcesDirectory);\n logger.log(\"Resource directory clean\");\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,kBAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,aAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAR,OAAA;AACA,IAAAS,6BAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,qBAAA,GAAAX,OAAA;AAKA,IAAAY,sBAAA,GAAAZ,OAAA;AACA,IAAAa,gBAAA,GAAAb,OAAA;AACA,IAAAc,cAAA,GAAAd,OAAA;AAEA,IAAAe,eAAA,GAAAf,OAAA;AAEA,IAAAgB,aAAA,GAAAhB,OAAA;AACA,IAAAiB,QAAA,GAAAjB,OAAA;AACA,IAAAkB,oBAAA,GAAAlB,OAAA;AACA,IAAAmB,YAAA,GAAAnB,OAAA;AACA,IAAAoB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,kBAAkB,CAAC;EAClCc,MAAM,CAACoE,GAAG,CAAC,0BAA0B,CAAC;AAC1C","ignoreList":[]}
1
+ {"version":3,"file":"RunBuildForms.js","names":["_path","_interopRequireDefault","require","_chalk","_fsExtra","_nodeNotifier","_AcquireFormEngine","_EngineSource","_CompileForm","_GenerateForm","_NullFormGenerator","_WriteFLangNormalizationFiles","_FSTask","_AcquireFormGenerator","_PublishedVersionUtils","_ResolveFormInfo","_WriteFormMeta","_FormGlobsUtils","_StaticLogger","_Observe","_SingleValueProducer","_TimingUtils","_CacheAssetsPlugin","_TypingUtils","_WriteAttachmentPathFiles","_EmptyProducer","_GetRngSchemaFileExtension","_FormPathUtils","_WellKnownDirectories","_WriteAttachmentPathByGfvFiles","_WriteKClangFiles","_WriteExtendedSchemaFiles","_EngineStructureUtils","_BuildCandyWidgetTask","getGeneratorVersion","generatorSource","type","version","Error","runBuildForms","context","options","farmDirectory","resourcesDirectory","engineDirectory","candyModulesDirectory","buildOptions","pickListsChain","Observe","files","path","join","do","x","FSTask","copyRecursively","logger","withPrefix","formInfos","FormGlobs","resolveGfvGlobs","formGlobs","staticResourcesForProductionChain","__dirname","getLogger","resourcesExternalConvertersChain","empty","copiedEngines","Set","repositoryRoot","buildCache","BuildCache","buildCacheMode","createChainForForm","formRelativePath","gfv","extractGfvFromFormPath","formDirPath","pathExists","WellKnownDirectories","FormJsonFileName","warning","value","formSchemasDirPath","rngSchemaMask","getRngSchemaFileExtension","rngSchemaExtension","file","transform","formJsonFile","resolveFormInfo","upgradeFormJson","useLastStableVersion","usePrereleaseVersion","fi","mode","FormBuildMode","NormalBuild","generatorVersion","undefined","engineVersion","resolveGeneratorVersion","engineSource","resolveEngineVersion","attach","SingleValueProducer","NullFormGenerator","generatorFactory","useVersionFromCache","y","generator","getGeneratorSourceKey","engineFactory","has","getEngineSourceKey","add","watch","formSourcesPath","dependenciesHash","supportsDependenciesExtraction","getAllDependenciesHash","buildCacheExist","exists","_fi$dependenciesHash","log","generateForm","skipCodeReformatting","skipGeneratedCodeReformatting","resourcesHash","_fi$dependenciesHash2","_fi$dependenciesHash3","extract","buildCacheOptions","depsHash","compileForm","formName","reject","writeFormMeta","themes","writeFLangNormalizationFiles","writeKClangFiles","writeExtendedSchemaFiles","writeAttachmentPathFiles","writeAttachmentPathByGfvFiles","modifier","content","replace","modifyFilesContent","notifier","notify","title","message","buildFormsChain","fixedFormDirectories","map","relative","formPath","splitToParallelChains","candyWidgetsConfigTask","createClientViteConfigTask","buildCandyWidgetChain","buildCandyWidget","EmptyProducer","chainWith","p","BuildCandyWidgetTask","clean","cleanTargetDirectory","stopObserve1","observe","stopObserve2","stopObserve3","stopObserve5","waitForExit","startDate","Date","now","currentValue","console","chalk","greenBright","totalTime","printTime","emptyDir"],"sources":["../../../../../src/CLICommands/BuildForms/RunBuildForms.ts"],"sourcesContent":["import path from \"path\";\n\nimport chalk from \"chalk\";\nimport { emptyDir, pathExists } from \"fs-extra\";\nimport notifier from \"node-notifier\";\n\nimport { engineFactory } from \"../../BuildTasks/Engine/AcquireFormEngine\";\nimport { getEngineSourceKey } from \"../../BuildTasks/Engine/EngineSource\";\nimport { compileForm } from \"../../BuildTasks/Form/CompileForm\";\nimport { generateForm } from \"../../BuildTasks/Form/GenerateForm\";\nimport { NullFormGenerator } from \"../../BuildTasks/Form/NullFormGenerator\";\nimport { writeFLangNormalizationFiles } from \"../../BuildTasks/Form/WriteFLangNormalizationFiles\";\nimport { FSTask } from \"../../BuildTasks/FSTask\";\nimport {\n generatorFactory,\n GeneratorSource,\n getGeneratorSourceKey,\n} from \"../../BuildTasks/Generator/AcquireFormGenerator\";\nimport { resolveEngineVersion, resolveGeneratorVersion } from \"../../BuildTasks/PublishedVersionUtils\";\nimport { FormBuildMode, resolveFormInfo } from \"../../BuildTasks/ResolveFormInfo\";\nimport { writeFormMeta } from \"../../BuildTasks/WriteFormMeta\";\nimport { ConsoleApplicationContext } from \"../../Commons/ConsoleApplication/ConsoleApplicationContext\";\nimport { FormGlobs } from \"../../Commons/FormGlobsUtils\";\nimport { ILogger } from \"../../Commons/Logging/ILogger\";\nimport { getLogger } from \"../../Commons/Logging/StaticLogger\";\nimport { Observe } from \"../../Commons/TasksCore/Observe\";\nimport { SingleValueProducer } from \"../../Commons/TasksCore/SingleValueProducer\";\nimport { printTime } from \"../../Commons/TimingUtils\";\nimport { BuildCache } from \"../../FormWebpackConfiguration/CacheAssetsPlugin\";\nimport { reject } from \"../../../../Common/TypingUtils\";\nimport { writeAttachmentPathFiles } from \"../../BuildTasks/Form/WriteAttachmentPathFiles\";\nimport { ChainableValueProducer } from \"../../Commons/TasksCore/ChainableValueProducer\";\nimport { EmptyProducer } from \"../../Commons/TasksCore/EmptyProducer\";\nimport { getRngSchemaFileExtension } from \"../../../../Common/GetRngSchemaFileExtension\";\nimport { extractGfvFromFormPath } from \"../../../../Common/FormPathUtils\";\nimport { WellKnownDirectories } from \"../../../../Common/WellKnownDirectories\";\nimport { writeAttachmentPathByGfvFiles } from \"../../BuildTasks/Form/WriteAttachmentPathByGfvFiles\";\nimport { writeKClangFiles } from \"../../BuildTasks/Form/WriteKClangFiles\";\nimport { writeExtendedSchemaFiles } from \"../../BuildTasks/Form/WriteExtendedSchemaFiles\";\nimport { createClientViteConfigTask } from \"../../BuildTasks/EngineStructureUtils\";\nimport { BuildCandyWidgetTask } from \"../../BuildTasks/CandyWidget/BuildCandyWidgetTask\";\n\nimport { BuildFormsOptions } from \"./BuildFormsOptions\";\n\nfunction getGeneratorVersion(generatorSource: GeneratorSource): string {\n if (generatorSource.type === \"PublishedGenerator\") {\n return generatorSource.version;\n } else {\n throw new Error(\"InvalidProgramState\");\n }\n}\n\nexport async function runBuildForms(\n context: ConsoleApplicationContext,\n options: BuildFormsOptions,\n farmDirectory: string,\n resourcesDirectory: string,\n engineDirectory: string,\n candyModulesDirectory: string\n): Promise<void> {\n const buildOptions = options;\n\n const pickListsChain = Observe.files(path.join(farmDirectory, \"picklists\"), \"*.json\").do(x =>\n FSTask.copyRecursively(context.logger.withPrefix(\"PICKLISTS\"), x, path.join(resourcesDirectory, \"picklists\"))\n );\n\n const formInfos = await FormGlobs.resolveGfvGlobs(options.formGlobs, farmDirectory);\n\n const staticResourcesForProductionChain = Observe.files(\n path.join(__dirname, \"..\", \"..\", \"StaticFilesForProductionResourcesDir\"),\n \"*.js\",\n \"*.js.map\"\n ).do(x =>\n FSTask.copyRecursively(getLogger().withPrefix(\"STATICS\"), x, path.join(resourcesDirectory, \"public\", \"scripts\"))\n );\n\n /** Конвертеры описи для форм, которые пока не реализованы на кенди, сама механика описи перенесена в формы в кенди апи, поэтому они должны быть в candy.resources\n * Реализуется только при общем билде форм: candy build *\n * */\n let resourcesExternalConvertersChain: ChainableValueProducer<string> | EmptyProducer = Observe.empty();\n if (options.formGlobs[0] === \"*\") {\n resourcesExternalConvertersChain = Observe.files(path.join(farmDirectory, \"externalConverters\"), \"*.xslt\").do(\n x =>\n FSTask.copyRecursively(\n getLogger().withPrefix(\"EXTERNAL-CONVERTERS\"),\n x,\n path.join(resourcesDirectory, \"converters\")\n )\n );\n }\n\n const copiedEngines = new Set<string>();\n\n const repositoryRoot = path.join(farmDirectory, \"..\");\n const buildCache = new BuildCache(farmDirectory, options.buildCacheMode);\n\n const createChainForForm = async (formRelativePath: string) => {\n const gfv = extractGfvFromFormPath(formRelativePath);\n const formDirPath = path.join(repositoryRoot, formRelativePath);\n\n if (!(await pathExists(path.join(formDirPath, WellKnownDirectories.FormJsonFileName)))) {\n context.logger.warning(\n `Form ${gfv} does not have form.json file. To include this form to build process restart build`\n );\n return Observe.value({});\n }\n const formSchemasDirPath = path.join(formDirPath, \"schemas\");\n const rngSchemaMask = `*${getRngSchemaFileExtension(formSchemasDirPath, gfv)}`;\n const rngSchemaExtension = getRngSchemaFileExtension(formSchemasDirPath, gfv);\n\n if (rngSchemaExtension == \".rng.xml\") {\n throw new Error(\n `Недопустимое название схемы ${gfv + rngSchemaExtension} используй команду candy rename ${gfv} в каталоге candy.farm`\n );\n }\n if (await pathExists(path.join(formDirPath, \"presentations.json\"))) {\n throw new Error(\n `presentations.json больше не используется, удали его из ${formDirPath} или используй команду candy rename ${gfv} в каталоге candy.farm`\n );\n }\n\n return Observe.file(path.join(formDirPath, WellKnownDirectories.FormJsonFileName))\n .transform(formJsonFile =>\n resolveFormInfo(\n formJsonFile,\n formDirPath,\n engineDirectory,\n context.logger.withPrefix(`FORM:${gfv}`),\n options.upgradeFormJson,\n options.useLastStableVersion,\n options.usePrereleaseVersion\n )\n )\n .transform(async fi => {\n if (fi.mode === FormBuildMode.NormalBuild) {\n if (fi.generatorVersion == undefined) {\n throw new Error(\"generatorVersion is not defined\");\n }\n if (fi.engineVersion == undefined) {\n throw new Error(\"engineVersion is not defined\");\n }\n return {\n ...fi,\n generatorSource: await resolveGeneratorVersion(\n fi.generatorVersion,\n context.logger.withPrefix(gfv)\n ),\n engineSource: await resolveEngineVersion(fi.engineVersion, context.logger.withPrefix(gfv)),\n };\n } else {\n return {\n ...fi,\n generatorSource: undefined,\n engineSource: undefined,\n };\n }\n })\n .attach(\n async fi => {\n if (fi.generatorSource == undefined) {\n return new SingleValueProducer(new NullFormGenerator());\n } else {\n return generatorFactory(fi.generatorSource, candyModulesDirectory, options.useVersionFromCache);\n }\n },\n async (fi, y) => ({ ...fi, generator: y }),\n async fi =>\n fi.generatorSource != undefined ? getGeneratorSourceKey(fi.generatorSource) : \"NullFormGenerator\"\n )\n .attach(\n async fi => {\n if (fi.engineSource === undefined) {\n return new SingleValueProducer(\"NullEngine\");\n }\n return engineFactory(fi.engineSource, candyModulesDirectory, options.useVersionFromCache).do(\n async x => {\n if (!copiedEngines.has(getEngineSourceKey(fi.engineSource))) {\n await FSTask.copyRecursively(\n getLogger().withPrefix(\"ENGINE\"),\n x,\n path.join(resourcesDirectory, \"public\")\n );\n copiedEngines.add(getEngineSourceKey(fi.engineSource));\n }\n }\n );\n },\n async fi => fi,\n async fi => (fi.engineSource != undefined ? getEngineSourceKey(fi.engineSource) : \"NullEngine\")\n )\n .attach(async fi =>\n buildOptions.watch\n ? Observe.files(\n fi.formSourcesPath,\n \"../../controls/**/*\",\n \"../../xsltTemplates/**/*\",\n \"../../jsHelpers/**/*\",\n `./${WellKnownDirectories.FormJsonFileName}`,\n \"schemas/**/*\",\n \"sugar/**/*\",\n \"controls/**/*\",\n \"autocalc/**/*\",\n \"helpers/**/*\",\n \"normalizers/**/*\",\n \"validations/**/*\",\n \"localization/**/*\"\n )\n : Observe.value(fi.formSourcesPath)\n )\n .transform(async fi => {\n let dependenciesHash: undefined | string;\n if (fi.mode !== FormBuildMode.NormalBuild) {\n return {\n ...fi,\n dependenciesHash: undefined,\n };\n }\n if (await fi.generator.supportsDependenciesExtraction()) {\n dependenciesHash = await fi.generator.getAllDependenciesHash(formDirPath, farmDirectory);\n }\n return {\n ...fi,\n dependenciesHash: dependenciesHash,\n };\n })\n .transform(async fi => {\n let buildCacheExist: boolean = false;\n if (fi.dependenciesHash != undefined && fi.generatorSource != undefined) {\n buildCacheExist = await buildCache.exists(fi.generatorSource, gfv, fi.dependenciesHash);\n }\n return {\n ...fi,\n buildCacheExist: buildCacheExist,\n };\n })\n .do(async fi => {\n if (fi.generatorSource == undefined) {\n return undefined;\n }\n if (fi.buildCacheExist) {\n context.logger.withPrefix(`GENERATE:${gfv}`).log(\"Skipped due build cache exits\");\n return undefined;\n }\n\n return generateForm(fi.formSourcesPath, farmDirectory, fi.generator, undefined, {\n skipCodeReformatting: options.skipGeneratedCodeReformatting,\n resourcesHash: fi.dependenciesHash ?? \"UndefinedResourcesHash\",\n });\n })\n .attach(async () =>\n buildOptions.watch\n ? Observe.files(path.join(formDirPath, \"form\"), \"**/*\")\n : Observe.value(path.join(formDirPath, \"form\"))\n )\n .do(async fi => {\n if (fi.generatorSource == undefined) {\n return;\n }\n if (fi.dependenciesHash != undefined && fi.buildCacheExist) {\n context.logger.withPrefix(`COMPILE:${gfv}`).log(\"Skipped due build cache exists\");\n await buildCache.extract(fi.generatorSource, gfv, fi.dependenciesHash, resourcesDirectory);\n return;\n }\n const buildCacheOptions =\n fi.dependenciesHash != undefined\n ? {\n depsHash: fi.dependenciesHash,\n generatorVersion: getGeneratorVersion(fi.generatorSource),\n gfv: gfv,\n mode: options.buildCacheMode,\n farmDirectory: farmDirectory,\n }\n : undefined;\n\n await compileForm(\n fi.formName,\n formDirPath,\n resourcesDirectory,\n fi.dependenciesHash ??\n reject(\n \"This version of generator is not supported due to dependencies extraction is not supported\"\n ),\n false,\n undefined,\n options.mode === \"production\",\n buildCacheOptions\n );\n\n await writeFormMeta(\n resourcesDirectory,\n gfv,\n fi.engineSource,\n fi.dependenciesHash ??\n reject(\n \"This version of generator is not supported due to dependencies extraction is not supported\"\n ),\n fi.themes,\n buildCache,\n buildCacheOptions\n );\n })\n .do(async fi => {\n if (fi.generatorSource == undefined) {\n return;\n }\n const buildCacheOptions =\n fi.dependenciesHash != undefined\n ? {\n depsHash: fi.dependenciesHash,\n generatorVersion: getGeneratorVersion(fi.generatorSource),\n gfv: gfv,\n mode: options.buildCacheMode,\n farmDirectory: farmDirectory,\n }\n : undefined;\n await writeFLangNormalizationFiles(\n fi.formName,\n formDirPath,\n resourcesDirectory,\n undefined,\n buildCache,\n buildCacheOptions,\n fi.buildCacheExist\n );\n await writeKClangFiles(\n fi.formName,\n formDirPath,\n resourcesDirectory,\n undefined,\n buildCache,\n buildCacheOptions,\n fi.buildCacheExist\n );\n await writeExtendedSchemaFiles(\n fi.formName,\n formDirPath,\n resourcesDirectory,\n undefined,\n buildCache,\n buildCacheOptions,\n fi.buildCacheExist\n );\n await writeAttachmentPathFiles(\n fi.formName,\n formDirPath,\n resourcesDirectory,\n undefined,\n buildCache,\n buildCacheOptions\n );\n await writeAttachmentPathByGfvFiles(\n fi.formName,\n formDirPath,\n resourcesDirectory,\n undefined,\n buildCache,\n buildCacheOptions\n );\n })\n .attach(async fi =>\n Observe.files(path.join(fi.formSourcesPath, \"schemas\"), rngSchemaMask).do(x =>\n FSTask.copyRecursively(\n getLogger().withPrefix(\"SCHEMAS\"),\n x,\n path.join(resourcesDirectory, \"schemas\")\n )\n )\n )\n .attach(async fi =>\n Observe.files(path.join(fi.formSourcesPath, \"converters\"), \"*\").do(x =>\n FSTask.copyRecursively(\n getLogger().withPrefix(\"CONVERTERS\"),\n x,\n path.join(resourcesDirectory, \"converters\")\n )\n )\n )\n .attach(async fi =>\n Observe.files(path.join(fi.formSourcesPath, \"mergers\"), \"*\").do(x =>\n FSTask.copyRecursively(\n getLogger().withPrefix(\"MERGERS\"),\n x,\n path.join(resourcesDirectory, \"mergers\")\n )\n )\n )\n .attach(async fi => {\n const modifier = (content: string): string =>\n content.replace(/<x:include href=\"[./]+/g, '<x:include href=\"');\n return Observe.files(path.join(fi.formSourcesPath, \"converters\"), \"*\").do(x =>\n FSTask.modifyFilesContent(\n getLogger().withPrefix(\"FIX-XSLT-INCLUDE\"),\n x,\n path.join(resourcesDirectory, \"converters\"),\n \"**/*.xslt\",\n modifier\n )\n );\n })\n .attach(async fi =>\n Observe.files(path.join(fi.formSourcesPath, \"..\", \"..\", \"xsltTemplates\"), \"*\").do(x =>\n FSTask.copyRecursively(\n getLogger().withPrefix(\"XSLT-TEMPLATES\"),\n x,\n path.join(resourcesDirectory, \"converters\", \"xsltTemplates\")\n )\n )\n )\n .attach(async fi =>\n Observe.files(path.join(fi.formSourcesPath, \"normalize\"), \"*.xml\").do(x =>\n FSTask.copyRecursively(\n getLogger().withPrefix(\"NORMALIZE\"),\n x,\n path.join(resourcesDirectory, \"normalize\")\n )\n )\n )\n .attach(async fi =>\n Observe.files(path.join(fi.formSourcesPath, \"patch\"), \"*.xslt\").do(x =>\n FSTask.copyRecursively(getLogger().withPrefix(\"PATCH\"), x, path.join(resourcesDirectory, \"patch\"))\n )\n )\n .attach(async fi =>\n Observe.files(path.join(fi.formSourcesPath, \"map\"), \"*.xml\").do(x =>\n FSTask.copyRecursively(getLogger().withPrefix(\"MAP\"), x, path.join(resourcesDirectory, \"map\"))\n )\n )\n .attach(async fi =>\n Observe.files(path.join(fi.formSourcesPath, \"unmap\"), \"*.xml\").do(x =>\n FSTask.copyRecursively(getLogger().withPrefix(\"UNMAP\"), x, path.join(resourcesDirectory, \"unmap\"))\n )\n )\n .do(async fi => {\n if (buildOptions.watch) {\n notifier.notify({\n title: `${fi.formName}: сборка завершена`,\n message: `Engine: ${\n fi.engineSource == undefined\n ? \"[NoEngine]\"\n : fi.engineSource.type === \"LocalEngineSources\"\n ? \"local\"\n : fi.engineSource.version\n }`,\n });\n }\n });\n };\n\n const buildFormsChain = Observe.fixedFormDirectories(\n formInfos.map(x => path.relative(repositoryRoot, x.formPath))\n ).splitToParallelChains(\n x => x,\n x => x,\n createChainForForm\n );\n\n const candyWidgetsConfigTask = await createClientViteConfigTask(engineDirectory);\n const buildCandyWidgetChain = !options.buildCandyWidget\n ? new EmptyProducer()\n : candyWidgetsConfigTask.chainWith(p => new BuildCandyWidgetTask(p));\n\n if (options.clean) {\n await cleanTargetDirectory(resourcesDirectory, context.logger);\n }\n\n if (buildOptions.watch) {\n const stopObserve1 = await pickListsChain.observe();\n const stopObserve2 = await buildFormsChain.observe();\n const stopObserve3 = await staticResourcesForProductionChain.observe();\n const stopObserve5 = await resourcesExternalConvertersChain.observe();\n await context.waitForExit();\n if (stopObserve3 != undefined) {\n await stopObserve3();\n }\n if (stopObserve5 != undefined) {\n await stopObserve5();\n }\n await stopObserve2();\n await stopObserve1();\n } else {\n const startDate = Date.now();\n try {\n await pickListsChain.currentValue;\n await resourcesExternalConvertersChain.currentValue;\n await staticResourcesForProductionChain.currentValue;\n await buildFormsChain.currentValue;\n await buildCandyWidgetChain.currentValue;\n // eslint-disable-next-line no-console\n console.log(chalk.greenBright(\"Build success\"));\n } finally {\n const totalTime = Date.now() - startDate;\n // eslint-disable-next-line no-console\n console.log(`Total time: ${printTime(totalTime)}`);\n }\n }\n}\n\nasync function cleanTargetDirectory(resourcesDirectory: string, logger: ILogger): Promise<void> {\n logger.log(\"Cleaning resource directory. \" + resourcesDirectory);\n await emptyDir(resourcesDirectory);\n logger.log(\"Resource directory clean\");\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,kBAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,aAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAR,OAAA;AACA,IAAAS,6BAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,qBAAA,GAAAX,OAAA;AAKA,IAAAY,sBAAA,GAAAZ,OAAA;AACA,IAAAa,gBAAA,GAAAb,OAAA;AACA,IAAAc,cAAA,GAAAd,OAAA;AAEA,IAAAe,eAAA,GAAAf,OAAA;AAEA,IAAAgB,aAAA,GAAAhB,OAAA;AACA,IAAAiB,QAAA,GAAAjB,OAAA;AACA,IAAAkB,oBAAA,GAAAlB,OAAA;AACA,IAAAmB,YAAA,GAAAnB,OAAA;AACA,IAAAoB,kBAAA,GAAApB,OAAA;AACA,IAAAqB,YAAA,GAAArB,OAAA;AACA,IAAAsB,yBAAA,GAAAtB,OAAA;AAEA,IAAAuB,cAAA,GAAAvB,OAAA;AACA,IAAAwB,0BAAA,GAAAxB,OAAA;AACA,IAAAyB,cAAA,GAAAzB,OAAA;AACA,IAAA0B,qBAAA,GAAA1B,OAAA;AACA,IAAA2B,8BAAA,GAAA3B,OAAA;AACA,IAAA4B,iBAAA,GAAA5B,OAAA;AACA,IAAA6B,yBAAA,GAAA7B,OAAA;AACA,IAAA8B,qBAAA,GAAA9B,OAAA;AACA,IAAA+B,qBAAA,GAAA/B,OAAA;AAIA,SAASgC,mBAAmBA,CAACC,eA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;IACxB;IACA,MAAMF,YAAY,CAAC,CAAC;IACpB,MAAMF,YAAY,CAAC,CAAC;EACxB,CAAC,MAAM;IACH,MAAMM,SAAS,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC;IAC5B,IAAI;MACA,MAAMjI,cAAc,CAACkI,YAAY;MACjC,MAAMhH,gCAAgC,CAACgH,YAAY;MACnD,MAAMnH,iCAAiC,CAACmH,YAAY;MACpD,MAAMzB,eAAe,CAACyB,YAAY;MAClC,MAAMjB,qBAAqB,CAACiB,YAAY;MACxC;MACAC,OAAO,CAACtD,GAAG,CAACuD,cAAK,CAACC,WAAW,CAAC,eAAe,CAAC,CAAC;IACnD,CAAC,SAAS;MACN,MAAMC,SAAS,GAAGN,IAAI,CAACC,GAAG,CAAC,CAAC,GAAGF,SAAS;MACxC;MACAI,OAAO,CAACtD,GAAG,CAAC,eAAe,IAAA0D,sBAAS,EAACD,SAAS,CAAC,EAAE,CAAC;IACtD;EACJ;AACJ;AAEA,eAAed,oBAAoBA,CAAC5H,kBAA0B,EAAEa,MAAe,EAAiB;EAC5FA,MAAM,CAACoE,GAAG,CAAC,+BAA+B,GAAGjF,kBAAkB,CAAC;EAChE,MAAM,IAAA4I,iBAAQ,EAAC5I,kBAAkB,CAAC;EAClCa,MAAM,CAACoE,GAAG,CAAC,0BAA0B,CAAC;AAC1C","ignoreList":[]}
@@ -18,10 +18,10 @@ var _SingletonController = require("../../../Commons/HttpServer/ExpressWrapper/S
18
18
  var _WellKnownDirectories = require("../../../../../Common/WellKnownDirectories");
19
19
  var _BuildFormDevServer = require("./DevServers/BuildFormDevServer");
20
20
  var _FarmDirectory = require("./Directories/FarmDirectory");
21
- var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _class;
21
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _class;
22
22
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
23
23
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
- let BuildServerBuildFormsController = exports.BuildServerBuildFormsController = (_dec = (0, _Methods.httpGet)("/:update.hot-update.json", _Results.httpReturn.StreamWithMime("application/json"), (0, _Params.httpUrlParam)("update", _Params.httpType.String)), _dec2 = (0, _Methods.httpGet)("/:update.hot-update.js", _Results.httpReturn.StreamWithMime("application/javascript"), (0, _Params.httpUrlParam)("update", _Params.httpType.String)), _dec3 = (0, _Methods.httpGet)("/:update.hot-update.js.map", _Results.httpReturn.StreamWithMime("application/json"), (0, _Params.httpUrlParam)("update", _Params.httpType.String)), _dec4 = (0, _Methods.httpGet)(/^\/public\/scripts\/(((\d{6,})(.[\w\-]*)?(.min)?).js)$/i, _Results.httpReturn.StreamWithMime("application/javascript"), (0, _Params.httpUrlParam)("0", _Params.httpType.String), (0, _Params.httpUrlParam)("1", _Params.httpType.String), (0, _Params.httpUrlParam)("2", _Params.httpType.String)), _dec5 = (0, _Methods.httpGet)(/^\/public\/styles\/(((\d{6,})(.[\w\-]*)?(.min)?).css)$/i, _Results.httpReturn.StreamWithMime("text/css"), (0, _Params.httpUrlParam)("0", _Params.httpType.String), (0, _Params.httpUrlParam)("1", _Params.httpType.String), (0, _Params.httpUrlParam)("2", _Params.httpType.String), (0, _Params.httpUrlParam)("3", _Params.httpType.String)), _dec6 = (0, _Methods.httpGet)("/public/images/:filename", _Results.httpReturn.Stream, (0, _Params.httpUrlParam)("filename", _Params.httpType.String)), _dec7 = (0, _Methods.httpGet)("/normalize/:gfv.All.kclang", _Results.httpReturn.Stream, (0, _Params.httpUrlParam)("gfv", _Params.httpType.String)), _dec8 = (0, _Methods.httpGet)("/schemas/:gfv.extendedSchema.json", _Results.httpReturn.Stream, (0, _Params.httpUrlParam)("gfv", _Params.httpType.String)), _dec9 = (0, _Methods.httpGet)("/normalize/:gfv.:normalizerId.flang", _Results.httpReturn.Stream, (0, _Params.httpUrlParam)("gfv", _Params.httpType.String), (0, _Params.httpUrlParam)("normalizerId", _Params.httpType.String)), (_class = class BuildServerBuildFormsController extends _SingletonController.SingletonController {
24
+ let BuildServerBuildFormsController = exports.BuildServerBuildFormsController = (_dec = (0, _Methods.httpGet)("/:update.hot-update.json", _Results.httpReturn.StreamWithMime("application/json"), (0, _Params.httpUrlParam)("update", _Params.httpType.String)), _dec2 = (0, _Methods.httpGet)("/:update.hot-update.js", _Results.httpReturn.StreamWithMime("application/javascript"), (0, _Params.httpUrlParam)("update", _Params.httpType.String)), _dec3 = (0, _Methods.httpGet)("/:update.hot-update.js.map", _Results.httpReturn.StreamWithMime("application/json"), (0, _Params.httpUrlParam)("update", _Params.httpType.String)), _dec4 = (0, _Methods.httpGet)(/^\/public\/scripts\/(((\d{6,})(.[\w\-]*)?(.min)?).js)$/i, _Results.httpReturn.StreamWithMime("application/javascript"), (0, _Params.httpUrlParam)("0", _Params.httpType.String), (0, _Params.httpUrlParam)("1", _Params.httpType.String), (0, _Params.httpUrlParam)("2", _Params.httpType.String)), _dec5 = (0, _Methods.httpGet)(/^\/public\/styles\/(((\d{6,})(.[\w\-]*)?(.min)?).css)$/i, _Results.httpReturn.StreamWithMime("text/css"), (0, _Params.httpUrlParam)("0", _Params.httpType.String), (0, _Params.httpUrlParam)("1", _Params.httpType.String), (0, _Params.httpUrlParam)("2", _Params.httpType.String), (0, _Params.httpUrlParam)("3", _Params.httpType.String)), _dec6 = (0, _Methods.httpGet)("/public/images/:filename", _Results.httpReturn.Stream, (0, _Params.httpUrlParam)("filename", _Params.httpType.String)), _dec7 = (0, _Methods.httpGet)("/normalize/:gfv.All.kclang", _Results.httpReturn.Stream, (0, _Params.httpUrlParam)("gfv", _Params.httpType.String)), _dec8 = (0, _Methods.httpGet)("/schemas/:gfv.extendedSchema.json", _Results.httpReturn.Stream, (0, _Params.httpUrlParam)("gfv", _Params.httpType.String)), (_class = class BuildServerBuildFormsController extends _SingletonController.SingletonController {
25
25
  constructor(allFarmConfig, candyModulesDirectory, useGeneratorFromLocalSources, engineDirectory, buildDebugOnly, nightly = false) {
26
26
  super();
27
27
  this.allFarmDirectory = void 0;
@@ -82,11 +82,6 @@ let BuildServerBuildFormsController = exports.BuildServerBuildFormsController =
82
82
  const stream = await buildFormDevServer.getGeneratedFileAsStream(`extendedSchema.json`);
83
83
  return new _StreamResultHandler.StreamResult(stream);
84
84
  }
85
- async getCustomFLangNormalizeFile(gfv, normalizerId) {
86
- const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);
87
- const stream = await buildFormDevServer.getGeneratedFileAsStream(`${normalizerId}.flang`);
88
- return new _StreamResultHandler.StreamResult(stream);
89
- }
90
85
  async getFirstExistsFileAsStreamFromDevServer(filename, mimeType) {
91
86
  for (const devServer of Object.values(this.devServers)) {
92
87
  if (devServer != undefined) {
@@ -147,7 +142,7 @@ let BuildServerBuildFormsController = exports.BuildServerBuildFormsController =
147
142
  async getOrCreateBuildFormDevServer(gfv) {
148
143
  let devServer = this.devServers[gfv];
149
144
  if (devServer == undefined) {
150
- devServer = new _BuildFormDevServer.BuildFormDevServer(this.nextFreePort++, this.allFarmDirectoryPath, gfv, this.candyModulesDirectory, this.allFarmConfig, this.useGeneratorFromLocalSources, this.engineDirectory, this.buildDebugOnly, false,
145
+ devServer = new _BuildFormDevServer.BuildFormDevServer(this.nextFreePort++, this.allFarmDirectoryPath, gfv, this.candyModulesDirectory, this.useGeneratorFromLocalSources, this.engineDirectory, this.buildDebugOnly, false,
151
146
  // skipCodeReformatting
152
147
  this.nightly);
153
148
  this.devServers[gfv] = devServer;
@@ -155,5 +150,5 @@ let BuildServerBuildFormsController = exports.BuildServerBuildFormsController =
155
150
  }
156
151
  return devServer;
157
152
  }
158
- }, ((0, _applyDecoratedDescriptor2.default)(_class.prototype, "getDevServerUpdateJson", [_dec], Object.getOwnPropertyDescriptor(_class.prototype, "getDevServerUpdateJson"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getDevServerUpdateJs", [_dec2], Object.getOwnPropertyDescriptor(_class.prototype, "getDevServerUpdateJs"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getDevServerUpdateJsMap", [_dec3], Object.getOwnPropertyDescriptor(_class.prototype, "getDevServerUpdateJsMap"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getFormScript", [_dec4], Object.getOwnPropertyDescriptor(_class.prototype, "getFormScript"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getFormStyle", [_dec5], Object.getOwnPropertyDescriptor(_class.prototype, "getFormStyle"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getFormImages", [_dec6], Object.getOwnPropertyDescriptor(_class.prototype, "getFormImages"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getAllKclangFile", [_dec7], Object.getOwnPropertyDescriptor(_class.prototype, "getAllKclangFile"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getExtendedSchemaFile", [_dec8], Object.getOwnPropertyDescriptor(_class.prototype, "getExtendedSchemaFile"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getCustomFLangNormalizeFile", [_dec9], Object.getOwnPropertyDescriptor(_class.prototype, "getCustomFLangNormalizeFile"), _class.prototype)), _class));
153
+ }, ((0, _applyDecoratedDescriptor2.default)(_class.prototype, "getDevServerUpdateJson", [_dec], Object.getOwnPropertyDescriptor(_class.prototype, "getDevServerUpdateJson"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getDevServerUpdateJs", [_dec2], Object.getOwnPropertyDescriptor(_class.prototype, "getDevServerUpdateJs"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getDevServerUpdateJsMap", [_dec3], Object.getOwnPropertyDescriptor(_class.prototype, "getDevServerUpdateJsMap"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getFormScript", [_dec4], Object.getOwnPropertyDescriptor(_class.prototype, "getFormScript"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getFormStyle", [_dec5], Object.getOwnPropertyDescriptor(_class.prototype, "getFormStyle"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getFormImages", [_dec6], Object.getOwnPropertyDescriptor(_class.prototype, "getFormImages"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getAllKclangFile", [_dec7], Object.getOwnPropertyDescriptor(_class.prototype, "getAllKclangFile"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getExtendedSchemaFile", [_dec8], Object.getOwnPropertyDescriptor(_class.prototype, "getExtendedSchemaFile"), _class.prototype)), _class));
159
154
  //# sourceMappingURL=BuildServerBuildFormsController.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BuildServerBuildFormsController.js","names":["path","_interopRequireWildcard","require","_mimeTypes","_interopRequireDefault","_ResolveFormInfo","_Methods","_NotFoundWebError","_Params","_Results","_StreamResultHandler","_SingletonController","_WellKnownDirectories","_BuildFormDevServer","_FarmDirectory","_dec","_dec2","_dec3","_dec4","_dec5","_dec6","_dec7","_dec8","_dec9","_class","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","BuildServerBuildFormsController","exports","httpGet","httpReturn","StreamWithMime","httpUrlParam","httpType","String","Stream","SingletonController","constructor","allFarmConfig","candyModulesDirectory","useGeneratorFromLocalSources","engineDirectory","buildDebugOnly","nightly","allFarmDirectory","allFarmDirectoryPath","nextFreePort","devServers","map","farm","FarmDirectory","farmDirectory","setupMiddleware","expressApplication","use","_","__","next","resetAllFarmDirectories","getDevServerUpdateJson","updateName","getFirstExistsFileAsStreamFromDevServer","getDevServerUpdateJs","getDevServerUpdateJsMap","getFormScript","fileName","_fileNameWithoutExt","gfv","buildFormDevServer","getOrCreateBuildFormDevServer","StreamResult","getFileAsStream","getFormStyle","theme","replace","getFormImages","mime","lookup","getAllKclangFile","stream","getGeneratedFileAsStream","getExtendedSchemaFile","getCustomFLangNormalizeFile","normalizerId","filename","mimeType","devServer","values","undefined","NotFoundWebError","getAllAttachmentPathFileNames","Promise","all","getAllGfvs","flat","getAttachmentPathsFileContent","resultStream","getAttachmentPathsWithGfvsFileContent","getAllNormalizationFileNames","result","gfvInfos","getAllGfvWithLocations","formPath","_formConfig$settings$","_formConfig$settings","formConfig","readFormConfig","join","WellKnownDirectories","FormJsonFileName","useServerSideFLangNormalization","settings","push","getNormalizationFileContent","_formConfig$settings$2","_formConfig$settings2","gfvInfo","find","x","BuildFormDevServer","start","_applyDecoratedDescriptor2","prototype"],"sources":["../../../../../../src/CLICommands/BuildServer/ResourcesControllers/BuildServerBuildFormsController.ts"],"sourcesContent":["import * as path from \"path\";\n\nimport { Express } from \"express\";\nimport mime from \"mime-types\";\nimport { FarmConfig } from \"Tools/src/CandyCLI\";\n\nimport { readFormConfig } from \"../../../BuildTasks/ResolveFormInfo\";\nimport { httpGet } from \"../../../Commons/HttpServer/AttributeRouting/Methods\";\nimport { NotFoundWebError } from \"../../../Commons/HttpServer/AttributeRouting/NotFoundWebError\";\nimport { httpType, httpUrlParam } from \"../../../Commons/HttpServer/AttributeRouting/Params\";\nimport { httpReturn } from \"../../../Commons/HttpServer/AttributeRouting/Results\";\nimport { StreamResult } from \"../../../Commons/HttpServer/AttributeRouting/Results/StreamResultHandler\";\nimport { SingletonController } from \"../../../Commons/HttpServer/ExpressWrapper/SingletonController\";\nimport { WellKnownDirectories } from \"../../../../../Common/WellKnownDirectories\";\n\nimport { BuildFormDevServer } from \"./DevServers/BuildFormDevServer\";\nimport { FarmDirectory } from \"./Directories/FarmDirectory\";\nimport { IGeneratedServerSideSourcesProvider } from \"./IGeneratedServerSideSourcesProvider\";\n\nexport class BuildServerBuildFormsController\n extends SingletonController\n implements IGeneratedServerSideSourcesProvider\n{\n private allFarmDirectory: FarmDirectory[];\n private readonly allFarmDirectoryPath: string[];\n private nextFreePort = 12001;\n private readonly devServers: { [gfv: string]: undefined | BuildFormDevServer } = {};\n private readonly candyModulesDirectory: string;\n private readonly allFarmConfig: FarmConfig[];\n private readonly useGeneratorFromLocalSources: boolean;\n private readonly engineDirectory: string;\n private readonly nightly: boolean;\n private readonly buildDebugOnly: boolean;\n\n public constructor(\n allFarmConfig: FarmConfig[],\n candyModulesDirectory: string,\n useGeneratorFromLocalSources: boolean,\n engineDirectory: string,\n buildDebugOnly: boolean,\n nightly: boolean = false\n ) {\n super();\n this.nightly = nightly;\n this.allFarmDirectory = allFarmConfig.map(farm => new FarmDirectory(farm.farmDirectory));\n this.allFarmDirectoryPath = allFarmConfig.map(farm => farm.farmDirectory);\n this.candyModulesDirectory = candyModulesDirectory;\n this.allFarmConfig = allFarmConfig;\n this.useGeneratorFromLocalSources = useGeneratorFromLocalSources;\n this.engineDirectory = engineDirectory;\n this.buildDebugOnly = buildDebugOnly;\n }\n\n public async setupMiddleware(expressApplication: Express) {\n expressApplication.use(\"/force-gfvs\", (_, __, next) => {\n this.resetAllFarmDirectories();\n next();\n });\n }\n\n private resetAllFarmDirectories() {\n this.allFarmDirectory = this.allFarmConfig.map(i => new FarmDirectory(i.farmDirectory));\n }\n\n @httpGet(\n \"/:update.hot-update.json\",\n httpReturn.StreamWithMime(\"application/json\"),\n httpUrlParam(\"update\", httpType.String)\n )\n public async getDevServerUpdateJson(updateName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(`static/${updateName}.hot-update.json`);\n }\n\n @httpGet(\n \"/:update.hot-update.js\",\n httpReturn.StreamWithMime(\"application/javascript\"),\n httpUrlParam(\"update\", httpType.String)\n )\n public async getDevServerUpdateJs(updateName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(`static/${updateName}.hot-update.js`);\n }\n\n @httpGet(\n \"/:update.hot-update.js.map\",\n httpReturn.StreamWithMime(\"application/json\"),\n httpUrlParam(\"update\", httpType.String)\n )\n public async getDevServerUpdateJsMap(updateName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(`static/${updateName}.hot-update.js.map`);\n }\n\n @httpGet(\n /^\\/public\\/scripts\\/(((\\d{6,})(.[\\w\\-]*)?(.min)?).js)$/i,\n httpReturn.StreamWithMime(\"application/javascript\"),\n httpUrlParam(\"0\", httpType.String),\n httpUrlParam(\"1\", httpType.String),\n httpUrlParam(\"2\", httpType.String)\n )\n public async getFormScript(fileName: string, _fileNameWithoutExt: string, gfv: string): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n return new StreamResult(await buildFormDevServer.getFileAsStream(`static/public/scripts/${fileName}`));\n }\n\n @httpGet(\n /^\\/public\\/styles\\/(((\\d{6,})(.[\\w\\-]*)?(.min)?).css)$/i,\n httpReturn.StreamWithMime(\"text/css\"),\n httpUrlParam(\"0\", httpType.String),\n httpUrlParam(\"1\", httpType.String),\n httpUrlParam(\"2\", httpType.String),\n httpUrlParam(\"3\", httpType.String)\n )\n public async getFormStyle(\n fileName: string,\n _fileNameWithoutExt: string,\n gfv: string,\n theme: undefined | string\n ): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n return new StreamResult(\n await buildFormDevServer.getFileAsStream(`static/public/styles/${fileName.replace(theme ?? \"\", \"\")}`)\n );\n }\n\n @httpGet(\"/public/images/:filename\", httpReturn.Stream, httpUrlParam(\"filename\", httpType.String))\n public async getFormImages(fileName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(\n `static/public/images/${fileName}`,\n mime.lookup(fileName)\n );\n }\n\n @httpGet(\"/normalize/:gfv.All.kclang\", httpReturn.Stream, httpUrlParam(\"gfv\", httpType.String))\n public async getAllKclangFile(gfv: string): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const stream = await buildFormDevServer.getGeneratedFileAsStream(`All.kclang`);\n return new StreamResult(stream);\n }\n\n @httpGet(\"/schemas/:gfv.extendedSchema.json\", httpReturn.Stream, httpUrlParam(\"gfv\", httpType.String))\n public async getExtendedSchemaFile(gfv: string): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const stream = await buildFormDevServer.getGeneratedFileAsStream(`extendedSchema.json`);\n return new StreamResult(stream);\n }\n\n @httpGet(\n \"/normalize/:gfv.:normalizerId.flang\",\n httpReturn.Stream,\n httpUrlParam(\"gfv\", httpType.String),\n httpUrlParam(\"normalizerId\", httpType.String)\n )\n public async getCustomFLangNormalizeFile(gfv: string, normalizerId: string): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const stream = await buildFormDevServer.getGeneratedFileAsStream(`${normalizerId}.flang`);\n return new StreamResult(stream);\n }\n\n private async getFirstExistsFileAsStreamFromDevServer(filename: string, mimeType?: string | false) {\n for (const devServer of Object.values(this.devServers)) {\n if (devServer != undefined) {\n try {\n return new StreamResult(await devServer.getFileAsStream(filename), mimeType);\n } catch {\n // try next server\n }\n }\n }\n throw new NotFoundWebError(\"File not found\", true);\n }\n\n public async getAllAttachmentPathFileNames(): Promise<string[]> {\n return (await Promise.all(this.allFarmDirectory.map(i => i.getAllGfvs()))).flat().map(gfv => `${gfv}.json`);\n }\n\n public async getAttachmentPathsFileContent(gfv: string): Promise<NodeJS.ReadableStream> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const resultStream = await buildFormDevServer.getGeneratedFileAsStream(`AttachmentPaths.json`);\n return resultStream;\n }\n\n public async getAttachmentPathsWithGfvsFileContent(gfv: string): Promise<NodeJS.ReadableStream> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const resultStream = await buildFormDevServer.getGeneratedFileAsStream(`AttachmentPathsWithGfvs.json`);\n return resultStream;\n }\n\n public async getAllNormalizationFileNames(): Promise<string[]> {\n const result: string[] = [];\n const gfvInfos = (await Promise.all(this.allFarmDirectory.map(i => i.getAllGfvWithLocations()))).flat();\n for (const { gfv, formPath } of gfvInfos) {\n const formConfig = await readFormConfig(path.join(formPath, WellKnownDirectories.FormJsonFileName));\n const useServerSideFLangNormalization = formConfig.settings?.useServerSideFLangNormalization ?? false;\n if (useServerSideFLangNormalization) {\n result.push(`${gfv}.normalize`);\n }\n }\n return result;\n }\n\n public async getNormalizationFileContent(gfv: string): Promise<NodeJS.ReadableStream | null> {\n const gfvInfos = (await Promise.all(this.allFarmDirectory.map(i => i.getAllGfvWithLocations()))).flat();\n const gfvInfo = gfvInfos.find(x => x.gfv === gfv);\n if (gfvInfo == null) {\n return null;\n }\n const formConfig = await readFormConfig(path.join(gfvInfo.formPath, WellKnownDirectories.FormJsonFileName));\n const useServerSideFLangNormalization = formConfig.settings?.useServerSideFLangNormalization ?? false;\n if (!useServerSideFLangNormalization) {\n return null;\n }\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const resultStream = await buildFormDevServer.getGeneratedFileAsStream(`ServerSide.normalize`);\n return resultStream;\n }\n\n private async getOrCreateBuildFormDevServer(gfv: string): Promise<BuildFormDevServer> {\n let devServer = this.devServers[gfv];\n if (devServer == undefined) {\n devServer = new BuildFormDevServer(\n this.nextFreePort++,\n this.allFarmDirectoryPath,\n gfv,\n this.candyModulesDirectory,\n this.allFarmConfig,\n this.useGeneratorFromLocalSources,\n this.engineDirectory,\n this.buildDebugOnly,\n false, // skipCodeReformatting\n this.nightly\n );\n this.devServers[gfv] = devServer;\n await devServer.start();\n }\n return devServer;\n }\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A,CAAAf,MAAA,CAAAoH,SAAA,oBAAApH,MAAA,CAAAoH,SAAA,OAAAD,0BAAA,CAAA5G,OAAA,EAAAP,MAAA,CAAAoH,SAAA,uBAAAvH,KAAA,GAAAgB,MAAA,CAAAE,wBAAA,CAAAf,MAAA,CAAAoH,SAAA,uBAAApH,MAAA,CAAAoH,SAAA,OAAAD,0BAAA,CAAA5G,OAAA,EAAAP,MAAA,CAAAoH,SAAA,4BAAAtH,KAAA,GAAAe,MAAA,CAAAE,wBAAA,CAAAf,MAAA,CAAAoH,SAAA,4BAAApH,MAAA,CAAAoH,SAAA,OAAAD,0BAAA,CAAA5G,OAAA,EAAAP,MAAA,CAAAoH,SAAA,kCAAArH,KAAA,GAAAc,MAAA,CAAAE,wBAAA,CAAAf,MAAA,CAAAoH,SAAA,kCAAApH,MAAA,CAAAoH,SAAA,IAAApH,MAAA","ignoreList":[]}
1
+ {"version":3,"file":"BuildServerBuildFormsController.js","names":["path","_interopRequireWildcard","require","_mimeTypes","_interopRequireDefault","_ResolveFormInfo","_Methods","_NotFoundWebError","_Params","_Results","_StreamResultHandler","_SingletonController","_WellKnownDirectories","_BuildFormDevServer","_FarmDirectory","_dec","_dec2","_dec3","_dec4","_dec5","_dec6","_dec7","_dec8","_class","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","BuildServerBuildFormsController","exports","httpGet","httpReturn","StreamWithMime","httpUrlParam","httpType","String","Stream","SingletonController","constructor","allFarmConfig","candyModulesDirectory","useGeneratorFromLocalSources","engineDirectory","buildDebugOnly","nightly","allFarmDirectory","allFarmDirectoryPath","nextFreePort","devServers","map","farm","FarmDirectory","farmDirectory","setupMiddleware","expressApplication","use","_","__","next","resetAllFarmDirectories","getDevServerUpdateJson","updateName","getFirstExistsFileAsStreamFromDevServer","getDevServerUpdateJs","getDevServerUpdateJsMap","getFormScript","fileName","_fileNameWithoutExt","gfv","buildFormDevServer","getOrCreateBuildFormDevServer","StreamResult","getFileAsStream","getFormStyle","theme","replace","getFormImages","mime","lookup","getAllKclangFile","stream","getGeneratedFileAsStream","getExtendedSchemaFile","filename","mimeType","devServer","values","undefined","NotFoundWebError","getAllAttachmentPathFileNames","Promise","all","getAllGfvs","flat","getAttachmentPathsFileContent","resultStream","getAttachmentPathsWithGfvsFileContent","getAllNormalizationFileNames","result","gfvInfos","getAllGfvWithLocations","formPath","_formConfig$settings$","_formConfig$settings","formConfig","readFormConfig","join","WellKnownDirectories","FormJsonFileName","useServerSideFLangNormalization","settings","push","getNormalizationFileContent","_formConfig$settings$2","_formConfig$settings2","gfvInfo","find","x","BuildFormDevServer","start","_applyDecoratedDescriptor2","prototype"],"sources":["../../../../../../src/CLICommands/BuildServer/ResourcesControllers/BuildServerBuildFormsController.ts"],"sourcesContent":["import * as path from \"path\";\n\nimport { Express } from \"express\";\nimport mime from \"mime-types\";\nimport { FarmConfig } from \"Tools/src/CandyCLI\";\n\nimport { readFormConfig } from \"../../../BuildTasks/ResolveFormInfo\";\nimport { httpGet } from \"../../../Commons/HttpServer/AttributeRouting/Methods\";\nimport { NotFoundWebError } from \"../../../Commons/HttpServer/AttributeRouting/NotFoundWebError\";\nimport { httpType, httpUrlParam } from \"../../../Commons/HttpServer/AttributeRouting/Params\";\nimport { httpReturn } from \"../../../Commons/HttpServer/AttributeRouting/Results\";\nimport { StreamResult } from \"../../../Commons/HttpServer/AttributeRouting/Results/StreamResultHandler\";\nimport { SingletonController } from \"../../../Commons/HttpServer/ExpressWrapper/SingletonController\";\nimport { WellKnownDirectories } from \"../../../../../Common/WellKnownDirectories\";\n\nimport { BuildFormDevServer } from \"./DevServers/BuildFormDevServer\";\nimport { FarmDirectory } from \"./Directories/FarmDirectory\";\nimport { IGeneratedServerSideSourcesProvider } from \"./IGeneratedServerSideSourcesProvider\";\n\nexport class BuildServerBuildFormsController\n extends SingletonController\n implements IGeneratedServerSideSourcesProvider\n{\n private allFarmDirectory: FarmDirectory[];\n private readonly allFarmDirectoryPath: string[];\n private nextFreePort = 12001;\n private readonly devServers: { [gfv: string]: undefined | BuildFormDevServer } = {};\n private readonly candyModulesDirectory: string;\n private readonly allFarmConfig: FarmConfig[];\n private readonly useGeneratorFromLocalSources: boolean;\n private readonly engineDirectory: string;\n private readonly nightly: boolean;\n private readonly buildDebugOnly: boolean;\n\n public constructor(\n allFarmConfig: FarmConfig[],\n candyModulesDirectory: string,\n useGeneratorFromLocalSources: boolean,\n engineDirectory: string,\n buildDebugOnly: boolean,\n nightly: boolean = false\n ) {\n super();\n this.nightly = nightly;\n this.allFarmDirectory = allFarmConfig.map(farm => new FarmDirectory(farm.farmDirectory));\n this.allFarmDirectoryPath = allFarmConfig.map(farm => farm.farmDirectory);\n this.candyModulesDirectory = candyModulesDirectory;\n this.allFarmConfig = allFarmConfig;\n this.useGeneratorFromLocalSources = useGeneratorFromLocalSources;\n this.engineDirectory = engineDirectory;\n this.buildDebugOnly = buildDebugOnly;\n }\n\n public async setupMiddleware(expressApplication: Express) {\n expressApplication.use(\"/force-gfvs\", (_, __, next) => {\n this.resetAllFarmDirectories();\n next();\n });\n }\n\n private resetAllFarmDirectories() {\n this.allFarmDirectory = this.allFarmConfig.map(i => new FarmDirectory(i.farmDirectory));\n }\n\n @httpGet(\n \"/:update.hot-update.json\",\n httpReturn.StreamWithMime(\"application/json\"),\n httpUrlParam(\"update\", httpType.String)\n )\n public async getDevServerUpdateJson(updateName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(`static/${updateName}.hot-update.json`);\n }\n\n @httpGet(\n \"/:update.hot-update.js\",\n httpReturn.StreamWithMime(\"application/javascript\"),\n httpUrlParam(\"update\", httpType.String)\n )\n public async getDevServerUpdateJs(updateName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(`static/${updateName}.hot-update.js`);\n }\n\n @httpGet(\n \"/:update.hot-update.js.map\",\n httpReturn.StreamWithMime(\"application/json\"),\n httpUrlParam(\"update\", httpType.String)\n )\n public async getDevServerUpdateJsMap(updateName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(`static/${updateName}.hot-update.js.map`);\n }\n\n @httpGet(\n /^\\/public\\/scripts\\/(((\\d{6,})(.[\\w\\-]*)?(.min)?).js)$/i,\n httpReturn.StreamWithMime(\"application/javascript\"),\n httpUrlParam(\"0\", httpType.String),\n httpUrlParam(\"1\", httpType.String),\n httpUrlParam(\"2\", httpType.String)\n )\n public async getFormScript(fileName: string, _fileNameWithoutExt: string, gfv: string): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n return new StreamResult(await buildFormDevServer.getFileAsStream(`static/public/scripts/${fileName}`));\n }\n\n @httpGet(\n /^\\/public\\/styles\\/(((\\d{6,})(.[\\w\\-]*)?(.min)?).css)$/i,\n httpReturn.StreamWithMime(\"text/css\"),\n httpUrlParam(\"0\", httpType.String),\n httpUrlParam(\"1\", httpType.String),\n httpUrlParam(\"2\", httpType.String),\n httpUrlParam(\"3\", httpType.String)\n )\n public async getFormStyle(\n fileName: string,\n _fileNameWithoutExt: string,\n gfv: string,\n theme: undefined | string\n ): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n return new StreamResult(\n await buildFormDevServer.getFileAsStream(`static/public/styles/${fileName.replace(theme ?? \"\", \"\")}`)\n );\n }\n\n @httpGet(\"/public/images/:filename\", httpReturn.Stream, httpUrlParam(\"filename\", httpType.String))\n public async getFormImages(fileName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(\n `static/public/images/${fileName}`,\n mime.lookup(fileName)\n );\n }\n\n @httpGet(\"/normalize/:gfv.All.kclang\", httpReturn.Stream, httpUrlParam(\"gfv\", httpType.String))\n public async getAllKclangFile(gfv: string): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const stream = await buildFormDevServer.getGeneratedFileAsStream(`All.kclang`);\n return new StreamResult(stream);\n }\n\n @httpGet(\"/schemas/:gfv.extendedSchema.json\", httpReturn.Stream, httpUrlParam(\"gfv\", httpType.String))\n public async getExtendedSchemaFile(gfv: string): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const stream = await buildFormDevServer.getGeneratedFileAsStream(`extendedSchema.json`);\n return new StreamResult(stream);\n }\n\n private async getFirstExistsFileAsStreamFromDevServer(filename: string, mimeType?: string | false) {\n for (const devServer of Object.values(this.devServers)) {\n if (devServer != undefined) {\n try {\n return new StreamResult(await devServer.getFileAsStream(filename), mimeType);\n } catch {\n // try next server\n }\n }\n }\n throw new NotFoundWebError(\"File not found\", true);\n }\n\n public async getAllAttachmentPathFileNames(): Promise<string[]> {\n return (await Promise.all(this.allFarmDirectory.map(i => i.getAllGfvs()))).flat().map(gfv => `${gfv}.json`);\n }\n\n public async getAttachmentPathsFileContent(gfv: string): Promise<NodeJS.ReadableStream> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const resultStream = await buildFormDevServer.getGeneratedFileAsStream(`AttachmentPaths.json`);\n return resultStream;\n }\n\n public async getAttachmentPathsWithGfvsFileContent(gfv: string): Promise<NodeJS.ReadableStream> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const resultStream = await buildFormDevServer.getGeneratedFileAsStream(`AttachmentPathsWithGfvs.json`);\n return resultStream;\n }\n\n public async getAllNormalizationFileNames(): Promise<string[]> {\n const result: string[] = [];\n const gfvInfos = (await Promise.all(this.allFarmDirectory.map(i => i.getAllGfvWithLocations()))).flat();\n for (const { gfv, formPath } of gfvInfos) {\n const formConfig = await readFormConfig(path.join(formPath, WellKnownDirectories.FormJsonFileName));\n const useServerSideFLangNormalization = formConfig.settings?.useServerSideFLangNormalization ?? false;\n if (useServerSideFLangNormalization) {\n result.push(`${gfv}.normalize`);\n }\n }\n return result;\n }\n\n public async getNormalizationFileContent(gfv: string): Promise<NodeJS.ReadableStream | null> {\n const gfvInfos = (await Promise.all(this.allFarmDirectory.map(i => i.getAllGfvWithLocations()))).flat();\n const gfvInfo = gfvInfos.find(x => x.gfv === gfv);\n if (gfvInfo == null) {\n return null;\n }\n const formConfig = await readFormConfig(path.join(gfvInfo.formPath, WellKnownDirectories.FormJsonFileName));\n const useServerSideFLangNormalization = formConfig.settings?.useServerSideFLangNormalization ?? false;\n if (!useServerSideFLangNormalization) {\n return null;\n }\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const resultStream = await buildFormDevServer.getGeneratedFileAsStream(`ServerSide.normalize`);\n return resultStream;\n }\n\n private async getOrCreateBuildFormDevServer(gfv: string): Promise<BuildFormDevServer> {\n let devServer = this.devServers[gfv];\n if (devServer == undefined) {\n devServer = new BuildFormDevServer(\n this.nextFreePort++,\n this.allFarmDirectoryPath,\n gfv,\n this.candyModulesDirectory,\n this.useGeneratorFromLocalSources,\n this.engineDirectory,\n this.buildDebugOnly,\n false, // skipCodeReformatting\n this.nightly\n );\n this.devServers[gfv] = devServer;\n await devServer.start();\n }\n return devServer;\n }\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,IAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,oBAAA,GAAAR,OAAA;AACA,IAAAS,oBAAA,GAAAT,OAAA;AACA,IAAAU,qBAAA,GAAAV,OAAA;AAEA,IAAAW,mBAAA,GAAAX,OAAA;AACA,IAAAY,cAAA,GAAAZ,OAAA;AAA4D,IAAAa,IAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EA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CAAAE,wBAAA,CAAAf,MAAA,CAAAkH,SAAA,mBAAAlH,MAAA,CAAAkH,SAAA,OAAAD,0BAAA,CAAA1G,OAAA,EAAAP,MAAA,CAAAkH,SAAA,oBAAArH,KAAA,GAAAgB,MAAA,CAAAE,wBAAA,CAAAf,MAAA,CAAAkH,SAAA,oBAAAlH,MAAA,CAAAkH,SAAA,OAAAD,0BAAA,CAAA1G,OAAA,EAAAP,MAAA,CAAAkH,SAAA,uBAAApH,KAAA,GAAAe,MAAA,CAAAE,wBAAA,CAAAf,MAAA,CAAAkH,SAAA,uBAAAlH,MAAA,CAAAkH,SAAA,OAAAD,0BAAA,CAAA1G,OAAA,EAAAP,MAAA,CAAAkH,SAAA,4BAAAnH,KAAA,GAAAc,MAAA,CAAAE,wBAAA,CAAAf,MAAA,CAAAkH,SAAA,4BAAAlH,MAAA,CAAAkH,SAAA,IAAAlH,MAAA","ignoreList":[]}
@@ -27,14 +27,13 @@ var _WebpackHybridFileSystem = require("./WebpackInMemoryUtils/WebpackHybridFile
27
27
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
28
28
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
29
29
  class BuildFormDevServer {
30
- constructor(port, allFarmConfig, gfv, candyModulesDirectory, farmConfigArray, useGeneratorFromLocalSources, engineDirectory, buildDebugOnly, skipCodeReformatting, nightly) {
30
+ constructor(port, allFarmConfig, gfv, candyModulesDirectory, useGeneratorFromLocalSources, engineDirectory, buildDebugOnly, skipCodeReformatting, nightly) {
31
31
  this.port = void 0;
32
32
  this.allFarmConfig = void 0;
33
33
  this.gfv = void 0;
34
34
  this.candyModulesDirectory = void 0;
35
35
  this.farmDirectory = void 0;
36
36
  this.formPath = void 0;
37
- this.farmConfigArray = void 0;
38
37
  this.startParallelLimit = void 0;
39
38
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
40
39
  this.generateChain = void 0;
@@ -53,7 +52,6 @@ class BuildFormDevServer {
53
52
  this.allFarmConfig = allFarmConfig;
54
53
  this.gfv = gfv;
55
54
  this.candyModulesDirectory = candyModulesDirectory;
56
- this.farmConfigArray = farmConfigArray;
57
55
  this.startParallelLimit = (0, _pLimit.default)(1);
58
56
  this.useGeneratorFromLocalSources = useGeneratorFromLocalSources;
59
57
  this.engineDirectory = engineDirectory;
@@ -144,11 +142,7 @@ class BuildFormDevServer {
144
142
  generator: y
145
143
  }), async fi => (0, _AcquireFormGenerator.getGeneratorSourceKey)(fi.generatorSource)).attach(async fi => _Observe.Observe.files(fi.formSourcesPath, "../../controls/**/generator/*", `./${_WellKnownDirectories.WellKnownDirectories.FormJsonFileName}`, "schemas/**/*", "sugar/**/*", "controls/**/*", "autocalc/**/*", "helpers/**/*", "normalizers/**/*", "validations/**/*", "localization/**/*")).do(async fi => {
146
144
  try {
147
- const FormsDirWithHlPath = this.farmConfigArray.find(i => i.farmDirectory == farmDirectory);
148
- if (FormsDirWithHlPath == undefined) {
149
- throw Error("FormsDirWithHlPath === undefined");
150
- }
151
- await (0, _GenerateForm.generateForm)(fi.formSourcesPath, this.farmDirectory, FormsDirWithHlPath.hlFarmDirectoryPath, fi.generator, undefined, {
145
+ await (0, _GenerateForm.generateForm)(fi.formSourcesPath, this.farmDirectory, fi.generator, undefined, {
152
146
  skipCodeReformatting: this.skipCodeReformatting,
153
147
  resourcesHash: "local-hash"
154
148
  }, this.webpackHybridFileSystem);
@@ -1 +1 @@
1
- {"version":3,"file":"BuildFormDevServer.js","names":["path","_interopRequireWildcard","require","_stream","_https","_nodeFetch","_interopRequireDefault","_pLimit","_fsExtra","_GenerateForm","_AcquireFormGenerator","_PublishedVersionUtils","_ResolveFormInfo","_AsyncUtils","_Observe","_ExtractGFVPath","_WellKnownDirectories","_NotFoundWebError","_TypingUtils","_ReportGeneratorErrorToPageBody","_RunFormCompilationViaWebpackDevServer","_WebpackHybridFileSystem","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","BuildFormDevServer","constructor","port","allFarmConfig","gfv","candyModulesDirectory","farmConfigArray","useGeneratorFromLocalSources","engineDirectory","buildDebugOnly","skipCodeReformatting","nightly","farmDirectory","formPath","startParallelLimit","generateChain","webpackDevServerStarted","webpackHybridFileSystem","httpsAgent","Agent","rejectUnauthorized","keepAlive","pLimit","findFormPath","farmConfigPath","extractGFVPathFromCandyFarmPath","pathExists","findFormPathLegacy","formDirPath","allPossibleFilePath","map","join","pth","Error","undefined","writeErrorInEntryAndShowInBrowser","_this$webpackHybridFi","formEntryPointPath","writeBatch","getReportGeneratorErrorToPageBodyScript","formatError","start","WebpackHybridFileSystem","Observe","file","WellKnownDirectories","FormJsonFileName","transform","formJsonFile","resolveFormInfo","x","generatorSource","resolveLocalGeneratorSource","engineSource","resolveLocalEngineSource","generatorVersion","engineVersion","resolveGeneratorVersion","resolveEngineVersion","attach","fi","generatorFactory","y","generator","getGeneratorSourceKey","files","formSourcesPath","do","FormsDirWithHlPath","find","generateForm","hlFarmDirectoryPath","resourcesHash","observe","runFormCompilationViaWebpackDevServer","getGeneratedFileAsStream","filename","delay","filePath","GeneratedFormSubdirectory","ensureNotNullOrUndefined","statSync","NotFoundWebError","Promise","resolve","reject","_this$webpackHybridFi2","readFile","error","data","Readable","from","getFileAsStream","response","fetch","method","agent","status","textResponse","text","body","stack","exports"],"sources":["../../../../../../../src/CLICommands/BuildServer/ResourcesControllers/DevServers/BuildFormDevServer.ts"],"sourcesContent":["import * as path from \"path\";\nimport { Readable } from \"stream\";\nimport { Agent } from \"https\";\n\nimport fetch from \"node-fetch\";\nimport pLimit, { Limit } from \"p-limit\";\nimport { FarmConfig } from \"Tools/src/CandyCLI\";\nimport { pathExists } from \"fs-extra\";\n\nimport { generateForm } from \"../../../../BuildTasks/Form/GenerateForm\";\nimport { generatorFactory, getGeneratorSourceKey } from \"../../../../BuildTasks/Generator/AcquireFormGenerator\";\nimport {\n resolveEngineVersion,\n resolveGeneratorVersion,\n resolveLocalEngineSource,\n resolveLocalGeneratorSource,\n} from \"../../../../BuildTasks/PublishedVersionUtils\";\nimport { resolveFormInfo } from \"../../../../BuildTasks/ResolveFormInfo\";\nimport { delay } from \"../../../../../../Common/AsyncUtils\";\nimport { ReasonOrError } from \"../../../../Commons/ErrorUntyped\";\nimport { ChainableValueProducer } from \"../../../../Commons/TasksCore/ChainableValueProducer\";\nimport { Observe } from \"../../../../Commons/TasksCore/Observe\";\nimport { extractGFVPathFromCandyFarmPath } from \"../../../../../../Common/ExtractGFVPath/ExtractGFVPath\";\nimport { WellKnownDirectories } from \"../../../../../../Common/WellKnownDirectories\";\nimport { NotFoundWebError } from \"../../../../Commons/HttpServer/AttributeRouting/NotFoundWebError\";\nimport { ensureNotNullOrUndefined } from \"../../../../../../Common/TypingUtils\";\n\nimport { getReportGeneratorErrorToPageBodyScript } from \"./ReportGeneratorErrorToPageBody\";\nimport { runFormCompilationViaWebpackDevServer } from \"./RunFormCompilationViaWebpackDevServer\";\nimport { WebpackHybridFileSystem } from \"./WebpackInMemoryUtils/WebpackHybridFileSystem\";\n\nexport class BuildFormDevServer {\n private readonly port: number;\n private readonly allFarmConfig: string[];\n private readonly gfv: string;\n private readonly candyModulesDirectory: string;\n private farmDirectory: string;\n private formPath: string;\n private readonly farmConfigArray: FarmConfig[];\n private readonly startParallelLimit: Limit;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private generateChain?: ChainableValueProducer<any>;\n private webpackDevServerStarted = false;\n private readonly useGeneratorFromLocalSources: boolean;\n private readonly engineDirectory: string;\n private readonly nightly: boolean;\n private readonly buildDebugOnly: boolean;\n private readonly skipCodeReformatting: boolean;\n private webpackHybridFileSystem?: WebpackHybridFileSystem;\n private readonly httpsAgent = new Agent({ rejectUnauthorized: false, keepAlive: true });\n\n public constructor(\n port: number,\n allFarmConfig: string[],\n gfv: string,\n candyModulesDirectory: string,\n farmConfigArray: FarmConfig[],\n useGeneratorFromLocalSources: boolean,\n engineDirectory: string,\n buildDebugOnly: boolean,\n skipCodeReformatting: boolean,\n nightly: boolean\n ) {\n this.port = port;\n this.allFarmConfig = allFarmConfig;\n this.gfv = gfv;\n this.candyModulesDirectory = candyModulesDirectory;\n this.farmConfigArray = farmConfigArray;\n this.startParallelLimit = pLimit(1);\n this.useGeneratorFromLocalSources = useGeneratorFromLocalSources;\n this.engineDirectory = engineDirectory;\n this.buildDebugOnly = buildDebugOnly;\n this.skipCodeReformatting = skipCodeReformatting;\n this.nightly = nightly;\n this.farmDirectory = \"\";\n this.formPath = \"\";\n }\n\n private async findFormPath(gfv: string): Promise<{ formPath: string; farmDirectory: string }> {\n for (const farmConfigPath of this.allFarmConfig) {\n const formPath = extractGFVPathFromCandyFarmPath(farmConfigPath, gfv);\n if (await pathExists(formPath)) {\n return {\n formPath: formPath,\n farmDirectory: farmConfigPath,\n };\n }\n }\n\n return this.findFormPathLegacy(this.allFarmConfig, gfv);\n }\n\n // Fallback для legacy-каталогов (без /Candy подпапки)\n // узнать остались ли такие, если нет -> удалить\n private async findFormPathLegacy(\n allFarmConfig: string[],\n gfv: string\n ): Promise<{ formPath: string; farmDirectory: string }> {\n let farmDirectory: string | undefined;\n let formDirPath = \"\";\n\n const allPossibleFilePath = allFarmConfig.map(i => path.join(i, \"forms\", gfv));\n for (const pth of allPossibleFilePath) {\n if (await pathExists(pth)) {\n formDirPath = pth;\n farmDirectory = path.join(pth, \"..\", \"..\");\n break;\n }\n }\n\n if (formDirPath === \"\") {\n throw Error(\"formDirPath not found\");\n }\n if (farmDirectory == undefined || !(await pathExists(farmDirectory))) {\n throw Error(`FarmDirectory = ${farmDirectory} not exist`);\n }\n return {\n formPath: formDirPath,\n farmDirectory: farmDirectory,\n };\n }\n\n private async writeErrorInEntryAndShowInBrowser(e: unknown) {\n const formEntryPointPath = path.join(this.formPath, \"form\", \"web.js\");\n await this.webpackHybridFileSystem?.writeBatch({\n [formEntryPointPath]: getReportGeneratorErrorToPageBodyScript(this.formatError(e)),\n });\n }\n\n public start(): Promise<void> {\n return this.startParallelLimit(async () => {\n if (this.generateChain != undefined) {\n return;\n }\n\n const { formPath, farmDirectory } = await this.findFormPath(this.gfv);\n this.farmDirectory = farmDirectory;\n this.formPath = formPath;\n this.webpackHybridFileSystem = new WebpackHybridFileSystem(path.join(this.formPath, \"form\"));\n\n this.generateChain = Observe.file(path.join(this.formPath, WellKnownDirectories.FormJsonFileName))\n .transform(formJsonFile =>\n resolveFormInfo(\n formJsonFile,\n this.formPath,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n this.nightly\n )\n )\n .transform(async x => {\n if (this.useGeneratorFromLocalSources) {\n return {\n ...x,\n generatorSource: resolveLocalGeneratorSource(this.engineDirectory),\n engineSource: resolveLocalEngineSource(this.engineDirectory),\n };\n } else {\n if (x.generatorVersion == undefined) {\n throw new Error(\"generatorVersion is no defined\");\n }\n if (x.engineVersion == undefined) {\n throw new Error(\"engineVersion is no defined\");\n }\n return {\n ...x,\n generatorSource: await resolveGeneratorVersion(x.generatorVersion),\n engineSource: await resolveEngineVersion(x.engineVersion),\n };\n }\n })\n .attach(\n async fi => generatorFactory(fi.generatorSource, this.candyModulesDirectory, false, undefined),\n async (fi, y) => ({ ...fi, generator: y }),\n async fi => getGeneratorSourceKey(fi.generatorSource)\n )\n .attach(async fi =>\n Observe.files(\n fi.formSourcesPath,\n \"../../controls/**/generator/*\",\n `./${WellKnownDirectories.FormJsonFileName}`,\n \"schemas/**/*\",\n \"sugar/**/*\",\n \"controls/**/*\",\n \"autocalc/**/*\",\n \"helpers/**/*\",\n \"normalizers/**/*\",\n \"validations/**/*\",\n \"localization/**/*\"\n )\n )\n .do(async fi => {\n try {\n const FormsDirWithHlPath = this.farmConfigArray.find(i => i.farmDirectory == farmDirectory);\n if (FormsDirWithHlPath == undefined) {\n throw Error(\"FormsDirWithHlPath === undefined\");\n }\n await generateForm(\n fi.formSourcesPath,\n this.farmDirectory,\n FormsDirWithHlPath.hlFarmDirectoryPath,\n fi.generator,\n undefined,\n {\n skipCodeReformatting: this.skipCodeReformatting,\n resourcesHash: \"local-hash\",\n },\n this.webpackHybridFileSystem\n );\n } catch (e) {\n await this.writeErrorInEntryAndShowInBrowser(e);\n }\n });\n try {\n await this.generateChain.observe();\n } catch (e) {\n await this.writeErrorInEntryAndShowInBrowser(e);\n }\n\n await runFormCompilationViaWebpackDevServer(\n this.gfv,\n this.formPath,\n path.join(this.farmDirectory, \"res\"),\n \"local-hash\",\n this.buildDebugOnly,\n this.webpackHybridFileSystem,\n this.port\n );\n this.webpackDevServerStarted = true;\n });\n }\n\n public async getGeneratedFileAsStream(filename: string): Promise<NodeJS.ReadableStream> {\n while (!this.webpackDevServerStarted) {\n await delay(500);\n }\n\n const { formPath } = await this.findFormPath(this.gfv);\n const filePath = path.join(formPath, WellKnownDirectories.GeneratedFormSubdirectory, filename);\n try {\n ensureNotNullOrUndefined(this.webpackHybridFileSystem);\n this.webpackHybridFileSystem.statSync(filePath);\n } catch {\n throw new NotFoundWebError(`getGeneratedFileAsStream ${filename} not found`);\n }\n\n return new Promise((resolve, reject) => {\n this.webpackHybridFileSystem?.readFile(filePath, \"utf-8\", (error, data) => {\n if (error) {\n reject(error);\n } else {\n resolve(Readable.from([data]));\n }\n });\n });\n }\n\n public async getFileAsStream(filename: string): Promise<NodeJS.ReadableStream> {\n while (!this.webpackDevServerStarted) {\n await delay(500);\n }\n const response = await fetch(`https://localhost:${this.port}/${filename}`, {\n method: \"GET\",\n agent: this.httpsAgent,\n });\n if (response.status != 200) {\n const textResponse = await response.text();\n throw new Error(textResponse);\n }\n return response.body;\n }\n\n private formatError(e: ReasonOrError): string {\n if (e instanceof Error) {\n return `${e}\\n${e.stack}`;\n }\n return `${e}`;\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,IAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAD,sBAAA,CAAAJ,OAAA;AAEA,IAAAM,QAAA,GAAAN,OAAA;AAEA,IAAAO,aAAA,GAAAP,OAAA;AACA,IAAAQ,qBAAA,GAAAR,OAAA;AACA,IAAAS,sBAAA,GAAAT,OAAA;AAMA,IAAAU,gBAAA,GAAAV,OAAA;AACA,IAAAW,WAAA,GAAAX,OAAA;AAGA,IAAAY,QAAA,GAAAZ,OAAA;AACA,IAAAa,eAAA,GAAAb,OAAA;AACA,IAAAc,qBAAA,GAAAd,OAAA;AACA,IAAAe,iBAAA,GAAAf,OAAA;AACA,IAAAgB,YAAA,GAAAhB,OAAA;AAEA,IAAAiB,+BAAA,GAAAjB,OAAA;AACA,IAAAkB,sCAAA,GAAAlB,OAAA;AACA,IAAAmB,wBAAA,GAAAnB,OAAA;AAAyF,SAAAoB,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAtB,wBAAAsB,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,C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,OAAO,EAAE,CAACU,KAAK,EAAEC,IAAI,KAAK;QACvE,IAAID,KAAK,EAAE;UACPH,MAAM,CAACG,KAAK,CAAC;QACjB,CAAC,MAAM;UACHJ,OAAO,CAACM,gBAAQ,CAACC,IAAI,CAAC,CAACF,IAAI,CAAC,CAAC,CAAC;QAClC;MACJ,CAAC,CAAC;IACN,CAAC,CAAC;EACN;EAEA,MAAaG,eAAeA,CAAChB,QAAgB,EAAkC;IAC3E,OAAO,CAAC,IAAI,CAAC5D,uBAAuB,EAAE;MAClC,MAAM,IAAA6D,iBAAK,EAAC,GAAG,CAAC;IACpB;IACA,MAAMgB,QAAQ,GAAG,MAAM,IAAAC,kBAAK,EAAC,qBAAqB,IAAI,CAAC5F,IAAI,IAAI0E,QAAQ,EAAE,EAAE;MACvEmB,MAAM,EAAE,KAAK;MACbC,KAAK,EAAE,IAAI,CAAC9E;IAChB,CAAC,CAAC;IACF,IAAI2E,QAAQ,CAACI,MAAM,IAAI,GAAG,EAAE;MACxB,MAAMC,YAAY,GAAG,MAAML,QAAQ,CAACM,IAAI,CAAC,CAAC;MAC1C,MAAM,IAAIlE,KAAK,CAACiE,YAAY,CAAC;IACjC;IACA,OAAOL,QAAQ,CAACO,IAAI;EACxB;EAEQ5D,WAAWA,CAAC3D,CAAgB,EAAU;IAC1C,IAAIA,CAAC,YAAYoD,KAAK,EAAE;MACpB,OAAO,GAAGpD,CAAC,KAAKA,CAAC,CAACwH,KAAK,EAAE;IAC7B;IACA,OAAO,GAAGxH,CAAC,EAAE;EACjB;AACJ;AAACyH,OAAA,CAAAtG,kBAAA,GAAAA,kBAAA","ignoreList":[]}
1
+ {"version":3,"file":"BuildFormDevServer.js","names":["path","_interopRequireWildcard","require","_stream","_https","_nodeFetch","_interopRequireDefault","_pLimit","_fsExtra","_GenerateForm","_AcquireFormGenerator","_PublishedVersionUtils","_ResolveFormInfo","_AsyncUtils","_Observe","_ExtractGFVPath","_WellKnownDirectories","_NotFoundWebError","_TypingUtils","_ReportGeneratorErrorToPageBody","_RunFormCompilationViaWebpackDevServer","_WebpackHybridFileSystem","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","BuildFormDevServer","constructor","port","allFarmConfig","gfv","candyModulesDirectory","useGeneratorFromLocalSources","engineDirectory","buildDebugOnly","skipCodeReformatting","nightly","farmDirectory","formPath","startParallelLimit","generateChain","webpackDevServerStarted","webpackHybridFileSystem","httpsAgent","Agent","rejectUnauthorized","keepAlive","pLimit","findFormPath","farmConfigPath","extractGFVPathFromCandyFarmPath","pathExists","findFormPathLegacy","formDirPath","allPossibleFilePath","map","join","pth","Error","undefined","writeErrorInEntryAndShowInBrowser","_this$webpackHybridFi","formEntryPointPath","writeBatch","getReportGeneratorErrorToPageBodyScript","formatError","start","WebpackHybridFileSystem","Observe","file","WellKnownDirectories","FormJsonFileName","transform","formJsonFile","resolveFormInfo","x","generatorSource","resolveLocalGeneratorSource","engineSource","resolveLocalEngineSource","generatorVersion","engineVersion","resolveGeneratorVersion","resolveEngineVersion","attach","fi","generatorFactory","y","generator","getGeneratorSourceKey","files","formSourcesPath","do","generateForm","resourcesHash","observe","runFormCompilationViaWebpackDevServer","getGeneratedFileAsStream","filename","delay","filePath","GeneratedFormSubdirectory","ensureNotNullOrUndefined","statSync","NotFoundWebError","Promise","resolve","reject","_this$webpackHybridFi2","readFile","error","data","Readable","from","getFileAsStream","response","fetch","method","agent","status","textResponse","text","body","stack","exports"],"sources":["../../../../../../../src/CLICommands/BuildServer/ResourcesControllers/DevServers/BuildFormDevServer.ts"],"sourcesContent":["import * as path from \"path\";\nimport { Readable } from \"stream\";\nimport { Agent } from \"https\";\n\nimport fetch from \"node-fetch\";\nimport pLimit, { Limit } from \"p-limit\";\nimport { pathExists } from \"fs-extra\";\n\nimport { generateForm } from \"../../../../BuildTasks/Form/GenerateForm\";\nimport { generatorFactory, getGeneratorSourceKey } from \"../../../../BuildTasks/Generator/AcquireFormGenerator\";\nimport {\n resolveEngineVersion,\n resolveGeneratorVersion,\n resolveLocalEngineSource,\n resolveLocalGeneratorSource,\n} from \"../../../../BuildTasks/PublishedVersionUtils\";\nimport { resolveFormInfo } from \"../../../../BuildTasks/ResolveFormInfo\";\nimport { delay } from \"../../../../../../Common/AsyncUtils\";\nimport { ReasonOrError } from \"../../../../Commons/ErrorUntyped\";\nimport { ChainableValueProducer } from \"../../../../Commons/TasksCore/ChainableValueProducer\";\nimport { Observe } from \"../../../../Commons/TasksCore/Observe\";\nimport { extractGFVPathFromCandyFarmPath } from \"../../../../../../Common/ExtractGFVPath/ExtractGFVPath\";\nimport { WellKnownDirectories } from \"../../../../../../Common/WellKnownDirectories\";\nimport { NotFoundWebError } from \"../../../../Commons/HttpServer/AttributeRouting/NotFoundWebError\";\nimport { ensureNotNullOrUndefined } from \"../../../../../../Common/TypingUtils\";\n\nimport { getReportGeneratorErrorToPageBodyScript } from \"./ReportGeneratorErrorToPageBody\";\nimport { runFormCompilationViaWebpackDevServer } from \"./RunFormCompilationViaWebpackDevServer\";\nimport { WebpackHybridFileSystem } from \"./WebpackInMemoryUtils/WebpackHybridFileSystem\";\n\nexport class BuildFormDevServer {\n private readonly port: number;\n private readonly allFarmConfig: string[];\n private readonly gfv: string;\n private readonly candyModulesDirectory: string;\n private farmDirectory: string;\n private formPath: string;\n private readonly startParallelLimit: Limit;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private generateChain?: ChainableValueProducer<any>;\n private webpackDevServerStarted = false;\n private readonly useGeneratorFromLocalSources: boolean;\n private readonly engineDirectory: string;\n private readonly nightly: boolean;\n private readonly buildDebugOnly: boolean;\n private readonly skipCodeReformatting: boolean;\n private webpackHybridFileSystem?: WebpackHybridFileSystem;\n private readonly httpsAgent = new Agent({ rejectUnauthorized: false, keepAlive: true });\n\n public constructor(\n port: number,\n allFarmConfig: string[],\n gfv: string,\n candyModulesDirectory: string,\n useGeneratorFromLocalSources: boolean,\n engineDirectory: string,\n buildDebugOnly: boolean,\n skipCodeReformatting: boolean,\n nightly: boolean\n ) {\n this.port = port;\n this.allFarmConfig = allFarmConfig;\n this.gfv = gfv;\n this.candyModulesDirectory = candyModulesDirectory;\n this.startParallelLimit = pLimit(1);\n this.useGeneratorFromLocalSources = useGeneratorFromLocalSources;\n this.engineDirectory = engineDirectory;\n this.buildDebugOnly = buildDebugOnly;\n this.skipCodeReformatting = skipCodeReformatting;\n this.nightly = nightly;\n this.farmDirectory = \"\";\n this.formPath = \"\";\n }\n\n private async findFormPath(gfv: string): Promise<{ formPath: string; farmDirectory: string }> {\n for (const farmConfigPath of this.allFarmConfig) {\n const formPath = extractGFVPathFromCandyFarmPath(farmConfigPath, gfv);\n if (await pathExists(formPath)) {\n return {\n formPath: formPath,\n farmDirectory: farmConfigPath,\n };\n }\n }\n\n return this.findFormPathLegacy(this.allFarmConfig, gfv);\n }\n\n // Fallback для legacy-каталогов (без /Candy подпапки)\n // узнать остались ли такие, если нет -> удалить\n private async findFormPathLegacy(\n allFarmConfig: string[],\n gfv: string\n ): Promise<{ formPath: string; farmDirectory: string }> {\n let farmDirectory: string | undefined;\n let formDirPath = \"\";\n\n const allPossibleFilePath = allFarmConfig.map(i => path.join(i, \"forms\", gfv));\n for (const pth of allPossibleFilePath) {\n if (await pathExists(pth)) {\n formDirPath = pth;\n farmDirectory = path.join(pth, \"..\", \"..\");\n break;\n }\n }\n\n if (formDirPath === \"\") {\n throw Error(\"formDirPath not found\");\n }\n if (farmDirectory == undefined || !(await pathExists(farmDirectory))) {\n throw Error(`FarmDirectory = ${farmDirectory} not exist`);\n }\n return {\n formPath: formDirPath,\n farmDirectory: farmDirectory,\n };\n }\n\n private async writeErrorInEntryAndShowInBrowser(e: unknown) {\n const formEntryPointPath = path.join(this.formPath, \"form\", \"web.js\");\n await this.webpackHybridFileSystem?.writeBatch({\n [formEntryPointPath]: getReportGeneratorErrorToPageBodyScript(this.formatError(e)),\n });\n }\n\n public start(): Promise<void> {\n return this.startParallelLimit(async () => {\n if (this.generateChain != undefined) {\n return;\n }\n\n const { formPath, farmDirectory } = await this.findFormPath(this.gfv);\n this.farmDirectory = farmDirectory;\n this.formPath = formPath;\n this.webpackHybridFileSystem = new WebpackHybridFileSystem(path.join(this.formPath, \"form\"));\n\n this.generateChain = Observe.file(path.join(this.formPath, WellKnownDirectories.FormJsonFileName))\n .transform(formJsonFile =>\n resolveFormInfo(\n formJsonFile,\n this.formPath,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n this.nightly\n )\n )\n .transform(async x => {\n if (this.useGeneratorFromLocalSources) {\n return {\n ...x,\n generatorSource: resolveLocalGeneratorSource(this.engineDirectory),\n engineSource: resolveLocalEngineSource(this.engineDirectory),\n };\n } else {\n if (x.generatorVersion == undefined) {\n throw new Error(\"generatorVersion is no defined\");\n }\n if (x.engineVersion == undefined) {\n throw new Error(\"engineVersion is no defined\");\n }\n return {\n ...x,\n generatorSource: await resolveGeneratorVersion(x.generatorVersion),\n engineSource: await resolveEngineVersion(x.engineVersion),\n };\n }\n })\n .attach(\n async fi => generatorFactory(fi.generatorSource, this.candyModulesDirectory, false, undefined),\n async (fi, y) => ({ ...fi, generator: y }),\n async fi => getGeneratorSourceKey(fi.generatorSource)\n )\n .attach(async fi =>\n Observe.files(\n fi.formSourcesPath,\n \"../../controls/**/generator/*\",\n `./${WellKnownDirectories.FormJsonFileName}`,\n \"schemas/**/*\",\n \"sugar/**/*\",\n \"controls/**/*\",\n \"autocalc/**/*\",\n \"helpers/**/*\",\n \"normalizers/**/*\",\n \"validations/**/*\",\n \"localization/**/*\"\n )\n )\n .do(async fi => {\n try {\n await generateForm(\n fi.formSourcesPath,\n this.farmDirectory,\n fi.generator,\n undefined,\n {\n skipCodeReformatting: this.skipCodeReformatting,\n resourcesHash: \"local-hash\",\n },\n this.webpackHybridFileSystem\n );\n } catch (e) {\n await this.writeErrorInEntryAndShowInBrowser(e);\n }\n });\n try {\n await this.generateChain.observe();\n } catch (e) {\n await this.writeErrorInEntryAndShowInBrowser(e);\n }\n\n await runFormCompilationViaWebpackDevServer(\n this.gfv,\n this.formPath,\n path.join(this.farmDirectory, \"res\"),\n \"local-hash\",\n this.buildDebugOnly,\n this.webpackHybridFileSystem,\n this.port\n );\n this.webpackDevServerStarted = true;\n });\n }\n\n public async getGeneratedFileAsStream(filename: string): Promise<NodeJS.ReadableStream> {\n while (!this.webpackDevServerStarted) {\n await delay(500);\n }\n\n const { formPath } = await this.findFormPath(this.gfv);\n const filePath = path.join(formPath, WellKnownDirectories.GeneratedFormSubdirectory, filename);\n try {\n ensureNotNullOrUndefined(this.webpackHybridFileSystem);\n this.webpackHybridFileSystem.statSync(filePath);\n } catch {\n throw new NotFoundWebError(`getGeneratedFileAsStream ${filename} not found`);\n }\n\n return new Promise((resolve, reject) => {\n this.webpackHybridFileSystem?.readFile(filePath, \"utf-8\", (error, data) => {\n if (error) {\n reject(error);\n } else {\n resolve(Readable.from([data]));\n }\n });\n });\n }\n\n public async getFileAsStream(filename: string): Promise<NodeJS.ReadableStream> {\n while (!this.webpackDevServerStarted) {\n await delay(500);\n }\n const response = await fetch(`https://localhost:${this.port}/${filename}`, {\n method: \"GET\",\n agent: this.httpsAgent,\n });\n if (response.status != 200) {\n const textResponse = await response.text();\n throw new Error(textResponse);\n }\n return response.body;\n }\n\n private formatError(e: ReasonOrError): string {\n if (e instanceof Error) {\n return `${e}\\n${e.stack}`;\n }\n return `${e}`;\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,IAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAEA,IAAAO,aAAA,GAAAP,OAAA;AACA,IAAAQ,qBAAA,GAAAR,OAAA;AAC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AAC,YAAYmD,KAAK,EAAE;MACpB,OAAO,GAAGnD,CAAC,KAAKA,CAAC,CAACoH,KAAK,EAAE;IAC7B;IACA,OAAO,GAAGpH,CAAC,EAAE;EACjB;AACJ;AAACqH,OAAA,CAAAlG,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -31,14 +31,14 @@ var _WriteAttachmentPathByGfvFiles = require("../../BuildTasks/Form/WriteAttachm
31
31
  var _WriteKClangFiles = require("../../BuildTasks/Form/WriteKClangFiles");
32
32
  var _WriteExtendedSchemaFiles = require("../../BuildTasks/Form/WriteExtendedSchemaFiles");
33
33
  var _BuildCandyWidgetTask = require("../../BuildTasks/CandyWidget/BuildCandyWidgetTask");
34
- async function runDevBuild(context, options, engineDirectory, resourcesDirectory, farmDirectory, candyModulesDirectory, hlFarmDirectoryPath) {
34
+ async function runDevBuild(context, options, engineDirectory, resourcesDirectory, farmDirectory, candyModulesDirectory) {
35
35
  const devBuildOptions = options;
36
36
  const engineWebpackConfigTask = await (0, _EngineStructureUtils.createEngineWebpackConfigTask)(engineDirectory);
37
37
  const buildEngineChain = options.skipBuildEngine ? new _EmptyProducer.EmptyProducer() : engineWebpackConfigTask.chainWith(p => new _BuildLocalEngineTask.BuildLocalEngineTask(p, resourcesDirectory, options.buildDebugOnly));
38
38
  const clientWebpackConfigTask = await (0, _EngineStructureUtils.createClientWebpackConfigTask)(engineDirectory);
39
39
  const buildClientJsChain = options.skipBuildEngine ? new _EmptyProducer.EmptyProducer() : clientWebpackConfigTask.chainWith(p => new _BuildClientJsTask.BuildClientJsTask(p, resourcesDirectory));
40
40
  const candyWidgetsConfigTask = await (0, _EngineStructureUtils.createClientViteConfigTask)(engineDirectory);
41
- const buildCandyWidgetChain = options.skipBuildEngine && !options.buildCandyWidget ? new _EmptyProducer.EmptyProducer() : candyWidgetsConfigTask.chainWith(p => new _BuildCandyWidgetTask.BuildCandyWidgetTask(p));
41
+ const buildCandyWidgetChain = options.skipBuildEngine || !options.buildCandyWidget ? new _EmptyProducer.EmptyProducer() : candyWidgetsConfigTask.chainWith(p => new _BuildCandyWidgetTask.BuildCandyWidgetTask(p));
42
42
  const staticResourcesChain = _Observe.Observe.files(_path.default.join(__dirname, "..", "..", "StaticFilesForResourcesDir"), "*.js").do(x => _FSTask.FSTask.copyRecursively((0, _StaticLogger.getLogger)().withPrefix("STATICS"), x, _path.default.join(resourcesDirectory, "public", "scripts")));
43
43
  const pickListsChain = _Observe.Observe.files(_path.default.join(farmDirectory, "picklists"), "*.json").do(x => _FSTask.FSTask.copyRecursively(context.logger.withPrefix("PICKLISTS"), x, _path.default.join(resourcesDirectory, "picklists")));
44
44
  const repositoryRoot = _path.default.join(farmDirectory, "..");
@@ -65,12 +65,12 @@ async function runDevBuild(context, options, engineDirectory, resourcesDirectory
65
65
  generator: y
66
66
  }), async fi => (0, _AcquireFormGenerator.getGeneratorSourceKey)(fi.generatorSource)).attach(async fi => devBuildOptions.watch ? _Observe.Observe.files(fi.formSourcesPath, "../../controls/**/*", `./${_WellKnownDirectories.WellKnownDirectories.FormJsonFileName}`, "schemas/**/*", "sugar/**/*", "controls/**/*", "autocalc/**/*", "helpers/**/*", "normalizers/**/*", "validations/**/*", "localization/**/*") : _Observe.Observe.value(fi.formSourcesPath)).transform(async fi => ({
67
67
  ...fi,
68
- dependenciesHash: await fi.generator.getAllDependenciesHash(formDirPath, farmDirectory, hlFarmDirectoryPath)
68
+ dependenciesHash: await fi.generator.getAllDependenciesHash(formDirPath, farmDirectory)
69
69
  })).do(async fi => {
70
70
  if (options.skipGeneration) {
71
71
  return undefined;
72
72
  }
73
- return (0, _GenerateForm.generateForm)(fi.formSourcesPath, farmDirectory, hlFarmDirectoryPath, fi.generator, undefined, {
73
+ return (0, _GenerateForm.generateForm)(fi.formSourcesPath, farmDirectory, fi.generator, undefined, {
74
74
  skipCodeReformatting: options.skipGeneratedCodeReformatting,
75
75
  resourcesHash: fi.dependenciesHash
76
76
  });