Skip to content

Commit

Permalink
Merge pull request #6 from fluent-ci-templates/remove-graphql-schema
Browse files Browse the repository at this point in the history
remove GraphQL, use jsdocs for exported functions
  • Loading branch information
tsirysndr authored Dec 8, 2023
2 parents f8e7a54 + a0bae1c commit fc6be8c
Show file tree
Hide file tree
Showing 34 changed files with 13,188 additions and 881 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,9 @@ jobs:
with:
deno-version: v1.37
- name: Setup Fluent CI CLI
run: deno install -A -r https://cli.fluentci.io -n fluentci
- name: Setup Dagger
run: |
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh
sudo mv bin/dagger /usr/local/bin
dagger version
uses: fluentci-io/setup-fluentci@v2
- name: Run Dagger Pipelines
run: dagger run fluentci deno_pipeline fmt lint test
run: fluentci run deno_pipeline fmt lint test
- name: Upload Coverage
run: fluentci run codecov_pipeline
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
run: deno install -A -r https://cli.fluentci.io -n fluentci
- name: Setup Dagger
run: |
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.8 sh
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.9.3 sh
sudo mv bin/dagger /usr/local/bin
dagger version
- name: Run Dagger Pipelines
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zenith.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v2
- name: Setup Dagger Zenith
run: |
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.8 sh
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.9.3 sh
sudo mv bin/dagger /usr/local/bin
dagger version
- name: Run Dagger Pipelines
Expand Down
59 changes: 37 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ Or simply:
fluentci
```

## Dagger Module

Use as a [Dagger](https://dagger.io) module:

```bash
dagger mod install github.com/fluent-ci-templates/nodejs-pipeline@mod
```


## Environment variables

| Variable | Description | Default |
Expand All @@ -51,39 +60,45 @@ fluentci
| test | Run the tests |
| run | Run a custom task |

```graphql
build(
nodeVersion: String!,
packageManager: String!,
src: String!
): String
```typescript
test(
src: Directory | string | undefined = ".",
packageManager?: string,
nodeVersion?: string
): Promise<string>

install(
nodeVersion: String!,
packageManager: String!,
src: String!
): String
build(
src: Directory | string | undefined = ".",
packageManager?: string,
nodeVersion?: string
): Promise<Directory | string>

run(
nodeVersion: String!,
packageManager: String!,
src: String!,
task: String!
): String
src: Directory | string | undefined = ".",
task: string,
packageManager?: string,
nodeVersion?: string
): Promise<string>

test(
nodeVersion: String!,
packageManager: String!,
src: String!
): String
install(
src: Directory | string | undefined = ".",
packageManager?: string,
nodeVersion?: string
): Promise<Container | string>

dev(
src: Directory | string | undefined = ".",
packageManager?: string,
nodeVersion?: string
): Promise<Container | string>
```

## Programmatic usage

You can also use this pipeline programmatically:

```ts
import { test, build } from "https://pkg.fluentci.io/nodejs_pipeline@v0.5.0/mod.ts";
import { test, build } from "https://pkg.fluentci.io/nodejs_pipeline@v0.6.0/mod.ts";

await test();
await build();
Expand Down
2 changes: 1 addition & 1 deletion ci.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
test,
build,
} from "https://pkg.fluentci.io/nodejs_pipeline@v0.5.0/mod.ts";
} from "https://pkg.fluentci.io/nodejs_pipeline@v0.6.0/mod.ts";

await test();
await build();
4 changes: 1 addition & 3 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"tasks": {
"esm:add": "deno run -A https://esm.sh/v128 add",
"esm:update": "deno run -A https://esm.sh/v128 update",
"esm:remove": "deno run -A https://esm.sh/v128 remove",
"schema": "deno run -A src/dagger/schema.ts",
"clean": "rm -rf gen schema.graphql"
"esm:remove": "deno run -A https://esm.sh/v128 remove"
},
"fmt": {
"exclude": [
Expand Down
133 changes: 53 additions & 80 deletions deno.lock

Large diffs are not rendered by default.

45 changes: 28 additions & 17 deletions deps.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
export { assertEquals } from "https://deno.land/std@0.191.0/testing/asserts.ts";
import Client from "https://sdk.fluentci.io/v0.2.0/mod.ts";
export default Client;

export {
connect,
uploadContext,
CacheSharingMode,
} from "https://sdk.fluentci.io/v0.2.0/mod.ts";
export type { DirectoryID, SecretID } from "./sdk/client.gen.ts";
export { Directory, Secret, File, Container } from "./sdk/client.gen.ts";
export { connect, uploadContext } from "https://sdk.fluentci.io/v0.3.0/mod.ts";
export { brightGreen } from "https://deno.land/std@0.191.0/fmt/colors.ts";
export { withDevbox } from "https://nix.fluentci.io/v0.5.2/src/dagger/steps.ts";
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,
intArg,
nonNull,
makeSchema,
} from "npm:nexus";
export {
dirname,
join,
Expand All @@ -29,6 +16,30 @@ export {
export { parse } from "https://deno.land/std@0.205.0/flags/mod.ts";
export { snakeCase, camelCase } from "https://cdn.skypack.dev/lodash";

export {
ClientError,
GraphQLClient,
} from "https://esm.sh/v128/graphql-request@6.1.0";
export {
DaggerSDKError,
UnknownDaggerError,
DockerImageRefValidationError,
EngineSessionConnectParamsParseError,
ExecError,
GraphQLRequestError,
InitEngineSessionBinaryError,
TooManyNestedObjectsError,
EngineSessionError,
EngineSessionConnectionTimeoutError,
NotAwaitedRequestError,
ERROR_CODES,
} from "https://esm.sh/@dagger.io/dagger@0.9.3";

export type {
CallbackFct,
ConnectOpts,
} from "https://sdk.fluentci.io/v0.3.0/mod.ts";

export * as FluentGitlabCI from "https://deno.land/x/fluent_gitlab_ci@v0.4.2/mod.ts";
export * as FluentGithubActions from "https://deno.land/x/fluent_github_actions@v0.2.1/mod.ts";
export * as FluentCircleCI from "https://deno.land/x/fluent_circleci@v0.2.5/mod.ts";
Expand Down
4 changes: 1 addition & 3 deletions example/.fluentci/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"tasks": {
"esm:add": "deno run -A https://esm.sh/v128 add",
"esm:update": "deno run -A https://esm.sh/v128 update",
"esm:remove": "deno run -A https://esm.sh/v128 remove",
"schema": "deno run -A src/dagger/schema.ts",
"clean": "rm -rf gen schema.graphql"
"esm:remove": "deno run -A https://esm.sh/v128 remove"
},
"fmt": {
"exclude": [
Expand Down
Loading

0 comments on commit fc6be8c

Please sign in to comment.