Commit graph

12 commits

Author SHA1 Message Date
regexowl
7c7427761b tsconfig: Specify include
Specify, what folders to include in the compilation process. This limits the scope, might reduce compilation time and will resolve errors outputted to the console during build.
2025-05-26 09:46:16 +02:00
Klara Simickova
aaabed38a0 Revert "tsconfig: Exclude /pkg folder during build"
This reverts commit 18f6bc74de.
2025-03-28 16:13:14 +01:00
regexowl
18f6bc74de tsconfig: Exclude /pkg folder during build
After running `make cockpit/devel`, the generated files do not pass `npm run build`, outputing failures and making dev console and output of `npm run build` cluttered with errors.

This excludes `/pkg` folder during build time, removing the errors.
2025-03-27 15:40:08 +01:00
Gianluca Zuccarelli
2b82fa3c4b tsconfig: cockpit plumbing
It was necessary to do a bit of plumbing to get typescript, webpack &
vitest all happy. To do this we had had to create a separate tsconfig
for the on-prem version and the service frontend.

We override the module resolution for both config files. For on-prem we
check modules in `pkg/lib` and for the service we resolve the modules to
stub functions of the `cockpit` & `cockpit/fsinfo` modules. This was so
typescript and webpack would not complain.

For on-prem we had to intruct webpack to resolve modules from both
`node_modules` and `pkg/lib`. While for the service we set the
resulotion for the two modules to false, which means they won't get
bundled with the service.

Lastly, we needed to set some aliases in the vitest config so that
vitest could resolve the `cockpit` & `cockpit/fsinfo` modules.

Using the cjs `require` keyword to import cockpit would have worked to
make typescript and webpack compile since these imports are not
statically analysed like the `import` keyword is. However, this approach
broke the tests as `require` imports are not supported in vitest.
2024-12-21 08:19:15 -06:00
Gianluca Zuccarelli
696cc4f4bf tsconfig: exactOptionalPropertyTypes
This is a recommended setting, see:
https://www.typescriptlang.org/tsconfig/#exactOptionalPropertyTypes
2024-12-06 12:02:34 -06:00
Gianluca Zuccarelli
b3b69c3653 tsconfig: update to es2021 2024-12-06 12:02:34 -06:00
Sanne Raymaekers
08950749d0 tsconfig.json: generate sourcemaps for typescript files 2024-11-15 13:03:01 +01:00
regexowl
da16a42128 Migrate from Jest to Vitest
This migrates our tests from using the Jest testing framework to Vitest.
2024-07-16 16:55:31 +02:00
regexowl
45a42ce549 src: Migrate remaining files to TypeScript
This migrates remaining JavaScript files to TypeScript and updates imports.
2024-06-06 08:38:41 +02:00
lucasgarfield
ad2bd7a31a V2Wizard: Add <ReleaseSelect> to Image Output step
The `<ReleaseSelect>` component now uses RTK instead of DDF. Some
additional small changes  were necessary due to Typescript - in
particular, we use a Map() to store the releases (in order to ensure
they appear in the correct order) and .tsconfig had to be modified to
allow iteration over the Map() object.
2024-01-08 11:59:23 +01:00
lucasgarfield
702b667dc5 API: Add programatically generated Provisioning API slice definitions
These definitions were generated using the RTKQ code generation tool and
will replace the existing definitions.
2023-07-28 15:05:08 +02:00
lucasgarfield
c33cc6ef70 Typescript: Add initial Typescript setup
This commit adds the initial setup for using Typescript in our project.
The tsconfig.json is very minimal at this point, we will introduce
stricter rules as our Typescript migration progresses.
2023-06-20 07:25:02 +02:00