@intentius/chant-lexicon-gcp 0.124.31 → 0.124.32
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.
- package/dist/actions/index.js +45 -0
- package/dist/api/read-client.js +105 -0
- package/dist/codegen/docs-cli.js +6 -0
- package/dist/codegen/docs.js +115 -0
- package/dist/codegen/generate-cli.js +17 -0
- package/dist/codegen/generate.js +214 -0
- package/dist/codegen/naming.js +164 -0
- package/dist/codegen/package.js +43 -0
- package/dist/composites/catalog.js +1245 -0
- package/dist/composites/cloud-function.js +65 -0
- package/dist/composites/cloud-run-service.js +71 -0
- package/dist/composites/cloud-sql-instance.js +85 -0
- package/dist/composites/gcs-bucket.js +64 -0
- package/dist/composites/gke-cluster.js +113 -0
- package/dist/composites/gke-crdb-region.js +137 -0
- package/dist/composites/gpu-node-pool.js +74 -0
- package/dist/composites/index.js +15 -0
- package/dist/composites/landing-zone.js +89 -0
- package/dist/composites/managed-certificate.js +46 -0
- package/dist/composites/memorystore-redis.js +52 -0
- package/dist/composites/multi-region-vpc.js +108 -0
- package/dist/composites/private-service.js +50 -0
- package/dist/composites/pubsub-pipeline.js +63 -0
- package/dist/composites/secure-project.js +85 -0
- package/dist/composites/vpc-network.js +113 -0
- package/dist/coverage.js +28 -0
- package/dist/deep-observe-hooks.js +152 -0
- package/dist/deep-observe.js +273 -0
- package/dist/default-labels.js +67 -0
- package/dist/describe-resources.js +264 -0
- package/dist/detect.js +16 -0
- package/dist/export-resources.js +59 -0
- package/dist/generated/index.js +1804 -0
- package/dist/generated/runtime.js +4 -0
- package/dist/governance.js +98 -0
- package/dist/import/generator.js +68 -0
- package/dist/import/live-export.js +73 -0
- package/dist/import/parser.js +61 -0
- package/dist/index.js +36 -0
- package/dist/integrity.json +3 -3
- package/dist/lint/audit-catalog.js +38 -0
- package/dist/lint/audit-lineage.js +63 -0
- package/dist/lint/post-synth/gcp-helpers.js +91 -0
- package/dist/lint/post-synth/index.js +54 -0
- package/dist/lint/post-synth/schema-registry.d.ts.map +1 -1
- package/dist/lint/post-synth/schema-registry.js +69 -0
- package/dist/lint/post-synth/wgc101.js +47 -0
- package/dist/lint/post-synth/wgc102.js +29 -0
- package/dist/lint/post-synth/wgc103.js +37 -0
- package/dist/lint/post-synth/wgc104.js +34 -0
- package/dist/lint/post-synth/wgc105.js +39 -0
- package/dist/lint/post-synth/wgc106.js +30 -0
- package/dist/lint/post-synth/wgc107.js +33 -0
- package/dist/lint/post-synth/wgc108.js +34 -0
- package/dist/lint/post-synth/wgc109.js +33 -0
- package/dist/lint/post-synth/wgc110.js +32 -0
- package/dist/lint/post-synth/wgc111.js +47 -0
- package/dist/lint/post-synth/wgc112.js +46 -0
- package/dist/lint/post-synth/wgc113.js +35 -0
- package/dist/lint/post-synth/wgc201.js +30 -0
- package/dist/lint/post-synth/wgc202.js +33 -0
- package/dist/lint/post-synth/wgc203.js +35 -0
- package/dist/lint/post-synth/wgc204.js +33 -0
- package/dist/lint/post-synth/wgc301.js +28 -0
- package/dist/lint/post-synth/wgc302.js +28 -0
- package/dist/lint/post-synth/wgc303.js +29 -0
- package/dist/lint/post-synth/wgc401.js +50 -0
- package/dist/lint/post-synth/wgc402.js +46 -0
- package/dist/lint/post-synth/wgc403.js +74 -0
- package/dist/lint/post-synth/wgc501.js +63 -0
- package/dist/lint/post-synth/wgc502.js +37 -0
- package/dist/lint/post-synth/wgc503.js +49 -0
- package/dist/lint/rules/hardcoded-project.js +51 -0
- package/dist/lint/rules/hardcoded-region.js +51 -0
- package/dist/lint/rules/index.js +3 -0
- package/dist/lint/rules/public-iam.js +37 -0
- package/dist/lsp/completions.d.ts.map +1 -1
- package/dist/lsp/completions.js +15 -0
- package/dist/lsp/hover.d.ts.map +1 -1
- package/dist/lsp/hover.js +46 -0
- package/dist/manifest.json +1 -1
- package/dist/op/activities/floci-gcp.js +49 -0
- package/dist/op/activities/gcp-apply.js +618 -0
- package/dist/op/activities/index.js +10 -0
- package/dist/op/builders.js +50 -0
- package/dist/ownership.js +38 -0
- package/dist/package-cli.js +20 -0
- package/dist/plugin.js +371 -0
- package/dist/pseudo.js +15 -0
- package/dist/rules/schema-registry.ts +2 -1
- package/dist/serializer.d.ts.map +1 -1
- package/dist/serializer.js +233 -0
- package/dist/spec/fetch.js +107 -0
- package/dist/spec/parse.js +323 -0
- package/dist/validate-cli.js +11 -0
- package/dist/validate.js +24 -0
- package/dist/variables.js +15 -0
- package/package.json +8 -8
- package/src/codegen/package.ts +2 -2
- package/src/lint/post-synth/schema-registry.ts +2 -1
- package/src/lsp/completions.ts +2 -1
- package/src/lsp/hover.ts +2 -1
- package/src/serializer.ts +2 -1
package/dist/validate.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate generated lexicon-gcp artifacts.
|
|
3
|
+
*/
|
|
4
|
+
import { dirname } from "path";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
6
|
+
import { validateLexiconArtifacts } from "@intentius/chant/codegen/validate";
|
|
7
|
+
const REQUIRED_NAMES = [
|
|
8
|
+
"ComputeInstance", "StorageBucket", "GKECluster", "SQLInstance",
|
|
9
|
+
"GCPServiceAccount", "IAMPolicyMember", "CloudRunService", "PubSubTopic",
|
|
10
|
+
"VPCNetwork",
|
|
11
|
+
];
|
|
12
|
+
export async function validate(opts) {
|
|
13
|
+
const basePath = opts?.basePath ?? dirname(dirname(fileURLToPath(import.meta.url)));
|
|
14
|
+
return validateLexiconArtifacts({
|
|
15
|
+
lexiconJsonFilename: "lexicon-gcp.json",
|
|
16
|
+
requiredNames: REQUIRED_NAMES,
|
|
17
|
+
basePath,
|
|
18
|
+
coverageThresholds: {
|
|
19
|
+
minPropertyPct: 0,
|
|
20
|
+
minLifecyclePct: 0,
|
|
21
|
+
minAttrPct: 1,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Well-known Config Connector annotation keys.
|
|
3
|
+
*/
|
|
4
|
+
export const GcpAnnotations = {
|
|
5
|
+
/** Bind a resource to a specific GCP project. */
|
|
6
|
+
ProjectId: "cnrm.cloud.google.com/project-id",
|
|
7
|
+
/** Control what happens when a resource is deleted from K8s. */
|
|
8
|
+
DeletionPolicy: "cnrm.cloud.google.com/deletion-policy",
|
|
9
|
+
/** Whether to merge observed spec back into the resource. */
|
|
10
|
+
StateIntoSpec: "cnrm.cloud.google.com/state-into-spec",
|
|
11
|
+
/** Strategy when another controller manages the same resource. */
|
|
12
|
+
ManagementConflictPolicy: "cnrm.cloud.google.com/management-conflict-prevention-policy",
|
|
13
|
+
/** Disable dependent resource reconciliation. */
|
|
14
|
+
SkipDependentResources: "cnrm.cloud.google.com/skip-dependent-resources",
|
|
15
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/chant-lexicon-gcp",
|
|
3
|
-
"version": "0.124.
|
|
3
|
+
"version": "0.124.32",
|
|
4
4
|
"description": "Google Cloud lexicon for chant — declarative IaC in TypeScript",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://intentius.io/chant",
|
|
@@ -32,27 +32,27 @@
|
|
|
32
32
|
".": {
|
|
33
33
|
"development": "./src/index.ts",
|
|
34
34
|
"types": "./dist/index.d.ts",
|
|
35
|
-
"default": "./
|
|
35
|
+
"default": "./dist/index.js"
|
|
36
36
|
},
|
|
37
37
|
"./*": {
|
|
38
38
|
"development": "./src/*.ts",
|
|
39
39
|
"types": "./dist/*.d.ts",
|
|
40
|
-
"default": "./
|
|
40
|
+
"default": "./dist/*.js"
|
|
41
41
|
},
|
|
42
42
|
"./detect": {
|
|
43
43
|
"development": "./src/detect.ts",
|
|
44
44
|
"types": "./dist/detect.d.ts",
|
|
45
|
-
"default": "./
|
|
45
|
+
"default": "./dist/detect.js"
|
|
46
46
|
},
|
|
47
47
|
"./op/activities": {
|
|
48
48
|
"development": "./src/op/activities/index.ts",
|
|
49
49
|
"types": "./dist/op/activities/index.d.ts",
|
|
50
|
-
"default": "./
|
|
50
|
+
"default": "./dist/op/activities/index.js"
|
|
51
51
|
},
|
|
52
52
|
"./lint/post-synth": {
|
|
53
53
|
"development": "./src/lint/post-synth/index.ts",
|
|
54
54
|
"types": "./dist/lint/post-synth/index.d.ts",
|
|
55
|
-
"default": "./
|
|
55
|
+
"default": "./dist/lint/post-synth/index.js"
|
|
56
56
|
},
|
|
57
57
|
"./manifest": "./dist/manifest.json",
|
|
58
58
|
"./meta": "./dist/meta.json",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"validate": "tsx src/validate-cli.ts",
|
|
65
65
|
"docs": "tsx src/codegen/docs-cli.ts",
|
|
66
66
|
"prepack": "npm run generate && npm run bundle && npm run validate && npm run build",
|
|
67
|
-
"build": "../../scripts/tsc7.sh -p tsconfig.build.json && tsc-alias -p tsconfig.build.json
|
|
67
|
+
"build": "../../scripts/tsc7.sh -p tsconfig.build.json --sourceMap false && tsc-alias -p tsconfig.build.json"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"fflate": "^0.8.2",
|
|
@@ -76,6 +76,6 @@
|
|
|
76
76
|
"typescript": "^5.9.3"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
|
-
"@intentius/chant": "^0.124.
|
|
79
|
+
"@intentius/chant": "^0.124.32"
|
|
80
80
|
}
|
|
81
81
|
}
|
package/src/codegen/package.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { readFileSync } from "fs";
|
|
7
7
|
import { gcpPlugin } from "../plugin";
|
|
8
8
|
import { dirname } from "path";
|
|
9
|
-
import {
|
|
9
|
+
import { moduleSourceDir } from "@intentius/chant/module-source";
|
|
10
10
|
import {
|
|
11
11
|
packagePipeline,
|
|
12
12
|
collectSkills,
|
|
@@ -18,7 +18,7 @@ import { generate } from "./generate";
|
|
|
18
18
|
export type { PackageOptions, PackageResult };
|
|
19
19
|
|
|
20
20
|
// src/codegen/package.ts → dirname x2 → src/ (srcDir for rule collection)
|
|
21
|
-
const pkgDir = dirname(
|
|
21
|
+
const pkgDir = dirname(moduleSourceDir(import.meta.url));
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Package the GCP lexicon into a distributable BundleSpec.
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { createRequire } from "module";
|
|
9
|
+
import { moduleSourceUrl } from "@intentius/chant/module-source";
|
|
9
10
|
|
|
10
11
|
export interface FieldSchema {
|
|
11
12
|
type: string;
|
|
@@ -38,7 +39,7 @@ export function getSchemaRegistry(): Map<string, ResourceSchema> {
|
|
|
38
39
|
// Built lazily (not at module load) so importing this module stays edge-safe:
|
|
39
40
|
// `createRequire(import.meta.url)` throws where import.meta.url is undefined
|
|
40
41
|
// (bundled Workers); there it's caught here and the registry is just empty.
|
|
41
|
-
const require = createRequire(import.meta.url);
|
|
42
|
+
const require = createRequire(moduleSourceUrl(import.meta.url));
|
|
42
43
|
const lexicon = require("../../generated/lexicon-gcp.json") as Record<string, LexiconEntry>;
|
|
43
44
|
for (const entry of Object.values(lexicon)) {
|
|
44
45
|
if (entry.kind === "resource" && entry.gvkKind && entry.schema) {
|
package/src/lsp/completions.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { createRequire } from "module";
|
|
2
|
+
import { moduleSourceUrl } from "@intentius/chant/module-source";
|
|
2
3
|
import type { CompletionContext, CompletionItem } from "@intentius/chant/lsp/types";
|
|
3
4
|
import { LexiconIndex, lexiconCompletions, type LexiconEntry } from "@intentius/chant/lsp/lexicon-providers";
|
|
4
|
-
const require = createRequire(import.meta.url);
|
|
5
|
+
const require = createRequire(moduleSourceUrl(import.meta.url));
|
|
5
6
|
|
|
6
7
|
let cachedIndex: LexiconIndex | null = null;
|
|
7
8
|
|
package/src/lsp/hover.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { createRequire } from "module";
|
|
2
|
+
import { moduleSourceUrl } from "@intentius/chant/module-source";
|
|
2
3
|
import type { HoverContext, HoverInfo } from "@intentius/chant/lsp/types";
|
|
3
4
|
import { LexiconIndex, lexiconHover, type LexiconEntry } from "@intentius/chant/lsp/lexicon-providers";
|
|
4
|
-
const require = createRequire(import.meta.url);
|
|
5
|
+
const require = createRequire(moduleSourceUrl(import.meta.url));
|
|
5
6
|
|
|
6
7
|
// GCP's generated lexicon JSON includes extra CRD-derived metadata (apiVersion,
|
|
7
8
|
// gvkKind) that the core LexiconEntry interface doesn't carry. Type the data
|
package/src/serializer.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { createRequire } from "module";
|
|
9
|
+
import { moduleSourceUrl } from "@intentius/chant/module-source";
|
|
9
10
|
import type { Declarable } from "@intentius/chant/declarable";
|
|
10
11
|
import { isPropertyDeclarable, isResourceDeclarable } from "@intentius/chant/declarable";
|
|
11
12
|
import type { Serializer, SerializerResult, SerializeContext } from "@intentius/chant/serializer";
|
|
@@ -16,7 +17,7 @@ import { emitYAML } from "@intentius/chant/yaml";
|
|
|
16
17
|
import { INTRINSIC_MARKER } from "@intentius/chant/intrinsic";
|
|
17
18
|
import { isDefaultLabels, isDefaultAnnotations, type DefaultLabels, type DefaultAnnotations } from "./default-labels";
|
|
18
19
|
|
|
19
|
-
const require = createRequire(import.meta.url);
|
|
20
|
+
const require = createRequire(moduleSourceUrl(import.meta.url));
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
23
|
* GVK mapping entry — loaded from generated lexicon-gcp.json.
|