Comparing version 3.0.0-alpha.6 to 3.0.0-alpha.7
@@ -8,3 +8,3 @@ // src/clean.ts | ||
// src/read.ts | ||
import { basename, extname, relative } from "path"; | ||
import { relative } from "node:path"; | ||
import fs2 from "fs-extra"; | ||
@@ -26,5 +26,5 @@ import { switcher } from "js-runtime"; | ||
if (slashedPath.startsWith("../")) { | ||
return slashedPath.replace(basename(slashedPath), basename(slashedPath, extname(filePath))); | ||
return slashedPath; | ||
} | ||
return `./${slashedPath.replace(basename(slashedPath), basename(slashedPath, extname(filePath)))}`; | ||
return `./${slashedPath}`; | ||
} | ||
@@ -62,3 +62,3 @@ var reader = switcher( | ||
// src/write.ts | ||
import { resolve } from "path"; | ||
import { resolve } from "node:path"; | ||
import fs3 from "fs-extra"; | ||
@@ -65,0 +65,0 @@ import { switcher as switcher2 } from "js-runtime"; |
@@ -17,3 +17,3 @@ type BasePath<T extends string = string> = `${T}/`; | ||
path: string; | ||
extName?: string; | ||
extName?: Extname; | ||
/** | ||
@@ -44,6 +44,5 @@ * Add `type` prefix to the import, this will result in: `import type { Type } from './path'`. | ||
* Path for the import. | ||
* When not defined it will only be used in cache(fileManager will not add it and use it to create barrel files) | ||
* @example '@kubb/core' | ||
*/ | ||
path?: string; | ||
path: string; | ||
extName?: Extname; | ||
@@ -59,5 +58,2 @@ /** | ||
}; | ||
/** | ||
* @deprecated | ||
*/ | ||
type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}`; | ||
@@ -79,9 +75,2 @@ type Mode = 'single' | 'split'; | ||
/** | ||
* Unique identifier to reuse later | ||
* @default object-hash | ||
*/ | ||
id?: string; | ||
name?: string; | ||
extName?: string; | ||
/** | ||
* Name to be used to create the path | ||
@@ -110,2 +99,4 @@ * Based on UNIX basename, `${name}.extName` | ||
}; | ||
type ResolvedImport = Import; | ||
type ResolvedExport = Export; | ||
type ResolvedFile<TMeta extends object = object> = File<TMeta> & { | ||
@@ -121,5 +112,7 @@ /** | ||
name: string; | ||
extName: string; | ||
extName: Extname; | ||
imports: Array<ResolvedImport>; | ||
exports: Array<ResolvedExport>; | ||
}; | ||
export type { AdvancedPath, BaseName, Export, Extname, File, Import, Mode, OptionalPath, Path, ResolvedFile, Source }; | ||
export type { AdvancedPath, BaseName, Export, Extname, File, Import, Mode, OptionalPath, Path, ResolvedExport, ResolvedFile, ResolvedImport, Source }; |
{ | ||
"name": "@kubb/fs", | ||
"version": "3.0.0-alpha.6", | ||
"version": "3.0.0-alpha.7", | ||
"description": "FileSystem helpers", | ||
@@ -56,5 +56,5 @@ "keywords": [ | ||
"tsup": "^8.2.4", | ||
"@kubb/config-biome": "3.0.0-alpha.6", | ||
"@kubb/config-ts": "3.0.0-alpha.6", | ||
"@kubb/config-tsup": "3.0.0-alpha.6" | ||
"@kubb/config-biome": "3.0.0-alpha.7", | ||
"@kubb/config-ts": "3.0.0-alpha.7", | ||
"@kubb/config-tsup": "3.0.0-alpha.7" | ||
}, | ||
@@ -61,0 +61,0 @@ "engines": { |
@@ -30,6 +30,6 @@ import { basename, extname, relative } from 'node:path' | ||
if (slashedPath.startsWith('../')) { | ||
return slashedPath.replace(basename(slashedPath), basename(slashedPath, extname(filePath))) | ||
return slashedPath | ||
} | ||
return `./${slashedPath.replace(basename(slashedPath), basename(slashedPath, extname(filePath)))}` | ||
return `./${slashedPath}` | ||
} | ||
@@ -36,0 +36,0 @@ |
@@ -23,3 +23,3 @@ type BasePath<T extends string = string> = `${T}/` | ||
path: string | ||
extName?: string | ||
extName?: Extname | ||
/** | ||
@@ -53,6 +53,5 @@ * Add `type` prefix to the import, this will result in: `import type { Type } from './path'`. | ||
* Path for the import. | ||
* When not defined it will only be used in cache(fileManager will not add it and use it to create barrel files) | ||
* @example '@kubb/core' | ||
*/ | ||
path?: string | ||
path: string | ||
extName?: Extname | ||
@@ -69,5 +68,2 @@ /** | ||
/** | ||
* @deprecated | ||
*/ | ||
export type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}` | ||
@@ -95,9 +91,2 @@ | ||
/** | ||
* Unique identifier to reuse later | ||
* @default object-hash | ||
*/ | ||
id?: string | ||
name?: string | ||
extName?: string | ||
/** | ||
* Name to be used to create the path | ||
@@ -127,2 +116,6 @@ * Based on UNIX basename, `${name}.extName` | ||
export type ResolvedImport = Import | ||
export type ResolvedExport = Export | ||
export type ResolvedFile<TMeta extends object = object> = File<TMeta> & { | ||
@@ -138,3 +131,5 @@ /** | ||
name: string | ||
extName: string | ||
extName: Extname | ||
imports: Array<ResolvedImport> | ||
exports: Array<ResolvedExport> | ||
} |
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
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
249129
2778