changelogen
Advanced tools
Comparing version 0.4.1 to 0.5.0
@@ -0,4 +1,17 @@ | ||
type RepoProvider = "github" | "gitlab" | "bitbucket"; | ||
type RepoConfig = { | ||
domain?: string; | ||
repo?: string; | ||
provider?: RepoProvider; | ||
token?: string; | ||
}; | ||
declare function formatReference(ref: Reference, repo?: RepoConfig): string; | ||
declare function formatCompareChanges(v: string, config: ChangelogConfig): string; | ||
declare function getRepoConfig(repoUrl?: string): RepoConfig; | ||
type SemverBumpType = "major" | "minor" | "patch"; | ||
declare function determineSemverChange(commits: GitCommit[], config: ChangelogConfig): SemverBumpType | null; | ||
declare function bumpVersion(commits: GitCommit[], config: ChangelogConfig): Promise<string | false>; | ||
declare function bumpVersion(commits: GitCommit[], config: ChangelogConfig, opts?: { | ||
type?: SemverBumpType; | ||
}): Promise<string | false>; | ||
@@ -12,3 +25,4 @@ interface ChangelogConfig { | ||
scopeMap: Record<string, string>; | ||
github: string; | ||
repo?: RepoConfig; | ||
tokens: Partial<Record<RepoProvider, string>>; | ||
from: string; | ||
@@ -51,4 +65,52 @@ to: string; | ||
interface GithubOptions { | ||
repo: string; | ||
token: string; | ||
} | ||
interface GithubRelease { | ||
id?: string; | ||
tag_name: string; | ||
name?: string; | ||
body?: string; | ||
draft?: boolean; | ||
prerelease?: boolean; | ||
} | ||
declare function listGithubReleases(config: ChangelogConfig): Promise<GithubRelease[]>; | ||
declare function getGithubReleaseByTag(config: ChangelogConfig, tag: string): Promise<GithubRelease>; | ||
declare function getGithubChangelog(config: ChangelogConfig): Promise<any>; | ||
declare function createGithubRelease(config: ChangelogConfig, body: GithubRelease): Promise<any>; | ||
declare function updateGithubRelease(config: ChangelogConfig, id: string, body: GithubRelease): Promise<any>; | ||
declare function syncGithubRelease(config: ChangelogConfig, release: { | ||
version: string; | ||
body: string; | ||
}): Promise<{ | ||
status: string; | ||
url: string; | ||
id?: undefined; | ||
error?: undefined; | ||
} | { | ||
status: string; | ||
id: any; | ||
url?: undefined; | ||
error?: undefined; | ||
} | { | ||
status: string; | ||
error: any; | ||
url: string; | ||
id?: undefined; | ||
}>; | ||
declare function githubNewReleaseURL(config: ChangelogConfig, release: { | ||
version: string; | ||
body: string; | ||
}): string; | ||
declare function resolveGithubToken(config: ChangelogConfig): Promise<any>; | ||
declare function generateMarkDown(commits: GitCommit[], config: ChangelogConfig): Promise<string>; | ||
declare function parseChangelogMarkdown(contents: string): { | ||
releases: { | ||
version?: string; | ||
body: string; | ||
}[]; | ||
}; | ||
export { ChangelogConfig, GitCommit, GitCommitAuthor, RawGitCommit, Reference, SemverBumpType, bumpVersion, determineSemverChange, generateMarkDown, getCurrentGitBranch, getCurrentGitRef, getCurrentGitTag, getGitDiff, getLastGitTag, loadChangelogConfig, parseCommits, parseGitCommit }; | ||
export { ChangelogConfig, GitCommit, GitCommitAuthor, GithubOptions, GithubRelease, RawGitCommit, Reference, RepoConfig, RepoProvider, SemverBumpType, bumpVersion, createGithubRelease, determineSemverChange, formatCompareChanges, formatReference, generateMarkDown, getCurrentGitBranch, getCurrentGitRef, getCurrentGitTag, getGitDiff, getGithubChangelog, getGithubReleaseByTag, getLastGitTag, getRepoConfig, githubNewReleaseURL, listGithubReleases, loadChangelogConfig, parseChangelogMarkdown, parseCommits, parseGitCommit, resolveGithubToken, syncGithubRelease, updateGithubRelease }; |
{ | ||
"name": "changelogen", | ||
"version": "0.4.1", | ||
"version": "0.5.0", | ||
"description": "Generate Beautiful Changelogs using Conventional Commits", | ||
@@ -24,35 +24,42 @@ "repository": "unjs/changelogen", | ||
], | ||
"scripts": { | ||
"build": "unbuild", | ||
"changelogen": "jiti ./src/cli.ts", | ||
"dev": "vitest dev", | ||
"lint": "eslint --ext .ts,.js,.mjs,.cjs . && prettier -c src test", | ||
"lint:fix": "eslint --fix --ext .ts,.js,.mjs,.cjs . && prettier -w src test", | ||
"prepack": "unbuild", | ||
"release": "pnpm test && pnpm changelogen --release && git push --follow-tags && pnpm publish", | ||
"test": "pnpm lint && vitest run --coverage" | ||
}, | ||
"dependencies": { | ||
"c12": "^1.1.0", | ||
"c12": "^1.1.2", | ||
"colorette": "^2.0.19", | ||
"consola": "^2.15.3", | ||
"convert-gitmoji": "^0.1.3", | ||
"execa": "^6.1.0", | ||
"execa": "^7.0.0", | ||
"mri": "^1.2.0", | ||
"node-fetch-native": "^1.0.1", | ||
"pkg-types": "^1.0.1", | ||
"node-fetch-native": "^1.0.2", | ||
"ofetch": "^1.0.1", | ||
"open": "^8.4.2", | ||
"pathe": "^1.1.0", | ||
"pkg-types": "^1.0.2", | ||
"scule": "^1.0.0", | ||
"semver": "^7.3.8" | ||
"semver": "^7.3.8", | ||
"yaml": "^2.2.1" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^18.11.18", | ||
"@types/node": "^18.14.2", | ||
"@types/semver": "^7.3.13", | ||
"@vitest/coverage-c8": "^0.27.2", | ||
"eslint": "^8.32.0", | ||
"eslint-config-unjs": "^0.0.3", | ||
"jiti": "^1.16.2", | ||
"prettier": "^2.8.3", | ||
"@vitest/coverage-c8": "^0.29.2", | ||
"eslint": "^8.35.0", | ||
"eslint-config-unjs": "^0.1.0", | ||
"jiti": "^1.17.1", | ||
"prettier": "^2.8.4", | ||
"standard-version": "^9.5.0", | ||
"typescript": "^4.8.9", | ||
"unbuild": "^1.1.1", | ||
"vitest": "^0.27.2" | ||
"typescript": "^4.9.5", | ||
"unbuild": "^1.1.2", | ||
"vitest": "^0.29.2" | ||
}, | ||
"packageManager": "pnpm@7.15.0", | ||
"scripts": { | ||
"build": "unbuild", | ||
"changelogen": "jiti ./src/cli.ts", | ||
"dev": "vitest dev", | ||
"lint": "eslint --ext .ts,.js,.mjs,.cjs . && prettier -c src test", | ||
"release": "pnpm test && pnpm changelogen --release && git push --follow-tags && pnpm publish", | ||
"test": "pnpm lint && vitest run --coverage" | ||
} | ||
} | ||
"packageManager": "pnpm@7.28.0" | ||
} |
@@ -33,3 +33,3 @@ # changelogen | ||
```sh | ||
npx changelogen@latest [...args] [<rootDir>] | ||
npx changelogen@latest [...args] [--dir <dir>] | ||
``` | ||
@@ -41,8 +41,26 @@ | ||
- `--to`: End commit reference. When not provided, **latest commit in HEAD** will be used as default. | ||
- `--rootDir`: Path to git repository. When not provided, **current working directory** will be used as as default. | ||
- `--output`: Changelog file name to create or update. Defaults to `CHANGELOG.md` and resolved relative to rootDir. Use `--no-output` to write to console only. | ||
- `--dir`: Path to git repository. When not provided, **current working directory** will be used as as default. | ||
- `--output`: Changelog file name to create or update. Defaults to `CHANGELOG.md` and resolved relative to dir. Use `--no-output` to write to console only. | ||
- `--bump`: Determine semver change and update version in `package.json`. | ||
- `--release`. Bumps version in `package.json` and creates commit and git tags using local `git`. You can disable commit using `--no-commit` and tag using `--no-tag`. | ||
- `-r`: Release as specific version. | ||
- `--major`: Bump as a semver-major version | ||
- `--minor`: Bump as a semver-minor version | ||
- `--patch`: Bump as a semver-patch version | ||
### `changelogen gh release` | ||
Changelogen has built-in functionality to sync with with Github releases! | ||
In order to manually sync a release, you can use `changelogen gh release <versions|all> [--dir] [--token]`. It will parse current `CHANGELOG.md` from current repository (local, then remote) and create or update releases. | ||
To enable this integration, make sure there is a valid `repository` field in `package.json` or `repo` is set in `.changelogenrc`. | ||
By default in unauthenticated mode, changelogen will open a browser link to make manual release. By providing github token, it can be automated. | ||
- Using environment variables or `.env`, use `CHANGELOGEN_TOKENS_GITHUB` or `GITHUB_TOKEN` or `GH_TOKEN` | ||
- Using CLI args, use `--token <token>` | ||
- Using global configuration, put `tokens.github=<token>` inside `~/.changlogenrc` | ||
- Using [GitHub CLI](https://cli.github.com/) token when authenticated with `gh auth login` | ||
## Configuration | ||
@@ -54,3 +72,2 @@ | ||
## 💻 Development | ||
@@ -70,12 +87,10 @@ | ||
<!-- Badges --> | ||
[npm-version-src]: https://img.shields.io/npm/v/changelogen?style=flat-square | ||
[npm-version-href]: https://npmjs.com/package/changelogen | ||
[npm-downloads-src]: https://img.shields.io/npm/dm/changelogen?style=flat-square | ||
[npm-downloads-href]: https://npmjs.com/package/changelogen | ||
[github-actions-src]: https://img.shields.io/github/workflow/status/unjs/changelogen/ci/main?style=flat-square | ||
[github-actions-href]: https://github.com/unjs/changelogen/actions?query=workflow%3Aci | ||
[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/changelogen/main?style=flat-square | ||
[codecov-href]: https://codecov.io/gh/unjs/changelogen |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances 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
Telemetry
Supply chain riskThis package contains telemetry which tracks how it is used.
Found 2 instances in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
60854
17
1612
93
0
14
15
+ Addedcolorette@^2.0.19
+ Addedofetch@^1.0.1
+ Addedopen@^8.4.2
+ Addedpathe@^1.1.0
+ Addedyaml@^2.2.1
+ Addedcolorette@2.0.20(transitive)
+ Addeddefine-lazy-prop@2.0.0(transitive)
+ Addedexeca@7.2.0(transitive)
+ Addedhuman-signals@4.3.1(transitive)
+ Addedis-docker@2.2.1(transitive)
+ Addedis-wsl@2.2.0(transitive)
+ Addedofetch@1.4.1(transitive)
+ Addedopen@8.4.2(transitive)
+ Addedyaml@2.6.0(transitive)
- Removedexeca@6.1.0(transitive)
- Removedhuman-signals@3.0.1(transitive)
Updatedc12@^1.1.2
Updatedexeca@^7.0.0
Updatednode-fetch-native@^1.0.2
Updatedpkg-types@^1.0.2