@trackunit/iris-app-build-utilities 1.0.4 → 1.0.5

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,8 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.0.5](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/1.0.4...iris-app-build-utilities/1.0.5) (2025-01-27)
6
+
5
7
  ## [1.0.4](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/1.0.3...iris-app-build-utilities/1.0.4) (2025-01-27)
6
8
 
7
9
  ### Dependency Updates
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/iris-app-build-utilities",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "repository": "https://github.com/Trackunit/manager",
6
6
  "engines": {
@@ -8,16 +8,17 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "tsconfig-paths": "^4.2.0",
11
- "typescript": "5.5.4",
11
+ "typescript": "5.6.3",
12
12
  "@graphql-codegen/cli": "^5.0.3",
13
- "@nx/react": "19.8.3",
13
+ "@nx/react": "20.3.3",
14
14
  "tailwindcss": "3.4.3",
15
15
  "@tailwindcss/container-queries": "^0.1.1",
16
16
  "node-fetch": "2.6.8",
17
17
  "webpack-dev-server": "5.1.0",
18
- "@trackunit/iris-app-api": "^1.0.4"
18
+ "@trackunit/iris-app-api": "^1.0.4",
19
+ "@trackunit/css-tailwind": "^1.0.1"
19
20
  },
21
+ "types": "./src/index.d.ts",
20
22
  "main": "./src/index.js",
21
- "type": "commonjs",
22
- "types": "./src/index.d.ts"
23
+ "type": "commonjs"
23
24
  }
@@ -22,12 +22,11 @@ const fromTsPath = (tsPath) => {
22
22
  * @returns { Promise<Record<string, string>> } aliases Exposes object for module federation.
23
23
  */
24
24
  const getAliasesFromTsConfig = async (options) => {
25
- var _a, _b;
26
25
  const tsConfig = ts.readConfigFile(path.join(options.nxRootDir, options.tsConfigFilePath || "tsconfig.base.json"), ts.sys.readFile);
27
- if (!((_a = tsConfig.config.compilerOptions) === null || _a === void 0 ? void 0 : _a.paths)) {
26
+ if (!tsConfig.config.compilerOptions?.paths) {
28
27
  throw Error(`option tsconfigFilePath missing paths property in (tsConfig.compilerOptions.paths)`);
29
28
  }
30
- return Object.entries((_b = tsConfig.config.compilerOptions) === null || _b === void 0 ? void 0 : _b.paths).reduce((acc, [key, value]) => {
29
+ return Object.entries(tsConfig.config.compilerOptions?.paths).reduce((acc, [key, value]) => {
31
30
  if (value.length !== 1) {
32
31
  throw new TypeError(`Unsupported TS alias ${key} has length ${value.length}`);
33
32
  }
@@ -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,KAAK,EAAE,OAAmC,EAAE,EAAE;;IAClF,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,CAAC,MAAM,CAAC,eAAe,0CAAE,KAAK,CAAA,EAAE,CAAC;QAC5C,MAAM,KAAK,CAAC,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,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
+ {"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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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"]}
@@ -23,7 +23,6 @@ const getIrisAppWebpackDevServer = async (webpackDevServerConfiguration = {}) =>
23
23
  },
24
24
  onListening: (server) => { },
25
25
  setupMiddlewares: (middlewares, devServer) => {
26
- var _a, _b, _c;
27
26
  middlewares.push({
28
27
  name: "cors-preflight",
29
28
  path: "/",
@@ -36,11 +35,11 @@ const getIrisAppWebpackDevServer = async (webpackDevServerConfiguration = {}) =>
36
35
  }
37
36
  },
38
37
  });
39
- (_a = devServer.app) === null || _a === void 0 ? void 0 : _a.use("/", (request, response, next) => {
38
+ devServer.app?.use("/", (request, response, next) => {
40
39
  response.header("Access-Control-Allow-Origin", request.headers.origin || "https://dev.manager.trackunit.com");
41
40
  next();
42
41
  });
43
- (_b = devServer.app) === null || _b === void 0 ? void 0 : _b.use("/manifestAndToken", async (request, response, next) => {
42
+ devServer.app?.use("/manifestAndToken", async (request, response, next) => {
44
43
  response.header("Access-Control-Allow-Origin", request.headers.origin || "https://dev.manager.trackunit.com");
45
44
  response.header("Access-Control-Allow-Headers", "X-Requested-With, baggage, content-type, Authorization, sentry-trace, session-id, commit-number, x-trackunitappversion");
46
45
  try {
@@ -55,7 +54,7 @@ const getIrisAppWebpackDevServer = async (webpackDevServerConfiguration = {}) =>
55
54
  response.send(e);
56
55
  }
57
56
  });
58
- (_c = devServer.app) === null || _c === void 0 ? void 0 : _c.use("/extensionloader.js", async (request, response, next) => {
57
+ devServer.app?.use("/extensionloader.js", async (request, response, next) => {
59
58
  response.header("Access-Control-Allow-Origin", request.headers.origin || "https://dev.manager.trackunit.com");
60
59
  response.header("Access-Control-Allow-Headers", "X-Requested-With, baggage, content-type, Authorization, sentry-trace, session-id, commit-number, x-trackunitappversion");
61
60
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"getIrisAppWebpackDevServer.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getIrisAppWebpackDevServer.ts"],"names":[],"mappings":";;;;AAAA,oEAA+B;AAE/B,yDAAsD;AAEtD;;;;;GAKG;AACI,MAAM,0BAA0B,GAAG,KAAK,EAC7C,gCAA+C,EAAE,EACzB,EAAE;IAC1B,MAAM,IAAI,GAAG,MAAM,IAAA,mCAAgB,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAClD,OAAO;QACL,IAAI;QACJ,kBAAkB,EAAE,IAAI;QACxB,OAAO,EAAE;YACP,kCAAkC,EAAE,MAAM;YAC1C,wBAAwB,EAAE,MAAM;YAChC,8BAA8B,EAAE,iCAAiC;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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 getIrisAppWebpackDevServer = 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(\"/extensionloader.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 extensionloader locally build the iris-app-loader and flip these 2 lines.\n // const resp = await fetch(\"http://localhost:3000/extensionloader.js\");\n const resp = await fetch(\"https://iris.trackunit.app/extensionloader.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"]}
1
+ {"version":3,"file":"getIrisAppWebpackDevServer.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getIrisAppWebpackDevServer.ts"],"names":[],"mappings":";;;;AAAA,oEAA+B;AAE/B,yDAAsD;AAEtD;;;;;GAKG;AACI,MAAM,0BAA0B,GAAG,KAAK,EAC7C,gCAA+C,EAAE,EACzB,EAAE;IAC1B,MAAM,IAAI,GAAG,MAAM,IAAA,mCAAgB,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAClD,OAAO;QACL,IAAI;QACJ,kBAAkB,EAAE,IAAI;QACxB,OAAO,EAAE;YACP,kCAAkC,EAAE,MAAM;YAC1C,wBAAwB,EAAE,MAAM;YAChC,8BAA8B,EAAE,iCAAiC;YACjE,8BAA8B,EAC5B,wHAAwH;SAC3H;QACD,WAAW,EAAE,CAAC,MAAc,EAAE,EAAE,GAAE,CAAC;QACnC,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,CAAC;wBACzB,IAAI,EAAE,CAAC;oBACT,CAAC;yBAAM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,EAAE,EAAE;gBAC1E,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,oFAAoF;oBACpF,wEAAwE;oBACxE,MAAM,IAAI,GAAG,MAAM,IAAA,oBAAK,EAAC,+CAA+C,CAAC,CAAC;oBAC1E,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,sCAAsC;oBACtC,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,CAAC,CAAC;YACH,OAAO,WAAW,CAAC;QACrB,CAAC;QACD,GAAG,6BAA6B;KACjC,CAAC;AACJ,CAAC,CAAC;AAvEW,QAAA,0BAA0B,8BAuErC","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 getIrisAppWebpackDevServer = 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(\"/extensionloader.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 extensionloader locally build the iris-app-loader and flip these 2 lines.\n // const resp = await fetch(\"http://localhost:3000/extensionloader.js\");\n const resp = await fetch(\"https://iris.trackunit.app/extensionloader.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"]}
@@ -33,9 +33,9 @@ const getTrackunitTailwindConfig = (options) => {
33
33
  // eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports
34
34
  const tailwindBase = require("@trackunit/css-tailwind/tailwind-base.generated.js");
35
35
  return {
36
- presets: [(tailwindBase === null || tailwindBase === void 0 ? void 0 : tailwindBase.default) ? tailwindBase.default : tailwindBase],
36
+ presets: [tailwindBase?.default ? tailwindBase.default : tailwindBase],
37
37
  content: (0, exports.getTailwindContentForApp)(options),
38
- // eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports
38
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
39
39
  plugins: [require("@tailwindcss/container-queries")],
40
40
  };
41
41
  };
@@ -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,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,qGAAqG;IACrG,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,qGAAqG;QACrG,OAAO,EAAE,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC;KACrD,CAAC;AACJ,CAAC,CAAC;AATW,QAAA,0BAA0B,8BASrC","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, @typescript-eslint/no-require-imports\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 // eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports\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,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,qGAAqG;IACrG,MAAM,YAAY,GAAG,OAAO,CAAC,oDAAoD,CAAC,CAAC;IACnF,OAAO;QACL,OAAO,EAAE,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC;QACtE,OAAO,EAAE,IAAA,gCAAwB,EAAC,OAAO,CAAC;QAC1C,iEAAiE;QACjE,OAAO,EAAE,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC;KACrD,CAAC;AACJ,CAAC,CAAC;AATW,QAAA,0BAA0B,8BASrC","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, @typescript-eslint/no-require-imports\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 // eslint-disable-next-line @typescript-eslint/no-require-imports\n plugins: [require(\"@tailwindcss/container-queries\")],\n };\n};\n"]}