mobx-tanstack-query-api 0.0.31 → 0.0.32

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.
package/cli/bin.js CHANGED
@@ -2,6 +2,7 @@
2
2
  import { existsSync } from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import { generateApi } from '../codegen/index.js';
5
+ import { defineConfig } from './define-config.js';
5
6
  const projectDir = process.cwd();
6
7
  let generateApiParams;
7
8
  let module;
@@ -17,10 +18,10 @@ else if (existsSync(path.resolve(projectDir, 'api-codegen.config.json'))) {
17
18
  else {
18
19
  throw new Error('api-codegen.config.(js|mjs|json) not found');
19
20
  }
20
- if (module.default && 'links' in module.default) {
21
+ if (module.default) {
21
22
  generateApiParams = module.default;
22
23
  }
23
24
  else {
24
- throw new Error('api-codegen.config.(js|mjs|json) is not valid');
25
+ throw new Error('api-codegen.config.(js|mjs|json) is not valid, This file should return object - result of the defineConfig function');
25
26
  }
26
- generateApi(generateApiParams);
27
+ defineConfig(generateApiParams).forEach(generateApi);
package/cli/bin.mjs CHANGED
@@ -2,6 +2,7 @@
2
2
  import { existsSync } from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import { generateApi } from '../codegen/index.js';
5
+ import { defineConfig } from './define-config.js';
5
6
  const projectDir = process.cwd();
6
7
  let generateApiParams;
7
8
  let module;
@@ -17,10 +18,10 @@ else if (existsSync(path.resolve(projectDir, 'api-codegen.config.json'))) {
17
18
  else {
18
19
  throw new Error('api-codegen.config.(js|mjs|json) not found');
19
20
  }
20
- if (module.default && 'links' in module.default) {
21
+ if (module.default) {
21
22
  generateApiParams = module.default;
22
23
  }
23
24
  else {
24
- throw new Error('api-codegen.config.(js|mjs|json) is not valid');
25
+ throw new Error('api-codegen.config.(js|mjs|json) is not valid, This file should return object - result of the defineConfig function');
25
26
  }
26
- generateApi(generateApiParams);
27
+ defineConfig(generateApiParams).forEach(generateApi);
@@ -1,3 +1,4 @@
1
+ import { Maybe } from 'yummies/utils/types';
1
2
  import { GenerateApiParams } from '../codegen/index.js';
2
- export declare const defineConfig: (config: GenerateApiParams) => GenerateApiParams;
3
+ export declare const defineConfig: (...configs: Maybe<GenerateApiParams | GenerateApiParams[]>[]) => GenerateApiParams[];
3
4
  //# sourceMappingURL=define-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"define-config.d.ts","sourceRoot":"","sources":["../../src/cli/define-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,eAAO,MAAM,YAAY,WAAY,iBAAiB,sBAErD,CAAC"}
1
+ {"version":3,"file":"define-config.d.ts","sourceRoot":"","sources":["../../src/cli/define-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,eAAO,MAAM,YAAY,eACX,KAAK,CAAC,iBAAiB,GAAG,iBAAiB,EAAE,CAAC,EAAE,KAC3D,iBAAiB,EAInB,CAAC"}
@@ -1,3 +1,5 @@
1
- export const defineConfig = (config) => {
2
- return config;
1
+ export const defineConfig = (...configs) => {
2
+ return configs
3
+ .flat()
4
+ .filter((config) => !!config);
3
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobx-tanstack-query-api",
3
- "version": "0.0.31",
3
+ "version": "0.0.32",
4
4
  "keywords": [],
5
5
  "author": "js2me",
6
6
  "license": "MIT",
@@ -30,6 +30,7 @@
30
30
  "js2me-eslint-config": "^1.0.7",
31
31
  "js2me-exports-post-build-script": "^2.0.17",
32
32
  "jsdom": "^26.0.0",
33
+ "nodemon": "^3.1.9",
33
34
  "rimraf": "^6.0.1",
34
35
  "typescript": "^5.7.2",
35
36
  "unplugin-swc": "^1.5.1",
@@ -134,6 +135,7 @@
134
135
  "ts:check": "tsc --noEmit",
135
136
  "check": "npm run lint:check && npm run ts:check",
136
137
  "prebuild": "npm run clean && npm run check",
138
+ "build:watch": "npm run build && nodemon --watch src --ext ts --exec \"tsc && node ./post-build.mjs\"",
137
139
  "build": "tsc && node ./post-build.mjs",
138
140
  "pub": "PUBLISH=true pnpm run build",
139
141
  "pub:patch": "PUBLISH=true PUBLISH_VERSION=patch pnpm run build",