@trackunit/iris-app-build-utilities 0.0.421 → 0.0.423
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/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/enableTsConfigPath.d.ts +2 -2
- package/src/enableTsConfigPath.js +1 -3
- package/src/enableTsConfigPath.js.map +1 -1
- package/src/getAliasesFromTsConfig.d.ts +2 -2
- package/src/getAliasesFromTsConfig.js +2 -2
- package/src/getAliasesFromTsConfig.js.map +1 -1
- package/src/getExposedExtensions.d.ts +3 -3
- package/src/getExposedExtensions.js +4 -6
- package/src/getExposedExtensions.js.map +1 -1
- package/src/getGraphqlCodeGenConfig.d.ts +1 -1
- package/src/getGraphqlCodeGenConfig.js +2 -1
- package/src/getGraphqlCodeGenConfig.js.map +1 -1
- package/src/getSharedDependencies.d.ts +3 -3
- package/src/getSharedDependencies.js +4 -4
- package/src/getSharedDependencies.js.map +1 -1
- package/src/getTailwindContentForApp.d.ts +6 -6
- package/src/getTailwindContentForApp.js +2 -2
- package/src/getTailwindContentForApp.js.map +1 -1
- package/src/getTileWebpackDevServer.js +2 -0
- package/src/getTileWebpackDevServer.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.0.423](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.422...iris-app-build-utilities/0.0.423) (2024-06-11)
|
|
6
|
+
|
|
7
|
+
### Dependency Updates
|
|
8
|
+
|
|
9
|
+
* `iris-app-api` updated to version `0.0.422`
|
|
10
|
+
## [0.0.422](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.421...iris-app-build-utilities/0.0.422) (2024-06-11)
|
|
11
|
+
|
|
5
12
|
## [0.0.421](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.420...iris-app-build-utilities/0.0.421) (2024-06-10)
|
|
6
13
|
|
|
7
14
|
## [0.0.420](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.419...iris-app-build-utilities/0.0.420) (2024-05-21)
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
interface
|
|
1
|
+
interface TSConfigOptions {
|
|
2
2
|
projectRootDir: string;
|
|
3
3
|
}
|
|
4
4
|
/**
|
|
@@ -7,5 +7,5 @@ interface ITSConfigOptions {
|
|
|
7
7
|
* @param options - The options to enable tsconfig path
|
|
8
8
|
* @returns {import("typescript").ParsedCommandLine} - Returns the parsed command line
|
|
9
9
|
*/
|
|
10
|
-
export declare const enableTsConfigPath: (options:
|
|
10
|
+
export declare const enableTsConfigPath: (options: TSConfigOptions) => import("typescript").ParsedCommandLine;
|
|
11
11
|
export {};
|
|
@@ -12,9 +12,7 @@ let tsModule;
|
|
|
12
12
|
* @returns {import("typescript").ParsedCommandLine} - Returns the parsed command line
|
|
13
13
|
*/
|
|
14
14
|
const enableTsConfigPath = (options) => {
|
|
15
|
-
|
|
16
|
-
tsModule = require("typescript");
|
|
17
|
-
}
|
|
15
|
+
tsModule = require("typescript");
|
|
18
16
|
const readResult = tsModule.readConfigFile((0, path_1.join)(options.projectRootDir, "tsconfig.app.json"), tsModule.sys.readFile);
|
|
19
17
|
const result = tsModule.parseJsonConfigFileContent(readResult.config, tsModule.sys, options.projectRootDir);
|
|
20
18
|
require.extensions[".ts"] = function (m, filename) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enableTsConfigPath.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/enableTsConfigPath.ts"],"names":[],"mappings":";;;AAAA,2BAAkC;AAClC,+BAA4B;AAC5B,mDAAiF;AAMjF,IAAI,QAAqC,CAAC;AAE1C;;;;;GAKG;AACI,MAAM,kBAAkB,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"enableTsConfigPath.js","s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W,QAAA,kBAAkB,sBAqB7B","sourcesContent":["import { readFileSync } from \"fs\";\nimport { join } from \"path\";\nimport { ConfigLoaderSuccessResult, loadConfig, register } from \"tsconfig-paths\";\n\ninterface TSConfigOptions {\n projectRootDir: string;\n}\n\nlet tsModule: typeof import(\"typescript\");\n\n/**\n * This enables webpack typescript file to load projects from the path section in tsconfig file.\n *\n * @param options - The options to enable tsconfig path\n * @returns {import(\"typescript\").ParsedCommandLine} - Returns the parsed command line\n */\nexport const enableTsConfigPath = (options: TSConfigOptions) => {\n tsModule = require(\"typescript\");\n const readResult = tsModule.readConfigFile(join(options.projectRootDir, \"tsconfig.app.json\"), tsModule.sys.readFile);\n const result = tsModule.parseJsonConfigFileContent(readResult.config, tsModule.sys, options.projectRootDir);\n\n require.extensions[\".ts\"] = function (m, filename) {\n const input = readFileSync(filename, \"utf-8\");\n\n const { outputText } = tsModule.transpileModule(input, {\n compilerOptions: readResult.config,\n });\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (m as any)._compile(outputText, filename);\n };\n const loadedConf = loadConfig(options.projectRootDir) as ConfigLoaderSuccessResult;\n register({\n baseUrl: join(options.projectRootDir, loadedConf.baseUrl || \"\"),\n paths: loadedConf.paths,\n });\n return result;\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
interface
|
|
1
|
+
interface AliasesFromTsConfigOptions {
|
|
2
2
|
nxRootDir: string;
|
|
3
3
|
tsConfigFilePath?: string;
|
|
4
4
|
}
|
|
@@ -7,5 +7,5 @@ interface IAliasesFromTsConfigOptions {
|
|
|
7
7
|
*
|
|
8
8
|
* @returns { Promise<Record<string, string>> } aliases Exposes object for module federation.
|
|
9
9
|
*/
|
|
10
|
-
export declare const getAliasesFromTsConfig: (options:
|
|
10
|
+
export declare const getAliasesFromTsConfig: (options: AliasesFromTsConfigOptions) => Promise<Record<string, string>>;
|
|
11
11
|
export {};
|
|
@@ -24,10 +24,10 @@ const fromTsPath = (tsPath) => {
|
|
|
24
24
|
const getAliasesFromTsConfig = (options) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
25
25
|
var _a, _b;
|
|
26
26
|
const tsConfig = ts.readConfigFile(path.join(options.nxRootDir, options.tsConfigFilePath || "tsconfig.base.json"), ts.sys.readFile);
|
|
27
|
-
if (!((_a = tsConfig
|
|
27
|
+
if (!((_a = tsConfig.config.compilerOptions) === null || _a === void 0 ? void 0 : _a.paths)) {
|
|
28
28
|
throw Error(`option tsconfigFilePath missing paths property in (tsConfig.compilerOptions.paths)`);
|
|
29
29
|
}
|
|
30
|
-
return Object.entries((_b = tsConfig
|
|
30
|
+
return Object.entries((_b = tsConfig.config.compilerOptions) === null || _b === void 0 ? void 0 : _b.paths).reduce((acc, [key, value]) => {
|
|
31
31
|
if (value.length !== 1) {
|
|
32
32
|
throw new TypeError(`Unsupported TS alias ${key} has length ${value.length}`);
|
|
33
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAliasesFromTsConfig.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getAliasesFromTsConfig.ts"],"names":[],"mappings":";;;;AAAA,mDAA6B;AAC7B,uDAAiC;AAMjC;;;;;GAKG;AACH,MAAM,WAAW,GAAG,CAAC,OAAe,EAAE,EAAE;IACtC,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,CAAC;AACjH,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,MAAc,EAAE,EAAE;IACpC,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,M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AAC,oFAAoF,CAAC,CAAC;IACpG,CAAC;IACD,OAAO,MAAM,CAAC,OAAO,CAAC,MAAA,QAAQ,CAAC,MAAM,CAAC,eAAe,0CAAE,KAAiC,CAAC,CAAC,MAAM,CAE9F,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACtB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,MAAM,IAAI,SAAS,CAAC,wBAAwB,GAAG,eAAe,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;QAChF,CAAC;QACD,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACjF,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC,CAAA,CAAC;AAlBW,QAAA,sBAAsB,0BAkBjC","sourcesContent":["import * as path from \"path\";\nimport * as ts from \"typescript\";\ninterface AliasesFromTsConfigOptions {\n nxRootDir: string;\n tsConfigFilePath?: string;\n}\n\n/**\n * Removes the /* from the end of the alias if it exists.\n *\n * @param tsAlias the alias from the tsconfig.json\n * @returns { string } substring of the alias if it ends with /*\n */\nconst fromTsAlias = (tsAlias: string) => {\n return tsAlias.indexOf(\"/*\") === tsAlias.length - 2 ? tsAlias.substring(0, tsAlias.length - 2) : `${tsAlias}$`;\n};\n\nconst fromTsPath = (tsPath: string) => {\n return tsPath.indexOf(\"/*\") === tsPath.length - 2 ? tsPath.substring(0, tsPath.length - 2) : tsPath;\n};\n\n/**\n * Generates a list of aliases from the options.tsConfigFilePath defaults to tsconfig.base.json.\n *\n * @returns { Promise<Record<string, string>> } aliases Exposes object for module federation.\n */\nexport const getAliasesFromTsConfig = async (options: AliasesFromTsConfigOptions) => {\n const tsConfig = ts.readConfigFile(\n path.join(options.nxRootDir, options.tsConfigFilePath || \"tsconfig.base.json\"),\n ts.sys.readFile\n );\n\n if (!tsConfig.config.compilerOptions?.paths) {\n throw Error(`option tsconfigFilePath missing paths property in (tsConfig.compilerOptions.paths)`);\n }\n return Object.entries(tsConfig.config.compilerOptions?.paths as Record<string, string[]>).reduce<\n Record<string, string>\n >((acc, [key, value]) => {\n if (value.length !== 1) {\n throw new TypeError(`Unsupported TS alias ${key} has length ${value.length}`);\n }\n acc[fromTsAlias(key)] = path.join(options.nxRootDir, fromTsPath(value[0] || \"\"));\n return acc;\n }, {});\n};\n"]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Exposes, IrisAppManifest } from "@trackunit/iris-app-api";
|
|
2
|
-
interface
|
|
2
|
+
interface ExposedExtensionsOptions {
|
|
3
3
|
nxRootDir: string;
|
|
4
4
|
manifest: IrisAppManifest;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* Generates a list of exposed extensions from a manifest.
|
|
8
8
|
*
|
|
9
|
-
* @param
|
|
9
|
+
* @param options {ExposedExtensionsOptions} The manifest to get the exposed extensions from.
|
|
10
10
|
* @returns {Exposes} Exposes object for module federation.
|
|
11
11
|
*/
|
|
12
|
-
export declare const getExposedExtensions: (options:
|
|
12
|
+
export declare const getExposedExtensions: (options: ExposedExtensionsOptions) => Promise<Exposes>;
|
|
13
13
|
export {};
|
|
@@ -6,16 +6,14 @@ const path = tslib_1.__importStar(require("path"));
|
|
|
6
6
|
/**
|
|
7
7
|
* Generates a list of exposed extensions from a manifest.
|
|
8
8
|
*
|
|
9
|
-
* @param
|
|
9
|
+
* @param options {ExposedExtensionsOptions} The manifest to get the exposed extensions from.
|
|
10
10
|
* @returns {Exposes} Exposes object for module federation.
|
|
11
11
|
*/
|
|
12
12
|
const getExposedExtensions = (options) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
13
13
|
const output = {};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
output[`./${extension.id}`] = path.join(options.nxRootDir, extension.sourceRoot, extension.main ? extension.main : "index.tsx");
|
|
18
|
-
}
|
|
14
|
+
for (const extension of options.manifest.extensions) {
|
|
15
|
+
if (extension.type !== "REPORT_EXTENSION") {
|
|
16
|
+
output[`./${extension.id}`] = path.join(options.nxRootDir, extension.sourceRoot, extension.main ? extension.main : "index.tsx");
|
|
19
17
|
}
|
|
20
18
|
}
|
|
21
19
|
return output;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getExposedExtensions.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getExposedExtensions.ts"],"names":[],"mappings":";;;;AACA,mDAA6B;AAM7B;;;;;GAKG;AACI,MAAM,oBAAoB,GAAG,CAAO,
|
|
1
|
+
{"version":3,"file":"getExposedExtensions.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getExposedExtensions.ts"],"names":[],"mappings":";;;;AACA,mDAA6B;AAM7B;;;;;GAKG;AACI,MAAM,oBAAoB,GAAG,CAAO,OAAiC,EAAoB,EAAE;IAChG,MAAM,MAAM,GAAY,EAAE,CAAC;IAC3B,KAAK,MAAM,SAAS,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;QACpD,IAAI,SAAS,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;YAC1C,MAAM,CAAC,KAAK,SAAS,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CACrC,OAAO,CAAC,SAAS,EACjB,SAAS,CAAC,UAAU,EACpB,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAC9C,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAA,CAAC;AAZW,QAAA,oBAAoB,wBAY/B","sourcesContent":["import { Exposes, IrisAppManifest } from \"@trackunit/iris-app-api\";\nimport * as path from \"path\";\n\ninterface ExposedExtensionsOptions {\n nxRootDir: string;\n manifest: IrisAppManifest;\n}\n/**\n * Generates a list of exposed extensions from a manifest.\n *\n * @param options {ExposedExtensionsOptions} The manifest to get the exposed extensions from.\n * @returns {Exposes} Exposes object for module federation.\n */\nexport const getExposedExtensions = async (options: ExposedExtensionsOptions): Promise<Exposes> => {\n const output: Exposes = {};\n for (const extension of options.manifest.extensions) {\n if (extension.type !== \"REPORT_EXTENSION\") {\n output[`./${extension.id}`] = path.join(\n options.nxRootDir,\n extension.sourceRoot,\n extension.main ? extension.main : \"index.tsx\"\n );\n }\n }\n return output;\n};\n"]}
|
|
@@ -4,6 +4,6 @@ import { CodegenConfig } from "@graphql-codegen/cli";
|
|
|
4
4
|
*
|
|
5
5
|
* @param nxLibPath The library path.
|
|
6
6
|
* @param gqlFilePaths (optional) An array of library relative paths to the graphql-files to generate hooks for.
|
|
7
|
-
* @returns GraphQL code generation config.
|
|
7
|
+
* @returns {CodegenConfig } GraphQL code generation config.
|
|
8
8
|
*/
|
|
9
9
|
export declare const getGraphqlCodegenConfig: (nxLibPath: string, gqlFilePaths?: string[]) => CodegenConfig;
|
|
@@ -8,7 +8,7 @@ const path_1 = require("path");
|
|
|
8
8
|
*
|
|
9
9
|
* @param nxLibPath The library path.
|
|
10
10
|
* @param gqlFilePaths (optional) An array of library relative paths to the graphql-files to generate hooks for.
|
|
11
|
-
* @returns GraphQL code generation config.
|
|
11
|
+
* @returns {CodegenConfig } GraphQL code generation config.
|
|
12
12
|
*/
|
|
13
13
|
const getGraphqlCodegenConfig = (nxLibPath, gqlFilePaths) => {
|
|
14
14
|
const internalSchemaFilePath = (0, path_1.join)(__dirname, "..", "..", "..", "..", "libs", "api", "internal-gql-schema", "src", "internal-schema.gql");
|
|
@@ -21,6 +21,7 @@ const getGraphqlCodegenConfig = (nxLibPath, gqlFilePaths) => {
|
|
|
21
21
|
const generatedGqlOutputFolder = (0, path_1.join)(nxLibPath, "src", "generated", "graphql-api") + "/";
|
|
22
22
|
if ((0, fs_1.existsSync)(generatedGqlOutputFolder)) {
|
|
23
23
|
(0, fs_1.rmSync)(generatedGqlOutputFolder, { recursive: true });
|
|
24
|
+
// eslint-disable-next-line no-console
|
|
24
25
|
console.log(`Cleanup path: ${generatedGqlOutputFolder}`);
|
|
25
26
|
}
|
|
26
27
|
const documents = gqlFilePaths && gqlFilePaths.length > 0 ? gqlFilePaths : [(0, path_1.join)(nxLibPath, "src", "**", "*.graphql")];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getGraphqlCodeGenConfig.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getGraphqlCodeGenConfig.ts"],"names":[],"mappings":";;;AACA,2BAAwC;AACxC,+BAA4B;AAE5B;;;;;;GAMG;AACI,MAAM,uBAAuB,GAAkE,CACpG,SAAiB,EACjB,YAAuB,EACvB,EAAE;IACF,MAAM,sBAAsB,GAAG,IAAA,WAAI,EACjC,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,KAAK,EACL,qBAAqB,EACrB,KAAK,EACL,qBAAqB,CACtB,CAAC;IACF,MAAM,mCAAmC,GAAG,IAAA,eAAU,EAAC,sBAAsB,CAAC;QAC5E,CAAC,CAAC,sBAAsB;QACxB,CAAC,CAAC,yCAAyC,CAAC;IAE9C,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC,iBAAiB,mCAAmC,EAAE,CAAC,CAAC;IAEpE,oFAAoF;IACpF,MAAM,wBAAwB,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,aAAa,CAAC,GAAG,GAAG,CAAC;IAC1F,IAAI,IAAA,eAAU,EAAC,wBAAwB,CAAC,EAAE,CAAC;QACzC,IAAA,WAAM,EAAC,wBAAwB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,OAAO,CAAC,GAAG,CAAC,iBA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,EAAE,IAAI;YACd,cAAc,EAAE;gBACd,KAAK,EAAE,IAAI;gBACX,UAAU,EAAE,KAAK;gBACjB,MAAM,EAAE,IAAI;gBACZ,YAAY,EAAE,IAAI;aACnB;YACD,YAAY,EAAE,IAAI;YAClB,gBAAgB,EAAE;gBAChB,SAAS,EAAE,MAAM;gBACjB,UAAU,EAAE,MAAM;aACnB;SACF;KACF,CAAC;IAEF,OAAO;QACL,MAAM,EAAE,EAAE;QACV,iBAAiB,EAAE,IAAI,EAAE,yCAAyC;QAClE,SAAS;KACV,CAAC;AACJ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"getGraphqlCodeGenConfig.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getGraphqlCodeGenConfig.ts"],"names":[],"mappings":";;;AACA,2BAAwC;AACxC,+BAA4B;AAE5B;;;;;;GAMG;AACI,MAAM,uBAAuB,GAAkE,CACpG,SAAiB,EACjB,YAAuB,EACvB,EAAE;IACF,MAAM,sBAAsB,GAAG,IAAA,WAAI,EACjC,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,KAAK,EACL,qBAAqB,EACrB,KAAK,EACL,qBAAqB,CACtB,CAAC;IACF,MAAM,mCAAmC,GAAG,IAAA,eAAU,EAAC,sBAAsB,CAAC;QAC5E,CAAC,CAAC,sBAAsB;QACxB,CAAC,CAAC,yCAAyC,CAAC;IAE9C,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC,iBAAiB,mCAAmC,EAAE,CAAC,CAAC;IAEpE,oFAAoF;IACpF,MAAM,wBAAwB,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,aAAa,CAAC,GAAG,GAAG,CAAC;IAC1F,IAAI,IAAA,eAAU,EAAC,wBAAwB,CAAC,EAAE,CAAC;QACzC,IAAA,WAAM,EAAC,wBAAwB,EAAE,EAAE,SAAS,EAAE,IAAI,EA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ACZ,eAAe,EAAE,EAAE,kBAAkB,EAAE,iBAAiB,EAAE;YAC1D,QAAQ,EAAE,IAAI;YACd,cAAc,EAAE;gBACd,KAAK,EAAE,IAAI;gBACX,UAAU,EAAE,KAAK;gBACjB,MAAM,EAAE,IAAI;gBACZ,YAAY,EAAE,IAAI;aACnB;YACD,YAAY,EAAE,IAAI;YAClB,gBAAgB,EAAE;gBAChB,SAAS,EAAE,MAAM;gBACjB,UAAU,EAAE,MAAM;aACnB;SACF;KACF,CAAC;IAEF,OAAO;QACL,MAAM,EAAE,EAAE;QACV,iBAAiB,EAAE,IAAI,EAAE,yCAAyC;QAClE,SAAS;KACV,CAAC;AACJ,CAAC,CAAC;AAhGW,QAAA,uBAAuB,2BAgGlC","sourcesContent":["import { CodegenConfig } from \"@graphql-codegen/cli\";\nimport { existsSync, rmSync } from \"fs\";\nimport { join } from \"path\";\n\n/**\n * This function returns the codegen config for trackunit public graphql-codegen.\n *\n * @param nxLibPath The library path.\n * @param gqlFilePaths (optional) An array of library relative paths to the graphql-files to generate hooks for.\n * @returns {CodegenConfig } GraphQL code generation config.\n */\nexport const getGraphqlCodegenConfig: (nxLibPath: string, gqlFilePaths?: string[]) => CodegenConfig = (\n nxLibPath: string,\n gqlFilePaths?: string[]\n) => {\n const internalSchemaFilePath = join(\n __dirname,\n \"..\",\n \"..\",\n \"..\",\n \"..\",\n \"libs\",\n \"api\",\n \"internal-gql-schema\",\n \"src\",\n \"internal-schema.gql\"\n );\n const publicSchemaUrlOrInternalSchemaPath = existsSync(internalSchemaFilePath)\n ? internalSchemaFilePath\n : \"https://iris.trackunit.com/api/graphql/\";\n\n // eslint-disable-next-line no-console\n console.log(`Using schema: ${publicSchemaUrlOrInternalSchemaPath}`);\n\n // Adds a / to the end of the path to make gql client-preset happy - also on Windows\n const generatedGqlOutputFolder = join(nxLibPath, \"src\", \"generated\", \"graphql-api\") + \"/\";\n if (existsSync(generatedGqlOutputFolder)) {\n rmSync(generatedGqlOutputFolder, { recursive: true });\n // eslint-disable-next-line no-console\n console.log(`Cleanup path: ${generatedGqlOutputFolder}`);\n }\n const documents =\n gqlFilePaths && gqlFilePaths.length > 0 ? gqlFilePaths : [join(nxLibPath, \"src\", \"**\", \"*.graphql\")];\n if (!gqlFilePaths) {\n documents.push(join(`!${nxLibPath}`, \"src\", \"**\", \"*-manager.graphql\"));\n }\n\n const generates: CodegenConfig[\"generates\"] = {};\n generates[generatedGqlOutputFolder] = {\n schema: publicSchemaUrlOrInternalSchemaPath,\n documents,\n preset: \"client\",\n plugins: [\n {\n add: {\n content: [\n \"export type DateTimeISOString = string;\",\n \"import type { PublicIrisAppManifest } from '@trackunit/iris-app-api';\",\n ],\n },\n },\n ],\n config: {\n scalars: {\n Cursor: \"string\",\n Date: \"DateTimeISOString\",\n DateTime: \"DateTimeISOString\",\n GeoJSONCoordinates: \"number[] | number[][]\",\n PublicIrisAppManifest: \"PublicIrisAppManifest\",\n PhoneNumber: \"string\",\n EmailAddress: \"string\",\n Currency: \"string\",\n Url: \"string\",\n },\n namingConvention: {\n typeNames: \"keep\",\n enumValues: \"keep\",\n },\n avoidOptionals: {\n field: true,\n inputValue: false,\n object: true,\n defaultValue: true,\n },\n },\n presetConfig: {\n fragmentMasking: { unmaskFunctionName: \"getFragmentData\" },\n noExport: true,\n avoidOptionals: {\n field: true,\n inputValue: false,\n object: true,\n defaultValue: true,\n },\n noNamespaces: true,\n namingConvention: {\n typeNames: \"keep\",\n enumValues: \"keep\",\n },\n },\n };\n\n return {\n schema: \"\",\n ignoreNoDocuments: true, // for better experience with the watcher\n generates,\n };\n};\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { IrisAppManifest, Shared } from "@trackunit/iris-app-api";
|
|
2
|
-
interface
|
|
2
|
+
interface SharedDependenciesProps {
|
|
3
3
|
manifest: IrisAppManifest;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* Generates a list of shared dependencies for module federation.
|
|
7
7
|
*
|
|
8
|
-
* @param
|
|
8
|
+
* @param props {ISharedDependenciesOptions} The app manifest file
|
|
9
9
|
* @returns {Shared} The shared dependencies for module federation
|
|
10
10
|
*/
|
|
11
|
-
export declare const getSharedDependencies: (
|
|
11
|
+
export declare const getSharedDependencies: (props: SharedDependenciesProps) => Shared;
|
|
12
12
|
export {};
|
|
@@ -4,24 +4,24 @@ exports.getSharedDependencies = void 0;
|
|
|
4
4
|
/**
|
|
5
5
|
* Generates a list of shared dependencies for module federation.
|
|
6
6
|
*
|
|
7
|
-
* @param
|
|
7
|
+
* @param props {ISharedDependenciesOptions} The app manifest file
|
|
8
8
|
* @returns {Shared} The shared dependencies for module federation
|
|
9
9
|
*/
|
|
10
|
-
const getSharedDependencies = (
|
|
10
|
+
const getSharedDependencies = (props) => {
|
|
11
11
|
return [
|
|
12
12
|
{
|
|
13
13
|
react: {
|
|
14
14
|
singleton: true,
|
|
15
15
|
eager: true,
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/dot-notation
|
|
17
|
-
requiredVersion:
|
|
17
|
+
requiredVersion: props.manifest.dependencies["react"],
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
"react-dom": {
|
|
22
22
|
singleton: true,
|
|
23
23
|
eager: true,
|
|
24
|
-
requiredVersion:
|
|
24
|
+
requiredVersion: props.manifest.dependencies["react-dom"],
|
|
25
25
|
},
|
|
26
26
|
},
|
|
27
27
|
"single-spa-react",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSharedDependencies.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getSharedDependencies.ts"],"names":[],"mappings":";;;AAIA;;;;;GAKG;AACI,MAAM,qBAAqB,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"getSharedDependencies.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getSharedDependencies.ts"],"names":[],"mappings":";;;AAIA;;;;;GAKG;AACI,MAAM,qBAAqB,GAAG,CAAC,KAA8B,EAAU,EAAE;IAC9E,OAAO;QACL;YACE,KAAK,EAAE;gBACL,SAAS,EAAE,IAAI;gBACf,KAAK,EAAE,IAAI;gBACX,2DAA2D;gBAC3D,eAAe,EAAE,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC;aACtD;SACF;QACD;YACE,WAAW,EAAE;gBACX,SAAS,EAAE,IAAI;gBACf,KAAK,EAAE,IAAI;gBACX,eAAe,EAAE,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,WAAW,CAAC;aAC1D;SACF;QACD,kBAAkB;KACnB,CAAC;AACJ,CAAC,CAAC;AAnBW,QAAA,qBAAqB,yBAmBhC","sourcesContent":["import { IrisAppManifest, Shared } from \"@trackunit/iris-app-api\";\ninterface SharedDependenciesProps {\n manifest: IrisAppManifest;\n}\n/**\n * Generates a list of shared dependencies for module federation.\n *\n * @param props {ISharedDependenciesOptions} The app manifest file\n * @returns {Shared} The shared dependencies for module federation\n */\nexport const getSharedDependencies = (props: SharedDependenciesProps): Shared => {\n return [\n {\n react: {\n singleton: true,\n eager: true,\n // eslint-disable-next-line @typescript-eslint/dot-notation\n requiredVersion: props.manifest.dependencies[\"react\"],\n },\n },\n {\n \"react-dom\": {\n singleton: true,\n eager: true,\n requiredVersion: props.manifest.dependencies[\"react-dom\"],\n },\n },\n \"single-spa-react\",\n ];\n};\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Config } from "tailwindcss";
|
|
2
|
-
export interface
|
|
2
|
+
export interface TailwindContentOptions {
|
|
3
3
|
nxRootDir?: string;
|
|
4
4
|
/**
|
|
5
5
|
* The name of the folder in the nx repo this iris app is in.
|
|
6
6
|
*/
|
|
7
7
|
appDir: string;
|
|
8
8
|
}
|
|
9
|
-
export interface
|
|
9
|
+
export interface TrackunitTailwindConfigOptions {
|
|
10
10
|
nxRootDir?: string;
|
|
11
11
|
/**
|
|
12
12
|
* The name of the folder in the nx repo this iris app is in.
|
|
@@ -16,14 +16,14 @@ export interface ITrackunitTailwindConfigOptions {
|
|
|
16
16
|
/**
|
|
17
17
|
* Generates a list of exposed extensions from a manifest.
|
|
18
18
|
*
|
|
19
|
-
* @param options {
|
|
19
|
+
* @param options {TailwindContentOptions} The options include necessary information to get the dependencies.
|
|
20
20
|
* @returns {string[]} Exposes object for module federation. The list of files to include in the tailwind content.
|
|
21
21
|
*/
|
|
22
|
-
export declare const getTailwindContentForApp: (options:
|
|
22
|
+
export declare const getTailwindContentForApp: (options: TailwindContentOptions) => string[];
|
|
23
23
|
/**
|
|
24
24
|
* Generates a trackunit tailwind config for use with iris apps.
|
|
25
25
|
*
|
|
26
|
-
* @param options {
|
|
26
|
+
* @param options {TrackunitTailwindConfigOptions} The options include necessary information to get the dependencies.
|
|
27
27
|
* @returns {Config} Tailwind config for the app.
|
|
28
28
|
*/
|
|
29
|
-
export declare const getTrackunitTailwindConfig: (options:
|
|
29
|
+
export declare const getTrackunitTailwindConfig: (options: TrackunitTailwindConfigOptions) => Config;
|
|
@@ -9,7 +9,7 @@ const path_1 = require("path");
|
|
|
9
9
|
/**
|
|
10
10
|
* Generates a list of exposed extensions from a manifest.
|
|
11
11
|
*
|
|
12
|
-
* @param options {
|
|
12
|
+
* @param options {TailwindContentOptions} The options include necessary information to get the dependencies.
|
|
13
13
|
* @returns {string[]} Exposes object for module federation. The list of files to include in the tailwind content.
|
|
14
14
|
*/
|
|
15
15
|
const getTailwindContentForApp = (options) => {
|
|
@@ -26,7 +26,7 @@ exports.getTailwindContentForApp = getTailwindContentForApp;
|
|
|
26
26
|
/**
|
|
27
27
|
* Generates a trackunit tailwind config for use with iris apps.
|
|
28
28
|
*
|
|
29
|
-
* @param options {
|
|
29
|
+
* @param options {TrackunitTailwindConfigOptions} The options include necessary information to get the dependencies.
|
|
30
30
|
* @returns {Config} Tailwind config for the app.
|
|
31
31
|
*/
|
|
32
32
|
const getTrackunitTailwindConfig = (options) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTailwindContentForApp.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getTailwindContentForApp.ts"],"names":[],"mappings":";;;;AAAA,iDAAuE;AACvE,2BAAgC;AAChC,mDAA6B;AAC7B,+BAA4B;AA2B5B;;;;;GAKG;AACI,MAAM,wBAAwB,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"getTailwindContentForApp.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getTailwindContentForApp.ts"],"names":[],"mappings":";;;;AAAA,iDAAuE;AACvE,2BAAgC;AAChC,mDAA6B;AAC7B,+BAA4B;AA2B5B;;;;;GAKG;AACI,MAAM,wBAAwB,GAAG,CAAC,OAA+B,EAAY,EAAE;IACpF,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAE9E,IAAI,CAAC,IAAA,eAAU,EAAC,IAAA,WAAI,EAAC,SAAS,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CACb,yIAAyI,CAC1I,CAAC;IACJ,CAAC;IACD,OAAO;QACL,GAAG,IAAA,4CAAiC,EAAC,OAAO,CAAC,MAAM,EAAE,8CAA8C,CAAC;QACpG,SAAS,GAAG,wEAAwE;KACrF,CAAC;AACJ,CAAC,CAAC;AAZW,QAAA,wBAAwB,4BAYnC;AAEF;;;;;GAKG;AACI,MAAM,0BAA0B,GAAG,CAAC,OAAuC,EAAU,EAAE;IAC5F,8DAA8D;IAC9D,MAAM,YAAY,GAAG,OAAO,CAAC,oDAAoD,CAAC,CAAC;IACnF,OAAO;QACL,OAAO,EAAE,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,EAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC;QACtE,OAAO,EAAE,IAAA,gCAAwB,EAAC,OAAO,CAAC;QAC1C,OAAO,EAAE,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC;KACrD,CAAC;AACJ,CAAC,CAAC;AARW,QAAA,0BAA0B,8BAQrC","sourcesContent":["import { createGlobPatternsForDependencies } from \"@nx/react/tailwind\";\nimport { existsSync } from \"fs\";\nimport * as path from \"path\";\nimport { join } from \"path\";\nimport { Config } from \"tailwindcss\";\n\nexport interface TailwindContentOptions {\n /*\n * Root of the nx repo.\n */\n nxRootDir?: string;\n\n /**\n * The name of the folder in the nx repo this iris app is in.\n */\n appDir: string;\n}\n\nexport interface TrackunitTailwindConfigOptions {\n /*\n * Root of the nx repo.\n */\n nxRootDir?: string;\n\n /**\n * The name of the folder in the nx repo this iris app is in.\n */\n appDir: string;\n}\n\n/**\n * Generates a list of exposed extensions from a manifest.\n *\n * @param options {TailwindContentOptions} The options include necessary information to get the dependencies.\n * @returns {string[]} Exposes object for module federation. The list of files to include in the tailwind content.\n */\nexport const getTailwindContentForApp = (options: TailwindContentOptions): string[] => {\n const nxRootDir = options.nxRootDir || path.resolve(options.appDir, \"../../\");\n\n if (!existsSync(join(nxRootDir, \"nx.json\"))) {\n throw new Error(\n \"nx.json not found. Are you sure this is an nx repo, if you have more then 2 levels of nesting you need to pass in the nxRootDir option.\"\n );\n }\n return [\n ...createGlobPatternsForDependencies(options.appDir, \"/**/!(*.stories|*.spec).{tsx,jsx,ts,js,html}\"),\n nxRootDir + \"/node_modules/@trackunit/*/**/!(*.stories|*.spec).{tsx,jsx,ts,js,html}\",\n ];\n};\n\n/**\n * Generates a trackunit tailwind config for use with iris apps.\n *\n * @param options {TrackunitTailwindConfigOptions} The options include necessary information to get the dependencies.\n * @returns {Config} Tailwind config for the app.\n */\nexport const getTrackunitTailwindConfig = (options: TrackunitTailwindConfigOptions): Config => {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const tailwindBase = require(\"@trackunit/css-tailwind/tailwind-base.generated.js\");\n return {\n presets: [tailwindBase?.default ? tailwindBase.default : tailwindBase],\n content: getTailwindContentForApp(options),\n plugins: [require(\"@tailwindcss/container-queries\")],\n };\n};\n"]}
|
|
@@ -44,6 +44,7 @@ const getTileWebpackDevServer = (...args_1) => tslib_1.__awaiter(void 0, [...arg
|
|
|
44
44
|
response.send({ manifest: body });
|
|
45
45
|
}
|
|
46
46
|
catch (e) {
|
|
47
|
+
// eslint-disable-next-line no-console
|
|
47
48
|
console.error("ERROR: ", e);
|
|
48
49
|
response.status(500);
|
|
49
50
|
response.send(e);
|
|
@@ -60,6 +61,7 @@ const getTileWebpackDevServer = (...args_1) => tslib_1.__awaiter(void 0, [...arg
|
|
|
60
61
|
response.send(body);
|
|
61
62
|
}
|
|
62
63
|
catch (e) {
|
|
64
|
+
// eslint-disable-next-line no-console
|
|
63
65
|
console.error("ERROR: ", e);
|
|
64
66
|
response.status(500);
|
|
65
67
|
response.send(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTileWebpackDevServer.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getTileWebpackDevServer.ts"],"names":[],"mappings":";;;;AAAA,oEAA+B;AAE/B,yDAAsD;AAEtD;;;;;GAKG;AACI,MAAM,uBAAuB,GAAG,YAEb,EAAE,2DAD1B,gCAA+C,EAAE;IAEjD,MAAM,IAAI,GAAG,MAAM,IAAA,mCAAgB,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAClD,uBACE,IAAI,EACJ,kBAAkB,EAAE,IAAI,EACxB,OAAO,EAAE;YACP,kCAAkC,EAAE,MAAM;YAC1C,wBAAwB,EAAE,MAAM;YAChC,8BAA8B,EAAE,iCAAiC;YACjE,8BAA8B,EAC5B,wHAAwH;SAC3H,EACD,WAAW,EAAE,CAAC,MAAc,EAAE,EAAE,GAAE,CAAC,EACnC,gBAAgB,EAAE,CAAC,WAAyB,EAAE,SAAiB,EAAE,EAAE;;YACjE,WAAW,CAA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AAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;oBACrB,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACnB,CAAC;YACH,CAAC,CAAA,CAAC,CAAC;YACH,MAAA,SAAS,CAAC,GAAG,0CAAE,GAAG,CAAC,gBAAgB,EAAE,CAAO,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;gBACrE,QAAQ,CAAC,MAAM,CAAC,6BAA6B,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,IAAI,mCAAmC,CAAC,CAAC;gBAC9G,QAAQ,CAAC,MAAM,CACb,8BAA8B,EAC9B,wHAAwH,CACzH,CAAC;gBACF,IAAI,CAAC;oBACH,+EAA+E;oBAC/E,mEAAmE;oBACnE,MAAM,IAAI,GAAG,MAAM,IAAA,oBAAK,EAAC,0CAA0C,CAAC,CAAC;oBACrE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;oBAC/B,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACtB,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,OAAO,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;oBAC5B,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;oBACrB,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACnB,CAAC;YACH,CAAC,CAAA,CAAC,CAAC;YACH,OAAO,WAAW,CAAC;QACrB,CAAC,IACE,6BAA6B,EAChC;AACJ,CAAC,CAAA,CAAC;
|
|
1
|
+
{"version":3,"file":"getTileWebpackDevServer.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getTileWebpackDevServer.ts"],"names":[],"mappings":";;;;AAAA,oEAA+B;AAE/B,yDAAsD;AAEtD;;;;;GAKG;AACI,MAAM,uBAAuB,GAAG,YAEb,EAAE,2DAD1B,gCAA+C,EAAE;IAEjD,MAAM,I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CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACnB,CAAC;YACH,CAAC,CAAA,CAAC,CAAC;YACH,OAAO,WAAW,CAAC;QACrB,CAAC,IACE,6BAA6B,EAChC;AACJ,CAAC,CAAA,CAAC;AAvEW,QAAA,uBAAuB,2BAuElC","sourcesContent":["import fetch from \"node-fetch\";\nimport Server, { Configuration, Middleware, Request, Response } from \"webpack-dev-server\";\nimport { getAvailablePort } from \"./getAvailablePort\";\n\n/**\n * Generates a dev server configuration for webpack configuration.\n *\n * @param webpackDevServerConfiguration The configuration to extend.\n * @returns {Configuration} The dev server for tiles.\n */\nexport const getTileWebpackDevServer = async (\n webpackDevServerConfiguration: Configuration = {}\n): Promise<Configuration> => {\n const port = await getAvailablePort(22220, 22229);\n return {\n port,\n historyApiFallback: true,\n headers: {\n \"Access-Control-Allow-Credentials\": \"true\",\n \"Access-Control-Max-Age\": \"3600\",\n \"Access-Control-Allow-Methods\": \"GET, POST, PUT, DELETE, OPTIONS\",\n \"Access-Control-Allow-Headers\":\n \"X-Requested-With, baggage, content-type, Authorization, sentry-trace, session-id, commit-number, x-trackunitappversion\",\n },\n onListening: (server: Server) => {},\n setupMiddlewares: (middlewares: Middleware[], devServer: Server) => {\n middlewares.push({\n name: \"cors-preflight\",\n path: \"/\",\n middleware: (req: Request, res: Response, next: () => void) => {\n if (req.method === \"GET\") {\n next();\n } else {\n res.send(\"GET, HEAD\");\n }\n },\n });\n devServer.app?.use(\"/\", (request, response, next) => {\n response.header(\"Access-Control-Allow-Origin\", request.headers.origin || \"https://dev.manager.trackunit.com\");\n next();\n });\n devServer.app?.use(\"/manifestAndToken\", async (request, response, next) => {\n response.header(\"Access-Control-Allow-Origin\", request.headers.origin || \"https://dev.manager.trackunit.com\");\n response.header(\n \"Access-Control-Allow-Headers\",\n \"X-Requested-With, baggage, content-type, Authorization, sentry-trace, session-id, commit-number, x-trackunitappversion\"\n );\n try {\n const resp = await fetch(`http://localhost:${port}/manifest.json`);\n const body = await resp.json();\n response.send({ manifest: body });\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(\"ERROR: \", e);\n response.status(500);\n response.send(e);\n }\n });\n devServer.app?.use(\"/tileloader.js\", async (request, response, next) => {\n response.header(\"Access-Control-Allow-Origin\", request.headers.origin || \"https://dev.manager.trackunit.com\");\n response.header(\n \"Access-Control-Allow-Headers\",\n \"X-Requested-With, baggage, content-type, Authorization, sentry-trace, session-id, commit-number, x-trackunitappversion\"\n );\n try {\n // To test tileloader locally build the iris-app-loader and flip these 2 lines.\n // const resp = await fetch(\"http://localhost:3000/tileloader.js\");\n const resp = await fetch(\"https://iris.trackunit.app/tileloader.js\");\n const body = await resp.text();\n response.send(body);\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(\"ERROR: \", e);\n response.status(500);\n response.send(e);\n }\n });\n return middlewares;\n },\n ...webpackDevServerConfiguration,\n };\n};\n"]}
|