Skip to content

Commit 2daede7

Browse files
committed
make it work with Node.js and Bun
1 parent 3b9789e commit 2daede7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+207
-56
lines changed

ansible-lint/deno.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@daggerverse/ansible-lint",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"exports": "./mod.ts",
55
"importMap": "import_map.json",
66
"tasks": {

ansible-lint/deno.lock

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ansible-lint/deps.ts

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ const snakeCase = _.default.snakeCase;
1414
const camelCase = _.default.camelCase;
1515
export { snakeCase, camelCase };
1616

17+
import * as env from "jsr:@tsirysndr/[email protected]";
18+
export { env };
19+
export { exit } from "jsr:@tsirysndr/[email protected]";
20+
1721
export { ClientError, GraphQLClient } from "npm:[email protected]";
1822
export {
1923
DaggerSDKError,

ansible-lint/sdk/builder.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { createGQLClient } from "./client.ts";
22
import { Context } from "./context.ts";
3+
import { env } from "../deps.ts";
34

45
/**
56
* @hidden
@@ -10,9 +11,9 @@ export function initDefaultContext(): Context {
1011
let ctx = new Context();
1112

1213
// Prefer DAGGER_SESSION_PORT if set
13-
const daggerSessionPort = Deno.env.get("DAGGER_SESSION_PORT");
14+
const daggerSessionPort = env.get("DAGGER_SESSION_PORT");
1415
if (daggerSessionPort) {
15-
const sessionToken = Deno.env.get("DAGGER_SESSION_TOKEN");
16+
const sessionToken = env.get("DAGGER_SESSION_TOKEN");
1617
if (!sessionToken) {
1718
throw new Error(
1819
"DAGGER_SESSION_TOKEN must be set when using DAGGER_SESSION_PORT"

ansible/deno.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@daggerverse/ansible",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"exports": "./mod.ts",
55
"importMap": "import_map.json",
66
"tasks": {

ansible/deno.lock

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ansible/deps.ts

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ const snakeCase = _.default.snakeCase;
1414
const camelCase = _.default.camelCase;
1515
export { snakeCase, camelCase };
1616

17+
import * as env from "jsr:@tsirysndr/[email protected]";
18+
export { env };
19+
export { exit } from "jsr:@tsirysndr/[email protected]";
20+
1721
export { ClientError, GraphQLClient } from "npm:[email protected]";
1822
export {
1923
DaggerSDKError,

ansible/sdk/builder.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createGQLClient } from "./client.ts";
22
import { Context } from "./context.ts";
3-
3+
import { env } from "../deps.ts";
44
/**
55
* @hidden
66
*
@@ -10,9 +10,9 @@ export function initDefaultContext(): Context {
1010
let ctx = new Context();
1111

1212
// Prefer DAGGER_SESSION_PORT if set
13-
const daggerSessionPort = Deno.env.get("DAGGER_SESSION_PORT");
13+
const daggerSessionPort = env.get("DAGGER_SESSION_PORT");
1414
if (daggerSessionPort) {
15-
const sessionToken = Deno.env.get("DAGGER_SESSION_TOKEN");
15+
const sessionToken = env.get("DAGGER_SESSION_TOKEN");
1616
if (!sessionToken) {
1717
throw new Error(
1818
"DAGGER_SESSION_TOKEN must be set when using DAGGER_SESSION_PORT"

awesome-ci/deno.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@daggerverse/awesome-ci",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"exports": "./mod.ts",
55
"importMap": "import_map.json",
66
"tasks": {

awesome-ci/deno.lock

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

awesome-ci/deps.ts

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ const snakeCase = _.default.snakeCase;
1414
const camelCase = _.default.camelCase;
1515
export { snakeCase, camelCase };
1616

17+
import * as env from "jsr:@tsirysndr/[email protected]";
18+
export { env };
19+
export { exit } from "jsr:@tsirysndr/[email protected]";
20+
1721
export { ClientError, GraphQLClient } from "npm:[email protected]";
1822
export {
1923
DaggerSDKError,

awesome-ci/sdk/builder.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { createGQLClient } from "./client.ts";
22
import { Context } from "./context.ts";
3+
import { env } from "../deps.ts";
34

45
/**
56
* @hidden
@@ -10,9 +11,9 @@ export function initDefaultContext(): Context {
1011
let ctx = new Context();
1112

1213
// Prefer DAGGER_SESSION_PORT if set
13-
const daggerSessionPort = Deno.env.get("DAGGER_SESSION_PORT");
14+
const daggerSessionPort = env.get("DAGGER_SESSION_PORT");
1415
if (daggerSessionPort) {
15-
const sessionToken = Deno.env.get("DAGGER_SESSION_TOKEN");
16+
const sessionToken = env.get("DAGGER_SESSION_TOKEN");
1617
if (!sessionToken) {
1718
throw new Error(
1819
"DAGGER_SESSION_TOKEN must be set when using DAGGER_SESSION_PORT"

checkmake/deno.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@daggerverse/checkmake",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"exports": "./mod.ts",
55
"importMap": "import_map.json",
66
"tasks": {

checkmake/deno.lock

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

checkmake/deps.ts

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ export { gql };
99
export { dirname, join, resolve } from "jsr:@std/[email protected]";
1010
export { parse } from "jsr:@std/[email protected]";
1111

12+
import * as env from "jsr:@tsirysndr/[email protected]";
13+
export { env };
14+
export { exit } from "jsr:@tsirysndr/[email protected]";
15+
1216
import * as _ from "npm:[email protected]";
1317
const snakeCase = _.default.snakeCase;
1418
const camelCase = _.default.camelCase;

checkmake/sdk/builder.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { createGQLClient } from "./client.ts";
22
import { Context } from "./context.ts";
3+
import { env } from "../deps.ts";
34

45
/**
56
* @hidden
@@ -10,9 +11,9 @@ export function initDefaultContext(): Context {
1011
let ctx = new Context();
1112

1213
// Prefer DAGGER_SESSION_PORT if set
13-
const daggerSessionPort = Deno.env.get("DAGGER_SESSION_PORT");
14+
const daggerSessionPort = env.get("DAGGER_SESSION_PORT");
1415
if (daggerSessionPort) {
15-
const sessionToken = Deno.env.get("DAGGER_SESSION_TOKEN");
16+
const sessionToken = env.get("DAGGER_SESSION_TOKEN");
1617
if (!sessionToken) {
1718
throw new Error(
1819
"DAGGER_SESSION_TOKEN must be set when using DAGGER_SESSION_PORT"

flakestry/deno.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@daggerverse/flakestry",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"exports": "./mod.ts",
55
"importMap": "import_map.json",
66
"tasks": {

flakestry/deno.lock

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flakestry/deps.ts

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ const snakeCase = _.default.snakeCase;
1414
const camelCase = _.default.camelCase;
1515
export { snakeCase, camelCase };
1616

17+
import * as env from "jsr:@tsirysndr/[email protected]";
18+
export { env };
19+
export { exit } from "jsr:@tsirysndr/[email protected]";
20+
1721
export { ClientError, GraphQLClient } from "npm:[email protected]";
1822
export {
1923
DaggerSDKError,

flakestry/sdk/builder.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { createGQLClient } from "./client.ts";
22
import { Context } from "./context.ts";
3+
import { env } from "../deps.ts";
34

45
/**
56
* @hidden
@@ -10,9 +11,9 @@ export function initDefaultContext(): Context {
1011
let ctx = new Context();
1112

1213
// Prefer DAGGER_SESSION_PORT if set
13-
const daggerSessionPort = Deno.env.get("DAGGER_SESSION_PORT");
14+
const daggerSessionPort = env.get("DAGGER_SESSION_PORT");
1415
if (daggerSessionPort) {
15-
const sessionToken = Deno.env.get("DAGGER_SESSION_TOKEN");
16+
const sessionToken = env.get("DAGGER_SESSION_TOKEN");
1617
if (!sessionToken) {
1718
throw new Error(
1819
"DAGGER_SESSION_TOKEN must be set when using DAGGER_SESSION_PORT"

flakestry/src/dagger/jobs.ts

+7-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @module flakestry
33
* @description Publish a flake from Github to flakestry.dev ❄️
44
*/
5-
import { dag, Directory, Container } from "../../deps.ts";
5+
import { dag, env, Directory, Container } from "../../deps.ts";
66
import { Secret } from "../../sdk/client.gen.ts";
77
import { getDirectory, getGithubToken } from "./lib.ts";
88

@@ -77,22 +77,21 @@ export async function publish(
7777
fi
7878
`,
7979
])
80-
.withEnvVariable("VERSION", Deno.env.get("VERSION") || version)
81-
.withEnvVariable("REF", Deno.env.get("REF") || ref)
80+
.withEnvVariable("VERSION", env.get("VERSION") || version)
81+
.withEnvVariable("REF", env.get("REF") || ref)
8282
.withSecretVariable("GH_TOKEN", (await getGithubToken(ghToken))!)
83-
.withEnvVariable("URL", Deno.env.get("URL") || url)
83+
.withEnvVariable("URL", env.get("URL") || url)
8484
.withEnvVariable(
8585
"ACTIONS_ID_TOKEN_REQUEST_TOKEN",
86-
Deno.env.get("ACTIONS_ID_TOKEN_REQUEST_TOKEN") ||
87-
actionsIdTokenRequestToken
86+
env.get("ACTIONS_ID_TOKEN_REQUEST_TOKEN") || actionsIdTokenRequestToken
8887
)
8988
.withEnvVariable(
9089
"ACTIONS_ID_TOKEN_REQUEST_URL",
91-
Deno.env.get("ACTIONS_ID_TOKEN_REQUEST_URL") || actionsIdTokenRequestUrl
90+
env.get("ACTIONS_ID_TOKEN_REQUEST_URL") || actionsIdTokenRequestUrl
9291
)
9392
.withEnvVariable(
9493
"IGNORE_CONFLICTS",
95-
Deno.env.get("IGNORE_CONFLICTS") || `${ignoreConflicts}`
94+
env.get("IGNORE_CONFLICTS") || `${ignoreConflicts}`
9695
)
9796
.withExec([
9897
"bash",

flakestry/src/dagger/pipeline.ts

+15-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as jobs from "./jobs.ts";
2+
import { env } from "../../deps.ts";
23

34
const { publish, runnableJobs } = jobs;
45

@@ -10,13 +11,13 @@ export default async function pipeline(src = ".", args: string[] = []) {
1011

1112
await publish(
1213
src,
13-
Deno.env.get("VERSION")!,
14-
Deno.env.get("REF")!,
15-
Deno.env.get("GH_TOKEN")!,
16-
Deno.env.get("ACTIONS_ID_TOKEN_REQUEST_TOKEN")!,
17-
Deno.env.get("ACTIONS_ID_TOKEN_REQUEST_URL")!,
18-
Deno.env.get("URL"),
19-
Deno.env.get("IGNORE_CONFLICTS") === "true"
14+
env.get("VERSION")!,
15+
env.get("REF")!,
16+
env.get("GH_TOKEN")!,
17+
env.get("ACTIONS_ID_TOKEN_REQUEST_TOKEN")!,
18+
env.get("ACTIONS_ID_TOKEN_REQUEST_URL")!,
19+
env.get("URL"),
20+
env.get("IGNORE_CONFLICTS") === "true"
2021
);
2122
}
2223

@@ -28,13 +29,13 @@ async function runSpecificJobs(args: jobs.Job[], src: string) {
2829
}
2930
await job(
3031
src,
31-
Deno.env.get("VERSION")!,
32-
Deno.env.get("REF")!,
33-
Deno.env.get("GH_TOKEN")!,
34-
Deno.env.get("ACTIONS_ID_TOKEN_REQUEST_TOKEN")!,
35-
Deno.env.get("ACTIONS_ID_TOKEN_REQUEST_URL")!,
36-
Deno.env.get("URL"),
37-
Deno.env.get("IGNORE_CONFLICTS") === "true"
32+
env.get("VERSION")!,
33+
env.get("REF")!,
34+
env.get("GH_TOKEN")!,
35+
env.get("ACTIONS_ID_TOKEN_REQUEST_TOKEN")!,
36+
env.get("ACTIONS_ID_TOKEN_REQUEST_URL")!,
37+
env.get("URL"),
38+
env.get("IGNORE_CONFLICTS") === "true"
3839
);
3940
}
4041
}

0 commit comments

Comments
 (0)