Skip to content

Split boilerplate generation into separate files per frame format - #65

Merged
rijesha merged 2 commits into
mainfrom
copilot/add-boilerplate-files-for-frames
Dec 3, 2025
Merged

Split boilerplate generation into separate files per frame format#65
rijesha merged 2 commits into
mainfrom
copilot/add-boilerplate-files-for-frames

Conversation

Copilot AI commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

Boilerplate generation now creates individual files for each frame format instead of a single monolithic file, plus a base file with common utilities and an index file for easy importing.

Generated File Structure

Language Base Individual Formats Index
Python frame_base.py basic_frame.py, tiny_frame.py, ... __init__.py
TypeScript frame_base.ts BasicFrame.ts, TinyFrame.ts, ... index.ts
JavaScript frame_base.js BasicFrame.js, TinyFrame.js, ... index.js
C frame_base.h basic_frame.h, tiny_frame.h, ... frame_parsers.h
C++ frame_base.hpp BasicFrame.hpp, TinyFrame.hpp, ... frame_parsers.hpp

Usage

# Import specific frame formats
from my_package import BasicFrame, TinyFrame

# Or import everything via index
from my_package import *
// Include all formats
#include "frame_parsers.h"

// Or include specific format
#include "basic_frame.h"

Changes

  • Frame parser generators: Added generate_*_multi() functions returning {filename: content} dicts
  • generate_boilerplate.py: Uses multi-file generation by default via multi_file=True parameter
  • generate.py: Copies entire boilerplate directories instead of specific files
  • Tests: Updated includes from frame_parsers_gen.hframe_parsers.h
Original prompt

This section details on the original issue you should resolve

<issue_title>Boilerplate generation should create more files</issue_title>
<issue_description>Boilerplate file generation should create a new file for each frame format. There should also be a base file for each language that has common functions.
There should also be a file the allows each frame format to be imported in.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Modified frame parser generators (Python, TypeScript, JavaScript, C, C++) to generate multiple files:
  - A base file with common utilities (checksum, FrameMsgInfo, FrameFormatType enum)
  - Individual files for each frame format
  - An index/main file that exports all frame formats
- Updated generate_boilerplate.py to use new multi-file generation
- Updated generate.py to copy all boilerplate files instead of specific files
- Updated test files to use new header names (frame_parsers.h/.hpp)
- Regenerated boilerplate files with new multi-file structure

Co-authored-by: rijesha <7819200+rijesha@users.noreply.github.com>
Copilot AI changed the title [WIP] Add boilerplate file generation for each frame format Split boilerplate generation into separate files per frame format Dec 3, 2025
Copilot AI requested a review from rijesha December 3, 2025 18:05
@rijesha
rijesha marked this pull request as ready for review December 3, 2025 19:15
@rijesha
rijesha merged commit 005b3ca into main Dec 3, 2025
2 checks passed
@rijesha
rijesha deleted the copilot/add-boilerplate-files-for-frames branch December 6, 2025 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Boilerplate generation should create more files

2 participants