cli: add automatic exports compatibility entry point addition to files field
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -42,6 +42,8 @@ export interface ExtendedPackageJSON extends PackageJSON {
|
||||
|
||||
exports?: JsonValue;
|
||||
typesVersions?: Record<string, Record<string, string[]>>;
|
||||
|
||||
files?: string[];
|
||||
}
|
||||
|
||||
export type ExtendedPackage = {
|
||||
|
||||
@@ -212,6 +212,9 @@ async function writeExportsEntryPoints(
|
||||
},
|
||||
{ encoding: 'utf8', spaces: 2 },
|
||||
);
|
||||
if (Array.isArray(pkg.files) && !pkg.files.includes(entryPoint.name)) {
|
||||
pkg.files.push(entryPoint.name);
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.keys(exp).length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user