Skip to content

Commit 00314ca

Browse files
committed
Published using @Stream44 Studio
Signed-off-by: Christoph <christoph@christoph.diy>
1 parent 8231c9a commit 00314ca

6 files changed

Lines changed: 77 additions & 53 deletions

File tree

caps/WorkspaceConfig.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
$schema: ../../../../../../../.~o/workspace.foundation/@t44.sh~t44~caps~JsonSchemas/@t44.sh~t44~structs~WorkspaceConfigFile.json
22
extends:
33
- ./WorkspaceShell.yaml
4-
'#t44/structs/WorkspaceCliConfig':
4+
"#t44/structs/WorkspaceCliConfig":
55
javascript:
66
api:
77
workspaceDir: resolve('${__dirname}/..')
88
cli:
99
commands:
1010
init:
11-
capsule: 't44/caps/WorkspaceInit'
11+
capsule: "t44/caps/WorkspaceInit"
1212
description: Initialize a new Terminal 44 workspace.
1313
activate:
14-
capsule: 't44/caps/WorkspaceShell'
14+
capsule: "t44/caps/WorkspaceShell"
1515
description: Generate environment variables for sourcing into shells.
1616
info:
17-
capsule: 't44/caps/WorkspaceInfo'
17+
capsule: "t44/caps/WorkspaceInfo"
1818
description: Display information about the workspace.
1919
options:
2020
full:
2121
description: Show full details instead of compact view
2222
query:
23-
capsule: 't44/caps/WorkspaceModel'
23+
capsule: "t44/caps/WorkspaceModel"
2424
description: Query the workspace model.
2525
arguments:
2626
entitySelector:
@@ -30,14 +30,14 @@ extends:
3030
full:
3131
description: Show full details instead of compact view
3232
dev:
33-
capsule: 't44/caps/ProjectDevelopment'
33+
capsule: "t44/caps/ProjectDevelopment"
3434
description: Run a project or package dev server.
3535
arguments:
3636
projectSelector:
3737
optional: true
3838
description: Name of a project or package to run the dev script for.
3939
push:
40-
capsule: 't44/caps/ProjectPublishing'
40+
capsule: "t44/caps/ProjectPublishing"
4141
description: Publish local committed code to a remote service.
4242
arguments:
4343
projectSelector:
@@ -66,7 +66,7 @@ extends:
6666
yes-signoff:
6767
description: Automatically agree to DCO sign-off without prompting.
6868
deploy:
69-
capsule: 't44/caps/ProjectDeployment'
69+
capsule: "t44/caps/ProjectDeployment"
7070
description: Deploy a project to a provider.
7171
arguments:
7272
projectSelector:
@@ -75,5 +75,5 @@ extends:
7575
options:
7676
deprovision:
7777
description: Delete the project from the provider instead of deploying it
78-
createdAt: '2026-02-11T01:01:49.797Z'
79-
updatedAt: '2026-02-11T01:01:49.797Z'
78+
createdAt: "2026-02-11T01:01:49.797Z"
79+
updatedAt: "2026-02-11T01:01:49.797Z"

caps/WorkspaceConfigFile.ts

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@ export async function capsule({
7676

7777
const wrapped = yaml.dump(output, {
7878
indent: 2,
79-
lineWidth: -1,
79+
lineWidth: 200,
8080
noRefs: true,
81-
sortKeys: false
81+
sortKeys: false,
82+
quotingType: '"',
83+
forceQuotes: false
8284
})
8385
await writeFile(absolutePath, wrapped)
8486
}
@@ -112,9 +114,11 @@ export async function capsule({
112114
// Write as YAML with schema wrapper
113115
const content = yaml.dump(output, {
114116
indent: 2,
115-
lineWidth: -1,
117+
lineWidth: 200,
116118
noRefs: true,
117-
sortKeys: false
119+
sortKeys: false,
120+
quotingType: '"',
121+
forceQuotes: false
118122
})
119123
await writeFile(absolutePath, content)
120124
}
@@ -407,9 +411,11 @@ async function loadConfigWithExtends(configPath: string, workspaceRootDir: strin
407411

408412
const wrapped = yaml.dump(output, {
409413
indent: 2,
410-
lineWidth: -1,
414+
lineWidth: 200,
411415
noRefs: true,
412-
sortKeys: false
416+
sortKeys: false,
417+
quotingType: '"',
418+
forceQuotes: false
413419
})
414420
await writeFile(absolutePath, wrapped)
415421
rawContent = wrapped
@@ -427,9 +433,11 @@ async function loadConfigWithExtends(configPath: string, workspaceRootDir: strin
427433

428434
const wrapped = yaml.dump(output, {
429435
indent: 2,
430-
lineWidth: -1,
436+
lineWidth: 200,
431437
noRefs: true,
432-
sortKeys: false
438+
sortKeys: false,
439+
quotingType: '"',
440+
forceQuotes: false
433441
})
434442
await writeFile(absolutePath, wrapped)
435443
needsRewrite = false
@@ -440,9 +448,11 @@ async function loadConfigWithExtends(configPath: string, workspaceRootDir: strin
440448
if (needsRewrite && isWrapped) {
441449
const rewritten = yaml.dump(rawParsed, {
442450
indent: 2,
443-
lineWidth: -1,
451+
lineWidth: 200,
444452
noRefs: true,
445-
sortKeys: false
453+
sortKeys: false,
454+
quotingType: '"',
455+
forceQuotes: false
446456
})
447457
await writeFile(absolutePath, rewritten)
448458
rawContent = rewritten

caps/WorkspaceShell.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
$schema: ../../../../../../../.~o/workspace.foundation/@t44.sh~t44~caps~JsonSchemas/@t44.sh~t44~structs~WorkspaceConfigFile.json
2-
'#t44/structs/WorkspaceShellConfig':
2+
"#t44/structs/WorkspaceShellConfig":
33
env:
44
default: null
55
force:
66
F_WORKSPACE_DIR: resolve('${__dirname}/..')
77
shell:
88
commands:
9-
'44':
9+
"44":
1010
description: Run workspace CLI commands.
1111
cmd: |
1212
"${F_WORKSPACE_IMPL_DIR}/bin/t44" $@
@@ -60,5 +60,5 @@ $schema: ../../../../../../../.~o/workspace.foundation/@t44.sh~t44~caps~JsonSche
6060
cliCommand: dev
6161
deploy:
6262
cliCommand: deploy
63-
createdAt: '2026-02-11T01:01:49.799Z'
64-
updatedAt: '2026-02-11T01:01:49.799Z'
63+
createdAt: "2026-02-11T01:01:49.799Z"
64+
updatedAt: "2026-02-11T01:01:49.799Z"

caps/patterns/git-scm.com/ProjectPublishing.ts

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -236,25 +236,7 @@ export async function capsule({
236236
return
237237
}
238238

239-
// Check if tag already exists locally
240-
const localTag = await this.ProjectRepository.hasTag({ rootDir: stageDir, tag })
241-
if (localTag.exists) {
242-
if (localTag.commit === headCommit) {
243-
console.log(chalk.gray(` ○ Tag ${tag} already exists at current commit, skipping\n`))
244-
return
245-
}
246-
console.log(chalk.yellow(`\n Tag ${tag} exists at ${localTag.commit!.slice(0, 8)} but HEAD is ${headCommit.slice(0, 8)}\n`))
247-
const diffText = await this.ProjectRepository.diff({ rootDir: stageDir, from: tag })
248-
if (diffText.length > 0) {
249-
console.log(diffText)
250-
}
251-
throw new Error(
252-
`Git tag '${tag}' already exists but points to a different commit.\n` +
253-
` Please bump to a different version before pushing.`
254-
)
255-
}
256-
257-
// Check if tag already exists on remote
239+
// Check if tag already exists on remote first
258240
const remoteTag = await this.ProjectRepository.hasRemoteTag({ rootDir: stageDir, tag })
259241
if (remoteTag.exists) {
260242
if (remoteTag.commit === headCommit) {
@@ -272,6 +254,19 @@ export async function capsule({
272254
)
273255
}
274256

257+
// Check if tag already exists locally
258+
const localTag = await this.ProjectRepository.hasTag({ rootDir: stageDir, tag })
259+
if (localTag.exists) {
260+
if (localTag.commit === headCommit) {
261+
console.log(chalk.gray(` ○ Tag ${tag} already exists at current commit, skipping\n`))
262+
return
263+
}
264+
// Local tag points to a different commit but tag is NOT on remote —
265+
// this is a stale tag from a previous failed run. Delete and re-tag.
266+
console.log(chalk.yellow(` ⟳ Local tag ${tag} is stale (at ${localTag.commit!.slice(0, 8)}, HEAD is ${headCommit.slice(0, 8)}) — re-tagging`))
267+
await $`git tag -d ${tag}`.cwd(stageDir).quiet()
268+
}
269+
275270
await this.ProjectRepository.tag({ rootDir: stageDir, tag })
276271
console.log(chalk.green(` ✓ Tagged with ${tag}\n`))
277272
}

caps/patterns/semver.org/ProjectPublishing.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,26 @@ export async function capsule({
159159
const updatedContent = JSON.stringify(packageJson, null, indent) + '\n'
160160
await writeFile(packageJsonPath, updatedContent, 'utf-8')
161161

162-
console.log(chalk.green(` ✓ Updated ${packageJsonPath} to version ${newVersion}\n`))
162+
// Write bumped version back to the original source package.json
163+
// so that if this run fails partway through, the next run starts
164+
// from the already-bumped version instead of producing a duplicate tag.
165+
const originalSourceDir = ctx.repoConfig?.sourceDir
166+
if (originalSourceDir) {
167+
const originalPackageJsonPath = join(originalSourceDir, 'package.json')
168+
try {
169+
const originalContent = await readFile(originalPackageJsonPath, 'utf-8')
170+
const originalJson = JSON.parse(originalContent)
171+
originalJson.version = newVersion
172+
const originalIndent = detectIndent(originalContent)
173+
await writeFile(originalPackageJsonPath, JSON.stringify(originalJson, null, originalIndent) + '\n', 'utf-8')
174+
console.log(chalk.green(` ✓ Updated ${packageJsonPath} to version ${newVersion}`))
175+
console.log(chalk.green(` ✓ Written back version ${newVersion} to source ${originalPackageJsonPath}\n`))
176+
} catch {
177+
console.log(chalk.green(` ✓ Updated ${packageJsonPath} to version ${newVersion}\n`))
178+
}
179+
} else {
180+
console.log(chalk.green(` ✓ Updated ${packageJsonPath} to version ${newVersion}\n`))
181+
}
163182

164183
ctx.metadata.bumped = true
165184
ctx.metadata.newVersion = newVersion

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "t44",
3-
"version": "0.4.0-rc.17",
3+
"version": "0.4.0-rc.19",
44
"license": "LGPL",
55
"repository": {
66
"type": "git",
@@ -71,14 +71,14 @@
7171
"@ucanto/principal": "^9.0.3",
7272
"@ucanto/server": "^11.0.3",
7373
"json-schema-ref-resolver": "^3.0.0",
74-
"@stream44.studio/t44-bunny.net": "^0.1.0-rc.1",
75-
"@stream44.studio/t44-vercel.com": "^0.1.0-rc.1",
76-
"@stream44.studio/t44-github.com": "^0.1.0-rc.1",
77-
"@stream44.studio/t44-dynadot.com": "^0.1.0-rc.1",
78-
"@stream44.studio/t44-npmjs.com": "^0.1.0-rc.1",
79-
"@stream44.studio/encapsulate": "^0.4.0-rc.19",
80-
"@stream44.studio/dco": "^0.3.0-rc.22",
81-
"@stream44.studio/t44-blockchaincommons.com": "^0.1.0-rc.17"
74+
"@stream44.studio/t44-bunny.net": "^0.1.0-rc.3",
75+
"@stream44.studio/t44-vercel.com": "^0.1.0-rc.3",
76+
"@stream44.studio/t44-github.com": "^0.1.0-rc.3",
77+
"@stream44.studio/t44-dynadot.com": "^0.1.0-rc.3",
78+
"@stream44.studio/t44-npmjs.com": "^0.1.0-rc.3",
79+
"@stream44.studio/encapsulate": "^0.4.0-rc.21",
80+
"@stream44.studio/dco": "^0.3.0-rc.24",
81+
"@stream44.studio/t44-blockchaincommons.com": "^0.1.0-rc.19"
8282
},
8383
"devDependencies": {
8484
"@types/bun": "^1.3.4",

0 commit comments

Comments
 (0)