@intentius/chant-lexicon-gcp 0.14.0 → 0.15.0

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.
@@ -0,0 +1,46 @@
1
+ /**
2
+ * GCP Op activities — resolved by the core activity registry when a project's
3
+ * `chant.config.ts` lists the `gcp` lexicon. Contributes the native GCP applier
4
+ * (`gcpApply`), which maps CNRM resources to GCP REST calls since GCP has no
5
+ * native deployment service to shell out to.
6
+ */
7
+ export {
8
+ gcpApply,
9
+ gcpDelete,
10
+ applyResource,
11
+ deleteResource,
12
+ waitForOperation,
13
+ longRunningOperation,
14
+ bucketInsertBody,
15
+ pubSubTopicBody,
16
+ pubSubSubscriptionBody,
17
+ cloudRunServiceBody,
18
+ secretBody,
19
+ serviceAccountBody,
20
+ storageBucketMapper,
21
+ pubSubTopicMapper,
22
+ pubSubSubscriptionMapper,
23
+ cloudRunServiceMapper,
24
+ secretManagerSecretMapper,
25
+ gcpServiceAccountMapper,
26
+ MAPPERS,
27
+ referencedNames,
28
+ orderByReferences,
29
+ pruneOrphans,
30
+ chantOwnershipLabels,
31
+ isChantOwned,
32
+ resolveGcpProject,
33
+ parseManifest,
34
+ } from "./gcp-apply";
35
+ export type {
36
+ GcpApplyArgs,
37
+ GcpResource,
38
+ CnrmStorageBucket,
39
+ BucketInsertBody,
40
+ PubSubTopicBody,
41
+ ResourceMapper,
42
+ OperationSpec,
43
+ ListSpec,
44
+ ApplyPlan,
45
+ GcpHttp,
46
+ } from "./gcp-apply";
package/src/plugin.ts CHANGED
@@ -12,6 +12,7 @@ import type { TemplateParser } from "@intentius/chant/import/parser";
12
12
  import type { TypeScriptGenerator } from "@intentius/chant/import/generator";
13
13
  import type { CompletionContext, CompletionItem, HoverContext, HoverInfo } from "@intentius/chant/lsp/types";
14
14
  import { postSynthChecks as postSynthCheckList } from "./lint/post-synth";
15
+ import { gcpAuditCatalog } from "./lint/audit-catalog";
15
16
  import { createSkillsLoader, createDiffTool, createCatalogResource } from "@intentius/chant/lexicon-plugin-helpers";
16
17
  import { join, dirname } from "path";
17
18
  import { fileURLToPath } from "url";
@@ -26,6 +27,14 @@ import { gcpHover } from "./lsp/hover";
26
27
 
27
28
  export const gcpPlugin: LexiconPlugin = {
28
29
  name: "gcp",
30
+ auditCatalog: () => gcpAuditCatalog,
31
+ // Self-upgrade: where the pinned Config Connector (KCC) version lives + its upstream (#685).
32
+ upstreamPin: {
33
+ file: "src/spec/fetch.ts",
34
+ pattern: /export const KCC_VERSION\s*=\s*"([^"]+)"/,
35
+ replace: (v, line) => line.replace(/export const KCC_VERSION\s*=\s*"[^"]+"/, `export const KCC_VERSION = "${v}"`),
36
+ upstream: { owner: "GoogleCloudPlatform", repo: "k8s-config-connector", kind: "releases" },
37
+ },
29
38
  serializer: gcpSerializer,
30
39
 
31
40
  lintRules(): LintRule[] {
package/src/serializer.ts CHANGED
@@ -9,7 +9,7 @@ import { createRequire } from "module";
9
9
  import type { Declarable } from "@intentius/chant/declarable";
10
10
  import { isPropertyDeclarable } from "@intentius/chant/declarable";
11
11
  import type { Serializer, SerializerResult, SerializeContext } from "@intentius/chant/serializer";
12
- import { ownershipEntries } from "@intentius/chant/ownership";
12
+ import { ownershipEntries, LABEL_OWNERSHIP_KEYS } from "@intentius/chant/ownership";
13
13
  import type { LexiconOutput } from "@intentius/chant/lexicon-output";
14
14
  import { walkValue, type SerializerVisitor } from "@intentius/chant/serializer-walker";
15
15
  import { emitYAML } from "@intentius/chant/yaml";
@@ -127,7 +127,7 @@ export const gcpSerializer: Serializer = {
127
127
  // Collect default labels and annotations. Ownership markers are stamped as
128
128
  // labels (Config Connector resources carry them in metadata.labels).
129
129
  let defaultLabelEntries: Record<string, unknown> = context?.ownership
130
- ? { ...ownershipEntries("label", context.ownership) }
130
+ ? { ...ownershipEntries(LABEL_OWNERSHIP_KEYS, context.ownership) }
131
131
  : {};
132
132
  let defaultAnnotationEntries: Record<string, unknown> = {};
133
133