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(individual-pkg-gen): set the alpha version in alpha module's package.json files if present #16322

Merged
Merged
Changes from all 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
9 changes: 7 additions & 2 deletions tools/individual-pkg-gen/copy-files-removing-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import * as awsCdkMigration from 'aws-cdk-migration';
import * as fs from 'fs-extra';
// eslint-disable-next-line @typescript-eslint/no-require-imports
const lerna_project = require('@lerna/project');
// eslint-disable-next-line @typescript-eslint/no-require-imports
const ver = require('../../scripts/resolve-version');

transformPackages();

Expand Down Expand Up @@ -98,6 +100,9 @@ function transformPackageJson(pkg: any, source: string, destination: string, alp
const pkgUnscopedName = `${pkg.name.substring('@aws-cdk/'.length)}`;

packageJson.name += '-alpha';
if (ver.alphaVersion) {
packageJson.version = ver.alphaVersion;
}
packageJson.repository.directory = `packages/individual-packages/${pkgUnscopedName}`;

// disable awslint (some rules are hard-coded to @aws-cdk/core)
Expand Down Expand Up @@ -160,7 +165,7 @@ function transformPackageJsonDependencies(packageJson: any, pkg: any, alphaPacka
break;
default:
if (alphaPackages[dependency]) {
alphaDependencies[alphaPackages[dependency]] = pkg.version;
alphaDependencies[alphaPackages[dependency]] = packageJson.version;
} else if (v1BundledDependencies.indexOf(dependency) !== -1) {
// ...other than third-party dependencies, which are in bundledDependencies
bundledDependencies[dependency] = packageJson.dependencies[dependency];
Expand All @@ -180,7 +185,7 @@ function transformPackageJsonDependencies(packageJson: any, pkg: any, alphaPacka
break;
default:
if (alphaPackages[v1DevDependency]) {
alphaDevDependencies[alphaPackages[v1DevDependency]] = pkg.version;
alphaDevDependencies[alphaPackages[v1DevDependency]] = packageJson.version;
} else if (!v1DevDependency.startsWith('@aws-cdk/')) {
devDependencies[v1DevDependency] = packageJson.devDependencies[v1DevDependency];
}
Expand Down