@kontur.candy/tools 2.234.0 → 2.236.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/distr/Tools/src/CLICommands/BuildServer/ResourcesControllers/BuildServerBuildFormsController.js +8 -3
- package/distr/Tools/src/CLICommands/BuildServer/ResourcesControllers/BuildServerBuildFormsController.js.map +1 -1
- package/distr/Tools/src/FormWebpackConfiguration/createFormWebpackConfiguration.js +37 -22
- package/distr/Tools/src/FormWebpackConfiguration/createFormWebpackConfiguration.js.map +1 -1
- package/package.json +3 -2
|
@@ -18,10 +18,10 @@ var _SingletonController = require("../../../Commons/HttpServer/ExpressWrapper/S
|
|
|
18
18
|
var _WellKnownDirectories = require("../../../../../Common/WellKnownDirectories");
|
|
19
19
|
var _BuildFormDevServer = require("./DevServers/BuildFormDevServer");
|
|
20
20
|
var _FarmDirectory = require("./Directories/FarmDirectory");
|
|
21
|
-
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _class;
|
|
21
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _class;
|
|
22
22
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
23
23
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
24
|
-
let BuildServerBuildFormsController = exports.BuildServerBuildFormsController = (_dec = (0, _Methods.httpGet)("/:update.hot-update.json", _Results.httpReturn.StreamWithMime("application/json"), (0, _Params.httpUrlParam)("update", _Params.httpType.String)), _dec2 = (0, _Methods.httpGet)("/:update.hot-update.js", _Results.httpReturn.StreamWithMime("application/javascript"), (0, _Params.httpUrlParam)("update", _Params.httpType.String)), _dec3 = (0, _Methods.httpGet)("/:update.hot-update.js.map", _Results.httpReturn.StreamWithMime("application/json"), (0, _Params.httpUrlParam)("update", _Params.httpType.String)), _dec4 = (0, _Methods.httpGet)(/^\/public\/scripts\/(((\d{6,})(.[\w\-]*)?(.min)?).js)$/i, _Results.httpReturn.StreamWithMime("application/javascript"), (0, _Params.httpUrlParam)("0", _Params.httpType.String), (0, _Params.httpUrlParam)("1", _Params.httpType.String), (0, _Params.httpUrlParam)("2", _Params.httpType.String)), _dec5 = (0, _Methods.httpGet)(/^\/public\/styles\/(((\d{6,})(.[\w\-]*)?(.min)?).css)$/i, _Results.httpReturn.StreamWithMime("text/css"), (0, _Params.httpUrlParam)("0", _Params.httpType.String), (0, _Params.httpUrlParam)("1", _Params.httpType.String), (0, _Params.httpUrlParam)("2", _Params.httpType.String), (0, _Params.httpUrlParam)("3", _Params.httpType.String)), _dec6 = (0, _Methods.httpGet)("/public/images/:filename", _Results.httpReturn.Stream, (0, _Params.httpUrlParam)("filename", _Params.httpType.String)), _dec7 = (0, _Methods.httpGet)("/normalize/:gfv.All.kclang", _Results.httpReturn.Stream, (0, _Params.httpUrlParam)("gfv", _Params.httpType.String)), _dec8 = (0, _Methods.httpGet)("/normalize/:gfv.:normalizerId.flang", _Results.httpReturn.Stream, (0, _Params.httpUrlParam)("gfv", _Params.httpType.String), (0, _Params.httpUrlParam)("normalizerId", _Params.httpType.String)), (_class = class BuildServerBuildFormsController extends _SingletonController.SingletonController {
|
|
24
|
+
let BuildServerBuildFormsController = exports.BuildServerBuildFormsController = (_dec = (0, _Methods.httpGet)("/:update.hot-update.json", _Results.httpReturn.StreamWithMime("application/json"), (0, _Params.httpUrlParam)("update", _Params.httpType.String)), _dec2 = (0, _Methods.httpGet)("/:update.hot-update.js", _Results.httpReturn.StreamWithMime("application/javascript"), (0, _Params.httpUrlParam)("update", _Params.httpType.String)), _dec3 = (0, _Methods.httpGet)("/:update.hot-update.js.map", _Results.httpReturn.StreamWithMime("application/json"), (0, _Params.httpUrlParam)("update", _Params.httpType.String)), _dec4 = (0, _Methods.httpGet)(/^\/public\/scripts\/(((\d{6,})(.[\w\-]*)?(.min)?).js)$/i, _Results.httpReturn.StreamWithMime("application/javascript"), (0, _Params.httpUrlParam)("0", _Params.httpType.String), (0, _Params.httpUrlParam)("1", _Params.httpType.String), (0, _Params.httpUrlParam)("2", _Params.httpType.String)), _dec5 = (0, _Methods.httpGet)(/^\/public\/styles\/(((\d{6,})(.[\w\-]*)?(.min)?).css)$/i, _Results.httpReturn.StreamWithMime("text/css"), (0, _Params.httpUrlParam)("0", _Params.httpType.String), (0, _Params.httpUrlParam)("1", _Params.httpType.String), (0, _Params.httpUrlParam)("2", _Params.httpType.String), (0, _Params.httpUrlParam)("3", _Params.httpType.String)), _dec6 = (0, _Methods.httpGet)("/public/images/:filename", _Results.httpReturn.Stream, (0, _Params.httpUrlParam)("filename", _Params.httpType.String)), _dec7 = (0, _Methods.httpGet)("/normalize/:gfv.All.kclang", _Results.httpReturn.Stream, (0, _Params.httpUrlParam)("gfv", _Params.httpType.String)), _dec8 = (0, _Methods.httpGet)("/schemas/:gfv.extendedSchema.json", _Results.httpReturn.Stream, (0, _Params.httpUrlParam)("gfv", _Params.httpType.String)), _dec9 = (0, _Methods.httpGet)("/normalize/:gfv.:normalizerId.flang", _Results.httpReturn.Stream, (0, _Params.httpUrlParam)("gfv", _Params.httpType.String), (0, _Params.httpUrlParam)("normalizerId", _Params.httpType.String)), (_class = class BuildServerBuildFormsController extends _SingletonController.SingletonController {
|
|
25
25
|
constructor(allFarmConfig, candyModulesDirectory, useGeneratorFromLocalSources, engineDirectory, buildDebugOnly, nightly = false) {
|
|
26
26
|
super();
|
|
27
27
|
this.allFarmDirectory = void 0;
|
|
@@ -77,6 +77,11 @@ let BuildServerBuildFormsController = exports.BuildServerBuildFormsController =
|
|
|
77
77
|
const stream = await buildFormDevServer.getGeneratedFileAsStream(`All.kclang`);
|
|
78
78
|
return new _StreamResultHandler.StreamResult(stream);
|
|
79
79
|
}
|
|
80
|
+
async getExtendedSchemaFile(gfv) {
|
|
81
|
+
const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);
|
|
82
|
+
const stream = await buildFormDevServer.getGeneratedFileAsStream(`extendedSchema.json`);
|
|
83
|
+
return new _StreamResultHandler.StreamResult(stream);
|
|
84
|
+
}
|
|
80
85
|
async getCustomFLangNormalizeFile(gfv, normalizerId) {
|
|
81
86
|
const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);
|
|
82
87
|
const stream = await buildFormDevServer.getGeneratedFileAsStream(`${normalizerId}.flang`);
|
|
@@ -148,5 +153,5 @@ let BuildServerBuildFormsController = exports.BuildServerBuildFormsController =
|
|
|
148
153
|
}
|
|
149
154
|
return devServer;
|
|
150
155
|
}
|
|
151
|
-
}, ((0, _applyDecoratedDescriptor2.default)(_class.prototype, "getDevServerUpdateJson", [_dec], Object.getOwnPropertyDescriptor(_class.prototype, "getDevServerUpdateJson"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getDevServerUpdateJs", [_dec2], Object.getOwnPropertyDescriptor(_class.prototype, "getDevServerUpdateJs"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getDevServerUpdateJsMap", [_dec3], Object.getOwnPropertyDescriptor(_class.prototype, "getDevServerUpdateJsMap"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getFormScript", [_dec4], Object.getOwnPropertyDescriptor(_class.prototype, "getFormScript"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getFormStyle", [_dec5], Object.getOwnPropertyDescriptor(_class.prototype, "getFormStyle"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getFormImages", [_dec6], Object.getOwnPropertyDescriptor(_class.prototype, "getFormImages"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getAllKclangFile", [_dec7], Object.getOwnPropertyDescriptor(_class.prototype, "getAllKclangFile"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "
|
|
156
|
+
}, ((0, _applyDecoratedDescriptor2.default)(_class.prototype, "getDevServerUpdateJson", [_dec], Object.getOwnPropertyDescriptor(_class.prototype, "getDevServerUpdateJson"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getDevServerUpdateJs", [_dec2], Object.getOwnPropertyDescriptor(_class.prototype, "getDevServerUpdateJs"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getDevServerUpdateJsMap", [_dec3], Object.getOwnPropertyDescriptor(_class.prototype, "getDevServerUpdateJsMap"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getFormScript", [_dec4], Object.getOwnPropertyDescriptor(_class.prototype, "getFormScript"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getFormStyle", [_dec5], Object.getOwnPropertyDescriptor(_class.prototype, "getFormStyle"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getFormImages", [_dec6], Object.getOwnPropertyDescriptor(_class.prototype, "getFormImages"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getAllKclangFile", [_dec7], Object.getOwnPropertyDescriptor(_class.prototype, "getAllKclangFile"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getExtendedSchemaFile", [_dec8], Object.getOwnPropertyDescriptor(_class.prototype, "getExtendedSchemaFile"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "getCustomFLangNormalizeFile", [_dec9], Object.getOwnPropertyDescriptor(_class.prototype, "getCustomFLangNormalizeFile"), _class.prototype)), _class));
|
|
152
157
|
//# sourceMappingURL=BuildServerBuildFormsController.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuildServerBuildFormsController.js","names":["path","_interopRequireWildcard","require","_mimeTypes","_interopRequireDefault","_ResolveFormInfo","_Methods","_NotFoundWebError","_Params","_Results","_StreamResultHandler","_SingletonController","_WellKnownDirectories","_BuildFormDevServer","_FarmDirectory","_dec","_dec2","_dec3","_dec4","_dec5","_dec6","_dec7","_dec8","_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","getCustomFLangNormalizeFile","normalizerId","filename","mimeType","devServer","values","undefined","NotFoundWebError","getAllAttachmentPathFileNames","Promise","all","getAllGfvs","flat","getAttachmentPathsFileContent","resultStream","getAttachmentPathsWithGfvsFileContent","getAllNormalizationFileNames","result","gfvInfos","getAllGfvWithLocations","formPath","_formConfig$settings$","_formConfig$settings","formConfig","readFormConfig","join","WellKnownDirectories","FormJsonFileName","useServerSideFLangNormalization","settings","push","getNormalizationFileContent","_formConfig$settings$2","_formConfig$settings2","gfvInfo","find","x","BuildFormDevServer","start","_applyDecoratedDescriptor2","prototype"],"sources":["../../../../../../src/CLICommands/BuildServer/ResourcesControllers/BuildServerBuildFormsController.ts"],"sourcesContent":["import * as path from \"path\";\n\nimport { Express } from \"express\";\nimport mime from \"mime-types\";\nimport { FarmConfig } from \"Tools/src/CandyCLI\";\n\nimport { readFormConfig } from \"../../../BuildTasks/ResolveFormInfo\";\nimport { httpGet } from \"../../../Commons/HttpServer/AttributeRouting/Methods\";\nimport { NotFoundWebError } from \"../../../Commons/HttpServer/AttributeRouting/NotFoundWebError\";\nimport { httpType, httpUrlParam } from \"../../../Commons/HttpServer/AttributeRouting/Params\";\nimport { httpReturn } from \"../../../Commons/HttpServer/AttributeRouting/Results\";\nimport { StreamResult } from \"../../../Commons/HttpServer/AttributeRouting/Results/StreamResultHandler\";\nimport { SingletonController } from \"../../../Commons/HttpServer/ExpressWrapper/SingletonController\";\nimport { WellKnownDirectories } from \"../../../../../Common/WellKnownDirectories\";\n\nimport { BuildFormDevServer } from \"./DevServers/BuildFormDevServer\";\nimport { FarmDirectory } from \"./Directories/FarmDirectory\";\nimport { IGeneratedServerSideSourcesProvider } from \"./IGeneratedServerSideSourcesProvider\";\n\nexport class BuildServerBuildFormsController\n extends SingletonController\n implements IGeneratedServerSideSourcesProvider\n{\n private allFarmDirectory: FarmDirectory[];\n private readonly allFarmDirectoryPath: string[];\n private nextFreePort = 12001;\n private readonly devServers: { [gfv: string]: undefined | BuildFormDevServer } = {};\n private readonly candyModulesDirectory: string;\n private readonly allFarmConfig: FarmConfig[];\n private readonly useGeneratorFromLocalSources: boolean;\n private readonly engineDirectory: string;\n private readonly nightly: boolean;\n private readonly buildDebugOnly: boolean;\n\n public constructor(\n allFarmConfig: FarmConfig[],\n candyModulesDirectory: string,\n useGeneratorFromLocalSources: boolean,\n engineDirectory: string,\n buildDebugOnly: boolean,\n nightly: boolean = false\n ) {\n super();\n this.nightly = nightly;\n this.allFarmDirectory = allFarmConfig.map(farm => new FarmDirectory(farm.farmDirectory));\n this.allFarmDirectoryPath = allFarmConfig.map(farm => farm.farmDirectory);\n this.candyModulesDirectory = candyModulesDirectory;\n this.allFarmConfig = allFarmConfig;\n this.useGeneratorFromLocalSources = useGeneratorFromLocalSources;\n this.engineDirectory = engineDirectory;\n this.buildDebugOnly = buildDebugOnly;\n }\n\n public async setupMiddleware(expressApplication: Express) {\n expressApplication.use(\"/force-gfvs\", (_, __, next) => {\n this.resetAllFarmDirectories();\n next();\n });\n }\n\n private resetAllFarmDirectories() {\n this.allFarmDirectory = this.allFarmConfig.map(i => new FarmDirectory(i.farmDirectory));\n }\n\n @httpGet(\n \"/:update.hot-update.json\",\n httpReturn.StreamWithMime(\"application/json\"),\n httpUrlParam(\"update\", httpType.String)\n )\n public async getDevServerUpdateJson(updateName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(`static/${updateName}.hot-update.json`);\n }\n\n @httpGet(\n \"/:update.hot-update.js\",\n httpReturn.StreamWithMime(\"application/javascript\"),\n httpUrlParam(\"update\", httpType.String)\n )\n public async getDevServerUpdateJs(updateName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(`static/${updateName}.hot-update.js`);\n }\n\n @httpGet(\n \"/:update.hot-update.js.map\",\n httpReturn.StreamWithMime(\"application/json\"),\n httpUrlParam(\"update\", httpType.String)\n )\n public async getDevServerUpdateJsMap(updateName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(`static/${updateName}.hot-update.js.map`);\n }\n\n @httpGet(\n /^\\/public\\/scripts\\/(((\\d{6,})(.[\\w\\-]*)?(.min)?).js)$/i,\n httpReturn.StreamWithMime(\"application/javascript\"),\n httpUrlParam(\"0\", httpType.String),\n httpUrlParam(\"1\", httpType.String),\n httpUrlParam(\"2\", httpType.String)\n )\n public async getFormScript(fileName: string, _fileNameWithoutExt: string, gfv: string): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n return new StreamResult(await buildFormDevServer.getFileAsStream(`static/public/scripts/${fileName}`));\n }\n\n @httpGet(\n /^\\/public\\/styles\\/(((\\d{6,})(.[\\w\\-]*)?(.min)?).css)$/i,\n httpReturn.StreamWithMime(\"text/css\"),\n httpUrlParam(\"0\", httpType.String),\n httpUrlParam(\"1\", httpType.String),\n httpUrlParam(\"2\", httpType.String),\n httpUrlParam(\"3\", httpType.String)\n )\n public async getFormStyle(\n fileName: string,\n _fileNameWithoutExt: string,\n gfv: string,\n theme: undefined | string\n ): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n return new StreamResult(\n await buildFormDevServer.getFileAsStream(`static/public/styles/${fileName.replace(theme ?? \"\", \"\")}`)\n );\n }\n\n @httpGet(\"/public/images/:filename\", httpReturn.Stream, httpUrlParam(\"filename\", httpType.String))\n public async getFormImages(fileName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(\n `static/public/images/${fileName}`,\n mime.lookup(fileName)\n );\n }\n\n @httpGet(\"/normalize/:gfv.All.kclang\", httpReturn.Stream, httpUrlParam(\"gfv\", httpType.String))\n public async getAllKclangFile(gfv: string): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const stream = await buildFormDevServer.getGeneratedFileAsStream(`All.kclang`);\n return new StreamResult(stream);\n }\n\n @httpGet(\n \"/normalize/:gfv.:normalizerId.flang\",\n httpReturn.Stream,\n httpUrlParam(\"gfv\", httpType.String),\n httpUrlParam(\"normalizerId\", httpType.String)\n )\n public async getCustomFLangNormalizeFile(gfv: string, normalizerId: string): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const stream = await buildFormDevServer.getGeneratedFileAsStream(`${normalizerId}.flang`);\n return new StreamResult(stream);\n }\n\n private async getFirstExistsFileAsStreamFromDevServer(filename: string, mimeType?: string | false) {\n for (const devServer of Object.values(this.devServers)) {\n if (devServer != undefined) {\n try {\n return new StreamResult(await devServer.getFileAsStream(filename), mimeType);\n } catch {\n // try next server\n }\n }\n }\n throw new NotFoundWebError(\"File not found\", true);\n }\n\n public async getAllAttachmentPathFileNames(): Promise<string[]> {\n return (await Promise.all(this.allFarmDirectory.map(i => i.getAllGfvs()))).flat().map(gfv => `${gfv}.json`);\n }\n\n public async getAttachmentPathsFileContent(gfv: string): Promise<NodeJS.ReadableStream> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const resultStream = await buildFormDevServer.getGeneratedFileAsStream(`AttachmentPaths.json`);\n return resultStream;\n }\n\n public async getAttachmentPathsWithGfvsFileContent(gfv: string): Promise<NodeJS.ReadableStream> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const resultStream = await buildFormDevServer.getGeneratedFileAsStream(`AttachmentPathsWithGfvs.json`);\n return resultStream;\n }\n\n public async getAllNormalizationFileNames(): Promise<string[]> {\n const result: string[] = [];\n const gfvInfos = (await Promise.all(this.allFarmDirectory.map(i => i.getAllGfvWithLocations()))).flat();\n for (const { gfv, formPath } of gfvInfos) {\n const formConfig = await readFormConfig(path.join(formPath, WellKnownDirectories.FormJsonFileName));\n const useServerSideFLangNormalization = formConfig.settings?.useServerSideFLangNormalization ?? false;\n if (useServerSideFLangNormalization) {\n result.push(`${gfv}.normalize`);\n }\n }\n return result;\n }\n\n public async getNormalizationFileContent(gfv: string): Promise<NodeJS.ReadableStream | null> {\n const gfvInfos = (await Promise.all(this.allFarmDirectory.map(i => i.getAllGfvWithLocations()))).flat();\n const gfvInfo = gfvInfos.find(x => x.gfv === gfv);\n if (gfvInfo == null) {\n return null;\n }\n const formConfig = await readFormConfig(path.join(gfvInfo.formPath, WellKnownDirectories.FormJsonFileName));\n const useServerSideFLangNormalization = formConfig.settings?.useServerSideFLangNormalization ?? false;\n if (!useServerSideFLangNormalization) {\n return null;\n }\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const resultStream = await buildFormDevServer.getGeneratedFileAsStream(`ServerSide.normalize`);\n return resultStream;\n }\n\n private async getOrCreateBuildFormDevServer(gfv: string): Promise<BuildFormDevServer> {\n let devServer = this.devServers[gfv];\n if (devServer == undefined) {\n devServer = new BuildFormDevServer(\n this.nextFreePort++,\n this.allFarmDirectoryPath,\n gfv,\n this.candyModulesDirectory,\n this.allFarmConfig,\n this.useGeneratorFromLocalSources,\n this.engineDirectory,\n this.buildDebugOnly,\n false,\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,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAxB,wBAAAwB,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAA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BAAA,CAAAf,MAAA,CAAAmH,SAAA,uBAAAnH,MAAA,CAAAmH,SAAA,OAAAD,0BAAA,CAAA3G,OAAA,EAAAP,MAAA,CAAAmH,SAAA,kCAAApH,KAAA,GAAAc,MAAA,CAAAE,wBAAA,CAAAf,MAAA,CAAAmH,SAAA,kCAAAnH,MAAA,CAAAmH,SAAA,IAAAnH,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","_dec9","_class","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","BuildServerBuildFormsController","exports","httpGet","httpReturn","StreamWithMime","httpUrlParam","httpType","String","Stream","SingletonController","constructor","allFarmConfig","candyModulesDirectory","useGeneratorFromLocalSources","engineDirectory","buildDebugOnly","nightly","allFarmDirectory","allFarmDirectoryPath","nextFreePort","devServers","map","farm","FarmDirectory","farmDirectory","setupMiddleware","expressApplication","use","_","__","next","resetAllFarmDirectories","getDevServerUpdateJson","updateName","getFirstExistsFileAsStreamFromDevServer","getDevServerUpdateJs","getDevServerUpdateJsMap","getFormScript","fileName","_fileNameWithoutExt","gfv","buildFormDevServer","getOrCreateBuildFormDevServer","StreamResult","getFileAsStream","getFormStyle","theme","replace","getFormImages","mime","lookup","getAllKclangFile","stream","getGeneratedFileAsStream","getExtendedSchemaFile","getCustomFLangNormalizeFile","normalizerId","filename","mimeType","devServer","values","undefined","NotFoundWebError","getAllAttachmentPathFileNames","Promise","all","getAllGfvs","flat","getAttachmentPathsFileContent","resultStream","getAttachmentPathsWithGfvsFileContent","getAllNormalizationFileNames","result","gfvInfos","getAllGfvWithLocations","formPath","_formConfig$settings$","_formConfig$settings","formConfig","readFormConfig","join","WellKnownDirectories","FormJsonFileName","useServerSideFLangNormalization","settings","push","getNormalizationFileContent","_formConfig$settings$2","_formConfig$settings2","gfvInfo","find","x","BuildFormDevServer","start","_applyDecoratedDescriptor2","prototype"],"sources":["../../../../../../src/CLICommands/BuildServer/ResourcesControllers/BuildServerBuildFormsController.ts"],"sourcesContent":["import * as path from \"path\";\n\nimport { Express } from \"express\";\nimport mime from \"mime-types\";\nimport { FarmConfig } from \"Tools/src/CandyCLI\";\n\nimport { readFormConfig } from \"../../../BuildTasks/ResolveFormInfo\";\nimport { httpGet } from \"../../../Commons/HttpServer/AttributeRouting/Methods\";\nimport { NotFoundWebError } from \"../../../Commons/HttpServer/AttributeRouting/NotFoundWebError\";\nimport { httpType, httpUrlParam } from \"../../../Commons/HttpServer/AttributeRouting/Params\";\nimport { httpReturn } from \"../../../Commons/HttpServer/AttributeRouting/Results\";\nimport { StreamResult } from \"../../../Commons/HttpServer/AttributeRouting/Results/StreamResultHandler\";\nimport { SingletonController } from \"../../../Commons/HttpServer/ExpressWrapper/SingletonController\";\nimport { WellKnownDirectories } from \"../../../../../Common/WellKnownDirectories\";\n\nimport { BuildFormDevServer } from \"./DevServers/BuildFormDevServer\";\nimport { FarmDirectory } from \"./Directories/FarmDirectory\";\nimport { IGeneratedServerSideSourcesProvider } from \"./IGeneratedServerSideSourcesProvider\";\n\nexport class BuildServerBuildFormsController\n extends SingletonController\n implements IGeneratedServerSideSourcesProvider\n{\n private allFarmDirectory: FarmDirectory[];\n private readonly allFarmDirectoryPath: string[];\n private nextFreePort = 12001;\n private readonly devServers: { [gfv: string]: undefined | BuildFormDevServer } = {};\n private readonly candyModulesDirectory: string;\n private readonly allFarmConfig: FarmConfig[];\n private readonly useGeneratorFromLocalSources: boolean;\n private readonly engineDirectory: string;\n private readonly nightly: boolean;\n private readonly buildDebugOnly: boolean;\n\n public constructor(\n allFarmConfig: FarmConfig[],\n candyModulesDirectory: string,\n useGeneratorFromLocalSources: boolean,\n engineDirectory: string,\n buildDebugOnly: boolean,\n nightly: boolean = false\n ) {\n super();\n this.nightly = nightly;\n this.allFarmDirectory = allFarmConfig.map(farm => new FarmDirectory(farm.farmDirectory));\n this.allFarmDirectoryPath = allFarmConfig.map(farm => farm.farmDirectory);\n this.candyModulesDirectory = candyModulesDirectory;\n this.allFarmConfig = allFarmConfig;\n this.useGeneratorFromLocalSources = useGeneratorFromLocalSources;\n this.engineDirectory = engineDirectory;\n this.buildDebugOnly = buildDebugOnly;\n }\n\n public async setupMiddleware(expressApplication: Express) {\n expressApplication.use(\"/force-gfvs\", (_, __, next) => {\n this.resetAllFarmDirectories();\n next();\n });\n }\n\n private resetAllFarmDirectories() {\n this.allFarmDirectory = this.allFarmConfig.map(i => new FarmDirectory(i.farmDirectory));\n }\n\n @httpGet(\n \"/:update.hot-update.json\",\n httpReturn.StreamWithMime(\"application/json\"),\n httpUrlParam(\"update\", httpType.String)\n )\n public async getDevServerUpdateJson(updateName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(`static/${updateName}.hot-update.json`);\n }\n\n @httpGet(\n \"/:update.hot-update.js\",\n httpReturn.StreamWithMime(\"application/javascript\"),\n httpUrlParam(\"update\", httpType.String)\n )\n public async getDevServerUpdateJs(updateName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(`static/${updateName}.hot-update.js`);\n }\n\n @httpGet(\n \"/:update.hot-update.js.map\",\n httpReturn.StreamWithMime(\"application/json\"),\n httpUrlParam(\"update\", httpType.String)\n )\n public async getDevServerUpdateJsMap(updateName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(`static/${updateName}.hot-update.js.map`);\n }\n\n @httpGet(\n /^\\/public\\/scripts\\/(((\\d{6,})(.[\\w\\-]*)?(.min)?).js)$/i,\n httpReturn.StreamWithMime(\"application/javascript\"),\n httpUrlParam(\"0\", httpType.String),\n httpUrlParam(\"1\", httpType.String),\n httpUrlParam(\"2\", httpType.String)\n )\n public async getFormScript(fileName: string, _fileNameWithoutExt: string, gfv: string): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n return new StreamResult(await buildFormDevServer.getFileAsStream(`static/public/scripts/${fileName}`));\n }\n\n @httpGet(\n /^\\/public\\/styles\\/(((\\d{6,})(.[\\w\\-]*)?(.min)?).css)$/i,\n httpReturn.StreamWithMime(\"text/css\"),\n httpUrlParam(\"0\", httpType.String),\n httpUrlParam(\"1\", httpType.String),\n httpUrlParam(\"2\", httpType.String),\n httpUrlParam(\"3\", httpType.String)\n )\n public async getFormStyle(\n fileName: string,\n _fileNameWithoutExt: string,\n gfv: string,\n theme: undefined | string\n ): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n return new StreamResult(\n await buildFormDevServer.getFileAsStream(`static/public/styles/${fileName.replace(theme ?? \"\", \"\")}`)\n );\n }\n\n @httpGet(\"/public/images/:filename\", httpReturn.Stream, httpUrlParam(\"filename\", httpType.String))\n public async getFormImages(fileName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(\n `static/public/images/${fileName}`,\n mime.lookup(fileName)\n );\n }\n\n @httpGet(\"/normalize/:gfv.All.kclang\", httpReturn.Stream, httpUrlParam(\"gfv\", httpType.String))\n public async getAllKclangFile(gfv: string): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const stream = await buildFormDevServer.getGeneratedFileAsStream(`All.kclang`);\n return new StreamResult(stream);\n }\n\n @httpGet(\"/schemas/:gfv.extendedSchema.json\", httpReturn.Stream, httpUrlParam(\"gfv\", httpType.String))\n public async getExtendedSchemaFile(gfv: string): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const stream = await buildFormDevServer.getGeneratedFileAsStream(`extendedSchema.json`);\n return new StreamResult(stream);\n }\n\n @httpGet(\n \"/normalize/:gfv.:normalizerId.flang\",\n httpReturn.Stream,\n httpUrlParam(\"gfv\", httpType.String),\n httpUrlParam(\"normalizerId\", httpType.String)\n )\n public async getCustomFLangNormalizeFile(gfv: string, normalizerId: string): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const stream = await buildFormDevServer.getGeneratedFileAsStream(`${normalizerId}.flang`);\n return new StreamResult(stream);\n }\n\n private async getFirstExistsFileAsStreamFromDevServer(filename: string, mimeType?: string | false) {\n for (const devServer of Object.values(this.devServers)) {\n if (devServer != undefined) {\n try {\n return new StreamResult(await devServer.getFileAsStream(filename), mimeType);\n } catch {\n // try next server\n }\n }\n }\n throw new NotFoundWebError(\"File not found\", true);\n }\n\n public async getAllAttachmentPathFileNames(): Promise<string[]> {\n return (await Promise.all(this.allFarmDirectory.map(i => i.getAllGfvs()))).flat().map(gfv => `${gfv}.json`);\n }\n\n public async getAttachmentPathsFileContent(gfv: string): Promise<NodeJS.ReadableStream> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const resultStream = await buildFormDevServer.getGeneratedFileAsStream(`AttachmentPaths.json`);\n return resultStream;\n }\n\n public async getAttachmentPathsWithGfvsFileContent(gfv: string): Promise<NodeJS.ReadableStream> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const resultStream = await buildFormDevServer.getGeneratedFileAsStream(`AttachmentPathsWithGfvs.json`);\n return resultStream;\n }\n\n public async getAllNormalizationFileNames(): Promise<string[]> {\n const result: string[] = [];\n const gfvInfos = (await Promise.all(this.allFarmDirectory.map(i => i.getAllGfvWithLocations()))).flat();\n for (const { gfv, formPath } of gfvInfos) {\n const formConfig = await readFormConfig(path.join(formPath, WellKnownDirectories.FormJsonFileName));\n const useServerSideFLangNormalization = formConfig.settings?.useServerSideFLangNormalization ?? false;\n if (useServerSideFLangNormalization) {\n result.push(`${gfv}.normalize`);\n }\n }\n return result;\n }\n\n public async getNormalizationFileContent(gfv: string): Promise<NodeJS.ReadableStream | null> {\n const gfvInfos = (await Promise.all(this.allFarmDirectory.map(i => i.getAllGfvWithLocations()))).flat();\n const gfvInfo = gfvInfos.find(x => x.gfv === gfv);\n if (gfvInfo == null) {\n return null;\n }\n const formConfig = await readFormConfig(path.join(gfvInfo.formPath, WellKnownDirectories.FormJsonFileName));\n const useServerSideFLangNormalization = formConfig.settings?.useServerSideFLangNormalization ?? false;\n if (!useServerSideFLangNormalization) {\n return null;\n }\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const resultStream = await buildFormDevServer.getGeneratedFileAsStream(`ServerSide.normalize`);\n return resultStream;\n }\n\n private async getOrCreateBuildFormDevServer(gfv: string): Promise<BuildFormDevServer> {\n let devServer = this.devServers[gfv];\n if (devServer == undefined) {\n devServer = new BuildFormDevServer(\n this.nextFreePort++,\n this.allFarmDirectoryPath,\n gfv,\n this.candyModulesDirectory,\n this.allFarmConfig,\n this.useGeneratorFromLocalSources,\n this.engineDirectory,\n this.buildDebugOnly,\n false,\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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,MAAA","ignoreList":[]}
|
|
@@ -75,28 +75,43 @@ async function createConfigVariant(options) {
|
|
|
75
75
|
}]
|
|
76
76
|
}, {
|
|
77
77
|
test: /\.jsx?$/,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
78
|
+
oneOf: [{
|
|
79
|
+
test: /(kcXmlValidationConfigurator|kcXmlAutoCalculationConfigurator|dataDeclaration)\.js$/,
|
|
80
|
+
type: "javascript/auto"
|
|
81
|
+
}, {
|
|
82
|
+
use: [{
|
|
83
|
+
loader: require.resolve("thread-loader"),
|
|
84
|
+
options: {
|
|
85
|
+
workers: 4,
|
|
86
|
+
workerParallelJobs: 10,
|
|
87
|
+
workerNodeArgs: ["--max-old-space-size=3072"]
|
|
88
|
+
}
|
|
89
|
+
}, {
|
|
90
|
+
loader: require.resolve("babel-loader"),
|
|
91
|
+
options: {
|
|
92
|
+
babelrc: false,
|
|
93
|
+
configFile: false,
|
|
94
|
+
presets: [require.resolve("@babel/preset-react"), [require.resolve("@babel/preset-env"), {
|
|
95
|
+
targets: {
|
|
96
|
+
browsers: [">0.5%", "last 2 versions", "not dead", "not IE 11"]
|
|
97
|
+
},
|
|
98
|
+
loose: true,
|
|
99
|
+
useBuiltIns: "usage",
|
|
100
|
+
corejs: 3
|
|
101
|
+
}]],
|
|
102
|
+
plugins: [[require.resolve("@babel/plugin-proposal-decorators"), {
|
|
103
|
+
legacy: true
|
|
104
|
+
}], [require.resolve("@babel/plugin-transform-class-properties"), {
|
|
105
|
+
loose: true
|
|
106
|
+
}], require.resolve("@babel/plugin-proposal-export-default-from")],
|
|
107
|
+
cacheDirectory: true
|
|
108
|
+
}
|
|
109
|
+
}],
|
|
110
|
+
resolve: {
|
|
111
|
+
fullySpecified: false
|
|
112
|
+
},
|
|
113
|
+
exclude: [/node_modules/]
|
|
114
|
+
}]
|
|
100
115
|
}, {
|
|
101
116
|
test: /\.(png|svg)$/,
|
|
102
117
|
loader: require.resolve("file-loader"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createFormWebpackConfiguration.js","names":["_path","_interopRequireDefault","require","_miniCssExtractPlugin","_webpack","_CacheAssetsPlugin","createConfigVariant","options","gfv","fileNameSuffix","mode","formPath","buildCache","buildCacheOptions","undefined","BuildCache","farmDirectory","buildCacheWebpackPlugin","createWebpackPlugin","devtoolOption","isLocalDev","target","context","output","filename","path","resourcesDirectoryPath","publicPath","resolve","alias","join","__dirname","variables","Resources","extensions","entry","devtool","cache","type","maxGenerations","module","rules","test","use","loader","MiniCssExtractPlugin","modules","localIdentName","postcssOptions","ident","plugins","overrideBrowserslist","babelrc","configFile","presets","targets","browsers","loose","legacy","fullySpecified","exclude","name","webpack","DefinePlugin","GFV","JSON","stringify","NODE_ENV","RESOURCES_HASH","resourcesHash","filter","isNotNullOrUndefined","input","createConfig","result","modes","push","Promise","all"],"sources":["../../../../src/FormWebpackConfiguration/createFormWebpackConfiguration.ts"],"sourcesContent":["import path from \"path\";\n\nimport MiniCssExtractPlugin from \"mini-css-extract-plugin\";\nimport webpack, { Configuration } from \"webpack\";\n\nimport { BuildCache, FormBuildCacheOptions } from \"./CacheAssetsPlugin\";\n\ntype BuildMode = \"production\" | \"development\";\n\ninterface CreateWebpackConfigurationVariantOptions {\n gfv: string;\n resourcesHash: string;\n formPath: string;\n mode?: BuildMode;\n isLocalDev?: boolean;\n resourcesDirectoryPath: string;\n buildCacheOptions?: FormBuildCacheOptions;\n}\n\nasync function createConfigVariant(options: CreateWebpackConfigurationVariantOptions): Promise<Configuration> {\n const { gfv } = options;\n\n const fileNameSuffix = options.mode === \"production\" ? \".min\" : \"\";\n\n const formPath = options.formPath;\n const buildCache =\n options.buildCacheOptions != undefined\n ? new BuildCache(options.buildCacheOptions.farmDirectory, options.buildCacheOptions.mode)\n : undefined;\n\n const buildCacheWebpackPlugin =\n buildCache != undefined && options.buildCacheOptions != undefined\n ? await buildCache.createWebpackPlugin(options.buildCacheOptions)\n : undefined;\n\n const devtoolOption: Configuration[\"devtool\"] =\n options.mode === \"production\" ? \"hidden-source-map\" : options.isLocalDev ? \"inline-source-map\" : \"source-map\";\n\n return {\n mode: options.mode,\n target: [\"web\", \"es5\"],\n context: formPath,\n output: {\n filename: `public/scripts/${gfv}${fileNameSuffix}.js`,\n path: options.resourcesDirectoryPath,\n publicPath: \"/static/\",\n },\n resolve: {\n alias: {\n \"variables.less\": path.resolve(path.join(__dirname, \"variables.less\")),\n variables: path.resolve(path.join(__dirname, \"variables.less\")),\n Resources: path.join(formPath, \"form\", \"resources\"),\n },\n extensions: [\".js\", \".jsx\"],\n },\n entry: [path.join(formPath, \"form\", \"./web\")],\n devtool: devtoolOption,\n cache:\n options.mode === \"development\"\n ? {\n type: \"memory\",\n maxGenerations: 5,\n }\n : false,\n module: {\n rules: [\n {\n test: /\\.less$/,\n use: [\n {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n loader: MiniCssExtractPlugin.loader as any,\n options: { publicPath: \"../../\" },\n },\n {\n loader: require.resolve(\"css-loader\"),\n options: {\n modules: {\n localIdentName: \"[hash:base64:5]\",\n },\n },\n },\n {\n loader: require.resolve(\"postcss-loader\"),\n options: {\n postcssOptions: {\n ident: \"postcss\",\n plugins: [\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n require(\"autoprefixer\")({\n // Просто дефолтные значение из текущего (1.7.7) browserslist\n overrideBrowserslist: \"> 1%, last 2 versions, Firefox ESR\",\n }),\n ],\n },\n },\n },\n {\n loader: require.resolve(\"less-loader\"),\n },\n ],\n },\n {\n test: /\\.jsx?$/,\n use: [\n {\n loader: require.resolve(\"babel-loader\"),\n options: {\n babelrc: false,\n configFile: false,\n presets: [\n require.resolve(\"@babel/preset-react\"),\n [\n require.resolve(\"@babel/preset-env\"),\n {\n targets: { browsers: \"> 0%\" },\n loose: true,\n },\n ],\n ],\n plugins: [\n [require.resolve(\"@babel/plugin-proposal-decorators\"), { legacy: true }],\n [require.resolve(\"@babel/plugin-transform-class-properties\"), { loose: true }],\n require.resolve(\"@babel/plugin-proposal-export-default-from\"),\n ],\n },\n },\n ],\n resolve: {\n fullySpecified: false,\n },\n exclude: [/node_modules/],\n },\n {\n test: /\\.(png|svg)$/,\n loader: require.resolve(\"file-loader\"),\n options: { name: \"public/images/[hash].[ext]\" },\n },\n {\n test: /\\.(ttf|eot|woff2?)$/,\n loader: require.resolve(\"file-loader\"),\n options: { name: \"public/fonts/[hash].[ext]\" },\n },\n ],\n },\n // @ts-expect-error Починится, когда все либы обновятся\n plugins: [\n new MiniCssExtractPlugin({\n filename: `public/styles/${gfv}${fileNameSuffix}.css`,\n }),\n new webpack.DefinePlugin({\n \"process.env\": {\n GFV: JSON.stringify(gfv),\n NODE_ENV: JSON.stringify(options.mode),\n RESOURCES_HASH: JSON.stringify(options.resourcesHash),\n },\n }),\n buildCacheWebpackPlugin,\n ].filter(isNotNullOrUndefined),\n };\n}\n\nfunction isNotNullOrUndefined<T>(input: T | undefined | null): input is T {\n return input != undefined;\n}\n\nexport interface CreateWebpackConfigurationOptions {\n gfv: string;\n resourcesHash: string;\n formPath: string;\n resourcesDirectoryPath: string;\n modes: BuildMode[];\n isLocalDev?: boolean;\n buildCacheOptions?: FormBuildCacheOptions;\n}\n\nexport function createConfig(options: CreateWebpackConfigurationOptions): Promise<Configuration[]> {\n const result: Array<Promise<Configuration>> = [];\n\n for (const mode of options.modes) {\n result.push(\n createConfigVariant({\n gfv: options.gfv,\n resourcesHash: options.resourcesHash,\n formPath: options.formPath,\n resourcesDirectoryPath: options.resourcesDirectoryPath,\n mode: mode,\n isLocalDev: options.isLocalDev,\n buildCacheOptions: options.buildCacheOptions,\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AGC,cAAc;IACnD,CAAC,CAAC,EACF,IAAIqD,gBAAO,CAACC,YAAY,CAAC;MACrB,aAAa,EAAE;QACXC,GAAG,EAAEC,IAAI,CAACC,SAAS,CAAC1D,GAAG,CAAC;QACxB2D,QAAQ,EAAEF,IAAI,CAACC,SAAS,CAAC3D,OAAO,CAACG,IAAI,CAAC;QACtC0D,cAAc,EAAEH,IAAI,CAACC,SAAS,CAAC3D,OAAO,CAAC8D,aAAa;MACxD;IACJ,CAAC,CAAC,EACFpD,uBAAuB,CAC1B,CAACqD,MAAM,CAACC,oBAAoB;EACjC,CAAC;AACL;AAEA,SAASA,oBAAoBA,CAAIC,KAA2B,EAAc;EACtE,OAAOA,KAAK,IAAI1D,SAAS;AAC7B;AAYO,SAAS2D,YAAYA,CAAClE,OAA0C,EAA4B;EAC/F,MAAMmE,MAAqC,GAAG,EAAE;EAEhD,KAAK,MAAMhE,IAAI,IAAIH,OAAO,CAACoE,KAAK,EAAE;IAC9BD,MAAM,CAACE,IAAI,CACPtE,mBAAmB,CAAC;MAChBE,GAAG,EAAED,OAAO,CAACC,GAAG;MAChB6D,aAAa,EAAE9D,OAAO,CAAC8D,aAAa;MACpC1D,QAAQ,EAAEJ,OAAO,CAACI,QAAQ;MAC1Be,sBAAsB,EAAEnB,OAAO,CAACmB,sBAAsB;MACtDhB,IAAI,EAAEA,IAAI;MACVU,UAAU,EAAEb,OAAO,CAACa,UAAU;MAC9BP,iBAAiB,EAAEN,OAAO,CAACM;IAC/B,CAAC,CACL,CAAC;EACL;EACA,OAAOgE,OAAO,CAACC,GAAG,CAACJ,MAAM,CAAC;AAC9B","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"createFormWebpackConfiguration.js","names":["_path","_interopRequireDefault","require","_miniCssExtractPlugin","_webpack","_CacheAssetsPlugin","createConfigVariant","options","gfv","fileNameSuffix","mode","formPath","buildCache","buildCacheOptions","undefined","BuildCache","farmDirectory","buildCacheWebpackPlugin","createWebpackPlugin","devtoolOption","isLocalDev","target","context","output","filename","path","resourcesDirectoryPath","publicPath","resolve","alias","join","__dirname","variables","Resources","extensions","entry","devtool","cache","type","maxGenerations","module","rules","test","use","loader","MiniCssExtractPlugin","modules","localIdentName","postcssOptions","ident","plugins","overrideBrowserslist","oneOf","workers","workerParallelJobs","workerNodeArgs","babelrc","configFile","presets","targets","browsers","loose","useBuiltIns","corejs","legacy","cacheDirectory","fullySpecified","exclude","name","webpack","DefinePlugin","GFV","JSON","stringify","NODE_ENV","RESOURCES_HASH","resourcesHash","filter","isNotNullOrUndefined","input","createConfig","result","modes","push","Promise","all"],"sources":["../../../../src/FormWebpackConfiguration/createFormWebpackConfiguration.ts"],"sourcesContent":["import path from \"path\";\n\nimport MiniCssExtractPlugin from \"mini-css-extract-plugin\";\nimport webpack, { Configuration } from \"webpack\";\n\nimport { BuildCache, FormBuildCacheOptions } from \"./CacheAssetsPlugin\";\n\ntype BuildMode = \"production\" | \"development\";\n\ninterface CreateWebpackConfigurationVariantOptions {\n gfv: string;\n resourcesHash: string;\n formPath: string;\n mode?: BuildMode;\n isLocalDev?: boolean;\n resourcesDirectoryPath: string;\n buildCacheOptions?: FormBuildCacheOptions;\n}\n\nasync function createConfigVariant(options: CreateWebpackConfigurationVariantOptions): Promise<Configuration> {\n const { gfv } = options;\n\n const fileNameSuffix = options.mode === \"production\" ? \".min\" : \"\";\n\n const formPath = options.formPath;\n const buildCache =\n options.buildCacheOptions != undefined\n ? new BuildCache(options.buildCacheOptions.farmDirectory, options.buildCacheOptions.mode)\n : undefined;\n\n const buildCacheWebpackPlugin =\n buildCache != undefined && options.buildCacheOptions != undefined\n ? await buildCache.createWebpackPlugin(options.buildCacheOptions)\n : undefined;\n\n const devtoolOption: Configuration[\"devtool\"] =\n options.mode === \"production\" ? \"hidden-source-map\" : options.isLocalDev ? \"inline-source-map\" : \"source-map\";\n\n return {\n mode: options.mode,\n target: [\"web\", \"es5\"],\n context: formPath,\n output: {\n filename: `public/scripts/${gfv}${fileNameSuffix}.js`,\n path: options.resourcesDirectoryPath,\n publicPath: \"/static/\",\n },\n resolve: {\n alias: {\n \"variables.less\": path.resolve(path.join(__dirname, \"variables.less\")),\n variables: path.resolve(path.join(__dirname, \"variables.less\")),\n Resources: path.join(formPath, \"form\", \"resources\"),\n },\n extensions: [\".js\", \".jsx\"],\n },\n entry: [path.join(formPath, \"form\", \"./web\")],\n devtool: devtoolOption,\n cache:\n options.mode === \"development\"\n ? {\n type: \"memory\",\n maxGenerations: 5,\n }\n : false,\n module: {\n rules: [\n {\n test: /\\.less$/,\n use: [\n {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n loader: MiniCssExtractPlugin.loader as any,\n options: { publicPath: \"../../\" },\n },\n {\n loader: require.resolve(\"css-loader\"),\n options: {\n modules: {\n localIdentName: \"[hash:base64:5]\",\n },\n },\n },\n {\n loader: require.resolve(\"postcss-loader\"),\n options: {\n postcssOptions: {\n ident: \"postcss\",\n plugins: [\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n require(\"autoprefixer\")({\n // Просто дефолтные значение из текущего (1.7.7) browserslist\n overrideBrowserslist: \"> 1%, last 2 versions, Firefox ESR\",\n }),\n ],\n },\n },\n },\n {\n loader: require.resolve(\"less-loader\"),\n },\n ],\n },\n {\n test: /\\.jsx?$/,\n oneOf: [\n {\n test: /(kcXmlValidationConfigurator|kcXmlAutoCalculationConfigurator|dataDeclaration)\\.js$/,\n type: \"javascript/auto\",\n },\n {\n use: [\n {\n loader: require.resolve(\"thread-loader\"),\n options: {\n workers: 4,\n workerParallelJobs: 10,\n workerNodeArgs: [\"--max-old-space-size=3072\"],\n },\n },\n {\n loader: require.resolve(\"babel-loader\"),\n options: {\n babelrc: false,\n configFile: false,\n presets: [\n require.resolve(\"@babel/preset-react\"),\n [\n require.resolve(\"@babel/preset-env\"),\n {\n targets: {\n browsers: [\">0.5%\", \"last 2 versions\", \"not dead\", \"not IE 11\"],\n },\n loose: true,\n useBuiltIns: \"usage\",\n corejs: 3,\n },\n ],\n ],\n plugins: [\n [require.resolve(\"@babel/plugin-proposal-decorators\"), { legacy: true }],\n [\n require.resolve(\"@babel/plugin-transform-class-properties\"),\n { loose: true },\n ],\n require.resolve(\"@babel/plugin-proposal-export-default-from\"),\n ],\n cacheDirectory: true,\n },\n },\n ],\n resolve: {\n fullySpecified: false,\n },\n exclude: [/node_modules/],\n },\n ],\n },\n {\n test: /\\.(png|svg)$/,\n loader: require.resolve(\"file-loader\"),\n options: { name: \"public/images/[hash].[ext]\" },\n },\n {\n test: /\\.(ttf|eot|woff2?)$/,\n loader: require.resolve(\"file-loader\"),\n options: { name: \"public/fonts/[hash].[ext]\" },\n },\n ],\n },\n // @ts-expect-error Починится, когда все либы обновятся\n plugins: [\n new MiniCssExtractPlugin({\n filename: `public/styles/${gfv}${fileNameSuffix}.css`,\n }),\n new webpack.DefinePlugin({\n \"process.env\": {\n GFV: JSON.stringify(gfv),\n NODE_ENV: JSON.stringify(options.mode),\n RESOURCES_HASH: JSON.stringify(options.resourcesHash),\n },\n }),\n buildCacheWebpackPlugin,\n ].filter(isNotNullOrUndefined),\n };\n}\n\nfunction isNotNullOrUndefined<T>(input: T | undefined | null): input is T {\n return input != undefined;\n}\n\nexport interface CreateWebpackConfigurationOptions {\n gfv: string;\n resourcesHash: string;\n formPath: string;\n resourcesDirectoryPath: string;\n modes: BuildMode[];\n isLocalDev?: boolean;\n buildCacheOptions?: FormBuildCacheOptions;\n}\n\nexport function createConfig(options: CreateWebpackConfigurationOptions): Promise<Configuration[]> {\n const result: Array<Promise<Configuration>> = [];\n\n for (const mode of options.modes) {\n result.push(\n createConfigVariant({\n gfv: options.gfv,\n resourcesHash: options.resourcesHash,\n formPath: options.formPath,\n resourcesDirectoryPath: options.resourcesDirectoryPath,\n mode: mode,\n isLocalDev: options.isLocalDev,\n buildCacheOptions: options.buildCacheOptions,\n })\n );\n }\n return Promise.all(result);\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA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,CAACM;IAC/B,CAAC,CACL,CAAC;EACL;EACA,OAAOuE,OAAO,CAACC,GAAG,CAACJ,MAAM,CAAC;AAC9B","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kontur.candy/tools",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.236.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"files": [
|
|
6
6
|
"candy.js",
|
|
@@ -64,7 +64,8 @@
|
|
|
64
64
|
"babel-plugin-transform-typescript-metadata": "^0.3.2",
|
|
65
65
|
"classnames-loader": "^2.1.0",
|
|
66
66
|
"conventional-changelog": "^3.1.24",
|
|
67
|
-
"conventional-changelog-cli": "^2.1.1"
|
|
67
|
+
"conventional-changelog-cli": "^2.1.1",
|
|
68
|
+
"thread-loader": "^4.0.4"
|
|
68
69
|
},
|
|
69
70
|
"dependencies": {
|
|
70
71
|
"@babel/core": "7.24.*",
|