generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 69
feat: record CLI version in manifest package #184
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
18 commits
Select commit
Hold shift + click to select a range
ca3acf4
feat: record CLI version in manifest package
rix0rrr 001385b
Tweaks
rix0rrr 34c5b78
Do correct synthesis
rix0rrr 4bda3d6
Manifest can contain an additioanl version or not, I don't care
rix0rrr 722830b
esliiiiiiiiiiiiiint
rix0rrr 9de66a9
Generic
rix0rrr 0f587a4
bumpIx => stepIx
rix0rrr 6ce4429
Simplify
rix0rrr 9fdecb5
Simplify!
rix0rrr 6276a49
Run projen
rix0rrr 7139cda
Update projen
rix0rrr 006785d
Merge remote-tracking branch 'origin/main' into huijbers/insert-cli-v…
rix0rrr bbc36e9
projen
rix0rrr fb1a1dd
Reset yarn.lock
rix0rrr a556593
Undo package.json updates
rix0rrr df00209
chore: self mutation
invalid-email-address 6e4ace3
chore: self mutation
invalid-email-address 9214af2
Merge branch 'main' into huijbers/insert-cli-versioun
rix0rrr 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import { promises as fs } from 'fs'; | ||
|
|
||
| /** | ||
| * Copy the version from the CLI into the `@aws-cdk/cloud-assembly-schema` package at release time. | ||
| */ | ||
| async function main() { | ||
| const cliVersion = JSON.parse(await fs.readFile(`${__dirname}/../packages/aws-cdk/package.json`, 'utf8')).version; | ||
|
|
||
| const cliVersionFile = `${__dirname}/../packages/@aws-cdk/cloud-assembly-schema/cli-version.json`; | ||
|
|
||
| // We write an empty string if we're in "development mode" to show that we don't really have a version. | ||
| // It's not a missing field so that the `import` statement of that JSON file in TypeScript | ||
| // always knows the version field is there, and its value is a string. | ||
| const advertisedVersion = cliVersion !== '0.0.0' ? cliVersion : ''; | ||
|
|
||
| await fs.writeFile(cliVersionFile, JSON.stringify({ version: advertisedVersion }), 'utf8'); | ||
| } | ||
|
|
||
| main().catch(e => { | ||
| // this is effectively a mini-cli | ||
| // eslint-disable-next-line no-console | ||
| console.error(e); | ||
| process.exitCode = 1; | ||
| }); | ||
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.
just FYI, not sure which is better