Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[run]
branch = True
source = struct_module
source = structkit

[report]
omit =
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Struct devcontainer",
"name": "StructKit devcontainer",
"image": "mcr.microsoft.com/devcontainers/python:3",
"features": {
// "ghcr.io/devcontainers/features/python:1": {},
Expand Down
28 changes: 14 additions & 14 deletions .github/instructions/struct.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
applyTo: '**'
---

# Struct Assistant
# StructKit Assistant

## Role

You are an expert assistant that generates valid `.struct.yaml` files for the [STRUCT tool](https://github.com/httpdss/struct), which automates project structure generation from YAML configuration.
You are an expert assistant that generates valid `.struct.yaml` files for the [StructKit tool](https://github.com/httpdss/struct), which automates project structure generation from YAML configuration.

## Defining the `.struct.yaml` file

Expand All @@ -29,10 +29,10 @@ files:

### Defining folders

The `folders` key is used to define folders that are created. Each folder path should include a `struct` key with a list of struct files to call. Optionally, you can define the value of a variable using the `with:` key.
The list of struct files available can be taken from all the files defined inside `struct_module/contribs/`.
Remember the name of the struct file is the path to the file without the `.yaml` extension.
Read from the struct file to kown the variables that can be used.
The `folders` key is used to define folders that are created. Each folder path should include a `struct` key with a list of structkit files to call. Optionally, you can define the value of a variable using the `with:` key.
The list of structkit files available can be taken from all the files defined inside `structkit/contribs/`.
Remember the name of the structkit file is the path to the file without the `.yaml` extension.
Read from the structkit file to kown the variables that can be used.

```yaml
folders:
Expand All @@ -48,7 +48,7 @@ folders:

### Defining variables

The `variables` key is used to define variables that can be used in the struct files. Each variable should have a description, type, and optional default value.
The `variables` key is used to define variables that can be used in the structkit files. Each variable should have a description, type, and optional default value.

```yaml
variables:
Expand All @@ -63,15 +63,15 @@ variables:
- Follow the JSON Schema definition provided in the references.
- Use valid keys: `files`, `folders`, and `variables`.
- if you want to define files, use the `files:` key, and a list of file paths that are created. each file path should have a content key.
- if you want to define folders, use the `folders:` key, and a list of folder paths that are created. each folder path should have a list of folder paths and each folder path needs to have a list of struct keys. also if you want to define the value of a variable then you should use the `with:` key.
- Follow the conventions from the STRUCT README provided in the references.
- if you want to define folders, use the `folders:` key, and a list of folder paths that are created. each folder path should have a list of folder paths and each folder path needs to have a list of structkit keys. also if you want to define the value of a variable then you should use the `with:` key.
- Follow the conventions from the StructKit README provided in the references.
- Include content blocks under `content:` using pipe notation (`|`) when needed.
- Use `permissions`, `skip`, or `skip_if_exists` if specified. This is used only for the `files` key.
- Use `file:` to reference the content of a file or `content:` to define the content of the file.
- Use `struct:` to define the list of struct files to call for a folder.
- When defining the list of struct files you want to use, make sure to query the `structure name` to know what to use. this will be at ../../docs/structures.md.
- Use `struct:` to define the list of structkit files to call for a folder.
- When defining the list of structkit files you want to use, make sure to query the `structure name` to know what to use. this will be at ../../docs/structures.md.
- Optionally, use Jinja2 custom filters such as `| latest_release`, `| default_branch`, or `| slugify`.
- before creating a file from scratch, check that there is no struct contrib available that can be used to create the file.
- before creating a file from scratch, check that there is no structkit contrib available that can be used to create the file.

## Output

Expand All @@ -89,6 +89,6 @@ Always return YAML that is syntactically correct and validated against the provi

## References

- [STRUCT json schema](../../struct-schema.json)
- [STRUCT README](../../README.md)
- [StructKit json schema](../../struct-schema.json)
- [StructKit README](../../README.md)
- [Structures available in contribs](../../doc/structures.md)
22 changes: 11 additions & 11 deletions .github/prompts/struct.prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Role

You are an expert assistant that generates valid `.struct.yaml` files for the [STRUCT tool](https://github.com/httpdss/struct), which automates project structure generation from YAML configuration.
You are an expert assistant that generates valid `.struct.yaml` files for the [StructKit tool](https://github.com/httpdss/struct), which automates project structure generation from YAML configuration.

## Defining the `.struct.yaml` file

Expand All @@ -25,10 +25,10 @@ structures:

### Defining folders

The `folders` key is used to define folders that are created. Each folder path should include a `struct` key with a list of struct files to call. Optionally, you can define the value of a variable using the `with:` key.
The list of struct files available can be taken from all the files defined inside `struct_module/contribs/`.
Remember the name of the struct file is the path to the file without the `.yaml` extension.
Read from the struct file to kown the variables that can be used.
The `folders` key is used to define folders that are created. Each folder path should include a `struct` key with a list of structkit files to call. Optionally, you can define the value of a variable using the `with:` key.
The list of structkit files available can be taken from all the files defined inside `structkit/contribs/`.
Remember the name of the structkit file is the path to the file without the `.yaml` extension.
Read from the structkit file to kown the variables that can be used.

```yaml
folders:
Expand All @@ -44,7 +44,7 @@ folders:

### Defining variables

The `variables` key is used to define variables that can be used in the struct files. Each variable should have a description, type, and optional default value.
The `variables` key is used to define variables that can be used in the structkit files. Each variable should have a description, type, and optional default value.

```yaml
variables:
Expand All @@ -59,12 +59,12 @@ variables:
- Follow the JSON Schema definition provided in the references.
- Use valid keys: `structures`, `folders`, and `variables`.
- if you want to define files, use the `structures:` key, and a list of file paths that are created. each file path should have a content key.
- if you want to define folders, use the `folders:` key, and a list of folder paths that are created. each folder path should have a list of folder paths and each folder path needs to have a list of struct keys. also if you want to define the value of a variable then you should use the `with:` key.
- Follow the conventions from the STRUCT README provided in the references.
- if you want to define folders, use the `folders:` key, and a list of folder paths that are created. each folder path should have a list of folder paths and each folder path needs to have a list of structkit keys. also if you want to define the value of a variable then you should use the `with:` key.
- Follow the conventions from the StructKit README provided in the references.
- Include content blocks under `content:` using pipe notation (`|`) when needed.
- Use `permissions`, `skip`, or `skip_if_exists` if specified. This is used only for the `structures` key.
- Use `file:` to reference the content of a file or `content:` to define the content of the file.
- Use `struct:` to define the list of struct files to call for a folder.
- Use `struct:` to define the list of structkit files to call for a folder.
- Optionally, use Jinja2 custom filters such as `| latest_release`, `| default_branch`, or `| slugify`.

## Output
Expand All @@ -83,5 +83,5 @@ Always return YAML that is syntactically correct and validated against the provi

## References

- [STRUCT json schema](https://raw.githubusercontent.com/httpdss/struct/refs/heads/main/struct-schema.json)
- [STRUCT README](https://raw.githubusercontent.com/httpdss/struct/refs/heads/main/README.md)
- [StructKit json schema](https://raw.githubusercontent.com/httpdss/struct/refs/heads/main/struct-schema.json)
- [StructKit README](https://raw.githubusercontent.com/httpdss/struct/refs/heads/main/README.md)
9 changes: 4 additions & 5 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/* --skip-existing

- name: Create release note
if: github.event_name == 'release'
- name: Put pypi url on job summary
run: |
echo "Package published to PyPI successfully!"
echo "Version: ${{ github.event.release.tag_name }}"
echo "PyPI URL: https://pypi.org/project/struct/"
echo "## PyPI Package Published" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "The package has been published to [PyPI](https://pypi.org/project/structkit/)." >> $GITHUB_STEP_SUMMARY
22 changes: 11 additions & 11 deletions .github/workflows/struct-generate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_call:
inputs:
struct_file:
description: 'Path to the STRUCT file'
description: 'Path to the StructKit file'
type: string
required: false
default: '.struct.yaml'
Expand All @@ -14,20 +14,20 @@ on:
required: false
default: '.'
args:
description: 'Additional arguments to pass to STRUCT'
description: 'Additional arguments to pass to StructKit'
type: string
required: false
default: ''
pr_title:
description: 'Title of the PR'
type: string
required: false
default: 'Run STRUCT generate on repository'
default: 'Run StructKit generate on repository'
pr_body:
description: 'Body of the PR'
type: string
required: false
default: 'This PR was automatically generated by the STRUCT action.'
default: 'This PR was automatically generated by the StructKit action.'
pr_assignees:
description: 'Assignees of the PR'
type: string
Expand Down Expand Up @@ -70,10 +70,10 @@ jobs:
with:
python-version: '3.x'

- name: Install STRUCT
- name: Install StructKit
run: |
pip install git+https://github.com/httpdss/struct.git
struct -h
structkit -h

- name: Install custom structures
if: ${{ inputs.custom_structure_repository != '' }}
Expand All @@ -84,25 +84,25 @@ jobs:
path: ./custom-structures
fetch-depth: 1

- name: Run STRUCT
- name: Run StructKit
env:
GITHUB_TOKEN: ${{ secrets.token }}
run: |
if [ -d ./custom-structures ]; then

struct list \
structkit list \
-s ./custom-structures/${{ inputs.custom_structure_path }}

struct generate \
structkit generate \
--non-interactive \
-s ./custom-structures/${{ inputs.custom_structure_path }} \
${{ inputs.args }} \
${{ inputs.struct_file }} \
${{ inputs.output_dir }}
else
struct list
structkit list

struct generate \
structkit generate \
--non-interactive \
${{ inputs.args }} \
${{ inputs.struct_file }} \
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/struct-on-gha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@ jobs:
with:
python-version: '3.x'

- name: Install STRUCT
- name: Install StructKit
run: |
pip install git+https://github.com/httpdss/struct.git
struct -h
structkit -h

- name: Run STRUCT
- name: Run StructKit
run: |
# struct generate ...
struct list
# structkit generate ...
structkit list

- name: Generate PR with changes
if: github.event_name == 'workflow_dispatch'
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Run STRUCT generate on repository"
title: "Run STRUCT generate on repository"
commit-message: "Run StructKit generate on repository"
title: "Run StructKit generate on repository"
body: |
This PR was automatically generated by the STRUCT action.
This PR was automatically generated by the StructKit action.
base: "main"
assignees: "httpdss"
branch: repository-dispatch/update-${{ github.run_id }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-script.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
shell: bash
run: |
echo "REPORT_FILE=${REPORT_OUTPUT}" >> "$GITHUB_ENV"
pytest --cov=struct_module --cov-branch --cov-report=xml -v --md-report --md-report-flavor gfm --md-report-exclude-outcomes passed skipped xpassed --md-report-output "$REPORT_OUTPUT" --pyargs tests
pytest --cov=structkit --cov-branch --cov-report=xml -v --md-report --md-report-flavor gfm --md-report-exclude-outcomes passed skipped xpassed --md-report-output "$REPORT_OUTPUT" --pyargs tests

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
Expand Down
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"yaml.schemas": {
"file:///home/kenny/.vscode-server/extensions/atlassian.atlascode-4.0.6/resources/schemas/pipelines-schema.json": "bitbucket-pipelines.yml",
"file:///home/kenny/.vscode-server/extensions/httpdss.vscode-struct-0.1.0/schemas/struct-schema.json": [
"*.struct.yaml"
]
}
}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN pip install argcomplete
COPY . .

# Register the script for auto-completion
RUN echo 'eval "$(register-python-argcomplete struct)"' >> /etc/bash.bashrc
RUN echo 'eval "$(register-python-argcomplete structkit)"' >> /etc/bash.bashrc

# Run your script when the container launches
ENTRYPOINT ["python", "struct_module/main.py"]
ENTRYPOINT ["python", "structkit/main.py"]
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
recursive-include struct_module/contribs *
recursive-include structkit/contribs *
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# 🚀 STRUCT: Automated Project Structure Generator
# 🚀 StructKit: Automated Project Structure Generator

![STRUCT Logo](./docs/assets/github-hero.gif)
![StructKit Logo](./docs/assets/github-hero.gif)

[![codecov](https://codecov.io/github/httpdss/struct/graph/badge.svg?token=JL5WIO1C9T)](https://codecov.io/github/httpdss/struct)
![GitHub issues](https://img.shields.io/github/issues/httpdss/struct)
![GitHub pull requests](https://img.shields.io/github/issues-pr/httpdss/struct)
![GitHub stars](https://img.shields.io/github/stars/httpdss/struct?style=social)

**STRUCT** is a powerful, flexible tool for automating project structure creation through YAML configurations. Generate consistent project layouts, boilerplate code, and configurations with template variables, remote content fetching, and intelligent file handling.
**StructKit** is a powerful, flexible tool for automating project structure creation through YAML configurations. Generate consistent project layouts, boilerplate code, and configurations with template variables, remote content fetching, and intelligent file handling.

> 📚 **[View Complete Documentation](docs/index.md)** | 🚀 **[Quick Start Guide](docs/quickstart.md)** | 🔧 **[Installation](docs/installation.md)**

Expand Down Expand Up @@ -38,16 +38,16 @@ docker run -v $(pwd):/workdir ghcr.io/httpdss/struct:main generate my-config.yam

```bash
# Generate a Terraform module structure
struct generate terraform-module ./my-terraform-module
structkit generate terraform-module ./my-terraform-module

# List available structures
struct list
structkit list

# Validate a configuration
struct validate my-config.yaml
structkit validate my-config.yaml

# Start MCP server for AI integration
struct mcp --server
structkit mcp --server
```

### Example Configuration
Expand All @@ -57,7 +57,7 @@ files:
- README.md:
content: |
# {{@ project_name @}}
Generated with STRUCT
Generated with StructKit
- .gitignore:
file: github://github/gitignore/main/Python.gitignore

Expand Down Expand Up @@ -101,7 +101,7 @@ Our comprehensive documentation is organized into the following sections:

### 👩‍💻 Development

- **[Development Setup](docs/development.md)** - Contributing to STRUCT
- **[Development Setup](docs/development.md)** - Contributing to StructKit
- **[Known Issues](docs/known-issues.md)** - Current limitations and workarounds

### 📖 Resources
Expand All @@ -128,7 +128,7 @@ MIT License - see [LICENSE](LICENSE) for details.

## 💰 Support

If STRUCT helps your workflow, consider supporting the project: [patreon/structproject](https://patreon.com/structproject)
If StructKit helps your workflow, consider supporting the project: [patreon/structproject](https://patreon.com/structproject)

---

Expand Down
Loading
Loading