Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

Commit

Permalink
fix(build): fix type errors after adding tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
baetheus committed Jun 12, 2019
1 parent c3fd0f9 commit 88df72c
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 161 deletions.
9 changes: 9 additions & 0 deletions package-lock.json

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

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"version": "0.0.0",
"description": "A generalized api codegen library",
"main": "lib/index.js",
"bin": "lib/bin.js",
"scripts": {
"clean": "rimraf rm -rf lib/*",
"build": "npm run clean && tsc",
"test": "tsc --noEmit"
},
"repository": {
Expand Down Expand Up @@ -33,6 +36,7 @@
"io-ts-reporters": "0.0.21",
"io-ts-types": "^0.4.7",
"monocle-ts": "^1.7.2",
"newtype-ts": "^0.2.4",
"rimraf": "^2.6.3",
"swagger2openapi": "^5.3.0",
"typescript": "^3.5.1"
Expand Down
Empty file added src/bin.ts
Empty file.
7 changes: 5 additions & 2 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function assembleMonad<I>(
return fromEither(monad);
}

function writeFile(M: MonadApp, file: File): TaskEither<string, void> {
function writeFile<I>(M: MonadApp<I>, file: File): TaskEither<string, void> {
const writeFile = M.writeFile(file.path, file.content);
return M.fromTask<string, boolean>(M.existsFile(file.path)).chain(exists => {
if (exists) {
Expand All @@ -123,7 +123,10 @@ function writeFile(M: MonadApp, file: File): TaskEither<string, void> {
});
}

function writeFiles(M: MonadApp, files: File[]): TaskEither<string, void> {
function writeFiles<I>(
M: MonadApp<I>,
files: File[]
): TaskEither<string, void> {
return array
.traverse(taskEither)(files, file => writeFile(M, file))
.map(() => undefined);
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as fs from 'fs-extra';
import glob = require('glob');
import rimraf = require('rimraf');

import { Config, main } from './core';
import { Config, main, Parser, Printer } from './core';
import { openApiParser } from './parsers/openapi';
import { typescriptPrinter } from './printers/typescript';
import { OpenAPIObject } from './types/openapi-3.0.2';
Expand Down Expand Up @@ -39,6 +39,6 @@ function onRight(): Task<void> {
return task.of(undefined);
}

export const app = main(monadApp)
.foldTask(onLeft, onRight)
.run();
export { Config, Parser, Printer, main };

export const defaultApp = main(monadApp).foldTask(onLeft, onRight);
2 changes: 1 addition & 1 deletion src/printers/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { taskEither } from 'fp-ts/lib/TaskEither';
import { Printer } from '../core';
import { OpenAPIObject } from '../types/openapi-3.0.2';

export const typescriptPrinter: Printer<OpenAPIObject> = (M, i) => {
export const typescriptPrinter: Printer<OpenAPIObject> = (_, i) => {
return taskEither.of([
{
path: './local/dist/test',
Expand Down
54 changes: 0 additions & 54 deletions src/types/intermediate.ts

This file was deleted.

Loading

0 comments on commit 88df72c

Please sign in to comment.