gg_one library
Classes
- AddTypeScriptVersionTag
-
Tags HEAD with the
versionfield of a TSpackage.json— the TS counterpart togg_version.AddVersionTag. Idempotent. - Analyze
- Runs static analysis on the source code, dispatching to the right Analyzer based on the detected ProjectType.
- Analyzer
- Runs static analysis for a specific project type.
- Build
- Builds a cross-language bridge repo before the other checks run.
- Can
- Various checks for the source code
- CanCheckout
- Are the current changes ready for checking out a new branch?
- CanCommit
- Are the last changes ready for »git commit«?
- CanMerge
- Are the last changes ready to be merged?
- CanPublish
- Are the last changes ready to be published?
- CanPush
- Are the last changes ready for »git push«?
- CanUpgrade
- Is the package ready to get a dependeny upgrade?
- Check
- Various checks for the source code
- CheckPackageJsonScripts
-
Checks that a TypeScript project's
package.jsondeclares every npm script gg relies on and wires them into the expected publish chain (prepublishOnly→build→test): - Checks
- Dependencies for the check command
- CommandCluster
- A cluster of commands that is run in sequence
- Create
- Groups commands for creating new development artifacts.
- CreateTicket
- Creates a ticket branch while preserving local changes.
- DartAnalyzer
-
Runs the catalog
analyzecommand on a Dart or Flutter package. - DartFormatter
-
Runs
dart formaton a Dart or Flutter package. - DefaultInteractAdapter
-
Default implementation of InteractAdapter that delegates to
interact. - DepsOfCan
- Dependencies for the check command
- DepsOfCreate
- Dependencies for the create command.
- DepsOfDid
- Dependencies for the check command
- DepsOfDo
- Dependencies for the check command
- Did
- Various checks for the source code
- DidCommit
- Are all changes committed?
- DidMerge
- Was the merge successful?
- DidPublish
- Everything is published to pub.dev or git?
- DidPush
- Are all changes pushed to the remote repository?
- DidUpgrade
- Are the dependencies of the package upgraded?
- Do
- Various checks for the source code
- DoCheckout
- Checks out the branch belonging to a ticket in the current repository.
- DoCommit
- Does a commit of the current directory.
- DoConfigurePublish
-
Interactively builds the
.gg/.gg-publish.jsonpublish configuration for the current repository: version increment (patch/minor/major) plus merge message.gg do publishruns this automatically when it is started without a configuration, so every interactive decision is made up front — the same file then collects the per-step publish progress and is removed after a fully successful publish. - DoMaintain
- Upgrades all dependencies
- DoMerge
- Performs the merge operation.
- DoPublish
- Publishes the current directory.
- DoPush
- Pushes the current state.
- DoUpgrade
- Upgrades all dependencies
- EnsurePublishConfigIgnored
-
Makes sure
.gg/.gg-publish.jsonis listed in a repository's.gitignore. - Format
- Applies formatting to the source code, dispatching to the right Formatter based on the detected ProjectType.
- Formatter
- Applies formatting rules to a project's source code.
- Gg
- The command line interface for gg_one
- GgState
- Stores and retrieves the state of the check commands
- Info
- Commands to inform about the source code
- InteractAdapter
- Abstraction over interactive selection used by VersionSelector.
- MockAddTypeScriptVersionTag
- Mock for AddTypeScriptVersionTag.
- MockAnalyze
- A mocktail mock.
- MockAnalyzer
- A mocktail mock.
- MockBuild
- A mocktail mock.
- MockCanCheckout
- A mocktail mock
- MockCanCommit
- A mocktail mock
- MockCanMerge
- A mocktail mock
- MockCanPublish
- A mocktail mock
- MockCanPush
- A mocktail mock
- MockCanUpgrade
- A mocktail mock
- MockCheckPackageJsonScripts
- A mocktail mock.
- MockCreateTicket
- Mock for CreateTicket.
- MockDidCommit
- Mock for DidCommit
- MockDidMerge
- Mock for DidMerge
- MockDidPublish
- Mock for DidPublish
- MockDidPush
- Mock for DidPush
- MockDidUpgrade
- Mock for DidUpgrade
- MockDoCheckout
- Mock for DoCheckout.
- MockDoCommit
- Mock for DoCommit.
- MockDoConfigurePublish
- Mock for DoConfigurePublish.
- MockDoMaintain
- Mock for DoMaintain.
- MockDoMerge
- Mock for DoMerge.
- MockDoPublish
- Mock for DoPublish.
- MockDoPush
- Mock for DoPush.
- MockDoUpgrade
- Mock for DoUpgrade.
- MockEnsurePublishConfigIgnored
- Mock for EnsurePublishConfigIgnored.
- MockFormat
- A mocktail mock.
- MockFormatter
- A mocktail mock.
- MockGgState
- Mock for GgState
- MockNpmLoggedIn
- A mocktail mock.
- MockPana
- A mocktail mock
- MockPubGetOffline
- A mocktail mock.
- MockVersionSelector
- A Mock for the VersionSelector class using Mocktail
- NpmLoggedIn
- Checks that the user is authenticated with the registry a TypeScript package publishes to, before the package is published.
- Pana
- Runs dart pana on the source code
- PubGetOffline
-
Runs
dart pub get --offline(or the Flutter equivalent) so thatpubspec.lockmatchespubspec.yamlbefore the other checks run. - PublishConfig
-
In-memory representation of a
.gg-publish.jsonconfig file. Top-levelversion_increment/merge_messageare defaults. Entries underrepos.<name>override the defaults per repo. - RepoOverride
-
Per-repo override block within a PublishConfig. The
version_incrementandmerge_messagefields may be null, in which case the top-level default applies. status is a runtime progress marker written during a publish run. - ResolvedPublishValues
- Returned by PublishConfig.forRepo (and used directly in single-repo scenarios). Both fields are present and validated when this is constructed — the caller may treat them as authoritative inputs to a publish run.
- TypeScriptAnalyzer
- Runs TypeScript static analysis.
- TypeScriptFormatter
- Formats a TypeScript project — but only when the project opts in.
- VersionSelector
- Lets the user interactively select the next version increment.
Enums
- ProjectType
- The kind of project gg is operating on.
- TypeScriptPackageManager
- The JavaScript/TypeScript package manager in use by a project.
Extensions
- ProjectTypeX on ProjectType
- Convenience predicates on ProjectType.
Constants
-
allowedPublishStatuses
→ const Set<
String> -
Allowed values for the per-repo
statusprogress marker written into a.gg-publish.jsonfile whilegg_multi do publishruns.publishedmeans the repo finished publishing and may be skipped on a--continuere-run;pending/failedmean it still has to be (re-)published. -
allowedPublishSteps
→ const Set<
String> -
Allowed entries of the repo-level
done_stepsprogress list written into<repo>/.gg/.gg-publish.jsonwhilegg do publishruns. Steps not listed here (the feature/main/tag pushes and the feature-branch deletion) are idempotent and always re-run on a--continue, so they are not tracked. -
allowedVersionIncrements
→ const Set<
String> -
Allowed values for
version_incrementin a.gg-publish.jsonfile. - buildMustRunScript → const String
-
The script that the
buildscript must run, so the test suite always runs as part of a build. - prepublishMustRunScript → const String
- The script that the publish-lifecycle script must run, so a fresh build (which in turn runs the tests) always precedes a publish.
-
prepublishScriptNames
→ const List<
String> -
The publish-lifecycle script that must reach
build. npm's modern name isprepublishOnly; the deprecatedprepublishis accepted as an equivalent. Exactly one of these must be present (unless the package is private). -
requiredNpmScripts
→ const List<
String> - The npm scripts every TypeScript project must declare in its package.json.
Properties
- carriageReturn → String
-
The carriage return
no setter
Functions
-
checkProjectType(
Directory directory) → ProjectType -
The ProjectType that gg's check pipeline (analyze / format / tests)
should use for
directory. -
detectProjectType(
Directory directory) → ProjectType -
Detects the ProjectType of
directory. -
detectTypeScriptPackageManager(
Directory directory) → TypeScriptPackageManager -
Detects the TypeScriptPackageManager of
directoryby looking at the lockfiles present. Falls back to TypeScriptPackageManager.npm. -
isBridgeProject(
Directory directory) → bool -
Whether
directoryis a cross-language bridge project — a repo that ships both a Dart manifest (pubspec.yaml) and a TypeScript manifest (package.json+tsconfig.json) side by side. -
lockFileFor(
Directory directory) → String -
Returns the dependency lock file name for the project in
directory. -
parseVersionIncrement(
String increment) → VersionIncrement -
Maps a version increment string to its
VersionIncrementenum value. Throws ArgumentError for unknown strings; validate earlier via allowedVersionIncrements. -
readRepositoryUrl(
Directory directory) → Future< String> -
Reads the canonical repository URL of the project at
directory. -
throwWhenNotATerminal(
String what, String alternative) → void - Throws when stdin is not a terminal, so headless runs (CI, scripts, pipes) fail fast with an actionable message instead of hanging forever on an interactive prompt.
Typedefs
- ConfirmDeleteFeatureBranch = bool Function(String branchName)
- Typedef for confirming feature branch deletion.
-
EditMessage
= Future<
String?> Function(String initialMessage) - Typedef for editing the merge message interactively.