farrow-api
Advanced tools
Comparing version
@@ -179,3 +179,6 @@ "use strict"; | ||
var definitions = handleTypes(formatResult.types); | ||
var source = "\n import type { JsonType } from 'farrow-api-client'\n " + definitions.join('\n\n') + "\n "; | ||
var source = definitions.join('\n\n'); | ||
if (source.includes('JsonType')) { | ||
source = "\n import type { JsonType } from 'farrow-api-client'\n " + source + "\n "; | ||
} | ||
if (config.emitApiClient) { | ||
@@ -182,0 +185,0 @@ var entries = handleEntries(formatResult.entries); |
{ | ||
"name": "farrow-api", | ||
"version": "1.7.0", | ||
"version": "1.8.0", | ||
"description": "A type-friendly BFF framework", | ||
@@ -29,4 +29,4 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"farrow-pipeline": "^1.7.0", | ||
"farrow-schema": "^1.7.0" | ||
"farrow-pipeline": "^1.8.0", | ||
"farrow-schema": "^1.8.0" | ||
}, | ||
@@ -38,3 +38,3 @@ "dependencies": { | ||
}, | ||
"gitHead": "37b8a08d2486c437f17593578e5c7c6dd5901459" | ||
"gitHead": "88287449b4c49cd2b7c9b40af934547d51f8411b" | ||
} |
@@ -11,6 +11,6 @@ # farrow-api | ||
# via npm | ||
npm install --save farrow-api-server | ||
npm install --save farrow-api | ||
# via yarn | ||
yarn add farrow-api-server | ||
yarn add farrow-api | ||
``` | ||
@@ -20,3 +20,3 @@ | ||
Writing `farrow-api` is just like typing in a higher-order way, we define a api-type via `farrow-schema`. | ||
Writing `farrow-api` is just like typing in a higher-order way, we define a api-type via `farrow-schema`. And then use [farrow-api-server](../farrow-api-server/README.md) to attach api to a http server. | ||
@@ -23,0 +23,0 @@ ```typescript |
@@ -96,3 +96,3 @@ import fs from 'fs/promises' | ||
expect(formatedSource).toEqual(expected.toString()) | ||
expect(formatedSource.replace(/\r|\n/g, '')).toEqual(expected.toString().replace(/\r|\n/g, '')) | ||
}) | ||
@@ -111,4 +111,4 @@ | ||
expect(formatedSource).toEqual(expected.toString()) | ||
expect(formatedSource.replace(/\r|\n/g, '')).toEqual(expected.toString().replace(/\r|\n/g, '')) | ||
}) | ||
}) |
@@ -280,7 +280,11 @@ import { | ||
let source = ` | ||
import type { JsonType } from 'farrow-api-client' | ||
${definitions.join('\n\n')} | ||
` | ||
let source = definitions.join('\n\n') | ||
if (source.includes('JsonType')) { | ||
source = ` | ||
import type { JsonType } from 'farrow-api-client' | ||
${source} | ||
` | ||
} | ||
if (config.emitApiClient) { | ||
@@ -287,0 +291,0 @@ let entries = handleEntries(formatResult.entries) |
Sorry, the diff of this file is not supported yet
49640
0.79%1047
0.58%