@trackunit/iris-app 0.0.214 → 0.0.219
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 +19 -0
- package/package.json +12 -7
- package/src/executors/utils/checkPackageVersion.js +2 -2
- package/src/executors/utils/checkPackageVersion.js.map +1 -1
- package/src/executors/utils/defaultWebpackConfig.js.map +1 -1
- package/src/generators/create/generator.js +20 -10
- package/src/generators/create/generator.js.map +1 -1
- package/src/generators/extend/generator.js +2 -0
- package/src/generators/extend/generator.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.0.219](https://github.com/Trackunit/manager/compare/iris-app/0.0.218...iris-app/0.0.219) (2023-04-26)
|
|
6
|
+
|
|
7
|
+
## [0.0.218](https://github.com/Trackunit/manager/compare/iris-app/0.0.217...iris-app/0.0.218) (2023-04-26)
|
|
8
|
+
|
|
9
|
+
### Dependency Updates
|
|
10
|
+
|
|
11
|
+
* `iris-app-build-utilities` updated to version `0.0.120`
|
|
12
|
+
## [0.0.217](https://github.com/Trackunit/manager/compare/iris-app/0.0.216...iris-app/0.0.217) (2023-04-25)
|
|
13
|
+
|
|
14
|
+
### Dependency Updates
|
|
15
|
+
|
|
16
|
+
* `iris-app-build-utilities` updated to version `0.0.119`
|
|
17
|
+
## [0.0.216](https://github.com/Trackunit/manager/compare/iris-app/0.0.215...iris-app/0.0.216) (2023-04-24)
|
|
18
|
+
|
|
19
|
+
### Dependency Updates
|
|
20
|
+
|
|
21
|
+
* `iris-app-build-utilities` updated to version `0.0.118`
|
|
22
|
+
## [0.0.215](https://github.com/Trackunit/manager/compare/iris-app/0.0.214...iris-app/0.0.215) (2023-04-24)
|
|
23
|
+
|
|
5
24
|
## [0.0.214](https://github.com/Trackunit/manager/compare/iris-app/0.0.213...iris-app/0.0.214) (2023-04-20)
|
|
6
25
|
|
|
7
26
|
## [0.0.213](https://github.com/Trackunit/manager/compare/iris-app/0.0.212...iris-app/0.0.213) (2023-04-20)
|
package/package.json
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/iris-app",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.219",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"generators": "./generators.json",
|
|
7
7
|
"executors": "./executors.json",
|
|
8
8
|
"repository": "https://github.com/Trackunit/manager",
|
|
9
9
|
"dependencies": {
|
|
10
|
+
"@nrwl/eslint-plugin-nx": "15.9.2",
|
|
10
11
|
"@phenomnomnominal/tsquery": "4.2.0",
|
|
11
12
|
"@react-google-maps/api": "2.17.1",
|
|
12
13
|
"@react-spring/web": "9.6.0",
|
|
14
|
+
"@typescript-eslint/eslint-plugin": "5.48.2",
|
|
15
|
+
"@typescript-eslint/parser": "5.48.2",
|
|
13
16
|
"camelcase": "5.3.1",
|
|
14
17
|
"csp-header": "5.1.0",
|
|
15
18
|
"csstype": "3.1.1",
|
|
16
19
|
"echarts": "5.4.0",
|
|
17
20
|
"enquirer": "2.3.6",
|
|
18
|
-
"
|
|
21
|
+
"eslint-plugin-import": "2.26.0",
|
|
22
|
+
"eslint-plugin-jsx-a11y": "6.6.1",
|
|
23
|
+
"eslint-plugin-react": "7.31.11",
|
|
24
|
+
"eslint-plugin-react-hooks": "4.6.0",
|
|
19
25
|
"i18next": "21.10.0",
|
|
20
26
|
"jest-canvas-mock": "2.4.0",
|
|
21
27
|
"libnpmpublish": "7.1.2",
|
|
@@ -39,17 +45,16 @@
|
|
|
39
45
|
"@heroicons/react": "2.0.16",
|
|
40
46
|
"@sentry/browser": "7.24.2",
|
|
41
47
|
"@trackunit/css-component-tokens": "0.0.24",
|
|
42
|
-
"@trackunit/css-components": "0.0.
|
|
43
|
-
"@trackunit/css-core": "0.0.
|
|
44
|
-
"@trackunit/css-tailwind": "0.0.
|
|
48
|
+
"@trackunit/css-components": "0.0.316",
|
|
49
|
+
"@trackunit/css-core": "0.0.81",
|
|
50
|
+
"@trackunit/css-tailwind": "0.0.51",
|
|
45
51
|
"@trackunit/css-tailwind-custom-properties-plugin": "0.0.16",
|
|
46
52
|
"@trackunit/i18n-library-translation": "0.0.41",
|
|
47
53
|
"@trackunit/iris-app-api": "0.0.88",
|
|
48
|
-
"@trackunit/iris-app-build-utilities": "0.0.
|
|
54
|
+
"@trackunit/iris-app-build-utilities": "0.0.120",
|
|
49
55
|
"@trackunit/iris-app-runtime-core": "0.3.28",
|
|
50
56
|
"@trackunit/iris-app-runtime-core-api": "0.3.25",
|
|
51
57
|
"@trackunit/iris-app-webpack-plugin": "0.0.98",
|
|
52
|
-
"@trackunit/react-components": "0.1.80",
|
|
53
58
|
"@trackunit/react-core-contexts-api": "0.2.24",
|
|
54
59
|
"@trackunit/react-core-contexts-test": "0.1.45",
|
|
55
60
|
"@trackunit/react-core-hooks": "0.2.41",
|
|
@@ -78,8 +78,8 @@ async function checkTrackunitPackages(dependencies, throwError = true) {
|
|
|
78
78
|
const remoteVersion = await (0, exports.getLatestRemoteVersion)(key);
|
|
79
79
|
if (remoteVersion) {
|
|
80
80
|
const localDependencyVersion = dependencies[key];
|
|
81
|
-
// If @trackunit dependencies are linked/added locally using "file
|
|
82
|
-
if (!localDependencyVersion.includes("file
|
|
81
|
+
// If @trackunit dependencies are linked/added locally using "file:", skip the version check, used for E2E tests.
|
|
82
|
+
if (!localDependencyVersion.includes("file:")) {
|
|
83
83
|
(0, exports.versionCheck)(key, localDependencyVersion, remoteVersion, throwError);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkPackageVersion.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/executors/utils/checkPackageVersion.ts"],"names":[],"m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E,CAAC,CAAC,CAAC,gCAAgC;IAC1G,OAAO,IAAA,oBAAY,EAAC,MAAM,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,UAAU,CAAC,CAAC;AAClF,CAAC;AAHD,4CAGC;AAED;;;;;GAKG;AACI,KAAK,UAAU,cAAc,CAAC,gBAAwB,EAAE,UAAU,GAAG,IAAI;IAC9E,MAAM,gBAAgB,GAAG,IAAA,wBAAQ,EAAC,cAAc,CAAC;SAC9C,QAAQ,CAAC,OAAO,CAAC;SACjB,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC,gCAAgC;IAC5D,OAAO,IAAA,oBAAY,EAAC,IAAI,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,CAAC,CAAC;AAC5E,CAAC;AALD,wCAKC;AAED;;GAEG;AACI,KAAK,UAAU,sBAAsB,CAAC,YAAoC,EAAE,UAAU,GAAG,IAAI;IAClG,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE;QAC9B,MAAM,aAAa,GAAuB,MAAM,IAAA,8BAAsB,EAAC,GAAG,CAAC,CAAC;QAC5E,IAAI,aAAa,EAAE;YACjB,MAAM,sBAAsB,GAAW,YAAY,CAAC,GAAG,CAAC,CAAC;YACzD
|
|
1
|
+
{"version":3,"file":"checkPackageVersion.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/executors/utils/checkPackageVersion.ts"],"names":[],"mappings":";;;;AAAA,yCAA4C;AAC5C,iDAAyC;AACzC,uDAAiC;AACjC,uDAAiC;AACjC,uCAAoC;AAEpC;;;;;;GAMG;AACI,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,UAAkB,EAAE,KAAa,EAAE,UAAU,GAAG,IAAI,EAAE,EAAE;IAChG,MAAM,YAAY,GAAG,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,CAAC,wBAAwB;IAC1F,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,K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;AACI,KAAK,UAAU,mBAAmB,CAAC,UAAU,GAAG,IAAI;IACzD,MAAM,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,GAAG,YAAY,EAAE,CAAC;IAC3E,MAAM,kBAAkB,GAAG,iBAAO,CAAC,kBAAkB,CAAC;IACtD,qDAAqD;IACrD,MAAM,gBAAgB,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;IACvD,sDAAsD;IACtD,MAAM,sBAAsB,CAAC,qBAAqB,EAAE,UAAU,CAAC,CAAC;IAChE,MAAM,sBAAsB,CAAC,wBAAwB,EAAE,UAAU,CAAC,CAAC;IACnE,OAAO,IAAI,CAAC;AACd,CAAC;AATD,kDASC","sourcesContent":["import { readJsonFile } from \"@nrwl/devkit\";\nimport { execSync } from \"child_process\";\nimport * as pacote from \"pacote\";\nimport * as semver from \"semver\";\nimport { version } from \"./version\";\n\n/**\n *\n * @param pkg package to look for.\n * @param localRange local version of the package.\n * @param range range\n * @returns { boolean } true if its a valid version\n */\nexport const versionCheck = (pkg: string, localRange: string, range: string, throwError = true) => {\n const localVersion = semver.minVersion(localRange) ?? localRange; // ('^1.0.0') => '1.0.0'\n if (!semver.satisfies(localVersion, range)) {\n const msg = `Package \"${pkg}\" outdated. Remote Version: ${range} Local version: ${localRange}. \\n Update package using command: 'npm i ${pkg}@${range}'`;\n if (throwError) {\n throw new Error(msg);\n } else {\n // eslint-disable-next-line no-console\n console.warn(\"!!! \" + msg);\n return true;\n }\n }\n return true;\n};\n\n/**\n * Get the latest version of the package from the registry.\n *\n * @param pkg package to look for.\n * @returns { Promise<string> } returns version\n */\nexport const getLatestRemoteVersion = async (pkg: string) => {\n try {\n const manifest = await pacote.manifest(pkg);\n return manifest.version;\n } catch (error) {\n throw new Error(`Error fetching manifest for package ${pkg}`);\n }\n};\n\n/**\n * Check if the current version of the package is the same as the one in the manager.\n *\n * @param {string} managerNodeVersion version of node in the manager\n * @returns { boolean } true if its a valid version\n */\nexport async function checkNodeVersion(managerNodeVersion: string, throwError = true) {\n const currentNodeVersion = await process.version.replace(/\\r?\\n|\\r/, \"\"); // regex removes any line breaks\n return versionCheck(\"node\", currentNodeVersion, managerNodeVersion, throwError);\n}\n\n/**\n * Check if the current version of the package is the same as the one in the manager.\n *\n * @param {string} managerNxVersion version of nx in the manager\n * @returns { boolean} true if its a valid version\n */\nexport async function checkNxVersion(managerNxVersion: string, throwError = true) {\n const currentNxVersion = execSync(\"nx --version\")\n .toString(\"utf-8\")\n .replace(/\\r?\\n|\\r/, \"\"); // regex removes any line breaks\n return versionCheck(\"nx\", currentNxVersion, managerNxVersion, throwError);\n}\n\n/**\n *\n */\nexport async function checkTrackunitPackages(dependencies: Record<string, string>, throwError = true) {\n for (const key in dependencies) {\n const remoteVersion: string | undefined = await getLatestRemoteVersion(key);\n if (remoteVersion) {\n const localDependencyVersion: string = dependencies[key];\n // If @trackunit dependencies are linked/added locally using \"file:\", skip the version check, used for E2E tests.\n if (!localDependencyVersion.includes(\"file:\")) {\n versionCheck(key, localDependencyVersion, remoteVersion, throwError);\n }\n }\n }\n return true;\n}\n\nfunction getLibraries() {\n const packageJsonLocal: Record<string, string | Record<string, string>> = readJsonFile(\"package.json\");\n const trackunitDependencies = Object.fromEntries(\n Object.entries(packageJsonLocal.dependencies).filter(([key]) => key.startsWith(\"@trackunit/\"))\n );\n const trackunitDevDependencies = Object.fromEntries(\n Object.entries(packageJsonLocal.devDependencies).filter(([key]) => key.startsWith(\"@trackunit/\"))\n );\n return { trackunitDependencies, trackunitDevDependencies };\n}\n\n/**\n *\n */\nexport async function checkPackageVersion(throwError = true) {\n const { trackunitDependencies, trackunitDevDependencies } = getLibraries();\n const managerNodeVersion = version.managerNodeVersion;\n // const managerNxVersion = version.managerNxVersion;\n await checkNodeVersion(managerNodeVersion, throwError);\n // await checkNxVersion(managerNxVersion, throwError);\n await checkTrackunitPackages(trackunitDependencies, throwError);\n await checkTrackunitPackages(trackunitDevDependencies, throwError);\n return true;\n}\n"]}
|
|
@@ -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;AACnC,8BAA4B;AAC5B,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,CAAC;IAClD,OAAO;QACL,IAAI,EAAE,IAAI;QACV,MAAM,EAAE;YACN,UAAU,EAAE,MAAM;YAClB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,CAAC;SACnD;QAED,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,GAAG,WAAW;QACnD,OAAO,EAAE,KAAK;QACd,SAAS,EAAE,MAAM,IAAA,kDAAuB,GAAE;QAC1C,OAAO,EAAE;YACP,UAAU,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC;YACnD,KAAK,EAAE,MAAM,IAAA,iDAAsB,EAAC,EAAE,SAAS,EAAE,CAAC;SACnD;QACD,MAAM,EAAE;YACN,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,iBAAiB;oBACvB,OAAO,EAAE;wBACP,cAAc,EAAE,KAAK;qBACtB;iBACF;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,GAAG,EAAE,CAAC,eAAe,EAAE,YAAY,CAAC;iBACrC;gBACD;oBACE,IAAI,EAAE,2BAA2B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,eAAe,EAAE,CAAC;aACnE,CAAC;
|
|
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;AACnC,8BAA4B;AAC5B,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,CAAC;IAClD,OAAO;QACL,IAAI,EAAE,IAAI;QACV,MAAM,EAAE;YACN,UAAU,EAAE,MAAM;YAClB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,CAAC;SACnD;QAED,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,GAAG,WAAW;QACnD,OAAO,EAAE,KAAK;QACd,SAAS,EAAE,MAAM,IAAA,kDAAuB,GAAE;QAC1C,OAAO,EAAE;YACP,UAAU,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC;YACnD,KAAK,EAAE,MAAM,IAAA,iDAAsB,EAAC,EAAE,SAAS,EAAE,CAAC;SACnD;QACD,MAAM,EAAE;YACN,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,iBAAiB;oBACvB,OAAO,EAAE;wBACP,cAAc,EAAE,KAAK;qBACtB;iBACF;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,GAAG,EAAE,CAAC,eAAe,EAAE,YAAY,CAAC;iBACrC;gBACD;oB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AAC,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC;aACnE,CAAC;YAEF,IAAI,uDAA6B,CAAC;gBAChC,SAAS,EAAE,SAAS;gBACpB,MAAM;gBACN,QAAQ,EAAE,eAAe;aAC1B,CAAC;YACF,IAAI,iBAAiB,CAAC;gBACpB,QAAQ,EAAE;oBACR;wBACE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,GAAG,4CAA4C;wBACrG,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC;qBACjC;iBACF;aACF,CAAC;SACH,CAAC,MAAM,CAAC,OAAO,CAAC;KAClB,CAAC;AACJ,CAAC,CAAC;AAjHW,QAAA,gBAAgB,oBAiH3B","sourcesContent":["import { IrisAppManifest } from \"@trackunit/iris-app-api\";\nimport {\n getAliasesFromTsConfig,\n getExposedExtensions,\n getSharedDependencies,\n getTileWebpackDevServer,\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// 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];\n return {\n mode: mode,\n output: {\n publicPath: \"auto\",\n path: path.join(nxRootDir, \"dist\", relativeAppDir),\n },\n\n entry: path.resolve(__dirname, \"src\") + \"/index.js\",\n devtool: false,\n devServer: await getTileWebpackDevServer(),\n resolve: {\n extensions: [\".tsx\", \".ts\", \".jsx\", \".js\", \".json\"],\n alias: await getAliasesFromTsConfig({ nxRootDir }),\n },\n module: {\n rules: [\n {\n test: /\\.m?js/,\n type: \"javascript/auto\",\n resolve: {\n fullySpecified: false,\n },\n },\n {\n test: /\\.svg$/,\n use: [\"@svgr/webpack\", \"url-loader\"],\n },\n {\n test: /\\.(png|jpg|gif|woff|ico)$/,\n exclude: /(node_modules)/,\n type: \"asset/resource\",\n },\n {\n test: /\\.(png|jpe?g|gif|svg|eot|ttf|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 loader: \"tsx\",\n jsx: \"automatic\",\n target: \"es6\",\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 {\n from: path.join(relativeAppDir.substring(1), \"assets\") + \"/**/(*.png|*.svg|*.jpg|*.jpeg|*.webp|*.md)\",\n to: path.join(nxRootDir, \"dist\"),\n },\n ],\n }),\n ].filter(Boolean),\n };\n};\n"]}
|
|
@@ -46,23 +46,31 @@ const IrisAppGenerator = async function (tree, options) {
|
|
|
46
46
|
if (packageJsonFromNpm.version !== packageJsonLocally.version) {
|
|
47
47
|
console.warn(`This version of the iris-app package does not match the version of the iris-app package from NPM JS. Please update using: npm i @trackunit/iris-app@${packageJsonFromNpm.version}`);
|
|
48
48
|
}
|
|
49
|
+
const installTUPackages = process.env.INSTALL_TU_PACKAGES ? process.env.INSTALL_TU_PACKAGES === "true" : true;
|
|
49
50
|
const reactComponentsPackageJsonFromNpm = pacote.manifest("@trackunit/react-components");
|
|
50
51
|
const reactCoreContextsPackageJsonFromNpm = pacote.manifest("@trackunit/react-core-contexts");
|
|
51
52
|
const cssComponentsPackageJsonFromNpm = pacote.manifest("@trackunit/css-components");
|
|
52
53
|
const cssTailwindPackageJsonFromNpm = pacote.manifest("@trackunit/css-tailwind");
|
|
53
|
-
const
|
|
54
|
-
const irisAppBuildUtilitiesPackageJsonFromNpm = pacote.manifest("@trackunit/iris-app-build-utilities");
|
|
55
|
-
const irisAppWebpackPluginPackageJsonFromNpm = pacote.manifest("@trackunit/iris-app-webpack-plugin");
|
|
56
|
-
(0, devkit_1.addDependenciesToPackageJson)(tree, {
|
|
57
|
-
tslib: "2.4.0",
|
|
54
|
+
const tuDependencies = {
|
|
58
55
|
"@trackunit/react-components": (await reactComponentsPackageJsonFromNpm).version,
|
|
59
56
|
"@trackunit/react-core-contexts": (await reactCoreContextsPackageJsonFromNpm).version,
|
|
60
57
|
"@trackunit/css-components": (await cssComponentsPackageJsonFromNpm).version,
|
|
61
58
|
"@trackunit/css-tailwind": (await cssTailwindPackageJsonFromNpm).version,
|
|
62
|
-
}
|
|
59
|
+
};
|
|
60
|
+
const irisAppApiPackageJsonFromNpm = pacote.manifest("@trackunit/iris-app-api");
|
|
61
|
+
const irisAppBuildUtilitiesPackageJsonFromNpm = pacote.manifest("@trackunit/iris-app-build-utilities");
|
|
62
|
+
const irisAppWebpackPluginPackageJsonFromNpm = pacote.manifest("@trackunit/iris-app-webpack-plugin");
|
|
63
|
+
const tuDevDependecies = {
|
|
63
64
|
"@trackunit/iris-app-api": (await irisAppApiPackageJsonFromNpm).version,
|
|
64
65
|
"@trackunit/iris-app-build-utilities": (await irisAppBuildUtilitiesPackageJsonFromNpm).version,
|
|
65
66
|
"@trackunit/iris-app-webpack-plugin": (await irisAppWebpackPluginPackageJsonFromNpm).version,
|
|
67
|
+
};
|
|
68
|
+
(0, devkit_1.addDependenciesToPackageJson)(tree, {
|
|
69
|
+
...(installTUPackages ? tuDependencies : {}),
|
|
70
|
+
tslib: "2.4.0",
|
|
71
|
+
}, {
|
|
72
|
+
...(installTUPackages ? tuDevDependecies : {}),
|
|
73
|
+
nx: "15.9.2",
|
|
66
74
|
"@nrwl/react": "15.9.2",
|
|
67
75
|
"@nrwl/workspace": "15.9.2",
|
|
68
76
|
"@nrwl/devkit": "15.9.2",
|
|
@@ -70,6 +78,7 @@ const IrisAppGenerator = async function (tree, options) {
|
|
|
70
78
|
"ts-morph": "15.1.0",
|
|
71
79
|
"esbuild-loader": "2.20.0",
|
|
72
80
|
"postcss-js": "4.0.0",
|
|
81
|
+
"copy-webpack-plugin": "11.0.0",
|
|
73
82
|
"postcss-loader": "6.2.1",
|
|
74
83
|
"postcss-nested": "5.0.6",
|
|
75
84
|
postcss: "8.4.19",
|
|
@@ -77,13 +86,12 @@ const IrisAppGenerator = async function (tree, options) {
|
|
|
77
86
|
"json-loader": "0.5.7",
|
|
78
87
|
autoprefixer: "10.4.13",
|
|
79
88
|
"css-loader": "6.4.0",
|
|
80
|
-
webpack: "5.
|
|
89
|
+
webpack: "5.80.0",
|
|
81
90
|
tailwindcss: "3.2.4",
|
|
82
91
|
"ts-node": "10.9.1",
|
|
83
92
|
typescript: "4.9.5",
|
|
84
|
-
"webpack-dev-server": "4.
|
|
85
|
-
"webpack-cli": "
|
|
86
|
-
"copy-webpack-plugin": "9.1.0",
|
|
93
|
+
"webpack-dev-server": "4.13.3",
|
|
94
|
+
"webpack-cli": "5.0.2",
|
|
87
95
|
});
|
|
88
96
|
}
|
|
89
97
|
(0, devkit_1.addProjectConfiguration)(tree, normalizedOptions.projectName, {
|
|
@@ -127,6 +135,8 @@ const IrisAppGenerator = async function (tree, options) {
|
|
|
127
135
|
await (0, devkit_1.formatFiles)(tree);
|
|
128
136
|
return () => {
|
|
129
137
|
(0, devkit_1.installPackagesTask)(tree, true);
|
|
138
|
+
// eslint-disable-next-line no-console
|
|
139
|
+
console.log("🥳 Successfully created an Iris App - review the iris-app-manifest.ts and start adding app extensions!");
|
|
130
140
|
};
|
|
131
141
|
};
|
|
132
142
|
exports.IrisAppGenerator = IrisAppGenerator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/generators/create/generator.ts"],"names":[],"mappings":";;;;AAAA,yCAWsB;AACtB,uDAAiC;AACjC,mDAA6B;AAW7B,SAAS,gBAAgB,CAAC,IAAU,EAAE,OAA+B;IACnE,MAAM,IAAI,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC;IAC1C,MAAM,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACvF,MAAM,QAAQ,GAAG,SAAS,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAC9E,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IAC5D,MAAM,Q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C,CAAC;IAClC,sDAAsD;IACtD,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAC;IAE3C,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IACxB,OAAO,GAAG,EAAE;QACV,IAAA,4BAAmB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC,CAAC;AACJ,CAAC,CAAC;AArGW,QAAA,gBAAgB,oBAqG3B;AAEF,kBAAe,wBAAgB,CAAC","sourcesContent":["import {\n addDependenciesToPackageJson,\n addProjectConfiguration,\n formatFiles,\n generateFiles,\n getWorkspaceLayout,\n installPackagesTask,\n names,\n offsetFromRoot,\n readJsonFile,\n Tree,\n} from \"@nrwl/devkit\";\nimport * as pacote from \"pacote\";\nimport * as path from \"path\";\nimport { IrisAppGeneratorSchema } from \"./schema\";\n\ninterface NormalizedSchema extends IrisAppGeneratorSchema {\n projectName: string;\n projectRoot: string;\n projectDirectory: string;\n toNxRoot: string;\n npmScope: string;\n}\n\nfunction normalizeOptions(tree: Tree, options: IrisAppGeneratorSchema): NormalizedSchema {\n const name = names(options.name).fileName;\n const projectDirectory = options.directory ? path.join(options.directory, name) : name;\n const toNxRoot = `../../${projectDirectory.indexOf(\"/\") !== -1 ? \"../\" : \"\"}`;\n const projectName = name.replace(new RegExp(\"/\", \"g\"), \"_\");\n const npmScope = getWorkspaceLayout(tree).npmScope;\n const projectRoot = `${getWorkspaceLayout(tree).appsDir}/${projectDirectory}`;\n return {\n ...options,\n projectName,\n projectRoot,\n projectDirectory,\n toNxRoot,\n npmScope,\n };\n}\n\nfunction addFiles(tree: Tree, options: NormalizedSchema) {\n const templateOptions = {\n ...options,\n ...names(options.name),\n offsetFromRoot: offsetFromRoot(options.projectRoot),\n template: \"\",\n };\n generateFiles(tree, path.join(__dirname, \"files\"), options.projectRoot, templateOptions);\n}\n\n/**\n * Iris App Generator.\n * This generator will create a new iris app, you can call this from your own generator.\n *\n * @param tree the nx tree\n * @param options the generator options\n * @returns { Promise<void> } void\n */\nexport const IrisAppGenerator = async function (tree: Tree, options: IrisAppGeneratorSchema) {\n const normalizedOptions = normalizeOptions(tree, options);\n const packageJsonFromNpm = await pacote.manifest(\"@trackunit/iris-app\");\n\n const packageJsonLocally = readJsonFile(path.join(__dirname, \"..\", \"..\", \"..\", \"package.json\"));\n\n if (options.updatePackageJson) {\n if (packageJsonFromNpm.version !== packageJsonLocally.version) {\n console.warn(\n `This version of the iris-app package does not match the version of the iris-app package from NPM JS. Please update using: npm i @trackunit/iris-app@${packageJsonFromNpm.version}`\n );\n }\n\n const reactComponentsPackageJsonFromNpm = pacote.manifest(\"@trackunit/react-components\");\n const reactCoreContextsPackageJsonFromNpm = pacote.manifest(\"@trackunit/react-core-contexts\");\n const cssComponentsPackageJsonFromNpm = pacote.manifest(\"@trackunit/css-components\");\n const cssTailwindPackageJsonFromNpm = pacote.manifest(\"@trackunit/css-tailwind\");\n const irisAppApiPackageJsonFromNpm = pacote.manifest(\"@trackunit/iris-app-api\");\n const irisAppBuildUtilitiesPackageJsonFromNpm = pacote.manifest(\"@trackunit/iris-app-build-utilities\");\n const irisAppWebpackPluginPackageJsonFromNpm = pacote.manifest(\"@trackunit/iris-app-webpack-plugin\");\n\n addDependenciesToPackageJson(\n tree,\n {\n tslib: \"2.4.0\",\n \"@trackunit/react-components\": (await reactComponentsPackageJsonFromNpm).version,\n \"@trackunit/react-core-contexts\": (await reactCoreContextsPackageJsonFromNpm).version,\n \"@trackunit/css-components\": (await cssComponentsPackageJsonFromNpm).version,\n \"@trackunit/css-tailwind\": (await cssTailwindPackageJsonFromNpm).version,\n },\n {\n \"@trackunit/iris-app-api\": (await irisAppApiPackageJsonFromNpm).version,\n \"@trackunit/iris-app-build-utilities\": (await irisAppBuildUtilitiesPackageJsonFromNpm).version,\n \"@trackunit/iris-app-webpack-plugin\": (await irisAppWebpackPluginPackageJsonFromNpm).version,\n \"@nrwl/react\": \"15.9.2\",\n \"@nrwl/workspace\": \"15.9.2\",\n \"@nrwl/devkit\": \"15.9.2\",\n eslint: \"8.35.0\",\n \"ts-morph\": \"15.1.0\",\n \"esbuild-loader\": \"2.20.0\",\n \"postcss-js\": \"4.0.0\",\n \"postcss-loader\": \"6.2.1\",\n \"postcss-nested\": \"5.0.6\",\n postcss: \"8.4.19\",\n \"style-loader\": \"3.3.0\",\n \"json-loader\": \"0.5.7\",\n autoprefixer: \"10.4.13\",\n \"css-loader\": \"6.4.0\",\n webpack: \"5.75.0\",\n tailwindcss: \"3.2.4\",\n \"ts-node\": \"10.9.1\",\n typescript: \"4.9.5\",\n \"webpack-dev-server\": \"4.10.0\",\n \"webpack-cli\": \"4.10.0\",\n \"copy-webpack-plugin\": \"9.1.0\",\n }\n );\n }\n addProjectConfiguration(tree, normalizedOptions.projectName, {\n root: normalizedOptions.projectRoot,\n projectType: \"application\",\n sourceRoot: `${normalizedOptions.projectRoot}/src`,\n targets: {\n build: {\n executor: \"@trackunit/iris-app:build\",\n options: {\n webpackConfig: `${normalizedOptions.projectRoot}/webpack.config.ts`,\n outputPath: `dist/${normalizedOptions.projectRoot}`,\n },\n outputs: [\"{options.outputPath}\"],\n },\n serve: {\n executor: \"@trackunit/iris-app:serve\",\n options: {\n webpackConfig: `${normalizedOptions.projectRoot}/webpack.config.ts`,\n },\n outputs: [\"{options.outputPath}\"],\n },\n publishApp: {\n executor: \"@trackunit/iris-app:publish\",\n options: {\n inputPath: `dist/${normalizedOptions.projectRoot}`,\n },\n dependsOn: [\n {\n target: \"build\",\n projects: \"self\",\n },\n ],\n outputs: [\"dist/\" + normalizedOptions.projectRoot],\n },\n },\n });\n addFiles(tree, normalizedOptions);\n // enforcing engine versions specified in package.json\n tree.write(\".npmrc\", \"engine-strict=true\");\n\n await formatFiles(tree);\n return () => {\n installPackagesTask(tree, true);\n };\n};\n\nexport default IrisAppGenerator;\n"]}
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/generators/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mB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAEhC,sCAAsC;QACtC,OAAO,CAAC,GAAG,CACT,wGAAwG,CACzG,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC;AArHW,QAAA,gBAAgB,oBAqH3B;AAEF,kBAAe,wBAAgB,CAAC","sourcesContent":["import {\n addDependenciesToPackageJson,\n addProjectConfiguration,\n formatFiles,\n generateFiles,\n getWorkspaceLayout,\n installPackagesTask,\n names,\n offsetFromRoot,\n readJsonFile,\n Tree,\n} from \"@nrwl/devkit\";\nimport * as pacote from \"pacote\";\nimport * as path from \"path\";\nimport { IrisAppGeneratorSchema } from \"./schema\";\n\ninterface NormalizedSchema extends IrisAppGeneratorSchema {\n projectName: string;\n projectRoot: string;\n projectDirectory: string;\n toNxRoot: string;\n npmScope: string;\n}\n\nfunction normalizeOptions(tree: Tree, options: IrisAppGeneratorSchema): NormalizedSchema {\n const name = names(options.name).fileName;\n const projectDirectory = options.directory ? path.join(options.directory, name) : name;\n const toNxRoot = `../../${projectDirectory.indexOf(\"/\") !== -1 ? \"../\" : \"\"}`;\n const projectName = name.replace(new RegExp(\"/\", \"g\"), \"_\");\n const npmScope = getWorkspaceLayout(tree).npmScope;\n const projectRoot = `${getWorkspaceLayout(tree).appsDir}/${projectDirectory}`;\n return {\n ...options,\n projectName,\n projectRoot,\n projectDirectory,\n toNxRoot,\n npmScope,\n };\n}\n\nfunction addFiles(tree: Tree, options: NormalizedSchema) {\n const templateOptions = {\n ...options,\n ...names(options.name),\n offsetFromRoot: offsetFromRoot(options.projectRoot),\n template: \"\",\n };\n generateFiles(tree, path.join(__dirname, \"files\"), options.projectRoot, templateOptions);\n}\n\n/**\n * Iris App Generator.\n * This generator will create a new iris app, you can call this from your own generator.\n *\n * @param tree the nx tree\n * @param options the generator options\n * @returns { Promise<void> } void\n */\nexport const IrisAppGenerator = async function (tree: Tree, options: IrisAppGeneratorSchema) {\n const normalizedOptions = normalizeOptions(tree, options);\n const packageJsonFromNpm = await pacote.manifest(\"@trackunit/iris-app\");\n\n const packageJsonLocally = readJsonFile(path.join(__dirname, \"..\", \"..\", \"..\", \"package.json\"));\n\n if (options.updatePackageJson) {\n if (packageJsonFromNpm.version !== packageJsonLocally.version) {\n console.warn(\n `This version of the iris-app package does not match the version of the iris-app package from NPM JS. Please update using: npm i @trackunit/iris-app@${packageJsonFromNpm.version}`\n );\n }\n\n const installTUPackages = process.env.INSTALL_TU_PACKAGES ? process.env.INSTALL_TU_PACKAGES === \"true\" : true;\n const reactComponentsPackageJsonFromNpm = pacote.manifest(\"@trackunit/react-components\");\n const reactCoreContextsPackageJsonFromNpm = pacote.manifest(\"@trackunit/react-core-contexts\");\n const cssComponentsPackageJsonFromNpm = pacote.manifest(\"@trackunit/css-components\");\n const cssTailwindPackageJsonFromNpm = pacote.manifest(\"@trackunit/css-tailwind\");\n\n const tuDependencies = {\n \"@trackunit/react-components\": (await reactComponentsPackageJsonFromNpm).version,\n \"@trackunit/react-core-contexts\": (await reactCoreContextsPackageJsonFromNpm).version,\n \"@trackunit/css-components\": (await cssComponentsPackageJsonFromNpm).version,\n \"@trackunit/css-tailwind\": (await cssTailwindPackageJsonFromNpm).version,\n };\n\n const irisAppApiPackageJsonFromNpm = pacote.manifest(\"@trackunit/iris-app-api\");\n const irisAppBuildUtilitiesPackageJsonFromNpm = pacote.manifest(\"@trackunit/iris-app-build-utilities\");\n const irisAppWebpackPluginPackageJsonFromNpm = pacote.manifest(\"@trackunit/iris-app-webpack-plugin\");\n\n const tuDevDependecies = {\n \"@trackunit/iris-app-api\": (await irisAppApiPackageJsonFromNpm).version,\n \"@trackunit/iris-app-build-utilities\": (await irisAppBuildUtilitiesPackageJsonFromNpm).version,\n \"@trackunit/iris-app-webpack-plugin\": (await irisAppWebpackPluginPackageJsonFromNpm).version,\n };\n\n addDependenciesToPackageJson(\n tree,\n {\n ...(installTUPackages ? tuDependencies : {}),\n tslib: \"2.4.0\",\n },\n {\n ...(installTUPackages ? tuDevDependecies : {}),\n nx: \"15.9.2\",\n \"@nrwl/react\": \"15.9.2\",\n \"@nrwl/workspace\": \"15.9.2\",\n \"@nrwl/devkit\": \"15.9.2\",\n eslint: \"8.35.0\",\n \"ts-morph\": \"15.1.0\",\n \"esbuild-loader\": \"2.20.0\",\n \"postcss-js\": \"4.0.0\",\n \"copy-webpack-plugin\": \"11.0.0\",\n \"postcss-loader\": \"6.2.1\",\n \"postcss-nested\": \"5.0.6\",\n postcss: \"8.4.19\",\n \"style-loader\": \"3.3.0\",\n \"json-loader\": \"0.5.7\",\n autoprefixer: \"10.4.13\",\n \"css-loader\": \"6.4.0\",\n webpack: \"5.80.0\",\n tailwindcss: \"3.2.4\",\n \"ts-node\": \"10.9.1\",\n typescript: \"4.9.5\",\n \"webpack-dev-server\": \"4.13.3\",\n \"webpack-cli\": \"5.0.2\",\n }\n );\n }\n addProjectConfiguration(tree, normalizedOptions.projectName, {\n root: normalizedOptions.projectRoot,\n projectType: \"application\",\n sourceRoot: `${normalizedOptions.projectRoot}/src`,\n targets: {\n build: {\n executor: \"@trackunit/iris-app:build\",\n options: {\n webpackConfig: `${normalizedOptions.projectRoot}/webpack.config.ts`,\n outputPath: `dist/${normalizedOptions.projectRoot}`,\n },\n outputs: [\"{options.outputPath}\"],\n },\n serve: {\n executor: \"@trackunit/iris-app:serve\",\n options: {\n webpackConfig: `${normalizedOptions.projectRoot}/webpack.config.ts`,\n },\n outputs: [\"{options.outputPath}\"],\n },\n publishApp: {\n executor: \"@trackunit/iris-app:publish\",\n options: {\n inputPath: `dist/${normalizedOptions.projectRoot}`,\n },\n dependsOn: [\n {\n target: \"build\",\n projects: \"self\",\n },\n ],\n outputs: [\"dist/\" + normalizedOptions.projectRoot],\n },\n },\n });\n addFiles(tree, normalizedOptions);\n // enforcing engine versions specified in package.json\n tree.write(\".npmrc\", \"engine-strict=true\");\n\n await formatFiles(tree);\n return () => {\n installPackagesTask(tree, true);\n\n // eslint-disable-next-line no-console\n console.log(\n \"🥳 Successfully created an Iris App - review the iris-app-manifest.ts and start adding app extensions!\"\n );\n };\n};\n\nexport default IrisAppGenerator;\n"]}
|
|
@@ -119,6 +119,8 @@ const IrisAppExtensionGenerator = async function (tree, options) {
|
|
|
119
119
|
await (0, devkit_1.formatFiles)(tree);
|
|
120
120
|
return () => {
|
|
121
121
|
(0, devkit_1.installPackagesTask)(tree, true);
|
|
122
|
+
// eslint-disable-next-line no-console
|
|
123
|
+
console.log("🥳 Successfully created an app extensions and it is already added to the Iris App!");
|
|
122
124
|
};
|
|
123
125
|
};
|
|
124
126
|
exports.IrisAppExtensionGenerator = IrisAppExtensionGenerator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/generators/extend/generator.ts"],"names":[],"mappings":";;;;AAAA,yCAWsB;AACtB,iCAAqD;AACrD,yCAAsC;AACtC,uCAA+C;AAE/C,kEAAkC;AAClC,uCAAkC;AAClC,+CAAyB;AACzB,mDAA6B;AAC7B,uCAAqD;AACrD,uDAA+D;AAC/D,yDAA2D;AAC3D,iDAAmE;AAYnE,SAAS,gBAAgB,CAAC,IAAU,EAAE,OAAwC;IAC5E,MAAM,IAAI,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC;IAC1C,MAAM,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACnG,MAAM,WAAW,GAAG,gBAAgB,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IACxE,MAAM,gBAAgB,GAAG,IAAA,mBAAS,EAAC,IAAI,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,IAAA,2BAAkB,EA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AM;YACL,MAAM,YAAY,GAAG;gBACnB,IAAI,EAAE,KAAK;gBACX,OAAO,EAAE,qCAAqC;gBAC9C,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC;aACpC,CAAC;YACF,MAAM,IAAA,iBAAM,EAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,MAAc,EAAE,EAAE;gBACjD,2DAA2D;gBAC3D,OAAO,CAAC,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;YAC9B,CAAC,CAAC,CAAC;SACJ;KACF;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,kBAAe,iCAAyB,CAAC","sourcesContent":["import {\n addDependenciesToPackageJson,\n formatFiles,\n generateFiles,\n getWorkspaceLayout,\n installPackagesTask,\n joinPathFragments,\n names,\n offsetFromRoot,\n Tree,\n updateJson,\n} from \"@nrwl/devkit\";\nimport { getRootTsConfigPathInTree } from \"@nrwl/js\";\nimport { Linter } from \"@nrwl/linter\";\nimport { libraryGenerator } from \"@nrwl/react\";\nimport { Schema } from \"@nrwl/react/src/generators/library/schema\";\nimport camelCase from \"camelcase\";\nimport { prompt } from \"enquirer\";\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport { Node, Project, SyntaxKind } from \"ts-morph\";\nimport { addPropertyWithName } from \"../../utils/ast/astUtils\";\nimport { updateFileInTree } from \"../../utils/fileUpdater\";\nimport { spaDependencies, testDependencies } from \"./dependencies\";\nimport { IrisAppExtensionGeneratorSchema } from \"./schema\";\n\ninterface NormalizedSchema extends IrisAppExtensionGeneratorSchema {\n projectName: string;\n projectRoot: string;\n projectDirectory: string;\n projectCamelcase: string;\n importPath: string;\n sourceRoot: string;\n}\n\nfunction normalizeOptions(tree: Tree, options: IrisAppExtensionGeneratorSchema): NormalizedSchema {\n const name = names(options.name).fileName;\n const projectDirectory = options.directory ? `${names(options.directory).fileName}/${name}` : name;\n const projectName = projectDirectory.replace(new RegExp(\"/\", \"g\"), \"-\");\n const projectCamelcase = camelCase(name);\n const wsLayout = getWorkspaceLayout(tree);\n const projectRoot = `${wsLayout.libsDir}/${projectDirectory}`;\n const sourceRoot = `${wsLayout.libsDir}/${projectDirectory}/src`;\n const importPath = `@${wsLayout.npmScope}/${projectDirectory}`;\n\n return {\n ...options,\n projectName,\n projectRoot,\n projectDirectory,\n projectCamelcase,\n importPath,\n sourceRoot,\n };\n}\n\n/**\n * Iris App Extension Generator.\n *\n * @param tree the nx tree\n * @param options the generator options\n * @returns { Promise<void> } void\n */\nexport const IrisAppExtensionGenerator = async function (tree: Tree, options: IrisAppExtensionGeneratorSchema) {\n const adjustedOptions = await updateAppName(tree, options);\n\n const normalizedOptions = normalizeOptions(tree, adjustedOptions);\n\n const templateOptions = {\n ...normalizedOptions,\n ...names(normalizedOptions.name),\n offsetFromRoot: offsetFromRoot(normalizedOptions.projectRoot),\n template: \"\",\n };\n const irisAppExtensionType = normalizedOptions.type;\n\n if (!tree.exists(`${getWorkspaceLayout(tree).appsDir}/${normalizedOptions.app}`)) {\n throw new Error(\n `The app does not exist: ${getWorkspaceLayout(tree).appsDir}/${\n normalizedOptions.app\n } make sure you enter the right app name`\n );\n }\n\n const manifestPath = `${getWorkspaceLayout(tree).appsDir}/${normalizedOptions.app}/iris-app-manifest.ts`;\n if (!tree.exists(manifestPath)) {\n throw new Error(\n `The app does not have an iris-app-manifest.ts: ${manifestPath} make sure you enter the right app name, which has an iris-app-manifest.ts`\n );\n }\n generateFiles(\n tree,\n path.join(__dirname, \"files\", irisAppExtensionType),\n normalizedOptions.projectRoot,\n templateOptions\n );\n\n if (normalizedOptions.updatePackageJson) {\n addDependenciesToPackageJson(\n tree,\n {},\n {\n ...spaDependencies,\n ...testDependencies,\n }\n );\n }\n\n const schema: Schema = {\n name: normalizedOptions.name,\n style: \"none\",\n skipFormat: false,\n strict: true,\n unitTestRunner: \"jest\",\n linter: Linter.EsLint,\n routing: false,\n pascalCaseFiles: true,\n directory: normalizedOptions.directory,\n skipTsConfig: false,\n skipPackageJson: true,\n standaloneConfig: true,\n };\n await libraryGenerator(tree, schema);\n\n if (irisAppExtensionType !== \"REPORT_EXTENSION\") {\n generateFiles(tree, path.join(__dirname, \"files\", \"react-app\"), normalizedOptions.projectRoot, templateOptions);\n }\n\n const rootTsConfigPath = getRootTsConfigPathInTree(tree);\n if (!rootTsConfigPath) {\n throw new Error(\"Could not find root tsconfig.json\");\n }\n updateJson(tree, rootTsConfigPath, tsConfigBase => {\n tsConfigBase.compilerOptions.paths[normalizedOptions.importPath] = [\n path.join(normalizedOptions.projectRoot, \"extension-manifest.ts\"),\n ];\n return tsConfigBase;\n });\n\n //TODO: Change the following to update the manifest in the virtual Tree - not on the file system.\n const project = new Project({\n tsConfigFilePath: `${getWorkspaceLayout(tree).appsDir}/${normalizedOptions.app}/tsconfig.app.json`,\n });\n\n const manifest = project.getSourceFileOrThrow(manifestPath);\n\n manifest.addImportDeclaration({\n moduleSpecifier: normalizedOptions.importPath,\n defaultImport: normalizedOptions.projectCamelcase,\n });\n\n manifest.forEachDescendant(node => {\n if (Node.isPropertyAssignment(node)) {\n if (node.getText().indexOf(\"extensions\") !== -1) {\n const array = node.getFirstChildByKindOrThrow(SyntaxKind.ArrayLiteralExpression);\n array.addElement(`${normalizedOptions.projectCamelcase}`);\n }\n }\n });\n await manifest.save();\n\n tree.delete(joinPathFragments(normalizedOptions.projectRoot, \"src\", \"index.ts\"));\n\n updateJson(tree, joinPathFragments(normalizedOptions.projectRoot, \"tsconfig.lib.json\"), tsConfigLib => {\n tsConfigLib.include = [...tsConfigLib.include, \"extension-manifest.ts\"];\n return tsConfigLib;\n });\n\n updateFileInTree(tree, joinPathFragments(normalizedOptions.projectRoot, \"jest.config.ts\"), fileContent =>\n addPropertyWithName(fileContent, \"moduleNameMapper\", { \"@trackunit/css-core\": \"jest-transform-stub\" })\n );\n\n await formatFiles(tree);\n return () => {\n installPackagesTask(tree, true);\n };\n};\nconst updateAppName = async (tree: Tree, options: IrisAppExtensionGeneratorSchema) => {\n if (!options.app) {\n const folders = fs\n .readdirSync(getWorkspaceLayout(tree).appsDir, { withFileTypes: true })\n .filter(item => item.isDirectory());\n\n const tileApps: string[] = [];\n\n folders.forEach(folder => {\n const irisAppManifest = fs\n .readdirSync(`${getWorkspaceLayout(tree).appsDir}/${folder.name}`, { withFileTypes: true })\n .find(item => item.name === \"iris-app-manifest.ts\");\n\n if (irisAppManifest) {\n tileApps.push(folder.name);\n } else {\n const subFolders = fs\n .readdirSync(path.join(getWorkspaceLayout(tree).appsDir, folder.name), { withFileTypes: true })\n .filter(item => item.isDirectory());\n subFolders.forEach(subFolder => {\n const subDirIrisAppManifest = fs\n .readdirSync(`${getWorkspaceLayout(tree).appsDir}/${folder.name}/${subFolder.name}`, {\n withFileTypes: true,\n })\n .find(item => item.name === \"iris-app-manifest.ts\");\n\n if (subDirIrisAppManifest) {\n tileApps.push(path.join(folder.name, subFolder.name));\n }\n });\n }\n });\n\n if (tileApps.length === 1) {\n options.app = tileApps[0];\n } else if (tileApps.length === 0) {\n throw new Error(\"Please add an iris-app using: nx g @trackunit/iris-app:create \");\n } else {\n const promptObject = {\n name: \"app\",\n message: \"Select iris-app for this extension:\",\n type: \"select\",\n choices: tileApps.map(item => item),\n };\n await prompt(promptObject).then((values: object) => {\n // eslint-disable-next-line @typescript-eslint/dot-notation\n options.app = values[\"app\"];\n });\n }\n }\n return options;\n};\n\nexport default IrisAppExtensionGenerator;\n"]}
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/generators/extend/generator.ts"],"names":[],"mappings":";;;;AAAA,yCAWsB;AACtB,iCAAqD;AACrD,yCAAsC;AACtC,uCAA+C;AAE/C,kEAAkC;AAClC,uCAAkC;AAClC,+CAAyB;AACzB,mDAA6B;AAC7B,uCAAqD;AACrD,uDAA+D;AAC/D,yDAA2D;AAC3D,iDAAmE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I,IAAI,SAAS,CAAC,IAAI,EAAE,EAAE;wBACnF,aAAa,EAAE,IAAI;qBACpB,CAAC;yBACD,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,sBAAsB,CAAC,CAAC;oBAEtD,IAAI,qBAAqB,EAAE;wBACzB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;qBACvD;gBACH,CAAC,CAAC,CAAC;aACJ;QACH,CAAC,CAAC,CAAC;QAEH,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YACzB,OAAO,CAAC,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;SAC3B;aAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAChC,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;SACnF;aAAM;YACL,MAAM,YAAY,GAAG;gBACnB,IAAI,EAAE,KAAK;gBACX,OAAO,EAAE,qCAAqC;gBAC9C,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC;aACpC,CAAC;YACF,MAAM,IAAA,iBAAM,EAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,MAAc,EAAE,EAAE;gBACjD,2DAA2D;gBAC3D,OAAO,CAAC,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;YAC9B,CAAC,CAAC,CAAC;SACJ;KACF;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,kBAAe,iCAAyB,CAAC","sourcesContent":["import {\n addDependenciesToPackageJson,\n formatFiles,\n generateFiles,\n getWorkspaceLayout,\n installPackagesTask,\n joinPathFragments,\n names,\n offsetFromRoot,\n Tree,\n updateJson,\n} from \"@nrwl/devkit\";\nimport { getRootTsConfigPathInTree } from \"@nrwl/js\";\nimport { Linter } from \"@nrwl/linter\";\nimport { libraryGenerator } from \"@nrwl/react\";\nimport { Schema } from \"@nrwl/react/src/generators/library/schema\";\nimport camelCase from \"camelcase\";\nimport { prompt } from \"enquirer\";\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport { Node, Project, SyntaxKind } from \"ts-morph\";\nimport { addPropertyWithName } from \"../../utils/ast/astUtils\";\nimport { updateFileInTree } from \"../../utils/fileUpdater\";\nimport { spaDependencies, testDependencies } from \"./dependencies\";\nimport { IrisAppExtensionGeneratorSchema } from \"./schema\";\n\ninterface NormalizedSchema extends IrisAppExtensionGeneratorSchema {\n projectName: string;\n projectRoot: string;\n projectDirectory: string;\n projectCamelcase: string;\n importPath: string;\n sourceRoot: string;\n}\n\nfunction normalizeOptions(tree: Tree, options: IrisAppExtensionGeneratorSchema): NormalizedSchema {\n const name = names(options.name).fileName;\n const projectDirectory = options.directory ? `${names(options.directory).fileName}/${name}` : name;\n const projectName = projectDirectory.replace(new RegExp(\"/\", \"g\"), \"-\");\n const projectCamelcase = camelCase(name);\n const wsLayout = getWorkspaceLayout(tree);\n const projectRoot = `${wsLayout.libsDir}/${projectDirectory}`;\n const sourceRoot = `${wsLayout.libsDir}/${projectDirectory}/src`;\n const importPath = `@${wsLayout.npmScope}/${projectDirectory}`;\n\n return {\n ...options,\n projectName,\n projectRoot,\n projectDirectory,\n projectCamelcase,\n importPath,\n sourceRoot,\n };\n}\n\n/**\n * Iris App Extension Generator.\n *\n * @param tree the nx tree\n * @param options the generator options\n * @returns { Promise<void> } void\n */\nexport const IrisAppExtensionGenerator = async function (tree: Tree, options: IrisAppExtensionGeneratorSchema) {\n const adjustedOptions = await updateAppName(tree, options);\n\n const normalizedOptions = normalizeOptions(tree, adjustedOptions);\n\n const templateOptions = {\n ...normalizedOptions,\n ...names(normalizedOptions.name),\n offsetFromRoot: offsetFromRoot(normalizedOptions.projectRoot),\n template: \"\",\n };\n const irisAppExtensionType = normalizedOptions.type;\n\n if (!tree.exists(`${getWorkspaceLayout(tree).appsDir}/${normalizedOptions.app}`)) {\n throw new Error(\n `The app does not exist: ${getWorkspaceLayout(tree).appsDir}/${\n normalizedOptions.app\n } make sure you enter the right app name`\n );\n }\n\n const manifestPath = `${getWorkspaceLayout(tree).appsDir}/${normalizedOptions.app}/iris-app-manifest.ts`;\n if (!tree.exists(manifestPath)) {\n throw new Error(\n `The app does not have an iris-app-manifest.ts: ${manifestPath} make sure you enter the right app name, which has an iris-app-manifest.ts`\n );\n }\n generateFiles(\n tree,\n path.join(__dirname, \"files\", irisAppExtensionType),\n normalizedOptions.projectRoot,\n templateOptions\n );\n\n if (normalizedOptions.updatePackageJson) {\n addDependenciesToPackageJson(\n tree,\n {},\n {\n ...spaDependencies,\n ...testDependencies,\n }\n );\n }\n\n const schema: Schema = {\n name: normalizedOptions.name,\n style: \"none\",\n skipFormat: false,\n strict: true,\n unitTestRunner: \"jest\",\n linter: Linter.EsLint,\n routing: false,\n pascalCaseFiles: true,\n directory: normalizedOptions.directory,\n skipTsConfig: false,\n skipPackageJson: true,\n standaloneConfig: true,\n };\n await libraryGenerator(tree, schema);\n\n if (irisAppExtensionType !== \"REPORT_EXTENSION\") {\n generateFiles(tree, path.join(__dirname, \"files\", \"react-app\"), normalizedOptions.projectRoot, templateOptions);\n }\n\n const rootTsConfigPath = getRootTsConfigPathInTree(tree);\n if (!rootTsConfigPath) {\n throw new Error(\"Could not find root tsconfig.json\");\n }\n updateJson(tree, rootTsConfigPath, tsConfigBase => {\n tsConfigBase.compilerOptions.paths[normalizedOptions.importPath] = [\n path.join(normalizedOptions.projectRoot, \"extension-manifest.ts\"),\n ];\n return tsConfigBase;\n });\n\n //TODO: Change the following to update the manifest in the virtual Tree - not on the file system.\n const project = new Project({\n tsConfigFilePath: `${getWorkspaceLayout(tree).appsDir}/${normalizedOptions.app}/tsconfig.app.json`,\n });\n\n const manifest = project.getSourceFileOrThrow(manifestPath);\n\n manifest.addImportDeclaration({\n moduleSpecifier: normalizedOptions.importPath,\n defaultImport: normalizedOptions.projectCamelcase,\n });\n\n manifest.forEachDescendant(node => {\n if (Node.isPropertyAssignment(node)) {\n if (node.getText().indexOf(\"extensions\") !== -1) {\n const array = node.getFirstChildByKindOrThrow(SyntaxKind.ArrayLiteralExpression);\n array.addElement(`${normalizedOptions.projectCamelcase}`);\n }\n }\n });\n await manifest.save();\n\n tree.delete(joinPathFragments(normalizedOptions.projectRoot, \"src\", \"index.ts\"));\n\n updateJson(tree, joinPathFragments(normalizedOptions.projectRoot, \"tsconfig.lib.json\"), tsConfigLib => {\n tsConfigLib.include = [...tsConfigLib.include, \"extension-manifest.ts\"];\n return tsConfigLib;\n });\n\n updateFileInTree(tree, joinPathFragments(normalizedOptions.projectRoot, \"jest.config.ts\"), fileContent =>\n addPropertyWithName(fileContent, \"moduleNameMapper\", { \"@trackunit/css-core\": \"jest-transform-stub\" })\n );\n\n await formatFiles(tree);\n return () => {\n installPackagesTask(tree, true);\n // eslint-disable-next-line no-console\n console.log(\"🥳 Successfully created an app extensions and it is already added to the Iris App!\");\n };\n};\nconst updateAppName = async (tree: Tree, options: IrisAppExtensionGeneratorSchema) => {\n if (!options.app) {\n const folders = fs\n .readdirSync(getWorkspaceLayout(tree).appsDir, { withFileTypes: true })\n .filter(item => item.isDirectory());\n\n const tileApps: string[] = [];\n\n folders.forEach(folder => {\n const irisAppManifest = fs\n .readdirSync(`${getWorkspaceLayout(tree).appsDir}/${folder.name}`, { withFileTypes: true })\n .find(item => item.name === \"iris-app-manifest.ts\");\n\n if (irisAppManifest) {\n tileApps.push(folder.name);\n } else {\n const subFolders = fs\n .readdirSync(path.join(getWorkspaceLayout(tree).appsDir, folder.name), { withFileTypes: true })\n .filter(item => item.isDirectory());\n subFolders.forEach(subFolder => {\n const subDirIrisAppManifest = fs\n .readdirSync(`${getWorkspaceLayout(tree).appsDir}/${folder.name}/${subFolder.name}`, {\n withFileTypes: true,\n })\n .find(item => item.name === \"iris-app-manifest.ts\");\n\n if (subDirIrisAppManifest) {\n tileApps.push(path.join(folder.name, subFolder.name));\n }\n });\n }\n });\n\n if (tileApps.length === 1) {\n options.app = tileApps[0];\n } else if (tileApps.length === 0) {\n throw new Error(\"Please add an iris-app using: nx g @trackunit/iris-app:create \");\n } else {\n const promptObject = {\n name: \"app\",\n message: \"Select iris-app for this extension:\",\n type: \"select\",\n choices: tileApps.map(item => item),\n };\n await prompt(promptObject).then((values: object) => {\n // eslint-disable-next-line @typescript-eslint/dot-notation\n options.app = values[\"app\"];\n });\n }\n }\n return options;\n};\n\nexport default IrisAppExtensionGenerator;\n"]}
|