@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":"BuildServerServerOptions.js","names":["_CommandBasedOptionsParser","require","_BuildDebugOnlyOption","_CommonOptionDefintions","buildServerCommandDefinition","exports","commandDefinition","optionsDefinition","alias","name","defaultValue","parse","defaultOption","multiple","description","allFarmsDir","input","nightly","doesNotRequireValue","disableClientOverride","
|
|
1
|
+
{"version":3,"file":"BuildServerServerOptions.js","names":["_CommandBasedOptionsParser","require","_BuildDebugOnlyOption","_CommonOptionDefintions","buildServerCommandDefinition","exports","commandDefinition","optionsDefinition","alias","name","defaultValue","parse","defaultOption","multiple","description","allFarmsDir","input","nightly","doesNotRequireValue","disableClientOverride","debugOnlyOptionDefinition","devModeOption","logVerbosityOption","devBuildServerCommandDefinition","formGlobs"],"sources":["../../../../../src/CLICommands/BuildServer/BuildServerServerOptions.ts"],"sourcesContent":["import { commandDefinition, optionsDefinition } from \"../../Commons/Options/CommandBasedOptionsParser\";\nimport { BuildDebugOnlyOption, debugOnlyOptionDefinition } from \"../CommonOptions/BuildDebugOnlyOption\";\nimport { CommonOptions } from \"../CommonOptions/CommonOptions\";\nimport { devModeOption, logVerbosityOption } from \"../CommonOptions/CommonOptionDefintions\";\n\nexport interface BuildServerOptions extends CommonOptions, BuildDebugOnlyOption {\n disableClientOverride: boolean;\n nightly: boolean;\n allFarmsDir: string[] | [];\n}\n\nexport interface DevBuildServerOptions extends CommonOptions, BuildDebugOnlyOption {\n formGlobs: string[];\n disableClientOverride: boolean;\n allFarmsDir: string[] | [];\n}\n\nexport const buildServerCommandDefinition = commandDefinition<\"build-server\", BuildServerOptions>(\n \"build-server\",\n \"build-server\",\n optionsDefinition(\n {\n alias: \"g\",\n name: \"gfvs\",\n defaultValue: {},\n parse: () => ({}),\n defaultOption: true,\n multiple: true,\n description: \"Опция устарела. Оставлена для обратной совместимости.\",\n },\n {\n alias: \"a\",\n name: \"all-farm-dir\",\n defaultValue: { allFarmsDir: [] },\n parse: (input: string[]) => ({ allFarmsDir: input }),\n defaultOption: false,\n multiple: true,\n description:\n \"Позволяет передать массив путей до всех фармов candy, чтобы открывать из всех них формы. Путь передавать относительно candy\",\n },\n {\n name: \"nightly\",\n defaultValue: { nightly: false },\n parse: input => ({ nightly: input }),\n doesNotRequireValue: true,\n description: \"Включает сборку форм на движке nightly.\",\n },\n {\n name: \"no-client-override\",\n defaultValue: { disableClientOverride: false },\n parse: input => ({ disableClientOverride: input }),\n doesNotRequireValue: true,\n description:\n \"Отключает перехват client.js. В этом случае не будет работать отображение логов сборки и ожидания сборки формы.\",\n },\n debugOnlyOptionDefinition,\n devModeOption,\n logVerbosityOption\n ),\n {\n description: \"Magic\",\n }\n);\n\nexport const devBuildServerCommandDefinition = commandDefinition<\"dev-build-server\", DevBuildServerOptions>(\n \"dev-build-server\",\n \"dev-build-server\",\n optionsDefinition(\n {\n alias: \"g\",\n name: \"gfvs\",\n defaultValue: { formGlobs: [\"*\"] },\n parse: (input: string[]) => ({ formGlobs: input }),\n defaultOption: true,\n multiple: true,\n description: \"Одна или несколько GFV или GFV-масок для пересобрки.\",\n },\n {\n alias: \"a\",\n name: \"all-farm-dir\",\n defaultValue: { allFarmsDir: [] },\n parse: (input: string[]) => ({ allFarmsDir: input }),\n defaultOption: false,\n multiple: true,\n description:\n \"Позволяет передать массив путей до всех фармов candy, чтобы открывать из всех них формы. Путь передавать относительно candy\",\n },\n {\n name: \"no-client-override\",\n defaultValue: { disableClientOverride: false },\n parse: input => ({ disableClientOverride: input }),\n doesNotRequireValue: true,\n description:\n \"Отключает перехват client.js. В этом случае не будет работать отображение логов сборки и ожидания сборки формы.\",\n },\n debugOnlyOptionDefinition,\n devModeOption,\n logVerbosityOption\n ),\n {\n description: \"Magic\",\n }\n);\n"],"mappings":";;;;;;AAAA,IAAAA,0BAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AAEA,IAAAE,uBAAA,GAAAF,OAAA;AAcO,MAAMG,4BAA4B,GAAAC,OAAA,CAAAD,4BAAA,GAAG,IAAAE,4CAAiB,EACzD,cAAc,EACd,cAAc,EACd,IAAAC,4CAAiB,EACb;EACIC,KAAK,EAAE,GAAG;EACVC,IAAI,EAAE,MAAM;EACZC,YAAY,EAAE,CAAC,CAAC;EAChBC,KAAK,EAAEA,CAAA,MAAO,CAAC,CAAC,CAAC;EACjBC,aAAa,EAAE,IAAI;EACnBC,QAAQ,EAAE,IAAI;EACdC,WAAW,EAAE;AACjB,CAAC,EACD;EACIN,KAAK,EAAE,GAAG;EACVC,IAAI,EAAE,cAAc;EACpBC,YAAY,EAAE;IAAEK,WAAW,EAAE;EAAG,CAAC;EACjCJ,KAAK,EAAGK,KAAe,KAAM;IAAED,WAAW,EAAEC;EAAM,CAAC,CAAC;EACpDJ,aAAa,EAAE,KAAK;EACpBC,QAAQ,EAAE,IAAI;EACdC,WAAW,EACP;AACR,CAAC,EACD;EACIL,IAAI,EAAE,SAAS;EACfC,YAAY,EAAE;IAAEO,OAAO,EAAE;EAAM,CAAC;EAChCN,KAAK,EAAEK,KAAK,KAAK;IAAEC,OAAO,EAAED;EAAM,CAAC,CAAC;EACpCE,mBAAmB,EAAE,IAAI;EACzBJ,WAAW,EAAE;AACjB,CAAC,EACD;EACIL,IAAI,EAAE,oBAAoB;EAC1BC,YAAY,EAAE;IAAES,qBAAqB,EAAE;EAAM,CAAC;EAC9CR,KAAK,EAAEK,KAAK,KAAK;IAAEG,qBAAqB,EAAEH;EAAM,CAAC,CAAC;EAClDE,mBAAmB,EAAE,IAAI;EACzBJ,WAAW,EACP;AACR,CAAC,EACDM,+CAAyB,EACzBC,qCAAa,EACbC,0CACJ,CAAC,EACD;EACIR,WAAW,EAAE;AACjB,CACJ,CAAC;AAEM,MAAMS,+BAA+B,GAAAlB,OAAA,CAAAkB,+BAAA,GAAG,IAAAjB,4CAAiB,EAC5D,kBAAkB,EAClB,kBAAkB,EAClB,IAAAC,4CAAiB,EACb;EACIC,KAAK,EAAE,GAAG;EACVC,IAAI,EAAE,MAAM;EACZC,YAAY,EAAE;IAAEc,SAAS,EAAE,CAAC,GAAG;EAAE,CAAC;EAClCb,KAAK,EAAGK,KAAe,KAAM;IAAEQ,SAAS,EAAER;EAAM,CAAC,CAAC;EAClDJ,aAAa,EAAE,IAAI;EACnBC,QAAQ,EAAE,IAAI;EACdC,WAAW,EAAE;AACjB,CAAC,EACD;EACIN,KAAK,EAAE,GAAG;EACVC,IAAI,EAAE,cAAc;EACpBC,YAAY,EAAE;IAAEK,WAAW,EAAE;EAAG,CAAC;EACjCJ,KAAK,EAAGK,KAAe,KAAM;IAAED,WAAW,EAAEC;EAAM,CAAC,CAAC;EACpDJ,aAAa,EAAE,KAAK;EACpBC,QAAQ,EAAE,IAAI;EACdC,WAAW,EACP;AACR,CAAC,EACD;EACIL,IAAI,EAAE,oBAAoB;EAC1BC,YAAY,EAAE;IAAES,qBAAqB,EAAE;EAAM,CAAC;EAC9CR,KAAK,EAAEK,KAAK,KAAK;IAAEG,qBAAqB,EAAEH;EAAM,CAAC,CAAC;EAClDE,mBAAmB,EAAE,IAAI;EACzBJ,WAAW,EACP;AACR,CAAC,EACDM,+CAAyB,EACzBC,qCAAa,EACbC,0CACJ,CAAC,EACD;EACIR,WAAW,EAAE;AACjB,CACJ,CAAC","ignoreList":[]}
|
|
@@ -142,9 +142,7 @@ let BuildServerBuildFormsController = exports.BuildServerBuildFormsController =
|
|
|
142
142
|
async getOrCreateBuildFormDevServer(gfv) {
|
|
143
143
|
let devServer = this.devServers[gfv];
|
|
144
144
|
if (devServer == undefined) {
|
|
145
|
-
devServer = new _BuildFormDevServer.BuildFormDevServer(this.nextFreePort++, this.allFarmDirectoryPath, gfv, this.candyModulesDirectory, this.useGeneratorFromLocalSources, this.engineDirectory, this.buildDebugOnly,
|
|
146
|
-
// skipCodeReformatting
|
|
147
|
-
this.nightly);
|
|
145
|
+
devServer = new _BuildFormDevServer.BuildFormDevServer(this.nextFreePort++, this.allFarmDirectoryPath, gfv, this.candyModulesDirectory, this.useGeneratorFromLocalSources, this.engineDirectory, this.buildDebugOnly, this.nightly);
|
|
148
146
|
this.devServers[gfv] = devServer;
|
|
149
147
|
await devServer.start();
|
|
150
148
|
}
|
|
@@ -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","_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,EAAAC,KAAA,EAAAC,MAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAA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AA,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":[]}
|
|
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 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,EAAAC,KAAA,EAAAC,MAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OA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,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":[]}
|
|
@@ -47,7 +47,7 @@ let BuildServerFormInfoController = exports.BuildServerFormInfoController = (_de
|
|
|
47
47
|
if (formJsonFile[0] == undefined) {
|
|
48
48
|
throw Error(`${gfv} not found in farm directories`);
|
|
49
49
|
}
|
|
50
|
-
const formInfo = await (0, _ResolveFormInfo.resolveFormInfo)(formJsonFile[0], path.dirname(formJsonFile[0])
|
|
50
|
+
const formInfo = await (0, _ResolveFormInfo.resolveFormInfo)(formJsonFile[0], path.dirname(formJsonFile[0]));
|
|
51
51
|
if (this.useEngineFromLocalSources) {
|
|
52
52
|
const localEngineMetaContent = {
|
|
53
53
|
engineName: "local",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuildServerFormInfoController.js","names":["path","_interopRequireWildcard","require","_EngineVersionUtils","_PublishedVersionUtils","_ResolveFormInfo","_Methods","_Params","_Results","_SingletonController","_FarmDirectory","_dec","_dec2","_class","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","BuildServerFormInfoController","exports","httpGet","httpReturn","PlainText","httpUrlParam","httpType","String","SingletonController","constructor","allFarmConfig","useEngineFromLocalSources","nightly","allFarmDirectories","map","FarmDirectory","farmDirectory","setupMiddleware","expressApplication","use","_","__","next","resetAllFarmDirectories","getAllFormMetas","Promise","all","getAllGfvs","flat","x","join","getFormMeta","gfv","formJsonFile","getFormJsonPath","filter","undefined","Error","formInfo","resolveFormInfo","dirname","localEngineMetaContent","engineName","resourcesHash","useServerSideNormalization","JSON","stringify","engineVersion","type","preId","engineSources","resolveEngineVersion","formMetaContent","EngineVersionUtils","engineVersionToName","version","themes","_applyDecoratedDescriptor2","prototype"],"sources":["../../../../../../src/CLICommands/BuildServer/ResourcesControllers/BuildServerFormInfoController.ts"],"sourcesContent":["import * as path from \"path\";\n\nimport { Express } from \"express\";\nimport { FarmConfig } from \"Tools/src/CandyCLI\";\n\nimport { EngineVersionUtils } from \"../../../BuildTasks/EngineVersionUtils\";\nimport { resolveEngineVersion } from \"../../../BuildTasks/PublishedVersionUtils\";\nimport { resolveFormInfo } from \"../../../BuildTasks/ResolveFormInfo\";\nimport { FormMetaContent } from \"../../../BuildTasks/WriteFormMeta\";\nimport { httpGet } from \"../../../Commons/HttpServer/AttributeRouting/Methods\";\nimport { httpType, httpUrlParam } from \"../../../Commons/HttpServer/AttributeRouting/Params\";\nimport { httpReturn } from \"../../../Commons/HttpServer/AttributeRouting/Results\";\nimport { SingletonController } from \"../../../Commons/HttpServer/ExpressWrapper/SingletonController\";\nimport { CandyVersionSpec } from \"../../../BuildTasks/Version\";\n\nimport { FarmDirectory } from \"./Directories/FarmDirectory\";\n\nexport class BuildServerFormInfoController extends SingletonController {\n private readonly allFarmConfig: FarmConfig[];\n private allFarmDirectories: FarmDirectory[];\n private readonly nightly: boolean;\n private readonly useEngineFromLocalSources: boolean;\n\n public constructor(allFarmConfig: FarmConfig[], useEngineFromLocalSources: boolean, nightly: boolean) {\n super();\n this.nightly = nightly;\n this.allFarmConfig = allFarmConfig;\n this.allFarmDirectories = allFarmConfig.map(i => new FarmDirectory(i.farmDirectory));\n this.useEngineFromLocalSources = useEngineFromLocalSources;\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.allFarmDirectories = this.allFarmConfig.map(i => new FarmDirectory(i.farmDirectory));\n }\n\n @httpGet(\"/metas\", httpReturn.PlainText)\n public async getAllFormMetas(): Promise<string> {\n return (await Promise.all(this.allFarmDirectories.map(i => i.getAllGfvs())))\n .flat()\n .map(x => `${x}.metas.json`)\n .join(\"\\n\");\n }\n\n @httpGet(\"/metas/:gfv.metas.json\", httpReturn.PlainText, httpUrlParam(\"gfv\", httpType.String))\n public async getFormMeta(gfv: string): Promise<string> {\n const formJsonFile = (await Promise.all(this.allFarmDirectories.map(i => i.getFormJsonPath(gfv))))\n .flat()\n .filter(i => i != undefined);\n if (formJsonFile[0] == undefined) {\n throw Error(`${gfv} not found in farm directories`);\n }\n const formInfo = await resolveFormInfo(formJsonFile[0], path.dirname(formJsonFile[0])
|
|
1
|
+
{"version":3,"file":"BuildServerFormInfoController.js","names":["path","_interopRequireWildcard","require","_EngineVersionUtils","_PublishedVersionUtils","_ResolveFormInfo","_Methods","_Params","_Results","_SingletonController","_FarmDirectory","_dec","_dec2","_class","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","BuildServerFormInfoController","exports","httpGet","httpReturn","PlainText","httpUrlParam","httpType","String","SingletonController","constructor","allFarmConfig","useEngineFromLocalSources","nightly","allFarmDirectories","map","FarmDirectory","farmDirectory","setupMiddleware","expressApplication","use","_","__","next","resetAllFarmDirectories","getAllFormMetas","Promise","all","getAllGfvs","flat","x","join","getFormMeta","gfv","formJsonFile","getFormJsonPath","filter","undefined","Error","formInfo","resolveFormInfo","dirname","localEngineMetaContent","engineName","resourcesHash","useServerSideNormalization","JSON","stringify","engineVersion","type","preId","engineSources","resolveEngineVersion","formMetaContent","EngineVersionUtils","engineVersionToName","version","themes","_applyDecoratedDescriptor2","prototype"],"sources":["../../../../../../src/CLICommands/BuildServer/ResourcesControllers/BuildServerFormInfoController.ts"],"sourcesContent":["import * as path from \"path\";\n\nimport { Express } from \"express\";\nimport { FarmConfig } from \"Tools/src/CandyCLI\";\n\nimport { EngineVersionUtils } from \"../../../BuildTasks/EngineVersionUtils\";\nimport { resolveEngineVersion } from \"../../../BuildTasks/PublishedVersionUtils\";\nimport { resolveFormInfo } from \"../../../BuildTasks/ResolveFormInfo\";\nimport { FormMetaContent } from \"../../../BuildTasks/WriteFormMeta\";\nimport { httpGet } from \"../../../Commons/HttpServer/AttributeRouting/Methods\";\nimport { httpType, httpUrlParam } from \"../../../Commons/HttpServer/AttributeRouting/Params\";\nimport { httpReturn } from \"../../../Commons/HttpServer/AttributeRouting/Results\";\nimport { SingletonController } from \"../../../Commons/HttpServer/ExpressWrapper/SingletonController\";\nimport { CandyVersionSpec } from \"../../../BuildTasks/Version\";\n\nimport { FarmDirectory } from \"./Directories/FarmDirectory\";\n\nexport class BuildServerFormInfoController extends SingletonController {\n private readonly allFarmConfig: FarmConfig[];\n private allFarmDirectories: FarmDirectory[];\n private readonly nightly: boolean;\n private readonly useEngineFromLocalSources: boolean;\n\n public constructor(allFarmConfig: FarmConfig[], useEngineFromLocalSources: boolean, nightly: boolean) {\n super();\n this.nightly = nightly;\n this.allFarmConfig = allFarmConfig;\n this.allFarmDirectories = allFarmConfig.map(i => new FarmDirectory(i.farmDirectory));\n this.useEngineFromLocalSources = useEngineFromLocalSources;\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.allFarmDirectories = this.allFarmConfig.map(i => new FarmDirectory(i.farmDirectory));\n }\n\n @httpGet(\"/metas\", httpReturn.PlainText)\n public async getAllFormMetas(): Promise<string> {\n return (await Promise.all(this.allFarmDirectories.map(i => i.getAllGfvs())))\n .flat()\n .map(x => `${x}.metas.json`)\n .join(\"\\n\");\n }\n\n @httpGet(\"/metas/:gfv.metas.json\", httpReturn.PlainText, httpUrlParam(\"gfv\", httpType.String))\n public async getFormMeta(gfv: string): Promise<string> {\n const formJsonFile = (await Promise.all(this.allFarmDirectories.map(i => i.getFormJsonPath(gfv))))\n .flat()\n .filter(i => i != undefined);\n if (formJsonFile[0] == undefined) {\n throw Error(`${gfv} not found in farm directories`);\n }\n const formInfo = await resolveFormInfo(formJsonFile[0], path.dirname(formJsonFile[0]));\n if (this.useEngineFromLocalSources) {\n const localEngineMetaContent: FormMetaContent = {\n engineName: \"local\",\n resourcesHash: \"local-hash\",\n useServerSideNormalization: formInfo.useServerSideNormalization,\n };\n return JSON.stringify(localEngineMetaContent, undefined, \" \");\n }\n const engineVersion: undefined | CandyVersionSpec = this.nightly\n ? { type: \"pre\", preId: \"nightly\" }\n : formInfo.engineVersion;\n if (engineVersion == undefined) {\n throw new Error(\"Unknown engine version! Can't return meta for this form!\");\n }\n const engineSources = await resolveEngineVersion(engineVersion);\n const formMetaContent: FormMetaContent = {\n engineName:\n engineSources.type === \"LocalEngineSources\"\n ? \"local\"\n : EngineVersionUtils.engineVersionToName(engineSources.version),\n resourcesHash: \"local-hash\",\n useServerSideNormalization: formInfo.useServerSideNormalization,\n };\n if (formInfo.themes != undefined) {\n formMetaContent.themes = formInfo.themes;\n }\n return JSON.stringify(formMetaContent, undefined, \" \");\n }\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,IAAA,GAAAC,uBAAA,CAAAC,OAAA;AAKA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AAEA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,oBAAA,GAAAP,OAAA;AAGA,IAAAQ,cAAA,GAAAR,OA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AgC,GAAG;MACrCV,UAAU,EACNQ,aAAa,CAACF,IAAI,KAAK,oBAAoB,GACrC,OAAO,GACPK,sCAAkB,CAACC,mBAAmB,CAACJ,aAAa,CAACK,OAAO,CAAC;MACvEZ,aAAa,EAAE,YAAY;MAC3BC,0BAA0B,EAAEN,QAAQ,CAACM;IACzC,CAAC;IACD,IAAIN,QAAQ,CAACkB,MAAM,IAAIpB,SAAS,EAAE;MAC9BgB,eAAe,CAACI,MAAM,GAAGlB,QAAQ,CAACkB,MAAM;IAC5C;IACA,OAAOX,IAAI,CAACC,SAAS,CAACM,eAAe,EAAEhB,SAAS,EAAE,IAAI,CAAC;EAC3D;AACJ,CAAC,OAAAqB,0BAAA,CAAAvE,OAAA,EAAAP,MAAA,CAAA+E,SAAA,sBAAAjF,IAAA,GAAAe,MAAA,CAAAE,wBAAA,CAAAf,MAAA,CAAA+E,SAAA,sBAAA/E,MAAA,CAAA+E,SAAA,OAAAD,0BAAA,CAAAvE,OAAA,EAAAP,MAAA,CAAA+E,SAAA,kBAAAhF,KAAA,GAAAc,MAAA,CAAAE,wBAAA,CAAAf,MAAA,CAAA+E,SAAA,kBAAA/E,MAAA,CAAA+E,SAAA,IAAA/E,MAAA","ignoreList":[]}
|
|
@@ -27,7 +27,7 @@ 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, useGeneratorFromLocalSources, engineDirectory, buildDebugOnly,
|
|
30
|
+
constructor(port, allFarmConfig, gfv, candyModulesDirectory, useGeneratorFromLocalSources, engineDirectory, buildDebugOnly, nightly) {
|
|
31
31
|
this.port = void 0;
|
|
32
32
|
this.allFarmConfig = void 0;
|
|
33
33
|
this.gfv = void 0;
|
|
@@ -42,7 +42,6 @@ class BuildFormDevServer {
|
|
|
42
42
|
this.engineDirectory = void 0;
|
|
43
43
|
this.nightly = void 0;
|
|
44
44
|
this.buildDebugOnly = void 0;
|
|
45
|
-
this.skipCodeReformatting = void 0;
|
|
46
45
|
this.webpackHybridFileSystem = void 0;
|
|
47
46
|
this.httpsAgent = new _https.Agent({
|
|
48
47
|
rejectUnauthorized: false,
|
|
@@ -56,7 +55,6 @@ class BuildFormDevServer {
|
|
|
56
55
|
this.useGeneratorFromLocalSources = useGeneratorFromLocalSources;
|
|
57
56
|
this.engineDirectory = engineDirectory;
|
|
58
57
|
this.buildDebugOnly = buildDebugOnly;
|
|
59
|
-
this.skipCodeReformatting = skipCodeReformatting;
|
|
60
58
|
this.nightly = nightly;
|
|
61
59
|
this.farmDirectory = "";
|
|
62
60
|
this.formPath = "";
|
|
@@ -117,7 +115,7 @@ class BuildFormDevServer {
|
|
|
117
115
|
this.farmDirectory = farmDirectory;
|
|
118
116
|
this.formPath = formPath;
|
|
119
117
|
this.webpackHybridFileSystem = new _WebpackHybridFileSystem.WebpackHybridFileSystem(path.join(this.formPath, "form"));
|
|
120
|
-
this.generateChain = _Observe.Observe.file(path.join(this.formPath, _WellKnownDirectories.WellKnownDirectories.FormJsonFileName)).transform(formJsonFile => (0, _ResolveFormInfo.resolveFormInfo)(formJsonFile, this.formPath, undefined, undefined, undefined, undefined,
|
|
118
|
+
this.generateChain = _Observe.Observe.file(path.join(this.formPath, _WellKnownDirectories.WellKnownDirectories.FormJsonFileName)).transform(formJsonFile => (0, _ResolveFormInfo.resolveFormInfo)(formJsonFile, this.formPath, undefined, undefined, undefined, undefined, this.nightly)).transform(async x => {
|
|
121
119
|
if (this.useGeneratorFromLocalSources) {
|
|
122
120
|
return {
|
|
123
121
|
...x,
|
|
@@ -143,7 +141,6 @@ class BuildFormDevServer {
|
|
|
143
141
|
}), 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 => {
|
|
144
142
|
try {
|
|
145
143
|
await (0, _GenerateForm.generateForm)(fi.formSourcesPath, this.farmDirectory, fi.generator, undefined, {
|
|
146
|
-
skipCodeReformatting: this.skipCodeReformatting,
|
|
147
144
|
resourcesHash: "local-hash"
|
|
148
145
|
}, this.webpackHybridFileSystem);
|
|
149
146
|
} catch (e) {
|
|
@@ -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","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;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;AA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O,EAAEC,MAAM,KAAK;MAAA,IAAAC,sBAAA;MACpC,CAAAA,sBAAA,OAAI,CAAClE,uBAAuB,cAAAkE,sBAAA,eAA5BA,sBAAA,CAA8BC,QAAQ,CAACT,QAAQ,EAAE,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,CAACzD,uBAAuB,EAAE;MAClC,MAAM,IAAA0D,iBAAK,EAAC,GAAG,CAAC;IACpB;IACA,MAAMgB,QAAQ,GAAG,MAAM,IAAAC,kBAAK,EAAC,qBAAqB,IAAI,CAACxF,IAAI,IAAIsE,QAAQ,EAAE,EAAE;MACvEmB,MAAM,EAAE,KAAK;MACbC,KAAK,EAAE,IAAI,CAAC3E;IAChB,CAAC,CAAC;IACF,IAAIwE,QAAQ,CAACI,MAAM,IAAI,GAAG,EAAE;MACxB,MAAMC,YAAY,GAAG,MAAML,QAAQ,CAACM,IAAI,CAAC,CAAC;MAC1C,MAAM,IAAI/D,KAAK,CAAC8D,YAAY,CAAC;IACjC;IACA,OAAOL,QAAQ,CAACO,IAAI;EACxB;EAEQzD,WAAWA,CAAC1D,CAAgB,EAAU;IAC1C,IAAIA,CAAC,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":[]}
|
|
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","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 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 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.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 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 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;AAC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,CAAC,EAAE;EACjB;AACJ;AAACoH,OAAA,CAAAjG,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -60,16 +60,6 @@ const devBuildCommandDefinition = exports.devBuildCommandDefinition = (0, _Comma
|
|
|
60
60
|
}),
|
|
61
61
|
doesNotRequireValue: true,
|
|
62
62
|
description: "Не запускать сборку runtime-движка. Для отладки результатов генерации."
|
|
63
|
-
}, {
|
|
64
|
-
name: "no-reformat",
|
|
65
|
-
doesNotRequireValue: true,
|
|
66
|
-
defaultValue: {
|
|
67
|
-
skipGeneratedCodeReformatting: false
|
|
68
|
-
},
|
|
69
|
-
parse: input => ({
|
|
70
|
-
skipGeneratedCodeReformatting: input
|
|
71
|
-
}),
|
|
72
|
-
description: "Отлючает форматирование генерируемого кода. Работает, только если версия генератора поддерживает эту опцию. Используется для ускорения сборки форм."
|
|
73
63
|
}, {
|
|
74
64
|
name: "continue-on-error",
|
|
75
65
|
doesNotRequireValue: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevBuildOptions.js","names":["_CommandBasedOptionsParser","require","_CommonOptionDefintions","devBuildCommandDefinition","exports","commandDefinition","optionsDefinition","alias","name","defaultValue","watch","parse","input","doesNotRequireValue","description","formGlobs","defaultOption","multiple","skipGeneration","skipWebPackCompilation","skipBuildEngine","
|
|
1
|
+
{"version":3,"file":"DevBuildOptions.js","names":["_CommandBasedOptionsParser","require","_CommonOptionDefintions","devBuildCommandDefinition","exports","commandDefinition","optionsDefinition","alias","name","defaultValue","watch","parse","input","doesNotRequireValue","description","formGlobs","defaultOption","multiple","skipGeneration","skipWebPackCompilation","skipBuildEngine","continueOnError","buildDebugOnly","buildCandyWidget","devModeOption","logVerbosityOption","detailedDescription","trim","examples"],"sources":["../../../../../src/CLICommands/DevBuild/DevBuildOptions.ts"],"sourcesContent":["import { commandDefinition, optionsDefinition } from \"../../Commons/Options/CommandBasedOptionsParser\";\nimport { CommonOptions } from \"../CommonOptions/CommonOptions\";\nimport { devModeOption, logVerbosityOption } from \"../CommonOptions/CommonOptionDefintions\";\n\nexport interface DevelopmentBuildOptions extends CommonOptions {\n watch: boolean;\n formGlobs: string[];\n skipGeneration: boolean;\n skipBuildEngine: boolean;\n skipWebPackCompilation: boolean;\n buildDebugOnly: boolean;\n continueOnError: boolean;\n buildCandyWidget: boolean;\n}\n\nexport const devBuildCommandDefinition = commandDefinition<\"dev-build\", DevelopmentBuildOptions>(\n \"dev-build\",\n \"dev-build\",\n optionsDefinition(\n {\n alias: \"w\",\n name: \"watch\",\n defaultValue: { watch: false },\n parse: input => ({ watch: input }),\n doesNotRequireValue: true,\n description:\n \"Watch-режим. Выполняет сборку форм, а затем пересобирает при изменениях. В том числе движка, генератора и статических ресурсов.\",\n },\n {\n alias: \"g\",\n name: \"gfvs\",\n defaultValue: { formGlobs: [] },\n parse: (input: string[]) => ({ formGlobs: input }),\n defaultOption: true,\n multiple: true,\n description: \"Одна или несколько GFV или GFV-масок для пересобрки.\",\n },\n {\n alias: \"n\",\n name: \"skip-generation\",\n defaultValue: { skipGeneration: false },\n parse: (input: boolean) => ({ skipGeneration: input }),\n doesNotRequireValue: true,\n description:\n \"Не выполнять генарцию формы из сахара, будет выполняться только компиляция исходников формы из каталога форм.\",\n },\n {\n name: \"skip-webpack\",\n defaultValue: { skipWebPackCompilation: false },\n parse: (input: boolean) => ({ skipWebPackCompilation: input }),\n doesNotRequireValue: true,\n description: \"Не запускать компиляцию сгенерированного кода. Для отладки результатов генерации.\",\n },\n {\n name: \"skip-engine\",\n defaultValue: { skipBuildEngine: false },\n parse: (input: boolean) => ({ skipBuildEngine: input }),\n doesNotRequireValue: true,\n description: \"Не запускать сборку runtime-движка. Для отладки результатов генерации.\",\n },\n {\n name: \"continue-on-error\",\n doesNotRequireValue: true,\n defaultValue: { continueOnError: false },\n parse: (input: boolean) => ({ continueOnError: input }),\n description: \"Не генерирует код ошибки в случае ошибки при генерации или компиляции формы.\",\n },\n {\n alias: \"d\",\n name: \"debug-only\",\n defaultValue: { buildDebugOnly: false },\n parse: (input: boolean) => ({ buildDebugOnly: input }),\n doesNotRequireValue: true,\n description:\n \"Собирать только debug-сборки движка и форм. \" +\n \"ВНИМАНИЕ: при работе в браузере необходимо использовать параметр ?debug=true\",\n },\n {\n name: \"build-candy-widget\",\n doesNotRequireValue: true,\n defaultValue: { buildCandyWidget: false },\n parse: (input: boolean) => ({ buildCandyWidget: input }),\n description: \"Собирать candy-виджет\",\n },\n devModeOption,\n logVerbosityOption\n ),\n {\n description: \"Выполняет сборку форм с ипользованием локальных исходников движка и генератора.\",\n detailedDescription: `\nВыполняет сборку форм с ипользованием локальных исходников движка и генератора.\n\n### **ВАЖНО**\nЭта команда собирает выполняет сборку форм в каталог ресурсов, но результаты сборки не являеются корректными для выкатывания в продакшен.\n`.trim(),\n examples: `\n### Написание и просмотр форм\n\nВ каталоге candy.farm запустить команды\n\n\\`\\`\\`\ncandy build 123456 -w\n\\`\\`\\`\n\n\\`\\`\\`\ncandy local-server\n\\`\\`\\`\n\n* Переход на url http://localhost:9080/123456/form -- создаст черновик и откроет редактор\n* Inner черновиков находится в каталоге candy.resources/.data\n\n### Сборка формы для релиза\n\n\\`\\`\\`\ncandy build 123456\n\\`\\`\\`\n\n### Переключение и сборка формы на использование последней стабильной\n\n\\`\\`\\`\ncandy build 123456 --use-last-stable-version\n\\`\\`\\`\n\nЗатем можно использовать пункт 'Написание и просмотр форм'\n\n### Отладка форм с локальным движком\n\nВ каталоге candy.farm запустить команды\n\n\\`\\`\\`\ncandy dev-build 123456 -w\n\\`\\`\\`\n\n\\`\\`\\`\ncandy local-server\n\\`\\`\\`\n\n* Переход на url http://localhost:9080/123456/form -- создаст черновик и откроет редактор\n* Inner черновиков находится в каталоге candy.resources/.data\n\n### Разработка и отладка движка\n\nВ этом случае удобно использовать сборку только отладочных скриптов.\n\n\\`\\`\\`\ncandy dev-build 123456 --watch --debug-only\n\\`\\`\\`\n\n\\`\\`\\`\ncandy local-server --redirect-to-debug-scripts\n\\`\\`\\`\n\n* Переход на url http://localhost:9080/123456/form -- создаст черновик и откроет редактор\n* Inner черновиков находится в каталоге candy.resources/.data\n`.trim(),\n }\n);\n"],"mappings":";;;;;;AAAA,IAAAA,0BAAA,GAAAC,OAAA;AAEA,IAAAC,uBAAA,GAAAD,OAAA;AAaO,MAAME,yBAAyB,GAAAC,OAAA,CAAAD,yBAAA,GAAG,IAAAE,4CAAiB,EACtD,WAAW,EACX,WAAW,EACX,IAAAC,4CAAiB,EACb;EACIC,KAAK,EAAE,GAAG;EACVC,IAAI,EAAE,OAAO;EACbC,YAAY,EAAE;IAAEC,KAAK,EAAE;EAAM,CAAC;EAC9BC,KAAK,EAAEC,KAAK,KAAK;IAAEF,KAAK,EAAEE;EAAM,CAAC,CAAC;EAClCC,mBAAmB,EAAE,IAAI;EACzBC,WAAW,EACP;AACR,CAAC,EACD;EACIP,KAAK,EAAE,GAAG;EACVC,IAAI,EAAE,MAAM;EACZC,YAAY,EAAE;IAAEM,SAAS,EAAE;EAAG,CAAC;EAC/BJ,KAAK,EAAGC,KAAe,KAAM;IAAEG,SAAS,EAAEH;EAAM,CAAC,CAAC;EAClDI,aAAa,EAAE,IAAI;EACnBC,QAAQ,EAAE,IAAI;EACdH,WAAW,EAAE;AACjB,CAAC,EACD;EACIP,KAAK,EAAE,GAAG;EACVC,IAAI,EAAE,iBAAiB;EACvBC,YAAY,EAAE;IAAES,cAAc,EAAE;EAAM,CAAC;EACvCP,KAAK,EAAGC,KAAc,KAAM;IAAEM,cAAc,EAAEN;EAAM,CAAC,CAAC;EACtDC,mBAAmB,EAAE,IAAI;EACzBC,WAAW,EACP;AACR,CAAC,EACD;EACIN,IAAI,EAAE,cAAc;EACpBC,YAAY,EAAE;IAAEU,sBAAsB,EAAE;EAAM,CAAC;EAC/CR,KAAK,EAAGC,KAAc,KAAM;IAAEO,sBAAsB,EAAEP;EAAM,CAAC,CAAC;EAC9DC,mBAAmB,EAAE,IAAI;EACzBC,WAAW,EAAE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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAACD,IAAI,CAAC;AACH,CACJ,CAAC","ignoreList":[]}
|
|
@@ -56,7 +56,7 @@ async function runDevBuild(context, options, engineDirectory, resourcesDirectory
|
|
|
56
56
|
const formDirPath = _path.default.join(repositoryRoot, formRelativePath);
|
|
57
57
|
const formSchemasDirPath = _path.default.join(formDirPath, "schemas");
|
|
58
58
|
const rngSchemaMask = `*${(0, _GetRngSchemaFileExtension.getRngSchemaFileExtension)(formSchemasDirPath, gfv)}`;
|
|
59
|
-
return _Observe.Observe.file(_path.default.join(formDirPath, _WellKnownDirectories.WellKnownDirectories.FormJsonFileName)).transform(formJsonFile => (0, _ResolveFormInfo.resolveFormInfo)(formJsonFile, formDirPath
|
|
59
|
+
return _Observe.Observe.file(_path.default.join(formDirPath, _WellKnownDirectories.WellKnownDirectories.FormJsonFileName)).transform(formJsonFile => (0, _ResolveFormInfo.resolveFormInfo)(formJsonFile, formDirPath)).transform(async x => ({
|
|
60
60
|
...x,
|
|
61
61
|
generatorSource: (0, _PublishedVersionUtils.resolveLocalGeneratorSource)(engineDirectory),
|
|
62
62
|
engineSource: (0, _PublishedVersionUtils.resolveLocalEngineSource)(engineDirectory)
|
|
@@ -65,21 +65,50 @@ 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)
|
|
68
|
+
dependenciesHash: fi.mode === _ResolveFormInfo.FormBuildMode.NormalBuild ? await fi.generator.getAllDependenciesHash(formDirPath, farmDirectory) : ""
|
|
69
69
|
})).do(async fi => {
|
|
70
|
-
if (options.skipGeneration) {
|
|
70
|
+
if (options.skipGeneration || fi.mode !== _ResolveFormInfo.FormBuildMode.NormalBuild) {
|
|
71
71
|
return undefined;
|
|
72
72
|
}
|
|
73
73
|
return (0, _GenerateForm.generateForm)(fi.formSourcesPath, farmDirectory, fi.generator, undefined, {
|
|
74
|
-
skipCodeReformatting: options.skipGeneratedCodeReformatting,
|
|
75
74
|
resourcesHash: fi.dependenciesHash
|
|
76
75
|
});
|
|
77
76
|
}).attach(async () => devBuildOptions.watch ? _Observe.Observe.files(_path.default.join(formDirPath, "form"), "**/*") : _Observe.Observe.value(_path.default.join(formDirPath, "form"))).do(async fi => {
|
|
78
|
-
if (options.skipWebPackCompilation) {
|
|
77
|
+
if (options.skipWebPackCompilation || fi.mode !== _ResolveFormInfo.FormBuildMode.NormalBuild) {
|
|
79
78
|
return undefined;
|
|
80
79
|
}
|
|
81
80
|
return (0, _CompileForm.compileForm)(fi.formName, formDirPath, resourcesDirectory, fi.dependenciesHash, options.buildDebugOnly, undefined, false);
|
|
82
|
-
}).do(
|
|
81
|
+
}).do(async fi => {
|
|
82
|
+
if (fi.mode !== _ResolveFormInfo.FormBuildMode.NormalBuild) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
await (0, _WriteFLangNormalizationFiles.writeFLangNormalizationFiles)(fi.formName, formDirPath, resourcesDirectory);
|
|
86
|
+
}).do(async fi => {
|
|
87
|
+
if (fi.mode !== _ResolveFormInfo.FormBuildMode.NormalBuild) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
await (0, _WriteKClangFiles.writeKClangFiles)(fi.formName, formDirPath, resourcesDirectory);
|
|
91
|
+
}).do(async fi => {
|
|
92
|
+
if (fi.mode !== _ResolveFormInfo.FormBuildMode.NormalBuild) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
await (0, _WriteExtendedSchemaFiles.writeExtendedSchemaFiles)(fi.formName, formDirPath, resourcesDirectory);
|
|
96
|
+
}).do(async fi => {
|
|
97
|
+
if (fi.mode !== _ResolveFormInfo.FormBuildMode.NormalBuild) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
await (0, _WriteAttachmentPathFiles.writeAttachmentPathFiles)(fi.formName, formDirPath, resourcesDirectory);
|
|
101
|
+
}).do(async fi => {
|
|
102
|
+
if (fi.mode !== _ResolveFormInfo.FormBuildMode.NormalBuild) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
await (0, _WriteAttachmentPathByGfvFiles.writeAttachmentPathByGfvFiles)(fi.formName, formDirPath, resourcesDirectory);
|
|
106
|
+
}).do(async fi => {
|
|
107
|
+
if (fi.mode !== _ResolveFormInfo.FormBuildMode.NormalBuild) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
await (0, _WriteFormMeta.writeFormMeta)(resourcesDirectory, gfv, fi.engineSource, fi.dependenciesHash, fi.themes, fi.useServerSideNormalization);
|
|
111
|
+
}).attach(async fi => _Observe.Observe.files(_path.default.join(fi.formSourcesPath, "schemas"), rngSchemaMask).do(x => _FSTask.FSTask.copyRecursively((0, _StaticLogger.getLogger)().withPrefix("SCHEMAS"), x, _path.default.join(resourcesDirectory, "schemas")))).attach(async fi => _Observe.Observe.files(_path.default.join(fi.formSourcesPath, "converters"), "*").do(x => _FSTask.FSTask.copyRecursively((0, _StaticLogger.getLogger)().withPrefix("CONVERTERS"), x, _path.default.join(resourcesDirectory, "converters")))).attach(async fi => _Observe.Observe.files(_path.default.join(fi.formSourcesPath, "mergers"), "*").do(x => _FSTask.FSTask.copyRecursively((0, _StaticLogger.getLogger)().withPrefix("MERGERS"), x, _path.default.join(resourcesDirectory, "mergers")))).attach(async fi => _Observe.Observe.files(_path.default.join(fi.formSourcesPath, "normalize"), "*.xml").do(x => _FSTask.FSTask.copyRecursively((0, _StaticLogger.getLogger)().withPrefix("NORMALIZE"), x, _path.default.join(resourcesDirectory, "normalize")))).attach(async fi => _Observe.Observe.files(_path.default.join(fi.formSourcesPath, "patch"), "*.xslt").do(x => _FSTask.FSTask.copyRecursively((0, _StaticLogger.getLogger)().withPrefix("PATCH"), x, _path.default.join(resourcesDirectory, "patch")))).attach(async fi => _Observe.Observe.files(_path.default.join(fi.formSourcesPath, "map"), "*.xml").do(x => _FSTask.FSTask.copyRecursively((0, _StaticLogger.getLogger)().withPrefix("MAP"), x, _path.default.join(resourcesDirectory, "map")))).attach(async fi => _Observe.Observe.files(_path.default.join(fi.formSourcesPath, "unmap"), "*.xml").do(x => _FSTask.FSTask.copyRecursively((0, _StaticLogger.getLogger)().withPrefix("UNMAP"), x, _path.default.join(resourcesDirectory, "unmap"))));
|
|
83
112
|
};
|
|
84
113
|
const buildFormsChain = _Observe.Observe.fixedFormDirectories(formInfos.map(x => _path.default.relative(repositoryRoot, x.formPath))).splitToParallelChains(x => x, x => x, createChainForForm);
|
|
85
114
|
if (devBuildOptions.watch) {
|