Skip to content

Commit

Permalink
make it work with Node.js and Bun
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Mar 3, 2024
1 parent 3e71b26 commit f6ae060
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 6 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,13 @@ jobs:
run: fluentci run codecov_pipeline
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
publish:
needs: tests
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Publish package
run: npx jsr publish --allow-slow-types
2 changes: 1 addition & 1 deletion ci.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { test } from "https://pkg.fluentci.io/bun_pipeline@v0.6.8/mod.ts";
import { test } from "jsr:@fluentci/bun";

await test();
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fluentci/bun",
"version": "0.6.9",
"version": "0.6.10",
"exports": "./mod.ts",
"importMap": "import_map.json",
"tasks": {
Expand Down
8 changes: 8 additions & 0 deletions deno.lock

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

3 changes: 3 additions & 0 deletions deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ const snakeCase = _.default.snakeCase;
const camelCase = _.default.camelCase;
export { snakeCase, camelCase };

import * as env from "jsr:@tsirysndr/env-js@0.1.2";
export { env };

export { ClientError, GraphQLClient } from "npm:graphql-request@6.1.0";
export {
DaggerSDKError,
Expand Down
8 changes: 4 additions & 4 deletions src/dagger/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
* @description Provides a set of functions for Bun projects
*/

import { Directory, dag } from "../../deps.ts";
import { Directory, dag, env } from "../../deps.ts";
import { getDirectory } from "./lib.ts";

export enum Job {
test = "test",
run = "run",
}

const NODE_VERSION = Deno.env.get("NODE_VERSION") || "18.16.1";
const NODE_VERSION = env.get("NODE_VERSION") || "18.16.1";

export const exclude = [".git", ".devbox", "node_modules", ".fluentci"];

Expand All @@ -26,7 +26,7 @@ export async function test(
src: string | Directory | undefined = ".",
bunVersion = "latest"
): Promise<string> {
const BUN_VERSION = Deno.env.get("BUN_VERSION") || bunVersion;
const BUN_VERSION = env.get("BUN_VERSION") || bunVersion;
const context = await getDirectory(src);
const ctr = dag
.pipeline(Job.test)
Expand Down Expand Up @@ -56,7 +56,7 @@ export async function run(
src: string | Directory | undefined = ".",
bunVersion = "latest"
): Promise<string> {
const BUN_VERSION = Deno.env.get("BUN_VERSION") || bunVersion;
const BUN_VERSION = env.get("BUN_VERSION") || bunVersion;
const context = await getDirectory(src);
let ctr = dag
.pipeline(Job.run)
Expand Down

0 comments on commit f6ae060

Please sign in to comment.