@based/type-gen
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -12,3 +12,3 @@ import { BasedFunctionConfig } from '@based/functions'; | ||
basedPath?: string; | ||
}) => Promise<boolean>; | ||
}) => Promise<string | void>; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -7,3 +7,4 @@ "use strict"; | ||
// check if client is correct version | ||
const basedClientPath = opts.basedPath || require.resolve('@based/client'); | ||
const basedClientPath = opts.basedPath || | ||
require.resolve('@based/client', { paths: [process.cwd()] }); | ||
if (!basedClientPath) { | ||
@@ -78,7 +79,6 @@ throw new Error('Cannot find basedClient'); | ||
await (0, fs_extra_1.writeFile)(decPath, x); | ||
return true; | ||
return decPath; | ||
} | ||
return false; | ||
}; | ||
exports.updateTypes = updateTypes; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@based/type-gen", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -13,6 +13,8 @@ import { BasedFunctionConfig } from '@based/functions' | ||
} = {} | ||
): Promise<boolean> => { | ||
): Promise<string | void> => { | ||
// check if client is correct version | ||
const basedClientPath = opts.basedPath || require.resolve('@based/client') | ||
const basedClientPath = | ||
opts.basedPath || | ||
require.resolve('@based/client', { paths: [process.cwd()] }) | ||
@@ -104,6 +106,4 @@ if (!basedClientPath) { | ||
await writeFile(decPath, x) | ||
return true | ||
return decPath | ||
} | ||
return false | ||
} |
import test from 'ava' | ||
import { updateTypes } from '../src' | ||
import { join } from 'path' | ||
import based from '@based/client' | ||
import { readFile } from 'fs-extra' | ||
test.serial('Generare types file from examples', async (t) => { | ||
test.serial('Generate types file from examples', async (t) => { | ||
const result = await updateTypes([ | ||
@@ -43,3 +42,3 @@ { | ||
t.true(result) | ||
t.is(result, join(__dirname, '../../client/dist/index.d.ts')) | ||
t.true(file.includes('counter')) | ||
@@ -46,0 +45,0 @@ t.true(file.includes('db:schema')) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
88508