@reelout/config 0.6.1 → 0.7.1
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/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/src/defaultConfig.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -47,8 +47,10 @@ var defaultConfig = Object.freeze({
|
|
|
47
47
|
"@reelout/core/builder",
|
|
48
48
|
"@reelout/core/changelog",
|
|
49
49
|
"@reelout/npm",
|
|
50
|
+
"@reelout/cargo",
|
|
50
51
|
"@reelout/git",
|
|
51
|
-
"@reelout/github"
|
|
52
|
+
"@reelout/github",
|
|
53
|
+
"@reelout/gitlab"
|
|
52
54
|
]
|
|
53
55
|
});
|
|
54
56
|
// src/mergeConfig.ts
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/defaultConfig.ts","../src/mergeConfig.ts","../src/normalizeConfig.ts","../src/resolveConfig.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type { ReleaseConfig } from '@reelout/core'\n\n/**\n * Default release configuration used when no user config is provided.\n *\n * Includes defaults for user identity, workspace layout, release rules,\n * commit-to-release mappings, and built-in plugins.\n */\nexport const defaultConfig = Object.freeze({\n author: {\n name: 'github-actions[bot]',\n email: '41898282+github-actions[bot]@users.noreply.github.com',\n },\n classifier: {\n major: [],\n minor: ['feat'],\n patch: ['fix', 'perf', 'revert'],\n },\n rules: [\n { type: 'branch', pattern: 'alpha', qualifier: 'alpha', channel: 'alpha' },\n { type: 'branch', pattern: 'beta', qualifier: 'beta', channel: 'beta' },\n { type: 'branch', pattern: 'next', qualifier: 'next', channel: 'next' },\n ],\n plugins: [\n '@reelout/core/analyzer', // Analyze the commits and determine the release type.\n '@reelout/core/builder', // Build the release artifacts.\n '@reelout/core/changelog', // Generate and write changelog entries for each release.\n '@reelout/npm', // Update package manifests and publish packages to npm.\n '@reelout/git', // Create release commits and tags, then push them.\n '@reelout/github', // Create GitHub releases from finalized plans.\n ],\n} satisfies Required<ReleaseConfig>)\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { assignWith } from 'lodash-es'\n\n/**\n * Merge a user configuration into the defaults, preserving unspecified keys.\n *\n * Uses `lodash.assignWith` to avoid overwriting default values with\n * `undefined` from the user configuration.\n *\n * @param defaultConfig Default configuration object\n * @param userConfig Partial user-provided configuration\n * @returns Merged configuration object\n */\nexport function mergeConfig<T>(\n defaultConfig: T,\n userConfig: Partial<T> | null | undefined\n): T {\n return assignWith({}, defaultConfig, userConfig, (objValue, srcValue) => {\n if (srcValue === undefined) {\n return objValue\n }\n })\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport {\n compact,\n normalizeCommitFilter,\n normalizeReleaseRule,\n resolvePlugin,\n type GitAuthor,\n type ReleaseConfig,\n type ResolvedReleaseConfig,\n} from '@reelout/core'\nimport { defaultConfig } from './defaultConfig'\n\n/**\n * Normalize and resolve a release configuration.\n *\n * Applies default author settings when incomplete, normalizes commit filters\n * and release rules, and loads specified plugins.\n *\n * @param cwd Working directory path used for plugin resolution\n * @param config User-supplied release configuration\n * @returns Resolved and normalized release configuration\n * @throws If a configured plugin cannot be resolved\n */\nexport async function normalizeConfig(\n cwd: string,\n config: Required<ReleaseConfig>\n): Promise<ResolvedReleaseConfig> {\n const author: GitAuthor =\n config.author.name && config.author.email\n ? { name: config.author.name, email: config.author.email }\n : { ...defaultConfig.author }\n\n const classifier = normalizeCommitFilter(config.classifier)\n\n const rules = compact(config.rules.map((rule) => normalizeReleaseRule(rule)))\n\n const plugins = compact(\n await Promise.all(\n config.plugins.map(async (plugin) => {\n try {\n return await resolvePlugin(cwd, plugin)\n } catch (err) {\n try {\n return await resolvePlugin(import.meta.filename, plugin)\n } catch {}\n\n throw err\n }\n })\n )\n )\n\n return {\n ...config,\n author,\n classifier,\n rules,\n plugins,\n }\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type { ReleaseConfig, ResolvedReleaseConfig } from '@reelout/core'\nimport { cosmiconfig } from 'cosmiconfig'\nimport { defaultConfig } from './defaultConfig'\nimport { mergeConfig } from './mergeConfig'\nimport { normalizeConfig } from './normalizeConfig'\n\n/**\n * Resolve and normalize a release configuration for a target directory.\n *\n * Searches for configuration files using `cosmiconfig`, merges discovered user\n * settings with default configurations, and normalizes the resulting structure.\n *\n * @param cwd Working directory path to search from\n * @param name Module name used for configuration file discovery\n * @returns Resolved and normalized release configuration\n */\nexport async function resolveConfig(\n cwd: string,\n name = 'reelout'\n): Promise<ResolvedReleaseConfig> {\n const explorer = cosmiconfig(name)\n\n const result = await explorer.search(cwd)\n\n const config = mergeConfig<Required<ReleaseConfig>>(\n defaultConfig,\n result?.config\n )\n\n return normalizeConfig(cwd, config)\n}\n"],"mappings":";;;;;;;;;;AAWA,IAAa,gBAAgB,OAAO,OAAO;CACzC,QAAQ;EACN,MAAM;EACN,OAAO;CACT;CACA,YAAY;EACV,OAAO,CAAC;EACR,OAAO,CAAC,MAAM;EACd,OAAO;GAAC;GAAO;GAAQ;EAAQ;CACjC;CACA,OAAO;EACL;GAAE,MAAM;GAAU,SAAS;GAAS,WAAW;GAAS,SAAS;EAAQ;EACzE;GAAE,MAAM;GAAU,SAAS;GAAQ,WAAW;GAAQ,SAAS;EAAO;EACtE;GAAE,MAAM;GAAU,SAAS;GAAQ,WAAW;GAAQ,SAAS;EAAO;CACxE;CACA,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;CACF;AACF,CAAmC;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/defaultConfig.ts","../src/mergeConfig.ts","../src/normalizeConfig.ts","../src/resolveConfig.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type { ReleaseConfig } from '@reelout/core'\n\n/**\n * Default release configuration used when no user config is provided.\n *\n * Includes defaults for user identity, workspace layout, release rules,\n * commit-to-release mappings, and built-in plugins.\n */\nexport const defaultConfig = Object.freeze({\n author: {\n name: 'github-actions[bot]',\n email: '41898282+github-actions[bot]@users.noreply.github.com',\n },\n classifier: {\n major: [],\n minor: ['feat'],\n patch: ['fix', 'perf', 'revert'],\n },\n rules: [\n { type: 'branch', pattern: 'alpha', qualifier: 'alpha', channel: 'alpha' },\n { type: 'branch', pattern: 'beta', qualifier: 'beta', channel: 'beta' },\n { type: 'branch', pattern: 'next', qualifier: 'next', channel: 'next' },\n ],\n plugins: [\n '@reelout/core/analyzer', // Analyze the commits and determine the release type.\n '@reelout/core/builder', // Build the release artifacts.\n '@reelout/core/changelog', // Generate and write changelog entries for each release.\n '@reelout/npm', // Update package manifests and publish packages to npm.\n '@reelout/cargo', // Update crate manifests and publish crates to crates.io.\n '@reelout/git', // Create release commits and tags, then push them.\n '@reelout/github', // Create GitHub releases from finalized plans.\n '@reelout/gitlab', // Create GitLab releases from finalized plans.\n ],\n} satisfies Required<ReleaseConfig>)\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { assignWith } from 'lodash-es'\n\n/**\n * Merge a user configuration into the defaults, preserving unspecified keys.\n *\n * Uses `lodash.assignWith` to avoid overwriting default values with\n * `undefined` from the user configuration.\n *\n * @param defaultConfig Default configuration object\n * @param userConfig Partial user-provided configuration\n * @returns Merged configuration object\n */\nexport function mergeConfig<T>(\n defaultConfig: T,\n userConfig: Partial<T> | null | undefined\n): T {\n return assignWith({}, defaultConfig, userConfig, (objValue, srcValue) => {\n if (srcValue === undefined) {\n return objValue\n }\n })\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport {\n compact,\n normalizeCommitFilter,\n normalizeReleaseRule,\n resolvePlugin,\n type GitAuthor,\n type ReleaseConfig,\n type ResolvedReleaseConfig,\n} from '@reelout/core'\nimport { defaultConfig } from './defaultConfig'\n\n/**\n * Normalize and resolve a release configuration.\n *\n * Applies default author settings when incomplete, normalizes commit filters\n * and release rules, and loads specified plugins.\n *\n * @param cwd Working directory path used for plugin resolution\n * @param config User-supplied release configuration\n * @returns Resolved and normalized release configuration\n * @throws If a configured plugin cannot be resolved\n */\nexport async function normalizeConfig(\n cwd: string,\n config: Required<ReleaseConfig>\n): Promise<ResolvedReleaseConfig> {\n const author: GitAuthor =\n config.author.name && config.author.email\n ? { name: config.author.name, email: config.author.email }\n : { ...defaultConfig.author }\n\n const classifier = normalizeCommitFilter(config.classifier)\n\n const rules = compact(config.rules.map((rule) => normalizeReleaseRule(rule)))\n\n const plugins = compact(\n await Promise.all(\n config.plugins.map(async (plugin) => {\n try {\n return await resolvePlugin(cwd, plugin)\n } catch (err) {\n try {\n return await resolvePlugin(import.meta.filename, plugin)\n } catch {}\n\n throw err\n }\n })\n )\n )\n\n return {\n ...config,\n author,\n classifier,\n rules,\n plugins,\n }\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type { ReleaseConfig, ResolvedReleaseConfig } from '@reelout/core'\nimport { cosmiconfig } from 'cosmiconfig'\nimport { defaultConfig } from './defaultConfig'\nimport { mergeConfig } from './mergeConfig'\nimport { normalizeConfig } from './normalizeConfig'\n\n/**\n * Resolve and normalize a release configuration for a target directory.\n *\n * Searches for configuration files using `cosmiconfig`, merges discovered user\n * settings with default configurations, and normalizes the resulting structure.\n *\n * @param cwd Working directory path to search from\n * @param name Module name used for configuration file discovery\n * @returns Resolved and normalized release configuration\n */\nexport async function resolveConfig(\n cwd: string,\n name = 'reelout'\n): Promise<ResolvedReleaseConfig> {\n const explorer = cosmiconfig(name)\n\n const result = await explorer.search(cwd)\n\n const config = mergeConfig<Required<ReleaseConfig>>(\n defaultConfig,\n result?.config\n )\n\n return normalizeConfig(cwd, config)\n}\n"],"mappings":";;;;;;;;;;AAWA,IAAa,gBAAgB,OAAO,OAAO;CACzC,QAAQ;EACN,MAAM;EACN,OAAO;C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OAAO,GAAG,EAItC,EAAQ,MAGkB,CAAM;AACpC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reelout/config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Discovers, merges, and normalizes ReelOut configuration, including plugin registrations.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"./src"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@reelout/cargo": "^0.
|
|
35
|
+
"@reelout/cargo": "^0.3.0",
|
|
36
36
|
"@reelout/core": "^0.13.0",
|
|
37
|
-
"@reelout/git": "^0.
|
|
38
|
-
"@reelout/github": "^0.
|
|
39
|
-
"@reelout/gitlab": "^0.
|
|
40
|
-
"@reelout/npm": "^0.
|
|
37
|
+
"@reelout/git": "^0.9.0",
|
|
38
|
+
"@reelout/github": "^0.8.0",
|
|
39
|
+
"@reelout/gitlab": "^0.8.0",
|
|
40
|
+
"@reelout/npm": "^0.14.0",
|
|
41
41
|
"cosmiconfig": "^10.0.1",
|
|
42
42
|
"lodash-es": "^4.18.1"
|
|
43
43
|
},
|
package/src/defaultConfig.ts
CHANGED
|
@@ -29,7 +29,9 @@ export const defaultConfig = Object.freeze({
|
|
|
29
29
|
'@reelout/core/builder', // Build the release artifacts.
|
|
30
30
|
'@reelout/core/changelog', // Generate and write changelog entries for each release.
|
|
31
31
|
'@reelout/npm', // Update package manifests and publish packages to npm.
|
|
32
|
+
'@reelout/cargo', // Update crate manifests and publish crates to crates.io.
|
|
32
33
|
'@reelout/git', // Create release commits and tags, then push them.
|
|
33
34
|
'@reelout/github', // Create GitHub releases from finalized plans.
|
|
35
|
+
'@reelout/gitlab', // Create GitLab releases from finalized plans.
|
|
34
36
|
],
|
|
35
37
|
} satisfies Required<ReleaseConfig>)
|