@kubb/core 2.0.0-beta.7 → 2.0.0-beta.8
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 +12 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +12 -24
- package/dist/index.js.map +1 -1
- package/dist/utils.cjs +12 -24
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +4 -4
- package/dist/utils.d.ts +4 -4
- package/dist/utils.js +12 -24
- package/dist/utils.js.map +1 -1
- package/package.json +3 -3
- package/src/BarrelManager.ts +5 -17
- package/src/FileManager.ts +9 -12
package/dist/index.cjs
CHANGED
|
@@ -681,19 +681,9 @@ var BarrelManager = class {
|
|
|
681
681
|
__privateSet(this, _options, options);
|
|
682
682
|
return this;
|
|
683
683
|
}
|
|
684
|
-
getIndexes(pathToBuild
|
|
685
|
-
const { treeNode = {}, isTypeOnly,
|
|
686
|
-
const
|
|
687
|
-
".ts": {
|
|
688
|
-
extensions: /\.ts/,
|
|
689
|
-
exclude: [/schemas/, /json/]
|
|
690
|
-
},
|
|
691
|
-
".json": {
|
|
692
|
-
extensions: /\.json/,
|
|
693
|
-
exclude: []
|
|
694
|
-
}
|
|
695
|
-
};
|
|
696
|
-
const tree = TreeNode.build(pathToBuild, { ...extMapper[extName] || {}, ...treeNode });
|
|
684
|
+
getIndexes(pathToBuild) {
|
|
685
|
+
const { treeNode = {}, isTypeOnly, extName } = __privateGet(this, _options);
|
|
686
|
+
const tree = TreeNode.build(pathToBuild, treeNode);
|
|
697
687
|
if (!tree) {
|
|
698
688
|
return null;
|
|
699
689
|
}
|
|
@@ -709,7 +699,7 @@ var BarrelManager = class {
|
|
|
709
699
|
return void 0;
|
|
710
700
|
}
|
|
711
701
|
return {
|
|
712
|
-
path:
|
|
702
|
+
path: extName ? `${importPath}${extName}` : importPath,
|
|
713
703
|
isTypeOnly
|
|
714
704
|
};
|
|
715
705
|
}).filter(Boolean);
|
|
@@ -728,7 +718,7 @@ var BarrelManager = class {
|
|
|
728
718
|
const importPath = treeNodeChild.data.type === "directory" ? `./${treeNodeChild.data.name}/index` : `./${transformers_default.trimExtName(treeNodeChild.data.name)}`;
|
|
729
719
|
const exports = [
|
|
730
720
|
{
|
|
731
|
-
path:
|
|
721
|
+
path: extName ? `${importPath}${extName}` : importPath,
|
|
732
722
|
isTypeOnly
|
|
733
723
|
}
|
|
734
724
|
];
|
|
@@ -800,12 +790,10 @@ var _FileManager = class _FileManager {
|
|
|
800
790
|
}
|
|
801
791
|
return resolvedFiles[0];
|
|
802
792
|
}
|
|
803
|
-
async addIndexes({ root, output,
|
|
804
|
-
const
|
|
805
|
-
const
|
|
806
|
-
const
|
|
807
|
-
const barrelManager = new BarrelManager(options);
|
|
808
|
-
const files = barrelManager.getIndexes(path4.resolve(root, outputPath), extName);
|
|
793
|
+
async addIndexes({ root, output, meta, options = {} }) {
|
|
794
|
+
const exportPath = output.path.startsWith("./") ? output.path : `./${output.path}`;
|
|
795
|
+
const barrelManager = new BarrelManager({ extName: output.extName, ...options });
|
|
796
|
+
const files = barrelManager.getIndexes(path4.resolve(root, output.path));
|
|
809
797
|
if (!files) {
|
|
810
798
|
return void 0;
|
|
811
799
|
}
|
|
@@ -814,9 +802,9 @@ var _FileManager = class _FileManager {
|
|
|
814
802
|
baseName: "index.ts",
|
|
815
803
|
source: "",
|
|
816
804
|
exports: [
|
|
817
|
-
exportAs ? {
|
|
818
|
-
name: exportAs,
|
|
819
|
-
asAlias:
|
|
805
|
+
output.exportAs ? {
|
|
806
|
+
name: output.exportAs,
|
|
807
|
+
asAlias: true,
|
|
820
808
|
path: exportPath,
|
|
821
809
|
isTypeOnly: options.isTypeOnly
|
|
822
810
|
} : {
|