Skip to content

Commit

Permalink
remove GraphQL, use jsdocs for exported functions
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Dec 1, 2023
1 parent a63491c commit d77e355
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 259 deletions.
90 changes: 45 additions & 45 deletions deno.lock

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

9 changes: 0 additions & 9 deletions deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@ export { withDevbox } from "https://nix.fluentci.io/v0.5.3/src/dagger/steps.ts";
export { stringifyTree } from "https://esm.sh/stringify-tree@1.1.1";
import gql from "https://esm.sh/graphql-tag@2.12.6";
export { gql };
export {
arg,
queryType,
stringArg,
booleanArg,
intArg,
nonNull,
makeSchema,
} from "npm:nexus";
export {
dirname,
join,
Expand Down
135 changes: 0 additions & 135 deletions gen/nexus.ts

This file was deleted.

2 changes: 0 additions & 2 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
export * from "./src/dagger/index.ts";
export * as queries from "./src/dagger/queries.ts";
export { schema } from "./src/dagger/schema.ts";
7 changes: 0 additions & 7 deletions schema.graphql

This file was deleted.

29 changes: 16 additions & 13 deletions src/dagger/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,17 @@ export enum Job {

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

export const upload = async (
src: string | Directory | undefined = ".",
token?: string | Secret
) => {
/**
* @function
* @description Uploads code coverage to Codecov
* @param {string} src
* @param {string} token
* @returns {string}
*/
export async function upload(
src: string | Directory,
token: string | Secret
): Promise<string> {
await connect(async (client: Client) => {
const context = getDirectory(client, src);
const secret = getCodecovToken(client, token);
Expand Down Expand Up @@ -55,16 +62,12 @@ export const upload = async (
console.log(result);
});
return "Codecov upload complete.";
};
}

export type JobExec = (src?: string) =>
| Promise<string>
| ((
src?: string,
options?: {
ignore: string[];
}
) => Promise<string>);
export type JobExec = (
src: string | Directory,
token: string | Secret
) => Promise<string>;

export const runnableJobs: Record<Job, JobExec> = {
[Job.upload]: upload,
Expand Down
4 changes: 2 additions & 2 deletions src/dagger/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default async function pipeline(src = ".", args: string[] = []) {
return;
}

await upload();
await upload(src, Deno.env.get("CODECOV_TOKEN") || "");
}

async function runSpecificJobs(args: jobs.Job[]) {
Expand All @@ -21,6 +21,6 @@ async function runSpecificJobs(args: jobs.Job[]) {
if (!job) {
throw new Error(`Job ${name} not found`);
}
await job();
await job(".", Deno.env.get("CODECOV_TOKEN") || "");
}
}
7 changes: 0 additions & 7 deletions src/dagger/queries.ts

This file was deleted.

39 changes: 0 additions & 39 deletions src/dagger/schema.ts

This file was deleted.

0 comments on commit d77e355

Please sign in to comment.