structkit 3.0.0__py3-none-any.whl

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.
Files changed (77) hide show
  1. structkit/__init__.py +6 -0
  2. structkit/commands/__init__.py +17 -0
  3. structkit/commands/completion.py +65 -0
  4. structkit/commands/generate.py +397 -0
  5. structkit/commands/generate_schema.py +67 -0
  6. structkit/commands/import.py +63 -0
  7. structkit/commands/info.py +87 -0
  8. structkit/commands/init.py +52 -0
  9. structkit/commands/list.py +89 -0
  10. structkit/commands/mcp.py +100 -0
  11. structkit/commands/validate.py +129 -0
  12. structkit/completers.py +54 -0
  13. structkit/content_fetcher.py +249 -0
  14. structkit/contribs/README.md +271 -0
  15. structkit/contribs/ansible-playbook.yaml +38 -0
  16. structkit/contribs/chef-cookbook.yaml +51 -0
  17. structkit/contribs/ci-cd-pipelines.yaml +67 -0
  18. structkit/contribs/cloudformation-files.yaml +21 -0
  19. structkit/contribs/configs/chglog.yaml +31 -0
  20. structkit/contribs/configs/codeowners.yaml +3 -0
  21. structkit/contribs/configs/devcontainer.yaml +35 -0
  22. structkit/contribs/configs/editor-config.yaml +11 -0
  23. structkit/contribs/configs/eslint.yaml +30 -0
  24. structkit/contribs/configs/jshint.yaml +11 -0
  25. structkit/contribs/configs/kubectl.yaml +23 -0
  26. structkit/contribs/configs/prettier.yaml +19 -0
  27. structkit/contribs/docker-files.yaml +27 -0
  28. structkit/contribs/documentation-template.yaml +33 -0
  29. structkit/contribs/git-hooks.yaml +19 -0
  30. structkit/contribs/github/chatmodes/plan.yaml +18 -0
  31. structkit/contribs/github/instructions/generic.yaml +5 -0
  32. structkit/contribs/github/prompts/generic.yaml +4 -0
  33. structkit/contribs/github/prompts/react-form.yaml +17 -0
  34. structkit/contribs/github/prompts/security-api.yaml +8 -0
  35. structkit/contribs/github/prompts/struct.yaml +90 -0
  36. structkit/contribs/github/templates.yaml +91 -0
  37. structkit/contribs/github/workflows/codeql.yaml +88 -0
  38. structkit/contribs/github/workflows/execute-tf-workflow.yaml +39 -0
  39. structkit/contribs/github/workflows/labeler.yaml +77 -0
  40. structkit/contribs/github/workflows/pre-commit.yaml +27 -0
  41. structkit/contribs/github/workflows/release-drafter.yaml +77 -0
  42. structkit/contribs/github/workflows/run-struct.yaml +30 -0
  43. structkit/contribs/github/workflows/stale.yaml +16 -0
  44. structkit/contribs/helm-chart.yaml +160 -0
  45. structkit/contribs/kubernetes-manifests.yaml +103 -0
  46. structkit/contribs/project/custom-structures.yaml +24 -0
  47. structkit/contribs/project/generic.yaml +309 -0
  48. structkit/contribs/project/go.yaml +104 -0
  49. structkit/contribs/project/java.yaml +85 -0
  50. structkit/contribs/project/n8n.yaml +100 -0
  51. structkit/contribs/project/nodejs.yaml +101 -0
  52. structkit/contribs/project/python.yaml +136 -0
  53. structkit/contribs/project/ruby.yaml +130 -0
  54. structkit/contribs/project/rust.yaml +106 -0
  55. structkit/contribs/prompts/run-struct-trigger.yaml +18 -0
  56. structkit/contribs/terraform/apps/aws-accounts.yaml +21 -0
  57. structkit/contribs/terraform/apps/environments.yaml +41 -0
  58. structkit/contribs/terraform/apps/generic.yaml +41 -0
  59. structkit/contribs/terraform/apps/github-organization.yaml +40 -0
  60. structkit/contribs/terraform/apps/init.yaml +11 -0
  61. structkit/contribs/terraform/modules/generic.yaml +58 -0
  62. structkit/contribs/vagrant-files.yaml +21 -0
  63. structkit/file_item.py +182 -0
  64. structkit/filters.py +112 -0
  65. structkit/input_store.py +35 -0
  66. structkit/logging_config.py +36 -0
  67. structkit/main.py +85 -0
  68. structkit/mcp_server.py +347 -0
  69. structkit/model_wrapper.py +47 -0
  70. structkit/template_renderer.py +258 -0
  71. structkit/utils.py +36 -0
  72. structkit-3.0.0.dist-info/METADATA +182 -0
  73. structkit-3.0.0.dist-info/RECORD +77 -0
  74. structkit-3.0.0.dist-info/WHEEL +5 -0
  75. structkit-3.0.0.dist-info/entry_points.txt +2 -0
  76. structkit-3.0.0.dist-info/licenses/LICENSE +201 -0
  77. structkit-3.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,77 @@
1
+ files:
2
+ - .github/labeler.yml:
3
+ content: |
4
+ # Add 'root' label to any root file changes
5
+ # Quotation marks are required for the leading asterisk
6
+ root:
7
+ - changed-files:
8
+ - any-glob-to-any-file: '*'
9
+
10
+ # Add 'AnyChange' label to any changes within the entire repository
11
+ AnyChange:
12
+ - changed-files:
13
+ - any-glob-to-any-file: '**'
14
+
15
+ # Add 'Documentation' label to any changes within 'docs' folder or any subfolders
16
+ Documentation:
17
+ - changed-files:
18
+ - any-glob-to-any-file: docs/**
19
+
20
+ # Add 'Documentation' label to any file changes within 'docs' folder
21
+ Documentation:
22
+ - changed-files:
23
+ - any-glob-to-any-file: docs/*
24
+
25
+ # Add 'Documentation' label to any file changes within 'docs' or 'guides' folders
26
+ Documentation:
27
+ - changed-files:
28
+ - any-glob-to-any-file:
29
+ - docs/*
30
+ - guides/*
31
+
32
+ ## Equivalent of the above mentioned configuration using another syntax
33
+ Documentation:
34
+ - changed-files:
35
+ - any-glob-to-any-file: ['docs/*', 'guides/*']
36
+
37
+ # Add 'Documentation' label to any change to .md files within the entire repository
38
+ Documentation:
39
+ - changed-files:
40
+ - any-glob-to-any-file: '**/*.md'
41
+
42
+ # Add 'source' label to any change to src files within the source dir EXCEPT for the docs sub-folder
43
+ source:
44
+ - all:
45
+ - changed-files:
46
+ - any-glob-to-any-file: 'src/**/*'
47
+ - all-globs-to-all-files: '!src/docs/*'
48
+
49
+ # Add 'feature' label to any PR where the head branch name starts with `feature` or has a `feature` section in the name
50
+ feature:
51
+ - head-branch: ['^feature', 'feature']
52
+
53
+ # Add 'release' label to any PR that is opened against the `{{@ current_repo() | default_branch @}}` branch
54
+ release:
55
+ - base-branch: '{{@ current_repo() | default_branch @}}'
56
+
57
+ # Add 'bug' label to any PR where the head branch name starts with `bug` or has a `bug` section in the name
58
+ bug:
59
+ - head-branch: ['^bug', 'bug']
60
+
61
+ # Add 'docs' label to any PR where the head branch name starts with `docs` or has a `docs` section in the name
62
+ docs:
63
+ - head-branch: ['^docs', 'docs']
64
+ - .github/workflows/labeler.yaml:
65
+ content: |
66
+ name: "labeler"
67
+ on:
68
+ - pull_request_target
69
+
70
+ jobs:
71
+ labeler:
72
+ permissions:
73
+ contents: read
74
+ pull-requests: write
75
+ runs-on: ubuntu-latest
76
+ steps:
77
+ - uses: actions/labeler@{{@ "actions/labeler" | latest_release @}}
@@ -0,0 +1,27 @@
1
+ files:
2
+ - .github/workflows/z-pre-commit.yaml:
3
+ content: |
4
+ name: z-pre-commit
5
+
6
+ on:
7
+ pull_request:
8
+ branches: [{{@ current_repo() | default_branch @}}]
9
+ push:
10
+ branches: [{{@ current_repo() | default_branch @}}]
11
+
12
+ jobs:
13
+ pre-commit:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@{{@ "actions/checkout" | latest_release @}}
17
+ - uses: actions/setup-python@{{@ "actions/setup-python" | latest_release @}}
18
+ - uses: pre-commit/action@{{@ "pre-commit/action" | latest_release @}}
19
+ - .pre-commit-config.yaml:
20
+ content: |
21
+ repos:
22
+ - repo: https://github.com/pre-commit/pre-commit-hooks
23
+ rev: {{@ "pre-commit/pre-commit-hooks" | latest_release @}}
24
+ hooks:
25
+ - id: check-yaml
26
+ - id: end-of-file-fixer
27
+ - id: trailing-whitespace
@@ -0,0 +1,77 @@
1
+ files:
2
+ - .github/workflows/release-drafter.yaml:
3
+ content: |
4
+ name: release-drafter
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - {{@ current_repo() | default_branch @}}
10
+
11
+ jobs:
12
+ update_release_draft:
13
+ runs-on: ubuntu-latest
14
+ permissions:
15
+ contents: write
16
+ pull-requests: write
17
+ steps:
18
+ - name: Checkout
19
+ uses: actions/checkout@{{@ "actions/checkout" | latest_release @}}
20
+ with:
21
+ fetch-depth: 0
22
+ - uses: release-drafter/release-drafter@{{@ "release-drafter/release-drafter" | latest_release @}}
23
+ id: release-drafter
24
+ with:
25
+ config-name: release-drafter.yml
26
+ publish: false
27
+ prerelease: false
28
+ env:
29
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30
+ - .github/workflows/major-tagging.yaml:
31
+ content: |
32
+ name: major-tagging
33
+
34
+ on:
35
+ push:
36
+ tags:
37
+ - v** # Trigger on every tag push
38
+
39
+ jobs:
40
+ tag:
41
+ name: Move major tag
42
+ runs-on: ubuntu-latest
43
+ steps:
44
+ - uses: actions/checkout@{{@ "actions/checkout" | latest_release @}}
45
+ - uses: phwt/major-tagging-action@v1
46
+
47
+ - .github/release-drafter.yml:
48
+ content: |
49
+ name-template: "v$RESOLVED_VERSION"
50
+ tag-template: "v$RESOLVED_VERSION"
51
+ categories:
52
+ - title: "🚀 Features"
53
+ labels:
54
+ - "feature"
55
+ - "enhancement"
56
+ - title: "🐛 Bug Fixes"
57
+ labels:
58
+ - "fix"
59
+ - "bugfix"
60
+ - "bug"
61
+ change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
62
+ change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
63
+ version-template: "$MAJOR.$MINOR.$PATCH"
64
+ version-resolver:
65
+ major:
66
+ labels:
67
+ - "major"
68
+ minor:
69
+ labels:
70
+ - "minor"
71
+ patch:
72
+ labels:
73
+ - "patch"
74
+ default: patch
75
+ template: |
76
+ ## Changes
77
+ $CHANGES
@@ -0,0 +1,30 @@
1
+ files:
2
+ - .github/workflows/run-struct.yaml:
3
+ skip_if_exists: true
4
+ content: |
5
+ name: run-struct
6
+
7
+ on:
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ generate:
12
+ uses: httpdss/structkit/.github/workflows/struct-generate.yaml@main
13
+ with:
14
+ struct_file: 'file://.struct.yaml'
15
+ output_dir: '.'
16
+ secrets:
17
+ token: {{@ github_token @}}
18
+ - .struct.yaml:
19
+ skip_if_exists: true
20
+ content: |
21
+ files:
22
+ - README.md:
23
+ content: |
24
+ # Sample content
25
+
26
+ variables:
27
+ - github_token:
28
+ type: string
29
+ description: 'GitHub token'
30
+ default: "${{ secrets.STRUCT_RUN_TOKEN }}"
@@ -0,0 +1,16 @@
1
+ files:
2
+ - .github/workflows/stale.yaml:
3
+ content: |
4
+ name: 'stale'
5
+ on:
6
+ schedule:
7
+ - cron: '30 1 * * *'
8
+
9
+ jobs:
10
+ stale:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/stale@{{@ "actions/stale" | latest_release @}}
14
+ with:
15
+ stale-issue-message: 'Message to comment on stale issues. If none provided, will not mark issues stale'
16
+ stale-pr-message: 'Message to comment on stale PRs. If none provided, will not mark PRs stale'
@@ -0,0 +1,160 @@
1
+ files:
2
+ - Chart.yaml:
3
+ content: |
4
+ apiVersion: v2
5
+ name: my-helm-chart
6
+ description: A Helm chart for Kubernetes
7
+ version: 0.1.0
8
+ appVersion: "1.0"
9
+ - values.yaml:
10
+ content: |
11
+ replicaCount: 1
12
+ image:
13
+ repository: nginx
14
+ tag: stable
15
+ pullPolicy: IfNotPresent
16
+ service:
17
+ type: ClusterIP
18
+ port: 80
19
+ ingress:
20
+ enabled: false
21
+ annotations: {}
22
+ hosts:
23
+ - host: chart-example.local
24
+ paths: []
25
+ tls: []
26
+ resources: {}
27
+ nodeSelector: {}
28
+ tolerations: []
29
+ affinity: {}
30
+ - charts/.gitkeep:
31
+ content: ""
32
+ - templates/deployment.yaml:
33
+ content: |
34
+ apiVersion: apps/v1
35
+ kind: Deployment
36
+ metadata:
37
+ name: {{ .Release.Name }}-{{ .Chart.Name }}
38
+ labels:
39
+ app: {{ .Chart.Name }}
40
+ chart: {{ .Chart.Name }}-{{ .Chart.Version }}
41
+ release: {{ .Release.Name }}
42
+ heritage: {{ .Release.Service }}
43
+ spec:
44
+ replicas: {{ .Values.replicaCount }}
45
+ selector:
46
+ matchLabels:
47
+ app: {{ .Chart.Name }}
48
+ release: {{ .Release.Name }}
49
+ template:
50
+ metadata:
51
+ labels:
52
+ app: {{ .Chart.Name }}
53
+ release: {{ .Release.Name }}
54
+ spec:
55
+ containers:
56
+ - name: {{ .Chart.Name }}
57
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
58
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
59
+ ports:
60
+ - containerPort: 80
61
+ livenessProbe:
62
+ httpGet:
63
+ path: /
64
+ port: 80
65
+ initialDelaySeconds: 60
66
+ periodSeconds: 10
67
+ readinessProbe:
68
+ httpGet:
69
+ path: /
70
+ port: 80
71
+ initialDelaySeconds: 60
72
+ periodSeconds: 10
73
+ resources:
74
+ {{- toYaml .Values.resources | nindent 12 }}
75
+ - templates/service.yaml:
76
+ content: |
77
+ apiVersion: v1
78
+ kind: Service
79
+ metadata:
80
+ name: {{ .Release.Name }}-{{ .Chart.Name }}
81
+ labels:
82
+ app: {{ .Chart.Name }}
83
+ chart: {{ .Chart.Name }}-{{ .Chart.Version }}
84
+ release: {{ .Release.Name }}
85
+ heritage: {{ .Release.Service }}
86
+ spec:
87
+ type: {{ .Values.service.type }}
88
+ ports:
89
+ - port: {{ .Values.service.port }}
90
+ targetPort: 80
91
+ protocol: TCP
92
+ name: http
93
+ selector:
94
+ app: {{ .Chart.Name }}
95
+ release: {{ .Release.Name }}
96
+ - templates/ingress.yaml:
97
+ content: |
98
+ {{- if .Values.ingress.enabled -}}
99
+ apiVersion: networking.k8s.io/v1
100
+ kind: Ingress
101
+ metadata:
102
+ name: {{ .Release.Name }}-{{ .Chart.Name }}
103
+ annotations:
104
+ {{- range $key, $value := .Values.ingress.annotations }}
105
+ {{ $key }}: {{ $value | quote }}
106
+ {{- end }}
107
+ spec:
108
+ rules:
109
+ {{- range .Values.ingress.hosts }}
110
+ - host: {{ .host | quote }}
111
+ http:
112
+ paths:
113
+ {{- range .paths }}
114
+ - path: {{ . }}
115
+ pathType: ImplementationSpecific
116
+ backend:
117
+ service:
118
+ name: {{ $.Release.Name }}-{{ $.Chart.Name }}
119
+ port:
120
+ number: 80
121
+ {{- end }}
122
+ {{- end }}
123
+ {{- if .Values.ingress.tls }}
124
+ tls:
125
+ {{- range .Values.ingress.tls }}
126
+ - hosts:
127
+ {{- range .hosts }}
128
+ - {{ . | quote }}
129
+ {{- end }}
130
+ secretName: {{ .secretName | quote }}
131
+ {{- end }}
132
+ {{- end }}
133
+ {{- end }}
134
+ - templates/_helpers.tpl:
135
+ content: |
136
+ {{/*
137
+ Create a default chart name and version as release-name.version
138
+ */}}
139
+ {{- define "my-helm-chart.chart" -}}
140
+ {{- printf "%s-%s" .Chart.Name .Chart.Version | trunc 63 | trimSuffix "-" -}}
141
+ {{- end }}
142
+ - .helmignore:
143
+ content: |
144
+ # Patterns to ignore when building packages.
145
+ # This supports shell glob matching, relative path matching, and
146
+ # negation (prefixed with !).
147
+ .DS_Store
148
+ .git/
149
+ .gitignore
150
+ .gcloudignore
151
+ .helmignore
152
+ *.swp
153
+ *.bak
154
+ *.tmp
155
+ *.orig
156
+ *.old
157
+ .project
158
+ .idea/
159
+ *.tmproj
160
+ .vscode/
@@ -0,0 +1,103 @@
1
+ files:
2
+ - deployment.yaml:
3
+ content: |
4
+ apiVersion: apps/v1
5
+ kind: Deployment
6
+ metadata:
7
+ name: {{@ deployment_name | slugify @}}
8
+ labels:
9
+ app: {{@ app_name | slugify @}}
10
+ spec:
11
+ replicas: 2
12
+ selector:
13
+ matchLabels:
14
+ app: {{@ app_name | slugify @}}
15
+ template:
16
+ metadata:
17
+ labels:
18
+ app: {{@ app_name | slugify @}}
19
+ spec:
20
+ containers:
21
+ - name: {{@ app_name | slugify @}}
22
+ image: {{@ image_name @}}:{{@ image_tag @}}
23
+ ports:
24
+ - containerPort: 80
25
+ - service.yaml:
26
+ content: |
27
+ apiVersion: v1
28
+ kind: Service
29
+ metadata:
30
+ name: example-service
31
+ spec:
32
+ selector:
33
+ app: {{@ app_name | slugify @}}
34
+ ports:
35
+ - protocol: TCP
36
+ port: 80
37
+ targetPort: 80
38
+ - ingress.yaml:
39
+ content: |
40
+ apiVersion: networking.k8s.io/v1
41
+ kind: Ingress
42
+ metadata:
43
+ name: example-ingress
44
+ spec:
45
+ rules:
46
+ - host: example.com
47
+ http:
48
+ paths:
49
+ - path: /
50
+ pathType: Prefix
51
+ backend:
52
+ service:
53
+ name: example-service
54
+ port:
55
+ number: 80
56
+ - configmap.yaml:
57
+ content: |
58
+ apiVersion: v1
59
+ kind: ConfigMap
60
+ metadata:
61
+ name: example-config
62
+ data:
63
+ example.property: "value"
64
+ - secrets.yaml:
65
+ content: |
66
+ apiVersion: v1
67
+ kind: Secret
68
+ metadata:
69
+ name: example-secret
70
+ type: Opaque
71
+ data:
72
+ password: dXNlcl9wYXNzd29yZA== # base64 encoded 'user_password'
73
+ - README.md:
74
+ content: |
75
+ # App Name
76
+ Kubernetes manifests for deploying the example app.
77
+
78
+ ## Usage
79
+
80
+ ```bash
81
+ kubectl apply -f deployment.yaml
82
+ kubectl apply -f service.yaml
83
+ kubectl apply -f ingress.yaml
84
+ kubectl apply -f configmap.yaml
85
+ kubectl apply -f secrets.yaml
86
+ ```
87
+
88
+ variables:
89
+ - app_name:
90
+ description: "The name of the application."
91
+ type: string
92
+ default: "example-app"
93
+ - deployment_name:
94
+ description: "The name of the deployment"
95
+ type: string
96
+ default: "example-app-deployment"
97
+ - image_name:
98
+ description: "The name of the Docker image."
99
+ type: string
100
+ - image_tag:
101
+ description: "The tag of the Docker image."
102
+ type: string
103
+ default: "latest"
@@ -0,0 +1,24 @@
1
+ files:
2
+ - README.md:
3
+ content: |
4
+ # Custom StructKit Structures
5
+ - custom-mappings.yaml:
6
+ content: |
7
+ # Custom StructKit Mappings
8
+ # This file defines custom mappings for the Struct.
9
+ mappings:
10
+ aws_account_ids:
11
+ nonprod: "123456789012"
12
+ prod: "987654321098"
13
+
14
+ - structures/.gitkeep:
15
+ content: ""
16
+ folders:
17
+ - ./:
18
+ struct:
19
+ - configs/devcontainer
20
+ - configs/editor-config
21
+ - configs/prettier
22
+ - github/workflows/run-struct
23
+ - github/workflows/release-drafter
24
+ - github/workflows/pre-commit