@trackunit/iris-app 1.11.49 → 1.11.51
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/executors.json +0 -10
- package/package.json +5 -11
- package/src/executors/utils/irisAppServerSettings.d.ts +0 -7
- package/src/executors/utils/irisAppServerSettings.js +2 -3
- package/src/executors/utils/irisAppServerSettings.js.map +1 -1
- package/src/generators/create/files/tsconfig.json__template__ +3 -0
- package/src/generators/create/files/tsconfig.spec.json__template__ +7 -0
- package/src/generators/create/files/vite.config.ts__template__ +6 -0
- package/src/generators/create/generator.js +8 -28
- package/src/generators/create/generator.js.map +1 -1
- package/src/executors/build/executor.d.ts +0 -16
- package/src/executors/build/executor.js +0 -99
- package/src/executors/build/executor.js.map +0 -1
- package/src/executors/build/schema.d.ts +0 -4
- package/src/executors/build/schema.json +0 -20
- package/src/executors/build/webpack.d.ts +0 -11
- package/src/executors/build/webpack.js +0 -44
- package/src/executors/build/webpack.js.map +0 -1
- package/src/executors/serve/executor.d.ts +0 -12
- package/src/executors/serve/executor.js +0 -91
- package/src/executors/serve/executor.js.map +0 -1
- package/src/executors/serve/schema.d.ts +0 -3
- package/src/executors/serve/schema.json +0 -20
- package/src/executors/serve/webpackDevServer.d.ts +0 -14
- package/src/executors/serve/webpackDevServer.js +0 -39
- package/src/executors/serve/webpackDevServer.js.map +0 -1
- package/src/executors/utils/defaultWebpackConfig.d.ts +0 -15
- package/src/executors/utils/defaultWebpackConfig.js +0 -159
- package/src/executors/utils/defaultWebpackConfig.js.map +0 -1
- package/src/generators/create/files/rspack.config.ts__template__ +0 -5
- package/src/generators/create/files/tailwind.config.js__template__ +0 -6
- package/src/utils/addDevDependency.d.ts +0 -17
- package/src/utils/addDevDependency.js +0 -51
- package/src/utils/addDevDependency.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
## 1.11.51 (2026-02-26)
|
|
2
|
+
|
|
3
|
+
### 🧱 Updated Dependencies
|
|
4
|
+
|
|
5
|
+
- Updated iris-app-build-utilities to 1.12.50
|
|
6
|
+
- Updated iris-app-api to 1.14.45
|
|
7
|
+
- Updated react-test-setup to 1.8.45
|
|
8
|
+
- Updated shared-utils to 1.13.45
|
|
9
|
+
|
|
10
|
+
## 1.11.50 (2026-02-25)
|
|
11
|
+
|
|
12
|
+
### 🧱 Updated Dependencies
|
|
13
|
+
|
|
14
|
+
- Updated iris-app-build-utilities to 1.12.49
|
|
15
|
+
- Updated iris-app-webpack-plugin to 1.11.49
|
|
16
|
+
- Updated iris-app-api to 1.14.44
|
|
17
|
+
- Updated react-test-setup to 1.8.44
|
|
18
|
+
- Updated shared-utils to 1.13.44
|
|
19
|
+
|
|
1
20
|
## 1.11.49 (2026-02-25)
|
|
2
21
|
|
|
3
22
|
### 🧱 Updated Dependencies
|
package/executors.json
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/schema",
|
|
3
3
|
"executors": {
|
|
4
|
-
"serve": {
|
|
5
|
-
"implementation": "./src/executors/serve/executor",
|
|
6
|
-
"schema": "./src/executors/serve/schema.json",
|
|
7
|
-
"description": "serve executor"
|
|
8
|
-
},
|
|
9
|
-
"build": {
|
|
10
|
-
"implementation": "./src/executors/build/executor",
|
|
11
|
-
"schema": "./src/executors/build/schema.json",
|
|
12
|
-
"description": "build executor"
|
|
13
|
-
},
|
|
14
4
|
"submit": {
|
|
15
5
|
"implementation": "./src/executors/submit/executor",
|
|
16
6
|
"schema": "./src/executors/submit/schema.json",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/iris-app",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.51",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"generators": "./generators.json",
|
|
@@ -11,14 +11,9 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"pacote": "^21.0.4",
|
|
14
|
-
"rxjs": "7.8.1",
|
|
15
|
-
"webpack-dev-server": "5.2.1",
|
|
16
|
-
"webpack": "5.101.3",
|
|
17
|
-
"@npm/types": "^1.0.2",
|
|
18
14
|
"libnpmpublish": "^11.1.3",
|
|
19
15
|
"open": "^10.2.0",
|
|
20
16
|
"semver": "7.5.4",
|
|
21
|
-
"copy-webpack-plugin": "11.0.0",
|
|
22
17
|
"string-ts": "^2.0.0",
|
|
23
18
|
"ts-morph": "^20.0.0",
|
|
24
19
|
"@phenomnomnominal/tsquery": "^6.1.3",
|
|
@@ -29,13 +24,12 @@
|
|
|
29
24
|
"@nx/react": "22.4.4",
|
|
30
25
|
"nx": "22.4.4",
|
|
31
26
|
"@npmcli/arborist": "^9.1.9",
|
|
32
|
-
"webpack-bundle-analyzer": "^4.8.0",
|
|
33
27
|
"win-ca": "^3.5.1",
|
|
34
|
-
"@trackunit/shared-utils": "1.13.
|
|
35
|
-
"@trackunit/iris-app-api": "1.14.
|
|
36
|
-
"@trackunit/iris-app-webpack-plugin": "1.11.48",
|
|
28
|
+
"@trackunit/shared-utils": "1.13.45",
|
|
29
|
+
"@trackunit/iris-app-api": "1.14.45",
|
|
37
30
|
"tslib": "^2.6.2",
|
|
38
|
-
"@clack/prompts": "^1.0.0"
|
|
31
|
+
"@clack/prompts": "^1.0.0",
|
|
32
|
+
"@npm/types": "^1.0.2"
|
|
39
33
|
},
|
|
40
34
|
"types": "./src/index.d.ts",
|
|
41
35
|
"type": "commonjs"
|
|
@@ -8,10 +8,3 @@ export type Settings = {
|
|
|
8
8
|
* Provides the settings for the Iris App server based on the environment.
|
|
9
9
|
*/
|
|
10
10
|
export declare function getSettings(): Settings;
|
|
11
|
-
/**
|
|
12
|
-
* Provides the base URL for the Iris App server based on the environment.
|
|
13
|
-
*
|
|
14
|
-
* @param {string} env The environment to get the base URL for.
|
|
15
|
-
* @returns {URL} The base URL for the Iris App server.
|
|
16
|
-
*/
|
|
17
|
-
export declare function getBaseUrl(env: string): URL;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getSettings = getSettings;
|
|
4
|
-
exports.getBaseUrl = getBaseUrl;
|
|
5
4
|
/**
|
|
6
5
|
* Provides the settings for the Iris App server based on the environment.
|
|
7
6
|
*/
|
|
@@ -22,7 +21,7 @@ function getSettings() {
|
|
|
22
21
|
* @param {string} env The environment to get the base URL for.
|
|
23
22
|
* @returns {URL} The base URL for the Iris App server.
|
|
24
23
|
*/
|
|
25
|
-
|
|
24
|
+
const getBaseUrl = (env) => {
|
|
26
25
|
switch (env.toUpperCase()) {
|
|
27
26
|
case "PROD":
|
|
28
27
|
return new URL(process.env.BASE_URL ?? "https://iris.trackunit.app/");
|
|
@@ -33,5 +32,5 @@ function getBaseUrl(env) {
|
|
|
33
32
|
default:
|
|
34
33
|
throw new Error(`Unknown environment: ${env}`);
|
|
35
34
|
}
|
|
36
|
-
}
|
|
35
|
+
};
|
|
37
36
|
//# sourceMappingURL=irisAppServerSettings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"irisAppServerSettings.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/executors/utils/irisAppServerSettings.ts"],"names":[],"mappings":";;AAUA,kCAWC;
|
|
1
|
+
{"version":3,"file":"irisAppServerSettings.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/executors/utils/irisAppServerSettings.ts"],"names":[],"mappings":";;AAUA,kCAWC;AAdD;;GAEG;AACH,SAAgB,WAAW;IACzB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,MAAM,CAAC;IACxD,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;IAChC,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,WAAW,EAAE,KAAK,QAAQ,CAAC;IAE3F,OAAO;QACL,WAAW,EAAE,IAAI,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC;QACzC,OAAO,EAAE,IAAI,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC;QAClC,GAAG;QACH,cAAc;KACf,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,EAAE;IACjC,QAAQ,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC;QAC1B,KAAK,MAAM;YACT,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,6BAA6B,CAAC,CAAC;QACxE,KAAK,OAAO;YACV,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,mCAAmC,CAAC,CAAC;QAC9E,KAAK,KAAK;YACR,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,iCAAiC,CAAC,CAAC;QAC5E;YACE,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,EAAE,CAAC,CAAC;IACnD,CAAC;AACH,CAAC,CAAA","sourcesContent":["export type Settings = {\n approvalUrl: URL;\n repoUrl: URL;\n env: string;\n devTermsAccept: boolean;\n};\n\n/**\n * Provides the settings for the Iris App server based on the environment.\n */\nexport function getSettings(): Settings {\n const env = process.env.TU_ENV?.toUpperCase() ?? \"PROD\";\n const baseUrl = getBaseUrl(env);\n const devTermsAccept = process.env.TU_DEV_TERMS_AND_CONDITIONS?.toLowerCase() === \"accept\";\n\n return {\n approvalUrl: new URL(\"approve/\", baseUrl),\n repoUrl: new URL(\"repo/\", baseUrl),\n env,\n devTermsAccept,\n };\n}\n\n/**\n * Provides the base URL for the Iris App server based on the environment.\n *\n * @param {string} env The environment to get the base URL for.\n * @returns {URL} The base URL for the Iris App server.\n */\nconst getBaseUrl = (env: string) => {\n switch (env.toUpperCase()) {\n case \"PROD\":\n return new URL(process.env.BASE_URL ?? \"https://iris.trackunit.app/\");\n case \"STAGE\":\n return new URL(process.env.BASE_URL ?? \"https://stage.iris.trackunit.app/\");\n case \"DEV\":\n return new URL(process.env.BASE_URL ?? \"https://dev.iris.trackunit.app/\");\n default:\n throw new Error(`Unknown environment: ${env}`);\n }\n}\n"]}
|
|
@@ -64,17 +64,11 @@ const IrisAppGenerator = async function (tree, options) {
|
|
|
64
64
|
"@trackunit/react-core-contexts": (await reactCoreContextsPackageJsonFromNpm).version,
|
|
65
65
|
"@trackunit/css-core": (await cssCorePackageJsonFromNpm).version,
|
|
66
66
|
};
|
|
67
|
-
const
|
|
68
|
-
const irisAppSdkRspackPackageJsonFromNpm = getManifest("@trackunit/iris-app-sdk-rspack");
|
|
69
|
-
const irisAppBuildUtilitiesPackageJsonFromNpm = getManifest("@trackunit/iris-app-build-utilities");
|
|
70
|
-
const irisAppWebpackPluginPackageJsonFromNpm = getManifest("@trackunit/iris-app-webpack-plugin");
|
|
67
|
+
const irisAppSdkVitePackageJsonFromNpm = getManifest("@trackunit/iris-app-sdk-vite");
|
|
71
68
|
const reactCoreContextsTestPackageJsonFromNpm = getManifest("@trackunit/react-core-contexts-test");
|
|
72
69
|
const reactTestSetupPackageJsonFromNpm = getManifest("@trackunit/react-test-setup");
|
|
73
70
|
const tuDevDependencies = {
|
|
74
|
-
"@trackunit/iris-app-
|
|
75
|
-
"@trackunit/iris-app-sdk-rspack": (await irisAppSdkRspackPackageJsonFromNpm).version,
|
|
76
|
-
"@trackunit/iris-app-build-utilities": (await irisAppBuildUtilitiesPackageJsonFromNpm).version,
|
|
77
|
-
"@trackunit/iris-app-webpack-plugin": (await irisAppWebpackPluginPackageJsonFromNpm).version,
|
|
71
|
+
"@trackunit/iris-app-sdk-vite": (await irisAppSdkVitePackageJsonFromNpm).version,
|
|
78
72
|
"@trackunit/react-core-contexts-test": (await reactCoreContextsTestPackageJsonFromNpm).version,
|
|
79
73
|
"@trackunit/react-test-setup": (await reactTestSetupPackageJsonFromNpm).version,
|
|
80
74
|
};
|
|
@@ -83,6 +77,7 @@ const IrisAppGenerator = async function (tree, options) {
|
|
|
83
77
|
tslib: "2.4.0",
|
|
84
78
|
react: "19.0.0",
|
|
85
79
|
"react-dom": "19.0.0",
|
|
80
|
+
"single-spa-react": "5.1.4"
|
|
86
81
|
}, {
|
|
87
82
|
...tuDevDependencies,
|
|
88
83
|
nx: "22.4.4",
|
|
@@ -97,22 +92,7 @@ const IrisAppGenerator = async function (tree, options) {
|
|
|
97
92
|
"eslint-plugin-import": "2.32.0",
|
|
98
93
|
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
99
94
|
"typescript-eslint": "8.54.0",
|
|
100
|
-
|
|
101
|
-
"esbuild-loader": "4.3.0",
|
|
102
|
-
"copy-webpack-plugin": "11.0.0",
|
|
103
|
-
"postcss-loader": "7.3.3",
|
|
104
|
-
"style-loader": "3.3.3",
|
|
105
|
-
"json-loader": "0.5.7",
|
|
106
|
-
"css-loader": "6.8.1",
|
|
107
|
-
webpack: "5.101.3",
|
|
108
|
-
tailwindcss: "^4.1.18",
|
|
109
|
-
"@tailwindcss/postcss": "^4.1.18",
|
|
110
|
-
"ts-node": "10.9.1",
|
|
111
|
-
typescript: "5.9.3",
|
|
112
|
-
"webpack-dev-server": "5.2.1",
|
|
113
|
-
"webpack-cli": "5.0.2",
|
|
114
|
-
"single-spa-react": "5.1.4",
|
|
115
|
-
ajv: "8.12.0",
|
|
95
|
+
typescript: "5.9.3"
|
|
116
96
|
});
|
|
117
97
|
(0, devkit_1.updateJson)(tree, "package.json", packageJson => {
|
|
118
98
|
packageJson.overrides = {
|
|
@@ -129,17 +109,17 @@ const IrisAppGenerator = async function (tree, options) {
|
|
|
129
109
|
sourceRoot: `${normalizedOptions.projectRoot}/src`,
|
|
130
110
|
targets: {
|
|
131
111
|
build: {
|
|
132
|
-
executor: "@trackunit/iris-app-sdk-
|
|
112
|
+
executor: "@trackunit/iris-app-sdk-vite:build",
|
|
133
113
|
options: {
|
|
134
|
-
|
|
114
|
+
viteConfig: `${normalizedOptions.projectRoot}/vite.config.ts`,
|
|
135
115
|
outputPath: `dist/${normalizedOptions.projectRoot}`,
|
|
136
116
|
},
|
|
137
117
|
outputs: ["{options.outputPath}"],
|
|
138
118
|
},
|
|
139
119
|
serve: {
|
|
140
|
-
executor: "@trackunit/iris-app-sdk-
|
|
120
|
+
executor: "@trackunit/iris-app-sdk-vite:serve",
|
|
141
121
|
options: {
|
|
142
|
-
|
|
122
|
+
viteConfig: `${normalizedOptions.projectRoot}/vite.config.ts`,
|
|
143
123
|
},
|
|
144
124
|
outputs: ["{options.outputPath}"],
|
|
145
125
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/generators/create/generator.ts"],"names":[],"mappings":";;;;AAAA,uCAYoB;AACpB,+EAA0E;AAE1E,uDAAiC;AACjC,mDAA6B;AAe7B,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,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AC,WAAW,EAAE;iBACnD;gBACD,SAAS,EAAE;oBACT;wBACE,MAAM,EAAE,OAAO;qBAChB;iBACF;gBACD,OAAO,EAAE,CAAC,uBAAuB,GAAG,iBAAiB,CAAC,WAAW,CAAC;aACnE;SACF;KACF,CAAC,CAAC;IACH,QAAQ,CAAC,IAAI,EAAE,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;IACtD,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;QAEhC,sCAAsC;QACtC,OAAO,CAAC,GAAG,CACT,wGAAwG,CACzG,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC;AAjJW,QAAA,gBAAgB,oBAiJ3B;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 updateJson,\n} from \"@nx/devkit\";\nimport { getNpmScope } from \"@nx/js/src/utils/package-json/get-npm-scope\";\nimport { PackageJson as PackageJsonBase } from \"nx/src/utils/package-json\";\nimport * as pacote from \"pacote\";\nimport * as path from \"path\";\nimport { IrisAppGeneratorSchema } from \"./schema\";\n\ntype PackageJson = PackageJsonBase & {\n engines?: Record<string, string>;\n};\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 = getNpmScope(tree);\n if (!npmScope) {\n throw new Error(\"Could not find npm scope in package.json\");\n }\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, packageJson: PackageJson | null) {\n const nodeVersion = packageJson?.engines?.node ?? \">=20.x\";\n const templateOptions = {\n ...options,\n ...names(options.name),\n offsetFromRoot: offsetFromRoot(options.projectRoot),\n template: \"\",\n nodeVersion,\n };\n generateFiles(tree, path.join(__dirname, \"files\"), options.projectRoot, templateOptions);\n}\n\nconst getManifest = (packageName: string) => {\n return pacote.manifest(\n packageName,\n process.env.TU_NPM_REGISTRY ? { registry: process.env.TU_NPM_REGISTRY } : undefined\n );\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 getManifest(\"@trackunit/iris-app\");\n\n const packageJsonLocally: PackageJson = readJsonFile(path.join(__dirname, \"..\", \"..\", \"..\", \"package.json\"));\n\n if (options.updatePackageJson) {\n if (packageJsonFromNpm.version !== packageJsonLocally.version) {\n // eslint-disable-next-line no-console\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 = getManifest(\"@trackunit/react-components\");\n const reactCoreContextsPackageJsonFromNpm = getManifest(\"@trackunit/react-core-contexts\");\n const cssCorePackageJsonFromNpm = getManifest(\"@trackunit/css-core\");\n\n const tuDependencies = {\n \"@trackunit/react-components\": (await reactComponentsPackageJsonFromNpm).version,\n \"@trackunit/react-core-contexts\": (await reactCoreContextsPackageJsonFromNpm).version,\n \"@trackunit/css-core\": (await cssCorePackageJsonFromNpm).version,\n };\n\n const irisAppApiPackageJsonFromNpm = getManifest(\"@trackunit/iris-app-api\");\n const irisAppSdkRspackPackageJsonFromNpm = getManifest(\"@trackunit/iris-app-sdk-rspack\");\n const irisAppBuildUtilitiesPackageJsonFromNpm = getManifest(\"@trackunit/iris-app-build-utilities\");\n const irisAppWebpackPluginPackageJsonFromNpm = getManifest(\"@trackunit/iris-app-webpack-plugin\");\n const reactCoreContextsTestPackageJsonFromNpm = getManifest(\"@trackunit/react-core-contexts-test\");\n const reactTestSetupPackageJsonFromNpm = getManifest(\"@trackunit/react-test-setup\");\n\n const tuDevDependencies = {\n \"@trackunit/iris-app-api\": (await irisAppApiPackageJsonFromNpm).version,\n \"@trackunit/iris-app-sdk-rspack\": (await irisAppSdkRspackPackageJsonFromNpm).version,\n \"@trackunit/iris-app-build-utilities\": (await irisAppBuildUtilitiesPackageJsonFromNpm).version,\n \"@trackunit/iris-app-webpack-plugin\": (await irisAppWebpackPluginPackageJsonFromNpm).version,\n \"@trackunit/react-core-contexts-test\": (await reactCoreContextsTestPackageJsonFromNpm).version,\n \"@trackunit/react-test-setup\": (await reactTestSetupPackageJsonFromNpm).version,\n };\n\n addDependenciesToPackageJson(\n tree,\n {\n ...tuDependencies,\n tslib: \"2.4.0\",\n react: \"19.0.0\",\n \"react-dom\": \"19.0.0\",\n },\n {\n ...tuDevDependencies,\n nx: \"22.4.4\",\n \"@nx/react\": \"22.4.4\",\n \"@nx/workspace\": \"22.4.4\",\n \"@nx/devkit\": \"22.4.4\",\n \"@nx/eslint-plugin\": \"22.4.4\",\n \"@types/react\": \"19.0.8\",\n eslint: \"9.33.0\",\n \"eslint-plugin-react-hooks\": \"7.0.1\",\n \"eslint-plugin-react\": \"7.37.5\",\n \"eslint-plugin-import\": \"2.32.0\",\n \"eslint-plugin-jsx-a11y\": \"6.10.2\",\n \"typescript-eslint\": \"8.54.0\",\n \"ts-morph\": \"20.0.0\",\n \"esbuild-loader\": \"4.3.0\",\n \"copy-webpack-plugin\": \"11.0.0\",\n \"postcss-loader\": \"7.3.3\",\n \"style-loader\": \"3.3.3\",\n \"json-loader\": \"0.5.7\",\n \"css-loader\": \"6.8.1\",\n webpack: \"5.101.3\",\n tailwindcss: \"^4.1.18\",\n \"@tailwindcss/postcss\": \"^4.1.18\",\n \"ts-node\": \"10.9.1\",\n typescript: \"5.9.3\",\n \"webpack-dev-server\": \"5.2.1\",\n \"webpack-cli\": \"5.0.2\",\n \"single-spa-react\": \"5.1.4\",\n ajv: \"8.12.0\",\n }\n );\n\n updateJson(tree, \"package.json\", packageJson => {\n packageJson.overrides = {\n react: \"19.0.0\", // to avoid resolution warnings when running npm install\n \"react-dom\": \"19.0.0\", // fix resolution warnings and test\n \"zod-validation-error\": \"4.0.2\",\n };\n return packageJson;\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-sdk-rspack:build\",\n options: {\n rspackConfig: `${normalizedOptions.projectRoot}/rspack.config.ts`,\n outputPath: `dist/${normalizedOptions.projectRoot}`,\n },\n outputs: [\"{options.outputPath}\"],\n },\n serve: {\n executor: \"@trackunit/iris-app-sdk-rspack:serve\",\n options: {\n rspackConfig: `${normalizedOptions.projectRoot}/rspack.config.ts`,\n },\n outputs: [\"{options.outputPath}\"],\n },\n submitApp: {\n executor: \"@trackunit/iris-app:submit\",\n dependsOn: [\"build\"],\n options: {\n inputPath: `dist/${normalizedOptions.projectRoot}`,\n },\n outputs: [\"{workspaceRoot}/dist/\" + normalizedOptions.projectRoot],\n },\n unpublishApp: {\n executor: \"@trackunit/iris-app:unpublish\",\n options: {\n inputPath: `dist/${normalizedOptions.projectRoot}`,\n },\n dependsOn: [\n {\n target: \"build\",\n },\n ],\n outputs: [\"{workspaceRoot}/dist/\" + normalizedOptions.projectRoot],\n },\n },\n });\n addFiles(tree, normalizedOptions, packageJsonLocally);\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"]}
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/generators/create/generator.ts"],"names":[],"mappings":";;;;AAAA,uCAYoB;AACpB,+EAA0E;AAE1E,uDAAiC;AACjC,mDAA6B;AAe7B,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,QAAQ,GAAG,IAAA,2BAAW,EAAC,IAAI,CAAC,CAAC;IACnC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC;IACD,MAAM,WAAW,GAAG,GAAG,I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aAClC;YACD,SAAS,EAAE;gBACT,QAAQ,EAAE,4BAA4B;gBACtC,SAAS,EAAE,CAAC,OAAO,CAAC;gBACpB,OAAO,EAAE;oBACP,SAAS,EAAE,QAAQ,iBAAiB,CAAC,WAAW,EAAE;iBACnD;gBACD,OAAO,EAAE,CAAC,uBAAuB,GAAG,iBAAiB,CAAC,WAAW,CAAC;aACnE;YACD,YAAY,EAAE;gBACZ,QAAQ,EAAE,+BAA+B;gBACzC,OAAO,EAAE;oBACP,SAAS,EAAE,QAAQ,iBAAiB,CAAC,WAAW,EAAE;iBACnD;gBACD,SAAS,EAAE;oBACT;wBACE,MAAM,EAAE,OAAO;qBAChB;iBACF;gBACD,OAAO,EAAE,CAAC,uBAAuB,GAAG,iBAAiB,CAAC,WAAW,CAAC;aACnE;SACF;KACF,CAAC,CAAC;IACH,QAAQ,CAAC,IAAI,EAAE,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;IACtD,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;QAEhC,sCAAsC;QACtC,OAAO,CAAC,GAAG,CACT,wGAAwG,CACzG,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC;AA7HW,QAAA,gBAAgB,oBA6H3B;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 updateJson,\n} from \"@nx/devkit\";\nimport { getNpmScope } from \"@nx/js/src/utils/package-json/get-npm-scope\";\nimport { PackageJson as PackageJsonBase } from \"nx/src/utils/package-json\";\nimport * as pacote from \"pacote\";\nimport * as path from \"path\";\nimport { IrisAppGeneratorSchema } from \"./schema\";\n\ntype PackageJson = PackageJsonBase & {\n engines?: Record<string, string>;\n};\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 = getNpmScope(tree);\n if (!npmScope) {\n throw new Error(\"Could not find npm scope in package.json\");\n }\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, packageJson: PackageJson | null) {\n const nodeVersion = packageJson?.engines?.node ?? \">=20.x\";\n const templateOptions = {\n ...options,\n ...names(options.name),\n offsetFromRoot: offsetFromRoot(options.projectRoot),\n template: \"\",\n nodeVersion,\n };\n generateFiles(tree, path.join(__dirname, \"files\"), options.projectRoot, templateOptions);\n}\n\nconst getManifest = (packageName: string) => {\n return pacote.manifest(\n packageName,\n process.env.TU_NPM_REGISTRY ? { registry: process.env.TU_NPM_REGISTRY } : undefined\n );\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 getManifest(\"@trackunit/iris-app\");\n\n const packageJsonLocally: PackageJson = readJsonFile(path.join(__dirname, \"..\", \"..\", \"..\", \"package.json\"));\n\n if (options.updatePackageJson) {\n if (packageJsonFromNpm.version !== packageJsonLocally.version) {\n // eslint-disable-next-line no-console\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 = getManifest(\"@trackunit/react-components\");\n const reactCoreContextsPackageJsonFromNpm = getManifest(\"@trackunit/react-core-contexts\");\n const cssCorePackageJsonFromNpm = getManifest(\"@trackunit/css-core\");\n\n const tuDependencies = {\n \"@trackunit/react-components\": (await reactComponentsPackageJsonFromNpm).version,\n \"@trackunit/react-core-contexts\": (await reactCoreContextsPackageJsonFromNpm).version,\n \"@trackunit/css-core\": (await cssCorePackageJsonFromNpm).version,\n };\n\n const irisAppSdkVitePackageJsonFromNpm = getManifest(\"@trackunit/iris-app-sdk-vite\");\n const reactCoreContextsTestPackageJsonFromNpm = getManifest(\"@trackunit/react-core-contexts-test\");\n const reactTestSetupPackageJsonFromNpm = getManifest(\"@trackunit/react-test-setup\");\n\n const tuDevDependencies = {\n \"@trackunit/iris-app-sdk-vite\": (await irisAppSdkVitePackageJsonFromNpm).version,\n \"@trackunit/react-core-contexts-test\": (await reactCoreContextsTestPackageJsonFromNpm).version,\n \"@trackunit/react-test-setup\": (await reactTestSetupPackageJsonFromNpm).version,\n };\n\n addDependenciesToPackageJson(\n tree,\n {\n ...tuDependencies,\n tslib: \"2.4.0\",\n react: \"19.0.0\",\n \"react-dom\": \"19.0.0\",\n \"single-spa-react\": \"5.1.4\"\n },\n {\n ...tuDevDependencies, \n nx: \"22.4.4\",\n \"@nx/react\": \"22.4.4\",\n \"@nx/workspace\": \"22.4.4\",\n \"@nx/devkit\": \"22.4.4\",\n \"@nx/eslint-plugin\": \"22.4.4\",\n \"@types/react\": \"19.0.8\",\n eslint: \"9.33.0\",\n \"eslint-plugin-react-hooks\": \"7.0.1\",\n \"eslint-plugin-react\": \"7.37.5\",\n \"eslint-plugin-import\": \"2.32.0\",\n \"eslint-plugin-jsx-a11y\": \"6.10.2\",\n \"typescript-eslint\": \"8.54.0\",\n typescript: \"5.9.3\"\n }\n );\n\n updateJson(tree, \"package.json\", packageJson => {\n packageJson.overrides = {\n react: \"19.0.0\", // to avoid resolution warnings when running npm install\n \"react-dom\": \"19.0.0\", // fix resolution warnings and test\n \"zod-validation-error\": \"4.0.2\",\n };\n return packageJson;\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-sdk-vite:build\",\n options: {\n viteConfig: `${normalizedOptions.projectRoot}/vite.config.ts`,\n outputPath: `dist/${normalizedOptions.projectRoot}`,\n },\n outputs: [\"{options.outputPath}\"],\n },\n serve: {\n executor: \"@trackunit/iris-app-sdk-vite:serve\",\n options: {\n viteConfig: `${normalizedOptions.projectRoot}/vite.config.ts`,\n },\n outputs: [\"{options.outputPath}\"],\n },\n submitApp: {\n executor: \"@trackunit/iris-app:submit\",\n dependsOn: [\"build\"],\n options: {\n inputPath: `dist/${normalizedOptions.projectRoot}`,\n },\n outputs: [\"{workspaceRoot}/dist/\" + normalizedOptions.projectRoot],\n },\n unpublishApp: {\n executor: \"@trackunit/iris-app:unpublish\",\n options: {\n inputPath: `dist/${normalizedOptions.projectRoot}`,\n },\n dependsOn: [\n {\n target: \"build\",\n },\n ],\n outputs: [\"{workspaceRoot}/dist/\" + normalizedOptions.projectRoot],\n },\n },\n });\n addFiles(tree, normalizedOptions, packageJsonLocally);\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"]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ExecutorContext } from "@nx/devkit";
|
|
2
|
-
import "webpack-dev-server";
|
|
3
|
-
import "win-ca";
|
|
4
|
-
import { BuildExecutorSchema } from "./schema";
|
|
5
|
-
export type NodeBuildEvent = {
|
|
6
|
-
outfile: string;
|
|
7
|
-
success: boolean;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Build executor for building iris apps.
|
|
11
|
-
*
|
|
12
|
-
* @param {BuildExecutorSchema} options build executor options for this nx executor
|
|
13
|
-
* @param {ExecutorContext} context build executor context for this nx executor
|
|
14
|
-
* @yields {NodeBuildEvent} the build event
|
|
15
|
-
*/
|
|
16
|
-
export default function (options: BuildExecutorSchema, context: ExecutorContext): AsyncGenerator<any, any, any>;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = default_1;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const rxjs_for_await_1 = require("@nx/devkit/src/utils/rxjs-for-await");
|
|
6
|
-
const iris_app_build_utilities_1 = require("@trackunit/iris-app-build-utilities");
|
|
7
|
-
const fs_1 = require("fs");
|
|
8
|
-
const path_1 = require("path");
|
|
9
|
-
const op = tslib_1.__importStar(require("rxjs/operators"));
|
|
10
|
-
require("webpack-dev-server");
|
|
11
|
-
require("win-ca");
|
|
12
|
-
const defaultWebpackConfig_1 = require("../utils/defaultWebpackConfig");
|
|
13
|
-
const webpack_1 = require("./webpack");
|
|
14
|
-
const deleteOutputDir = (root, outputPath) => {
|
|
15
|
-
const resolvedOutputPath = (0, path_1.resolve)(root, outputPath);
|
|
16
|
-
if (resolvedOutputPath === root) {
|
|
17
|
-
throw new Error("Output path MUST not be project root directory!");
|
|
18
|
-
}
|
|
19
|
-
(0, fs_1.rmSync)(resolvedOutputPath, { recursive: true, force: true });
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Build executor for building iris apps.
|
|
23
|
-
*
|
|
24
|
-
* @param {BuildExecutorSchema} options build executor options for this nx executor
|
|
25
|
-
* @param {ExecutorContext} context build executor context for this nx executor
|
|
26
|
-
* @yields {NodeBuildEvent} the build event
|
|
27
|
-
*/
|
|
28
|
-
async function* default_1(options, context) {
|
|
29
|
-
// eslint-disable-next-line no-console
|
|
30
|
-
console.warn(`
|
|
31
|
-
================================================================================
|
|
32
|
-
⚠️ Deprecation Notice ⚠️
|
|
33
|
-
================================================================================
|
|
34
|
-
|
|
35
|
-
The NX executor "@trackunit/iris-app:build" is **deprecated** and will be
|
|
36
|
-
removed in the next major version of the Iris App SDK.
|
|
37
|
-
|
|
38
|
-
Please update your "project.json" to make the following changes:
|
|
39
|
-
|
|
40
|
-
1. Update the executor:
|
|
41
|
-
Replace "@trackunit/iris-app:build" with:
|
|
42
|
-
👉 "@trackunit/iris-app-sdk-rspack:build"
|
|
43
|
-
|
|
44
|
-
2. Update the property name:
|
|
45
|
-
Replace the "webpackConfig" property with:
|
|
46
|
-
👉 "rspackConfig"
|
|
47
|
-
|
|
48
|
-
3. Rename the configuration file:
|
|
49
|
-
Rename your "webpack.config.ts" file to:
|
|
50
|
-
👉 "rspack.config.ts"
|
|
51
|
-
|
|
52
|
-
Use the following content in the renamed file:
|
|
53
|
-
|
|
54
|
-
import { Configuration } from "@rspack/core";
|
|
55
|
-
|
|
56
|
-
export default async (configuration: Configuration) => {
|
|
57
|
-
return configuration;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
4. Install the new dependency:
|
|
61
|
-
Add the following package to your project:
|
|
62
|
-
👉 "@trackunit/iris-app-sdk-rspack"
|
|
63
|
-
|
|
64
|
-
================================================================================
|
|
65
|
-
🚀 Update now to ensure compatibility! 🚀 ... its also faster!
|
|
66
|
-
================================================================================
|
|
67
|
-
|
|
68
|
-
`);
|
|
69
|
-
await (0, iris_app_build_utilities_1.checkPackageVersion)(false);
|
|
70
|
-
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
71
|
-
const projectRootDir = (0, path_1.join)(context.root, projectRoot);
|
|
72
|
-
const tileManifestPath = (0, path_1.join)(context.root, projectRoot, "iris-app-manifest.ts");
|
|
73
|
-
(0, iris_app_build_utilities_1.enableTsConfigPath)({
|
|
74
|
-
projectRootDir,
|
|
75
|
-
});
|
|
76
|
-
if (!options.webpackConfig) {
|
|
77
|
-
throw new Error("option.webpackConfig is required");
|
|
78
|
-
}
|
|
79
|
-
const IrisAppManifest = (await Promise.resolve(`${tileManifestPath}`).then(s => tslib_1.__importStar(require(s)))).default;
|
|
80
|
-
const defaultConfig = (0, defaultWebpackConfig_1.getDefaultConfig)("production", context.root, projectRootDir, IrisAppManifest);
|
|
81
|
-
const customConfigFile = await Promise.resolve(`${options.webpackConfig}`).then(s => tslib_1.__importStar(require(s)));
|
|
82
|
-
let config = customConfigFile.default(await defaultConfig);
|
|
83
|
-
const isPromise = config instanceof Promise;
|
|
84
|
-
if (isPromise) {
|
|
85
|
-
config = await config;
|
|
86
|
-
}
|
|
87
|
-
deleteOutputDir(context.root, options.outputPath);
|
|
88
|
-
const observable = (0, webpack_1.doRunWebpack)(config).pipe(op.tap(stats => {
|
|
89
|
-
// eslint-disable-next-line no-console
|
|
90
|
-
console.info(stats.toString(config.stats));
|
|
91
|
-
}), op.map(stats => {
|
|
92
|
-
return {
|
|
93
|
-
success: !stats.hasErrors(),
|
|
94
|
-
outfile: (0, path_1.resolve)(context.root, options.outputPath),
|
|
95
|
-
};
|
|
96
|
-
}));
|
|
97
|
-
return yield* (0, rxjs_for_await_1.eachValueFrom)(observable);
|
|
98
|
-
}
|
|
99
|
-
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/executors/build/executor.ts"],"names":[],"mappings":";;AAmCA,4BA6EC;;AA9GD,wEAAoE;AACpE,kFAA8F;AAC9F,2BAA4B;AAC5B,+BAAqC;AAErC,2DAAqC;AAEr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AAE,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,eAAe,CAAC,CAAC;IAEpG,MAAM,gBAAgB,GAAG,yBAAa,OAAO,CAAC,aAAa,+CAAC,CAAC;IAE7D,IAAI,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,MAAM,aAAa,CAAC,CAAC;IAC3D,MAAM,SAAS,GAAG,MAAM,YAAY,OAAO,CAAC;IAC5C,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,GAAG,MAAM,MAAM,CAAC;IACxB,CAAC;IACD,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAClD,MAAM,UAAU,GAAG,IAAA,sBAAY,EAAC,MAAM,CAAC,CAAC,IAAI,CAC1C,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QACb,sCAAsC;QACtC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,EACF,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QACb,OAAO;YACL,OAAO,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE;YAC3B,OAAO,EAAE,IAAA,cAAO,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC;SACjC,CAAC;IACtB,CAAC,CAAC,CACH,CAAC;IACF,OAAO,KAAK,CAAC,CAAC,IAAA,8BAAa,EAAC,UAAwC,CAAC,CAAC;AACxE,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ExecutorContext } from \"@nx/devkit\";\nimport { eachValueFrom } from \"@nx/devkit/src/utils/rxjs-for-await\";\nimport { checkPackageVersion, enableTsConfigPath } from \"@trackunit/iris-app-build-utilities\";\nimport { rmSync } from \"fs\";\nimport { join, resolve } from \"path\";\nimport { Observable } from \"rxjs\";\nimport * as op from \"rxjs/operators\";\n\nimport \"webpack-dev-server\";\nimport \"win-ca\";\nimport { getDefaultConfig } from \"../utils/defaultWebpackConfig\";\nimport { BuildExecutorSchema } from \"./schema\";\nimport { doRunWebpack } from \"./webpack\";\n\nexport type NodeBuildEvent = {\n outfile: string;\n success: boolean;\n};\n\nconst deleteOutputDir = (root: string, outputPath: string) => {\n const resolvedOutputPath = resolve(root, outputPath);\n if (resolvedOutputPath === root) {\n throw new Error(\"Output path MUST not be project root directory!\");\n }\n rmSync(resolvedOutputPath, { recursive: true, force: true });\n};\n\n/**\n * Build executor for building iris apps.\n *\n * @param {BuildExecutorSchema} options build executor options for this nx executor\n * @param {ExecutorContext} context build executor context for this nx executor\n * @yields {NodeBuildEvent} the build event\n */\nexport default async function* (options: BuildExecutorSchema, context: ExecutorContext) {\n // eslint-disable-next-line no-console\n console.warn(\n `\n================================================================================\n ⚠️ Deprecation Notice ⚠️\n================================================================================\n\nThe NX executor \"@trackunit/iris-app:build\" is **deprecated** and will be\nremoved in the next major version of the Iris App SDK.\n\nPlease update your \"project.json\" to make the following changes:\n\n 1. Update the executor:\n Replace \"@trackunit/iris-app:build\" with:\n 👉 \"@trackunit/iris-app-sdk-rspack:build\"\n\n 2. Update the property name:\n Replace the \"webpackConfig\" property with:\n 👉 \"rspackConfig\"\n\n 3. Rename the configuration file:\n Rename your \"webpack.config.ts\" file to:\n 👉 \"rspack.config.ts\"\n\n Use the following content in the renamed file:\n\n import { Configuration } from \"@rspack/core\";\n\n export default async (configuration: Configuration) => {\n return configuration;\n };\n\n 4. Install the new dependency:\n Add the following package to your project:\n 👉 \"@trackunit/iris-app-sdk-rspack\"\n\n================================================================================\n 🚀 Update now to ensure compatibility! 🚀 ... its also faster!\n================================================================================\n\n`\n );\n await checkPackageVersion(false);\n const projectRoot = context.projectsConfigurations.projects[context.projectName!]!.root;\n const projectRootDir = join(context.root, projectRoot);\n const tileManifestPath = join(context.root, projectRoot, \"iris-app-manifest.ts\");\n enableTsConfigPath({\n projectRootDir,\n });\n if (!options.webpackConfig) {\n throw new Error(\"option.webpackConfig is required\");\n }\n const IrisAppManifest = (await import(tileManifestPath)).default;\n const defaultConfig = getDefaultConfig(\"production\", context.root, projectRootDir, IrisAppManifest);\n\n const customConfigFile = await import(options.webpackConfig);\n\n let config = customConfigFile.default(await defaultConfig);\n const isPromise = config instanceof Promise;\n if (isPromise) {\n config = await config;\n }\n deleteOutputDir(context.root, options.outputPath);\n const observable = doRunWebpack(config).pipe(\n op.tap(stats => {\n // eslint-disable-next-line no-console\n console.info(stats.toString(config.stats));\n }),\n op.map(stats => {\n return {\n success: !stats.hasErrors(),\n outfile: resolve(context.root, options.outputPath),\n } as NodeBuildEvent;\n })\n );\n return yield* eachValueFrom(observable as unknown as Observable<any>);\n}\n"]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 2,
|
|
3
|
-
"outputCapture": "direct-nodejs",
|
|
4
|
-
"$schema": "http://json-schema.org/schema",
|
|
5
|
-
"title": "Build executor for apps from the Iris App SDK",
|
|
6
|
-
"description": "",
|
|
7
|
-
"type": "object",
|
|
8
|
-
"properties": {
|
|
9
|
-
"webpackConfig": {
|
|
10
|
-
"type": "string",
|
|
11
|
-
"description": "",
|
|
12
|
-
"$default": {
|
|
13
|
-
"$source": "argv",
|
|
14
|
-
"index": 0
|
|
15
|
-
},
|
|
16
|
-
"x-prompt": "What is the path for the webpack config for this app?"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
"required": []
|
|
20
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
import webpack = require("webpack");
|
|
3
|
-
type WebpackConfiguration = webpack.Configuration;
|
|
4
|
-
/**
|
|
5
|
-
* Run webpack with the given configuration.
|
|
6
|
-
*
|
|
7
|
-
* @param {WebpackConfiguration} config the webpack configuration
|
|
8
|
-
* @returns {*} {Observable<any>}
|
|
9
|
-
*/
|
|
10
|
-
export declare function doRunWebpack(config: WebpackConfiguration): Observable<webpack.Stats>;
|
|
11
|
-
export {};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.doRunWebpack = doRunWebpack;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
6
|
-
const webpack = require("webpack");
|
|
7
|
-
/**
|
|
8
|
-
* Run webpack with the given configuration.
|
|
9
|
-
*
|
|
10
|
-
* @param {WebpackConfiguration} config the webpack configuration
|
|
11
|
-
* @returns {*} {Observable<any>}
|
|
12
|
-
*/
|
|
13
|
-
function doRunWebpack(config) {
|
|
14
|
-
return new rxjs_1.Observable(subscriber => {
|
|
15
|
-
const { watch, ...normalizedConfig } = config;
|
|
16
|
-
const webpackCompiler = webpack(normalizedConfig);
|
|
17
|
-
if (webpackCompiler === null) {
|
|
18
|
-
throw new Error("Failed to run webpack. Webpack compiler was null");
|
|
19
|
-
}
|
|
20
|
-
const callback = (err, stats) => {
|
|
21
|
-
if (err) {
|
|
22
|
-
subscriber.error(err);
|
|
23
|
-
}
|
|
24
|
-
subscriber.next(stats);
|
|
25
|
-
};
|
|
26
|
-
if (config.watch) {
|
|
27
|
-
const watchOptions = config.watchOptions || {};
|
|
28
|
-
const watching = webpackCompiler.watch(watchOptions, callback);
|
|
29
|
-
return () => watching.close(() => subscriber.complete());
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
return webpackCompiler.run((err, stats) => {
|
|
33
|
-
callback(err, stats);
|
|
34
|
-
webpackCompiler.close((closeErr) => {
|
|
35
|
-
if (closeErr) {
|
|
36
|
-
subscriber.error(closeErr);
|
|
37
|
-
}
|
|
38
|
-
subscriber.complete();
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=webpack.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"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CAAC;wBACb,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;oBAC7B,CAAC;oBACD,UAAU,CAAC,QAAQ,EAAE,CAAC;gBACxB,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { Observable } from \"rxjs\";\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nimport webpack = require(\"webpack\");\n\ntype WebpackConfiguration = webpack.Configuration;\n\n/**\n * Run webpack with the given configuration.\n *\n * @param {WebpackConfiguration} config the webpack configuration\n * @returns {*} {Observable<any>}\n */\nexport function doRunWebpack(config: WebpackConfiguration): Observable<webpack.Stats> {\n return new Observable(subscriber => {\n const { watch, ...normalizedConfig } = config;\n const webpackCompiler = webpack(normalizedConfig);\n\n if (webpackCompiler === null) {\n throw new Error(\"Failed to run webpack. Webpack compiler was null\");\n }\n\n const callback = (err: Error | null | undefined, stats: webpack.Stats | undefined) => {\n if (err) {\n subscriber.error(err);\n }\n subscriber.next(stats);\n };\n\n if (config.watch) {\n const watchOptions = config.watchOptions || {};\n const watching = webpackCompiler.watch(watchOptions, callback);\n return () => watching.close(() => subscriber.complete());\n } else {\n return webpackCompiler.run((err: Error | null | undefined, stats: webpack.Stats | undefined) => {\n callback(err, stats);\n webpackCompiler.close((closeErr: Error | null | undefined) => {\n if (closeErr) {\n subscriber.error(closeErr);\n }\n subscriber.complete();\n });\n });\n }\n });\n}"]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ExecutorContext } from "@nx/devkit";
|
|
2
|
-
import "webpack-dev-server";
|
|
3
|
-
import "win-ca";
|
|
4
|
-
import { ServeExecutorSchema } from "./schema";
|
|
5
|
-
/**
|
|
6
|
-
* Serve executor for serving iris apps.
|
|
7
|
-
*
|
|
8
|
-
* @param {ServeExecutorSchema} options serve executor options for this nx executor
|
|
9
|
-
* @param {ExecutorContext} context serve executor context for this nx executor
|
|
10
|
-
* @yields {AsyncGenerator<any, void, unknown>} the serve observable
|
|
11
|
-
*/
|
|
12
|
-
export default function (options: ServeExecutorSchema, context: ExecutorContext): AsyncGenerator<any, any, any>;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = default_1;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const rxjs_for_await_1 = require("@nx/devkit/src/utils/rxjs-for-await");
|
|
6
|
-
const iris_app_build_utilities_1 = require("@trackunit/iris-app-build-utilities");
|
|
7
|
-
const path_1 = require("path");
|
|
8
|
-
const op = tslib_1.__importStar(require("rxjs/operators"));
|
|
9
|
-
require("webpack-dev-server");
|
|
10
|
-
require("win-ca");
|
|
11
|
-
const defaultWebpackConfig_1 = require("../utils/defaultWebpackConfig");
|
|
12
|
-
const webpackDevServer_1 = require("./webpackDevServer");
|
|
13
|
-
/**
|
|
14
|
-
* Serve executor for serving iris apps.
|
|
15
|
-
*
|
|
16
|
-
* @param {ServeExecutorSchema} options serve executor options for this nx executor
|
|
17
|
-
* @param {ExecutorContext} context serve executor context for this nx executor
|
|
18
|
-
* @yields {AsyncGenerator<any, void, unknown>} the serve observable
|
|
19
|
-
*/
|
|
20
|
-
async function* default_1(options, context) {
|
|
21
|
-
// eslint-disable-next-line no-console
|
|
22
|
-
console.warn(`
|
|
23
|
-
================================================================================
|
|
24
|
-
⚠️ Deprecation Notice ⚠️
|
|
25
|
-
================================================================================
|
|
26
|
-
|
|
27
|
-
The NX executor "@trackunit/iris-app:serve" is **deprecated** and will be
|
|
28
|
-
removed in the next major version of the Iris App SDK.
|
|
29
|
-
|
|
30
|
-
Please update your "project.json" to make the following changes:
|
|
31
|
-
|
|
32
|
-
1. Update the executor:
|
|
33
|
-
Replace "@trackunit/iris-app:serve" with:
|
|
34
|
-
👉 "@trackunit/iris-app-sdk-rspack:serve"
|
|
35
|
-
|
|
36
|
-
2. Update the property name:
|
|
37
|
-
Replace the "webpackConfig" property with:
|
|
38
|
-
👉 "rspackConfig"
|
|
39
|
-
|
|
40
|
-
3. Rename the configuration file:
|
|
41
|
-
Rename your "webpack.config.ts" file to:
|
|
42
|
-
👉 "rspack.config.ts"
|
|
43
|
-
|
|
44
|
-
Use the following content in the renamed file:
|
|
45
|
-
|
|
46
|
-
import { Configuration } from "@rspack/core";
|
|
47
|
-
|
|
48
|
-
export default async (configuration: Configuration) => {
|
|
49
|
-
return configuration;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
4. Install the new dependency:
|
|
53
|
-
Add the following package to your project:
|
|
54
|
-
👉 "@trackunit/iris-app-sdk-rspack"
|
|
55
|
-
|
|
56
|
-
================================================================================
|
|
57
|
-
🚀 Update now to ensure compatibility! 🚀 ... its also faster!
|
|
58
|
-
================================================================================
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
`);
|
|
62
|
-
await (0, iris_app_build_utilities_1.checkPackageVersion)(false);
|
|
63
|
-
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
64
|
-
const projectRootDir = (0, path_1.join)(context.root, projectRoot);
|
|
65
|
-
const tileManifestPath = (0, path_1.join)(context.root, projectRoot, "iris-app-manifest.ts");
|
|
66
|
-
(0, iris_app_build_utilities_1.enableTsConfigPath)({
|
|
67
|
-
projectRootDir,
|
|
68
|
-
});
|
|
69
|
-
if (!options.webpackConfig) {
|
|
70
|
-
throw new Error("option.webpackConfig is required");
|
|
71
|
-
}
|
|
72
|
-
const IrisAppManifest = (await Promise.resolve(`${tileManifestPath}`).then(s => tslib_1.__importStar(require(s)))).default;
|
|
73
|
-
const defaultConfig = (0, defaultWebpackConfig_1.getDefaultConfig)("development", context.root, projectRootDir, IrisAppManifest);
|
|
74
|
-
const customConfigFile = await Promise.resolve(`${options.webpackConfig}`).then(s => tslib_1.__importStar(require(s)));
|
|
75
|
-
let config = customConfigFile.default(await defaultConfig);
|
|
76
|
-
const isPromise = config instanceof Promise;
|
|
77
|
-
if (isPromise) {
|
|
78
|
-
config = await defaultConfig;
|
|
79
|
-
}
|
|
80
|
-
const observable = (0, webpackDevServer_1.doRunWebpackDevServer)(config).pipe(op.tap(({ stats }) => {
|
|
81
|
-
// eslint-disable-next-line no-console
|
|
82
|
-
console.info(stats.toString(config.stats));
|
|
83
|
-
}), op.map(({ baseUrl, stats }) => {
|
|
84
|
-
return {
|
|
85
|
-
baseUrl,
|
|
86
|
-
success: !stats.hasErrors(),
|
|
87
|
-
};
|
|
88
|
-
}));
|
|
89
|
-
return yield* (0, rxjs_for_await_1.eachValueFrom)(observable);
|
|
90
|
-
}
|
|
91
|
-
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/executors/serve/executor.ts"],"names":[],"mappings":";;AAwBA,4BA8EC;;AApGD,wEAAoE;AACpE,kFAA8F;AAC9F,+BAA4B;AAE5B,2DAAqC;AAErC,8BAA4B;AAC5B,kBAAgB;AAChB,wEAAiE;AAEjE,yDAA2D;AAK3D;;;;;;GAMG;AACY,KAAK,SAAS,CAAC,WAAE,OAA4B,EAAE,OAAwB;IACpF,sCAAsC;IACtC,OAAO,CAAC,IAAI,CACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCH,CACE,CAAC;IACF,MAAM,IAAA,8CAAmB,EAAC,KAAK,CAAC,CAAC;IACjC,MAAM,WAAW,GAAG,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAY,CAAE,CAAC,IAAI,CAAC;IACxF,MAAM,cAAc,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACvD,MAAM,gBAAgB,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,sBAAsB,CAAC,CAAC;IACjF,IAAA,6CAAkB,EAAC;QACjB,cAAc;KACf,CAAC,CAAC;IACH,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtD,CAAC;IACD,MAAM,eAAe,GAAG,CAAC,yBAAa,gBAAgB,+CAAC,CAAC,CAAC,OAAO,CAAC;IACjE,MAAM,aAAa,GAAG,IAAA,uCAAgB,EAAC,aAAa,EAAE,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,eAAe,CAAC,CAAC;IACrG,MAAM,gBAAgB,GAAG,yBAAa,OAAO,CAAC,aAAa,+CAAC,CAAC;IAE7D,IAAI,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,MAAM,aAAa,CAAC,CAAC;IAC3D,MAAM,SAAS,GAAG,MAAM,YAAY,OAAO,CAAC;IAC5C,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,GAAG,MAAM,aAAa,CAAC;IAC/B,CAAC;IAED,MAAM,UAAU,GAAG,IAAA,wCAAqB,EAAC,MAAM,CAAC,CAAC,IAAI,CACnD,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;QACnB,sCAAsC;QACtC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAE,MAAgC,CAAC,KAAK,CAAC,CAAC,CAAC;IACxE,CAAC,CAAC,EACF,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE;QAC5B,OAAO;YACL,OAAO;YACP,OAAO,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE;SAC5B,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,KAAK,CAAC,CAAC,IAAA,8BAAa,EAAC,UAAwC,CAAC,CAAC;AACxE,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ExecutorContext } from \"@nx/devkit\";\nimport { eachValueFrom } from \"@nx/devkit/src/utils/rxjs-for-await\";\nimport { checkPackageVersion, enableTsConfigPath } from \"@trackunit/iris-app-build-utilities\";\nimport { join } from \"path\";\nimport { Observable } from \"rxjs\";\nimport * as op from \"rxjs/operators\";\n\nimport \"webpack-dev-server\";\nimport \"win-ca\";\nimport { getDefaultConfig } from \"../utils/defaultWebpackConfig\";\nimport { ServeExecutorSchema } from \"./schema\";\nimport { doRunWebpackDevServer } from \"./webpackDevServer\";\n\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nimport type webpack = require(\"webpack\");\n\n/**\n * Serve executor for serving iris apps.\n *\n * @param {ServeExecutorSchema} options serve executor options for this nx executor\n * @param {ExecutorContext} context serve executor context for this nx executor\n * @yields {AsyncGenerator<any, void, unknown>} the serve observable\n */\nexport default async function* (options: ServeExecutorSchema, context: ExecutorContext) {\n // eslint-disable-next-line no-console\n console.warn(\n `\n================================================================================\n ⚠️ Deprecation Notice ⚠️\n================================================================================\n\nThe NX executor \"@trackunit/iris-app:serve\" is **deprecated** and will be\nremoved in the next major version of the Iris App SDK.\n\nPlease update your \"project.json\" to make the following changes:\n\n 1. Update the executor:\n Replace \"@trackunit/iris-app:serve\" with:\n 👉 \"@trackunit/iris-app-sdk-rspack:serve\"\n\n 2. Update the property name:\n Replace the \"webpackConfig\" property with:\n 👉 \"rspackConfig\"\n\n 3. Rename the configuration file:\n Rename your \"webpack.config.ts\" file to:\n 👉 \"rspack.config.ts\"\n\n Use the following content in the renamed file:\n\n import { Configuration } from \"@rspack/core\";\n\n export default async (configuration: Configuration) => {\n return configuration;\n };\n\n 4. Install the new dependency:\n Add the following package to your project:\n 👉 \"@trackunit/iris-app-sdk-rspack\"\n\n================================================================================\n 🚀 Update now to ensure compatibility! 🚀 ... its also faster!\n================================================================================\n\n\n`\n );\n await checkPackageVersion(false);\n const projectRoot = context.projectsConfigurations.projects[context.projectName!]!.root;\n const projectRootDir = join(context.root, projectRoot);\n const tileManifestPath = join(context.root, projectRoot, \"iris-app-manifest.ts\");\n enableTsConfigPath({\n projectRootDir,\n });\n if (!options.webpackConfig) {\n throw new Error(\"option.webpackConfig is required\");\n }\n const IrisAppManifest = (await import(tileManifestPath)).default;\n const defaultConfig = getDefaultConfig(\"development\", context.root, projectRootDir, IrisAppManifest);\n const customConfigFile = await import(options.webpackConfig);\n\n let config = customConfigFile.default(await defaultConfig);\n const isPromise = config instanceof Promise;\n if (isPromise) {\n config = await defaultConfig;\n }\n\n const observable = doRunWebpackDevServer(config).pipe(\n op.tap(({ stats }) => {\n // eslint-disable-next-line no-console\n console.info(stats.toString((config as webpack.Configuration).stats));\n }),\n op.map(({ baseUrl, stats }) => {\n return {\n baseUrl,\n success: !stats.hasErrors(),\n };\n })\n );\n\n return yield* eachValueFrom(observable as unknown as Observable<any>);\n}\n"]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 2,
|
|
3
|
-
"outputCapture": "direct-nodejs",
|
|
4
|
-
"$schema": "http://json-schema.org/schema",
|
|
5
|
-
"title": "Serve executor for apps from the Iris App SDK",
|
|
6
|
-
"description": "",
|
|
7
|
-
"type": "object",
|
|
8
|
-
"properties": {
|
|
9
|
-
"webpackConfig": {
|
|
10
|
-
"type": "string",
|
|
11
|
-
"description": "",
|
|
12
|
-
"$default": {
|
|
13
|
-
"$source": "argv",
|
|
14
|
-
"index": 0
|
|
15
|
-
},
|
|
16
|
-
"x-prompt": "What is the path for the webpack config for this app?"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
"required": []
|
|
20
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
import webpack = require("webpack");
|
|
3
|
-
type WebpackStats = webpack.Stats;
|
|
4
|
-
/**
|
|
5
|
-
* Run webpack with the given configuration.
|
|
6
|
-
*
|
|
7
|
-
* @param config the input webpack configuration
|
|
8
|
-
* @returns { Observable<{ stats: WebpackStats; baseUrl: string }> } the observable of webpack stats and base url
|
|
9
|
-
*/
|
|
10
|
-
export declare function doRunWebpackDevServer(config: webpack.Configuration): Observable<{
|
|
11
|
-
stats: WebpackStats;
|
|
12
|
-
baseUrl: string;
|
|
13
|
-
}>;
|
|
14
|
-
export {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.doRunWebpackDevServer = doRunWebpackDevServer;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const rxjs_1 = require("rxjs");
|
|
6
|
-
const webpack_dev_server_1 = tslib_1.__importDefault(require("webpack-dev-server"));
|
|
7
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
8
|
-
const webpack = require("webpack");
|
|
9
|
-
/**
|
|
10
|
-
* Run webpack with the given configuration.
|
|
11
|
-
*
|
|
12
|
-
* @param config the input webpack configuration
|
|
13
|
-
* @returns { Observable<{ stats: WebpackStats; baseUrl: string }> } the observable of webpack stats and base url
|
|
14
|
-
*/
|
|
15
|
-
function doRunWebpackDevServer(config) {
|
|
16
|
-
return new rxjs_1.Observable(subscriber => {
|
|
17
|
-
const webpackCompiler = webpack.webpack(config);
|
|
18
|
-
if (webpackCompiler === null) {
|
|
19
|
-
throw new Error("Failed to run webpack dev server. Webpack compiler was null");
|
|
20
|
-
}
|
|
21
|
-
let baseUrl;
|
|
22
|
-
webpackCompiler.hooks.done.tap("build-webpack", stats => {
|
|
23
|
-
subscriber.next({ stats, baseUrl });
|
|
24
|
-
});
|
|
25
|
-
const devServerConfig = config.devServer || {};
|
|
26
|
-
const originalOnListen = devServerConfig.onListening;
|
|
27
|
-
devServerConfig.onListening = function (server) {
|
|
28
|
-
if (originalOnListen) {
|
|
29
|
-
originalOnListen(server);
|
|
30
|
-
}
|
|
31
|
-
const devServerOptions = server.options;
|
|
32
|
-
baseUrl = `${server.options.server === "https" ? "https" : "http"}://${server.options.host}:${server.options.port}${devServerOptions.devMiddleware?.publicPath}`;
|
|
33
|
-
};
|
|
34
|
-
const webpackServer = new webpack_dev_server_1.default(devServerConfig, webpackCompiler);
|
|
35
|
-
webpackServer.start().catch((err) => subscriber.error(err));
|
|
36
|
-
return () => webpackServer.stop();
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=webpackDevServer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webpackDevServer.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/executors/serve/webpackDevServer.ts"],"names":[],"mappings":";;AAaA,sDAqCC;;AAlDD,+BAAkC;AAClC,oFAAkD;AAClD,iEAAiE;AACjE,mCAAoC;AAIpC;;;;;GAKG;AACH,SAAgB,qBAAqB,CACnC,MAA6B;IAE7B,OAAO,IAAI,iBAAU,CAAC,UAAU,CAAC,EAAE;QACjC,MAAM,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAEhD,IAAI,eAAe,KAAK,IAAI,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;QACjF,CAAC;QAED,IAAI,OAAe,CAAC;QAEpB,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,KAAK,CAAC,EAAE;YACtD,UAAU,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;QAEH,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC;QAE/C,MAAM,gBAAgB,GAAG,eAAe,CAAC,WAAW,CAAC;QAErD,eAAe,CAAC,WAAW,GAAG,UAAU,MAAwB;YAC9D,IAAI,gBAAgB,EAAE,CAAC;gBACrB,gBAAgB,CAAC,MAAM,CAAC,CAAC;YAC3B,CAAC;YAED,MAAM,gBAAgB,GAAmC,MAAM,CAAC,OAAO,CAAC;YAExE,OAAO,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,IACxF,MAAM,CAAC,OAAO,CAAC,IACjB,GAAG,gBAAgB,CAAC,aAAa,EAAE,UAAU,EAAE,CAAC;QAClD,CAAC,CAAC;QAEF,MAAM,aAAa,GAAG,IAAI,4BAAgB,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;QAE7E,aAAa,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QACnE,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { Observable } from \"rxjs\";\nimport WebpackDevServer from \"webpack-dev-server\";\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nimport webpack = require(\"webpack\");\n\ntype WebpackStats = webpack.Stats;\n\n/**\n * Run webpack with the given configuration.\n *\n * @param config the input webpack configuration\n * @returns { Observable<{ stats: WebpackStats; baseUrl: string }> } the observable of webpack stats and base url\n */\nexport function doRunWebpackDevServer(\n config: webpack.Configuration\n): Observable<{ stats: WebpackStats; baseUrl: string }> {\n return new Observable(subscriber => {\n const webpackCompiler = webpack.webpack(config);\n\n if (webpackCompiler === null) {\n throw new Error(\"Failed to run webpack dev server. Webpack compiler was null\");\n }\n\n let baseUrl: string;\n\n webpackCompiler.hooks.done.tap(\"build-webpack\", stats => {\n subscriber.next({ stats, baseUrl });\n });\n\n const devServerConfig = config.devServer || {};\n\n const originalOnListen = devServerConfig.onListening;\n\n devServerConfig.onListening = function (server: WebpackDevServer) {\n if (originalOnListen) {\n originalOnListen(server);\n }\n\n const devServerOptions: WebpackDevServer.Configuration = server.options;\n\n baseUrl = `${server.options.server === \"https\" ? \"https\" : \"http\"}://${server.options.host}:${\n server.options.port\n }${devServerOptions.devMiddleware?.publicPath}`;\n };\n\n const webpackServer = new WebpackDevServer(devServerConfig, webpackCompiler);\n\n webpackServer.start().catch((err: Error) => subscriber.error(err));\n return () => webpackServer.stop();\n });\n}\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { IrisAppManifest } from "@trackunit/iris-app-api";
|
|
2
|
-
import * as webpack from "webpack";
|
|
3
|
-
import "webpack-dev-server";
|
|
4
|
-
type WebpackConfiguration = webpack.Configuration;
|
|
5
|
-
/**
|
|
6
|
-
* Gets the default webpack config.
|
|
7
|
-
*
|
|
8
|
-
* @param mode mode either "production" or "development"
|
|
9
|
-
* @param nxRootDir the root of the nx workspace
|
|
10
|
-
* @param appDir the app directory
|
|
11
|
-
* @param irisAppManifest the iris app manifest
|
|
12
|
-
* @returns { Promise<WebpackConfiguration> } the default webpack config
|
|
13
|
-
*/
|
|
14
|
-
export declare const getDefaultConfig: (mode: "production" | "development", nxRootDir: string, appDir: string, irisAppManifest: IrisAppManifest) => Promise<WebpackConfiguration>;
|
|
15
|
-
export {};
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDefaultConfig = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const iris_app_build_utilities_1 = require("@trackunit/iris-app-build-utilities");
|
|
6
|
-
const iris_app_webpack_plugin_1 = require("@trackunit/iris-app-webpack-plugin");
|
|
7
|
-
const path = tslib_1.__importStar(require("path"));
|
|
8
|
-
const webpack = tslib_1.__importStar(require("webpack"));
|
|
9
|
-
require("webpack-dev-server");
|
|
10
|
-
let BundleAnalyzerPlugin = null;
|
|
11
|
-
if (process.env.BUNDLE_ANALYSE === "true") {
|
|
12
|
-
// doing require here to avoid dependency on webpack-bundle-analyzer directly
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
14
|
-
const BundleAnalyzerPluginConstructor = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
|
|
15
|
-
BundleAnalyzerPlugin = new BundleAnalyzerPluginConstructor({ analyzerMode: "static" });
|
|
16
|
-
}
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
18
|
-
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
|
19
|
-
/**
|
|
20
|
-
* Gets the default webpack config.
|
|
21
|
-
*
|
|
22
|
-
* @param mode mode either "production" or "development"
|
|
23
|
-
* @param nxRootDir the root of the nx workspace
|
|
24
|
-
* @param appDir the app directory
|
|
25
|
-
* @param irisAppManifest the iris app manifest
|
|
26
|
-
* @returns { Promise<WebpackConfiguration> } the default webpack config
|
|
27
|
-
*/
|
|
28
|
-
const getDefaultConfig = async (mode, nxRootDir, appDir, irisAppManifest) => {
|
|
29
|
-
const relativeAppDir = appDir.split(nxRootDir)[1] || "<unknown appdir>";
|
|
30
|
-
const copyPatterns = (0, iris_app_build_utilities_1.getCopyPatterns)({
|
|
31
|
-
nxRootDir,
|
|
32
|
-
appDir,
|
|
33
|
-
manifest: irisAppManifest,
|
|
34
|
-
mode,
|
|
35
|
-
});
|
|
36
|
-
return {
|
|
37
|
-
mode: mode,
|
|
38
|
-
output: {
|
|
39
|
-
publicPath: "auto",
|
|
40
|
-
path: path.join(nxRootDir, "dist", relativeAppDir),
|
|
41
|
-
},
|
|
42
|
-
entry: {},
|
|
43
|
-
devtool: false,
|
|
44
|
-
devServer: await (0, iris_app_build_utilities_1.getIrisAppWebpackDevServer)(),
|
|
45
|
-
resolve: {
|
|
46
|
-
extensions: [".tsx", ".ts", ".jsx", ".js", ".json"],
|
|
47
|
-
alias: await (0, iris_app_build_utilities_1.getAliasesFromTsConfig)({ nxRootDir }),
|
|
48
|
-
},
|
|
49
|
-
module: {
|
|
50
|
-
rules: [
|
|
51
|
-
{
|
|
52
|
-
test: /\.svg$/,
|
|
53
|
-
issuer: /\.[jt]sx?$/,
|
|
54
|
-
oneOf: [
|
|
55
|
-
{
|
|
56
|
-
resourceQuery: /react/, // if import has ?react in the query so .svg?react
|
|
57
|
-
use: [
|
|
58
|
-
{
|
|
59
|
-
loader: "@svgr/webpack",
|
|
60
|
-
options: {
|
|
61
|
-
typescript: true,
|
|
62
|
-
svgo: false,
|
|
63
|
-
titleProp: true,
|
|
64
|
-
ref: true,
|
|
65
|
-
exportType: "named",
|
|
66
|
-
namedExport: "ReactComponent",
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
type: "asset/resource",
|
|
73
|
-
generator: {
|
|
74
|
-
filename: mode === "production" ? "static/media/[hash][ext]" : "static/media/[name][ext]",
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
],
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
test: /\.m?js/,
|
|
81
|
-
type: "javascript/auto",
|
|
82
|
-
resolve: {
|
|
83
|
-
fullySpecified: false,
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
test: /\.(png|jpe?g|gif|eot|ttf|ico|woff|woff2)$/,
|
|
88
|
-
exclude: /(node_modules)/,
|
|
89
|
-
type: "asset/resource",
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
test: /\.(png|jpe?g|gif|svg|eot|ttf|ico|woff|woff2)$/i,
|
|
93
|
-
include: /(node_modules\/@okta)/,
|
|
94
|
-
type: "asset/resource",
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
test: /\.(css|s[ac]ss)$/i,
|
|
98
|
-
use: [
|
|
99
|
-
"style-loader",
|
|
100
|
-
"css-loader",
|
|
101
|
-
{
|
|
102
|
-
loader: "postcss-loader",
|
|
103
|
-
options: {
|
|
104
|
-
postcssOptions: {
|
|
105
|
-
plugins: {
|
|
106
|
-
"@tailwindcss/postcss": {},
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
],
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
test: /\.json$/,
|
|
115
|
-
loader: "json-loader",
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
test: /\.(j|t)sx?$/,
|
|
119
|
-
exclude: /(vendor|node_modules|dist)/,
|
|
120
|
-
use: {
|
|
121
|
-
loader: "esbuild-loader",
|
|
122
|
-
options: {
|
|
123
|
-
jsx: "automatic",
|
|
124
|
-
target: "es6",
|
|
125
|
-
define: {
|
|
126
|
-
"process.env.IRIS_APP_SENTRY_DSN": JSON.stringify(""),
|
|
127
|
-
"process.env.IRIS_APP_VERSION": JSON.stringify(""),
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
],
|
|
133
|
-
},
|
|
134
|
-
plugins: [
|
|
135
|
-
new webpack.container.ModuleFederationPlugin({
|
|
136
|
-
name: irisAppManifest.moduleFederationName,
|
|
137
|
-
filename: "remoteEntry.js",
|
|
138
|
-
library: { type: "global", name: irisAppManifest.moduleFederationName },
|
|
139
|
-
remotes: {},
|
|
140
|
-
exposes: await (0, iris_app_build_utilities_1.getExposedExtensions)({
|
|
141
|
-
nxRootDir,
|
|
142
|
-
manifest: irisAppManifest,
|
|
143
|
-
}),
|
|
144
|
-
shared: (0, iris_app_build_utilities_1.getSharedDependencies)({ manifest: irisAppManifest }),
|
|
145
|
-
}),
|
|
146
|
-
new iris_app_webpack_plugin_1.TrackunitIrisAppWebpackPlugin({
|
|
147
|
-
nxRootDir: nxRootDir,
|
|
148
|
-
appDir,
|
|
149
|
-
manifest: irisAppManifest,
|
|
150
|
-
}),
|
|
151
|
-
new CopyWebpackPlugin({
|
|
152
|
-
patterns: copyPatterns,
|
|
153
|
-
}),
|
|
154
|
-
BundleAnalyzerPlugin,
|
|
155
|
-
].filter(Boolean),
|
|
156
|
-
};
|
|
157
|
-
};
|
|
158
|
-
exports.getDefaultConfig = getDefaultConfig;
|
|
159
|
-
//# sourceMappingURL=defaultWebpackConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaultWebpackConfig.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/executors/utils/defaultWebpackConfig.ts"],"names":[],"mappings":";;;;AACA,kFAM6C;AAC7C,gFAAmF;AACnF,mDAA6B;AAC7B,yDAAmC;AACnC,8BAA4B;AAI5B,IAAI,oBAAoB,GAAyC,IAAI,CAAC;AACtE,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,MAAM,EAAE,CAAC;IAC1C,6EAA6E;IAC7E,iEAAiE;IACjE,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,iEAAiE;AACjE,MAAM,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAEzD;;;;;;;;GAQG;AACI,MAAM,gBAAgB,GAAG,KAAK,EACnC,IAAkC,EAClC,SAAiB,EACjB,MAAc,EACd,eAAgC,EACD,EAAE;IACjC,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,kBAAkB,CAAC;IAExE,MAAM,YAAY,GAAG,IAAA,0CAAe,EAAC;QACnC,SAAS;QACT,MAAM;QACN,QAAQ,EAAE,eAAe;QACzB,IAAI;KACL,CAAC,CAAC;IAEH,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,EAAE;QACT,OAAO,EAAE,KAAK;QACd,SAAS,EAAE,MAAM,IAAA,qDAA0B,GAAE;QAC7C,OAAO,EAAE;YACP,UAAU,EAAE,CAAC,MAAM,EAAE,KAA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IAAI,EAAE,SAAS;oBACf,MAAM,EAAE,aAAa;iBACtB;gBACD;oBACE,IAAI,EAAE,aAAa;oBACnB,OAAO,EAAE,4BAA4B;oBACrC,GAAG,EAAE;wBACH,MAAM,EAAE,gBAAgB;wBACxB,OAAO,EAAE;4BACP,GAAG,EAAE,WAAW;4BAChB,MAAM,EAAE,KAAK;4BACb,MAAM,EAAE;gCACN,iCAAiC,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;gCACrD,8BAA8B,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;6BACnD;yBACF;qBACF;iBACF;aACF;SACF;QAED,OAAO,EAAE;YACP,IAAI,OAAO,CAAC,SAAS,CAAC,sBAAsB,CAAC;gBAC3C,IAAI,EAAE,eAAe,CAAC,oBAAoB;gBAC1C,QAAQ,EAAE,gBAAgB;gBAC1B,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,eAAe,CAAC,oBAAoB,EAAE;gBACvE,OAAO,EAAE,EAAE;gBACX,OAAO,EAAE,MAAM,IAAA,+CAAoB,EAAC;oBAClC,SAAS;oBACT,QAAQ,EAAE,eAAe;iBAC1B,CAAC;gBACF,MAAM,EAAE,IAAA,gDAAqB,EAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC;aAC7D,CAAC;YAEF,IAAI,uDAA6B,CAAC;gBAChC,SAAS,EAAE,SAAS;gBACpB,MAAM;gBACN,QAAQ,EAAE,eAAe;aAC1B,CAAC;YACF,IAAI,iBAAiB,CAAC;gBACpB,QAAQ,EAAE,YAAY;aACvB,CAAC;YACF,oBAAoB;SACrB,CAAC,MAAM,CAAC,OAAO,CAAC;KAClB,CAAC;AACJ,CAAC,CAAC;AA3IW,QAAA,gBAAgB,oBA2I3B","sourcesContent":["import { IrisAppManifest } from \"@trackunit/iris-app-api\";\nimport {\n getAliasesFromTsConfig,\n getCopyPatterns,\n getExposedExtensions,\n getIrisAppWebpackDevServer,\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\ntype WebpackConfiguration = webpack.Configuration;\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-require-imports\n const BundleAnalyzerPluginConstructor = require(\"webpack-bundle-analyzer\").BundleAnalyzerPlugin;\n BundleAnalyzerPlugin = new BundleAnalyzerPluginConstructor({ analyzerMode: \"static\" });\n}\n\n// eslint-disable-next-line @typescript-eslint/no-require-imports\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<WebpackConfiguration> } the default webpack config\n */\nexport const getDefaultConfig = async (\n mode: \"production\" | \"development\",\n nxRootDir: string,\n appDir: string,\n irisAppManifest: IrisAppManifest\n): Promise<WebpackConfiguration> => {\n const relativeAppDir = appDir.split(nxRootDir)[1] || \"<unknown appdir>\";\n\n const copyPatterns = getCopyPatterns({\n nxRootDir,\n appDir,\n manifest: irisAppManifest,\n mode,\n });\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 oneOf: [\n {\n resourceQuery: /react/, // if import has ?react in the query so .svg?react\n use: [\n {\n loader: \"@svgr/webpack\",\n options: {\n typescript: true,\n svgo: false,\n titleProp: true,\n ref: true,\n exportType: \"named\",\n namedExport: \"ReactComponent\",\n },\n },\n ],\n },\n {\n type: \"asset/resource\",\n generator: {\n filename: mode === \"production\" ? \"static/media/[hash][ext]\" : \"static/media/[name][ext]\",\n },\n },\n ],\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 \"@tailwindcss/postcss\": {},\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: getSharedDependencies({ manifest: irisAppManifest }),\n }),\n\n new TrackunitIrisAppWebpackPlugin({\n nxRootDir: nxRootDir,\n appDir,\n manifest: irisAppManifest,\n }),\n new CopyWebpackPlugin({\n patterns: copyPatterns,\n }),\n BundleAnalyzerPlugin,\n ].filter(Boolean),\n };\n};\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Tree } from "@nx/devkit";
|
|
2
|
-
/**
|
|
3
|
-
* Add a dev dependency to the package.json
|
|
4
|
-
*
|
|
5
|
-
* @param { Tree } host the nx tree
|
|
6
|
-
* @param { string } packageName the package name
|
|
7
|
-
* @param { string } version the package version
|
|
8
|
-
*/
|
|
9
|
-
export declare const addDevDependency: (host: Tree, packageName: string, version?: string) => void;
|
|
10
|
-
/**
|
|
11
|
-
* Add a dependency to the package.json
|
|
12
|
-
*
|
|
13
|
-
* @param { Tree } host the nx tree
|
|
14
|
-
* @param { string } packageName the package name
|
|
15
|
-
* @param { string } version the package version
|
|
16
|
-
*/
|
|
17
|
-
export declare const addDependency: (host: Tree, packageName: string, version?: string) => void;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addDependency = exports.addDevDependency = void 0;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
/**
|
|
6
|
-
* Add a dev dependency to the package.json
|
|
7
|
-
*
|
|
8
|
-
* @param { Tree } host the nx tree
|
|
9
|
-
* @param { string } packageName the package name
|
|
10
|
-
* @param { string } version the package version
|
|
11
|
-
*/
|
|
12
|
-
const addDevDependency = (host, packageName, version = "*") => {
|
|
13
|
-
const packageJsonPath = "package.json";
|
|
14
|
-
const currentPackageJson = (0, devkit_1.readJson)(host, packageJsonPath);
|
|
15
|
-
const isPackageInstalled = currentPackageJson.devDependencies?.[packageName] !== undefined;
|
|
16
|
-
if (!isPackageInstalled) {
|
|
17
|
-
const modifiedPackageJson = {
|
|
18
|
-
...currentPackageJson,
|
|
19
|
-
devDependencies: {
|
|
20
|
-
...currentPackageJson.devDependencies,
|
|
21
|
-
[packageName]: version,
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
host.write(packageJsonPath, JSON.stringify(modifiedPackageJson, null, 2));
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
exports.addDevDependency = addDevDependency;
|
|
28
|
-
/**
|
|
29
|
-
* Add a dependency to the package.json
|
|
30
|
-
*
|
|
31
|
-
* @param { Tree } host the nx tree
|
|
32
|
-
* @param { string } packageName the package name
|
|
33
|
-
* @param { string } version the package version
|
|
34
|
-
*/
|
|
35
|
-
const addDependency = (host, packageName, version = "*") => {
|
|
36
|
-
const packageJsonPath = "package.json";
|
|
37
|
-
const currentPackageJson = (0, devkit_1.readJson)(host, packageJsonPath);
|
|
38
|
-
const isPackageInstalled = currentPackageJson.dependencies?.[packageName] !== undefined;
|
|
39
|
-
if (!isPackageInstalled) {
|
|
40
|
-
const modifiedPackageJson = {
|
|
41
|
-
...currentPackageJson,
|
|
42
|
-
dependencies: {
|
|
43
|
-
...currentPackageJson.dependencies,
|
|
44
|
-
[packageName]: version,
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
host.write(packageJsonPath, JSON.stringify(modifiedPackageJson, null, 2));
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
exports.addDependency = addDependency;
|
|
51
|
-
//# sourceMappingURL=addDevDependency.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addDevDependency.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app/src/utils/addDevDependency.ts"],"names":[],"mappings":";;;AAAA,uCAA4C;AAE5C;;;;;;GAMG;AACI,MAAM,gBAAgB,GAAG,CAAC,IAAU,EAAE,WAAmB,EAAE,OAAO,GAAG,GAAG,EAAE,EAAE;IACjF,MAAM,eAAe,GAAG,cAAc,CAAC;IACvC,MAAM,kBAAkB,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IAC3D,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,eAAe,EAAE,CAAC,WAAW,CAAC,KAAK,SAAS,CAAC;IAE3F,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACxB,MAAM,mBAAmB,GAAG;YAC1B,GAAG,kBAAkB;YACrB,eAAe,EAAE;gBACf,GAAG,kBAAkB,CAAC,eAAe;gBACrC,CAAC,WAAW,CAAC,EAAE,OAAO;aACvB;SACF,CAAC;QAEF,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC,CAAC;AAhBW,QAAA,gBAAgB,oBAgB3B;AAEF;;;;;;GAMG;AACI,MAAM,aAAa,GAAG,CAAC,IAAU,EAAE,WAAmB,EAAE,OAAO,GAAG,GAAG,EAAE,EAAE;IAC9E,MAAM,eAAe,GAAG,cAAc,CAAC;IACvC,MAAM,kBAAkB,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IAC3D,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,YAAY,EAAE,CAAC,WAAW,CAAC,KAAK,SAAS,CAAC;IAExF,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACxB,MAAM,mBAAmB,GAAG;YAC1B,GAAG,kBAAkB;YACrB,YAAY,EAAE;gBACZ,GAAG,kBAAkB,CAAC,YAAY;gBAClC,CAAC,WAAW,CAAC,EAAE,OAAO;aACvB;SACF,CAAC;QAEF,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC,CAAC;AAhBW,QAAA,aAAa,iBAgBxB","sourcesContent":["import { readJson, Tree } from \"@nx/devkit\";\n\n/**\n * Add a dev dependency to the package.json\n *\n * @param { Tree } host the nx tree\n * @param { string } packageName the package name\n * @param { string } version the package version\n */\nexport const addDevDependency = (host: Tree, packageName: string, version = \"*\") => {\n const packageJsonPath = \"package.json\";\n const currentPackageJson = readJson(host, packageJsonPath);\n const isPackageInstalled = currentPackageJson.devDependencies?.[packageName] !== undefined;\n\n if (!isPackageInstalled) {\n const modifiedPackageJson = {\n ...currentPackageJson,\n devDependencies: {\n ...currentPackageJson.devDependencies,\n [packageName]: version,\n },\n };\n\n host.write(packageJsonPath, JSON.stringify(modifiedPackageJson, null, 2));\n }\n};\n\n/**\n * Add a dependency to the package.json\n *\n * @param { Tree } host the nx tree\n * @param { string } packageName the package name\n * @param { string } version the package version\n */\nexport const addDependency = (host: Tree, packageName: string, version = \"*\") => {\n const packageJsonPath = \"package.json\";\n const currentPackageJson = readJson(host, packageJsonPath);\n const isPackageInstalled = currentPackageJson.dependencies?.[packageName] !== undefined;\n\n if (!isPackageInstalled) {\n const modifiedPackageJson = {\n ...currentPackageJson,\n dependencies: {\n ...currentPackageJson.dependencies,\n [packageName]: version,\n },\n };\n\n host.write(packageJsonPath, JSON.stringify(modifiedPackageJson, null, 2));\n }\n};\n"]}
|