@kubb/core
Advanced tools
Comparing version 0.46.0 to 0.47.0
@@ -196,2 +196,4 @@ import EventEmitter from 'eventemitter3'; | ||
declare const format: (source: string) => string; | ||
type Import = { | ||
@@ -241,3 +243,5 @@ name: string | string[]; | ||
private getCountByStatus; | ||
getSource(file: File): string; | ||
getSource(file: File, options?: { | ||
format?: boolean; | ||
}): string; | ||
get files(): File[]; | ||
@@ -380,2 +384,2 @@ add(file: File): Promise<File>; | ||
export { Argument0, CLIOptions, Cache, CacheStore, CorePluginOptions, File, FileManager, FileName, Generator, KubbBuild, KubbConfig, KubbJSONPlugin, KubbPlugin, KubbPluginKind, KubbUserConfig, LogLevel, LogType, Logger, MaybePromise, OptionalPath, Path, PathMode, PluginContext, PluginFactoryOptions, PluginLifecycle, PluginLifecycleHooks, PluginManager, ResolveIdParams, SchemaGenerator, Status, Strategy, TransformResult, TreeNode, UUID, ValidationPluginError, build, clean, createPlugin, createPluginCache, build as default, defineConfig, getPathMode, getRelativePath, hooks, isPromise, isURL, name, read, validatePlugins, write }; | ||
export { Argument0, CLIOptions, Cache, CacheStore, CorePluginOptions, File, FileManager, FileName, Generator, KubbBuild, KubbConfig, KubbJSONPlugin, KubbPlugin, KubbPluginKind, KubbUserConfig, LogLevel, LogType, Logger, MaybePromise, OptionalPath, Path, PathMode, PluginContext, PluginFactoryOptions, PluginLifecycle, PluginLifecycleHooks, PluginManager, ResolveIdParams, SchemaGenerator, Status, Strategy, TransformResult, TreeNode, UUID, ValidationPluginError, build, clean, createPlugin, createPluginCache, build as default, defineConfig, format, getPathMode, getRelativePath, hooks, isPromise, isURL, name, read, validatePlugins, write }; |
@@ -9,2 +9,3 @@ 'use strict'; | ||
var rimraf = require('rimraf'); | ||
var beautify = require('js-beautify'); | ||
var EventEmitter = require('eventemitter3'); | ||
@@ -19,2 +20,3 @@ var uniq = require('lodash.uniq'); | ||
var rimraf__default = /*#__PURE__*/_interopDefault(rimraf); | ||
var beautify__default = /*#__PURE__*/_interopDefault(beautify); | ||
var EventEmitter__default = /*#__PURE__*/_interopDefault(EventEmitter); | ||
@@ -118,2 +120,14 @@ var uniq__default = /*#__PURE__*/_interopDefault(uniq); | ||
}; | ||
var formatOptions = { | ||
indent_size: 1, | ||
indent_char: " ", | ||
max_preserve_newlines: 5, | ||
preserve_newlines: true, | ||
brace_style: "collapse", | ||
space_before_conditional: true, | ||
wrap_line_length: 160 | ||
}; | ||
var format = (source) => { | ||
return beautify__default.default(source, formatOptions); | ||
}; | ||
@@ -250,3 +264,3 @@ // src/plugin.ts | ||
} | ||
getSource(file) { | ||
getSource(file, options = { format: true }) { | ||
if (!file.fileName.endsWith(".ts")) { | ||
@@ -275,5 +289,12 @@ return file.source; | ||
if (importSource) { | ||
if (options.format) { | ||
return format(`${importSource} | ||
${file.source}`); | ||
} | ||
return `${importSource} | ||
${file.source}`; | ||
} | ||
if (options.format) { | ||
return format(file.source); | ||
} | ||
return file.source; | ||
@@ -725,2 +746,3 @@ } | ||
exports.defineConfig = defineConfig; | ||
exports.format = format; | ||
exports.getPathMode = getPathMode; | ||
@@ -727,0 +749,0 @@ exports.getRelativePath = getRelativePath; |
{ | ||
"name": "@kubb/core", | ||
"version": "0.46.0", | ||
"version": "0.47.0", | ||
"description": "Generator core", | ||
@@ -49,3 +49,4 @@ "repository": { | ||
"typescript": "^4.9.5", | ||
"uuid": "^9.0.0" | ||
"uuid": "^9.0.0", | ||
"js-beautify": "^1.14.7" | ||
}, | ||
@@ -55,3 +56,4 @@ "devDependencies": { | ||
"@types/lodash.uniq": "^4.5.7", | ||
"tsup": "^6.6.3" | ||
"tsup": "^6.6.3", | ||
"@types/js-beautify": "^1.13.3" | ||
}, | ||
@@ -58,0 +60,0 @@ "publishConfig": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
2432379
23624
8
4
+ Addedjs-beautify@^1.14.7
+ Added@isaacs/cliui@8.0.2(transitive)
+ Added@one-ini/wasm@0.1.1(transitive)
+ Added@pkgjs/parseargs@0.11.0(transitive)
+ Addedabbrev@2.0.0(transitive)
+ Addedansi-regex@5.0.16.1.0(transitive)
+ Addedansi-styles@4.3.06.2.1(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcommander@10.0.1(transitive)
+ Addedconfig-chain@1.1.13(transitive)
+ Addedcross-spawn@7.0.6(transitive)
+ Addedeastasianwidth@0.2.0(transitive)
+ Addededitorconfig@1.0.4(transitive)
+ Addedemoji-regex@8.0.09.2.2(transitive)
+ Addedforeground-child@3.3.0(transitive)
+ Addedglob@10.4.5(transitive)
+ Addedini@1.3.8(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedjackspeak@3.4.3(transitive)
+ Addedjs-beautify@1.15.1(transitive)
+ Addedjs-cookie@3.0.5(transitive)
+ Addedlru-cache@10.4.3(transitive)
+ Addedminimatch@9.0.19.0.5(transitive)
+ Addedminipass@7.1.2(transitive)
+ Addednopt@7.2.1(transitive)
+ Addedpackage-json-from-dist@1.0.1(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpath-scurry@1.11.1(transitive)
+ Addedproto-list@1.2.4(transitive)
+ Addedsemver@7.6.3(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@4.1.0(transitive)
+ Addedstring-width@4.2.35.1.2(transitive)
+ Addedstrip-ansi@6.0.17.1.0(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwrap-ansi@7.0.08.1.0(transitive)