Skip to content

Commit

Permalink
deno workflow.
Browse files Browse the repository at this point in the history
..

..

..

..

..

..
  • Loading branch information
igalklebanov committed May 30, 2024
1 parent 6ae28eb commit 7261c27
Show file tree
Hide file tree
Showing 6 changed files with 663 additions and 1,233 deletions.
54 changes: 52 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ jobs:
with:
version: 9

- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: 22
cache: "pnpm"

- uses: oven-sh/setup-bun@v1
Expand Down Expand Up @@ -106,3 +106,53 @@ jobs:
- name: kysely migrate:rollback --all
working-directory: examples/bun
run: bun --bun kysely migrate:rollback --all --debug

deno:
runs-on: ubuntu-latest

name: ubuntu-latest + Deno

steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"

- uses: denoland/setup-deno@v1
with:
deno-version: vx.x.x

- name: Install dependencies
run: pnpm i && pnpm build && cd examples/deno-package-json && deno cache .config/kysely.config.ts && cd ../.. && pnpx tsx ./scripts/localize-deno-dependency.mts

- name: Run docker compose
working-directory: examples/deno-package-json
run: docker compose up -d

- name: kysely -v
working-directory: examples/deno-package-json
run: deno task kysely -v

- name: kysely migrate:make <migration-name>
working-directory: examples/deno-package-json
run: deno task kysely migrate:make moshe --debug

- name: kysely migrate:list
working-directory: examples/deno-package-json
run: deno task kysely migrate:list --debug

- name: kysely migrate:latest
working-directory: examples/deno-package-json
run: deno task kysely migrate:latest --debug

- name: kysely migrate:rollback --all
working-directory: examples/deno-package-json
run: deno task kysely migrate:rollback --all --debug
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,41 @@ bun add -D kysely-ctl

### Deno

Yes.
Add `kysely-ctl` to your `package.json`:

```json
{
...
"scripts": {
...
"kysely": "kysely", // allows running commands with `deno task kysely ...`
...
},
...
"devDependencies": {
...
"kysely-ctl": "^0.8.3"
...
},
...
}
```

Running the following:

```bash
deno cache <some_file>
```

will install `kysely-ctl` in a `node_modules` folder.

> [!WARNING]
> It's complicated.
>
> We use `c12` for configuration file loading, which uses `jiti` to load `.ts` files.
`jiti` doesn't support `deno` [yet](https://github.com/unjs/jiti/issues/168). If your config file has `Deno`-native URL imports,
specifiers (e.g. `npm:`, `jsr:`), import map resolution, it won't work.
This means you can't use `kysely-ctl` with `SQLite` on `Deno`, as it requires a `Deno`-native `SQLite` library - `Deno` doesn't support `better-sqlite3` [yet](https://github.com/denoland/deno/issues/18444).

## Use

Expand Down
Loading

0 comments on commit 7261c27

Please sign in to comment.