-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(toolkit): prevent unintended public exports, file re-org (#32967)
### Description of changes Removing some unintentional public exports from the deploy action. Re-organizing files to improve project structure. Making the `.gitignore` file more readable. **No functional code changes!** ### Describe any new or updated permissions being added n/a ### Description of how you validated changes It builds. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
Showing
20 changed files
with
80 additions
and
122 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 |
---|---|---|
@@ -1,28 +1,31 @@ | ||
# Build artifacts | ||
*.js | ||
*.js.map | ||
*.d.ts | ||
*.d.ts.map | ||
*.gz | ||
node_modules | ||
npm-shrinkwrap.json | ||
tsconfig.tsbuildinfo | ||
dist | ||
.jsii | ||
docs | ||
|
||
# Generated by generate.sh | ||
build-info.json | ||
|
||
# Test artifacts | ||
assets.json | ||
junit.xml | ||
.LAST_BUILD | ||
.nyc_output | ||
coverage | ||
nyc.config.js | ||
.LAST_PACKAGE | ||
*.snk | ||
|
||
assets.json | ||
npm-shrinkwrap.json | ||
!.eslintrc.js | ||
!jest.config.js | ||
|
||
junit.xml | ||
|
||
# Exclude resources | ||
build-info.json | ||
lib/**/*.wasm | ||
lib/**/*.yaml | ||
|
||
# Include config files | ||
!.eslintrc.js | ||
!jest.config.js |
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
35 changes: 35 additions & 0 deletions
35
packages/@aws-cdk/toolkit/lib/actions/deploy/private/helpers.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,35 @@ | ||
import { DeployOptions } from '..'; | ||
import { Deployments, WorkGraph } from '../../../api/aws-cdk'; | ||
|
||
export function buildParameterMap(parameters?: Map<string, string | undefined>): { [name: string]: { [name: string]: string | undefined } } { | ||
const parameterMap: { | ||
[name: string]: { [name: string]: string | undefined }; | ||
} = {}; | ||
parameterMap['*'] = {}; | ||
|
||
const entries = parameters?.entries() ?? []; | ||
for (const [key, value] of entries) { | ||
const [stack, parameter] = key.split(':', 2) as [string, string | undefined]; | ||
if (!parameter) { | ||
parameterMap['*'][stack] = value; | ||
} else { | ||
if (!parameterMap[stack]) { | ||
parameterMap[stack] = {}; | ||
} | ||
parameterMap[stack][parameter] = value; | ||
} | ||
} | ||
|
||
return parameterMap; | ||
} | ||
|
||
/** | ||
* Remove the asset publishing and building from the work graph for assets that are already in place | ||
*/ | ||
export async function removePublishedAssets(graph: WorkGraph, deployments: Deployments, options: DeployOptions) { | ||
await graph.removeUnnecessaryAssets(assetNode => deployments.isSingleAssetPublished(assetNode.assetManifest, assetNode.asset, { | ||
stack: assetNode.parentStack, | ||
roleArn: options.roleArn, | ||
stackName: assetNode.parentStack.stackName, | ||
})); | ||
} |
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 @@ | ||
export * from './helpers'; |
2 changes: 1 addition & 1 deletion
2
...s/@aws-cdk/toolkit/lib/actions/destroy.ts → ...-cdk/toolkit/lib/actions/destroy/index.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
2 changes: 1 addition & 1 deletion
2
...ages/@aws-cdk/toolkit/lib/actions/diff.ts → ...aws-cdk/toolkit/lib/actions/diff/index.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
2 changes: 1 addition & 1 deletion
2
...es/@aws-cdk/toolkit/lib/actions/import.ts → ...s-cdk/toolkit/lib/actions/import/index.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
2 changes: 1 addition & 1 deletion
2
...ages/@aws-cdk/toolkit/lib/actions/list.ts → ...aws-cdk/toolkit/lib/actions/list/index.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
2 changes: 1 addition & 1 deletion
2
.../@aws-cdk/toolkit/lib/actions/rollback.ts → ...cdk/toolkit/lib/actions/rollback/index.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
2 changes: 1 addition & 1 deletion
2
...ges/@aws-cdk/toolkit/lib/actions/synth.ts → ...ws-cdk/toolkit/lib/actions/synth/index.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
2 changes: 1 addition & 1 deletion
2
...ges/@aws-cdk/toolkit/lib/actions/watch.ts → ...ws-cdk/toolkit/lib/actions/watch/index.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
2 changes: 1 addition & 1 deletion
2
packages/@aws-cdk/toolkit/lib/api/cloud-assembly/private/context-aware-source.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
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 was deleted.
Oops, something went wrong.
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 @@ | ||
export * from './toolkit'; |
4 changes: 2 additions & 2 deletions
4
.../toolkit/lib/api/toolkit/private/index.ts → ...-cdk/toolkit/lib/toolkit/private/index.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
33 changes: 16 additions & 17 deletions
33
packages/@aws-cdk/toolkit/lib/toolkit.ts → ...s/@aws-cdk/toolkit/lib/toolkit/toolkit.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