Skip to content

fixes #1, fixes #3 - #4

Merged
saeidex merged 2 commits into
mainfrom
dev
Aug 18, 2026
Merged

saeidex merged 2 commits into
mainfrom
dev

Conversation

@saeidex

@saeidex saeidex commented Aug 18, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI lite review requested due to automatic review settings August 18, 2026 18:17
@saeidex saeidex changed the title Fixes issues #1 and #3 Fixes: #1 and #3 Aug 18, 2026
@saeidex saeidex changed the title Fixes: #1 and #3 fix: #1 and #3 Aug 18, 2026
@saeidex
saeidex merged commit 5082032 into main Aug 18, 2026
1 check passed
@saeidex

saeidex commented Aug 18, 2026 •

Copy link
Copy Markdown
Owner Author

fixes #1
fixes #3

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR appears to address issues #1 and #3 by making generated position values configurable (via CLI offsets) and by adjusting how view field definitions are assembled during code generation.

Changes:

  • Added CLI options --views-base-position and --nav-menu-items-base-position and threaded their parsed values into generation behavior.
  • Introduced a shared position “store” utility and switched view/nav-menu generators to use incrementing positions instead of hard-coded 0.
  • Added a stringToInt helper and refactored generateTwentyViewFields to build output via string concatenation.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/internal/utils/temp-store.ts New global stores for view/nav-menu positions, currently initialized by calling createCLI() at module import time.
src/internal/utils/string-to-int.ts New helper for converting CLI option values to integers with fallback behavior.
src/internal/generators/generate-twenty-view.ts Uses the new temp store to assign incremental view positions.
src/internal/generators/generate-twenty-view-fields.ts Refactors view-fields string construction and introduces a (fixable) separator naming typo.
src/internal/generators/generate-twenty-nav-menu-item.ts Uses the new temp store to assign incremental nav menu item positions.
src/internal/create-cli.ts Adds new CLI options and converts them to numbers in the .action handler.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +1 to +5
import { createCLI } from "../create-cli.js";

const { viewsBasePosition, navMenuItemsBasePosition } =
createCLI();

Comment on lines +3 to +18
export const stringToInt = (str: any): number => {
let num = parseInt(str as string, 10);

if (isNaN(num)) {
console.error(
styleText(
"red",
`Cannot convert "${str}" to an integer. Falling back to 0.`
)
);

num = 0;
}

return num;
};
Comment on lines +56 to +58
const labelFieldSeperator = islabelFieldExists
? fieldSeperator
: "\n";
Comment on lines +89 to +90
.option("--views-base-position <number>", "offset for views starting index", DEFAULT_VIEWS_BASE_POSITION)
.option("--nav-menu-items-base-position <number>", "offset for navigation menu items starting index", DEFAULT_NAV_MENU_ITEMS_BASE_POSITION)
@saeidex
saeidex deleted the dev branch August 18, 2026 18:26
@saeidex saeidex changed the title fix: #1 and #3 fixes #1, fixes #3 Aug 18, 2026
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.

2 participants