forked from projen/projen
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: store & bump version in version.json
Otherwise, projen will override the "version" field after the bump.
- Loading branch information
Elad Ben-Israel
committed
May 11, 2020
1 parent
8c40191
commit a861b00
Showing
9 changed files
with
73 additions
and
12 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,4 +40,5 @@ tsconfig.json | |
.jsii | ||
*.d.ts | ||
*.js | ||
!projen.js | ||
!projen.js | ||
!.versionrc.json |
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 |
---|---|---|
|
@@ -3,6 +3,7 @@ projen.js | |
*.ts | ||
tsconfig.json | ||
dist | ||
.versionrc.json | ||
!*.js | ||
!*.d.ts | ||
!.jsii |
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,18 @@ | ||
{ | ||
"packageFiles": [ | ||
{ | ||
"filename": "version.json", | ||
"type": "json" | ||
} | ||
], | ||
"bumpFiles": [ | ||
{ | ||
"filename": "version.json", | ||
"type": "json" | ||
} | ||
], | ||
"commitAll": true, | ||
"scripts": { | ||
"postbump": "yarn projen && git add ." | ||
} | ||
} |
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,30 @@ | ||
import { Construct } from 'constructs'; | ||
import { JsonFile } from './json'; | ||
import { NodeProject } from './node-project'; | ||
import { Semver } from './semver'; | ||
|
||
export class BumpScript extends Construct { | ||
constructor(project: NodeProject) { | ||
super(project, 'bump-script'); | ||
|
||
project.addScripts({ | ||
bump: 'standard-version', | ||
}); | ||
|
||
project.addDevDependencies({ | ||
'standard-version': Semver.caret('8.0.0'), | ||
}); | ||
|
||
project.gitignore.include('.versionrc.json'); | ||
project.npmignore.exclude('.versionrc.json'); | ||
|
||
new JsonFile(this, '.versionrc.json', { | ||
packageFiles: [ { filename: 'version.json', type: 'json' } ], | ||
bumpFiles: [ { filename: 'version.json', type: 'json' } ], | ||
commitAll: true, | ||
scripts: { | ||
postbump: 'yarn projen && git add .', | ||
}, | ||
}); | ||
} | ||
} |
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
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,3 @@ | ||
{ | ||
"version": "0.1.1" | ||
} |