@kubb/core 1.0.1 → 1.0.3

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/dist/index.cjs CHANGED
@@ -1068,7 +1068,9 @@ async function transformReducer(_previousCode, result, _plugin) {
1068
1068
  async function build(options) {
1069
1069
  const { config, logger } = options;
1070
1070
  try {
1071
- await read(config.input.path);
1071
+ if (!isURL(config.input.path)) {
1072
+ await read(config.input.path);
1073
+ }
1072
1074
  } catch (e) {
1073
1075
  throw new Error("Cannot read file defined in `input.path` or set with --input in the CLI of your Kubb config", { cause: e });
1074
1076
  }
package/dist/index.d.ts CHANGED
@@ -345,6 +345,8 @@ type KubbConfig = {
345
345
  };
346
346
  /**
347
347
  * Log level to report when using the CLI
348
+ * Under construction, only info is implemented.
349
+ * @default `silent`
348
350
  */
349
351
  logLevel?: LogLevel;
350
352
  };
@@ -487,7 +489,7 @@ type TransformResult = string | null;
487
489
  type Path = string;
488
490
  type OptionalPath = Path | null | undefined;
489
491
  type FileName = string | null | undefined;
490
- type LogType = 'error' | 'warn' | 'info';
492
+ type LogType = 'error' | 'info';
491
493
  type LogLevel = LogType | 'silent';
492
494
 
493
495
  type Logger = {
package/dist/index.js CHANGED
@@ -1058,7 +1058,9 @@ async function transformReducer(_previousCode, result, _plugin) {
1058
1058
  async function build(options) {
1059
1059
  const { config, logger } = options;
1060
1060
  try {
1061
- await read(config.input.path);
1061
+ if (!isURL(config.input.path)) {
1062
+ await read(config.input.path);
1063
+ }
1062
1064
  } catch (e) {
1063
1065
  throw new Error("Cannot read file defined in `input.path` or set with --input in the CLI of your Kubb config", { cause: e });
1064
1066
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/core",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Generator core",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,7 +43,7 @@
43
43
  "change-case": "^4.1.2",
44
44
  "directory-tree": "^3.5.1",
45
45
  "rimraf": "^5.0.1",
46
- "@kubb/ts-codegen": "1.0.1"
46
+ "@kubb/ts-codegen": "1.0.3"
47
47
  },
48
48
  "devDependencies": {
49
49
  "tsup": "^6.7.0",
package/src/build.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable no-async-promise-executor */
2
2
  import { PluginManager } from './managers/pluginManager/index.ts'
3
- import { clean, read } from './utils/index.ts'
3
+ import { clean, isURL, read } from './utils/index.ts'
4
4
  import { getFileSource } from './managers/fileManager/index.ts'
5
5
 
6
6
  import type { OnExecute } from './managers/pluginManager/index.ts'
@@ -34,7 +34,9 @@ export async function build(options: BuildOptions): Promise<BuildOutput> {
34
34
  const { config, logger } = options
35
35
 
36
36
  try {
37
- await read(config.input.path)
37
+ if (!isURL(config.input.path)) {
38
+ await read(config.input.path)
39
+ }
38
40
  } catch (e: any) {
39
41
  throw new Error('Cannot read file defined in `input.path` or set with --input in the CLI of your Kubb config', { cause: e })
40
42
  }
package/src/types.ts CHANGED
@@ -80,6 +80,8 @@ export type KubbConfig = {
80
80
  }
81
81
  /**
82
82
  * Log level to report when using the CLI
83
+ * Under construction, only info is implemented.
84
+ * @default `silent`
83
85
  */
84
86
  logLevel?: LogLevel
85
87
  }
@@ -241,5 +243,5 @@ export type Path = string
241
243
  export type OptionalPath = Path | null | undefined
242
244
  export type FileName = string | null | undefined
243
245
 
244
- export type LogType = 'error' | 'warn' | 'info'
246
+ export type LogType = 'error' | 'info'
245
247
  export type LogLevel = LogType | 'silent'