@trackunit/iris-app-build-utilities 1.3.147 → 1.3.148
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 +6 -0
- package/package.json +2 -2
- package/src/getAliasesFromTsConfig.js.map +1 -1
- package/src/getGraphqlCodeGenConfig.d.ts +1 -1
- package/src/getGraphqlCodeGenConfig.js.map +1 -1
- package/src/getIrisAppWebpackDevServer.js.map +1 -1
- package/src/getTailwindContentForApp.d.ts +1 -1
- package/src/getTailwindContentForApp.js.map +1 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/iris-app-build-utilities",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.148",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"repository": "https://github.com/Trackunit/manager",
|
|
6
6
|
"engines": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"tailwindcss": "3.4.3",
|
|
15
15
|
"@tailwindcss/container-queries": "^0.1.1",
|
|
16
16
|
"webpack-dev-server": "5.1.0",
|
|
17
|
-
"@trackunit/iris-app-api": "1.3.
|
|
17
|
+
"@trackunit/iris-app-api": "1.3.148",
|
|
18
18
|
"tslib": "^2.6.2"
|
|
19
19
|
},
|
|
20
20
|
"types": "./src/index.d.ts",
|
|
@@ -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,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,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, Array<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"]}
|
|
@@ -6,4 +6,4 @@ import { CodegenConfig } from "@graphql-codegen/cli";
|
|
|
6
6
|
* @param gqlFilePaths (optional) An array of library relative paths to the graphql-files to generate hooks for.
|
|
7
7
|
* @returns {CodegenConfig } GraphQL code generation config.
|
|
8
8
|
*/
|
|
9
|
-
export declare const getGraphqlCodegenConfig: (nxLibPath: string, gqlFilePaths?: string
|
|
9
|
+
export declare const getGraphqlCodegenConfig: (nxLibPath: string, gqlFilePaths?: Array<string>) => CodegenConfig;
|
|
@@ -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,
|
|
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,GAAuE,CACzG,SAAiB,EACjB,YAA4B,EAC5B,EAAE;IACF,MAAM,sBAAsB,GAAG,IAAA,WAAI,EACjC,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,KAAK,EACL,qBAAqB,EACrB,WAAW,EACX,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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F;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;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?: Array<string>) => CodegenConfig = (\n nxLibPath: string,\n gqlFilePaths?: Array<string>\n) => {\n const internalSchemaFilePath = join(\n __dirname,\n \"..\",\n \"..\",\n \"..\",\n \"..\",\n \"libs\",\n \"api\",\n \"internal-gql-schema\",\n \"generated\",\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] | [number, number][] | [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":"getIrisAppWebpackDevServer.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getIrisAppWebpackDevServer.ts"],"names":[],"mappings":";;;AACA,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,
|
|
1
|
+
{"version":3,"file":"getIrisAppWebpackDevServer.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getIrisAppWebpackDevServer.ts"],"names":[],"mappings":";;;AACA,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,WAA8B,EAAE,SAAiB,EAAE,EAAE;YACtE,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,E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AE,QAAQ,EAAE,IAAI,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,KAAK,CAAC,+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 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: Array<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"]}
|
|
@@ -19,7 +19,7 @@ export interface TrackunitTailwindConfigOptions {
|
|
|
19
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: TailwindContentOptions) => string
|
|
22
|
+
export declare const getTailwindContentForApp: (options: TailwindContentOptions) => Array<string>;
|
|
23
23
|
/**
|
|
24
24
|
* Generates a trackunit tailwind config for use with iris apps.
|
|
25
25
|
*
|
|
@@ -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,
|
|
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,EAAiB,EAAE;IACzF,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): Array<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"]}
|