-
Notifications
You must be signed in to change notification settings - Fork 121
Add Flatpak Deno generator #460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
705ab96
Add Flatpak Deno generator
sigmaSd 1b82dac
fix publish path
sigmaSd d72d795
better fix
sigmaSd 66b539a
document lockfile version
sigmaSd 5d3323b
Add GitHub Actions workflow for Deno CI
sigmaSd 4f207e4
Add MIT license info to README and source files
sigmaSd c714f7f
fmt
sigmaSd 1955998
dcouemnt local run
sigmaSd f9646e8
set sigmasd as deno module maintainer
sigmaSd 01b6abc
Trigger Deno workflow only on changes in deno directory
sigmaSd eae2bed
Rename Deno workflow to CI
sigmaSd 09724dc
Rename test job to deno in workflow file
sigmaSd c50fac9
Remove matrix strategy from Deno workflow
sigmaSd 91ea5cf
Remove submodules option from checkout step in CI workflow
sigmaSd 2c7713f
Add tests and refactor main function for better testability
sigmaSd e0504a3
Refactor Flatpak data types and improve README instructions
sigmaSd 07051f6
show usage when no argument is provided
sigmaSd 579fadc
Add --output option and usage examples to CLI entrypoint
sigmaSd f7ef1b2
Remove unused _urlToDenoCacheFilename function
sigmaSd c0a72ed
Clarify output file naming in usage instructions
sigmaSd 515d052
more correct typing
sigmaSd a7f234a
document technical choices
sigmaSd ff2bf48
typo
sigmaSd a04e297
Rename package to @flatpak-contrib and update version to 1.3.0
sigmaSd e6b1753
remove extra folder
sigmaSd cf1ab2a
Update deno/README.md
sigmaSd d45ba45
fmt
sigmaSd 1d23e69
Update example command to use src/main.ts path
sigmaSd eba8715
Add labeler config for deno directory
sigmaSd ca8a261
Handle peer dependencies in lockfile
sigmaSd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - deno/** | ||
| branches: | ||
| - master | ||
| pull_request: | ||
| paths: | ||
| - deno/** | ||
| branches: | ||
| - master | ||
|
|
||
| defaults: | ||
| run: | ||
| working-directory: deno | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| deno: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Setup repo | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Deno | ||
| uses: denoland/setup-deno@v2 | ||
|
|
||
| - name: Verify formatting | ||
| run: deno fmt --check | ||
|
|
||
| - name: Run linter | ||
| run: deno lint | ||
|
|
||
| - name: Run type check | ||
| run: deno check . | ||
|
|
||
| - name: Run tests | ||
| run: deno test -A | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| name: Publish | ||
| on: | ||
| push: | ||
| paths: | ||
| - deno/** | ||
| branches: | ||
| - master | ||
|
|
||
bbhtt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| defaults: | ||
| run: | ||
| working-directory: deno | ||
|
|
||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Deno | ||
| uses: denoland/setup-deno@v2 | ||
|
|
||
| - name: Publish package | ||
| run: deno publish | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| deno/coverage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| /spm/ @david-swift | ||
| /gradle/ @hadess | ||
| /deno/ @sigmasd |
bbhtt marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| # Flatpak Deno Generator | ||
|
|
||
| Run from jsr | ||
|
|
||
| ``` | ||
| deno -RN -W=. jsr:@flatpak-contrib/flatpak-deno-generator deno.lock | ||
| ``` | ||
|
|
||
| or locally from this repo | ||
|
|
||
| ``` | ||
| deno -RN -W=. src/main.ts deno.lock --output sources.json | ||
| ``` | ||
|
|
||
| This will create a `deno-sources.json` (or the name specified with --output) | ||
| that can be used in flatpak build files. The sources files provides these 2 | ||
| directories: | ||
|
|
||
| - it creates and populates `./deno_dir` with npm dependencies | ||
| - it creates and populates `./vendor` with jsr + http dependencies | ||
bbhtt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## Usage: | ||
|
|
||
| - Use the sources file as a source, example: | ||
|
|
||
| ```yml | ||
| sources: | ||
| - deno-sources.json | ||
| ``` | ||
|
|
||
| - To use `deno_dir` (when your project have npm dependencies) point `DENO_DIR` | ||
| env variable to it, like so: | ||
|
|
||
| ```yml | ||
| - name: someModule | ||
| buildsystem: simple | ||
| build-options: | ||
| env: | ||
| # sources provides deno_dir directory | ||
| DENO_DIR: deno_dir | ||
| ``` | ||
|
|
||
| - To use `vendor` (when your project have http or jsr dependencies) move it next | ||
| to your `deno.json` file and make sure to compile or run with `--vendor` flag, | ||
| exmaple: | ||
|
|
||
| ```yml | ||
| - # sources provides vendor directory | ||
| - # src is where my deno project at as in deno.json is under src directory, so I'm moving vendor next to it | ||
| - mv ./vendor src/ | ||
| - DENORT_BIN=$PWD/denort ./deno compile --vendor --no-check --output virtaudio-bin --cached-only | ||
| --allow-all --include ./src/gui.slint --include ./src/client.html ./src/gui.ts | ||
| ``` | ||
|
|
||
| ## Notes | ||
|
|
||
| Currently this only supports lockfile V5 (available since deno version 2.3) | ||
|
|
||
| ## License | ||
|
|
||
| MIT | ||
|
|
||
| ## Example | ||
|
|
||
| - checkout https://github.com/flathub/io.github.sigmasd.VirtAudio/ | ||
bbhtt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## Technical Info | ||
|
|
||
| Theoretically it would've been better to put all the dependencies in `DENO_DIR` | ||
| but currently thats not possible because jsr and https dependencies have some | ||
| special metadata checks made by deno, more info here | ||
| https://github.com/denoland/deno/issues/29212 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "name": "@flatpak-contrib/flatpak-deno-generator", | ||
| "version": "1.3.0", | ||
| "exports": "./src/main.ts", | ||
| "license": "MIT" | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.