editableCodebase
uses tcmts.share.servedCodebase, which uses process
The codebase, for changing it from the studio: only the studio's maintainer does, and only on the codebase's own branch (another branch, as the branch menu reads it, is only read).
import type { Codebase } from "#codebase/tcmts/cli/codebase"; import { HttpError } from "#codebase/tcmts/server"; import { callerNow, servedCodebase } from "#codebase/tcmts/share"; import { studioCodebase } from "#codebase/tcmts/studio"; export function editableCodebase(): Codebase { const { cb } = servedCodebase(); if (callerNow(cb)?.role !== "maintainer") throw new HttpError(403, "Only the studio's maintainer changes the codebase."); if (studioCodebase().cb !== cb) throw new HttpError( 409, `${studioCodebase().cb.store.branch().name} is only read here: it's changed where it's the codebase's own branch (the branch menu goes back to ${cb.store.branch().name}).`, ); return cb; }
uses
- tcmts.cli.codebase.Codebase
- tcmts.server.HttpError
- tcmts.share.callerNow
- tcmts.share.servedCodebase
- tcmts.studio.studioCodebase
used by
- tcmts.studio.abortMerge
- tcmts.studio.addLib
- tcmts.studio.announceRelease
- tcmts.studio.cancelJob
- tcmts.studio.checkLib
- tcmts.studio.completeInScratch
- tcmts.studio.definitionInScratch
- tcmts.studio.discardScratch
- tcmts.studio.editDefinition
- tcmts.studio.evaluateInScratch
- tcmts.studio.exportRows
- tcmts.studio.extractInScratch
- tcmts.studio.fetchProduction
- tcmts.studio.findDefinitions
- tcmts.studio.formatScratch
- tcmts.studio.hoverInScratch
- tcmts.studio.makeRelease
- tcmts.studio.migrateTable
- tcmts.studio.newScratch
- tcmts.studio.previewInScratch
- tcmts.studio.pullIntoScratch
- tcmts.studio.referencesInScratch
- tcmts.studio.removeDefinition
- tcmts.studio.removeLib
- tcmts.studio.removeRow
- tcmts.studio.renameDefinition
- tcmts.studio.renameInScratch
- tcmts.studio.resolveConflict
- tcmts.studio.retryJob
- tcmts.studio.runScratch
- tcmts.studio.runTestInScratch
- tcmts.studio.saveRow
- tcmts.studio.saveScratch
- tcmts.studio.setProduction
- tcmts.studio.signatureInScratch
- tcmts.studio.startApp
- tcmts.studio.startTests
- tcmts.studio.updateScratch
- tcmts.studio.upgradeLib
- tcmts.studio.upgradePackage
- tcmts.studio.writeReleaseSummary