Skip to content
Merged
Show file tree
Hide file tree
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 May 8, 2025
1b82dac
fix publish path
sigmaSd May 8, 2025
d72d795
better fix
sigmaSd May 8, 2025
66b539a
document lockfile version
sigmaSd May 8, 2025
5d3323b
Add GitHub Actions workflow for Deno CI
sigmaSd May 8, 2025
4f207e4
Add MIT license info to README and source files
sigmaSd May 8, 2025
c714f7f
fmt
sigmaSd May 8, 2025
1955998
dcouemnt local run
sigmaSd May 8, 2025
f9646e8
set sigmasd as deno module maintainer
sigmaSd May 8, 2025
01b6abc
Trigger Deno workflow only on changes in deno directory
sigmaSd May 8, 2025
eae2bed
Rename Deno workflow to CI
sigmaSd May 8, 2025
09724dc
Rename test job to deno in workflow file
sigmaSd May 8, 2025
c50fac9
Remove matrix strategy from Deno workflow
sigmaSd May 8, 2025
91ea5cf
Remove submodules option from checkout step in CI workflow
sigmaSd May 8, 2025
2c7713f
Add tests and refactor main function for better testability
sigmaSd May 8, 2025
e0504a3
Refactor Flatpak data types and improve README instructions
sigmaSd May 9, 2025
07051f6
show usage when no argument is provided
sigmaSd May 9, 2025
579fadc
Add --output option and usage examples to CLI entrypoint
sigmaSd May 9, 2025
f7ef1b2
Remove unused _urlToDenoCacheFilename function
sigmaSd May 9, 2025
c0a72ed
Clarify output file naming in usage instructions
sigmaSd May 9, 2025
515d052
more correct typing
sigmaSd May 9, 2025
a7f234a
document technical choices
sigmaSd May 9, 2025
ff2bf48
typo
sigmaSd May 9, 2025
a04e297
Rename package to @flatpak-contrib and update version to 1.3.0
sigmaSd May 9, 2025
e6b1753
remove extra folder
sigmaSd May 9, 2025
cf1ab2a
Update deno/README.md
sigmaSd May 9, 2025
d45ba45
fmt
sigmaSd May 9, 2025
1d23e69
Update example command to use src/main.ts path
sigmaSd May 9, 2025
eba8715
Add labeler config for deno directory
sigmaSd May 9, 2025
ca8a261
Handle peer dependencies in lockfile
sigmaSd May 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ dotnet:
- changed-files:
- any-glob-to-any-file: dotnet/**

deno:
- changed-files:
- any-glob-to-any-file: deno/**

dub:
- changed-files:
- any-glob-to-any-file: dub/**
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/deno.yml
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
28 changes: 28 additions & 0 deletions .github/workflows/publish-jsr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish
on:
push:
paths:
- deno/**
branches:
- master

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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deno/coverage
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/spm/ @david-swift
/gradle/ @hadess
/deno/ @sigmasd
72 changes: 72 additions & 0 deletions deno/README.md
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

## 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/

## 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
6 changes: 6 additions & 0 deletions deno/deno.json
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"
}
39 changes: 39 additions & 0 deletions deno/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading