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 packages/core/src/amazonqFeatureDev/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const featureDevChat = 'featureDevChat'
export const featureName = 'Amazon Q Developer Agent for software development'

export const generateDevFilePrompt =
"generate a devfile in my repository. Note that you should only use devfile version 2.0.0 and the only supported command is test, so you should bundle all install, build and test commands in “test”. also you can use public.ecr.aws/aws-mde/universal-image:latest” as universal image if you aren’t sure which image to use. here is an example for a node repository (but don't assume it's always a node project. look at the existing repository structure before generating the devfile): schemaVersion: 2.0.0 components: - name: dev container: image: public.ecr.aws/aws-mde/universal-image:latest commands: - id: test exec: component: dev commandLine: npm install && npm run build && npm run test”"
"generate a devfile in my repository. Note that you should only use devfile version 2.0.0 and the only supported commands are install, build and test (are all optional). so you may have to bundle some commands together using '&&'. also you can use public.ecr.aws/aws-mde/universal-image:latest” as universal image if you aren’t sure which image to use. here is an example for a node repository (but don't assume it's always a node project. look at the existing repository structure before generating the devfile): schemaVersion: 2.0.0 components: - name: dev container: image: public.ecr.aws/aws-mde/universal-image:latest commands: - id: install exec: component: dev commandLine: npm install” - id: build exec: component: dev commandLine: ”npm run build” - id: test exec: component: dev commandLine: ”npm run test”"

// Max allowed size for file collection
export const maxRepoSizeBytes = 200 * 1024 * 1024
Expand Down
9 changes: 8 additions & 1 deletion packages/core/src/shared/filetypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,15 @@ export const codefileExtensions = new Set([
// Code file names without an extension
export const codefileNames = new Set(['Dockerfile', 'Dockerfile.build', 'gradlew', 'mvnw'])

// Build file names
export const buildfileNames = new Set(['gradle/wrapper/gradle-wrapper.jar'])
Copy link
Contributor

Choose a reason for hiding this comment

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

why not add this to codefileNames?


/** Returns true if `filename` is a code file. */
export function isCodeFile(filename: string): boolean {
const ext = path.extname(filename).toLowerCase()
return codefileExtensions.has(ext) || codefileNames.has(path.basename(filename))
return (
codefileExtensions.has(ext) ||
codefileNames.has(path.basename(filename)) ||
buildfileNames.has(path.basename(filename))
)
}
1 change: 1 addition & 0 deletions packages/core/src/test/shared/filetypes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ describe('isCodeFile', () => {
'mvnw',
'build.gradle',
'gradle/wrapper/gradle-wrapper.properties',
'gradle/wrapper/gradle-wrapper.jar',
]
for (const codeFilePath of codeFiles) {
assert.strictEqual(isCodeFile(codeFilePath), true)
Expand Down
Loading