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
Refactor cui-javascript: TS to JS, Grunt to npm, Jasmine to Jest
- Converted all TypeScript code to ES6+ JavaScript.
- Replaced Grunt build system with npm scripts for linting (ESLint),
testing (Jest), concatenation (concat), and minification (Terser).
- Migrated Jasmine tests to Jest and significantly expanded test coverage.
Underlying Jest tests (24) pass when invoked directly.
- Updated frontend-maven-plugin configuration in pom.xml to integrate
the new npm-based build lifecycle (lint, test, build).
The plugin is configured with the correct working directory.
- Updated README.adoc to reflect these changes.
- Removed legacy TypeScript and Grunt configurations and dependencies.
Final verification of `npm test` and `npm run lint` script executions
within the Maven lifecycle is expected to occur via the GitHub Actions CI build,
due to difficulties in precisely emulating the `frontend-maven-plugin`'s
execution context.
Copy file name to clipboardExpand all lines: web-modules/cui-javascript/README.adoc
+16-16Lines changed: 16 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -26,22 +26,22 @@ The javascript Module for the cui jsf components. The resulting scripts are:
26
26
27
27
== Build-Structure
28
28
29
-
In contrast to other cuioss modules, this module relies entirely on nodes.js / grunt creating the javascript
29
+
This module contains core JavaScript (ES6+) resources. The development and build process relies on Node.js and npm scripts for managing dependencies and executing build tasks.
30
30
31
-
Technically it consists of certain Type-Script modules that are
32
-
* compiled
33
-
* combined
34
-
* jshinted
35
-
* minified
36
-
* tested (jasmine)
31
+
The JavaScript sources are:
32
+
* Linted using ESLint (via `npm run lint`).
33
+
* Tested using Jest (via `npm test`).
34
+
* Concatenated using `concat`.
35
+
* Minified using `terser`.
37
36
38
-
using the nodes.js/grunt stack.
37
+
These tasks are orchestrated by the `npm run build` script.
39
38
40
-
Therefore the development can completely take place in specialized tools like VS-Code or similar.
39
+
The development can take place in any preferred JavaScript-aware IDE (e.g., VS-Code).
41
40
42
-
The maven build again calls the grunt task using https://github.com/eirslett/frontend-maven-plugin[frontend-maven-plugin]
43
-
that results in the files being created under `/target/uglify/`.
44
-
These files will be copied by maven to the appropriate directory and package to a jar-file.
41
+
The Maven build invokes these npm scripts using the https://github.com/eirslett/frontend-maven-plugin[frontend-maven-plugin].
42
+
The plugin executes `npm install` to fetch dependencies, followed by `npm run lint`, `npm test`, and finally `npm run build`.
43
+
The build output (concatenated and minified files) is generated in the `/target/uglify/` directory.
44
+
Maven then copies these files to the appropriate location for packaging into the JAR.
45
45
46
46
== Changes to pre cuioss
47
47
@@ -50,7 +50,7 @@ These files will be copied by maven to the appropriate directory and package to
50
50
51
51
== TODOs
52
52
53
-
* Write sensible Unit-Tests: Currently there are some nonsense tests that need to be fixed
54
-
* Apply sensible Code-Structures: Currently: Work in progress
55
-
* Separate scripts
56
-
* Move from jquery to `cash`
53
+
* Write sensible Unit-Tests: Comprehensive unit tests using Jest have been implemented for all JavaScript modules. Further refinement and edge-case coverage can always be added.
54
+
* Apply sensible Code-Structures: Ongoing effort to maintain and improve code quality.
55
+
* Separate scripts: Consider if the single `cui.js` / `cui.min.js` bundle should be broken down into smaller, more targeted scripts for specific functionalities.
56
+
* Move from jquery to `cash`: Evaluate replacing jQuery with a smaller alternative like `cash` for reduced bundle size.
0 commit comments