Skip to content

Commit

Permalink
feat: exclude cdk folders from git, npm and tsc (projen#141)
Browse files Browse the repository at this point in the history
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
  • Loading branch information
hoegertn authored Oct 4, 2020
1 parent dd6a3ce commit c848ede
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -2285,6 +2285,7 @@ Name | Type | Description
**docgen**?🔹 | <code>boolean</code> | __*Optional*__
**eslint**?🔹 | <code>[Eslint](#projen-eslint)</code> | __*Optional*__
**jest**?🔹 | <code>[Jest](#projen-jest)</code> | __*Optional*__
**tsconfig**?🔹 | <code>[TypescriptConfig](#projen-typescriptconfig)</code> | __*Optional*__

### Methods

Expand Down
11 changes: 11 additions & 0 deletions src/awscdk-app-ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@ export class AwsCdkTypeScriptApp extends TypeScriptAppProject {
app: `npx ts-node ${path.join(this.srcdir, this.appEntrypoint)}`,
};

this.gitignore.exclude('cdk.out/');
this.gitignore.exclude('.cdk.staging/');
this.gitignore.exclude('.parcel-cache/');

this.npmignore?.exclude('cdk.out/');
this.npmignore?.exclude('.cdk.staging/');

if (this.tsconfig) {
this.tsconfig.exclude.push('cdk.out');
}

this.addDevDeps('ts-node');

new JsonFile(this, 'cdk.json', {
Expand Down
3 changes: 2 additions & 1 deletion src/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export class TypeScriptProject extends NodeProject {
public readonly docsDirectory: string;
public readonly eslint?: Eslint;
public readonly jest?: Jest;
public readonly tsconfig?: TypescriptConfig;

/**
* The directory in which the .ts sources reside.
Expand Down Expand Up @@ -195,7 +196,7 @@ export class TypeScriptProject extends NodeProject {
};

if (!options.disableTsconfig) {
new TypescriptConfig(this, {
this.tsconfig = new TypescriptConfig(this, {
include: [`${this.srcdir}/**/*.ts`],
exclude: [
'node_modules',
Expand Down

0 comments on commit c848ede

Please sign in to comment.