-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sdk): generate GitAttributes file ignoring generated files (#2214)
## Proposed change Generate GitAttributes file ignoring generated files
- Loading branch information
Showing
7 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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 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 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
24 changes: 24 additions & 0 deletions
24
packages/@ama-sdk/schematics/schematics/ng-update/typescript/v11.4/create-gitattributes.ts
This file contains 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import type { Rule } from '@angular-devkit/schematics'; | ||
|
||
/** | ||
* Create a default git attributes file (if it does not already exist) | ||
* @param tree | ||
*/ | ||
export const createGitAttributesFile: Rule = (tree) => { | ||
const gitAttributesFilePath = '.gitattributes'; | ||
if (!tree.exists(gitAttributesFilePath)) { | ||
tree.create(gitAttributesFilePath, `# Generated files | ||
src/api/** linguist-generated | ||
src/spec/api-mocks.ts linguist-generated | ||
src/spec/operation-adapter.ts linguist-generated | ||
# uncomment the following line if there is no core model: | ||
# src/models/base/** linguist-generated | ||
# in case of core models, the \`index.ts\` file should be ignored as follows: | ||
# !src/models/base/<model>/index.ts | ||
`); | ||
} | ||
|
||
return tree; | ||
}; |
This file contains 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
8 changes: 8 additions & 0 deletions
8
...es/@ama-sdk/schematics/schematics/typescript/shell/templates/base/.gitattributes.template
This file contains 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Generated files | ||
src/spec/api-mocks.ts linguist-generated | ||
src/spec/operation-adapter.ts linguist-generated | ||
src/api/** linguist-generated | ||
src/models/base/** linguist-generated | ||
|
||
# in case of core models, the `index.ts` file should be ignored as follows: | ||
# !src/models/base/<model>/index.ts |