@eclipse-scout/migrate 23.1.8 → 23.1.12
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/README.md +13 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -119,10 +119,14 @@ In order to run the TypeScript migration, do the following:
|
|
|
119
119
|
- Ensure you have a clean Git working tree (no uncommitted files).
|
|
120
120
|
- Create a `tsconfig.json` as described [here](#tsconfig)
|
|
121
121
|
- Add scripts in your `package.json` as described below.
|
|
122
|
+
- Add an `override` in your `package.json` to fix the TypeScript version to 4.8.3 (the migrate tool will skip some migrations and print a warning about the wrong version otherwise). This is only needed for the migration and has to be
|
|
123
|
+
removed afterwards.
|
|
122
124
|
- Adjust the module map as described in the chapter [Module Map](#module-map)
|
|
123
125
|
- Add custom type maps if you have a large code base and would like to automate a little more, see [Type Map](#type-map)
|
|
124
126
|
- Run the `rename` script by pressing the play button next to it in IntelliJ or using the command line: `npm run rename`.
|
|
125
|
-
|
|
127
|
+
- Adjust the paths in `package.json` (to `index.ts`), in `webpack.config.js` (to your entry point file) and in `karma.conf.js` (to `test-index.ts`).
|
|
128
|
+
- Open `index.ts` and replace `import * as self from './index.js';` with `import * as self from './index'`;
|
|
129
|
+
- Commit the changes to ensure Git can track the renames correctly.
|
|
126
130
|
- Run the `migrate` script.
|
|
127
131
|
- Review every file:
|
|
128
132
|
- Verify / add the types of the class properties.
|
|
@@ -133,6 +137,9 @@ In order to run the TypeScript migration, do the following:
|
|
|
133
137
|
Copy the relevant class properties to a separate model file.
|
|
134
138
|
In your widget, implement the model interface and declare a model variable.
|
|
135
139
|
- To create the event maps, you can run the `event-maps` script from below and copy the result into a separate event maps file.
|
|
140
|
+
- If you use third party libraries, you may want to check if they provide types and add them to the `devDependencies` of your `package.json` (e.g. @types/jquery).
|
|
141
|
+
See also [Project Setup for TypeScript](https://eclipsescout.github.io/scout-docs/stable/technical-guide/user-interface/typescript.html#project-setup-for-typescript)
|
|
142
|
+
- Remove the added `scripts`, `overrides` and dependency to `@eclipse-scout/migrate`.
|
|
136
143
|
|
|
137
144
|
```json
|
|
138
145
|
{
|
|
@@ -140,6 +147,11 @@ In order to run the TypeScript migration, do the following:
|
|
|
140
147
|
"rename": "scout-migrate --rename --sources src/main/js/**/*.js",
|
|
141
148
|
"migrate": "scout-migrate --rename false --migrate ts --sources src/main/js/**/*.ts --moduleMap.yourNamespace path:src/main/js/index.ts",
|
|
142
149
|
"event-maps": "scout-migrate --print-event-maps --sources src/main/js/**/*.ts"
|
|
150
|
+
},
|
|
151
|
+
"pnpm": {
|
|
152
|
+
"overrides": {
|
|
153
|
+
"typescript": "4.8.3"
|
|
154
|
+
}
|
|
143
155
|
}
|
|
144
156
|
}
|
|
145
157
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-scout/migrate",
|
|
3
|
-
"version": "23.1.
|
|
3
|
+
"version": "23.1.12",
|
|
4
4
|
"description": "TypeScript migration module",
|
|
5
5
|
"author": "BSI Business Systems Integration AG",
|
|
6
6
|
"homepage": "https://www.eclipse.org/scout",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"jest": "29.3.1",
|
|
43
43
|
"@babel/preset-env": "7.20.2",
|
|
44
44
|
"@babel/core": "7.20.5",
|
|
45
|
-
"@eclipse-scout/tsconfig": "23.1.
|
|
45
|
+
"@eclipse-scout/tsconfig": "23.1.12"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"scout-migrate": "node bin/scout-migrate",
|