diff --git a/.releaserc.json b/.releaserc.json index fc0bbfc..98ac23b 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -14,14 +14,64 @@ } ], "plugins": [ - "@semantic-release/commit-analyzer", - "@semantic-release/release-notes-generator", - "@semantic-release/changelog", + [ + "@semantic-release/commit-analyzer", + { + "preset": "angular", + "releaseRules": [ + { + "type": "docs", + "scope": "README", + "release": "patch" + }, + { + "type": "refactor", + "release": "patch" + }, + { + "type": "style", + "release": "patch" + } + ], + "parserOpts": { + "noteKeywords": [ + "BREAKING CHANGE", + "BREAKING CHANGES", + "BREAKING" + ] + } + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "angular", + "writerOpts": { + "commitsSort": [ + "subject", + "scope" + ] + } + } + ], + [ + "@semantic-release/changelog", + { + "changelogFile": "CHANGELOG.md", + "changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file." + } + ], "@semantic-release/npm", "@semantic-release/github", - ["@semantic-release/git", { - "assets": ["package.json", "CHANGELOG.md"], - "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" - }] + [ + "@semantic-release/git", + { + "assets": [ + "package.json", + "CHANGELOG.md" + ], + "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + } + ] ] -} +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 76b9686..6342f15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,3 @@ -# 1.0.0 (2024-11-15) - - -### Features - -* initial project setup ([12e7c1e](https://github.com/ItsCurstin/captioneer/commit/12e7c1ef40449255bd48168dabd131c26a5c5930)) - -# 1.0.0 (2024-11-15) - - -### Features - -* initial project setup ([12e7c1e](https://github.com/ItsCurstin/captioneer/commit/12e7c1ef40449255bd48168dabd131c26a5c5930)) - # Changelog All notable changes to this project will be documented in this file. @@ -19,26 +5,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] -### Added -- GitHub Actions workflows for CI/CD -- CodeQL security analysis -- Comprehensive documentation -- Test HTTP requests with Axios -- Add Proxy Support +# 1.0.0 (2024-11-15) -## [1.0.0] - 2024-01-24 -### Added -- Core Captioneer class for fetching YouTube transcripts -- Multi-language support for captions -- Type-safe error handling system -- ESM and CommonJS module support -- Full TypeScript types and declarations -- Biome for code formatting and linting -- Vitest test suite with coverage -- MIT License +### Features -### Security -- Input validation for video IDs -- Rate limiting detection -- Error handling for network issues +* initial project + setup ([12e7c1e](https://github.com/ItsCurstin/captioneer/commit/12e7c1ef40449255bd48168dabd131c26a5c5930)) diff --git a/commitlint.config.js b/commitlint.config.js index 985f878..d417ab5 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -5,5 +5,23 @@ export default { 'footer-max-line-length': [0, 'always'], 'header-max-length': [0, 'always'], 'subject-case': [0, 'always'], + 'type-enum': [ + 2, + 'always', + [ + 'feat', + 'fix', + 'docs', + 'style', + 'refactor', + 'perf', + 'test', + 'build', + 'ci', + 'chore', + 'revert', + ], + ], + 'scope-enum': [2, 'always', ['core', 'types', 'errors', 'config', 'deps', 'release']], }, }; diff --git a/package.json b/package.json index b1588d6..2ccfe99 100644 --- a/package.json +++ b/package.json @@ -26,15 +26,17 @@ ".": { "types": "./dist/index.d.ts", "import": "./dist/index.mjs", - "require": "./dist/index.js" - } + "require": "./dist/index.js", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" }, "publishConfig": { "access": "public" }, "scripts": { - "build": "tsup", - "dev": "tsup --watch", + "build": "NODE_ENV=production tsup", + "dev": "NODE_ENV=development tsup --watch", "test": "vitest run", "test:watch": "vitest", "test:coverage": "vitest run --coverage", @@ -67,12 +69,19 @@ "lint-staged": { "*.ts": [ "biome check --apply", + "biome format --write", "vitest related --run" ] }, - "packageManager": "pnpm@9.0.0", "engines": { - "node": ">=22.11.0", - "pnpm": ">=9.0.0" + "node": ">=16.0.0", + "npm": ">=8.0.0", + "pnpm": ">=8.0.0", + "yarn": ">=3.0.0" + }, + "typesVersions": { + "*": { + "*": ["./dist/index.d.ts"] + } } } diff --git a/tsconfig.json b/tsconfig.json index a83f060..90b9f1c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,9 +1,9 @@ { "compilerOptions": { - "target": "ES2020", - "lib": ["ES2020", "DOM"], + "target": "ES2021", + "lib": ["ES2021", "DOM"], "module": "ESNext", - "moduleResolution": "bundler", + "moduleResolution": "node", "types": ["node", "vitest/globals"], "declaration": true, "declarationMap": true, diff --git a/tsup.config.ts b/tsup.config.ts index e67d7f3..1cf28a5 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -1,5 +1,3 @@ -// tsup.config.ts - import { defineConfig } from 'tsup'; export default defineConfig({ @@ -7,9 +5,16 @@ export default defineConfig({ format: ['cjs', 'esm'], dts: true, splitting: false, - sourcemap: true, + sourcemap: process.env.NODE_ENV !== 'production', clean: true, - minify: true, + minify: process.env.NODE_ENV === 'production', treeshake: true, + external: Object.keys(require('./package.json').dependencies || {}), outDir: 'dist', + outExtension: ({ format }) => ({ + js: format === 'esm' ? '.mjs' : '.js', + }), + banner: { + js: `/*! * ${require('./package.json').name} v${require('./package.json').version} * Released under the MIT License. */`, + }, });