-
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.
- Loading branch information
Showing
14 changed files
with
208 additions
and
64 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,25 +1,33 @@ | ||
# Ignore artifacts | ||
# Ignore build artifacts | ||
**/cdk.out | ||
**/*.snapshot | ||
dist | ||
.LAST_PACKAGE | ||
.LAST_BUILD | ||
*.snk | ||
*.ts | ||
!*.d.ts | ||
!*.js | ||
coverage | ||
.nyc_output | ||
*.tgz | ||
|
||
# Ignore configs and test files | ||
# Ignore config files | ||
.eslintrc.js | ||
tsconfig.json | ||
*.tsbuildinfo | ||
junit.xml | ||
jest.config.js | ||
bundle.mjs | ||
|
||
# Include .jsii | ||
!.jsii | ||
|
||
# exclude cdk artifacts | ||
**/cdk.out | ||
**/*.snapshot | ||
# Explicitly allow all required files | ||
!build-info.json | ||
!db.json.gz | ||
# !lib/main.js | ||
# !lib/bridge.js | ||
# !lib/setup-sandbox.js | ||
# !lib/api/bootstrap/bootstrap-template.yaml | ||
!*.d.ts | ||
!*.d.ts.map | ||
!*.js | ||
!LICENSE | ||
!NOTICE | ||
!THIRD_PARTY_LICENSES |
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,44 @@ | ||
import { createRequire } from 'node:module'; | ||
import * as path from "node:path"; | ||
import * as esbuild from "esbuild"; | ||
import * as fs from "fs-extra"; | ||
|
||
const require = createRequire(import.meta.url); | ||
|
||
const cliPackage = path.dirname(require.resolve("aws-cdk/package.json")); | ||
let copyFromCli = (from, to = undefined) => { | ||
return fs.copy(path.join(cliPackage, ...from), path.join(process.cwd(), ...(to ?? from))) | ||
} | ||
|
||
await Promise.all([ | ||
copyFromCli(["build-info.json"]), | ||
copyFromCli(["/db.json.gz"]), | ||
copyFromCli(["lib", "index_bg.wasm"]), | ||
]) | ||
|
||
// # Copy all resources that aws_cdk/generate.sh produced, and some othersCall the generator for the | ||
// cp -R $aws_cdk/lib/init-templates ./lib/ | ||
// mkdir -p ./lib/api/bootstrap/ && cp $aws_cdk/lib/api/bootstrap/bootstrap-template.yaml ./lib/api/bootstrap/ | ||
|
||
|
||
let bundleCli = { | ||
name: "bundle-aws-cdk", | ||
setup(build) { | ||
|
||
// Mark all paths inside aws-cdk as internal | ||
build.onResolve({ filter: /^aws-cdk\/lib/ }, (args) => { | ||
return { path: require.resolve(args.path), external: false } | ||
}); | ||
}, | ||
}; | ||
|
||
await esbuild.build({ | ||
entryPoints: ["lib/index.ts"], | ||
target: "node18", | ||
platform: "node", | ||
packages: "external", | ||
plugins: [bundleCli], | ||
sourcemap: true, | ||
bundle: true, | ||
outfile: "lib/main.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
export { DEFAULT_TOOLKIT_STACK_NAME, SdkProvider } from 'aws-cdk/lib'; | ||
export type { SuccessfulDeployStackResult } from 'aws-cdk/lib'; | ||
export { formatSdkLoggerContent } from 'aws-cdk/lib/api/aws-auth/sdk-logger'; | ||
export { CloudAssembly, sanitizePatterns, StackCollection, ExtendedStackSelection } from 'aws-cdk/lib/api/cxapp/cloud-assembly'; | ||
export { prepareDefaultEnvironment, prepareContext, spaceAvailableForContext } from 'aws-cdk/lib/api/cxapp/exec'; | ||
export { Deployments } from 'aws-cdk/lib/api/deployments'; | ||
export { HotswapMode } from 'aws-cdk/lib/api/hotswap/common'; | ||
export { StackActivityProgress } from 'aws-cdk/lib/api/util/cloudformation/stack-activity-monitor'; | ||
export { RWLock } from 'aws-cdk/lib/api/util/rwlock'; | ||
export type { ILock } from 'aws-cdk/lib/api/util/rwlock'; | ||
export { formatTime } from 'aws-cdk/lib/api/util/string-manipulation'; | ||
export * as contextproviders from 'aws-cdk/lib/context-providers'; | ||
export { ResourceMigrator } from 'aws-cdk/lib/migrator'; | ||
export { obscureTemplate, serializeStructure } from 'aws-cdk/lib/serialize'; | ||
export { Context, Settings, PROJECT_CONTEXT } from 'aws-cdk/lib/settings'; | ||
export { tagsForStack } from 'aws-cdk/lib/tags'; | ||
export { CliIoHost } from 'aws-cdk/lib/toolkit/cli-io-host'; | ||
export { loadTree, some } from 'aws-cdk/lib/tree'; | ||
export { splitBySize } from 'aws-cdk/lib/util'; | ||
export { validateSnsTopicArn } from 'aws-cdk/lib/util/validate-notification-arn'; | ||
export { WorkGraph } from 'aws-cdk/lib/util/work-graph'; | ||
export type { Concurrency } from 'aws-cdk/lib/util/work-graph'; | ||
export { WorkGraphBuilder } from 'aws-cdk/lib/util/work-graph-builder'; | ||
export type { AssetBuildNode, AssetPublishNode, StackNode } from 'aws-cdk/lib/util/work-graph-types'; | ||
export { versionNumber } from 'aws-cdk/lib/version'; | ||
export { guessExecutable } from 'aws-cdk/lib/api/cxapp/exec'; |
3 changes: 1 addition & 2 deletions
3
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
4 changes: 2 additions & 2 deletions
4
packages/@aws-cdk/toolkit/lib/api/cloud-assembly/private/source-builder.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/stack-assembly.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 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
Oops, something went wrong.