@trackunit/iris-app-build-utilities 0.0.413 → 0.0.415

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 CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.0.415](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.414...iris-app-build-utilities/0.0.415) (2024-04-24)
6
+
7
+ ### Dependency Updates
8
+
9
+ * `iris-app-api` updated to version `0.0.414`
10
+ ## [0.0.414](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.413...iris-app-build-utilities/0.0.414) (2024-04-19)
11
+
12
+ ### Dependency Updates
13
+
14
+ * `iris-app-api` updated to version `0.0.413`
5
15
  ## [0.0.413](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.412...iris-app-build-utilities/0.0.413) (2024-04-18)
6
16
 
7
17
  ### Dependency Updates
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/iris-app-build-utilities",
3
- "version": "0.0.413",
3
+ "version": "0.0.415",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "repository": "https://github.com/Trackunit/manager",
6
6
  "engines": {
@@ -8,10 +8,10 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "tsconfig-paths": "^4.2.0",
11
- "typescript": "5.2.2",
11
+ "typescript": "5.4.4",
12
12
  "@trackunit/iris-app-api": "*",
13
13
  "@graphql-codegen/cli": "^5.0.0",
14
- "@nx/react": "17.1.3",
14
+ "@nx/react": "18.3.3",
15
15
  "tailwindcss": "3.4.1",
16
16
  "@tailwindcss/container-queries": "^0.1.1",
17
17
  "node-fetch": "2.6.8",
@@ -1 +1 @@
1
- {"version":3,"file":"enableTsConfigPath.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/enableTsConfigPath.ts"],"names":[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import { readFileSync } from \"fs\";\nimport { join } from \"path\";\nimport { ConfigLoaderSuccessResult, loadConfig, register } from \"tsconfig-paths\";\n\ninterface ITSConfigOptions {\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: ITSConfigOptions) => {\n if (!tsModule) {\n tsModule = require(\"typescript\");\n }\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
+ {"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,OAAyB,EAAE,EAAE;IAC9D,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACnC,CAAC;IACD,MAAM,UAAU,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAA,WAAI,EAAC,OAAO,CAAC,cAAc,EAAE,mBAAmB,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACrH,MAAM,MAAM,GAAG,QAAQ,CAAC,0BAA0B,CAAC,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IAE5G,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,EAAE,QAAQ;QAC/C,MAAM,KAAK,GAAG,IAAA,iBAAY,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAE9C,MAAM,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC,KAAK,EAAE;YACrD,eAAe,EAAE,UAAU,CAAC,MAAM;SACnC,CAAC,CAAC;QAEH,8DAA8D;QAC7D,CAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC5C,CAAC,CAAC;IACF,MAAM,UAAU,GAAG,IAAA,2BAAU,EAAC,OAAO,CAAC,cAAc,CAA8B,CAAC;IACnF,IAAA,yBAAQ,EAAC;QACP,OAAO,EAAE,IAAA,WAAI,EAAC,OAAO,CAAC,cAAc,EAAE,UAAU,CAAC,OAAO,IAAI,EAAE,CAAC;QAC/D,KAAK,EAAE,UAAU,CAAC,KAAK;KACxB,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAvBW,QAAA,kBAAkB,sBAuB7B","sourcesContent":["import { readFileSync } from \"fs\";\nimport { join } from \"path\";\nimport { ConfigLoaderSuccessResult, loadConfig, register } from \"tsconfig-paths\";\n\ninterface ITSConfigOptions {\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: ITSConfigOptions) => {\n if (!tsModule) {\n tsModule = require(\"typescript\");\n }\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 +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,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AACtG,CAAC,CAAC;AAEF;;;;GAIG;AACI,MAAM,sBAAsB,GAAG,CAAO,OAAoC,EAAE,EAAE;;IACnF,MAAM,QAAQ,GAAG,EAAE,CAAC,cAAc,CAChC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,gBAAgB,IAAI,oBAAoB,CAAC,EAC9E,EAAE,CAAC,GAAG,CAAC,QAAQ,CAChB,CAAC;IAEF,IAAI,CAAC,CAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,CAAC,eAAe,0CAAE,KAAK,CAAA,EAAE;QAC5C,MAAM,KAAK,CAAC,oFAAoF,CAAC,CAAC;KACnG;IACD,OAAO,MAAM,CAAC,OAAO,CAAC,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,CAAC,eAAe,0CAAE,KAAiC,CAAC,CAAC,MAAM,CAE/F,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACtB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACtB,MAAM,IAAI,SAAS,CAAC,wBAAwB,GAAG,eAAe,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;SAC/E;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 IAliasesFromTsConfigOptions {\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: IAliasesFromTsConfigOptions) => {\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
+ {"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,CA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sB,0BAkBjC","sourcesContent":["import * as path from \"path\";\nimport * as ts from \"typescript\";\ninterface IAliasesFromTsConfigOptions {\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: IAliasesFromTsConfigOptions) => {\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 +1 @@
1
- {"version":3,"file":"getAvailablePort.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getAvailablePort.ts"],"names":[],"mappings":";;;;AAAA,iDAA2B;AAE3B,MAAM,QAAQ,GAAG,CAAO,IAAY,EAAoB,EAAE;IACxD,OAAO,IAAI,OAAO,CAAU,OAAO,CAAC,EAAE;QACpC,MAAM,MAAM,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC;QAClC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAqB,EAAE,EAAE;YAC7C,IAAI,GAAG,CAAC,IAAI,KAAK,YAAY,EAAE;gBAC7B,OAAO,CAAC,KAAK,CAAC,CAAC;aAChB;iBAAM;gBACL,OAAO,CAAC,IAAI,CAAC,CAAC;aACf;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE;YAC5B,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE;gBAChB,OAAO,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF;;;;;;GAMG;AACI,MAAM,gBAAgB,GAAG,CAAO,OAAe,EAAE,OAAe,EAAmB,EAAE;IAC1F,IAAI,OAAO,GAAG,CAAC,IAAI,OAAO,GAAG,KAAK,IAAI,OAAO,GAAG,OAAO,EAAE;QACvD,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;KACxC;IAED,KAAK,IAAI,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,IAAI,EAAE,EAAE;QAChD,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,WAAW,EAAE;YACf,OAAO,IAAI,CAAC;SACb;KACF;IAED,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;AAChE,CAAC,CAAA,CAAC;AAbW,QAAA,gBAAgB,oBAa3B","sourcesContent":["import * as net from \"net\";\n\nconst findPort = async (port: number): Promise<boolean> => {\n return new Promise<boolean>(resolve => {\n const server = net.createServer();\n server.once(\"error\", (err: { code: string }) => {\n if (err.code === \"EADDRINUSE\") {\n resolve(false);\n } else {\n resolve(true);\n }\n });\n\n server.once(\"listening\", () => {\n server.close(() => {\n resolve(true);\n });\n });\n\n server.listen(port);\n });\n};\n\n/**\n * Gets the first available port in the specified range.\n *\n * @param minPort min port number inclusive\n * @param maxPort max port number inclusive\n * @returns {number} the first available port in the range\n */\nexport const getAvailablePort = async (minPort: number, maxPort: number): Promise<number> => {\n if (minPort < 1 || maxPort > 65535 || minPort > maxPort) {\n throw new Error(\"Invalid port range.\");\n }\n\n for (let port = minPort; port <= maxPort; port++) {\n const isAvailable = await findPort(port);\n if (isAvailable) {\n return port;\n }\n }\n\n throw new Error(\"No available ports in the specified range.\");\n};\n"]}
1
+ {"version":3,"file":"getAvailablePort.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getAvailablePort.ts"],"names":[],"mappings":";;;;AAAA,iDAA2B;AAE3B,MAAM,QAAQ,GAAG,CAAO,IAAY,EAAoB,EAAE;IACxD,OAAO,IAAI,OAAO,CAAU,OAAO,CAAC,EAAE;QACpC,MAAM,MAAM,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC;QAClC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAqB,EAAE,EAAE;YAC7C,IAAI,GAAG,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;gBAC9B,OAAO,CAAC,KAAK,CAAC,CAAC;YACjB,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE;YAC5B,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE;gBAChB,OAAO,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF;;;;;;GAMG;AACI,MAAM,gBAAgB,GAAG,CAAO,OAAe,EAAE,OAAe,EAAmB,EAAE;IAC1F,IAAI,OAAO,GAAG,CAAC,IAAI,OAAO,GAAG,KAAK,IAAI,OAAO,GAAG,OAAO,EAAE,CAAC;QACxD,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,IAAI,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;QACjD,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,WAAW,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;AAChE,CAAC,CAAA,CAAC;AAbW,QAAA,gBAAgB,oBAa3B","sourcesContent":["import * as net from \"net\";\n\nconst findPort = async (port: number): Promise<boolean> => {\n return new Promise<boolean>(resolve => {\n const server = net.createServer();\n server.once(\"error\", (err: { code: string }) => {\n if (err.code === \"EADDRINUSE\") {\n resolve(false);\n } else {\n resolve(true);\n }\n });\n\n server.once(\"listening\", () => {\n server.close(() => {\n resolve(true);\n });\n });\n\n server.listen(port);\n });\n};\n\n/**\n * Gets the first available port in the specified range.\n *\n * @param minPort min port number inclusive\n * @param maxPort max port number inclusive\n * @returns {number} the first available port in the range\n */\nexport const getAvailablePort = async (minPort: number, maxPort: number): Promise<number> => {\n if (minPort < 1 || maxPort > 65535 || minPort > maxPort) {\n throw new Error(\"Invalid port range.\");\n }\n\n for (let port = minPort; port <= maxPort; port++) {\n const isAvailable = await findPort(port);\n if (isAvailable) {\n return port;\n }\n }\n\n throw new Error(\"No available ports in the specified range.\");\n};\n"]}
@@ -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,OAAkC,EAAoB,EAAE;IACjG,MAAM,MAAM,GAAY,EAAE,CAAC;IAC3B,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE;QAC/B,KAAK,MAAM,SAAS,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE;YACnD,IAAI,SAAS,CAAC,IAAI,KAAK,kBAAkB,EAAE;gBACzC,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;aACH;SACF;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAA,CAAC;AAdW,QAAA,oBAAoB,wBAc/B","sourcesContent":["import { Exposes, IrisAppManifest } from \"@trackunit/iris-app-api\";\nimport * as path from \"path\";\n\ninterface IExposedExtensionsOptions {\n nxRootDir: string;\n manifest: IrisAppManifest;\n}\n/**\n * Generates a list of exposed extensions from a manifest.\n *\n * @param manifest {Manifest} The manifest to get the exposed extensions from.\n * @returns {Exposes} Exposes object for module federation.\n */\nexport const getExposedExtensions = async (options: IExposedExtensionsOptions): Promise<Exposes> => {\n const output: Exposes = {};\n if (options.manifest.extensions) {\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 }\n return output;\n};\n"]}
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,OAAkC,EAAoB,EAAE;IACjG,MAAM,MAAM,GAAY,EAAE,CAAC;IAC3B,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;QAChC,KAAK,MAAM,SAAS,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;YACpD,IAAI,SAAS,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;gBAC1C,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;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAA,CAAC;AAdW,QAAA,oBAAoB,wBAc/B","sourcesContent":["import { Exposes, IrisAppManifest } from \"@trackunit/iris-app-api\";\nimport * as path from \"path\";\n\ninterface IExposedExtensionsOptions {\n nxRootDir: string;\n manifest: IrisAppManifest;\n}\n/**\n * Generates a list of exposed extensions from a manifest.\n *\n * @param manifest {Manifest} The manifest to get the exposed extensions from.\n * @returns {Exposes} Exposes object for module federation.\n */\nexport const getExposedExtensions = async (options: IExposedExtensionsOptions): Promise<Exposes> => {\n const output: Exposes = {};\n if (options.manifest.extensions) {\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 }\n return output;\n};\n"]}
@@ -83,7 +83,7 @@ const getGraphqlCodegenConfig = (nxLibPath, gqlFilePaths) => {
83
83
  };
84
84
  return {
85
85
  schema: "",
86
- ignoreNoDocuments: true,
86
+ ignoreNoDocuments: true, // for better experience with the watcher
87
87
  generates,
88
88
  };
89
89
  };
@@ -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;QACxC,IAAA,WAAM,EAAC,wBAAwB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,OAAO,CAAC,GAAG,CAAC,iBAAiB,wBAAwB,EAAE,CAAC,CAAC;KAC1D;IACD,MAAM,SAAS,GACb,YAAY,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAA,WAAI,EAAC,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC;IACvG,IAAI,CAAC,YAAY,EAAE;QACjB,SAAS,CAAC,IAAI,CAAC,IAAA,WAAI,EAAC,IAAI,SAAS,EAAE,EA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CAAC;AA/FW,QAAA,uBAAuB,2BA+FlC","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 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 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
+ {"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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;YACD,cAAc,EAAE;gBACd,KAAK,EAAE,IAAI;gBACX,UAAU,EAAE,KAAK;gBACjB,MAAM,EAAE,IAAI;gBACZ,YAAY,EAAE,IAAI;aACnB;SACF;QACD,YAAY,EAAE;YACZ,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;AA/FW,QAAA,uBAAuB,2BA+FlC","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 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 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 +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,OAAgC,EAAY,EAAE;IACrF,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;QAC3C,MAAM,IAAI,KAAK,CACb,yIAAyI,CAC1I,CAAC;KACH;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,OAAwC,EAAU,EAAE;IAC7F,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 ITailwindContentOptions {\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 ITrackunitTailwindConfigOptions {\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 {ITailwindContentOptions} 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: ITailwindContentOptions): 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 {ITrackunitTailwindConfigOptions} The options include necessary information to get the dependencies.\n * @returns {Config} Tailwind config for the app.\n */\nexport const getTrackunitTailwindConfig = (options: ITrackunitTailwindConfigOptions): 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"]}
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,OAAgC,EAAY,EAAE;IACrF,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,OAAwC,EAAU,EAAE;IAC7F,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 ITailwindContentOptions {\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 ITrackunitTailwindConfigOptions {\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 {ITailwindContentOptions} 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: ITailwindContentOptions): 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 {ITrackunitTailwindConfigOptions} The options include necessary information to get the dependencies.\n * @returns {Config} Tailwind config for the app.\n */\nexport const getTrackunitTailwindConfig = (options: ITrackunitTailwindConfigOptions): 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"]}
@@ -10,7 +10,7 @@ const getAvailablePort_1 = require("./getAvailablePort");
10
10
  * @param webpackDevServerConfiguration The configuration to extend.
11
11
  * @returns {Configuration} The dev server for tiles.
12
12
  */
13
- const getTileWebpackDevServer = (webpackDevServerConfiguration = {}) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
13
+ const getTileWebpackDevServer = (...args_1) => tslib_1.__awaiter(void 0, [...args_1], void 0, function* (webpackDevServerConfiguration = {}) {
14
14
  const port = yield (0, getAvailablePort_1.getAvailablePort)(22220, 22229);
15
15
  return Object.assign({ port, historyApiFallback: true, headers: {
16
16
  "Access-Control-Allow-Credentials": "true",
@@ -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,CACrC,gCAA+C,EAAE,EACzB,EAAE;IAC1B,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,CAAC,IAAI,CAAC;gBACf,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,GAAG;gBACT,UAAU,EAAE,CAAC,GAAY,EAAE,GAAa,EAAE,IAAgB,EAAE,EAAE;oBAC5D,IAAI,GAAG,CAAC,MAAM,KAAK,KAAK,EAAE;wBACxB,IAAI,EAAE,CAAC;qBACR;yBAAM;wBACL,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;qBACvB;gBACH,CAAC;aACF,CAAC,CAAC;YACH,MAAA,SAAS,CAAC,GAAG,0CAAE,GAAG,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;gBAClD,QAAQ,CAAC,MAAM,CAAC,6BAA6B,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,IAAI,mCAAmC,CAAC,CAAC;gBAC9G,IAAI,EAAE,CAAC;YACT,CAAC,CAAC,CAAC;YAC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;gBAAC,OAAO,CAAC,EAAE;oBACV,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;iBAClB;YACH,CAAC,CAAA,CAAC,CAAC;YACH,OAAO,WAAW,CAAC;QACrB,CAAC,IACE,6BAA6B,EAChC;AACJ,CAAC,CAAA,CAAC;AAnEW,QAAA,uBAAuB,2BAmElC","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 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 const resp = await fetch(\"https://iris.trackunit.app/tileloader.js\");\n const body = await resp.text();\n response.send(body);\n } catch (e) {\n console.error(\"ERROR: \", e);\n response.status(500);\n response.send(e);\n }\n });\n return middlewares;\n },\n ...webpackDevServerConfiguration,\n };\n};\n"]}
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,CAAC,IAAI,CAAC;gBAC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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,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;AAnEW,QAAA,uBAAuB,2BAmElC","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 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 const resp = await fetch(\"https://iris.trackunit.app/tileloader.js\");\n const body = await resp.text();\n response.send(body);\n } catch (e) {\n console.error(\"ERROR: \", e);\n response.status(500);\n response.send(e);\n }\n });\n return middlewares;\n },\n ...webpackDevServerConfiguration,\n };\n};\n"]}