diff --git a/package.json b/package.json index d45945c..f9e850a 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ } }, "scripts": { - "build": "tsup index.ts --format cjs,esm --dts --clean --minify", + "build": "tsup ./src/index.ts --format cjs,esm --dts --clean --minify", "prepublishOnly": "pnpm run build", "push": "np", "test": "jest" diff --git a/index.test.ts b/src/index.test.ts similarity index 100% rename from index.test.ts rename to src/index.test.ts diff --git a/index.ts b/src/index.ts similarity index 92% rename from index.ts rename to src/index.ts index 1114789..1bbe158 100644 --- a/index.ts +++ b/src/index.ts @@ -1,3 +1,5 @@ +export * from './release' + export function parseKV(data: string) { const cleanedData = data.replaceAll(/\r\n|\r|\n/g, '\n').replaceAll(/\0/g, '').normalize().trim() const lineChunks = cleanedData.split('\n') // We know it will always be \n because of our cleanup @@ -35,7 +37,6 @@ export function parseKV(data: string) { const appendContent = (existingContent + appendLine).replace(/\s+/g, ' ').trim() fields.set(previousKey, appendContent) } - } continue @@ -69,6 +70,13 @@ export function parseControl(data: string) { return parsePackages(data) } +/** + * Parse raw file contents of a release file and retrieve a map of keys and values + * + * @deprecated Use the `Release` class instead + * @param data Raw string contents from a Release file + * @returns Map of string keys and values + */ export function parseRelease(data: string) { const mapped = parseKV(data) diff --git a/tsconfig.json b/tsconfig.json index 19e899f..8302434 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { "outDir": "dist", + "rootDir": "src", "target": "ESNext", "module": "ESNext", "moduleResolution": "Node",