Skip to content

Commit 7e23e64

Browse files
authored
fix(cli-lib-alpha): deprecate package (#500)
Deprecated in favor of @aws-cdk/toolkit-lib, a newer approach providing similar functionality to this package. Please migrate. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
1 parent 319f1ad commit 7e23e64

File tree

6 files changed

+47
-32
lines changed

6 files changed

+47
-32
lines changed

.projenrc.ts

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,7 @@ const CLI_LIB_EXCLUDE_PATTERNS = [
12931293
'lib/init-templates/*/typescript/*/*.template.ts',
12941294
];
12951295

1296-
const cliLib = configureProject(
1296+
const cliLibAlpha = configureProject(
12971297
new yarn.TypeScriptWorkspace({
12981298
...genericCdkProps(),
12991299
parent: repo,
@@ -1329,20 +1329,20 @@ const cliLib = configureProject(
13291329
);
13301330

13311331
// Do include all .ts files inside init-templates
1332-
cliLib.npmignore?.addPatterns(
1332+
cliLibAlpha.npmignore?.addPatterns(
13331333
'!lib/init-templates/**/*.ts',
13341334
'!lib/api/bootstrap/bootstrap-template.yaml',
13351335
);
13361336

1337-
cliLib.gitignore.addPatterns(
1337+
cliLibAlpha.gitignore.addPatterns(
13381338
...ADDITIONAL_CLI_IGNORE_PATTERNS,
13391339
'lib/**/*.yaml',
13401340
'lib/**/*.yml',
13411341
'lib/init-templates/**',
13421342
'cdk.out',
13431343
);
13441344

1345-
new JsiiBuild(cliLib, {
1345+
new JsiiBuild(cliLibAlpha, {
13461346
jsiiVersion: TYPESCRIPT_VERSION,
13471347
publishToNuget: {
13481348
dotNetNamespace: 'Amazon.CDK.Cli.Lib.Alpha',
@@ -1362,29 +1362,33 @@ new JsiiBuild(cliLib, {
13621362
pypiClassifiers: [
13631363
'Framework :: AWS CDK',
13641364
'Framework :: AWS CDK :: 2',
1365+
'Development Status :: 7 - Inactive',
13651366
],
13661367
publishToGo: {
13671368
moduleName: 'github.com/aws/aws-cdk-go',
13681369
packageName: 'awscdkclilibalpha',
13691370
},
13701371
rosettaStrict: true,
1371-
stability: Stability.EXPERIMENTAL,
1372+
stability: Stability.DEPRECATED,
13721373
composite: true,
13731374
excludeTypescript: CLI_LIB_EXCLUDE_PATTERNS,
13741375
});
13751376

1377+
// the package is deprecated
1378+
cliLibAlpha.package.addField('deprecated', 'Deprecated in favor of @aws-cdk/toolkit-lib, a newer approach providing similar functionality to this package. Please migrate.');
1379+
13761380
// clilib needs to bundle some resources, same as the CLI
1377-
cliLib.postCompileTask.exec('node-bundle validate --external=fsevents:optional --entrypoint=lib/index.js --fix --dont-attribute "^@aws-cdk/|^cdk-assets$|^cdk-cli-wrapper$|^aws-cdk$"');
1378-
cliLib.postCompileTask.exec('mkdir -p ./lib/api/bootstrap/ && cp ../../aws-cdk/lib/api/bootstrap/bootstrap-template.yaml ./lib/api/bootstrap/');
1381+
cliLibAlpha.postCompileTask.exec('node-bundle validate --external=fsevents:optional --entrypoint=lib/index.js --fix --dont-attribute "^@aws-cdk/|^cdk-assets$|^cdk-cli-wrapper$|^aws-cdk$"');
1382+
cliLibAlpha.postCompileTask.exec('mkdir -p ./lib/api/bootstrap/ && cp ../../aws-cdk/lib/api/bootstrap/bootstrap-template.yaml ./lib/api/bootstrap/');
13791383
for (const resourceCommand of includeCliResourcesCommands) {
1380-
cliLib.postCompileTask.exec(resourceCommand);
1384+
cliLibAlpha.postCompileTask.exec(resourceCommand);
13811385
}
1382-
cliLib.postCompileTask.exec('cp $(node -p \'require.resolve("aws-cdk/build-info.json")\') .');
1383-
cliLib.postCompileTask.exec('esbuild --bundle lib/index.ts --target=node18 --platform=node --external:fsevents --minify-whitespace --outfile=lib/main.js');
1384-
cliLib.postCompileTask.exec('node ./lib/main.js >/dev/null </dev/null'); // Smoke test
1386+
cliLibAlpha.postCompileTask.exec('cp $(node -p \'require.resolve("aws-cdk/build-info.json")\') .');
1387+
cliLibAlpha.postCompileTask.exec('esbuild --bundle lib/index.ts --target=node18 --platform=node --external:fsevents --minify-whitespace --outfile=lib/main.js');
1388+
cliLibAlpha.postCompileTask.exec('node ./lib/main.js >/dev/null </dev/null'); // Smoke test
13851389

13861390
// Exclude takes precedence over include
1387-
for (const tsconfig of [cliLib.tsconfigDev]) {
1391+
for (const tsconfig of [cliLibAlpha.tsconfigDev]) {
13881392
for (const pat of CLI_LIB_EXCLUDE_PATTERNS) {
13891393
tsconfig?.addExclude(pat);
13901394
}
@@ -1698,7 +1702,7 @@ new CdkCliIntegTestsWorkflow(repo, {
16981702
cloudFormationDiff.name,
16991703
cdkAssets.name,
17001704
cli.name,
1701-
cliLib.name,
1705+
cliLibAlpha.name,
17021706
cdkAliasPackage.name,
17031707
cliInteg.name,
17041708
toolkitLib.name,

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Here are the packages in this repository. See the README of each package for mor
5252
| [@aws-cdk/cloud-assembly-schema](./packages/@aws-cdk//cloud-assembly-schema/) | The contract between the CDK construct library and the CDK toolkit | Yes | Yes |
5353
| [@aws-cdk/cloudformation-diff](./packages/@aws-cdk/cloudformation-diff/) | CLI component for diffing CloudFormation templates | Yes | Yes |
5454
| [@aws-cdk/cli-lib-alpha](./packages/@aws-cdk/cli-lib-alpha/) | A deprecated attempt at building a programmatic interface for the CLI | Yes | No |
55-
| [@aws-cdk/toolkit-lib](./packages/@aws-cdk/toolkit-lib/) | A work-in-progress programmatic interface for the CLI | No | Yes |
55+
| [@aws-cdk/toolkit-lib](./packages/@aws-cdk/toolkit-lib/) | A programmatic interface for the CDK Toolkit | Yes | Yes |
5656
| [@aws-cdk/cli-plugin-contract](./packages/@aws-cdk/cli-plugin-contract/) | TypeScript types for CLI plugins. | No | Yes |
5757
| [@aws-cdk/cdk-cli-wrapper](./packages/@aws-cdk/cdk-cli-wrapper/) | A deprecated attempt at building a programmatic interface for the CLI | No | No |
5858
| [@aws-cdk/node-bundle](./packages/@aws-cdk/node-bundle/) | A tool to build CLI bundles that include license attributions. | No | Yes |

packages/@aws-cdk-testing/cli-integ/lib/package-sources/cli-npm-source.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export class RunnerCliNpmSource implements IRunnerSource<ITestCliSource> {
1818

1919
await shell(['node', require.resolve('npm'), 'install', `aws-cdk@${this.range}`], {
2020
cwd: tempDir,
21+
show: 'error',
2122
});
2223
const installedVersion = await npmQueryInstalledVersion('aws-cdk', tempDir);
2324

packages/@aws-cdk-testing/cli-integ/lib/package-sources/library-globalinstall-source.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export class RunnerLibraryGlobalInstallSource implements IRunnerSource<ITestLibr
2323

2424
await shell(['node', require.resolve('npm'), 'install', `${this.packageName}@${this.range}`], {
2525
cwd: tempDir,
26+
show: 'error',
2627
});
2728

2829
const symlinkPath = path.join(__dirname, '..', '..', 'node_modules', this.packageName);

packages/@aws-cdk/cli-lib-alpha/README.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,27 @@
1-
# AWS CDK CLI Library
1+
# AWS CDK CLI Library (deprecated)
2+
23
<!--BEGIN STABILITY BANNER-->
34

45
---
56

6-
![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)
7+
![@aws-cdk/cli-lib-lpha: Deprecated](https://img.shields.io/badge/@aws--cdk/cli--lib--alpha-deprectated-red.svg?style=for-the-badge)
78

8-
> The APIs of higher level constructs in this module are experimental and under active development.
9-
> They are subject to non-backward compatible changes or removal in any future version. These are
10-
> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be
11-
> announced in the release notes. This means that while you may use them, you may need to update
12-
> your source code when upgrading to a newer version of this package.
9+
> This package has been deprecated in favor of [@aws-cdk/toolkit-lib](https://github.com/aws/aws-cdk-cli/issues/155),
10+
> a newer approach providing similar functionality to what this package offered.
11+
> Please migrate as soon as possible.
12+
> For any migration problems, please open [an issue](https://github.com/aws/aws-cdk-cli/issues/new/choose).
13+
> We are committed to supporting the same feature set that this package offered.
1314
1415
---
1516

1617
<!--END STABILITY BANNER-->
1718

18-
## ⚠️ Experimental module
19+
## ⚠️ Deprecated module
1920

20-
This package is highly experimental. Expect frequent API changes and incomplete features.
21-
Known issues include:
21+
This package is has been deprecated.
22+
Already published versions can be used, but no support is provided whatsoever and we will soon stop publishing new versions.
2223

23-
- **JavaScript/TypeScript only**\
24-
The jsii packages are currently not in a working state.
25-
- **No useful return values**\
26-
All output is currently printed to stdout/stderr
27-
- **Missing or Broken options**\
28-
Some CLI options might not be available in this package or broken
24+
Instead, please use [@aws-cdk/toolkit-lib](https://github.com/aws/aws-cdk-cli/issues/155).
2925

3026
## Overview
3127

@@ -38,6 +34,17 @@ Currently the package includes implementations for:
3834
- `cdk destroy`
3935
- `cdk list`
4036

37+
## Known issues
38+
39+
- **JavaScript/TypeScript only**\
40+
The jsii packages are currently not in a working state.
41+
- **No useful return values**\
42+
All output is currently printed to stdout/stderr
43+
- **Missing or Broken options**\
44+
Some CLI options might not be available in this package or broken
45+
46+
Due to the deprecation of the package, this issues will not be resolved.
47+
4148
## Setup
4249

4350
### AWS CDK app directory

packages/@aws-cdk/cli-lib-alpha/package.json

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)