@based/type-gen 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { BasedFunctionConfig } from "@based/functions";
1
+ import { BasedFunctionConfig } from '@based/functions';
2
2
  export declare const updateTypes: (fns: ({
3
3
  config: BasedFunctionConfig;
4
4
  path: string;
package/dist/src/index.js CHANGED
@@ -1,16 +1,17 @@
1
- import { updateTypesPath } from "./updateTypesPath.js";
2
- import { createRequire } from "node:module";
3
- const require = createRequire(import.meta.url);
1
+ import { updateTypesPath } from './updateTypesPath.js';
2
+ import { createRequire } from 'node:module';
3
+ let require;
4
4
  export const updateTypes = async (fns, opts = {}) => {
5
+ require ??= createRequire(import.meta.url);
5
6
  const inputClientPath = opts.clientPath ||
6
- require.resolve("@based/client", { paths: [process.cwd()] });
7
+ require.resolve('@based/client', { paths: [process.cwd()] });
7
8
  const inputFunctionPath = opts.functionPath ||
8
- require.resolve("@based/functions", { paths: [process.cwd()] });
9
+ require.resolve('@based/functions', { paths: [process.cwd()] });
9
10
  let clientPath;
10
11
  let functionPath;
11
12
  if (inputClientPath) {
12
- const declarationPath = inputClientPath.replace("/index.js", "/index.d.ts");
13
- const originalDeclartionPath = inputClientPath.replace("/index.js", "/index_original.d.ts");
13
+ const declarationPath = inputClientPath.replace('/index.js', '/index.d.ts');
14
+ const originalDeclartionPath = inputClientPath.replace('/index.js', '/index_original.d.ts');
14
15
  clientPath = await updateTypesPath(fns, {
15
16
  imports: opts.imports,
16
17
  originalDeclartionPath,
@@ -21,19 +22,19 @@ export const updateTypes = async (fns, opts = {}) => {
21
22
  originalDeclartionPath,
22
23
  declarationPath,
23
24
  });
24
- console.error("Cannot find original declaration file - you may need to upgrade to @based/client ^4.8.8");
25
+ console.error('Cannot find original declaration file - you may need to upgrade to @based/client ^4.8.8');
25
26
  });
26
27
  }
27
28
  if (inputFunctionPath) {
28
- const declarationPath = inputFunctionPath.replace("/index.js", "/client.d.ts");
29
- const originalDeclartionPath = inputFunctionPath.replace("/index.js", "/client_original.d.ts");
29
+ const declarationPath = inputFunctionPath.replace('/index.js', '/client.d.ts');
30
+ const originalDeclartionPath = inputFunctionPath.replace('/index.js', '/client_original.d.ts');
30
31
  functionPath = await updateTypesPath(fns, {
31
32
  imports: opts.imports,
32
33
  originalDeclartionPath,
33
34
  declarationPath,
34
35
  isAbstract: true,
35
36
  }).catch(() => {
36
- console.error("Cannot find original declaration file - you may need to upgrade to @based/functions ^2.2.4");
37
+ console.error('Cannot find original declaration file - you may need to upgrade to @based/functions ^2.2.4');
37
38
  });
38
39
  }
39
40
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAE9C,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAC9B,GAGG,EACH,OAII,EAAE,EAIL,EAAE;IACH,MAAM,eAAe,GACnB,IAAI,CAAC,UAAU;QACf,OAAO,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAA;IAE9D,MAAM,iBAAiB,GACrB,IAAI,CAAC,YAAY;QACjB,OAAO,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAA;IAEjE,IAAI,UAAyB,CAAA;IAC7B,IAAI,YAA2B,CAAA;IAE/B,IAAI,eAAe,EAAE,CAAC;QACpB,MAAM,eAAe,GAAG,eAAe,CAAC,OAAO,CAAC,WAAW,EAAE,aAAa,CAAC,CAAA;QAC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e,CAAC,GAAG,EAAE;YACxC,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,sBAAsB;YACtB,eAAe;YACf,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;YACZ,OAAO,CAAC,KAAK,CACX,4FAA4F,CAC7F,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,OAAO;QACL,YAAY;QACZ,UAAU;KACX,CAAA;AACH,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@based/type-gen",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",
@@ -17,13 +17,13 @@
17
17
  "@babel/traverse": "^7.18.6",
18
18
  "utility-types": "^3.10.0",
19
19
  "@based/utils": "1.1.1",
20
- "@based/functions": "3.3.2"
20
+ "@based/functions": "3.3.3"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@types/fs-extra": "11.0.3",
24
24
  "ts-node": "10.9.1",
25
25
  "typescript": "^5.2.2",
26
- "@based/client": "8.2.2",
26
+ "@based/client": "8.2.3",
27
27
  "ava": "5.3.1"
28
28
  },
29
29
  "ava": {