@reelout/core 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analyzer.js +14 -10
- package/dist/analyzer.js.map +1 -1
- package/dist/builder.js +1 -1
- package/dist/changelog.js +1 -1
- package/dist/index.js +2 -36
- package/dist/index.js.map +1 -1
- package/dist/{workflow-c9uKSARL.js → workflow-BolfadM0.js} +690 -773
- package/dist/workflow-BolfadM0.js.map +1 -0
- package/package.json +1 -1
- package/src/analyzer.ts +27 -17
- package/src/config/const.ts +0 -2
- package/src/git/history/index.ts +2 -2
- package/src/git/history/{showGitHistory.ts → readGitHistory.ts} +3 -3
- package/src/git/history/{showParsedGitHistory.ts → readParsedGitHistory.ts} +6 -6
- package/src/git/tag/generateGitTagName.ts +1 -0
- package/src/git/tag/index.ts +1 -1
- package/src/git/tag/{isGitTagPointed.ts → isGitTagExact.ts} +1 -1
- package/src/workflow/analysis/deriveChangeReleases.ts +3 -3
- package/src/workflow/analysis/deriveTransitionReleases.ts +1 -1
- package/src/workflow/analysis/index.ts +1 -5
- package/src/workflow/analysis/{isCommitForPackage.ts → packageContainsCommit.ts} +4 -1
- package/src/workflow/analysis/readPackageHistory.ts +28 -9
- package/src/workflow/commit/index.ts +4 -0
- package/src/workflow/discovery/verifyPackageTag.ts +2 -2
- package/src/workflow/index.ts +2 -2
- package/src/workflow/{versioning/determineReleaseType.ts → version/deriveCommitReleaseType.ts} +2 -2
- package/src/workflow/{versioning → version}/deriveReleaseType.ts +2 -2
- package/src/workflow/{versioning → version}/index.ts +2 -1
- package/dist/workflow-c9uKSARL.js.map +0 -1
- package/src/workflow/analysis/collectUnreleased.ts +0 -44
- package/src/workflow/analysis/sliceUnreleased.ts +0 -24
- package/src/workflow/analysis/sliceUnreleasedForPackage.ts +0 -41
- package/src/workflow/committing/formatReleaseFilterPatterns.ts +0 -18
- package/src/workflow/committing/index.ts +0 -7
- package/src/workflow/committing/isReleaseCommit.ts +0 -56
- package/src/workflow/committing/readReleaseFilterPatterns.ts +0 -38
- /package/src/workflow/{committing → commit}/generateReleaseCommitMessage.ts +0 -0
- /package/src/workflow/{versioning → version}/bumpVersion.ts +0 -0
- /package/src/workflow/{versioning → version}/extractVersionQualifier.ts +0 -0
- /package/src/workflow/{versioning → version}/isSameReleaseCycle.ts +0 -0
- /package/src/workflow/{versioning → version}/isStableVersion.ts +0 -0
- /package/src/workflow/{versioning → version}/pickPriorityReleaseType.ts +0 -0
- /package/src/workflow/{analysis → version}/promotePrereleaseVersions.ts +0 -0
|
@@ -11,7 +11,7 @@ import { execGit } from '#util'
|
|
|
11
11
|
* @param commit Commit hash to compare against
|
|
12
12
|
* @returns `true` when the tag points at `commit`, otherwise `false`
|
|
13
13
|
*/
|
|
14
|
-
export async function
|
|
14
|
+
export async function isGitTagExact(
|
|
15
15
|
cwd: string,
|
|
16
16
|
tag: string,
|
|
17
17
|
commit: string
|
|
@@ -7,8 +7,8 @@ import type {
|
|
|
7
7
|
ReleasePlan,
|
|
8
8
|
ReleaseTypeHint,
|
|
9
9
|
} from '#types'
|
|
10
|
-
import { deriveReleaseType, pickPriorityReleaseType } from '../
|
|
11
|
-
import {
|
|
10
|
+
import { deriveReleaseType, pickPriorityReleaseType } from '../version'
|
|
11
|
+
import { packageContainsCommit } from './packageContainsCommit'
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Analyze commit history to update release plans for packages.
|
|
@@ -34,7 +34,7 @@ export async function deriveChangeReleases(
|
|
|
34
34
|
): Promise<ReleasePlan[]> {
|
|
35
35
|
for await (const commit of history) {
|
|
36
36
|
plans = plans.map((plan): ReleasePlan => {
|
|
37
|
-
if (!
|
|
37
|
+
if (!packageContainsCommit(plan.package, commit)) {
|
|
38
38
|
return plan
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -8,7 +8,7 @@ import type {
|
|
|
8
8
|
VersionTransition,
|
|
9
9
|
} from '#types'
|
|
10
10
|
import semver from 'semver'
|
|
11
|
-
import { extractVersionQualifier } from '../
|
|
11
|
+
import { extractVersionQualifier } from '../version/extractVersionQualifier'
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Derive transition release types for release plans based on version qualifiers.
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
// Copyright (c) 2026 Fai
|
|
3
3
|
|
|
4
|
-
export * from './collectUnreleased'
|
|
5
4
|
export * from './deriveChangeReleases'
|
|
6
5
|
export * from './deriveTransitionReleases'
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './promotePrereleaseVersions'
|
|
6
|
+
export * from './packageContainsCommit'
|
|
9
7
|
export * from './propagateDependencyUpdates'
|
|
10
8
|
export * from './readPackageHistory'
|
|
11
|
-
export * from './sliceUnreleased'
|
|
12
|
-
export * from './sliceUnreleasedForPackage'
|
|
@@ -13,7 +13,10 @@ import path from 'node:path'
|
|
|
13
13
|
* @param commit Parsed commit containing changed file paths
|
|
14
14
|
* @returns `true` if any changed file matches the package pattern
|
|
15
15
|
*/
|
|
16
|
-
export function
|
|
16
|
+
export function packageContainsCommit(
|
|
17
|
+
pkg: Package,
|
|
18
|
+
commit: GitCommit
|
|
19
|
+
): boolean {
|
|
17
20
|
return commit.files.some((file) => {
|
|
18
21
|
const { location } = pkg
|
|
19
22
|
const files = pkg.files || path.join(location, ALL_FILES)
|
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
// Copyright (c) 2026 Fai
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { readParsedGitHistory, type ReadGitHistoryOptions } from '#git'
|
|
5
5
|
import type { GitCommit, Package } from '#types'
|
|
6
|
-
import {
|
|
6
|
+
import { unique } from '#util'
|
|
7
|
+
import { packageContainsCommit } from './packageContainsCommit'
|
|
8
|
+
|
|
9
|
+
const LITERAL_PATH = /^[^*?[\]{}!+@]*$/
|
|
7
10
|
|
|
8
11
|
/**
|
|
9
12
|
* Yield commits from git history associated with a package.
|
|
10
13
|
*
|
|
11
14
|
* Filters git commit history to yield only entries relevant to the target
|
|
12
|
-
* `pkg` directory.
|
|
15
|
+
* `pkg` directory. When the package file pattern is a list, plain file
|
|
16
|
+
* entries are added to the git path filter alongside the package directory
|
|
17
|
+
* (duplicates removed), so commits touching extra package files (for example
|
|
18
|
+
* the pnpm workspace manifest) are included. Only entries without glob or
|
|
19
|
+
* pattern metacharacters (wildcards, braces, and the extglob or negation
|
|
20
|
+
* characters used by package file patterns) are passed to git, because git
|
|
21
|
+
* pathspecs would interpret those characters differently. Pattern-like
|
|
22
|
+
* entries are left to `packageContainsCommit`, which matches them with the
|
|
23
|
+
* package's own file-pattern semantics.
|
|
13
24
|
*
|
|
14
25
|
* @param cwd Path to the working directory for git commands
|
|
15
26
|
* @param pkg Package configuration containing the target directory
|
|
@@ -19,15 +30,23 @@ import { isCommitForPackage } from './isCommitForPackage'
|
|
|
19
30
|
export async function* readPackageHistory(
|
|
20
31
|
cwd: string,
|
|
21
32
|
pkg: Package,
|
|
22
|
-
options:
|
|
33
|
+
options: ReadGitHistoryOptions = {}
|
|
23
34
|
): AsyncGenerator<GitCommit> {
|
|
24
|
-
options = {
|
|
25
|
-
|
|
26
|
-
|
|
35
|
+
options = { ...options }
|
|
36
|
+
|
|
37
|
+
if (!options.filePath) {
|
|
38
|
+
if (Array.isArray(pkg.files)) {
|
|
39
|
+
options.filePath = unique([
|
|
40
|
+
pkg.location,
|
|
41
|
+
...pkg.files.filter((file) => LITERAL_PATH.test(file)),
|
|
42
|
+
])
|
|
43
|
+
} else {
|
|
44
|
+
options.filePath = pkg.location
|
|
45
|
+
}
|
|
27
46
|
}
|
|
28
47
|
|
|
29
|
-
for await (const commit of
|
|
30
|
-
if (
|
|
48
|
+
for await (const commit of readParsedGitHistory(cwd, options)) {
|
|
49
|
+
if (packageContainsCommit(pkg, commit)) {
|
|
31
50
|
yield commit
|
|
32
51
|
}
|
|
33
52
|
}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
isGitTagConnected,
|
|
9
9
|
} from '#git'
|
|
10
10
|
import type { GitCommit, Package } from '#types'
|
|
11
|
-
import {
|
|
11
|
+
import { packageContainsCommit } from '../analysis/packageContainsCommit'
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Verify a Git tag against package specifications and repository history.
|
|
@@ -39,7 +39,7 @@ export async function verifyPackageTag(
|
|
|
39
39
|
return false
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
if (!
|
|
42
|
+
if (!packageContainsCommit(pkg, tagCommit)) {
|
|
43
43
|
return false
|
|
44
44
|
}
|
|
45
45
|
|
package/src/workflow/index.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
export * from './analysis'
|
|
5
5
|
export * from './changelog'
|
|
6
|
-
export * from './
|
|
6
|
+
export * from './commit'
|
|
7
7
|
export * from './discovery'
|
|
8
8
|
export * from './executeReleaseWorkflow'
|
|
9
9
|
export * from './report'
|
|
10
|
-
export * from './
|
|
10
|
+
export * from './version'
|
package/src/workflow/{versioning/determineReleaseType.ts → version/deriveCommitReleaseType.ts}
RENAMED
|
@@ -5,7 +5,7 @@ import type { CommitClassifier, GitCommit, ReleaseType } from '#types'
|
|
|
5
5
|
import semver from 'semver'
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Derive the release type for a single commit.
|
|
9
9
|
*
|
|
10
10
|
* Returns `'minor'` for a commit marked as a breaking change while the
|
|
11
11
|
* supplied `version` is zero-major (`0.y.z`), and `'major'` otherwise, since
|
|
@@ -19,7 +19,7 @@ import semver from 'semver'
|
|
|
19
19
|
* @param version Current package version used to adjust zero-major breaking releases
|
|
20
20
|
* @returns `ReleaseType` string, or `null` when no matching rule applies
|
|
21
21
|
*/
|
|
22
|
-
export function
|
|
22
|
+
export function deriveCommitReleaseType(
|
|
23
23
|
classifier: CommitClassifier,
|
|
24
24
|
commit: GitCommit,
|
|
25
25
|
version?: string | null | undefined
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright (c) 2026 Fai
|
|
3
3
|
|
|
4
4
|
import type { CommitClassifier, ReleasePlan, ReleaseType } from '#types'
|
|
5
|
-
import {
|
|
5
|
+
import { deriveCommitReleaseType } from './deriveCommitReleaseType'
|
|
6
6
|
import { pickPriorityReleaseType } from './pickPriorityReleaseType'
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -27,7 +27,7 @@ export function deriveReleaseType(
|
|
|
27
27
|
for (const commit of plan.history) {
|
|
28
28
|
releaseType = pickPriorityReleaseType(
|
|
29
29
|
releaseType,
|
|
30
|
-
|
|
30
|
+
deriveCommitReleaseType(classifier, commit, plan.package.version)
|
|
31
31
|
)
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
// Copyright (c) 2026 Fai
|
|
3
3
|
|
|
4
4
|
export * from './bumpVersion'
|
|
5
|
+
export * from './deriveCommitReleaseType'
|
|
5
6
|
export * from './deriveReleaseType'
|
|
6
|
-
export * from './determineReleaseType'
|
|
7
7
|
export * from './extractVersionQualifier'
|
|
8
8
|
export * from './isSameReleaseCycle'
|
|
9
9
|
export * from './isStableVersion'
|
|
10
10
|
export * from './pickPriorityReleaseType'
|
|
11
|
+
export * from './promotePrereleaseVersions'
|