Skip to content

Commit

Permalink
Merge pull request #260 from niclim/chore/upgrade-optic-0.25.2
Browse files Browse the repository at this point in the history
chore: bump optic to 0.25.2
  • Loading branch information
cmars authored May 12, 2022
2 parents 7655cd1 + b888c88 commit a449327
Show file tree
Hide file tree
Showing 9 changed files with 109 additions and 5,294 deletions.
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@
},
"dependencies": {
"@babel/runtime": "^7.17.2",
"@useoptic/api-checks": "0.24.18",
"@useoptic/json-pointer-helpers": "0.24.18",
"@useoptic/openapi-cli": "0.24.18",
"@useoptic/openapi-io": "0.24.18",
"@useoptic/openapi-utilities": "0.24.18",
"@useoptic/api-checks": "0.25.2",
"@useoptic/optic-ci": "0.25.2",
"@useoptic/json-pointer-helpers": "0.25.2",
"@useoptic/openapi-cli": "0.25.2",
"@useoptic/openapi-io": "0.25.2",
"@useoptic/openapi-utilities": "0.25.2",
"@useoptic/rulesets-base": "0.25.2",
"chai": "^4.3.4",
"chalk": "^4.0.0",
"change-case": "^4.1.2",
Expand Down
75 changes: 42 additions & 33 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node

import { makeCiCli } from "@useoptic/api-checks/build/ci-cli/make-cli";
import { initializeCli } from "@useoptic/optic-ci/build/initialize";
import { newSnykApiCheckService } from "./service";
import { Command } from "commander";
import {
Expand All @@ -15,36 +15,45 @@ import {
} from "./workflows/commands";

const apiCheckService = newSnykApiCheckService();
const cli = makeCiCli("sweater-comb", apiCheckService, {
opticToken: process.env.OPTIC_TOKEN || "",
gitProvider: {
token: process.env.GITHUB_TOKEN || "",
},
ciProvider: "circleci",
});

const workflowCommand = new Command("workflow").description(
"workflows for designing and building APIs",
);
workflowCommand.addCommand(createResourceCommand());

workflowCommand.addCommand(createVersionCommand());

workflowCommand.addCommand(createUpdateCommand());

const operationCommand = new Command("operation").description(
"add common operations to an OpenAPI file",
);
const operationCommands = [
addCreateOperationCommand,
addDeleteOperationCommand,
addGetOperationCommand,
addListOperationCommand,
addUpdateOperationCommand,
];
operationCommands.forEach((command) => operationCommand.addCommand(command));

workflowCommand.addCommand(operationCommand);
cli.addCommand(workflowCommand);

cli.parse(process.argv);
(async () => {
const cli = await initializeCli({
token: process.env.OPTIC_TOKEN || "",
gitProvider: {
token: process.env.GITHUB_TOKEN || "",
},
checks: [
{
name: "snyk-checks",
type: "custom",
checkService: apiCheckService,
},
],
});

const workflowCommand = new Command("workflow").description(
"workflows for designing and building APIs",
);
workflowCommand.addCommand(createResourceCommand());

workflowCommand.addCommand(createVersionCommand());

workflowCommand.addCommand(createUpdateCommand());

const operationCommand = new Command("operation").description(
"add common operations to an OpenAPI file",
);
const operationCommands = [
addCreateOperationCommand,
addDeleteOperationCommand,
addGetOperationCommand,
addListOperationCommand,
addUpdateOperationCommand,
];
operationCommands.forEach((command) => operationCommand.addCommand(command));

workflowCommand.addCommand(operationCommand);
cli.addCommand(workflowCommand);

cli.parse(process.argv);
})();
Loading

0 comments on commit a449327

Please sign in to comment.