Skip to content

Conversation

@sigmaSd
Copy link
Collaborator

@sigmaSd sigmaSd commented May 8, 2025

You can test it here https://jsr.io/@sigmasd/flatpak-deno-generator

I already migrated to it for my projects, for example https://github.com/flathub/io.github.sigmasd.VirtAudio/

You would need to create @flatpak jsr scope and create @flatpak/flatpak-deno-generator it should be very straightforward

@github-actions github-actions bot added the CI label May 8, 2025
@bbhtt
Copy link
Collaborator

bbhtt commented May 8, 2025

You would need to create https://github.com/flatpak jsr scope and create @flatpak/flatpak-deno-generator it should be very straightforward

What's the process to create?

@bbhtt bbhtt added the deno label May 8, 2025
@sigmaSd
Copy link
Collaborator Author

sigmaSd commented May 8, 2025

You would need to create https://github.com/flatpak jsr scope and create @flatpak/flatpak-deno-generator it should be very straightforward

What are these and what's the process to create?

Simply signup here https://jsr.io/ then add a pkg, example in the demo, for more formal docs: https://jsr.io/docs/publishing-packages

Screencast.From.2025-05-08.15-57-44.mp4

After creating this package, if this pr merges it will automatically trigger github ci and it will upload the code to it

@bbhtt
Copy link
Collaborator

bbhtt commented May 8, 2025

I'll checkout the code later, some generic comments right now. If it's run-able locally I'd document that. Publishing to registry can be figured out later.

@sigmaSd
Copy link
Collaborator Author

sigmaSd commented May 8, 2025

I remembered something, after creating the package, you need to add this repo url in the jsr pkg settings

Screencast.From.2025-05-08.16-24-43.mp4

Please also add the description and select deno in the supported runtimes

@sigmaSd
Copy link
Collaborator Author

sigmaSd commented May 8, 2025

running locally is just deno main.ts thelockfile.json

@bbhtt
Copy link
Collaborator

bbhtt commented May 8, 2025

also set yourself as codeowner if you want to maintain it longtime https://github.com/flatpak/flatpak-builder-tools/blob/master/CODEOWNERS

@sigmaSd
Copy link
Collaborator Author

sigmaSd commented May 8, 2025

I added tests cause why not, it even have a not bad coverage

image

@bbhtt
Copy link
Collaborator

bbhtt commented May 9, 2025

Reserved the namespace flatpak-contrib https://jsr.io/@flatpak-contrib/flatpak-deno-generator

Anything else needed?

image

@sigmaSd
Copy link
Collaborator Author

sigmaSd commented May 9, 2025

Yep looks good to me that should work

@sigmaSd
Copy link
Collaborator Author

sigmaSd commented May 9, 2025

I think you should also reserve @flatpak and @flathub scopes, you can always add more members to any scope, better then letting them getting taken by someone else , even if you don't use them

@sigmaSd
Copy link
Collaborator Author

sigmaSd commented May 9, 2025

I renamed the pkg to match the scope you reserved, if you change your mind (for example @flatpak/pkg which is nicer imo less keys to type), you need to edit that name in deno.json

@bbhtt
Copy link
Collaborator

bbhtt commented May 9, 2025

contrib is ok, it's going to be copy-pasted anyways. I kept the other ones more official related things if there ever will be.

@bbhtt
Copy link
Collaborator

bbhtt commented May 9, 2025

maybe restrict formatting linting to *.ts, *.js etc.

@bbhtt
Copy link
Collaborator

bbhtt commented May 9, 2025

@bbhtt
Copy link
Collaborator

bbhtt commented May 9, 2025

Seems to work otherwise, tried on your apps and a few random deno projects found on GitHub.

The only failure I see was on https://github.com/denoland/fresh/blob/main/deno.lock

→ deno -RN -W=. main.ts ~/Downloads/fresh/deno.lock 
error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '8.4.35')
    meta.versions[pkg.version].dist.integrity,
                 ^
    at npmPkgToFlatpakData (file:///home/bbhtt/Git/github/flatpak-builder-tools/deno/src/main.ts:141:18)
    at eventLoopTick (ext:core/01_core.js:178:7)
    at async Promise.all (index 140)
    at async main (file:///home/bbhtt/Git/github/flatpak-builder-tools/deno/src/main.ts:216:5)
    at async file:///home/bbhtt/Git/github/flatpak-builder-tools/deno/src/main.ts:245:3

I guess you should put it behind an if that checks that meta.versions[pkg.version] is there, but not sure if it should be an error or a warning in case it doesn't. Maybe a package needed to build will be missing if it is skipped?

@sigmaSd
Copy link
Collaborator Author

sigmaSd commented May 9, 2025

maybe restrict formatting linting to *.ts, *.js etc.

I like that it formats deno.json and README

@sigmaSd sigmaSd requested a review from a team as a code owner May 9, 2025 22:24
@sigmaSd
Copy link
Collaborator Author

sigmaSd commented May 9, 2025

Seems to work otherwise, tried on your apps and a few random deno projects found on GitHub.

The only failure I see was on https://github.com/denoland/fresh/blob/main/deno.lock

→ deno -RN -W=. main.ts ~/Downloads/fresh/deno.lock 
error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '8.4.35')
    meta.versions[pkg.version].dist.integrity,
                 ^
    at npmPkgToFlatpakData (file:///home/bbhtt/Git/github/flatpak-builder-tools/deno/src/main.ts:141:18)
    at eventLoopTick (ext:core/01_core.js:178:7)
    at async Promise.all (index 140)
    at async main (file:///home/bbhtt/Git/github/flatpak-builder-tools/deno/src/main.ts:216:5)
    at async file:///home/bbhtt/Git/github/flatpak-builder-tools/deno/src/main.ts:245:3

I guess you should put it behind an if that checks that meta.versions[pkg.version] is there, but not sure if it should be an error or a warning in case it doesn't. Maybe a package needed to build will be missing if it is skipped?

nice catch, it have peer dependencies, I added support for it

@bbhtt bbhtt merged commit 92d2632 into flatpak:master May 10, 2025
2 checks passed
@bbhtt
Copy link
Collaborator

bbhtt commented May 10, 2025

I sent you an invite, it expires in a week.

@sigmaSd
Copy link
Collaborator Author

sigmaSd commented May 10, 2025

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants