Commit 4311070
committed
fix: builing of nativescript-cloud package fails
Building the nativescript-cloud package fails with error:
```
node_modules/nativescript/lib/services/analytics/analytics.d.ts(67,9): error TS2304: Cannot find name 'AnalyticsLoggingMessageType'.
```
The problem is that the build of `nativescript-cloud` extension needs to get all interfaces from CLI and include them in the global scope of the `nativescript-cloud`, so it can be transpiled. Currently this is done by iterrating over all files in nativescript and searching for `.d.ts` files.
For each `.d.ts` file, we create a new entry in a `references.d.ts` file in the root of `nativescript-cloud`. When trying to transpile the project, it fails as one of the included references (`analytics.d.ts`) uses a type (enum in this case) that is not available in the included references.
Fix this by moving the enums to `.d.ts` files - this way the transpiled `.js` files will not change (TypeScript strips all const enums from produced `.js` by replacing the enum usage with the actual value) and the transpilation of `nativescript-cloud` will work as well.1 parent e2b55b2 commit 4311070
1 file changed
+2
-2
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
0 commit comments