Commit graph

336 commits

Author SHA1 Message Date
Simon Hausmann
d37ee60155 Add iOS build of the Energy Monitor and Home Automation demos
Use xcodegen -s ios-project.yml to generate the Xcode project.
2025-05-20 11:07:19 +02:00
Simon Hausmann
da5e7d5b22 WGPU: Add support for using WGPU textures in Slint
This adds a `unstable-wgpu-24` feature that exposes WGPU types in the
GraphicsAPI enum, adds `require_wgpu_24()` to the backend selector,
and adds a conversion from `wgpu::Texture` to `slint::Image`.

The `require_wgpu_24()` function in the selector will be extended in the
future (before the next release) to permit specifying additional aspects
of the WGPU configuration.

Co-Authored-By: Olivier Goffart <olivier.goffart@slint.dev>
2025-04-29 17:46:57 +02:00
Tobias Hunger
e5ecb9cf6c infra: Test out mise
I found `mise` a tool to help manage development projects.
https://mise.jdx.dev/

It basically can manage ENV vars based on the directory you are in,
manages tools you need (and makes thoser available based on the
directory you are in), and allows to define simple tasks that can
then be shared between developers.

Tools can be found in npm, pipx, aqua, binaries on github, ...
and it tries to verify signatures and all that (if supported by the
repo the data comes from).

I replaces the entire autofix workflow with mise tooling and tasks,
just to give it a try :-)

To reproduce:

```sh
> cargo install mise # to get the tool itself

# Follow the necessary step
# https://mise.jdx.dev/installing-mise.html#shells
# to intergate into your shell

> cd /your/slint/folder

# Mise will now ask whether or not to trust this dir and prints the
# command needed to do so. Run that.

> mise install # Install all the tools defined in .mise/config.toml

# Add a .mise.local.toml with local overrides. Git will ignore this file.
# Or add tasks into .mise/tasks/local ... Git will also ignore those.

> mise run 'ci:autofix:**:all' # To run all the ci:autofix tasks.
```

It is so much fatser to see these checks fail locally than it is to
bother CI with them :-)
2025-03-20 16:33:00 +01:00
Tobias Hunger
238ad14911 xtask: Make license header check work with jj
I use jj as a VCS, make that work. It's a small enough change,
so I do not feel too bad about it ;-)
2025-03-12 16:31:26 +01:00
Tobias Hunger
53d972eb12
vscode: Fix tmGrammar test (#7750)
* vscode: Fix tmGrammar test

We can not have a copyright header in the test files,
they must start with the SYNTAX TEST annotation in
the first bytes.

* Update REUSE.toml

Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>

---------

Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
2025-02-26 19:04:30 +01:00
Simon Hausmann
245400c47b Fix VSCE build
The CI has been using the deprecated vsce package to test .vsix creation, while it was renamed to @vscode/vsce a while ago. Last night, the vsce publish action we're using switched to @vscode/vsce and now the vsce build is failing, because of a bug that was hidden:

In vsce 2.25 support for `files` in `package.json` was introduced, which was just `bin/slint-lsp-*` in our package. That would omit the extension entry point and many other files, causing the vsce package creation step to fail.

Fix this by fixing the CI to use the same vsce version as the action is using, and replace the files with the default and the ignore setting of files we definitely want to exclude from the package.

With this, the package now contains these files:

```
slint-1.10.0.vsix
├─ [Content_Types].xml
├─ extension.vsixmanifest
└─ extension/
   ├─ .gitignore [0.03 KB]
   ├─ LICENSE.txt [0.04 KB]
   ├─ biome.json [0.2 KB]
   ├─ esbuild.js [2.22 KB]
   ├─ extension-logo.png [6.76 KB]
   ├─ language-configuration.json [1.49 KB]
   ├─ package.json [7.93 KB]
   ├─ readme.md [3.85 KB]
   ├─ slint-file-icon.svg [0.83 KB]
   ├─ slint.injection.json [1.61 KB]
   ├─ slint.markdown-injection.json [1.37 KB]
   ├─ slint.tmLanguage.json [8.79 KB]
   ├─ telemetry.json [2.21 KB]
   ├─ bin/
   │  └─ slint-lsp [82.21 MB]
   ├─ out/
   │  ├─ .gitignore [0 KB]
   │  ├─ browser.js [321.26 KB]
   │  ├─ browser.js.map [406.49 KB]
   │  ├─ browserServerMain.js [18.27 MB]
   │  ├─ browserServerMain.js.map [255.8 KB]
   │  ├─ extension.js [457.78 KB]
   │  ├─ extension.js.map [617.27 KB]
   │  ├─ slint_lsp_wasm.js [84.62 KB]
   │  └─ slint_lsp_wasm_bg.wasm [13.56 MB]
   ├─ snippets/
   │  └─ slint.json [0.53 KB]
   └─ static/
      └─ walkthroughs/
         └─ welcome/ (4 files) [17.1 KB]
```
2025-02-24 10:00:18 +01:00
Simon Hausmann
0b5fff098f Permit py.typed stub files 2025-02-16 08:58:47 +00:00
Simon Hausmann
94c655731f
Add Python typings for Rust declared types (#7575)
This comes with a bump of the Python version to 3.11
due to the need for typing.Self.
2025-02-09 16:06:34 +01:00
Yuri Astrakhan
05f4fc0cde Auto-fixed clippy::needless_return
`__CARGO_FIX_YOLO=1` is a hack, but it does help a lot with the tedious fixes where the result is fairly clear.

See https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

```
__CARGO_FIX_YOLO=1 cargo clippy --fix --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::needless_return

cargo fmt --all
```
2025-02-07 09:46:49 +01:00
Yuri Astrakhan
9621cae218 Auto-fixed clippy::needless_lifetimes
`__CARGO_FIX_YOLO=1` is a hack, but it does help a lot with the tedious fixes where the result is fairly clear.

See https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes

```
__CARGO_FIX_YOLO=1 cargo clippy --fix --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::needless_lifetimes

cargo fmt --all
```
2025-02-07 09:20:49 +01:00
Yuri Astrakhan
6324b35e94 Auto-fixed clippy::needless_borrow
`__CARGO_FIX_YOLO=1` is a hack, but it does help a lot with the tedious fixes where the result is fairly clear.

See https://rust-lang.github.io/rust-clippy/master/index.html#/needless_borrow

```
__CARGO_FIX_YOLO=1 cargo clippy --fix --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::needless_borrow

cargo fmt --all
```
2025-02-07 09:02:45 +01:00
Yuri Astrakhan
bcb2953f00 Auto-fixed clippy::unnecessary_map_or
This is a hacky approach, but does help a lot with the tedious fixes.

See https://rust-lang.github.io/rust-clippy/master/index.html#/unnecessary_map_or

```
__CARGO_FIX_YOLO=1 cargo clippy --fix  --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::unnecessary_map_or

cargo fmt --all
```
2025-02-07 09:02:31 +01:00
Yuri Astrakhan
4ae2627ade A few more format arg inlining
Used these commands and some manual searching

```
cargo clippy --fix  --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::uninlined_format_args
cargo clippy --all-targets -- -A clippy::all -W clippy::uninlined_format_args
cargo clippy --fix -- -A clippy::all -W clippy::uninlined_format_args
```
2025-02-07 06:43:19 +01:00
Nigel Breslaw
facd460037
Convert Figma project to Vite + React (#7453)
A Figma plugin is just a single javascript file which means no out of the box way to split files, import helper libraries and scale the project. It's also a vanilla web site for making the UI.

The PR updates the project to use Vite. It allows normal project spliting for typescript and css files. It provides a simpler way for the plugin and backend code to communicate. React is used to then build the plugin interface.
2025-01-27 12:54:09 +02: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
Olivier Goffart
dc321fc50b Janitor: update which and notify deps 2025-01-06 17:25:08 +01:00
Simon Hausmann
0bb3f1af29 Add support for bazel files to the license checker 2025-01-03 14:55:04 +01:00
Simon Hausmann
3a4864c4c3 Fix license header check to permit non-SixtyFPS Copyright
Let LicenseHeader merely store the license and replace only that part, while preserving any existing copyright (when fixing).
2025-01-02 19:31:32 +01:00
Simon Hausmann
913362a303 Fix license header check 2024-12-16 21:54:37 +01:00
Simon Hausmann
a7f965c941 Include list of third-party licenses in the C++ docs
This isn't very pretty, but I think it does the job.

cc #6634
2024-12-16 21:54:37 +01:00
Nigel Breslaw
c794f875b8
1.9 docs: Remove Mermaid and Playwright build dependency (#7066) 2024-12-11 15:18:54 +02:00
Tobias Hunger
7b00c7301b docs: Do not fail fatally when playwright can not install its browsers
This is expected e.g. on Fedora :-/
2024-12-10 16:17:03 +01:00
Nigel Breslaw
92534a8a27
1.9 Organise docs folder. (#7005)
Move astro files to docs/astro
2024-12-05 15:40:04 +02:00
Simon Hausmann
cf9601e270 Fix up license header checker to permit file with third-party copyright 2024-11-26 15:09:58 +01:00
Tobias Hunger
10edaaa7f1 reuse: Update to a newer reuse version
Update from reuse 2 as packaged by Ubuntu to reuse 5
from pypi.

This moves configuration from .reuse/dep5 into REUSE.toml.

Make sure to only have one entry per license with all
the file under that license in one place.

This does change some licenses in demos and examples from
our triple-license to MIT. I *think* those were meant to
be under MIT all along as all docs and examples are supposed
to be MIT.
2024-11-22 09:24:39 +01:00
Olivier Goffart
5bd20def0e Experimental support for MenuBar
Introduces `MenuBar{ ... }` that can be put in a Window
2024-11-20 09:25:37 +01:00
Nigel Breslaw
ebd1c2eb09
Put back missing _templates to fix nightly snapshots 2024-11-16 00:30:29 +02:00
Nigel Breslaw
08d90a5f13
Next gen docs for 1.9 (#6766)
Co-authored-by: Aurindam Jana <aurindam.jana@slint.dev>
Co-authored-by: Tobias Hunger <tobias.hunger@slint.dev>
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
2024-11-14 15:52:35 +01:00
Simon Hausmann
a98d4709be Move printer demo and energy-monitor into new top-level demos/ folder
These are showing off use-cases for Slint, but they're not examples showing individual Slint features.

Also removed the old printerdemo while at it.
2024-10-25 12:09:32 +02:00
Aurindam Jana
463031b6d8
Use Editor in Docs (#6451) 2024-10-14 15:19:29 +02:00
Nigel Breslaw
a218c945ad
Use Biome across monorepo and for Slintpad (#6080)
Puts a shared biome.json in the root.
Deletes the prettier config files.
Deletes the unused pre-commit hooks.
Applies biome linting and formatting to the slintpad project.
2024-09-11 13:07:55 +02:00
Nigel Breslaw
fe55b0cb32
refactor: Tidy the vscode project (#5936)
Removed unused images.
Sets NPM versions to exact version e.g 8.2.1, not ^8.0.0. (prepare for dependabot).
Update all dependencies.
Use npm clean-install instead of npm install. This means an up to date package-lock.json file must exist in the project. Ensuring local development and the CI are repeatable builds that use the same dependency packages.
2024-08-26 12:04:49 +02:00
Simon Hausmann
7f62249bc3
Provide pre-generated release notes with tables for downloadable assets (#5899)
Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
2024-08-22 16:05:21 +02:00
Nigel Breslaw
be02f6e046
Replace eslint and prettier with biome.js
Biome is a Rust based replacement for eslint and prettier and runs much faster.
2024-08-22 15:29:57 +02:00
Simon Hausmann
38045a8327
Support npmrc in the license header check 2024-08-22 08:13:28 +02:00
Nigel Breslaw
ab49903a06
Use pnpm to build the vscode extension (#5888)
Replaces npm with pnpm for building the extension.
2024-08-21 15:55:12 +02:00
Nathan Collins
5e49d7f687 Zephyr: move the demo to examples/printerdemo
Given that the Zephyr demo now uses this UI instead of the "_mcu"
version it makes sense to relocate the code too.
2024-08-07 15:26:32 +02:00
Simon Hausmann
c76f9fe795 Include experimental API in the C++ snapshot docs 2024-07-11 11:42:18 +02:00
Simon Hausmann
27dc6e53c0
API review: enable all features in the C++ docs (#5592)
And make sure that functions excluded when freestanding is enabled are included in the docs.
2024-07-11 08:29:51 +02:00
Nathan Collins
538387b3d6 Zephyr: apply license headers
The Zephyr VERSION file is excluded as this simply specifies the version
of the Zephyr applicaiton, and the documentation doesn't say how
comments should be specified or if they are supported.
2024-07-08 16:46:33 +02:00
Simon Hausmann
6d79ca1a05 Document the SLINT_FEATURE_XXX pre-processor variables
and sync them with the existing features.
2024-07-04 13:39:13 +02:00
Simon Hausmann
4591ad8d57 Add plumbing for system testing 2024-06-13 04:03:17 -07:00
Simon Hausmann
355a8ab62b Attempt to upgrade the docs build to latest Ubuntu 24.04 in GH Actions
This might bring in a newer version of clang-format. We don't need to install `clang-format` as GH sets up /usr/bin/clang-format according to their toolset.json file.
2024-06-10 02:25:40 -07:00
Tobias Hunger
d9224cd58f janitor: Use more workspace dependencies 2024-06-04 14:58:29 +02:00
Tobias Hunger
199a7286a8 tree-sitter: Relicense grammar.js to MIT
Code is generated from grammar.js, which gets built into a library. That
library gets loaded by a text editor. So someone might argue that the GPL might
infect that text editor.

We do not want that argument to come up, so let's use MIT for that code.
2024-06-03 11:11:35 +02:00
Aurindam Jana
3523e86359
Simplify commercial license (#3063)
Base the commercial license on the Royalty-free license adding clauses pertaining to the fees.
2024-05-31 14:06:17 +02:00
Aurindam Jana
9a3aa265d5
Update Royalty-free license (#5257)
Add clarification that Application may not expose Slint APIs.
2024-05-31 10:53:19 +02:00
Olivier Goffart
475ced0a62 C++ testing API: Intreoduce the ElementHandle 2024-04-22 11:28:12 +02:00
Olivier Goffart
808b1ef946 Add a function to mark translated strings as dirty 2024-04-18 19:23:57 +02:00
Simon Hausmann
63f1114ff2 Run Node.js tests with the testing backend
Add the ability to depend on the testing backend and opt into it
when running tests/cases, like we do for the other drivers.

The testing backend dependency is removed in the packaging step, as
we don't publish i-slint-backend-testing.
2024-04-16 07:05:03 +02:00