@kubb/plugin-ts 5.0.6 → 5.0.7
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 +46 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +47 -44
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1850,6 +1850,9 @@ const typeGenerator = (0, kubb_kit.defineGenerator)({
|
|
|
1850
1850
|
}
|
|
1851
1851
|
});
|
|
1852
1852
|
//#endregion
|
|
1853
|
+
//#region package.json
|
|
1854
|
+
var version = "5.0.7";
|
|
1855
|
+
//#endregion
|
|
1853
1856
|
//#region src/resolvers/resolverTs.ts
|
|
1854
1857
|
/**
|
|
1855
1858
|
* Default resolver used by `@kubb/plugin-ts`. Decides the names and file paths
|
|
@@ -1965,52 +1968,52 @@ function assertEnumLikeOptions({ prefix, options }) {
|
|
|
1965
1968
|
* })
|
|
1966
1969
|
* ```
|
|
1967
1970
|
*/
|
|
1968
|
-
const pluginTs = (0, kubb_kit.definePlugin)(
|
|
1969
|
-
|
|
1970
|
-
path: "types",
|
|
1971
|
-
barrel: { type: "named" }
|
|
1972
|
-
}, group, exclude = [], include, override = [], enum: enumOptions = {}, optionalType = "questionToken", arrayType = "array", syntaxType = "type", printer, resolver: userResolver, macros: userMacros } = options;
|
|
1973
|
-
const groupConfig = createGroupConfig(group);
|
|
1974
|
-
const resolvedEnum = {
|
|
1975
|
-
type: enumOptions.type ?? "asConst",
|
|
1976
|
-
constCasing: enumOptions.constCasing ?? "camelCase",
|
|
1977
|
-
typeSuffix: enumOptions.typeSuffix ?? "Key",
|
|
1978
|
-
keyCasing: enumOptions.keyCasing ?? "none"
|
|
1979
|
-
};
|
|
1980
|
-
return {
|
|
1971
|
+
const pluginTs = (0, kubb_kit.definePlugin)({
|
|
1972
|
+
meta: {
|
|
1981
1973
|
name: pluginTsName,
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
exclude,
|
|
2000
|
-
include,
|
|
2001
|
-
override,
|
|
2002
|
-
optionalType,
|
|
2003
|
-
group: groupConfig,
|
|
2004
|
-
arrayType,
|
|
1974
|
+
version,
|
|
1975
|
+
compatibility: { kubb: ">=5.8.0" }
|
|
1976
|
+
},
|
|
1977
|
+
setup(options) {
|
|
1978
|
+
const { output = {
|
|
1979
|
+
path: "types",
|
|
1980
|
+
barrel: { type: "named" }
|
|
1981
|
+
}, group, exclude = [], include, override = [], enum: enumOptions = {}, optionalType = "questionToken", arrayType = "array", syntaxType = "type", printer, resolver: userResolver, macros: userMacros } = options;
|
|
1982
|
+
const resolvedEnum = {
|
|
1983
|
+
type: enumOptions.type ?? "asConst",
|
|
1984
|
+
constCasing: enumOptions.constCasing ?? "camelCase",
|
|
1985
|
+
typeSuffix: enumOptions.typeSuffix ?? "Key",
|
|
1986
|
+
keyCasing: enumOptions.keyCasing ?? "none"
|
|
1987
|
+
};
|
|
1988
|
+
assertEnumLikeOptions({
|
|
1989
|
+
prefix: "",
|
|
1990
|
+
options: {
|
|
2005
1991
|
enum: resolvedEnum,
|
|
2006
1992
|
syntaxType,
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
1993
|
+
arrayType,
|
|
1994
|
+
optionalType
|
|
1995
|
+
}
|
|
1996
|
+
});
|
|
1997
|
+
for (const [index, entry] of override.entries()) assertEnumLikeOptions({
|
|
1998
|
+
prefix: `override[${index}].options.`,
|
|
1999
|
+
options: entry.options
|
|
2000
|
+
});
|
|
2001
|
+
(0, kubb_kit.setResolver)(userResolver ? kubb_kit.Resolver.merge(resolverTs, userResolver) : resolverTs);
|
|
2002
|
+
if (userMacros?.length) (0, kubb_kit.setMacros)(userMacros);
|
|
2003
|
+
(0, kubb_kit.addGenerator)(typeGenerator);
|
|
2004
|
+
return {
|
|
2005
|
+
output,
|
|
2006
|
+
exclude,
|
|
2007
|
+
include,
|
|
2008
|
+
override,
|
|
2009
|
+
optionalType,
|
|
2010
|
+
group: createGroupConfig(group),
|
|
2011
|
+
arrayType,
|
|
2012
|
+
enum: resolvedEnum,
|
|
2013
|
+
syntaxType,
|
|
2014
|
+
printer
|
|
2015
|
+
};
|
|
2016
|
+
}
|
|
2014
2017
|
});
|
|
2015
2018
|
//#endregion
|
|
2016
2019
|
//#region src/printers/functionParams.ts
|