@xrystal/core 3.55.87 → 3.55.88

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
@@ -25,7 +25,7 @@
25
25
  | **DTO & UX** | `@xrystal/dto`, i18n, request trace, logging | DTO, i18n, trace, log |
26
26
  | **Data (optional)** | Redis, MongoDB, Kafka loaders | İsteğe bağlı Redis / Mongo / Kafka |
27
27
  | **Realtime** | WebSocket / Socket.IO on the same pattern as HTTP | HTTP ile aynı kalıpta ws / Socket.IO |
28
- | **CLI** | `xry dev`, `build`, `start`, `test`, `create`, `version`, `tag` | Geliştirme, build, scaffold, sürüm |
28
+ | **CLI** | `xry dev`, `build`, `start`, `test`, `create`, `version`, `version release` | Geliştirme, build, scaffold, sürüm |
29
29
 
30
30
  ---
31
31
 
@@ -55,9 +55,9 @@ npm install @xrystal/core
55
55
 
56
56
  ## Release (npm) / Yayın (npm)
57
57
 
58
- **EN:** Ship with `xry tag` (SemVer `v*` git tag). GitHub Actions `publish.yml` builds and publishes to npm using [Trusted Publishers](https://docs.npmjs.com/trusted-publishers) (OIDC). Housekeeping: `artifact.yml` (zip backups) and `clean.yml` (scheduled release pruning).
58
+ **EN:** Bump with `xry version patch` (etc.), commit, then ship with `xry version release` (aliases: `xry release`, `xry tag`). That runs full gates + SemVer `v*` push; GitHub Actions `publish.yml` publishes to npm with `--tag latest` via [Trusted Publishers](https://docs.npmjs.com/trusted-publishers) (OIDC). Housekeeping: `artifact.yml` (zip backups) and `clean.yml` (scheduled release pruning).
59
59
 
60
- **TR:** `xry tag` ile SemVer `v*` git tag gönder. `publish.yml` npm’e [Trusted Publisher](https://docs.npmjs.com/trusted-publishers) (OIDC) ile yazar. Bakım: `artifact.yml` (zip yedek), `clean.yml` (release temizliği).
60
+ **TR:** `xry version patch` ile bump, commit, sonra `xry version release` ile yayınla (`xry release` / `xry tag` alias). Tam kapı + SemVer `v*` push; `publish.yml` npm’e `--tag latest` ve [Trusted Publisher](https://docs.npmjs.com/trusted-publishers) (OIDC) ile yazar. Bakım: `artifact.yml` (zip yedek), `clean.yml` (release temizliği).
61
61
 
62
62
  ## Further reading / Ek kaynak
63
63
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Yusuf Yasir KAYGUSUZ",
3
3
  "name": "@xrystal/core",
4
- "version": "3.55.87",
4
+ "version": "3.55.88",
5
5
  "description": "Runtime framework and CLI for API services, frontends, and multi-repo workspaces",
6
6
  "publishConfig": {
7
7
  "access": "public",
@@ -83,6 +83,7 @@
83
83
  "build:prod": "bun run release:prepare && node x/bin/scripts/clean-source-types.mjs",
84
84
  "build:dev": "node x/bin/main-cli.js dev",
85
85
  "start": "node x/bin/main-cli.js start",
86
+ "release": "node x/bin/scripts/tag.mjs",
86
87
  "tag": "node x/bin/scripts/tag.mjs",
87
88
  "version:patch": "node x/bin/scripts/release-bump.mjs patch",
88
89
  "version:minor": "node x/bin/scripts/release-bump.mjs minor",
@@ -91,7 +92,7 @@
91
92
  "hooks:install": "node x/bin/scripts/install-git-hooks.mjs"
92
93
  },
93
94
  "dependencies": {
94
- "@xrystal/dto": "^26.11.14",
95
+ "@xrystal/dto": "26.11.14-p5",
95
96
  "awilix": "^12.0.5",
96
97
  "chalk": "^5.6.2",
97
98
  "commander": "^13.0.0",
@@ -100,12 +101,12 @@
100
101
  "i18next-fs-backend": "^2.6.1",
101
102
  "i18next-http-middleware": "^3.8.2",
102
103
  "kafkajs": "^2.2.4",
103
- "mongodb": "^6.20.0",
104
- "redis": "^5.8.2",
105
104
  "lodash": "^4.17.23",
105
+ "mongodb": "^6.20.0",
106
106
  "ora": "^9.0.0",
107
107
  "picocolors": "^1.1.1",
108
108
  "qs": "^6.14.1",
109
+ "redis": "^5.8.2",
109
110
  "soap": "^1.6.3",
110
111
  "winston": "^3.19.0",
111
112
  "winston-daily-rotate-file": "^5.0.0",
@@ -22,42 +22,42 @@ import path from 'node:path'
22
22
  import { packageDefaults } from '../helpers/package-defaults.mjs'
23
23
  import { CLI_PRIMARY_NAME, PACKAGE_NAME } from '../helpers/cli-identity.mjs'
24
24
 
25
- export function registerTagCommand(cli, { cliName = CLI_PRIMARY_NAME } = {}) {
26
- cli
27
- .command('tag')
28
- .description(`Git tag push (CalVer services) or git tag + npm publish (${packageDefaults.packageName} core only)`)
25
+ /** Full ship: version gates → prepare → push release tag → CI npm publish. */
26
+ async function runShipRelease({ cliName, commandLabel, options }) {
27
+ try {
28
+ const { root } = requireServiceRoot(process.cwd(), { cliName, command: commandLabel })
29
+ if (isCorePackageProject(root)) {
30
+ await runTagRelease({
31
+ dryRun: options.dryRun,
32
+ requireClean: options.strictClean,
33
+ skipPrepare: options.skipPrepare,
34
+ root,
35
+ })
36
+ } else {
37
+ const version = getVersionState('HEAD', root).committed.version
38
+ const calverEnv = detectCalverEnv(version)
39
+ if (calverEnv) {
40
+ assertCalverFormat(version, calverEnv)
41
+ } else {
42
+ assertVersionFormat(version)
43
+ }
44
+ runCalverTagPush({ root, dryRun: options.dryRun })
45
+ }
46
+ if (!options.dryRun) {
47
+ console.log(chalk.green('\n✓ Release shipped — CI publish should follow.\n'))
48
+ }
49
+ } catch (error) {
50
+ if (error?.name === 'CliContextError') exitOnCliContextError(error)
51
+ console.error(chalk.red(`\n✗ ${error.message}\n`))
52
+ process.exit(1)
53
+ }
54
+ }
55
+
56
+ function attachShipOptions(cmd) {
57
+ return cmd
29
58
  .option('--dry-run', 'Print commands without executing')
30
59
  .option('--strict-clean', 'Require fully clean working tree (default: only package.json must be committed)')
31
- .option('--skip-prepare', 'Skip lint, test, and build:prod (core only)')
32
- .action(async (options) => {
33
- try {
34
- const { root } = requireServiceRoot(process.cwd(), { cliName, command: 'tag' })
35
- if (isCorePackageProject(root)) {
36
- await runTagRelease({
37
- dryRun: options.dryRun,
38
- requireClean: options.strictClean,
39
- skipPrepare: options.skipPrepare,
40
- root,
41
- })
42
- } else {
43
- const version = getVersionState('HEAD', root).committed.version
44
- const calverEnv = detectCalverEnv(version)
45
- if (calverEnv) {
46
- assertCalverFormat(version, calverEnv)
47
- } else {
48
- assertVersionFormat(version)
49
- }
50
- runCalverTagPush({ root, dryRun: options.dryRun })
51
- }
52
- if (!options.dryRun) {
53
- console.log(chalk.green('\n✓ Tag pushed.\n'))
54
- }
55
- } catch (error) {
56
- if (error?.name === 'CliContextError') exitOnCliContextError(error)
57
- console.error(chalk.red(`\n✗ ${error.message}\n`))
58
- process.exit(1)
59
- }
60
- })
60
+ .option('--skip-prepare', 'Skip lint, test, and build (core only)')
61
61
  }
62
62
 
63
63
  function writePackageVersion(root, version) {
@@ -87,7 +87,7 @@ function runVersionBump({ cliName, level, dryRun }) {
87
87
  }
88
88
  writePackageVersion(root, next)
89
89
  console.log(chalk.green(`package.json → ${next}`))
90
- console.log(chalk.gray('Commit package.json, then: xry tag'))
90
+ console.log(chalk.gray(`Commit package.json, then: ${cliName} version release`))
91
91
  } catch (error) {
92
92
  if (error?.name === 'CliContextError') exitOnCliContextError(error)
93
93
  console.error(chalk.red(`\n✗ ${error.message}\n`))
@@ -109,10 +109,43 @@ function registerVersionBumpSubcommands(versionCmd, { cliName = CLI_PRIMARY_NAME
109
109
  }
110
110
  }
111
111
 
112
+ function registerVersionReleaseSubcommand(versionCmd, { cliName = CLI_PRIMARY_NAME } = {}) {
113
+ attachShipOptions(
114
+ versionCmd
115
+ .command('release')
116
+ .description(
117
+ `Full release: validate package.json, prepare, ship v* / CalVer (CI npm publish for ${packageDefaults.packageName})`,
118
+ ),
119
+ ).action(async (options) => {
120
+ await runShipRelease({ cliName, commandLabel: 'version release', options })
121
+ })
122
+ }
123
+
124
+ /** Quiet top-level aliases of `version release`. */
125
+ export function registerReleaseAliases(cli, { cliName = CLI_PRIMARY_NAME } = {}) {
126
+ const shipDesc = `Alias of ${cliName} version release — full ship (validate, prepare, push, CI publish)`
127
+
128
+ attachShipOptions(cli.command('release').description(shipDesc)).action(async (options) => {
129
+ await runShipRelease({ cliName, commandLabel: 'release', options })
130
+ })
131
+
132
+ attachShipOptions(cli.command('tag').description(shipDesc)).action(async (options) => {
133
+ await runShipRelease({ cliName, commandLabel: 'tag', options })
134
+ })
135
+ }
136
+
137
+ /** @deprecated Use registerReleaseAliases — kept for import compatibility. */
138
+ export function registerTagCommand(cli, opts) {
139
+ registerReleaseAliases(cli, opts)
140
+ }
141
+
112
142
  export function registerVersionCommand(cli, { cliName = CLI_PRIMARY_NAME } = {}) {
113
- const version = cli.command('version').description('Project version: show or bump package.json')
143
+ const version = cli
144
+ .command('version')
145
+ .description('Bump package.json (patch|minor|major) or full ship (version release)')
114
146
 
115
147
  registerVersionBumpSubcommands(version, { cliName })
148
+ registerVersionReleaseSubcommand(version, { cliName })
116
149
 
117
150
  version
118
151
  .command('show', { isDefault: true })
@@ -135,13 +168,13 @@ export function registerVersionCommand(cli, { cliName = CLI_PRIMARY_NAME } = {})
135
168
  console.log(` package.json (HEAD): ${chalk.bold(state.committed.version)}`)
136
169
  const isCore = isCorePackageProject(root)
137
170
  if (isCore) {
138
- console.log(` git tag name: ${chalk.bold(`v${state.committed.version}`)}`)
171
+ console.log(` release tag: ${chalk.bold(`v${state.committed.version}`)}`)
139
172
  } else {
140
173
  const cv = detectCalverEnv(state.committed.version)
141
174
  const tagLine = cv
142
175
  ? chalk.bold(gitTagFromCalver(state.committed.version))
143
- : chalk.gray('set CalVer in package.json, then xry tag')
144
- console.log(` git / image tag: ${tagLine}`)
176
+ : chalk.gray(`set CalVer in package.json, then ${cliName} version release`)
177
+ console.log(` release tag: ${tagLine}`)
145
178
  }
146
179
  console.log(` branch: ${state.branch}`)
147
180
  console.log(` version match: ${state.versionMatch ? chalk.green('yes') : chalk.red('no')}`)
@@ -82,9 +82,13 @@ function commandGroups() {
82
82
  {
83
83
  title: t('sections.release'),
84
84
  items: [
85
- { cmd: 'version patch', desc: 'Bump package.json — core SemVer · service CalVer pN' },
86
- { cmd: 'version minor|major', desc: '@xrystal/core SemVer only' },
87
- { cmd: 'tag', desc: 'Core npm publish · service v<CalVer> git tag' },
85
+ { cmd: 'version patch', desc: 'Bump package.json only — core SemVer · service CalVer pN' },
86
+ { cmd: 'version minor|major', desc: 'Bump only — @xrystal/core SemVer' },
87
+ {
88
+ cmd: 'version release',
89
+ aliases: 'release · tag',
90
+ desc: 'Full ship — validate, prepare, push v*/CalVer, CI npm publish',
91
+ },
88
92
  ],
89
93
  },
90
94
  ]
@@ -61,7 +61,7 @@ export function resolveProjectContext(startDir = process.cwd()) {
61
61
  selfMismatch: null,
62
62
  schemaVersionExpected: TMP_SCHEMA_VERSION,
63
63
  hints: [
64
- 'Global runtime library — publish via xry tag',
64
+ 'Global runtime library — ship via xry version release',
65
65
  'tmp global.type: core-library (not workspace / not api-service)',
66
66
  'Consumers: bun add @xrystal/core && xry tmp in their repo',
67
67
  ],
package/x/bin/main-cli.js CHANGED
@@ -10,7 +10,7 @@ import { registerProjectCommands } from './commands/project.mjs'
10
10
  import { registerTmpCommand } from './commands/tmp.mjs'
11
11
  import { registerSyncCommand } from './commands/sync.mjs'
12
12
  import { registerProjectsCommand, registerWorkspacesCommand } from './commands/projects.mjs'
13
- import { registerTagCommand, registerVersionCommand } from './commands/release.mjs'
13
+ import { registerReleaseAliases, registerVersionCommand } from './commands/release.mjs'
14
14
  import { registerTelepresenceCommand } from './commands/telepresence.mjs'
15
15
  import { registerHooksCommand } from './commands/hooks.mjs'
16
16
  import { registerWatchCommand } from './commands/watch.mjs'
@@ -83,7 +83,7 @@ cli
83
83
 
84
84
  registerCreateCommand(cli, cliContext)
85
85
  registerVersionCommand(cli, cliContext)
86
- registerTagCommand(cli, cliContext)
86
+ registerReleaseAliases(cli, cliContext)
87
87
  registerDoctorCommand(cli, cliContext)
88
88
  registerTmpCommand(cli, cliContext)
89
89
  registerProjectInfoCommand(cli, cliContext)
@@ -45,8 +45,8 @@ export function bumpSemverLevel(version, level) {
45
45
  function printCoreNextSteps(version) {
46
46
  console.log(chalk.gray('\nNext (core / npm):'))
47
47
  console.log(` git add package.json && git commit -m "Bump library version"`)
48
- console.log(` bun run tag`)
49
- console.log(chalk.dim(` git tag will be v${version} after commit\n`))
48
+ console.log(` bun run release`)
49
+ console.log(chalk.dim(` or: xry version release → ships v${version}\n`))
50
50
  }
51
51
 
52
52
  function printServiceNextSteps(version) {
@@ -54,8 +54,8 @@ function printServiceNextSteps(version) {
54
54
  console.log(chalk.gray('\nNext (service / GHCR):'))
55
55
  console.log(` git add package.json && git commit -m "Bump image version"`)
56
56
  console.log(` git push origin <branch>`)
57
- console.log(` bun run tag`)
58
- console.log(chalk.dim(` pushes ${tag} → CI\n`))
57
+ console.log(` bun run release`)
58
+ console.log(chalk.dim(` or: xry version release → pushes ${tag} → CI\n`))
59
59
  }
60
60
 
61
61
  async function main() {
@@ -56,6 +56,6 @@ export function runReleasePrepare({ root = resolveProjectRoot(), dryRun = false,
56
56
  run(step.cmd, { inherit: true, root })
57
57
  }
58
58
 
59
- console.log('\n✓ Ready to tag. GitHub Actions will build and publish on tag push.\n')
59
+ console.log('\n✓ Ready to release. Pushing the release tag will trigger GitHub Actions npm publish.\n')
60
60
  return { skipped: false }
61
61
  }
@@ -9,7 +9,11 @@ const skipPrepare = process.argv.includes('--skip-prepare')
9
9
  try {
10
10
  const state = await runTagRelease({ dryRun, skipPrepare })
11
11
  if (!dryRun) {
12
- console.log(chalk.green(`\n✓ Tag ${state.tag.tagName} pushed — GitHub Publish workflow should trigger.\n`))
12
+ console.log(
13
+ chalk.green(
14
+ `\n✓ Release ${state.tag.tagName} shipped — GitHub Publish workflow should trigger.\n`,
15
+ ),
16
+ )
13
17
  }
14
18
  } catch (error) {
15
19
  console.error(chalk.red(`\n✗ ${error.message}\n`))
@@ -365,7 +365,7 @@ export function assertReadyToTag({ requireClean = false, root = getProjectRoot()
365
365
 
366
366
  if (!state.isPackageJsonClean) {
367
367
  throw new Error(
368
- `package.json has uncommitted changes:\n${state.packageJsonDirty}\n\nCommit the version bump first, then run tag again.`
368
+ `package.json has uncommitted changes:\n${state.packageJsonDirty}\n\nCommit the version bump first, then run version release again.`
369
369
  )
370
370
  }
371
371