@xrystal/core 3.55.3 → 3.55.4

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
@@ -258,7 +258,7 @@ bun run dev
258
258
  | `xry create <name> --workspace` | Outer `./tmp.yml` + **api/general** + admin/web | Dış tmp + api/general |
259
259
  | `xry tmp` | Inner `x/tmp.yml` or outer workspace tmp; **`end.version` = schema (1)** | tmp.yml · şema sürümü |
260
260
  | `xry sync` | Inner tsconfig + pin `@xrystal/core` + registry (workspace mode) | tsconfig + core pin |
261
- | `xry tp connect` / `xry tp dev <deploy>` | Telepresence cluster connect / local intercept | Telepresence bağlan / local intercept |
261
+ | `xry tp connect --ns dev` / `xry tp intercept <deploy> --ns dev` | Telepresence connect / local intercept (`dev` = alias, not namespace) | Telepresence bağlan / local intercept |
262
262
  | `xry workspaces` | List `~/.xrystal` workspaces + linked projects | Kayıtlı workspace listesi |
263
263
  | `xry dev` | Watch `source/index.ts` + dev env | `source/index.ts` watch + dev env |
264
264
  | `xry build` | `tsc` full tree → dist (auto default) + alias/fix post-steps | `tsc` ile tüm `source/` → dist |
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.3",
4
+ "version": "3.55.4",
5
5
  "description": "Runtime framework and CLI for API services, frontends, and multi-repo workspaces",
6
6
  "publishConfig": {
7
7
  "access": "public",
@@ -84,7 +84,7 @@ export function registerCreateCommand(cli, { cliName = CLI_PRIMARY_NAME, runtime
84
84
  console.log(chalk.gray(' registered in ~/.xrystal'))
85
85
  } catch {}
86
86
  console.log(chalk.cyan(` ${cliName} sync --all`))
87
- console.log(chalk.cyan(` ${cliName} telepresence dev general`))
87
+ console.log(chalk.cyan(` ${cliName} tp intercept general --ns dev`))
88
88
  printCommandFooter({ version })
89
89
  } catch (error) {
90
90
  console.error(chalk.red(`\n✗ ${error.message}\n`))
@@ -9,7 +9,7 @@ import { readCliPackageJson } from '../helpers/project-root.mjs'
9
9
  export function registerGuideCommand(cli, { cliName = CLI_PRIMARY_NAME } = {}) {
10
10
  cli
11
11
  .command('guide')
12
- .description('Scope guide — standalone vs workspace commands (en | tr via --lang / XRY_LANG)')
12
+ .description('Scope guide — standalone vs workspace commands (en | tr via xry config lang)')
13
13
  .option('--lang <code>', 'CLI language: en | tr')
14
14
  .action(() => {
15
15
  const version = readCliPackageJson().version
@@ -1,4 +1,5 @@
1
1
  import { execSync } from 'node:child_process'
2
+ import path from 'node:path'
2
3
  import chalk from 'chalk'
3
4
 
4
5
  import { printCommandFooter, printCommandHeader } from '../helpers/banner.mjs'
@@ -29,29 +30,35 @@ function requireInfraScript(name) {
29
30
  return script
30
31
  }
31
32
 
33
+ function parsePort(value) {
34
+ return value && /^\d+$/.test(String(value)) ? String(value) : '3000'
35
+ }
36
+
32
37
  export function registerTelepresenceCommand(cli, { cliName = CLI_PRIMARY_NAME } = {}) {
33
38
  const tp = cli
34
39
  .command('telepresence')
35
40
  .alias('tp')
36
- .description('Local Telepresence intercept against cluster (dev/test)')
41
+ .description('Local Telepresence intercept against cluster (dev/test namespaces)')
37
42
  .addHelpText(
38
43
  'after',
39
44
  `
40
45
  ${chalk.gray('Examples:')}
41
- ${cliName} telepresence connect
42
- ${cliName} tp dev general
43
- ${cliName} tp dev gateway 3000
46
+ ${cliName} tp connect --ns dev
47
+ ${cliName} tp intercept general --ns dev
48
+ ${cliName} tp dev gateway 3000 --ns test
44
49
  ${cliName} telepresence quit
45
50
  ${cliName} tp install
46
51
 
47
- ${chalk.gray('Deploy names:')} ${TELEPRESENCE_DEPLOYMENTS.join(', ')}
52
+ ${chalk.gray('intercept/dev')} = local intercept + run process (NOT the k8s namespace)
53
+ ${chalk.gray('--ns')} = Kubernetes namespace (default: dev)
54
+ ${chalk.gray('<deploy>')} = ${TELEPRESENCE_DEPLOYMENTS.join(', ')}
48
55
  ${chalk.gray('Infra scripts:')} XRYSTAL_INFRA_DIR ${chalk.gray('or sibling')} ../-infrastructure-
49
56
  `,
50
57
  )
51
58
 
52
59
  tp
53
60
  .command('connect')
54
- .description('Connect local machine to cluster namespace (default NS=dev)')
61
+ .description('Connect local machine to cluster namespace')
55
62
  .option('--ns <namespace>', 'Kubernetes namespace', 'dev')
56
63
  .action((options) => {
57
64
  const version = readCliPackageJson().version
@@ -84,20 +91,27 @@ export function registerTelepresenceCommand(cli, { cliName = CLI_PRIMARY_NAME }
84
91
  printCommandFooter({ version })
85
92
  })
86
93
 
87
- tp
88
- .command('dev <deploy> [port]')
89
- .description('Intercept cluster deployment and run local dev server')
94
+ const intercept = tp
95
+ .command('intercept')
96
+ .alias('dev')
97
+ .description('Intercept cluster deployment and run local process (--ns = k8s namespace, not this subcommand name)')
98
+ .argument('<deploy>', `Deployment name (${TELEPRESENCE_DEPLOYMENTS.join(', ')})`)
99
+ .argument('[port]', 'Local listen port', '3000')
100
+ .option('--ns <namespace>', 'Kubernetes namespace', 'dev')
90
101
  .allowUnknownOption()
91
- .action((deploy, port, _options, command) => {
102
+ .allowExcessArguments()
103
+ .action((deploy, port, options, command) => {
92
104
  const version = readCliPackageJson().version
93
105
  const deployName = String(deploy ?? '').trim()
106
+ const ns = String(options.ns ?? 'dev').trim() || 'dev'
107
+
94
108
  if (!TELEPRESENCE_DEPLOYMENTS.includes(deployName)) {
95
109
  console.error(chalk.red(`\n✗ Unknown deploy "${deployName}"\n`))
96
110
  console.error(chalk.gray(` Use: ${TELEPRESENCE_DEPLOYMENTS.join(', ')}\n`))
97
111
  process.exit(1)
98
112
  }
99
113
 
100
- printCommandHeader({ cliName, command: `telepresence dev ${deployName}`, version })
114
+ printCommandHeader({ cliName, command: `telepresence intercept ${deployName}`, version })
101
115
 
102
116
  const workspaceRoot = findWorkspaceRoot(process.cwd())
103
117
  let svcDir = resolveTelepresenceServiceDir(workspaceRoot ?? process.cwd(), deployName)
@@ -110,20 +124,22 @@ export function registerTelepresenceCommand(cli, { cliName = CLI_PRIMARY_NAME }
110
124
 
111
125
  const env = ensureServiceTelepresenceEnv(svcDir)
112
126
  process.env.TELEPRESENCE_ENV_FILE = env.envRel
113
- process.env.NS = process.env.NS ?? 'dev'
127
+ process.env.NS = ns
114
128
  if (workspaceRoot) process.env.XRYSTAL_WORKSPACE = workspaceRoot
115
129
 
130
+ console.log(chalk.gray(` deploy: ${deployName}`))
131
+ console.log(chalk.gray(` ns: ${ns}`))
116
132
  console.log(chalk.gray(` service: ${svcDir}`))
117
133
  console.log(chalk.gray(` env: ${env.envRel}${env.created ? chalk.green(' (created)') : ''}\n`))
118
134
 
119
- const intercept = requireInfraScript('telepresence-intercept.sh')
135
+ const interceptScript = requireInfraScript('telepresence-intercept.sh')
120
136
 
121
- const portArg = port && /^\d+$/.test(String(port)) ? String(port) : '3000'
122
- const rest = command.args.slice(port && /^\d+$/.test(String(port)) ? 2 : 1)
137
+ const portArg = parsePort(port)
138
+ const rest = command.args.slice(/^\d+$/.test(String(port ?? '')) ? 2 : 1)
123
139
  const localCmd = rest.length ? rest : ['bun', 'run', 'dev']
124
- const args = [deployName, portArg, '--', ...localCmd]
140
+ const args = [`NS=${ns}`, deployName, portArg, '--', ...localCmd]
125
141
 
126
- runHelper(intercept, args, { cwd: svcDir })
142
+ runHelper(interceptScript, args, { cwd: svcDir })
127
143
  printCommandFooter({ version })
128
144
  })
129
145
  }
@@ -19,7 +19,7 @@ function quickCommands() {
19
19
  { cmd: 'create <name> --workspace', desc: t('quick.createWs') },
20
20
  { cmd: 'workspaces', desc: t('quick.workspaces') },
21
21
  { cmd: 'watch status', desc: t('quick.watch') },
22
- { cmd: 'tp connect / tp dev <deploy>', desc: t('quick.tp') },
22
+ { cmd: 'tp connect / tp intercept <deploy> --ns dev', desc: t('quick.tp') },
23
23
  { cmd: 'dev / build / doctor', desc: t('quick.dev') },
24
24
  ]
25
25
  }
@@ -51,8 +51,8 @@ function commandGroups() {
51
51
  { cmd: 'sync --all', desc: t('quick.syncAll') },
52
52
  { cmd: 'workspaces [list|sync]', desc: t('quick.workspaces') },
53
53
  { cmd: 'watch install', desc: 'OS service — survives reboot (launchd / systemd user)' },
54
- { cmd: 'telepresence dev <deploy>', aliases: 'tp dev', desc: 'Intercept cluster pod → local dev' },
55
- { cmd: 'telepresence connect', aliases: 'tp connect', desc: 'Connect Telepresence to dev/test namespace' },
54
+ { cmd: 'telepresence intercept <deploy> --ns dev', aliases: 'tp dev', desc: 'Intercept cluster pod → local process (dev = alias, --ns = namespace)' },
55
+ { cmd: 'telepresence connect --ns dev', aliases: 'tp connect', desc: 'Connect Telepresence to cluster namespace' },
56
56
  { cmd: 'telepresence install', aliases: 'tp install', desc: 'Install Telepresence OSS client (~2.31.x)' },
57
57
  ],
58
58
  },
@@ -132,7 +132,7 @@ export function printQuickStartGuide({ cliName = CLI_PRIMARY_NAME } = {}) {
132
132
  console.log(` ${chalk.dim('tip')} ${chalk.bold.white(`${cliName} guide`)} ${chalk.gray(`· ${t('tips.guide')}`)}`)
133
133
  console.log(` ${chalk.dim('tip')} ${chalk.bold.white(`${cliName} -h`)} ${chalk.gray(`· ${t('tips.help')}`)}`)
134
134
  console.log(` ${chalk.dim('tip')} ${chalk.bold.white(`${cliName} doctor`)} ${chalk.gray(`· ${t('tips.doctor')}`)}`)
135
- console.log(` ${chalk.dim('tip')} ${chalk.bold.white(`${cliName} tp dev general`)} ${chalk.gray(`· ${t('tips.tp')}`)}`)
135
+ console.log(` ${chalk.dim('tip')} ${chalk.bold.white(`${cliName} tp intercept general --ns dev`)} ${chalk.gray(`· ${t('tips.tp')}`)}`)
136
136
  console.log(` ${chalk.dim('tip')} ${chalk.gray(t('langTip'))}`)
137
137
  console.log('')
138
138
  }
@@ -48,7 +48,7 @@ const MESSAGES = {
48
48
  createWs: 'Outer tmp + api/general + web/mobile slots',
49
49
  workspaces: 'Global registry ~/.xrystal (not repo tmp.yml)',
50
50
  watch: 'Background tmp watcher for registered workspaces',
51
- tp: 'Telepresence: tp connect · tp dev <deploy> · tp install',
51
+ tp: 'Telepresence: tp connect --ns dev · tp intercept general · tp install',
52
52
  dev: 'Develop & diagnostics',
53
53
  guide: 'Scope guide — standalone vs workspace commands',
54
54
  },
@@ -110,7 +110,7 @@ const MESSAGES = {
110
110
  createWs: 'Dış tmp + api/general + web/mobile slotları',
111
111
  workspaces: 'Global registry ~/.xrystal (repo tmp değil)',
112
112
  watch: 'Kayıtlı workspace tmp izleyici (~/.xrystal)',
113
- tp: 'Telepresence: tp connect · tp dev <deploy> · tp install',
113
+ tp: 'Telepresence: tp connect --ns dev · tp intercept general · tp install',
114
114
  dev: 'Geliştir & teşhis',
115
115
  guide: 'Kapsam rehberi — standalone vs workspace',
116
116
  },
@@ -188,7 +188,7 @@ export function formatScopeGuide({ cliName = 'xry' } = {}) {
188
188
  ['create <name>', t('yes'), t('yes'), t('yes')],
189
189
  ['workspaces', '—', t('yes'), t('yes')],
190
190
  ['watch install', '—', t('yes'), '—'],
191
- ['tp connect / dev', t('yes'), t('yes'), t('yes')],
191
+ ['tp connect / intercept', t('yes'), t('yes'), t('yes')],
192
192
  ]
193
193
 
194
194
  const matrix = rows.map(([cmd, st, root, inner]) =>
@@ -8,7 +8,7 @@ TELEPRESENCE_INTERCEPT_HEADER=x-intercept-who
8
8
  # TELEPRESENCE_DEV_ID=your-id
9
9
  `
10
10
 
11
- const SERVICE_TELEPRESENCE_ENV = `# Auto-scaffolded for local intercept (xry telepresence dev)
11
+ const SERVICE_TELEPRESENCE_ENV = `# Auto-scaffolded for local intercept (xry tp intercept --ns dev)
12
12
  NS=dev
13
13
  NODE_ENV=dev
14
14
  TELEPRESENCE_INTERCEPT_HEADER=x-intercept-who