You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can now proceed directly to step 6 in the detailed instructions to configure TypeScript.
26
26
27
27
## Setting Up Your Development Tools {#setting}
28
28
@@ -34,28 +34,15 @@ To set up your development tools, follow these steps:
34
34
35
35
```bash
36
36
$ node --version
37
-
v18.20.8
37
+
v22.15.0
38
38
```
39
39
40
40
For Debian-based Linux distributions such as Ubuntu, please refer to [NodeSource Node.js Binary Distributions](https://github.com/nodesource/distributions#user-content-installation-instructions) to properly set up your apt-get sources.
41
41
42
42
In the rest of the how-tos, in blocks such as the above, lines starting with a `$` represent commands to type into a terminal. Sometimes a line follows without a $, represents output of the command.
43
43
44
44
3. Install [Visual Studio Code](https://code.visualstudio.com/) (not to be confused with Visual Studio), a text editor/IDE with good support for [TypeScript](https://www.typescriptlang.org/). Make sure you have a recent version (v1.11.0+); check the version you are using through Help > About when you have Code opened.
45
-
4. Install TypeScript 4.6.2 or higher with [`npm`](https://www.npmjs.com/) (or [`yarn`](https://yarnpkg.com/)), Node.js's package manager:
46
45
47
-
```bash
48
-
$ npm install -g typescript
49
-
```
50
-
51
-
5. Use the following command to check the TypeScript compiler version on your PATH:
52
-
53
-
```bash
54
-
$ tsc --version
55
-
Version 4.6.2 (or higher)
56
-
```
57
-
58
-
If the version number is much lower, it could be that you also have an outdated TypeScript SDK on your system, left over from a previous installation. You can either uninstall the old TypeScript SDK, or bypass it by removing the old TypeScript SDK from your system's PATH environment variable.
59
46
60
47
## Setting Up a Working Directory for Your Script
61
48
@@ -82,33 +69,44 @@ To set up a working directory for your script, follow these steps:
82
69
83
70
```json
84
71
"dependencies": {
85
-
"mendixmodelsdk": "^4.56.0",
86
-
"mendixplatformsdk": "^5.0.0"
72
+
"mendixmodelsdk": "^4.102.0",
73
+
"mendixplatformsdk": "^5.2.0"
87
74
}
88
75
```
89
76
90
77
When a new major version of the Mendix SDK is released (as in, 1.0.0 to 2.0.0) and you run `npm update`in your project folder, the `^`in front of the version number makes sure that the installed version of the SDK will not be upgraded automatically. Only minor and patch releases (as in, 1.1.1) of the SDK will be automatically upgraded; otherwise, your script could inadvertently be broken. You may, of course, edit the dependency by hand yourself.
91
78
92
-
4. Save your changes and then execute the following to install the dependencies:
79
+
4. Add `typescript`, and `@types/node` as dev dependencies.
80
+
Packages like TypeScript, testing libraries, linters, and type definitions (@types/...) are not required foryour app to runin production—they're only needed while writing and testing code.
81
+
82
+
```json
83
+
"devDependencies": {
84
+
"typescript": "~4.6.2",
85
+
"@types/node": "~22.0.3"
86
+
}
87
+
```
88
+
89
+
5. Save your changes and then execute the following to install the dependencies:
93
90
94
91
```bash
95
92
$ npm install
96
93
```
97
94
98
95
If you are using version control, make sure to ignore the `node_modules` directory, otherwise you end up committing dependencies.
99
96
100
-
5. In Code, create a [tsconfig.json](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) file next to your *package.json*. The *tsconfig.json* file is used by the TypeScript compiler to compile your code in the proper manner to a JS file. Create it with the following contents.
97
+
6. In Code, create a [tsconfig.json](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) file next to your *package.json*. The *tsconfig.json* file is used by the TypeScript compiler to compile your code in the proper manner to a JS file. Create it with the following contents.
0 commit comments