Commit graph

11 commits

Author SHA1 Message Date
Tobias Hunger
63f7533dc9 compiler: Fix identifier normalization function
`__1` is a valid identifier, which we normalized to
`--1`, which is invalid.

This changes the nromalization function to leave a `_` in the first position.
2025-05-21 12:21:20 +02:00
Simon Hausmann
f94e5a73b0 Node.js: Fix support for loadFile() with an URL on Windows
We recommend the use of `loadFile(new URL("...", import.metal.url))`,
but this never worked on Windows, because we're not using the API
the Node.js docs even recommend to correctly covert to a local path on Windows.

(Apply the same logic to initTranslations)

Fixes #8209
2025-04-22 18:01:48 +02:00
Simon Hausmann
22e7c4d4a6 Fix Node.js docs missing Diagnostic, DiagnosticLevel, RgbaColor, and Brush
typedoc uses typescript under the hood. An import from "rust-module.cjs" won't look for .d.ts but .d.cts as per https://www.typescriptlang.org/docs/handbook/modules/reference.html#file-extension-substitution .

This way the existing warning from the TS compiler that rust-module.cjs was imported as any goes away and actual type checking is being done. The rest of this commit fixes those type errors, including missing type casts to make ts-node's transpiler not thrown an exception.
2025-01-14 14:49:02 +01:00
Tasuku Suzuki
346d1c2df3 Fix typos
Ran `typos .` and fixed all typos that do make sense.
https://crates.io/crates/typos
2025-01-13 08:35:20 +01:00
Simon Hausmann
1ba2a6f0f0 Node.js: Upgrade TypeDoc
Typedoc complains about the links from the reference to the cover.md.
I couldn't find a way to make those warnings go away, but the links work.
As a remedy, `treatWarningsAsErrors` is removed temporarily.

Similarly, the relative links aren't supported either, so link to the latest
Slint docs.

Fixes #6488
2024-12-17 09:33:56 +01:00
Simon Hausmann
1888e58735 Add API to set the XDG app id
ChangeLog: Added function to set the XDG app id on Wayland/X11. This needs to be added with respective function names in the language sections.

Fixes #1332
2024-11-22 11:24:06 +01:00
FloVanGH
fe596179da
node: added fileloader to LoadData. (#6530) 2024-10-14 07:33:42 +02:00
FloVanGH
ccf5f04087
node: added initTranslations function (#6504) 2024-10-10 16:37:33 +02:00
FloVanGH
f01ac8fc39
node: added url support to loadFile (#6507) 2024-10-10 11:43:32 +00:00
FloVanGH
499a522f99
node: better ergonomics for structs and enums (#6500) 2024-10-10 04:12:32 +00:00
FloVanGH
25ae55b5dd
Improve source structure in the node api (#6164)
* Update api/node/typescript/models.ts

Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>

* Code review feedback
---------

Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
2024-09-30 08:49:35 +00:00