@kontur.candy/tools 2.253.0 → 2.255.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -16
- package/distr/Common/AsyncUtils.js +7 -0
- package/distr/Common/AsyncUtils.js.map +1 -1
- package/distr/Common/CandyApiClient/CandyApiClient.js +37 -5
- package/distr/Common/CandyApiClient/CandyApiClient.js.map +1 -1
- package/distr/Common/CandyApiClient/ClientDraftInfo/ClientDraftInfoResponse.js.map +1 -1
- package/distr/Common/CandyApiClient/FakeCandyApiClient.js +20 -0
- package/distr/Common/CandyApiClient/FakeCandyApiClient.js.map +1 -1
- package/distr/Common/CandyApiClient/ICandyApiClient.js.map +1 -1
- package/distr/Common/CommonConstants/DefaultServicesUrls.js +3 -1
- package/distr/Common/CommonConstants/DefaultServicesUrls.js.map +1 -1
- package/distr/Common/IntRangeUtils.js +4 -0
- package/distr/Common/IntRangeUtils.js.map +1 -1
- package/distr/Common/KCLangRuntimeUtils.js +7 -1
- package/distr/Common/KCLangRuntimeUtils.js.map +1 -1
- package/distr/Common/TypingUtils.js +4 -0
- package/distr/Common/TypingUtils.js.map +1 -1
- package/distr/Common/async/Channel.js +64 -0
- package/distr/Common/async/Channel.js.map +1 -0
- package/distr/Common/async/pool/AsyncPool.js +145 -0
- package/distr/Common/async/pool/AsyncPool.js.map +1 -0
- package/distr/Common/async/pool/FixedPool.js +29 -0
- package/distr/Common/async/pool/FixedPool.js.map +1 -0
- package/distr/Common/async/pool/LimitedPool.js +81 -0
- package/distr/Common/async/pool/LimitedPool.js.map +1 -0
- package/distr/Common/async/pool/Registry.js +73 -0
- package/distr/Common/async/pool/Registry.js.map +1 -0
- package/distr/Common/async/pool/index.js +13 -0
- package/distr/Common/async/pool/index.js.map +1 -0
- package/distr/Common/ds/LinkedList.js +64 -0
- package/distr/Common/ds/LinkedList.js.map +1 -0
- package/distr/Common/multithread/ThreadPool.js +74 -0
- package/distr/Common/multithread/ThreadPool.js.map +1 -0
- package/distr/Tools/src/BuildTasks/Form/GenerateForm.js +2 -1
- package/distr/Tools/src/BuildTasks/Form/GenerateForm.js.map +1 -1
- package/distr/Tools/src/BuildTasks/Form/NullFormGenerator.js +0 -3
- package/distr/Tools/src/BuildTasks/Form/NullFormGenerator.js.map +1 -1
- package/distr/Tools/src/BuildTasks/Generator/AcquirePublishedGeneratorTask.js +1 -1
- package/distr/Tools/src/BuildTasks/Generator/AcquirePublishedGeneratorTask.js.map +1 -1
- package/distr/Tools/src/BuildTasks/Generator/BuildGeneratorFromSourcesTask.js +13 -4
- package/distr/Tools/src/BuildTasks/Generator/BuildGeneratorFromSourcesTask.js.map +1 -1
- package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/CreateAsyncGenerator.js +29 -107
- package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/CreateAsyncGenerator.js.map +1 -1
- package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/GeneratorPool.js +62 -0
- package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/GeneratorPool.js.map +1 -0
- package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/GeneratorRequireUtils.js +29 -36
- package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/GeneratorRequireUtils.js.map +1 -1
- package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/ReadSourcesAndProcessSugarWorker.js +28 -35
- package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/ReadSourcesAndProcessSugarWorker.js.map +1 -1
- package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/TypedThreadWorker.js +14 -0
- package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/TypedThreadWorker.js.map +1 -0
- package/distr/Tools/src/BuildTasks/ResolveFormInfo.js +1 -1
- package/distr/Tools/src/BuildTasks/ResolveFormInfo.js.map +1 -1
- package/distr/Tools/src/CLICommands/BuildForms/BuildFormsOptions.js +0 -10
- package/distr/Tools/src/CLICommands/BuildForms/BuildFormsOptions.js.map +1 -1
- package/distr/Tools/src/CLICommands/BuildForms/RunBuildForms.js +2 -6
- package/distr/Tools/src/CLICommands/BuildForms/RunBuildForms.js.map +1 -1
- package/distr/Tools/src/CLICommands/BuildServer/BuildServerServerOptions.js +0 -22
- package/distr/Tools/src/CLICommands/BuildServer/BuildServerServerOptions.js.map +1 -1
- package/distr/Tools/src/CLICommands/BuildServer/ResourcesControllers/BuildServerBuildFormsController.js +1 -3
- package/distr/Tools/src/CLICommands/BuildServer/ResourcesControllers/BuildServerBuildFormsController.js.map +1 -1
- package/distr/Tools/src/CLICommands/BuildServer/ResourcesControllers/BuildServerFormInfoController.js +1 -1
- package/distr/Tools/src/CLICommands/BuildServer/ResourcesControllers/BuildServerFormInfoController.js.map +1 -1
- package/distr/Tools/src/CLICommands/BuildServer/ResourcesControllers/DevServers/BuildFormDevServer.js +2 -5
- package/distr/Tools/src/CLICommands/BuildServer/ResourcesControllers/DevServers/BuildFormDevServer.js.map +1 -1
- package/distr/Tools/src/CLICommands/DevBuild/DevBuildOptions.js +0 -10
- package/distr/Tools/src/CLICommands/DevBuild/DevBuildOptions.js.map +1 -1
- package/distr/Tools/src/CLICommands/DevBuild/RunDevBuild.js +35 -6
- package/distr/Tools/src/CLICommands/DevBuild/RunDevBuild.js.map +1 -1
- package/distr/Tools/src/CLICommands/Localization/RunLocalization.js +1 -1
- package/distr/Tools/src/CLICommands/Localization/RunLocalization.js.map +1 -1
- package/distr/Tools/src/CLICommands/SugarExtractor/Utils.js +1 -1
- package/distr/Tools/src/CLICommands/SugarExtractor/Utils.js.map +1 -1
- package/distr/Tools/src/LocalServerFrontEndDist/enhancedClient.js +1 -1
- package/distr/Tools/src/LocalServerFrontEndDist/index.js +1 -1
- package/distr/Tools/src/LocalServerFrontEndDist/index.js.map +1 -1
- package/distr/Tools/src/StaticFilesForProductionResourcesDir/client.js +14 -13
- package/distr/Tools/src/StaticFilesForProductionResourcesDir/client.js.map +1 -1
- package/distr/Tools/src/StaticFilesForProductionResourcesDir/client.min.js +14 -13
- package/distr/Tools/src/StaticFilesForProductionResourcesDir/client.min.js.map +1 -1
- package/package.json +1 -1
- package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/RequireUncached.js +0 -40
- package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/RequireUncached.js.map +0 -1
- package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/TypedProcessWorker.js +0 -19
- package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/TypedProcessWorker.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RunDevBuild.js","names":["_path","_interopRequireDefault","require","_chalk","_BuildClientJsTask","_BuildLocalEngineTask","_EngineStructureUtils","_CompileForm","_GenerateForm","_WriteFLangNormalizationFiles","_FSTask","_AcquireFormGenerator","_PublishedVersionUtils","_ResolveFormInfo","_WriteFormMeta","_FormGlobsUtils","_StaticLogger","_Observe","_TimingUtils","_WriteAttachmentPathFiles","_EmptyProducer","_GetRngSchemaFileExtension","_FormPathUtils","_WellKnownDirectories","_WriteAttachmentPathByGfvFiles","_WriteKClangFiles","_WriteExtendedSchemaFiles","_BuildCandyWidgetTask","runDevBuild","context","options","engineDirectory","resourcesDirectory","farmDirectory","candyModulesDirectory","devBuildOptions","engineWebpackConfigTask","createEngineWebpackConfigTask","buildEngineChain","skipBuildEngine","EmptyProducer","chainWith","p","BuildLocalEngineTask","buildDebugOnly","clientWebpackConfigTask","createClientWebpackConfigTask","buildClientJsChain","BuildClientJsTask","candyWidgetsConfigTask","createClientViteConfigTask","buildCandyWidgetChain","buildCandyWidget","BuildCandyWidgetTask","staticResourcesChain","Observe","files","path","join","__dirname","do","x","FSTask","copyRecursively","getLogger","withPrefix","pickListsChain","logger","repositoryRoot","formInfos","FormGlobs","resolveGfvGlobs","formGlobs","resourcesExternalConvertersChain","empty","createChainForForm","formRelativePath","gfv","extractGfvFromFormPath","formDirPath","formSchemasDirPath","rngSchemaMask","getRngSchemaFileExtension","file","WellKnownDirectories","FormJsonFileName","transform","formJsonFile","resolveFormInfo","generatorSource","resolveLocalGeneratorSource","engineSource","resolveLocalEngineSource","attach","fi","generatorFactory","undefined","y","generator","getGeneratorSourceKey","watch","formSourcesPath","value","dependenciesHash","getAllDependenciesHash","skipGeneration","generateForm","skipCodeReformatting","skipGeneratedCodeReformatting","resourcesHash","skipWebPackCompilation","compileForm","formName","writeFLangNormalizationFiles","writeKClangFiles","writeExtendedSchemaFiles","writeAttachmentPathFiles","writeAttachmentPathByGfvFiles","writeFormMeta","themes","useServerSideNormalization","buildFormsChain","fixedFormDirectories","map","relative","formPath","splitToParallelChains","stopObserve1","observe","stopObserve2","stopObserve3","stopObserve4","stopObserve5","stopObserve6","waitForExit","startDate","Date","now","Promise","all","currentValue","e","continueOnError","error","totalTime","console","log","chalk","greenBright","printTime"],"sources":["../../../../../src/CLICommands/DevBuild/RunDevBuild.ts"],"sourcesContent":["import path from \"path\";\n\nimport chalk from \"chalk\";\n\nimport { BuildClientJsTask } from \"../../BuildTasks/ClientJS/BuildClientJsTask\";\nimport { BuildLocalEngineTask } from \"../../BuildTasks/Engine/BuildLocalEngineTask\";\nimport {\n createClientViteConfigTask,\n createClientWebpackConfigTask,\n createEngineWebpackConfigTask,\n} from \"../../BuildTasks/EngineStructureUtils\";\nimport { compileForm } from \"../../BuildTasks/Form/CompileForm\";\nimport { generateForm } from \"../../BuildTasks/Form/GenerateForm\";\nimport { writeFLangNormalizationFiles } from \"../../BuildTasks/Form/WriteFLangNormalizationFiles\";\nimport { FSTask } from \"../../BuildTasks/FSTask\";\nimport { generatorFactory, getGeneratorSourceKey } from \"../../BuildTasks/Generator/AcquireFormGenerator\";\nimport { resolveLocalEngineSource, resolveLocalGeneratorSource } from \"../../BuildTasks/PublishedVersionUtils\";\nimport { resolveFormInfo } from \"../../BuildTasks/ResolveFormInfo\";\nimport { writeFormMeta } from \"../../BuildTasks/WriteFormMeta\";\nimport { ConsoleApplicationContext } from \"../../Commons/ConsoleApplication/ConsoleApplicationContext\";\nimport { FormGlobs } from \"../../Commons/FormGlobsUtils\";\nimport { getLogger } from \"../../Commons/Logging/StaticLogger\";\nimport { Observe } from \"../../Commons/TasksCore/Observe\";\nimport { printTime } from \"../../Commons/TimingUtils\";\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 { BuildCandyWidgetTask } from \"../../BuildTasks/CandyWidget/BuildCandyWidgetTask\";\n\nimport { DevelopmentBuildOptions } from \"./DevBuildOptions\";\n\nexport async function runDevBuild(\n context: ConsoleApplicationContext,\n options: DevelopmentBuildOptions,\n engineDirectory: string,\n resourcesDirectory: string,\n farmDirectory: string,\n candyModulesDirectory: string\n): Promise<void> {\n const devBuildOptions = options;\n\n const engineWebpackConfigTask = await createEngineWebpackConfigTask(engineDirectory);\n const buildEngineChain = options.skipBuildEngine\n ? new EmptyProducer()\n : engineWebpackConfigTask.chainWith(\n p => new BuildLocalEngineTask(p, resourcesDirectory, options.buildDebugOnly)\n );\n\n const clientWebpackConfigTask = await createClientWebpackConfigTask(engineDirectory);\n const buildClientJsChain = options.skipBuildEngine\n ? new EmptyProducer()\n : clientWebpackConfigTask.chainWith(p => new BuildClientJsTask(p, resourcesDirectory));\n\n const candyWidgetsConfigTask = await createClientViteConfigTask(engineDirectory);\n const buildCandyWidgetChain =\n options.skipBuildEngine || !options.buildCandyWidget\n ? new EmptyProducer()\n : candyWidgetsConfigTask.chainWith(p => new BuildCandyWidgetTask(p));\n\n const staticResourcesChain = Observe.files(\n path.join(__dirname, \"..\", \"..\", \"StaticFilesForResourcesDir\"),\n \"*.js\"\n ).do(x =>\n FSTask.copyRecursively(getLogger().withPrefix(\"STATICS\"), x, path.join(resourcesDirectory, \"public\", \"scripts\"))\n );\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 repositoryRoot = path.join(farmDirectory, \"..\");\n\n const formInfos = await FormGlobs.resolveGfvGlobs(options.formGlobs, farmDirectory);\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 createChainForForm = async (formRelativePath: string) => {\n const gfv = extractGfvFromFormPath(formRelativePath);\n const formDirPath = path.join(repositoryRoot, formRelativePath);\n const formSchemasDirPath = path.join(formDirPath, \"schemas\");\n const rngSchemaMask = `*${getRngSchemaFileExtension(formSchemasDirPath, gfv)}`;\n\n return Observe.file(path.join(formDirPath, WellKnownDirectories.FormJsonFileName))\n .transform(formJsonFile => resolveFormInfo(formJsonFile, formDirPath, engineDirectory))\n .transform(async x => ({\n ...x,\n generatorSource: resolveLocalGeneratorSource(engineDirectory),\n engineSource: resolveLocalEngineSource(engineDirectory),\n }))\n .attach(\n async fi => generatorFactory(fi.generatorSource, candyModulesDirectory, false, undefined),\n async (fi, y) => ({ ...fi, generator: y }),\n async fi => getGeneratorSourceKey(fi.generatorSource)\n )\n .attach(async fi =>\n devBuildOptions.watch\n ? Observe.files(\n fi.formSourcesPath,\n \"../../controls/**/*\",\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 ...fi,\n dependenciesHash: await fi.generator.getAllDependenciesHash(formDirPath, farmDirectory),\n }))\n .do(async fi => {\n if (options.skipGeneration) {\n return undefined;\n }\n return generateForm(fi.formSourcesPath, farmDirectory, fi.generator, undefined, {\n skipCodeReformatting: options.skipGeneratedCodeReformatting,\n resourcesHash: fi.dependenciesHash,\n });\n })\n .attach(async () =>\n devBuildOptions.watch\n ? Observe.files(path.join(formDirPath, \"form\"), \"**/*\")\n : Observe.value(path.join(formDirPath, \"form\"))\n )\n .do(async fi => {\n if (options.skipWebPackCompilation) {\n return undefined;\n }\n return compileForm(\n fi.formName,\n formDirPath,\n resourcesDirectory,\n fi.dependenciesHash,\n options.buildDebugOnly,\n undefined,\n false\n );\n })\n .do(fi => writeFLangNormalizationFiles(fi.formName, formDirPath, resourcesDirectory))\n .do(fi => writeKClangFiles(fi.formName, formDirPath, resourcesDirectory))\n .do(fi => writeExtendedSchemaFiles(fi.formName, formDirPath, resourcesDirectory))\n .do(fi => writeAttachmentPathFiles(fi.formName, formDirPath, resourcesDirectory))\n .do(fi => writeAttachmentPathByGfvFiles(fi.formName, formDirPath, resourcesDirectory))\n .do(fi =>\n writeFormMeta(\n resourcesDirectory,\n gfv,\n fi.engineSource,\n fi.dependenciesHash,\n fi.themes,\n fi.useServerSideNormalization\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 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 };\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 if (devBuildOptions.watch) {\n const stopObserve1 = await buildEngineChain.observe();\n const stopObserve2 = await buildClientJsChain.observe();\n const stopObserve3 = await staticResourcesChain.observe();\n const stopObserve4 = await buildFormsChain.observe();\n const stopObserve5 = await pickListsChain.observe();\n const stopObserve6 = await resourcesExternalConvertersChain.observe();\n\n await context.waitForExit();\n\n await stopObserve1();\n await stopObserve2();\n await stopObserve3();\n await stopObserve4();\n await stopObserve5();\n await stopObserve6();\n } else {\n const startDate = Date.now();\n await Promise.all([\n buildEngineChain.currentValue,\n buildClientJsChain.currentValue,\n buildCandyWidgetChain.currentValue,\n staticResourcesChain.currentValue,\n resourcesExternalConvertersChain.currentValue,\n (async () => {\n try {\n await pickListsChain.currentValue;\n await buildFormsChain.currentValue;\n } catch (e) {\n if (options.continueOnError) {\n context.logger.error(e);\n } else {\n throw e;\n }\n }\n })(),\n ]);\n const totalTime = Date.now() - startDate;\n // eslint-disable-next-line no-console\n console.log(`${chalk.greenBright(\"Build success\")} Total time: ${printTime(totalTime)}`);\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AACA,IAAAI,qBAAA,GAAAJ,OAAA;AAKA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,6BAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,qBAAA,GAAAT,OAAA;AACA,IAAAU,sBAAA,GAAAV,OAAA;AACA,IAAAW,gBAAA,GAAAX,OAAA;AACA,IAAAY,cAAA,GAAAZ,OAAA;AAEA,IAAAa,eAAA,GAAAb,OAAA;AACA,IAAAc,aAAA,GAAAd,OAAA;AACA,IAAAe,QAAA,GAAAf,OAAA;AACA,IAAAgB,YAAA,GAAAhB,OAAA;AACA,IAAAiB,yBAAA,GAAAjB,OAAA;AAEA,IAAAkB,cAAA,GAAAlB,OAAA;AACA,IAAAmB,0BAAA,GAAAnB,OAAA;AACA,IAAAoB,c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,CAACC,WAAW,CAAC,eAAe,CAAC,gBAAgB,IAAAC,sBAAS,EAACL,SAAS,CAAC,EAAE,CAAC;EAC5F;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"RunDevBuild.js","names":["_path","_interopRequireDefault","require","_chalk","_BuildClientJsTask","_BuildLocalEngineTask","_EngineStructureUtils","_CompileForm","_GenerateForm","_WriteFLangNormalizationFiles","_FSTask","_AcquireFormGenerator","_PublishedVersionUtils","_ResolveFormInfo","_WriteFormMeta","_FormGlobsUtils","_StaticLogger","_Observe","_TimingUtils","_WriteAttachmentPathFiles","_EmptyProducer","_GetRngSchemaFileExtension","_FormPathUtils","_WellKnownDirectories","_WriteAttachmentPathByGfvFiles","_WriteKClangFiles","_WriteExtendedSchemaFiles","_BuildCandyWidgetTask","runDevBuild","context","options","engineDirectory","resourcesDirectory","farmDirectory","candyModulesDirectory","devBuildOptions","engineWebpackConfigTask","createEngineWebpackConfigTask","buildEngineChain","skipBuildEngine","EmptyProducer","chainWith","p","BuildLocalEngineTask","buildDebugOnly","clientWebpackConfigTask","createClientWebpackConfigTask","buildClientJsChain","BuildClientJsTask","candyWidgetsConfigTask","createClientViteConfigTask","buildCandyWidgetChain","buildCandyWidget","BuildCandyWidgetTask","staticResourcesChain","Observe","files","path","join","__dirname","do","x","FSTask","copyRecursively","getLogger","withPrefix","pickListsChain","logger","repositoryRoot","formInfos","FormGlobs","resolveGfvGlobs","formGlobs","resourcesExternalConvertersChain","empty","createChainForForm","formRelativePath","gfv","extractGfvFromFormPath","formDirPath","formSchemasDirPath","rngSchemaMask","getRngSchemaFileExtension","file","WellKnownDirectories","FormJsonFileName","transform","formJsonFile","resolveFormInfo","generatorSource","resolveLocalGeneratorSource","engineSource","resolveLocalEngineSource","attach","fi","generatorFactory","undefined","y","generator","getGeneratorSourceKey","watch","formSourcesPath","value","dependenciesHash","mode","FormBuildMode","NormalBuild","getAllDependenciesHash","skipGeneration","generateForm","resourcesHash","skipWebPackCompilation","compileForm","formName","writeFLangNormalizationFiles","writeKClangFiles","writeExtendedSchemaFiles","writeAttachmentPathFiles","writeAttachmentPathByGfvFiles","writeFormMeta","themes","useServerSideNormalization","buildFormsChain","fixedFormDirectories","map","relative","formPath","splitToParallelChains","stopObserve1","observe","stopObserve2","stopObserve3","stopObserve4","stopObserve5","stopObserve6","waitForExit","startDate","Date","now","Promise","all","currentValue","e","continueOnError","error","totalTime","console","log","chalk","greenBright","printTime"],"sources":["../../../../../src/CLICommands/DevBuild/RunDevBuild.ts"],"sourcesContent":["import path from \"path\";\n\nimport chalk from \"chalk\";\n\nimport { BuildClientJsTask } from \"../../BuildTasks/ClientJS/BuildClientJsTask\";\nimport { BuildLocalEngineTask } from \"../../BuildTasks/Engine/BuildLocalEngineTask\";\nimport {\n createClientViteConfigTask,\n createClientWebpackConfigTask,\n createEngineWebpackConfigTask,\n} from \"../../BuildTasks/EngineStructureUtils\";\nimport { compileForm } from \"../../BuildTasks/Form/CompileForm\";\nimport { generateForm } from \"../../BuildTasks/Form/GenerateForm\";\nimport { writeFLangNormalizationFiles } from \"../../BuildTasks/Form/WriteFLangNormalizationFiles\";\nimport { FSTask } from \"../../BuildTasks/FSTask\";\nimport { generatorFactory, getGeneratorSourceKey } from \"../../BuildTasks/Generator/AcquireFormGenerator\";\nimport { resolveLocalEngineSource, resolveLocalGeneratorSource } 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 { getLogger } from \"../../Commons/Logging/StaticLogger\";\nimport { Observe } from \"../../Commons/TasksCore/Observe\";\nimport { printTime } from \"../../Commons/TimingUtils\";\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 { BuildCandyWidgetTask } from \"../../BuildTasks/CandyWidget/BuildCandyWidgetTask\";\n\nimport { DevelopmentBuildOptions } from \"./DevBuildOptions\";\n\nexport async function runDevBuild(\n context: ConsoleApplicationContext,\n options: DevelopmentBuildOptions,\n engineDirectory: string,\n resourcesDirectory: string,\n farmDirectory: string,\n candyModulesDirectory: string\n): Promise<void> {\n const devBuildOptions = options;\n\n const engineWebpackConfigTask = await createEngineWebpackConfigTask(engineDirectory);\n const buildEngineChain = options.skipBuildEngine\n ? new EmptyProducer()\n : engineWebpackConfigTask.chainWith(\n p => new BuildLocalEngineTask(p, resourcesDirectory, options.buildDebugOnly)\n );\n\n const clientWebpackConfigTask = await createClientWebpackConfigTask(engineDirectory);\n const buildClientJsChain = options.skipBuildEngine\n ? new EmptyProducer()\n : clientWebpackConfigTask.chainWith(p => new BuildClientJsTask(p, resourcesDirectory));\n\n const candyWidgetsConfigTask = await createClientViteConfigTask(engineDirectory);\n const buildCandyWidgetChain =\n options.skipBuildEngine || !options.buildCandyWidget\n ? new EmptyProducer()\n : candyWidgetsConfigTask.chainWith(p => new BuildCandyWidgetTask(p));\n\n const staticResourcesChain = Observe.files(\n path.join(__dirname, \"..\", \"..\", \"StaticFilesForResourcesDir\"),\n \"*.js\"\n ).do(x =>\n FSTask.copyRecursively(getLogger().withPrefix(\"STATICS\"), x, path.join(resourcesDirectory, \"public\", \"scripts\"))\n );\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 repositoryRoot = path.join(farmDirectory, \"..\");\n\n const formInfos = await FormGlobs.resolveGfvGlobs(options.formGlobs, farmDirectory);\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 createChainForForm = async (formRelativePath: string) => {\n const gfv = extractGfvFromFormPath(formRelativePath);\n const formDirPath = path.join(repositoryRoot, formRelativePath);\n const formSchemasDirPath = path.join(formDirPath, \"schemas\");\n const rngSchemaMask = `*${getRngSchemaFileExtension(formSchemasDirPath, gfv)}`;\n\n return Observe.file(path.join(formDirPath, WellKnownDirectories.FormJsonFileName))\n .transform(formJsonFile => resolveFormInfo(formJsonFile, formDirPath))\n .transform(async x => ({\n ...x,\n generatorSource: resolveLocalGeneratorSource(engineDirectory),\n engineSource: resolveLocalEngineSource(engineDirectory),\n }))\n .attach(\n async fi => generatorFactory(fi.generatorSource, candyModulesDirectory, false, undefined),\n async (fi, y) => ({ ...fi, generator: y }),\n async fi => getGeneratorSourceKey(fi.generatorSource)\n )\n .attach(async fi =>\n devBuildOptions.watch\n ? Observe.files(\n fi.formSourcesPath,\n \"../../controls/**/*\",\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 ...fi,\n dependenciesHash:\n fi.mode === FormBuildMode.NormalBuild\n ? await fi.generator.getAllDependenciesHash(formDirPath, farmDirectory)\n : \"\",\n }))\n .do(async fi => {\n if (options.skipGeneration || fi.mode !== FormBuildMode.NormalBuild) {\n return undefined;\n }\n return generateForm(fi.formSourcesPath, farmDirectory, fi.generator, undefined, {\n resourcesHash: fi.dependenciesHash,\n });\n })\n .attach(async () =>\n devBuildOptions.watch\n ? Observe.files(path.join(formDirPath, \"form\"), \"**/*\")\n : Observe.value(path.join(formDirPath, \"form\"))\n )\n .do(async fi => {\n if (options.skipWebPackCompilation || fi.mode !== FormBuildMode.NormalBuild) {\n return undefined;\n }\n return compileForm(\n fi.formName,\n formDirPath,\n resourcesDirectory,\n fi.dependenciesHash,\n options.buildDebugOnly,\n undefined,\n false\n );\n })\n .do(async fi => {\n if (fi.mode !== FormBuildMode.NormalBuild) {\n return;\n }\n await writeFLangNormalizationFiles(fi.formName, formDirPath, resourcesDirectory);\n })\n .do(async fi => {\n if (fi.mode !== FormBuildMode.NormalBuild) {\n return;\n }\n await writeKClangFiles(fi.formName, formDirPath, resourcesDirectory);\n })\n .do(async fi => {\n if (fi.mode !== FormBuildMode.NormalBuild) {\n return;\n }\n await writeExtendedSchemaFiles(fi.formName, formDirPath, resourcesDirectory);\n })\n .do(async fi => {\n if (fi.mode !== FormBuildMode.NormalBuild) {\n return;\n }\n await writeAttachmentPathFiles(fi.formName, formDirPath, resourcesDirectory);\n })\n .do(async fi => {\n if (fi.mode !== FormBuildMode.NormalBuild) {\n return;\n }\n await writeAttachmentPathByGfvFiles(fi.formName, formDirPath, resourcesDirectory);\n })\n .do(async fi => {\n if (fi.mode !== FormBuildMode.NormalBuild) {\n return;\n }\n await writeFormMeta(\n resourcesDirectory,\n gfv,\n fi.engineSource,\n fi.dependenciesHash,\n fi.themes,\n fi.useServerSideNormalization\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 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 };\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 if (devBuildOptions.watch) {\n const stopObserve1 = await buildEngineChain.observe();\n const stopObserve2 = await buildClientJsChain.observe();\n const stopObserve3 = await staticResourcesChain.observe();\n const stopObserve4 = await buildFormsChain.observe();\n const stopObserve5 = await pickListsChain.observe();\n const stopObserve6 = await resourcesExternalConvertersChain.observe();\n\n await context.waitForExit();\n\n await stopObserve1();\n await stopObserve2();\n await stopObserve3();\n await stopObserve4();\n await stopObserve5();\n await stopObserve6();\n } else {\n const startDate = Date.now();\n await Promise.all([\n buildEngineChain.currentValue,\n buildClientJsChain.currentValue,\n buildCandyWidgetChain.currentValue,\n staticResourcesChain.currentValue,\n resourcesExternalConvertersChain.currentValue,\n (async () => {\n try {\n await pickListsChain.currentValue;\n await buildFormsChain.currentValue;\n } catch (e) {\n if (options.continueOnError) {\n context.logger.error(e);\n } else {\n throw e;\n }\n }\n })(),\n ]);\n const totalTime = Date.now() - startDate;\n // eslint-disable-next-line no-console\n console.log(`${chalk.greenBright(\"Build success\")} Total time: ${printTime(totalTime)}`);\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AACA,IAAAI,qBAAA,GAAAJ,OAAA;AAKA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,6BAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,qBAAA,GAAAT,OAAA;AACA,IAAAU,sBAAA,GAAAV,OAAA;AACA,IAAAW,gBAAA,GAAAX,OAAA;AACA,IAAAY,cAAA,GAAAZ,OAAA;AAEA,IAAAa,eAAA,GAAAb,OAAA;AACA,IAAAc,aAAA,GAAAd,OAAA;AACA,IAAAe,QAAA,GAAAf,OAAA;AACA,IAAAgB,YAAA,GAAAhB,OAAA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MAAME,YAAY,CAAC,CAAC;IACpB,MAAMC,YAAY,CAAC,CAAC;IACpB,MAAMC,YAAY,CAAC,CAAC;IACpB,MAAMC,YAAY,CAAC,CAAC;IACpB,MAAMC,YAAY,CAAC,CAAC;EACxB,CAAC,MAAM;IACH,MAAME,SAAS,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC;IAC5B,MAAMC,OAAO,CAACC,GAAG,CAAC,CACdtG,gBAAgB,CAACuG,YAAY,EAC7B9F,kBAAkB,CAAC8F,YAAY,EAC/B1F,qBAAqB,CAAC0F,YAAY,EAClCvF,oBAAoB,CAACuF,YAAY,EACjCpE,gCAAgC,CAACoE,YAAY,EAC7C,CAAC,YAAY;MACT,IAAI;QACA,MAAM3E,cAAc,CAAC2E,YAAY;QACjC,MAAMnB,eAAe,CAACmB,YAAY;MACtC,CAAC,CAAC,OAAOC,CAAC,EAAE;QACR,IAAIhH,OAAO,CAACiH,eAAe,EAAE;UACzBlH,OAAO,CAACsC,MAAM,CAAC6E,KAAK,CAACF,CAAC,CAAC;QAC3B,CAAC,MAAM;UACH,MAAMA,CAAC;QACX;MACJ;IACJ,CAAC,EAAE,CAAC,CACP,CAAC;IACF,MAAMG,SAAS,GAAGR,IAAI,CAACC,GAAG,CAAC,CAAC,GAAGF,SAAS;IACxC;IACAU,OAAO,CAACC,GAAG,CAAC,GAAGC,cAAK,CAACC,WAAW,CAAC,eAAe,CAAC,gBAAgB,IAAAC,sBAAS,EAACL,SAAS,CAAC,EAAE,CAAC;EAC5F;AACJ","ignoreList":[]}
|
|
@@ -18,7 +18,7 @@ async function runLocalization(context, options, farmDirectory, engineDirectory,
|
|
|
18
18
|
if (!(await (0, _fsExtra.pathExists)(formDirPath))) {
|
|
19
19
|
throw new Error(`GFV ${options.gfv} don't exist`);
|
|
20
20
|
}
|
|
21
|
-
const localizeChain = _Observe.Observe.file(_path.default.join(formDirPath, _WellKnownDirectories.WellKnownDirectories.FormJsonFileName)).transform(formJsonFile => (0, _ResolveFormInfo.resolveFormInfo)(formJsonFile, formDirPath,
|
|
21
|
+
const localizeChain = _Observe.Observe.file(_path.default.join(formDirPath, _WellKnownDirectories.WellKnownDirectories.FormJsonFileName)).transform(formJsonFile => (0, _ResolveFormInfo.resolveFormInfo)(formJsonFile, formDirPath, context.logger.withPrefix(`FORM:${options.gfv}`))).transform(async x => {
|
|
22
22
|
if (options.useLocalGeneratorSources) {
|
|
23
23
|
return {
|
|
24
24
|
...x,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RunLocalization.js","names":["_path","_interopRequireDefault","require","_fsExtra","_AcquireFormGenerator","_PublishedVersionUtils","_ResolveFormInfo","_FsUtils","_Observe","_WellKnownDirectories","runLocalization","context","options","farmDirectory","engineDirectory","candyModulesDirectory","formDirPath","path","join","gfv","pathExists","Error","localizeChain","Observe","file","WellKnownDirectories","FormJsonFileName","transform","formJsonFile","resolveFormInfo","logger","withPrefix","x","useLocalGeneratorSources","generatorSource","resolveLocalGeneratorSource","generatorVersion","undefined","resolveGeneratorVersion","attach","fi","generatorFactory","y","generator","getGeneratorSourceKey","do","formSource","readSources","dictionaryOnly","log","localizationDictionary","getDictionary","sugarContent","resources","writeFilesBatch","localizedSugar","getLocalizedSugar","oldSugarDirectory","ensureDir","Promise","all","Object","entries","map","filename","sugar","writeFileAsync","currentValue","filesBatch","outputDirectory","filePath","keys","content","parse","dir"],"sources":["../../../../../src/CLICommands/Localization/RunLocalization.ts"],"sourcesContent":["import path from \"path\";\n\nimport { ensureDir, pathExists } from \"fs-extra\";\n\nimport { generatorFactory, getGeneratorSourceKey } from \"../../BuildTasks/Generator/AcquireFormGenerator\";\nimport { resolveGeneratorVersion, resolveLocalGeneratorSource } from \"../../BuildTasks/PublishedVersionUtils\";\nimport { resolveFormInfo } from \"../../BuildTasks/ResolveFormInfo\";\nimport { ConsoleApplicationContext } from \"../../Commons/ConsoleApplication/ConsoleApplicationContext\";\nimport { writeFileAsync } from \"../../Commons/FsUtils\";\nimport { Observe } from \"../../Commons/TasksCore/Observe\";\nimport { WellKnownDirectories } from \"../../../../Common/WellKnownDirectories\";\n\nimport { LocalizationOptions } from \"./LocalizationOptions\";\n\nexport async function runLocalization(\n context: ConsoleApplicationContext,\n options: LocalizationOptions,\n farmDirectory: string,\n engineDirectory: string,\n candyModulesDirectory: string\n): Promise<void> {\n const formDirPath = path.join(farmDirectory, \"forms\", options.gfv);\n if (!(await pathExists(formDirPath))) {\n throw new Error(`GFV ${options.gfv} don't exist`);\n }\n\n const localizeChain = Observe.file(path.join(formDirPath, WellKnownDirectories.FormJsonFileName))\n .transform(formJsonFile =>\n resolveFormInfo(
|
|
1
|
+
{"version":3,"file":"RunLocalization.js","names":["_path","_interopRequireDefault","require","_fsExtra","_AcquireFormGenerator","_PublishedVersionUtils","_ResolveFormInfo","_FsUtils","_Observe","_WellKnownDirectories","runLocalization","context","options","farmDirectory","engineDirectory","candyModulesDirectory","formDirPath","path","join","gfv","pathExists","Error","localizeChain","Observe","file","WellKnownDirectories","FormJsonFileName","transform","formJsonFile","resolveFormInfo","logger","withPrefix","x","useLocalGeneratorSources","generatorSource","resolveLocalGeneratorSource","generatorVersion","undefined","resolveGeneratorVersion","attach","fi","generatorFactory","y","generator","getGeneratorSourceKey","do","formSource","readSources","dictionaryOnly","log","localizationDictionary","getDictionary","sugarContent","resources","writeFilesBatch","localizedSugar","getLocalizedSugar","oldSugarDirectory","ensureDir","Promise","all","Object","entries","map","filename","sugar","writeFileAsync","currentValue","filesBatch","outputDirectory","filePath","keys","content","parse","dir"],"sources":["../../../../../src/CLICommands/Localization/RunLocalization.ts"],"sourcesContent":["import path from \"path\";\n\nimport { ensureDir, pathExists } from \"fs-extra\";\n\nimport { generatorFactory, getGeneratorSourceKey } from \"../../BuildTasks/Generator/AcquireFormGenerator\";\nimport { resolveGeneratorVersion, resolveLocalGeneratorSource } from \"../../BuildTasks/PublishedVersionUtils\";\nimport { resolveFormInfo } from \"../../BuildTasks/ResolveFormInfo\";\nimport { ConsoleApplicationContext } from \"../../Commons/ConsoleApplication/ConsoleApplicationContext\";\nimport { writeFileAsync } from \"../../Commons/FsUtils\";\nimport { Observe } from \"../../Commons/TasksCore/Observe\";\nimport { WellKnownDirectories } from \"../../../../Common/WellKnownDirectories\";\n\nimport { LocalizationOptions } from \"./LocalizationOptions\";\n\nexport async function runLocalization(\n context: ConsoleApplicationContext,\n options: LocalizationOptions,\n farmDirectory: string,\n engineDirectory: string,\n candyModulesDirectory: string\n): Promise<void> {\n const formDirPath = path.join(farmDirectory, \"forms\", options.gfv);\n if (!(await pathExists(formDirPath))) {\n throw new Error(`GFV ${options.gfv} don't exist`);\n }\n\n const localizeChain = Observe.file(path.join(formDirPath, WellKnownDirectories.FormJsonFileName))\n .transform(formJsonFile =>\n resolveFormInfo(formJsonFile, formDirPath, context.logger.withPrefix(`FORM:${options.gfv}`))\n )\n .transform(async x => {\n if (options.useLocalGeneratorSources) {\n return {\n ...x,\n generatorSource: resolveLocalGeneratorSource(engineDirectory),\n };\n }\n\n if (x.generatorVersion == undefined) {\n throw new Error(\"generatorVersion is no defined\");\n }\n\n return {\n ...x,\n generatorSource: await resolveGeneratorVersion(x.generatorVersion),\n };\n })\n .attach(\n async fi => generatorFactory(fi.generatorSource, candyModulesDirectory, false),\n async (fi, y) => ({ ...fi, generator: y }),\n async fi => getGeneratorSourceKey(fi.generatorSource)\n )\n .do(async fi => {\n const logger = context.logger.withPrefix(\"LOCALIZE\").withPrefix(options.gfv);\n\n const formSource = await fi.generator.readSources(formDirPath, farmDirectory);\n\n if (options.dictionaryOnly) {\n logger.log(\"Generate translate dictionary\");\n const localizationDictionary = await fi.generator.getDictionary(\n formSource.sugarContent,\n formSource.resources\n );\n logger.log(\"Write translate dictionary\");\n await writeFilesBatch(localizationDictionary, formDirPath);\n } else {\n logger.log(\"Generate localization sugar\");\n const localizedSugar = await fi.generator.getLocalizedSugar(\n formSource.sugarContent,\n formSource.resources\n );\n\n logger.log(\"Generate translate dictionary\");\n const localizationDictionary = await fi.generator.getDictionary(localizedSugar, formSource.resources);\n\n const oldSugarDirectory = path.join(formDirPath, \"oldsugar\");\n logger.log(`Write previous version sugar in \"${oldSugarDirectory}\"`);\n await ensureDir(oldSugarDirectory);\n await Promise.all(\n Object.entries(formSource.sugarContent).map(([filename, sugar]) =>\n writeFileAsync(path.join(oldSugarDirectory, filename + \".sugar.xml\"), sugar)\n )\n );\n\n logger.log(\"Write localization sugar\");\n await writeFilesBatch(localizedSugar, formDirPath);\n\n logger.log(\"Write translate dictionary\");\n await writeFilesBatch(localizationDictionary, formDirPath);\n logger.log(\"Localize successful complete\");\n }\n });\n\n await localizeChain.currentValue;\n}\n\nasync function writeFilesBatch(\n filesBatch: {\n [relativeFileName: string]: string | Buffer;\n },\n outputDirectory: string\n): Promise<void> {\n for (const filePath of Object.keys(filesBatch)) {\n const content = filesBatch[filePath];\n if (content != undefined && content !== \"\") {\n await ensureDir(path.join(outputDirectory, path.parse(filePath).dir));\n await writeFileAsync(path.join(outputDirectory, filePath), content);\n }\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,qBAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AAEA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,qBAAA,GAAAP,OAAA;AAIO,eAAeQ,eAAeA,CACjCC,OAAkC,EAClCC,OAA4B,EAC5BC,aAAqB,EACrBC,eAAuB,EACvBC,qBAA6B,EAChB;EACb,MAAMC,WAAW,GAAGC,aAAI,CAACC,IAAI,CAACL,aAAa,EAAE,OAAO,EAAED,OAAO,CAACO,GAAG,CAAC;EAClE,IAAI,EAAE,MAAM,IAAAC,mBAAU,EAACJ,WAAW,CAAC,CAAC,EAAE;IAClC,MAAM,IAAIK,KAAK,CA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,eAAe,CAACC,cAAc,EAAEvC,WAAW,CAAC;MAElDc,MAAM,CAACmB,GAAG,CAAC,4BAA4B,CAAC;MACxC,MAAMK,eAAe,CAACJ,sBAAsB,EAAElC,WAAW,CAAC;MAC1Dc,MAAM,CAACmB,GAAG,CAAC,8BAA8B,CAAC;IAC9C;EACJ,CAAC,CAAC;EAEN,MAAM3B,aAAa,CAAC6C,YAAY;AACpC;AAEA,eAAeb,eAAeA,CAC1Bc,UAEC,EACDC,eAAuB,EACV;EACb,KAAK,MAAMC,QAAQ,IAAIT,MAAM,CAACU,IAAI,CAACH,UAAU,CAAC,EAAE;IAC5C,MAAMI,OAAO,GAAGJ,UAAU,CAACE,QAAQ,CAAC;IACpC,IAAIE,OAAO,IAAInC,SAAS,IAAImC,OAAO,KAAK,EAAE,EAAE;MACxC,MAAM,IAAAd,kBAAS,EAACzC,aAAI,CAACC,IAAI,CAACmD,eAAe,EAAEpD,aAAI,CAACwD,KAAK,CAACH,QAAQ,CAAC,CAACI,GAAG,CAAC,CAAC;MACrE,MAAM,IAAAR,uBAAc,EAACjD,aAAI,CAACC,IAAI,CAACmD,eAAe,EAAEC,QAAQ,CAAC,EAAEE,OAAO,CAAC;IACvE;EACJ;AACJ","ignoreList":[]}
|
|
@@ -28,7 +28,7 @@ async function resolveGeneratorModule(gfv, farmConfig, farmDirectory, isLocalEng
|
|
|
28
28
|
formJsonPath,
|
|
29
29
|
formPath
|
|
30
30
|
} = await resolveFormPath(gfv, farmConfig, farmDirectory);
|
|
31
|
-
const generatorVersion = (_await$resolveFormInf = (await (0, _ResolveFormInfo.resolveFormInfo)(formJsonPath, formPath
|
|
31
|
+
const generatorVersion = (_await$resolveFormInf = (await (0, _ResolveFormInfo.resolveFormInfo)(formJsonPath, formPath)).generatorVersion) !== null && _await$resolveFormInf !== void 0 ? _await$resolveFormInf : (0, _TypingUtils.reject)(`Cannot find generatorVersion for: ${gfv}`);
|
|
32
32
|
const generatorSource = await (0, _PublishedVersionUtils.resolveGeneratorVersion)(generatorVersion);
|
|
33
33
|
const generator = (0, _AcquireFormGenerator.generatorFactory)(generatorSource, (_farmConfig$candyModu = farmConfig === null || farmConfig === void 0 ? void 0 : farmConfig.candyModulesDirectory) !== null && _farmConfig$candyModu !== void 0 ? _farmConfig$candyModu : (0, _TypingUtils.reject)(""), true);
|
|
34
34
|
const generatorModule = await generator.currentValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.js","names":["_path","_interopRequireDefault","require","_TypingUtils","_PublishedVersionUtils","_AcquireFormGenerator","_ResolveFormInfo","resolveGeneratorModule","gfv","farmConfig","farmDirectory","isLocalEngine","_await$resolveFormInf","_farmConfig$candyModu","_farmConfig$engineDir","resolvedGeneratorVersion","resolveLocalGeneratorSource","engineDirectory","reject","candyModulesDirectory","undefined","Error","generator","generatorFactory","generatorModule","currentValue","formJsonPath","formPath","resolveFormPath","generatorVersion","resolveFormInfo","generatorSource","resolveGeneratorVersion","_await$farmDirectory$","_farmConfig$farmDirec","_path$join","getFormJsonPath","farmPath","path","join"],"sources":["../../../../../src/CLICommands/SugarExtractor/Utils.ts"],"sourcesContent":["import path from \"path\";\n\nimport { reject } from \"../../../../Common/TypingUtils\";\nimport { resolveLocalGeneratorSource, resolveGeneratorVersion } from \"../../BuildTasks/PublishedVersionUtils\";\nimport { generatorFactory } from \"../../BuildTasks/Generator/AcquireFormGenerator\";\nimport { FarmConfig } from \"../../CandyCLI\";\nimport { FarmDirectory } from \"../BuildServer/ResourcesControllers/Directories/FarmDirectory\";\nimport { resolveFormInfo } from \"../../BuildTasks/ResolveFormInfo\";\n\nexport async function resolveGeneratorModule(\n gfv: string,\n farmConfig: FarmConfig | undefined,\n farmDirectory: FarmDirectory | undefined,\n isLocalEngine: boolean\n) {\n if (isLocalEngine) {\n const resolvedGeneratorVersion = resolveLocalGeneratorSource(\n farmConfig?.engineDirectory ?? reject(`Cannot find form dir for: ${gfv}`)\n );\n const candyModulesDirectory = farmConfig?.candyModulesDirectory;\n if (candyModulesDirectory === undefined) {\n throw new Error(`Cannot find candyModulesDirectory for: ${gfv}`);\n }\n const generator = generatorFactory(resolvedGeneratorVersion, candyModulesDirectory, true);\n const generatorModule = await generator.currentValue;\n\n return generatorModule;\n }\n\n const { formJsonPath, formPath } = await resolveFormPath(gfv, farmConfig, farmDirectory);\n const generatorVersion =\n (await resolveFormInfo(formJsonPath, formPath
|
|
1
|
+
{"version":3,"file":"Utils.js","names":["_path","_interopRequireDefault","require","_TypingUtils","_PublishedVersionUtils","_AcquireFormGenerator","_ResolveFormInfo","resolveGeneratorModule","gfv","farmConfig","farmDirectory","isLocalEngine","_await$resolveFormInf","_farmConfig$candyModu","_farmConfig$engineDir","resolvedGeneratorVersion","resolveLocalGeneratorSource","engineDirectory","reject","candyModulesDirectory","undefined","Error","generator","generatorFactory","generatorModule","currentValue","formJsonPath","formPath","resolveFormPath","generatorVersion","resolveFormInfo","generatorSource","resolveGeneratorVersion","_await$farmDirectory$","_farmConfig$farmDirec","_path$join","getFormJsonPath","farmPath","path","join"],"sources":["../../../../../src/CLICommands/SugarExtractor/Utils.ts"],"sourcesContent":["import path from \"path\";\n\nimport { reject } from \"../../../../Common/TypingUtils\";\nimport { resolveLocalGeneratorSource, resolveGeneratorVersion } from \"../../BuildTasks/PublishedVersionUtils\";\nimport { generatorFactory } from \"../../BuildTasks/Generator/AcquireFormGenerator\";\nimport { FarmConfig } from \"../../CandyCLI\";\nimport { FarmDirectory } from \"../BuildServer/ResourcesControllers/Directories/FarmDirectory\";\nimport { resolveFormInfo } from \"../../BuildTasks/ResolveFormInfo\";\n\nexport async function resolveGeneratorModule(\n gfv: string,\n farmConfig: FarmConfig | undefined,\n farmDirectory: FarmDirectory | undefined,\n isLocalEngine: boolean\n) {\n if (isLocalEngine) {\n const resolvedGeneratorVersion = resolveLocalGeneratorSource(\n farmConfig?.engineDirectory ?? reject(`Cannot find form dir for: ${gfv}`)\n );\n const candyModulesDirectory = farmConfig?.candyModulesDirectory;\n if (candyModulesDirectory === undefined) {\n throw new Error(`Cannot find candyModulesDirectory for: ${gfv}`);\n }\n const generator = generatorFactory(resolvedGeneratorVersion, candyModulesDirectory, true);\n const generatorModule = await generator.currentValue;\n\n return generatorModule;\n }\n\n const { formJsonPath, formPath } = await resolveFormPath(gfv, farmConfig, farmDirectory);\n const generatorVersion =\n (await resolveFormInfo(formJsonPath, formPath)).generatorVersion ??\n reject(`Cannot find generatorVersion for: ${gfv}`);\n\n const generatorSource = await resolveGeneratorVersion(generatorVersion);\n const generator = generatorFactory(generatorSource, farmConfig?.candyModulesDirectory ?? reject(\"\"), true);\n const generatorModule = await generator.currentValue;\n return generatorModule;\n}\n\nexport async function resolveFormPath(\n gfv: string,\n farmConfig: FarmConfig | undefined,\n farmDirectory: FarmDirectory | undefined\n) {\n const formJsonPath = (await farmDirectory?.getFormJsonPath(gfv)) ?? reject(`Cannot find form.json for: ${gfv}`);\n const farmPath = farmConfig?.farmDirectory ?? reject(`Cannot find farm Directory for: ${gfv}`);\n\n const formPath = path.join(formJsonPath, \"..\") ?? reject(`Cannot find form dir for: ${gfv}`);\n\n return { farmPath: farmPath, formPath: formPath, formJsonPath: formJsonPath };\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AAGA,IAAAI,gBAAA,GAAAJ,OAAA;AAEO,eAAeK,sBAAsBA,CACxCC,GAAW,EACXC,UAAkC,EAClCC,aAAwC,EACxCC,aAAsB,EACxB;EAAA,IAAAC,qBAAA,EAAAC,qBAAA;EACE,IAAIF,aAAa,EAAE;IAAA,IAAAG,qBAAA;IACf,MAAMC,wBAAwB,GAAG,IAAAC,kDAA2B,GAAAF,qBAAA,GACxDL,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEQ,eAAe,cAAAH,qBAAA,cAAAA,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