@theholocron/cli 2.0.0-alpha.41 → 2.0.0-alpha.43

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.
@@ -66,6 +66,11 @@ interface RepoRef {
66
66
  name: string;
67
67
  defaultBranch: string;
68
68
  }
69
+ interface LabelDef {
70
+ readonly name: string;
71
+ readonly color: string;
72
+ readonly description: string;
73
+ }
69
74
  interface Source extends ProviderIdentity {
70
75
  readonly key: "source";
71
76
  /** Auth sanity-check. Throws ProviderApiError on auth failure. */
@@ -116,6 +121,12 @@ interface Source extends ProviderIdentity {
116
121
  * (e.g. `.github/dependabot.yml`).
117
122
  */
118
123
  writeRepoFile(path: string, contents: string): Promise<void>;
124
+ /**
125
+ * Idempotently sync repo labels to a canonical set. Creates missing
126
+ * labels, patches color/description drift, deletes stale labels.
127
+ * Optional — providers that have no label concept omit this.
128
+ */
129
+ syncLabels?(canonical: ReadonlyArray<LabelDef>, stale: ReadonlyArray<string>): Promise<string>;
119
130
  }
120
131
  type CiRunStatus = "queued" | "in_progress" | "completed" | "cancelled" | "failure" | "success" | "skipped";
121
132
  interface CiRun {
@@ -528,4 +539,4 @@ type CardinalityFor<K extends CapabilityKey> = (typeof CARDINALITY)[K];
528
539
  type ResolvedCapability<K extends CapabilityKey> = CardinalityFor<K> extends "many" ? CapabilityImpls[K][] : CapabilityImpls[K];
529
540
  declare function isMulti<K extends CapabilityKey>(key: K): CardinalityFor<K> extends "many" ? true : false;
530
541
  //#endregion
531
- export { Analytics, Auth, AuthDescription, AuthEvent, AuthEventType, AuthIdentity, AuthUser, CARDINALITY, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, Ci, CiRun, CiRunFilter, CiRunStatus, ConnectionStringOptions, CreateAuthUserInput, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, Dns, DnsRecord, DnsRecordType, EnsureResult, Environment, EnvironmentReviewer, Environments, Issue, IssueSearchFilter, Issues, LifecycleResult, LifecycleSlot, NormalizedAuthUser, Notifications, Observability, ParseWebhookInput, ProviderApiError, ProviderIdentity, REQUIRED_CAPABILITIES, RepoRef, RepoSettings, ResolvedCapability, Ruleset, SecretScope, Secrets, Source, StatusCategory, Storage, StorageBranch, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, Vault, WebhookDashboardInfo, WebhookVerificationError, isMulti };
542
+ export { Analytics, Auth, AuthDescription, AuthEvent, AuthEventType, AuthIdentity, AuthUser, CARDINALITY, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, Ci, CiRun, CiRunFilter, CiRunStatus, ConnectionStringOptions, CreateAuthUserInput, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, Dns, DnsRecord, DnsRecordType, EnsureResult, Environment, EnvironmentReviewer, Environments, Issue, IssueSearchFilter, Issues, LabelDef, LifecycleResult, LifecycleSlot, NormalizedAuthUser, Notifications, Observability, ParseWebhookInput, ProviderApiError, ProviderIdentity, REQUIRED_CAPABILITIES, RepoRef, RepoSettings, ResolvedCapability, Ruleset, SecretScope, Secrets, Source, StatusCategory, Storage, StorageBranch, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, Vault, WebhookDashboardInfo, WebhookVerificationError, isMulti };
package/dist/cli.mjs CHANGED
@@ -957,6 +957,7 @@ jobs:
957
957
  name: Add Labels to PRs
958
958
  permissions:
959
959
  contents: read
960
+ issues: write
960
961
  pull-requests: write
961
962
  runs-on: ubuntu-latest
962
963
  timeout-minutes: 5
@@ -1902,6 +1903,7 @@ on: # yamllint disable-line rule:truthy
1902
1903
 
1903
1904
  permissions:
1904
1905
  contents: read
1906
+ issues: write
1905
1907
  pull-requests: write
1906
1908
 
1907
1909
  jobs:
@@ -3746,6 +3748,100 @@ const ALEX_CONFIG = JSON.stringify({ allow: [
3746
3748
  "husky",
3747
3749
  "period"
3748
3750
  ] }, null, 2) + "\n";
3751
+ const CANONICAL_LABELS = [
3752
+ {
3753
+ name: "bug",
3754
+ color: "d73a4a",
3755
+ description: "Something isn't working"
3756
+ },
3757
+ {
3758
+ name: "chore",
3759
+ color: "ededed",
3760
+ description: "Maintenance, no user-facing change"
3761
+ },
3762
+ {
3763
+ name: "ci",
3764
+ color: "0075ca",
3765
+ description: "CI/CD pipeline changes"
3766
+ },
3767
+ {
3768
+ name: "dependencies",
3769
+ color: "0366d6",
3770
+ description: "Dependency update"
3771
+ },
3772
+ {
3773
+ name: "documentation",
3774
+ color: "0075ca",
3775
+ description: "Documentation only"
3776
+ },
3777
+ {
3778
+ name: "duplicate",
3779
+ color: "cfd3d7",
3780
+ description: "Already reported"
3781
+ },
3782
+ {
3783
+ name: "enhancement",
3784
+ color: "a2eeef",
3785
+ description: "New feature or request"
3786
+ },
3787
+ {
3788
+ name: "good first issue",
3789
+ color: "7057ff",
3790
+ description: "Good for newcomers"
3791
+ },
3792
+ {
3793
+ name: "help wanted",
3794
+ color: "008672",
3795
+ description: "Extra attention needed"
3796
+ },
3797
+ {
3798
+ name: "invalid",
3799
+ color: "e4e669",
3800
+ description: "Doesn't seem right"
3801
+ },
3802
+ {
3803
+ name: "performance",
3804
+ color: "fbca04",
3805
+ description: "Performance improvement"
3806
+ },
3807
+ {
3808
+ name: "question",
3809
+ color: "d876e3",
3810
+ description: "Further information requested"
3811
+ },
3812
+ {
3813
+ name: "refactor",
3814
+ color: "cfd3d7",
3815
+ description: "Code restructuring"
3816
+ },
3817
+ {
3818
+ name: "released",
3819
+ color: "ededed",
3820
+ description: "Included in a release"
3821
+ },
3822
+ {
3823
+ name: "test",
3824
+ color: "bfd4f2",
3825
+ description: "Test-related changes"
3826
+ },
3827
+ {
3828
+ name: "triage",
3829
+ color: "e4e669",
3830
+ description: "Needs investigation"
3831
+ },
3832
+ {
3833
+ name: "wontfix",
3834
+ color: "ffffff",
3835
+ description: "Won't be addressed"
3836
+ }
3837
+ ];
3838
+ const STALE_LABELS = [
3839
+ "github_actions",
3840
+ "javascript",
3841
+ "autorelease: pending",
3842
+ "autorelease: tagged",
3843
+ "released on @alpha"
3844
+ ];
3749
3845
  function labelerConfig() {
3750
3846
  return [
3751
3847
  `# AUTO-GENERATED — do not edit directly.`,
@@ -3757,6 +3853,12 @@ function labelerConfig() {
3757
3853
  `bug:`,
3758
3854
  ` - '^fix'`,
3759
3855
  ``,
3856
+ `chore:`,
3857
+ ` - '^chore(?!\\(deps)'`,
3858
+ ``,
3859
+ `ci:`,
3860
+ ` - '^ci'`,
3861
+ ``,
3760
3862
  `dependencies:`,
3761
3863
  ` - '^chore\\(deps'`,
3762
3864
  ``,
@@ -3766,8 +3868,14 @@ function labelerConfig() {
3766
3868
  `enhancement:`,
3767
3869
  ` - '^feat'`,
3768
3870
  ``,
3769
- `github_actions:`,
3770
- ` - '^ci'`,
3871
+ `performance:`,
3872
+ ` - '^perf'`,
3873
+ ``,
3874
+ `refactor:`,
3875
+ ` - '^refactor'`,
3876
+ ``,
3877
+ `test:`,
3878
+ ` - '^test'`,
3771
3879
  ``
3772
3880
  ].join("\n");
3773
3881
  }
@@ -4025,6 +4133,12 @@ async function runSetup(input) {
4025
4133
  await source.writeRepoFile(".editorconfig-checker.json", EDITORCONFIG_CHECKER_CONFIG);
4026
4134
  }));
4027
4135
  print(formatStep(steps[steps.length - 1]));
4136
+ if (source.syncLabels) {
4137
+ steps.push(await runStep("source", "sync labels", dryRun, async () => {
4138
+ return source.syncLabels(CANONICAL_LABELS, STALE_LABELS);
4139
+ }));
4140
+ print(formatStep(steps[steps.length - 1]));
4141
+ }
4028
4142
  }
4029
4143
  if (loader.has("environments")) {
4030
4144
  const envs = loader.get("environments");
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { Analytics, Auth, AuthDescription, AuthEvent, AuthEventType, AuthIdentity, AuthUser, CARDINALITY, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, Ci, CiRun, CiRunFilter, CiRunStatus, ConnectionStringOptions, CreateAuthUserInput, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, Dns, DnsRecord, DnsRecordType, EnsureResult, Environment, EnvironmentReviewer, Environments, Issue, IssueSearchFilter, Issues, LifecycleResult, LifecycleSlot, NormalizedAuthUser, Notifications, Observability, ParseWebhookInput, ProviderApiError, ProviderIdentity, REQUIRED_CAPABILITIES, RepoRef, RepoSettings, ResolvedCapability, Ruleset, SecretScope, Secrets, Source, StatusCategory, Storage, StorageBranch, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, Vault, WebhookDashboardInfo, WebhookVerificationError, isMulti } from "./capabilities/index.mjs";
1
+ import { Analytics, Auth, AuthDescription, AuthEvent, AuthEventType, AuthIdentity, AuthUser, CARDINALITY, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, Ci, CiRun, CiRunFilter, CiRunStatus, ConnectionStringOptions, CreateAuthUserInput, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, Dns, DnsRecord, DnsRecordType, EnsureResult, Environment, EnvironmentReviewer, Environments, Issue, IssueSearchFilter, Issues, LabelDef, LifecycleResult, LifecycleSlot, NormalizedAuthUser, Notifications, Observability, ParseWebhookInput, ProviderApiError, ProviderIdentity, REQUIRED_CAPABILITIES, RepoRef, RepoSettings, ResolvedCapability, Ruleset, SecretScope, Secrets, Source, StatusCategory, Storage, StorageBranch, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, Vault, WebhookDashboardInfo, WebhookVerificationError, isMulti } from "./capabilities/index.mjs";
2
2
  import { AuthError, RequestOptions, ResolveTokenConfig as ResolveTokenConfig$1, ResolveTokenInput, RestClient, RestClientConfig, createRestClient } from "@theholocron/http-client";
3
3
 
4
4
  //#region src/auth-resolver.d.ts
@@ -190,4 +190,4 @@ interface LoadedConfig {
190
190
  */
191
191
  declare function loadConfig(cwd: string): Promise<LoadedConfig>;
192
192
  //#endregion
193
- export { Analytics, AppConfig, Auth, AuthDescription, AuthError, AuthEvent, AuthEventType, AuthIdentity, AuthUser, CARDINALITY, CapabilityConfigPackage, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, Ci, CiRun, CiRunFilter, CiRunStatus, ConfigError, ConfigFileError, ConnectionStringOptions, CreateAuthUserInput, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, Dns, DnsRecord, DnsRecordType, DoctorConfig, EnsureResult, Environment, EnvironmentReviewer, Environments, HolocronConfig, Issue, IssueSearchFilter, Issues, LifecycleResult, LifecycleSlot, LoadedConfig, MultiEntry, NormalizedAuthUser, Notifications, Observability, ParseWebhookInput, ProviderApiError, ProviderIdentity, ProviderOptions, REQUIRED_CAPABILITIES, RawProviderEntry, RawProvidersConfig, RepoPolicyConfig, RepoRef, RepoSettings, type RequestOptions, ResolveTokenConfig, type ResolveTokenInput, ResolvedCapability, ResolvedHolocronConfig, ResolvedProviderEntry, ResolvedProvidersConfig, ResolvedTuple, type RestClient, type RestClientConfig, Ruleset, SecretScope, Secrets, SingleEntry, Source, StatusCategory, Storage, StorageBranch, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, Vault, WebhookDashboardInfo, WebhookVerificationError, createResolveToken, createRestClient, defineConfig, deleteToken, getToken, isMulti, listStoredProviders, loadConfig, resolveConfig, resolveEntry, resolvePluginPackage, setToken };
193
+ export { Analytics, AppConfig, Auth, AuthDescription, AuthError, AuthEvent, AuthEventType, AuthIdentity, AuthUser, CARDINALITY, CapabilityConfigPackage, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, Ci, CiRun, CiRunFilter, CiRunStatus, ConfigError, ConfigFileError, ConnectionStringOptions, CreateAuthUserInput, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, Dns, DnsRecord, DnsRecordType, DoctorConfig, EnsureResult, Environment, EnvironmentReviewer, Environments, HolocronConfig, Issue, IssueSearchFilter, Issues, LabelDef, LifecycleResult, LifecycleSlot, LoadedConfig, MultiEntry, NormalizedAuthUser, Notifications, Observability, ParseWebhookInput, ProviderApiError, ProviderIdentity, ProviderOptions, REQUIRED_CAPABILITIES, RawProviderEntry, RawProvidersConfig, RepoPolicyConfig, RepoRef, RepoSettings, type RequestOptions, ResolveTokenConfig, type ResolveTokenInput, ResolvedCapability, ResolvedHolocronConfig, ResolvedProviderEntry, ResolvedProvidersConfig, ResolvedTuple, type RestClient, type RestClientConfig, Ruleset, SecretScope, Secrets, SingleEntry, Source, StatusCategory, Storage, StorageBranch, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, Vault, WebhookDashboardInfo, WebhookVerificationError, createResolveToken, createRestClient, defineConfig, deleteToken, getToken, isMulti, listStoredProviders, loadConfig, resolveConfig, resolveEntry, resolvePluginPackage, setToken };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/cli",
3
- "version": "2.0.0-alpha.41",
3
+ "version": "2.0.0-alpha.43",
4
4
  "description": "The Holocron CLI — a pluggable, capability-based orchestrator for spinning up and operating software projects.",
5
5
  "homepage": "https://github.com/theholocron/holocron/tree/main/packages/cli#readme",
6
6
  "bugs": "https://github.com/theholocron/holocron/issues",