-
Notifications
You must be signed in to change notification settings - Fork 0
Create Gen App – tighten prompt mapping, simplify extraction, and refresh integration tests #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b39c01f
refactor: update answer keys in integration helpers for consistency
sdqede c663db3
refactor: remove ignored patterns handling from extract logic
sdqede 72d78b4
feat: enhance license handling with new utility functions
sdqede b624e45
refactor: improve CLI override handling in project prompts
sdqede 1769f30
test: refine template variable hydration and update integration test …
sdqede File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -284,7 +284,7 @@ module.exports = { | |
| ); | ||
| }); | ||
|
|
||
| it("should map CLI overrides with similar names to project questions", async () => { | ||
| it("should require exact CLI override names", async () => { | ||
| const { Inquirerer } = require("inquirerer"); | ||
| const mockPrompt = jest.fn().mockResolvedValue({}); | ||
|
|
||
|
|
@@ -312,10 +312,11 @@ module.exports = { | |
| await promptUser(extractedVariables, argv, false); | ||
|
|
||
| const passedArgv = mockPrompt.mock.calls[0][0]; | ||
| expect(passedArgv.fullName).toBe("CLI User"); | ||
| expect(passedArgv.fullName).toBeUndefined(); | ||
| expect(passedArgv.USERFULLNAME).toBe("CLI User"); | ||
| }); | ||
|
|
||
| it("should match CLI overrides sharing substrings", async () => { | ||
| it("should not map CLI overrides sharing substrings", async () => { | ||
| const { Inquirerer } = require("inquirerer"); | ||
| const mockPrompt = jest.fn().mockResolvedValue({}); | ||
|
|
||
|
|
@@ -343,7 +344,8 @@ module.exports = { | |
| await promptUser(extractedVariables, argv, false); | ||
|
|
||
| const passedArgv = mockPrompt.mock.calls[0][0]; | ||
| expect(passedArgv.description).toBe("CLI description"); | ||
| expect(passedArgv.description).toBeUndefined(); | ||
| expect(passedArgv.MODULEDESC).toBe("CLI description"); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. where do these ALL CAPS come from? |
||
| }); | ||
|
|
||
| it("should hydrate template variables from alias answers", async () => { | ||
|
|
@@ -376,7 +378,7 @@ module.exports = { | |
| expect(answers.fullName).toBe("Prompted User"); | ||
| }); | ||
|
|
||
| it("should hydrate overlapping template variables from answers", async () => { | ||
| it("should not hydrate overlapping template variables implicitly", async () => { | ||
| const { Inquirerer } = require("inquirerer"); | ||
| const mockPrompt = jest.fn().mockResolvedValue({ | ||
| description: "Prompted description", | ||
|
|
@@ -404,7 +406,7 @@ module.exports = { | |
|
|
||
| const answers = await promptUser(extractedVariables, {}, false); | ||
| expect(answers.description).toBe("Prompted description"); | ||
| expect(answers.moduleDesc).toBe("Prompted description"); | ||
| expect(answers.moduleDesc).toBeUndefined(); | ||
| }); | ||
| }); | ||
|
|
||
|
|
@@ -564,39 +566,4 @@ module.exports = { | |
| }); | ||
| }); | ||
|
|
||
| it("should respect ignore patterns from questions", async () => { | ||
| const ignoredDir = path.join(testTempDir, "__tests__"); | ||
| fs.mkdirSync(ignoredDir); | ||
| fs.writeFileSync( | ||
| path.join(ignoredDir, "example.txt"), | ||
| "This file has ____ignored____ variable" | ||
| ); | ||
| fs.writeFileSync( | ||
| path.join(testTempDir, ".questions.json"), | ||
| JSON.stringify({ | ||
| ignore: ["__tests__"], | ||
| questions: [], | ||
| }) | ||
| ); | ||
|
|
||
| const result = await extractVariables(testTempDir); | ||
|
|
||
| expect(result.fileReplacers.map((r) => r.variable)).not.toContain("tests"); | ||
| expect(result.contentReplacers.map((r) => r.variable)).not.toContain( | ||
| "IGNORED" | ||
| ); | ||
| }); | ||
|
|
||
| it("should skip default ignored content tokens", async () => { | ||
| fs.writeFileSync( | ||
| path.join(testTempDir, "jest.config.js"), | ||
| "// Match both __tests__ and colocated test files" | ||
| ); | ||
|
|
||
| const result = await extractVariables(testTempDir); | ||
|
|
||
| expect(result.contentReplacers.map((r) => r.variable)).not.toContain( | ||
| "tests" | ||
| ); | ||
| }); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where do these ALL CAPS come from?