@trackunit/iris-app 0.0.628 → 0.0.630

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,18 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.0.630](https://github.com/Trackunit/manager/compare/iris-app/0.0.629...iris-app/0.0.630) (2024-09-10)
6
+
7
+ ### Dependency Updates
8
+
9
+ * `iris-app-build-utilities` updated to version `0.0.629`
10
+ ## [0.0.629](https://github.com/Trackunit/manager/compare/iris-app/0.0.628...iris-app/0.0.629) (2024-09-09)
11
+
12
+ ### Dependency Updates
13
+
14
+ * `iris-app-build-utilities` updated to version `0.0.628`
15
+ * `iris-app-api` updated to version `0.0.628`
16
+ * `iris-app-webpack-plugin` updated to version `0.0.628`
5
17
  ## [0.0.628](https://github.com/Trackunit/manager/compare/iris-app/0.0.627...iris-app/0.0.628) (2024-09-09)
6
18
 
7
19
  ### Dependency Updates
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/iris-app",
3
- "version": "0.0.628",
3
+ "version": "0.0.630",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "main": "src/index.js",
6
6
  "generators": "./generators.json",
@@ -2,8 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getDefaultConfig = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ const iris_app_api_1 = require("@trackunit/iris-app-api");
5
6
  const iris_app_build_utilities_1 = require("@trackunit/iris-app-build-utilities");
6
7
  const iris_app_webpack_plugin_1 = require("@trackunit/iris-app-webpack-plugin");
8
+ const shared_utils_1 = require("@trackunit/shared-utils");
7
9
  const path = tslib_1.__importStar(require("path"));
8
10
  const webpack = tslib_1.__importStar(require("webpack"));
9
11
  require("webpack-dev-server");
@@ -27,6 +29,18 @@ const CopyWebpackPlugin = require("copy-webpack-plugin");
27
29
  */
28
30
  const getDefaultConfig = async (mode, nxRootDir, appDir, irisAppManifest) => {
29
31
  const relativeAppDir = appDir.split(nxRootDir)[1] || "<unknown appdir>";
32
+ const iconPaths = irisAppManifest.extensions
33
+ .map(extension => {
34
+ if (extension.type === "FLEET_EXTENSION" && extension.menuItem.image && (0, iris_app_api_1.isIconImage)(extension.menuItem.image)) {
35
+ return {
36
+ extensionId: extension.id,
37
+ path: extension.menuItem.image.path,
38
+ sourceRoot: extension.sourceRoot,
39
+ };
40
+ }
41
+ return null;
42
+ })
43
+ .filter(shared_utils_1.truthy);
30
44
  return {
31
45
  mode: mode,
32
46
  output: {
@@ -129,7 +143,8 @@ const getDefaultConfig = async (mode, nxRootDir, appDir, irisAppManifest) => {
129
143
  ...irisAppManifest.extensions
130
144
  .filter(extension => extension.type === "LIFECYCLE_EXTENSION")
131
145
  .map(extension => ({
132
- from: extension.sourceRoot,
146
+ //globs must use / in path to be valid
147
+ from: extension.sourceRoot.replace(/\\/g, "/"),
133
148
  to: path.join(nxRootDir, "dist", relativeAppDir, "serverside", extension.id),
134
149
  })),
135
150
  {
@@ -139,6 +154,11 @@ const getDefaultConfig = async (mode, nxRootDir, appDir, irisAppManifest) => {
139
154
  .replace(/\\/g, "/"),
140
155
  to: path.resolve(nxRootDir, "dist"),
141
156
  },
157
+ ...iconPaths.map(iconPath => ({
158
+ //globs must use / in path to be valid
159
+ from: path.join(iconPath.sourceRoot, iconPath.path).replace(/\\/g, "/"),
160
+ to: path.join(nxRootDir, "dist", relativeAppDir, iconPath.extensionId, iconPath.path),
161
+ })),
142
162
  ],
143
163
  }),
144
164
  BundleAnalyzerPlugin,
@@ -1 +1 @@
1
- {"version":3,"file":"defaultWebpackConfig.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/executors/utils/defaultWebpackConfig.ts"],"names":[],"mappings":";;;;AACA,kFAK6C;AAC7C,gFAAmF;AACnF,mDAA6B;AAC7B,yDAAmC;AACn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isAppWebpackDevServer,\n getSharedDependencies,\n} from \"@trackunit/iris-app-build-utilities\";\nimport { TrackunitIrisAppWebpackPlugin } from \"@trackunit/iris-app-webpack-plugin\";\nimport * as path from \"path\";\nimport * as webpack from \"webpack\";\nimport \"webpack-dev-server\";\n\nlet BundleAnalyzerPlugin: webpack.WebpackPluginInstance | null = null;\nif (process.env.BUNDLE_ANALYSE === \"true\") {\n // doing require here to avoid dependency on webpack-bundle-analyzer directly\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const BundleAnalyzerPluginConstructor = require(\"webpack-bundle-analyzer\").BundleAnalyzerPlugin;\n BundleAnalyzerPlugin = new BundleAnalyzerPluginConstructor({ analyzerMode: \"static\" });\n}\n\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst CopyWebpackPlugin = require(\"copy-webpack-plugin\");\n\n/**\n * Gets the default webpack config.\n *\n * @param mode mode either \"production\" or \"development\"\n * @param nxRootDir the root of the nx workspace\n * @param appDir the app directory\n * @param irisAppManifest the iris app manifest\n * @returns { Promise<webpack.Configuration> } the default webpack config\n */\nexport const getDefaultConfig = async (\n mode: \"production\" | \"development\",\n nxRootDir: string,\n appDir: string,\n irisAppManifest: IrisAppManifest\n): Promise<webpack.Configuration> => {\n const relativeAppDir = appDir.split(nxRootDir)[1] || \"<unknown appdir>\";\n\n return {\n mode: mode,\n output: {\n publicPath: \"auto\",\n path: path.join(nxRootDir, \"dist\", relativeAppDir),\n },\n\n entry: {},\n devtool: false,\n devServer: await getIrisAppWebpackDevServer(),\n resolve: {\n extensions: [\".tsx\", \".ts\", \".jsx\", \".js\", \".json\"],\n alias: await getAliasesFromTsConfig({ nxRootDir }),\n },\n module: {\n rules: [\n {\n test: /\\.svg$/,\n issuer: /\\.[jt]sx?$/,\n use: [\"@svgr/webpack\", \"file-loader\"],\n },\n {\n test: /\\.m?js/,\n type: \"javascript/auto\",\n resolve: {\n fullySpecified: false,\n },\n },\n {\n test: /\\.(png|jpe?g|gif|eot|ttf|ico|woff|woff2)$/,\n exclude: /(node_modules)/,\n type: \"asset/resource\",\n },\n {\n test: /\\.(png|jpe?g|gif|svg|eot|ttf|ico|woff|woff2)$/i,\n include: /(node_modules\\/@okta)/,\n type: \"asset/resource\",\n },\n {\n test: /\\.(css|s[ac]ss)$/i,\n use: [\n \"style-loader\",\n \"css-loader\",\n {\n loader: \"postcss-loader\",\n options: {\n postcssOptions: {\n plugins: {\n \"postcss-import\": {},\n \"tailwindcss/nesting\": {},\n tailwindcss: {\n config: path.resolve(appDir, \"tailwind.config.js\"),\n },\n autoprefixer: {},\n },\n },\n },\n },\n ],\n },\n {\n test: /\\.json$/,\n loader: \"json-loader\",\n },\n {\n test: /\\.(j|t)sx?$/,\n exclude: /(vendor|node_modules|dist)/,\n use: {\n loader: \"esbuild-loader\",\n options: {\n jsx: \"automatic\",\n target: \"es6\",\n define: {\n \"process.env.IRIS_APP_SENTRY_DSN\": JSON.stringify(\"\"),\n \"process.env.IRIS_APP_VERSION\": JSON.stringify(\"\"),\n },\n },\n },\n },\n ],\n },\n\n plugins: [\n new webpack.container.ModuleFederationPlugin({\n name: irisAppManifest.moduleFederationName,\n filename: \"remoteEntry.js\",\n library: { type: \"global\", name: irisAppManifest.moduleFederationName },\n remotes: {},\n exposes: await getExposedExtensions({\n nxRootDir,\n manifest: irisAppManifest,\n }),\n shared: await getSharedDependencies({ manifest: irisAppManifest }),\n }),\n\n new TrackunitIrisAppWebpackPlugin({\n nxRootDir: nxRootDir,\n appDir,\n manifest: irisAppManifest,\n }),\n new CopyWebpackPlugin({\n patterns: [\n ...irisAppManifest.extensions\n .filter(extension => extension.type === \"LIFECYCLE_EXTENSION\")\n .map(extension => ({\n from: extension.sourceRoot,\n to: path.join(nxRootDir, \"dist\", relativeAppDir, \"serverside\", extension.id),\n })),\n {\n //globs must use / in path to be valid\n from: path\n .join(path.resolve(relativeAppDir.substring(1), \"assets\"), \"**\", \"(*.png|*.svg|*.jpg|*.jpeg|*.webp|*.md)\")\n .replace(/\\\\/g, \"/\"),\n to: path.resolve(nxRootDir, \"dist\"),\n },\n ],\n }),\n BundleAnalyzerPlugin,\n ].filter(Boolean),\n };\n};\n"]}
1
+ {"version":3,"file":"defaultWebpackConfig.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/executors/utils/defaultWebpackConfig.ts"],"names":[],"mappings":";;;;AAAA,0DAAuE;AACvE,kFAK6C;AAC7C,gFAAmF;AACnF,0DAAiD;AACjD,mDAA6B;AAC7B,yDAAmC;AACnC,8BAA4B;AAE5B,IAAI,oBAAoB,GAAyC,IAAI,CAAC;AACtE,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,MAAM,EAAE,CAAC;IAC1C,6EAA6E;IAC7E,8DAA8D;IAC9D,MAAM,+BAA+B,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC,oBAAoB,CAAC;IAChG,oBAAoB,GAAG,IAAI,+BAA+B,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,CAAC;AACzF,CAAC;AAED,8DAA8D;AAC9D,MAAM,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAEzD;;;;;;;;GAQG;AACI,MAAM,gBAAgB,GAAG,KAAK,EACnC,IAAkC,EAClC,SAAiB,EACjB,MAAc,EACd,eAAgC,EACA,EAAE;IAClC,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,kBAAkB,CAAC;IAExE,MAAM,SAAS,GAAG,eAAe,CAAC,UAAU;SACzC,GAAG,CAAC,SAAS,CAAC,EAAE;QACf,IAAI,SAAS,CAAC,IAAI,KAAK,iBAAiB,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,IAAI,IAAA,0BAAW,EAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9G,OAAO;gBACL,WAAW,EAAE,SAAS,CAAC,EAAE;gBACzB,IAAI,EAAE,SAAS,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n getIrisAppWebpackDevServer,\n getSharedDependencies,\n} from \"@trackunit/iris-app-build-utilities\";\nimport { TrackunitIrisAppWebpackPlugin } from \"@trackunit/iris-app-webpack-plugin\";\nimport { truthy } from \"@trackunit/shared-utils\";\nimport * as path from \"path\";\nimport * as webpack from \"webpack\";\nimport \"webpack-dev-server\";\n\nlet BundleAnalyzerPlugin: webpack.WebpackPluginInstance | null = null;\nif (process.env.BUNDLE_ANALYSE === \"true\") {\n // doing require here to avoid dependency on webpack-bundle-analyzer directly\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const BundleAnalyzerPluginConstructor = require(\"webpack-bundle-analyzer\").BundleAnalyzerPlugin;\n BundleAnalyzerPlugin = new BundleAnalyzerPluginConstructor({ analyzerMode: \"static\" });\n}\n\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst CopyWebpackPlugin = require(\"copy-webpack-plugin\");\n\n/**\n * Gets the default webpack config.\n *\n * @param mode mode either \"production\" or \"development\"\n * @param nxRootDir the root of the nx workspace\n * @param appDir the app directory\n * @param irisAppManifest the iris app manifest\n * @returns { Promise<webpack.Configuration> } the default webpack config\n */\nexport const getDefaultConfig = async (\n mode: \"production\" | \"development\",\n nxRootDir: string,\n appDir: string,\n irisAppManifest: IrisAppManifest\n): Promise<webpack.Configuration> => {\n const relativeAppDir = appDir.split(nxRootDir)[1] || \"<unknown appdir>\";\n\n const iconPaths = irisAppManifest.extensions\n .map(extension => {\n if (extension.type === \"FLEET_EXTENSION\" && extension.menuItem.image && isIconImage(extension.menuItem.image)) {\n return {\n extensionId: extension.id,\n path: extension.menuItem.image.path,\n sourceRoot: extension.sourceRoot,\n };\n }\n return null;\n })\n .filter(truthy);\n\n return {\n mode: mode,\n output: {\n publicPath: \"auto\",\n path: path.join(nxRootDir, \"dist\", relativeAppDir),\n },\n\n entry: {},\n devtool: false,\n devServer: await getIrisAppWebpackDevServer(),\n resolve: {\n extensions: [\".tsx\", \".ts\", \".jsx\", \".js\", \".json\"],\n alias: await getAliasesFromTsConfig({ nxRootDir }),\n },\n module: {\n rules: [\n {\n test: /\\.svg$/,\n issuer: /\\.[jt]sx?$/,\n use: [\"@svgr/webpack\", \"file-loader\"],\n },\n {\n test: /\\.m?js/,\n type: \"javascript/auto\",\n resolve: {\n fullySpecified: false,\n },\n },\n {\n test: /\\.(png|jpe?g|gif|eot|ttf|ico|woff|woff2)$/,\n exclude: /(node_modules)/,\n type: \"asset/resource\",\n },\n {\n test: /\\.(png|jpe?g|gif|svg|eot|ttf|ico|woff|woff2)$/i,\n include: /(node_modules\\/@okta)/,\n type: \"asset/resource\",\n },\n {\n test: /\\.(css|s[ac]ss)$/i,\n use: [\n \"style-loader\",\n \"css-loader\",\n {\n loader: \"postcss-loader\",\n options: {\n postcssOptions: {\n plugins: {\n \"postcss-import\": {},\n \"tailwindcss/nesting\": {},\n tailwindcss: {\n config: path.resolve(appDir, \"tailwind.config.js\"),\n },\n autoprefixer: {},\n },\n },\n },\n },\n ],\n },\n {\n test: /\\.json$/,\n loader: \"json-loader\",\n },\n {\n test: /\\.(j|t)sx?$/,\n exclude: /(vendor|node_modules|dist)/,\n use: {\n loader: \"esbuild-loader\",\n options: {\n jsx: \"automatic\",\n target: \"es6\",\n define: {\n \"process.env.IRIS_APP_SENTRY_DSN\": JSON.stringify(\"\"),\n \"process.env.IRIS_APP_VERSION\": JSON.stringify(\"\"),\n },\n },\n },\n },\n ],\n },\n\n plugins: [\n new webpack.container.ModuleFederationPlugin({\n name: irisAppManifest.moduleFederationName,\n filename: \"remoteEntry.js\",\n library: { type: \"global\", name: irisAppManifest.moduleFederationName },\n remotes: {},\n exposes: await getExposedExtensions({\n nxRootDir,\n manifest: irisAppManifest,\n }),\n shared: await getSharedDependencies({ manifest: irisAppManifest }),\n }),\n\n new TrackunitIrisAppWebpackPlugin({\n nxRootDir: nxRootDir,\n appDir,\n manifest: irisAppManifest,\n }),\n new CopyWebpackPlugin({\n patterns: [\n ...irisAppManifest.extensions\n .filter(extension => extension.type === \"LIFECYCLE_EXTENSION\")\n .map(extension => ({\n //globs must use / in path to be valid\n from: extension.sourceRoot.replace(/\\\\/g, \"/\"),\n to: path.join(nxRootDir, \"dist\", relativeAppDir, \"serverside\", extension.id),\n })),\n {\n //globs must use / in path to be valid\n from: path\n .join(path.resolve(relativeAppDir.substring(1), \"assets\"), \"**\", \"(*.png|*.svg|*.jpg|*.jpeg|*.webp|*.md)\")\n .replace(/\\\\/g, \"/\"),\n to: path.resolve(nxRootDir, \"dist\"),\n },\n ...iconPaths.map(iconPath => ({\n //globs must use / in path to be valid\n from: path.join(iconPath.sourceRoot, iconPath.path).replace(/\\\\/g, \"/\"),\n to: path.join(nxRootDir, \"dist\", relativeAppDir, iconPath.extensionId, iconPath.path),\n })),\n ],\n }),\n BundleAnalyzerPlugin,\n ].filter(Boolean),\n };\n};\n"]}