Skip to content
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

chore(merge-back): 2.99.1 #27363

Merged
merged 6 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.v2.alpha.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [2.99.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.99.0-alpha.0...v2.99.1-alpha.0) (2023-09-29)

## [2.99.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.98.0-alpha.0...v2.99.0-alpha.0) (2023-09-27)


Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [2.99.1](https://github.com/aws/aws-cdk/compare/v2.99.0...v2.99.1) (2023-09-29)


### Bug Fixes

* load time regression ([#27314](https://github.com/aws/aws-cdk/issues/27314)) ([fca5a73](https://github.com/aws/aws-cdk/commit/fca5a7344d2e205663873b577d5d91f203dd9d14))

## [2.99.0](https://github.com/aws/aws-cdk/compare/v2.98.0...v2.99.0) (2023-09-27)


Expand Down
1 change: 0 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"tools/@aws-cdk/prlint",
"tools/@aws-cdk/spec2cdk",
"tools/@aws-cdk/yarn-cling",
"tools/@aws-cdk/lazify",
"scripts/@aws-cdk/script-tests"
],
"rejectCycles": true,
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
"tools/@aws-cdk/prlint",
"tools/@aws-cdk/spec2cdk",
"tools/@aws-cdk/yarn-cling",
"tools/@aws-cdk/lazify",
"scripts/@aws-cdk/script-tests"
],
"nohoist": [
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-lambda/test/code.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ describe('code', () => {
// then
Template.fromStack(stack).hasResource('AWS::Lambda::Function', {
Metadata: {
[cxapi.ASSET_RESOURCE_METADATA_PATH_KEY]: Match.stringLikeRegexp('asset\\.[0-9a-f]+'),
[cxapi.ASSET_RESOURCE_METADATA_PATH_KEY]: 'asset.7bbf7edf9881819a1b91e5b02acae3e3973f96fa93325c676a1285351ddacc62',
[cxapi.ASSET_RESOURCE_METADATA_IS_BUNDLED_KEY]: false,
[cxapi.ASSET_RESOURCE_METADATA_PROPERTY_KEY]: 'Code',
},
Expand Down
Empty file.
1 change: 0 additions & 1 deletion packages/aws-cdk-lib/core/lib/asset-staging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ export class AssetStaging extends Construct {
this.sourcePath = path.resolve(props.sourcePath);
this.fingerprintOptions = {
...props,
exclude: ['.is_custom_resource', ...props.exclude ?? []],
extraHash: props.extraHash || salt ? `${props.extraHash ?? ''}${salt ?? ''}` : undefined,
};

Expand Down
Empty file.
263 changes: 263 additions & 0 deletions packages/aws-cdk-lib/lazy-index.ts

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions packages/aws-cdk-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
"post": [
"ts-node ./scripts/verify-imports-resolve-same.ts",
"ts-node ./scripts/verify-imports-shielded.ts",
"ts-node ./cx-api/build-tools/flag-report.ts",
"env QUIET=1 lazify ."
"ts-node ./cx-api/build-tools/flag-report.ts"
]
},
"cdk-package": {
Expand Down Expand Up @@ -167,7 +166,6 @@
"@types/jest": "^29.5.5",
"@types/lodash": "^4.14.198",
"@types/punycode": "^2.1.0",
"@aws-cdk/lazify": "0.0.0",
"aws-sdk": "^2.1461.0",
"aws-sdk-client-mock": "^3.0.0",
"aws-sdk-client-mock-jest": "^3.0.0",
Expand Down Expand Up @@ -211,7 +209,11 @@
"libRoot": "/root/remodel/packages/aws-cdk-lib"
},
"exports": {
".": "./index.js",
".": {
"types": "./index.d.ts",
"import": "./index.js",
"require": "./lazy-index.js"
},
"./.jsii": "./.jsii",
"./.warnings.jsii.js": "./.warnings.jsii.js",
"./alexa-ask": "./alexa-ask/index.js",
Expand Down
15 changes: 15 additions & 0 deletions packages/aws-cdk-lib/scripts/gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import submodulesGen from './submodules';
const awsCdkLibDir = path.join(__dirname, '..');
const pkgJsonPath = path.join(awsCdkLibDir, 'package.json');
const topLevelIndexFilePath = path.join(awsCdkLibDir, 'index.ts');
const lazyExportsFilePath = path.join(awsCdkLibDir, 'lazy-index.ts');
const scopeMapPath = path.join(__dirname, 'scope-map.json');

main().catch(e => {
Expand Down Expand Up @@ -48,6 +49,11 @@ async function updateExportsAndEntryPoints(modules: ModuleMap) {
const indexFile = await fs.readFile(topLevelIndexFilePath);
indexStatements.push(...indexFile.toString('utf-8').split('\n').filter(Boolean));
}
const lazyExports = new Array<string>();
if (fs.existsSync(lazyExportsFilePath)) {
const lazExportsFile = await fs.readFile(lazyExportsFilePath);
lazyExports.push(...lazExportsFile.toString('utf-8').split('\n').filter(Boolean));
}

for (const [moduleName, { definition }] of Object.entries(modules)) {
const moduleConfig = {
Expand All @@ -63,11 +69,20 @@ async function updateExportsAndEntryPoints(modules: ModuleMap) {
if (!indexStatements.find(e => e.includes(moduleConfig.name))) {
indexStatements.push(`export * as ${moduleConfig.submodule} from './${moduleConfig.name}';`);
}

if (!lazyExports.find(e => e.includes(moduleConfig.name))) {
if (moduleConfig.name === 'core') {
lazyExports.unshift(`export * from './${moduleConfig.name}';`);
} else {
lazyExports.push(`Object.defineProperty(exports, '${moduleConfig.submodule}', { get: function () { return require('${exportName}'); } });`);
}
}
}

// sort exports
pkgJson.exports = Object.fromEntries(Object.entries(pkgJson.exports).sort(([e1], [e2]) => e1.localeCompare(e2)));

await fs.writeJson(pkgJsonPath, pkgJson, { spaces: 2 });
await fs.writeFile(topLevelIndexFilePath, indexStatements.sort((l1, l2) => l1.localeCompare(l2)).join('\n') + '\n');
await fs.writeFile(lazyExportsFilePath, lazyExports.sort((l1, l2) => l1.localeCompare(l2)).join('\n') + '\n');
}
Empty file.
15 changes: 0 additions & 15 deletions tools/@aws-cdk/lazify/.gitignore

This file was deleted.

202 changes: 0 additions & 202 deletions tools/@aws-cdk/lazify/LICENSE

This file was deleted.

Loading
Loading