relizy 0.1.0 → 0.2.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/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  </p>
10
10
  </div>
11
11
 
12
- Seamless and automated release management with elegant changelog generation based on Conventional Commits, supporting both monorepos and single packages. Handles version bumping, changelog generation, Git tagging, and publishing to npm, GitHub & GitLab effortlessly.
12
+ Seamless and automated release manager with elegant changelog generation based on Conventional Commits, supporting both monorepos and single packages. Handles version bumping, changelog generation, Git tagging, and publishing to npm, GitHub & GitLab effortlessly.
13
13
 
14
14
  ## 🎯 Why use this tool?
15
15
 
@@ -71,17 +71,17 @@ You can use any of these formats for your configuration file:
71
71
 
72
72
  **Examples:**
73
73
 
74
- - `changelog.config.ts` (TypeScript - recommended)
75
- - `changelog.config.js` (JavaScript)
76
- - `changelog.config.json` (JSON)
77
- - `changelog.config.yaml` (YAML)
74
+ - `relizy.config.ts` (TypeScript - recommended)
75
+ - `relizy.config.js` (JavaScript)
76
+ - `relizy.config.json` (JSON)
77
+ - `relizy.config.yaml` (YAML)
78
78
 
79
79
  ### Minimal Configuration Example
80
80
 
81
81
  **TypeScript/JavaScript** (recommended):
82
82
 
83
83
  ```typescript
84
- // changelog.config.ts
84
+ // relizy.config.ts
85
85
  import { defineConfig } from 'relizy'
86
86
 
87
87
  export default defineConfig({
@@ -134,11 +134,11 @@ Executes the entire release workflow in one command:
134
134
  4. Create git tag
135
135
  5. Push to remote
136
136
  6. Publish to npm
137
- 7. Create GitHub/GitLab release
137
+ 7. Create GitHub or GitLab release
138
138
 
139
139
  ```bash
140
140
  # Complete release
141
- relizy release --patch
141
+ relizy release
142
142
 
143
143
  # Release with pre-release
144
144
  relizy release --prerelease --preid beta --tag beta
@@ -150,7 +150,7 @@ relizy release --prerelease --preid beta --suffix abc123
150
150
  relizy release --patch --no-push
151
151
 
152
152
  # Without GitHub/GitLab release creation
153
- relizy release --patch --no-release
153
+ relizy release --patch --no-provider-release
154
154
 
155
155
  # Without npm publish
156
156
  relizy release --patch --no-publish
@@ -170,7 +170,7 @@ relizy release --patch --force
170
170
  All options from `bump`, `changelog`, `publish` and `provider-release` are available, and:
171
171
 
172
172
  - `--no-push` - Don't push changes and tags to remote
173
- - `--no-release` - Don't create GitHub/GitLab release
173
+ - `--no-provider-release` - Don't create GitHub/GitLab release
174
174
  - `--no-publish` - Don't publish to npm
175
175
  - `--no-verify` - Skip git hooks during commit
176
176
  - `--no-commit` - Skip commit and tag creation
@@ -180,7 +180,7 @@ All options from `bump`, `changelog`, `publish` and `provider-release` are avail
180
180
  - `--force` - Force bump even without commits
181
181
  - `--yes` - Skip confirmation prompt
182
182
  - `--build-cmd <cmd>` - Command to build packages before publish
183
- - `--suffix <suffix>` - Custom suffix for prerelease versions (see [bump --suffix](#suffix))
183
+ - `--suffix <suffix>` - Custom suffix for prerelease versions (see [bump --suffix](#--suffix))
184
184
 
185
185
  #### 2. `bump` - Update versions
186
186
 
@@ -387,8 +387,8 @@ Multiple ways to provide the token:
387
387
  - Command line option (`--token`)
388
388
  - Configuration file (see [tokens](#tokens) section)
389
389
  - Environment variables (checked in order):
390
- - **GitHub:** `RELIZY_TOKENS_GITHUB`, `GITHUB_TOKEN`, `GH_TOKEN`
391
- - **GitLab:** `RELIZY_TOKENS_GITLAB`, `GITLAB_TOKEN`, `GITLAB_API_TOKEN`, `CI_JOB_TOKEN`
390
+ - **GitHub:** `RELIZY_GITHUB_TOKEN`, `GITHUB_TOKEN`, `GH_TOKEN`
391
+ - **GitLab:** `RELIZY_GITLAB_TOKEN`, `GITLAB_TOKEN`, `GITLAB_API_TOKEN`, `CI_JOB_TOKEN`
392
392
 
393
393
  ### Global options
394
394
 
@@ -399,14 +399,14 @@ All commands support these global options:
399
399
  Use `--config` to specify a custom configuration file name (without the file extension):
400
400
 
401
401
  ```bash
402
- # Use default config (changelog.config.{ts,js,json,yaml,...})
402
+ # Use default config (relizy.config.{ts,js,json,yaml,...})
403
403
  relizy bump --patch
404
404
 
405
- # Use custom config (changelog.standalone.config.{ts,js,json,yaml,...})
406
- relizy bump --config changelog.standalone --patch
405
+ # Use custom config (relizy.standalone.config.{ts,js,json,yaml,...})
406
+ relizy bump --config relizy.standalone --patch
407
407
 
408
- # Use another config (changelog.experimental.config.{ts,js,json,yaml,...})
409
- relizy release --config changelog.experimental --minor
408
+ # Use another config (relizy.experimental.config.{ts,js,json,yaml,...})
409
+ relizy release --config relizy.experimental --minor
410
410
  ```
411
411
 
412
412
  **Important:**
@@ -485,7 +485,7 @@ $ relizy bump --patch --log-level debug
485
485
 
486
486
  This tool extends [changelogen](https://github.com/unjs/changelogen) configuration with additional monorepo-specific options. Some options from changelogen are overridden to provide better monorepo support.
487
487
 
488
- Create a `changelog.config.ts` file at the root of your project:
488
+ Create a `relizy.config.ts` file at the root of your project:
489
489
 
490
490
  ```typescript
491
491
  import { defineConfig } from 'relizy'
@@ -762,8 +762,8 @@ Authentication tokens for git providers (read from environment variables by defa
762
762
 
763
763
  **Environment variables checked (in order):**
764
764
 
765
- - GitHub: `RELIZY_TOKENS_GITHUB`, `GITHUB_TOKEN`, `GH_TOKEN`
766
- - GitLab: `RELIZY_TOKENS_GITLAB`, `GITLAB_TOKEN`, `GITLAB_API_TOKEN`, `CI_JOB_TOKEN`
765
+ - GitHub: `RELIZY_GITHUB_TOKEN`, `GITHUB_TOKEN`, `GH_TOKEN`
766
+ - GitLab: `RELIZY_GITLAB_TOKEN`, `GITLAB_TOKEN`, `GITLAB_API_TOKEN`, `CI_JOB_TOKEN`
767
767
 
768
768
  **Example:**
769
769
 
@@ -944,11 +944,11 @@ Create multiple configuration files following this naming pattern: `<name>.confi
944
944
 
945
945
  **Example file structure:**
946
946
 
947
- ```
947
+ ```text
948
948
  /
949
- ├── changelog.config.ts # Main config (core packages)
950
- ├── changelog.standalone.config.ts # Standalone utilities config
951
- └── changelog.experimental.config.json # Experimental packages config
949
+ ├── relizy.config.ts # Main config (core packages)
950
+ ├── relizy.standalone.config.ts # Standalone utilities config
951
+ └── relizy.experimental.config.json # Experimental packages config
952
952
  ```
953
953
 
954
954
  You can use any supported format (`.ts`, `.js`, `.json`, `.yaml`, etc.) for each config file.
@@ -957,7 +957,7 @@ You can use any supported format (`.ts`, `.js`, `.json`, `.yaml`, etc.) for each
957
957
 
958
958
  This is a real-world example where you want to separate UI components (which should be released together) from standalone utilities (which can evolve independently).
959
959
 
960
- **`changelog.config.ts`** - Core UI packages (selective mode):
960
+ **`relizy.config.ts`** - Core UI packages (selective mode):
961
961
 
962
962
  ```typescript
963
963
  import { defineConfig } from 'relizy'
@@ -983,7 +983,7 @@ export default defineConfig({
983
983
  })
984
984
  ```
985
985
 
986
- **`changelog.standalone.config.ts`** - Standalone utilities (independent mode):
986
+ **`relizy.standalone.config.ts`** - Standalone utilities (independent mode):
987
987
 
988
988
  ```typescript
989
989
  import { defineConfig } from 'relizy'
@@ -1017,20 +1017,20 @@ export default defineConfig({
1017
1017
  # Release core UI packages together (selective mode)
1018
1018
  pnpm relizy release --patch
1019
1019
  # or explicitly
1020
- pnpm relizy release --config changelog --patch
1020
+ pnpm relizy release --config relizy --patch
1021
1021
 
1022
1022
  # Release standalone utilities independently
1023
- pnpm relizy release --config changelog.standalone --patch
1023
+ pnpm relizy release --config relizy.standalone --patch
1024
1024
 
1025
1025
  # You can also use different configs for different commands
1026
- pnpm relizy bump --config changelog.standalone --minor
1027
- pnpm relizy changelog --config changelog.standalone
1028
- pnpm relizy publish --config changelog.standalone
1026
+ pnpm relizy bump --config relizy.standalone --minor
1027
+ pnpm relizy changelog --config relizy.standalone
1028
+ pnpm relizy publish --config relizy.standalone
1029
1029
  ```
1030
1030
 
1031
1031
  ### Example: Different Registries
1032
1032
 
1033
- **`changelog.config.ts`** - Public packages (npm registry):
1033
+ **`relizy.config.ts`** - Public packages (npm registry):
1034
1034
 
1035
1035
  ```typescript
1036
1036
  import { defineConfig } from 'relizy'
@@ -1047,7 +1047,7 @@ export default defineConfig({
1047
1047
  })
1048
1048
  ```
1049
1049
 
1050
- **`changelog.private.config.ts`** - Private packages (GitHub Packages):
1050
+ **`relizy.private.config.ts`** - Private packages (GitHub Packages):
1051
1051
 
1052
1052
  ```typescript
1053
1053
  import { defineConfig } from 'relizy'
@@ -1069,12 +1069,12 @@ export default defineConfig({
1069
1069
  pnpm relizy publish
1070
1070
 
1071
1071
  # Publish private packages to GitHub Packages
1072
- pnpm relizy publish --config changelog.private
1072
+ pnpm relizy publish --config relizy.private
1073
1073
  ```
1074
1074
 
1075
1075
  ### Best Practices
1076
1076
 
1077
- 1. **Use descriptive config names** - `changelog.standalone.config.ts` is better than `changelog.alt.config.ts`
1077
+ 1. **Use descriptive config names** - `relizy.standalone.config.ts` is better than `relizy.alt.config.ts`
1078
1078
  2. **Document your workflow** - Add comments in your config files explaining the purpose
1079
1079
  3. **Keep it simple** - Don't create too many configs unless necessary
1080
1080
  4. **Version control** - Commit all config files to your repository
@@ -1082,7 +1082,7 @@ pnpm relizy publish --config changelog.private
1082
1082
 
1083
1083
  ### Tips
1084
1084
 
1085
- - The default config is `changelog.config.<ext>` where c12 will auto-detect the extension (you don't need `--config` flag)
1085
+ - The default config is `relizy.config.<ext>` where c12 will auto-detect the extension (you don't need `--config` flag)
1086
1086
  - Config files must follow the pattern `<name>.config.<ext>` (c12 requirement)
1087
1087
  - Supported formats: `.ts`, `.js`, `.mjs`, `.cjs`, `.mts`, `.cts`, `.json`, `.jsonc`, `.json5`, `.yaml`, `.yml`, `.toml`
1088
1088
  - All commands support the `--config` option
@@ -1146,7 +1146,7 @@ If a `lerna.json` file exists at the root, the tool automatically updates its `v
1146
1146
  ### Migration from Lerna
1147
1147
 
1148
1148
  1. Keep your existing `lerna.json` (optional)
1149
- 2. Create a `changelog.config.ts` with your versioning strategy
1149
+ 2. Create a `relizy.config.ts` with your versioning strategy
1150
1150
  3. Replace `lerna version` with `relizy release`
1151
1151
  4. Use your package manager to publish (e.g., `pnpm publish -r`)
1152
1152
 
@@ -1159,7 +1159,7 @@ If a `lerna.json` file exists at the root, the tool automatically updates its `v
1159
1159
  3. Set the environment variable:
1160
1160
 
1161
1161
  ```bash
1162
- GITLAB_TOKEN="your-token-here"
1162
+ RELIZY_GITLAB_TOKEN="your-token-here"
1163
1163
  ```
1164
1164
 
1165
1165
  ### CI/CD Pipeline
package/dist/cli.mjs CHANGED
@@ -3,17 +3,17 @@ import { readFileSync } from 'node:fs';
3
3
  import { dirname, join } from 'node:path';
4
4
  import process from 'node:process';
5
5
  import { fileURLToPath } from 'node:url';
6
- import { printBanner } from '@maz-ui/node';
6
+ import { printBanner, logger } from '@maz-ui/node';
7
7
  import { Command } from 'commander';
8
- import { b as bump, c as changelog, a as publish, p as providerRelease, r as release } from './shared/relizy.Blp-ymeX.mjs';
8
+ import { R as isInCI, S as getCIName, b as bump, c as changelog, d as publish, a as providerRelease, r as release } from './shared/relizy.CBq0DAtR.mjs';
9
9
  import 'node:child_process';
10
+ import '@maz-ui/utils';
11
+ import 'c12';
10
12
  import 'changelogen';
13
+ import 'defu';
11
14
  import 'fast-glob';
12
15
  import '@inquirer/prompts';
13
- import '@maz-ui/utils';
14
16
  import 'semver';
15
- import 'c12';
16
- import 'defu';
17
17
  import 'convert-gitmoji';
18
18
  import 'node-fetch-native';
19
19
 
@@ -38,6 +38,11 @@ if (!hasSilentFlag) {
38
38
  }
39
39
  });
40
40
  }
41
+ if (isInCI()) {
42
+ logger.debug(`Running in CI: ${getCIName()}`);
43
+ } else {
44
+ logger.debug("Running locally");
45
+ }
41
46
  const program = new Command();
42
47
  function hasCliFlag(flag) {
43
48
  return process.argv.includes(flag);
@@ -60,7 +65,7 @@ function getReleaseType(options) {
60
65
  type = "prepatch";
61
66
  return type;
62
67
  }
63
- program.name("relizy").description("Release management tool for monorepos and standalone packages").version(version).option("--config <name>", "Config file name (without .config.ts - e.g. changelog-test)", "relizy").option("--log-level <level>", "Set log level (silent, error, warning, normal, default, debug, trace, verbose)", "default").option("--dry-run", "Preview changes without writing files, creating tags, commits or publishing");
68
+ program.name("relizy").description("Release management tool for monorepos and standalone packages").version(version).option("--config <name>", "Config file name (without .config.ts - e.g. changelog-test)").option("--no-safety-check", "Skip safety check").option("--log-level <level>", "Set log level (silent, error, warning, normal, default, debug, trace, verbose)", "default").option("--dry-run", "Preview changes without writing files, creating tags, commits or publishing");
64
69
  program.command("bump").description("Bump package versions").option("--major", "Bump major version").option("--minor", "Bump minor version").option("--patch", "Bump patch version").option("--prerelease", "Bump prerelease version").option("--premajor", "Bump premajor version").option("--preminor", "Bump preminor version").option("--prepatch", "Bump prepatch version").option("--preid <id>", "Prerelease identifier (alpha, beta, rc, etc.)").option("--suffix <suffix>", "Custom suffix for prerelease versions - replace the last .X with .suffix (e.g. 1.0.0-beta.0 -> 1.0.0-beta.suffix)").option("--no-clean", "Skip check if the working directory is clean").option("--force", "Bump even if there are no commits").option("--yes", "Skip confirmation prompt about bumping packages").action(async (options) => {
65
70
  try {
66
71
  await bump({
@@ -118,13 +123,14 @@ program.command("provider-release").description("Publish release to git provider
118
123
  provider: options.provider,
119
124
  dryRun: program.opts().dryRun,
120
125
  logLevel: program.opts().logLevel,
121
- configName: program.opts().config
126
+ configName: program.opts().config,
127
+ safetyCheck: hasCliFlag("--no-safety-check") ? false : void 0
122
128
  });
123
129
  } catch {
124
130
  process.exit(1);
125
131
  }
126
132
  });
127
- program.command("release").description("Complete release workflow (bump + changelog + commit + tag + push to remote + publish release)").option("--major", "Bump major version").option("--minor", "Bump minor version").option("--patch", "Bump patch version").option("--prerelease", "Bump prerelease version").option("--premajor", "Bump premajor version").option("--preminor", "Bump preminor version").option("--prepatch", "Bump prepatch version").option("--preid <id>", "Prerelease identifier (alpha, beta, rc, etc.)").option("--suffix <suffix>", "Custom suffix for prerelease versions - replace the last .X with .suffix (e.g. 1.0.0-beta.0 -> 1.0.0-beta.suffix)").option("--from <ref>", "Start commit reference").option("--to <ref>", "End commit reference").option("--no-push", "Skip push changes and tags to remote").option("--no-release", "Skip release creation (GitHub/GitLab)").option("--no-publish", "Skip npm publish").option("--registry <url>", "Custom npm registry URL").option("--tag <tag>", "Publish with specific tag (default: latest for stable, next for prerelease)").option("--access <type>", "Package access level (public or restricted)").option("--otp <code>", "One-time password for 2FA").option("--no-verify", "Skip git hooks during commit").option("--format-cmd <cmd>", 'Command to format CHANGELOG files after generation (e.g. "pnpm lint")').option("--build-cmd <cmd>", 'Command to build packages before publish (e.g. "pnpm build")').option("--no-root-changelog", "Skip generation of root changelog file").option("--token <token>", "Git token (github or gitlab)").option("--force", "Bump even if there are no commits").option("--no-clean", "Skip check if the working directory is clean").option("--no-commit", "Skip commit and tag").option("--no-changelog", "Skip changelog generation files").option("--yes", "Skip confirmation prompt about bumping packages").action(async (options) => {
133
+ program.command("release").description("Complete release workflow (bump + changelog + commit + tag + push to remote + publish release)").option("--major", "Bump major version").option("--minor", "Bump minor version").option("--patch", "Bump patch version").option("--prerelease", "Bump prerelease version").option("--premajor", "Bump premajor version").option("--preminor", "Bump preminor version").option("--prepatch", "Bump prepatch version").option("--preid <id>", "Prerelease identifier (alpha, beta, rc, etc.)").option("--suffix <suffix>", "Custom suffix for prerelease versions - replace the last .X with .suffix (e.g. 1.0.0-beta.0 -> 1.0.0-beta.suffix)").option("--from <ref>", "Start commit reference").option("--to <ref>", "End commit reference").option("--no-push", "Skip push changes and tags to remote").option("--no-provider-release", "Skip release creation (GitHub/GitLab)").option("--no-publish", "Skip npm publish").option("--registry <url>", "Custom npm registry URL").option("--tag <tag>", "Publish with specific tag (default: latest for stable, next for prerelease)").option("--access <type>", "Package access level (public or restricted)").option("--otp <code>", "One-time password for 2FA").option("--no-verify", "Skip git hooks during commit").option("--format-cmd <cmd>", 'Command to format CHANGELOG files after generation (e.g. "pnpm lint")').option("--build-cmd <cmd>", 'Command to build packages before publish (e.g. "pnpm build")').option("--no-root-changelog", "Skip generation of root changelog file").option("--token <token>", "Git token (github or gitlab)").option("--force", "Bump even if there are no commits").option("--no-clean", "Skip check if the working directory is clean").option("--no-commit", "Skip commit and tag").option("--no-changelog", "Skip changelog generation files").option("--provider <provider>", "Git provider (github or gitlab)").option("--yes", "Skip confirmation prompt about bumping packages").action(async (options) => {
128
134
  try {
129
135
  await release({
130
136
  type: getReleaseType(options),
@@ -136,7 +142,7 @@ program.command("release").description("Complete release workflow (bump + change
136
142
  commit: hasCliFlag("--no-commit") ? false : void 0,
137
143
  push: hasCliFlag("--no-push") || hasCliFlag("--no-commit") ? false : void 0,
138
144
  publish: hasCliFlag("--no-publish") ? false : void 0,
139
- release: hasCliFlag("--no-release") ? false : void 0,
145
+ providerRelease: hasCliFlag("--no-provider-release") ? false : void 0,
140
146
  noVerify: hasCliFlag("--no-verify") ? true : void 0,
141
147
  clean: hasCliFlag("--no-clean") ? false : void 0,
142
148
  registry: options.registry,
@@ -151,7 +157,8 @@ program.command("release").description("Complete release workflow (bump + change
151
157
  logLevel: program.opts().logLevel,
152
158
  force: options.force,
153
159
  yes: options.yes,
154
- configName: program.opts().config
160
+ configName: program.opts().config,
161
+ safetyCheck: hasCliFlag("--no-safety-check") ? false : void 0
155
162
  });
156
163
  } catch {
157
164
  process.exit(1);