@trackunit/iris-app-build-utilities 0.0.1-alpha-afcc978985.0
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 +136 -0
- package/README.md +19 -0
- package/package.json +15 -0
- package/src/enableTsConfigPath.d.ts +10 -0
- package/src/enableTsConfigPath.js +35 -0
- package/src/enableTsConfigPath.js.map +1 -0
- package/src/getAliasesFromTsConfig.d.ts +10 -0
- package/src/getAliasesFromTsConfig.js +32 -0
- package/src/getAliasesFromTsConfig.js.map +1 -0
- package/src/getExposedExtensions.d.ts +12 -0
- package/src/getExposedExtensions.js +23 -0
- package/src/getExposedExtensions.js.map +1 -0
- package/src/getSharedDependencies.d.ts +11 -0
- package/src/getSharedDependencies.js +30 -0
- package/src/getSharedDependencies.js.map +1 -0
- package/src/getTailwindContentForApp.d.ts +18 -0
- package/src/getTailwindContentForApp.js +20 -0
- package/src/getTailwindContentForApp.js.map +1 -0
- package/src/getTileWebpackDevServer.d.ts +7 -0
- package/src/getTileWebpackDevServer.js +40 -0
- package/src/getTileWebpackDevServer.js.map +1 -0
- package/src/index.d.ts +6 -0
- package/src/index.js +10 -0
- package/src/index.js.map +1 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
|
+
|
|
5
|
+
### [0.0.1-alpha-afcc978985.0](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.60...iris-app-build-utilities/0.0.1-alpha-afcc978985.0) (2022-11-04)
|
|
6
|
+
|
|
7
|
+
### [0.0.60](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.59...iris-app-build-utilities/0.0.60) (2022-11-01)
|
|
8
|
+
|
|
9
|
+
### Dependency Updates
|
|
10
|
+
|
|
11
|
+
* `iris-app-api` updated to version `0.0.1`
|
|
12
|
+
### [0.0.59](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.58...iris-app-build-utilities/0.0.59) (2022-10-27)
|
|
13
|
+
|
|
14
|
+
### Dependency Updates
|
|
15
|
+
|
|
16
|
+
* `iris-app-api` updated to version `0.0.1`
|
|
17
|
+
### [0.0.58](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.57...iris-app-build-utilities/0.0.58) (2022-10-13)
|
|
18
|
+
|
|
19
|
+
### Dependency Updates
|
|
20
|
+
|
|
21
|
+
* `iris-app-api` updated to version `0.0.1`
|
|
22
|
+
### [0.0.57](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.56...iris-app-build-utilities/0.0.57) (2022-10-06)
|
|
23
|
+
|
|
24
|
+
### Dependency Updates
|
|
25
|
+
|
|
26
|
+
* `iris-app-api` updated to version `0.0.1`
|
|
27
|
+
### [0.0.56](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.55...iris-app-build-utilities/0.0.56) (2022-10-03)
|
|
28
|
+
|
|
29
|
+
### Dependency Updates
|
|
30
|
+
|
|
31
|
+
* `iris-app-api` updated to version `0.0.1`
|
|
32
|
+
### [0.0.55](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.54...iris-app-build-utilities/0.0.55) (2022-09-26)
|
|
33
|
+
|
|
34
|
+
### Dependency Updates
|
|
35
|
+
|
|
36
|
+
* `iris-app-api` updated to version `0.0.1`
|
|
37
|
+
### [0.0.54](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.53...iris-app-build-utilities/0.0.54) (2022-09-16)
|
|
38
|
+
|
|
39
|
+
### Dependency Updates
|
|
40
|
+
|
|
41
|
+
* `iris-app-api` updated to version `0.0.1`
|
|
42
|
+
### [0.0.53](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.52...iris-app-build-utilities/0.0.53) (2022-09-15)
|
|
43
|
+
|
|
44
|
+
### Dependency Updates
|
|
45
|
+
|
|
46
|
+
* `iris-app-api` updated to version `0.0.1`
|
|
47
|
+
### [0.0.52](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.51...iris-app-build-utilities/0.0.52) (2022-09-13)
|
|
48
|
+
|
|
49
|
+
### [0.0.51](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.50...iris-app-build-utilities/0.0.51) (2022-09-12)
|
|
50
|
+
|
|
51
|
+
### Dependency Updates
|
|
52
|
+
|
|
53
|
+
* `iris-app-api` updated to version `0.0.1`
|
|
54
|
+
### [0.0.50](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.49...iris-app-build-utilities/0.0.50) (2022-09-12)
|
|
55
|
+
|
|
56
|
+
### Dependency Updates
|
|
57
|
+
|
|
58
|
+
* `iris-app-api` updated to version `0.0.1`
|
|
59
|
+
|
|
60
|
+
### Reverts
|
|
61
|
+
|
|
62
|
+
* Revert "ci: bump iris-app-build-utilities to 0.0.50-alpha-61732b8ce.0 [skip ci]" ([6e00cee](https://github.com/Trackunit/manager/commit/6e00ceebd858d7a591e916bf7cf5f8ca174616b2))
|
|
63
|
+
|
|
64
|
+
### [0.0.49](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.48...iris-app-build-utilities/0.0.49) (2022-09-08)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
### Reverts
|
|
68
|
+
|
|
69
|
+
* Revert "ci: bump iris-app-build-utilities to 0.0.49-alpha-506424025.0 [skip ci]" ([6152e24](https://github.com/Trackunit/manager/commit/6152e243d8d447bb0e0bed7ac18e2f8c1bceb2b7))
|
|
70
|
+
|
|
71
|
+
### [0.0.48](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.47...iris-app-build-utilities/0.0.48) (2022-08-30)
|
|
72
|
+
|
|
73
|
+
### [0.0.47](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.46...iris-app-build-utilities/0.0.47) (2022-08-25)
|
|
74
|
+
|
|
75
|
+
### Dependency Updates
|
|
76
|
+
|
|
77
|
+
* `iris-app-api` updated to version `0.0.1`
|
|
78
|
+
### [0.0.46](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.45...iris-app-build-utilities/0.0.46) (2022-08-17)
|
|
79
|
+
|
|
80
|
+
### Dependency Updates
|
|
81
|
+
|
|
82
|
+
* `iris-app-api` updated to version `0.0.1`
|
|
83
|
+
### [0.0.45](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.44...iris-app-build-utilities/0.0.45) (2022-08-12)
|
|
84
|
+
|
|
85
|
+
### Dependency Updates
|
|
86
|
+
|
|
87
|
+
* `iris-app-api` updated to version `0.0.1`
|
|
88
|
+
### [0.0.44](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.43...iris-app-build-utilities/0.0.44) (2022-08-05)
|
|
89
|
+
|
|
90
|
+
### Dependency Updates
|
|
91
|
+
|
|
92
|
+
* `iris-app-api` updated to version `0.0.1`
|
|
93
|
+
### [0.0.43](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.42...iris-app-build-utilities/0.0.43) (2022-08-04)
|
|
94
|
+
|
|
95
|
+
### [0.0.42](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.41...iris-app-build-utilities/0.0.42) (2022-07-29)
|
|
96
|
+
|
|
97
|
+
### Dependency Updates
|
|
98
|
+
|
|
99
|
+
* `iris-app-api` updated to version `0.0.1`
|
|
100
|
+
### [0.0.41](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.40...iris-app-build-utilities/0.0.41) (2022-07-29)
|
|
101
|
+
|
|
102
|
+
### Dependency Updates
|
|
103
|
+
|
|
104
|
+
* `iris-app-api` updated to version `0.0.1`
|
|
105
|
+
### [0.0.40](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.39...iris-app-build-utilities/0.0.40) (2022-07-05)
|
|
106
|
+
|
|
107
|
+
### Dependency Updates
|
|
108
|
+
|
|
109
|
+
* `iris-app-api` updated to version `0.0.1`
|
|
110
|
+
### [0.0.39](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.38...iris-app-build-utilities/0.0.39) (2022-06-28)
|
|
111
|
+
|
|
112
|
+
### Dependency Updates
|
|
113
|
+
|
|
114
|
+
* `iris-app-api` updated to version `0.0.1`
|
|
115
|
+
### [0.0.38](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.37...iris-app-build-utilities/0.0.38) (2022-06-27)
|
|
116
|
+
|
|
117
|
+
### Dependency Updates
|
|
118
|
+
|
|
119
|
+
* `iris-app-api` updated to version `0.0.1`
|
|
120
|
+
### [0.0.37](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.36...iris-app-build-utilities/0.0.37) (2022-06-27)
|
|
121
|
+
|
|
122
|
+
### [0.0.36](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.35...iris-app-build-utilities/0.0.36) (2022-06-26)
|
|
123
|
+
|
|
124
|
+
### Dependency Updates
|
|
125
|
+
|
|
126
|
+
* `iris-app-api` updated to version `0.0.1`
|
|
127
|
+
### [0.0.35](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.34...iris-app-build-utilities/0.0.35) (2022-06-23)
|
|
128
|
+
|
|
129
|
+
### Dependency Updates
|
|
130
|
+
|
|
131
|
+
* `iris-app-api` updated to version `0.0.1`
|
|
132
|
+
### [0.0.34](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.33...iris-app-build-utilities/0.0.34) (2022-06-20)
|
|
133
|
+
|
|
134
|
+
### Dependency Updates
|
|
135
|
+
|
|
136
|
+
* `iris-app-api` updated to version `0.0.1`
|
package/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
> **⚠️ Beta**
|
|
2
|
+
>
|
|
3
|
+
> This is a beta version and subject to change without notice.
|
|
4
|
+
|
|
5
|
+
# Trackunit Iris App build utilities
|
|
6
|
+
The `@trackunit/iris-app-build-utilities` package contains several tools used for the Trackunit Iris App SDK.
|
|
7
|
+
|
|
8
|
+
Trackunit Iris Apps are used by external developers to integrate custom functionality into [the Trackunit Manager platform](https://www.trackunit.com/services/manager/).
|
|
9
|
+
|
|
10
|
+
For more info and a full guide on Iris App SDK Development, please visit our [Developer Hub](https://developers.trackunit.com/).
|
|
11
|
+
|
|
12
|
+
## Basic Usage
|
|
13
|
+
This package is not meant for isolated usage but is a part of the [`@trackunit/iris-app`](https://www.npmjs.com/package/@trackunit/iris-app) package.
|
|
14
|
+
|
|
15
|
+
## Trackunit
|
|
16
|
+
This package was developed by Trackunit ApS.
|
|
17
|
+
Trackunit is the leading SaaS-based IoT solution for the construction industry, offering an ecosystem of hardware, fleet management software & telematics.
|
|
18
|
+
|
|
19
|
+

|
package/package.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@trackunit/iris-app-build-utilities",
|
|
3
|
+
"version": "0.0.1-alpha-afcc978985.0",
|
|
4
|
+
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
|
+
"repository": "https://github.com/Trackunit/manager",
|
|
6
|
+
"main": "./src/index.js",
|
|
7
|
+
"types": "./src/index.d.ts",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"tsconfig-paths": "^3.14.1",
|
|
10
|
+
"typescript": "4.7.3",
|
|
11
|
+
"@trackunit/iris-app-api": "0.0.1-alpha-afcc978985.0",
|
|
12
|
+
"tslib": "^2.4.0"
|
|
13
|
+
},
|
|
14
|
+
"peerDependencies": {}
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface ITSConfigOptions {
|
|
2
|
+
projectRootDir: string;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* This enables webpack typescript file to load projects from the path section in tsconfig file.
|
|
6
|
+
* @param options {ITSConfigOptions} The options for the .
|
|
7
|
+
* @returns {Exposes} Exposes object for module federation.
|
|
8
|
+
*/
|
|
9
|
+
export declare const enableTsConfigPath: (options: ITSConfigOptions) => import("typescript").ParsedCommandLine;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.enableTsConfigPath = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const tsconfig_paths_1 = require("tsconfig-paths");
|
|
7
|
+
let tsModule;
|
|
8
|
+
/**
|
|
9
|
+
* This enables webpack typescript file to load projects from the path section in tsconfig file.
|
|
10
|
+
* @param options {ITSConfigOptions} The options for the .
|
|
11
|
+
* @returns {Exposes} Exposes object for module federation.
|
|
12
|
+
*/
|
|
13
|
+
const enableTsConfigPath = (options) => {
|
|
14
|
+
if (!tsModule) {
|
|
15
|
+
tsModule = require("typescript");
|
|
16
|
+
}
|
|
17
|
+
const readResult = tsModule.readConfigFile((0, path_1.join)(options.projectRootDir, "tsconfig.app.json"), tsModule.sys.readFile);
|
|
18
|
+
const result = tsModule.parseJsonConfigFileContent(readResult.config, tsModule.sys, options.projectRootDir);
|
|
19
|
+
require.extensions[".ts"] = function (m, filename) {
|
|
20
|
+
const input = (0, fs_1.readFileSync)(filename, "utf-8");
|
|
21
|
+
const { outputText } = tsModule.transpileModule(input, {
|
|
22
|
+
compilerOptions: readResult.config,
|
|
23
|
+
});
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
|
+
m._compile(outputText, filename);
|
|
26
|
+
};
|
|
27
|
+
const loadedConf = (0, tsconfig_paths_1.loadConfig)(options.projectRootDir);
|
|
28
|
+
(0, tsconfig_paths_1.register)({
|
|
29
|
+
baseUrl: (0, path_1.join)(options.projectRootDir, loadedConf.baseUrl),
|
|
30
|
+
paths: loadedConf.paths,
|
|
31
|
+
});
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
exports.enableTsConfigPath = enableTsConfigPath;
|
|
35
|
+
//# sourceMappingURL=enableTsConfigPath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enableTsConfigPath.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/enableTsConfigPath.ts"],"names":[],"mappings":";;;AAAA,2BAAkC;AAClC,+BAA4B;AAC5B,mDAAiF;AAMjF,IAAI,QAAqC,CAAC;AAE1C;;;;GAIG;AACI,MAAM,kBAAkB,GAAG,CAAC,OAAyB,EAAE,EAAE;IAC9D,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;KAClC;IACD,MAAM,UAAU,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAA,WAAI,EAAC,OAAO,CAAC,cAAc,EAAE,mBAAmB,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACrH,MAAM,MAAM,GAAG,QAAQ,CAAC,0BAA0B,CAAC,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IAE5G,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,EAAE,QAAQ;QAC/C,MAAM,KAAK,GAAG,IAAA,iBAAY,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAE9C,MAAM,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC,KAAK,EAAE;YACrD,eAAe,EAAE,UAAU,CAAC,MAAM;SACnC,CAAC,CAAC;QAEH,8DAA8D;QAC7D,CAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC5C,CAAC,CAAC;IACF,MAAM,UAAU,GAAG,IAAA,2BAAU,EAAC,OAAO,CAAC,cAAc,CAA8B,CAAC;IACnF,IAAA,yBAAQ,EAAC;QACP,OAAO,EAAE,IAAA,WAAI,EAAC,OAAO,CAAC,cAAc,EAAE,UAAU,CAAC,OAAO,CAAC;QACzD,KAAK,EAAE,UAAU,CAAC,KAAK;KACxB,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAvBW,QAAA,kBAAkB,sBAuB7B","sourcesContent":["import { readFileSync } from \"fs\";\nimport { join } from \"path\";\nimport { ConfigLoaderSuccessResult, loadConfig, register } from \"tsconfig-paths\";\n\ninterface ITSConfigOptions {\n projectRootDir: string;\n}\n\nlet tsModule: typeof import(\"typescript\");\n\n/**\n * This enables webpack typescript file to load projects from the path section in tsconfig file.\n * @param options {ITSConfigOptions} The options for the .\n * @returns {Exposes} Exposes object for module federation.\n */\nexport const enableTsConfigPath = (options: ITSConfigOptions) => {\n if (!tsModule) {\n tsModule = require(\"typescript\");\n }\n const readResult = tsModule.readConfigFile(join(options.projectRootDir, \"tsconfig.app.json\"), tsModule.sys.readFile);\n const result = tsModule.parseJsonConfigFileContent(readResult.config, tsModule.sys, options.projectRootDir);\n\n require.extensions[\".ts\"] = function (m, filename) {\n const input = readFileSync(filename, \"utf-8\");\n\n const { outputText } = tsModule.transpileModule(input, {\n compilerOptions: readResult.config,\n });\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (m as any)._compile(outputText, filename);\n };\n const loadedConf = loadConfig(options.projectRootDir) as ConfigLoaderSuccessResult;\n register({\n baseUrl: join(options.projectRootDir, loadedConf.baseUrl),\n paths: loadedConf.paths,\n });\n return result;\n};\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface IAliasesFromTsConfigOptions {
|
|
2
|
+
nxRootDir: string;
|
|
3
|
+
tsConfigFilePath?: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Generates a list of aliases from the options.tsConfigFilePath defaults to tsconfig.base.json.
|
|
7
|
+
* @returns aliases Exposes object for module federation.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getAliasesFromTsConfig: (options: IAliasesFromTsConfigOptions) => Promise<Record<string, string>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAliasesFromTsConfig = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const path = tslib_1.__importStar(require("path"));
|
|
6
|
+
const ts = tslib_1.__importStar(require("typescript"));
|
|
7
|
+
const fromTsAlias = (tsAlias) => {
|
|
8
|
+
return tsAlias.indexOf("/*") === tsAlias.length - 2 ? tsAlias.substring(0, tsAlias.length - 2) : `${tsAlias}$`;
|
|
9
|
+
};
|
|
10
|
+
const fromTsPath = (tsPath) => {
|
|
11
|
+
return tsPath.indexOf("/*") === tsPath.length - 2 ? tsPath.substring(0, tsPath.length - 2) : tsPath;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Generates a list of aliases from the options.tsConfigFilePath defaults to tsconfig.base.json.
|
|
15
|
+
* @returns aliases Exposes object for module federation.
|
|
16
|
+
*/
|
|
17
|
+
const getAliasesFromTsConfig = (options) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
const tsConfig = ts.readConfigFile(path.join(options.nxRootDir, options.tsConfigFilePath || "tsconfig.base.json"), ts.sys.readFile);
|
|
20
|
+
if (!((_a = tsConfig === null || tsConfig === void 0 ? void 0 : tsConfig.config.compilerOptions) === null || _a === void 0 ? void 0 : _a.paths)) {
|
|
21
|
+
throw Error(`option tsconfigFilePath missing paths property in (tsConfig.compilerOptions.paths)`);
|
|
22
|
+
}
|
|
23
|
+
return Object.entries((_b = tsConfig === null || tsConfig === void 0 ? void 0 : tsConfig.config.compilerOptions) === null || _b === void 0 ? void 0 : _b.paths).reduce((acc, [key, value]) => {
|
|
24
|
+
if (value.length !== 1) {
|
|
25
|
+
throw new TypeError(`Unsupported TS alias ${key} has length ${value.length}`);
|
|
26
|
+
}
|
|
27
|
+
acc[fromTsAlias(key)] = path.join(options.nxRootDir, fromTsPath(value[0]));
|
|
28
|
+
return acc;
|
|
29
|
+
}, {});
|
|
30
|
+
});
|
|
31
|
+
exports.getAliasesFromTsConfig = getAliasesFromTsConfig;
|
|
32
|
+
//# sourceMappingURL=getAliasesFromTsConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAliasesFromTsConfig.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getAliasesFromTsConfig.ts"],"names":[],"mappings":";;;;AAAA,mDAA6B;AAC7B,uDAAiC;AAMjC,MAAM,WAAW,GAAG,CAAC,OAAe,EAAE,EAAE;IACtC,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,CAAC;AACjH,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,MAAc,EAAE,EAAE;IACpC,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AACtG,CAAC,CAAC;AAEF;;;GAGG;AACI,MAAM,sBAAsB,GAAG,CAAO,OAAoC,EAAE,EAAE;;IACnF,MAAM,QAAQ,GAAG,EAAE,CAAC,cAAc,CAChC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,gBAAgB,IAAI,oBAAoB,CAAC,EAC9E,EAAE,CAAC,GAAG,CAAC,QAAQ,CAChB,CAAC;IAEF,IAAI,CAAC,CAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,CAAC,eAAe,0CAAE,KAAK,CAAA,EAAE;QAC5C,MAAM,KAAK,CAAC,oFAAoF,CAAC,CAAC;KACnG;IACD,OAAO,MAAM,CAAC,OAAO,CAAC,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,CAAC,eAAe,0CAAE,KAAiC,CAAC,CAAC,MAAM,CAE/F,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACtB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACtB,MAAM,IAAI,SAAS,CAAC,wBAAwB,GAAG,eAAe,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;SAC/E;QACD,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3E,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC,CAAA,CAAC;AAlBW,QAAA,sBAAsB,0BAkBjC","sourcesContent":["import * as path from \"path\";\nimport * as ts from \"typescript\";\ninterface IAliasesFromTsConfigOptions {\n nxRootDir: string;\n tsConfigFilePath?: string;\n}\n\nconst fromTsAlias = (tsAlias: string) => {\n return tsAlias.indexOf(\"/*\") === tsAlias.length - 2 ? tsAlias.substring(0, tsAlias.length - 2) : `${tsAlias}$`;\n};\n\nconst fromTsPath = (tsPath: string) => {\n return tsPath.indexOf(\"/*\") === tsPath.length - 2 ? tsPath.substring(0, tsPath.length - 2) : tsPath;\n};\n\n/**\n * Generates a list of aliases from the options.tsConfigFilePath defaults to tsconfig.base.json.\n * @returns aliases Exposes object for module federation.\n */\nexport const getAliasesFromTsConfig = async (options: IAliasesFromTsConfigOptions) => {\n const tsConfig = ts.readConfigFile(\n path.join(options.nxRootDir, options.tsConfigFilePath || \"tsconfig.base.json\"),\n ts.sys.readFile\n );\n\n if (!tsConfig?.config.compilerOptions?.paths) {\n throw Error(`option tsconfigFilePath missing paths property in (tsConfig.compilerOptions.paths)`);\n }\n return Object.entries(tsConfig?.config.compilerOptions?.paths as Record<string, string[]>).reduce<\n Record<string, string>\n >((acc, [key, value]) => {\n if (value.length !== 1) {\n throw new TypeError(`Unsupported TS alias ${key} has length ${value.length}`);\n }\n acc[fromTsAlias(key)] = path.join(options.nxRootDir, fromTsPath(value[0]));\n return acc;\n }, {});\n};\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Exposes, IrisAppManifest } from "@trackunit/iris-app-api";
|
|
2
|
+
interface IExposedExtensionsOptions {
|
|
3
|
+
nxRootDir: string;
|
|
4
|
+
manifest: IrisAppManifest;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Generates a list of exposed extensions from a manifest.
|
|
8
|
+
* @param manifest {Manifest} The manifest to get the exposed extensions from.
|
|
9
|
+
* @returns {Exposes} Exposes object for module federation.
|
|
10
|
+
*/
|
|
11
|
+
export declare const getExposedExtensions: (options: IExposedExtensionsOptions) => Promise<Exposes>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getExposedExtensions = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const path = tslib_1.__importStar(require("path"));
|
|
6
|
+
/**
|
|
7
|
+
* Generates a list of exposed extensions from a manifest.
|
|
8
|
+
* @param manifest {Manifest} The manifest to get the exposed extensions from.
|
|
9
|
+
* @returns {Exposes} Exposes object for module federation.
|
|
10
|
+
*/
|
|
11
|
+
const getExposedExtensions = (options) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
12
|
+
const output = {};
|
|
13
|
+
if (options.manifest.extensions) {
|
|
14
|
+
for (const extension of options.manifest.extensions) {
|
|
15
|
+
if (extension.type !== "REPORT_EXTENSION") {
|
|
16
|
+
output[`./${extension.id}`] = path.join(options.nxRootDir, extension.sourceRoot, extension.main ? extension.main : "index.tsx");
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return output;
|
|
21
|
+
});
|
|
22
|
+
exports.getExposedExtensions = getExposedExtensions;
|
|
23
|
+
//# sourceMappingURL=getExposedExtensions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getExposedExtensions.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getExposedExtensions.ts"],"names":[],"mappings":";;;;AACA,mDAA6B;AAM7B;;;;GAIG;AACI,MAAM,oBAAoB,GAAG,CAAO,OAAkC,EAAoB,EAAE;IACjG,MAAM,MAAM,GAAY,EAAE,CAAC;IAC3B,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE;QAC/B,KAAK,MAAM,SAAS,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE;YACnD,IAAI,SAAS,CAAC,IAAI,KAAK,kBAAkB,EAAE;gBACzC,MAAM,CAAC,KAAK,SAAS,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CACrC,OAAO,CAAC,SAAS,EACjB,SAAS,CAAC,UAAU,EACpB,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAC9C,CAAC;aACH;SACF;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAA,CAAC;AAdW,QAAA,oBAAoB,wBAc/B","sourcesContent":["import { Exposes, IrisAppManifest } from \"@trackunit/iris-app-api\";\nimport * as path from \"path\";\n\ninterface IExposedExtensionsOptions {\n nxRootDir: string;\n manifest: IrisAppManifest;\n}\n/**\n * Generates a list of exposed extensions from a manifest.\n * @param manifest {Manifest} The manifest to get the exposed extensions from.\n * @returns {Exposes} Exposes object for module federation.\n */\nexport const getExposedExtensions = async (options: IExposedExtensionsOptions): Promise<Exposes> => {\n const output: Exposes = {};\n if (options.manifest.extensions) {\n for (const extension of options.manifest.extensions) {\n if (extension.type !== \"REPORT_EXTENSION\") {\n output[`./${extension.id}`] = path.join(\n options.nxRootDir,\n extension.sourceRoot,\n extension.main ? extension.main : \"index.tsx\"\n );\n }\n }\n }\n return output;\n};\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IrisAppManifest, Shared } from "@trackunit/iris-app-api";
|
|
2
|
+
interface ISharedDependenciesOptions {
|
|
3
|
+
manifest: IrisAppManifest;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Generates the shared dependencies to expose in the the module federation configuration.
|
|
7
|
+
* @param manifest {Manifest} The app manifest file
|
|
8
|
+
* @returns {Shared} The shared dependencies for module federation
|
|
9
|
+
*/
|
|
10
|
+
export declare const getSharedDependencies: (options: ISharedDependenciesOptions) => Shared;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSharedDependencies = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Generates the shared dependencies to expose in the the module federation configuration.
|
|
6
|
+
* @param manifest {Manifest} The app manifest file
|
|
7
|
+
* @returns {Shared} The shared dependencies for module federation
|
|
8
|
+
*/
|
|
9
|
+
const getSharedDependencies = (options) => {
|
|
10
|
+
return [
|
|
11
|
+
{
|
|
12
|
+
react: {
|
|
13
|
+
singleton: true,
|
|
14
|
+
eager: true,
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/dot-notation
|
|
16
|
+
requiredVersion: options.manifest.dependencies["react"],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"react-dom": {
|
|
21
|
+
singleton: true,
|
|
22
|
+
eager: true,
|
|
23
|
+
requiredVersion: options.manifest.dependencies["react-dom"],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
"single-spa-react",
|
|
27
|
+
];
|
|
28
|
+
};
|
|
29
|
+
exports.getSharedDependencies = getSharedDependencies;
|
|
30
|
+
//# sourceMappingURL=getSharedDependencies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSharedDependencies.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getSharedDependencies.ts"],"names":[],"mappings":";;;AAIA;;;;GAIG;AACI,MAAM,qBAAqB,GAAG,CAAC,OAAmC,EAAU,EAAE;IACnF,OAAO;QACL;YACE,KAAK,EAAE;gBACL,SAAS,EAAE,IAAI;gBACf,KAAK,EAAE,IAAI;gBACX,2DAA2D;gBAC3D,eAAe,EAAE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC;aACxD;SACF;QACD;YACE,WAAW,EAAE;gBACX,SAAS,EAAE,IAAI;gBACf,KAAK,EAAE,IAAI;gBACX,eAAe,EAAE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,WAAW,CAAC;aAC5D;SACF;QACD,kBAAkB;KACnB,CAAC;AACJ,CAAC,CAAC;AAnBW,QAAA,qBAAqB,yBAmBhC","sourcesContent":["import { IrisAppManifest, Shared } from \"@trackunit/iris-app-api\";\ninterface ISharedDependenciesOptions {\n manifest: IrisAppManifest;\n}\n/**\n * Generates the shared dependencies to expose in the the module federation configuration.\n * @param manifest {Manifest} The app manifest file\n * @returns {Shared} The shared dependencies for module federation\n */\nexport const getSharedDependencies = (options: ISharedDependenciesOptions): Shared => {\n return [\n {\n react: {\n singleton: true,\n eager: true,\n // eslint-disable-next-line @typescript-eslint/dot-notation\n requiredVersion: options.manifest.dependencies[\"react\"],\n },\n },\n {\n \"react-dom\": {\n singleton: true,\n eager: true,\n requiredVersion: options.manifest.dependencies[\"react-dom\"],\n },\n },\n \"single-spa-react\",\n ];\n};\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface ITailwindContentOptions {
|
|
2
|
+
nxRootDir: string;
|
|
3
|
+
app: string;
|
|
4
|
+
/**
|
|
5
|
+
* The name of the apps folder in the nx repo.
|
|
6
|
+
* (can be overridden in nx.json)
|
|
7
|
+
*
|
|
8
|
+
* @default apps
|
|
9
|
+
*/
|
|
10
|
+
appsDir?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Generates a list of exposed extensions from a manifest.
|
|
14
|
+
* @param manifest {Manifest} The manifest to get the exposed extensions from.
|
|
15
|
+
* @returns {Exposes} Exposes object for module federation.
|
|
16
|
+
*/
|
|
17
|
+
export declare const getTailwindContentForApp: (options: ITailwindContentOptions) => string[];
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTailwindContentForApp = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const tailwind_1 = require("@nrwl/react/tailwind");
|
|
6
|
+
const path = tslib_1.__importStar(require("path"));
|
|
7
|
+
/**
|
|
8
|
+
* Generates a list of exposed extensions from a manifest.
|
|
9
|
+
* @param manifest {Manifest} The manifest to get the exposed extensions from.
|
|
10
|
+
* @returns {Exposes} Exposes object for module federation.
|
|
11
|
+
*/
|
|
12
|
+
const getTailwindContentForApp = (options) => {
|
|
13
|
+
return [
|
|
14
|
+
...(0, tailwind_1.createGlobPatternsForDependencies)(path.join(options.nxRootDir, options.appsDir ? options.appsDir : "apps", options.app)).map(pattern => pattern.replace(/{tsx,jsx,js,html}/, "{tsx,ts,jsx,js,html}")),
|
|
15
|
+
options.nxRootDir + "/node_modules/@trackunit/react-components/**/**",
|
|
16
|
+
options.nxRootDir + "/node_modules/@trackunit/custom-field-components/**/**",
|
|
17
|
+
];
|
|
18
|
+
};
|
|
19
|
+
exports.getTailwindContentForApp = getTailwindContentForApp;
|
|
20
|
+
//# sourceMappingURL=getTailwindContentForApp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTailwindContentForApp.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getTailwindContentForApp.ts"],"names":[],"mappings":";;;;AAAA,mDAAyE;AACzE,mDAA6B;AAoB7B;;;;GAIG;AACI,MAAM,wBAAwB,GAAG,CAAC,OAAgC,EAAY,EAAE;IACrF,OAAO;QACL,GAAG,IAAA,4CAAiC,EAClC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,CACtF,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,CAAC;QAC9E,OAAO,CAAC,SAAS,GAAG,iDAAiD;QACrE,OAAO,CAAC,SAAS,GAAG,wDAAwD;KAC7E,CAAC;AACJ,CAAC,CAAC;AARW,QAAA,wBAAwB,4BAQnC","sourcesContent":["import { createGlobPatternsForDependencies } from \"@nrwl/react/tailwind\";\nimport * as path from \"path\";\n\ninterface ITailwindContentOptions {\n /*\n * Root of the nx repo.\n */\n nxRootDir: string;\n /*\n * Name of the app.\n */\n app: string;\n\n /**\n * The name of the apps folder in the nx repo.\n * (can be overridden in nx.json)\n *\n * @default apps\n */\n appsDir?: string;\n}\n/**\n * Generates a list of exposed extensions from a manifest.\n * @param manifest {Manifest} The manifest to get the exposed extensions from.\n * @returns {Exposes} Exposes object for module federation.\n */\nexport const getTailwindContentForApp = (options: ITailwindContentOptions): string[] => {\n return [\n ...createGlobPatternsForDependencies(\n path.join(options.nxRootDir, options.appsDir ? options.appsDir : \"apps\", options.app)\n ).map(pattern => pattern.replace(/{tsx,jsx,js,html}/, \"{tsx,ts,jsx,js,html}\")),\n options.nxRootDir + \"/node_modules/@trackunit/react-components/**/**\",\n options.nxRootDir + \"/node_modules/@trackunit/custom-field-components/**/**\",\n ];\n};\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Configuration } from "webpack-dev-server";
|
|
2
|
+
/**
|
|
3
|
+
* Generates a dev server configuration for webpack configuration.
|
|
4
|
+
* @param webpackDevServerConfiguration The configuration to extend.
|
|
5
|
+
* @returns {Configuration} The dev server for tiles.
|
|
6
|
+
*/
|
|
7
|
+
export declare const getTileWebpackDevServer: (webpackDevServerConfiguration?: Configuration) => Promise<Configuration>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTileWebpackDevServer = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
/**
|
|
6
|
+
* Generates a dev server configuration for webpack configuration.
|
|
7
|
+
* @param webpackDevServerConfiguration The configuration to extend.
|
|
8
|
+
* @returns {Configuration} The dev server for tiles.
|
|
9
|
+
*/
|
|
10
|
+
const getTileWebpackDevServer = (webpackDevServerConfiguration = {}) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
11
|
+
return Object.assign({ port: 22220, historyApiFallback: true, headers: {
|
|
12
|
+
"Access-Control-Allow-Credentials": "true",
|
|
13
|
+
"Access-Control-Max-Age": "3600",
|
|
14
|
+
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
|
|
15
|
+
"Access-Control-Allow-Headers": "X-Requested-With, baggage, content-type, Authorization, sentry-trace, session-id, x-trackunitappversion",
|
|
16
|
+
}, open: {
|
|
17
|
+
target: ["https://dev.manager.trackunit.com/iris-sdk-portal/main#runLocal"],
|
|
18
|
+
}, onListening: (server) => { }, setupMiddlewares: (middlewares, devServer) => {
|
|
19
|
+
var _a;
|
|
20
|
+
middlewares.push({
|
|
21
|
+
name: "cors-preflight",
|
|
22
|
+
path: "/",
|
|
23
|
+
middleware: (req, res, next) => {
|
|
24
|
+
if (req.method === "GET") {
|
|
25
|
+
next();
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
res.send("GET, HEAD");
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
(_a = devServer.app) === null || _a === void 0 ? void 0 : _a.use("/", (request, response, next) => {
|
|
33
|
+
response.header("Access-Control-Allow-Origin", request.headers.origin || "https://dev.manager.trackunit.com");
|
|
34
|
+
next();
|
|
35
|
+
});
|
|
36
|
+
return middlewares;
|
|
37
|
+
} }, webpackDevServerConfiguration);
|
|
38
|
+
});
|
|
39
|
+
exports.getTileWebpackDevServer = getTileWebpackDevServer;
|
|
40
|
+
//# sourceMappingURL=getTileWebpackDevServer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTileWebpackDevServer.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getTileWebpackDevServer.ts"],"names":[],"mappings":";;;;AAEA;;;;GAIG;AACI,MAAM,uBAAuB,GAAG,CACrC,gCAA+C,EAAE,EACzB,EAAE;IAC1B,uBACE,IAAI,EAAE,KAAK,EACX,kBAAkB,EAAE,IAAI,EACxB,OAAO,EAAE;YACP,kCAAkC,EAAE,MAAM;YAC1C,wBAAwB,EAAE,MAAM;YAChC,8BAA8B,EAAE,iCAAiC;YACjE,8BAA8B,EAC5B,yGAAyG;SAC5G,EACD,IAAI,EAAE;YACJ,MAAM,EAAE,CAAC,iEAAiE,CAAC;SAC5E,EACD,WAAW,EAAE,CAAC,MAAc,EAAE,EAAE,GAAE,CAAC,EACnC,gBAAgB,EAAE,CAAC,WAAyB,EAAE,SAAiB,EAAE,EAAE;;YACjE,WAAW,CAAC,IAAI,CAAC;gBACf,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,GAAG;gBACT,UAAU,EAAE,CAAC,GAAY,EAAE,GAAa,EAAE,IAAgB,EAAE,EAAE;oBAC5D,IAAI,GAAG,CAAC,MAAM,KAAK,KAAK,EAAE;wBACxB,IAAI,EAAE,CAAC;qBACR;yBAAM;wBACL,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;qBACvB;gBACH,CAAC;aACF,CAAC,CAAC;YACH,MAAA,SAAS,CAAC,GAAG,0CAAE,GAAG,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;gBAClD,QAAQ,CAAC,MAAM,CAAC,6BAA6B,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,IAAI,mCAAmC,CAAC,CAAC;gBAC9G,IAAI,EAAE,CAAC;YACT,CAAC,CAAC,CAAC;YACH,OAAO,WAAW,CAAC;QACrB,CAAC,IACE,6BAA6B,EAChC;AACJ,CAAC,CAAA,CAAC;AArCW,QAAA,uBAAuB,2BAqClC","sourcesContent":["import Server, { Configuration, Middleware, Request, Response } from \"webpack-dev-server\";\n\n/**\n * Generates a dev server configuration for webpack configuration.\n * @param webpackDevServerConfiguration The configuration to extend.\n * @returns {Configuration} The dev server for tiles.\n */\nexport const getTileWebpackDevServer = async (\n webpackDevServerConfiguration: Configuration = {}\n): Promise<Configuration> => {\n return {\n port: 22220,\n historyApiFallback: true,\n headers: {\n \"Access-Control-Allow-Credentials\": \"true\",\n \"Access-Control-Max-Age\": \"3600\",\n \"Access-Control-Allow-Methods\": \"GET, POST, PUT, DELETE, OPTIONS\",\n \"Access-Control-Allow-Headers\":\n \"X-Requested-With, baggage, content-type, Authorization, sentry-trace, session-id, x-trackunitappversion\",\n },\n open: {\n target: [\"https://dev.manager.trackunit.com/iris-sdk-portal/main#runLocal\"],\n },\n onListening: (server: Server) => {},\n setupMiddlewares: (middlewares: Middleware[], devServer: Server) => {\n middlewares.push({\n name: \"cors-preflight\",\n path: \"/\",\n middleware: (req: Request, res: Response, next: () => void) => {\n if (req.method === \"GET\") {\n next();\n } else {\n res.send(\"GET, HEAD\");\n }\n },\n });\n devServer.app?.use(\"/\", (request, response, next) => {\n response.header(\"Access-Control-Allow-Origin\", request.headers.origin || \"https://dev.manager.trackunit.com\");\n next();\n });\n return middlewares;\n },\n ...webpackDevServerConfiguration,\n };\n};\n"]}
|
package/src/index.d.ts
ADDED
package/src/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./enableTsConfigPath"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./getAliasesFromTsConfig"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./getExposedExtensions"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./getSharedDependencies"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./getTailwindContentForApp"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./getTileWebpackDevServer"), exports);
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/index.ts"],"names":[],"mappings":";;;AAAA,+DAAqC;AACrC,mEAAyC;AACzC,iEAAuC;AACvC,kEAAwC;AACxC,qEAA2C;AAC3C,oEAA0C","sourcesContent":["export * from \"./enableTsConfigPath\";\nexport * from \"./getAliasesFromTsConfig\";\nexport * from \"./getExposedExtensions\";\nexport * from \"./getSharedDependencies\";\nexport * from \"./getTailwindContentForApp\";\nexport * from \"./getTileWebpackDevServer\";\n"]}
|