Skip to content

Commit

Permalink
build: account for recent packaging changes in shared dev-infra package
Browse files Browse the repository at this point in the history
The dev-infra package now bundles dependencies properly and no longer lists
them as `dependencies`. This results in our deep imports breaking due to
missing dependencies. The solution is the use of the bundled entry-points
so that we get all the required transitive dependencies without needing to
install them manually.
  • Loading branch information
devversion authored and andrewseguin committed Mar 2, 2022
1 parent f1d04d5 commit d496ff3
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .ng-dev/caretaker.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {CaretakerConfig} from '@angular/dev-infra-private/ng-dev/caretaker/config';
import {CaretakerConfig} from '@angular/dev-infra-private/ng-dev';

/** The configuration for `ng-dev caretaker` commands. */
export const caretaker: CaretakerConfig = {
Expand Down
2 changes: 1 addition & 1 deletion .ng-dev/commit-message.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {CommitMessageConfig} from '@angular/dev-infra-private/ng-dev/commit-message/config';
import {CommitMessageConfig} from '@angular/dev-infra-private/ng-dev';

/**
* The configuration for `ng-dev commit-message` commands.
Expand Down
2 changes: 1 addition & 1 deletion .ng-dev/format.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {FormatConfig} from '@angular/dev-infra-private/ng-dev/format/config';
import {FormatConfig} from '@angular/dev-infra-private/ng-dev';

/**
* Configuration for the ng-dev format command. We currently only use the buildifier
Expand Down
2 changes: 1 addition & 1 deletion .ng-dev/github.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {GithubConfig} from '@angular/dev-infra-private/ng-dev/utils/config';
import {GithubConfig} from '@angular/dev-infra-private/ng-dev';

/**
* Github configuration for the ng-dev command. This repository is
Expand Down
2 changes: 1 addition & 1 deletion .ng-dev/pull-request.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {PullRequestConfig} from '@angular/dev-infra-private/ng-dev/pr/config';
import {PullRequestConfig} from '@angular/dev-infra-private/ng-dev';

/**
* Configuration for the pull request commands in `ng-dev`. This includes the
Expand Down
13 changes: 9 additions & 4 deletions .ng-dev/release.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import {BuiltPackage, ReleaseConfig} from '@angular/dev-infra-private/ng-dev/release/config';
import {ReleaseAction} from '@angular/dev-infra-private/ng-dev/release/publish/actions';
import {
BuiltPackage,
ReleaseConfig,
FatalReleaseActionError,
} from '@angular/dev-infra-private/ng-dev';
import {SemVer} from 'semver';
import {assertValidNpmPackageOutput} from '../tools/release-checks/npm-package-output';
import {fork} from 'child_process';
import {join} from 'path';
import {FatalReleaseActionError} from '@angular/dev-infra-private/ng-dev/release/publish/actions-error';

const actionProto = ReleaseAction.prototype as any;
// The `ng-dev` release tool exposes the `ReleaseAction` instance through `global`,
// allowing it to be monkey-patched for our release checks. This can be removed
// when the release tool has a public API for release checks.
const actionProto = (global as any).ReleaseAction.prototype;
const _origStageFn = actionProto.stageVersionForBranchAndCreatePullRequest;
const _origVerifyFn = actionProto._verifyPackageVersions;

Expand Down
2 changes: 1 addition & 1 deletion scripts/build-packages-dist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import {execSync} from 'child_process';
import {join} from 'path';
import {BuiltPackage} from '@angular/dev-infra-private/ng-dev/release/config';
import {BuiltPackage} from '@angular/dev-infra-private/ng-dev';
import {chmod, cp, mkdir, rm, set, test} from 'shelljs';

// ShellJS should exit if a command fails.
Expand Down
3 changes: 1 addition & 2 deletions tools/release-checks/check-framework-peer-dependency.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {FatalReleaseActionError} from '@angular/dev-infra-private/ng-dev/release/publish/actions-error';
import {error} from '@angular/dev-infra-private/ng-dev/utils/console';
import {error, FatalReleaseActionError} from '@angular/dev-infra-private/ng-dev';
import {SemVer} from 'semver';
import {join} from 'path';
import {existsSync, readFileSync} from 'fs';
Expand Down
2 changes: 1 addition & 1 deletion tools/release-checks/check-migration-collections.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {error} from '@angular/dev-infra-private/ng-dev/utils/console';
import {error} from '@angular/dev-infra-private/ng-dev';
import {dirname, join} from 'path';
import chalk from 'chalk';
import {releasePackages} from '../../.ng-dev/release';
Expand Down
2 changes: 1 addition & 1 deletion tools/release-checks/npm-package-output/check-package.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {error} from '@angular/dev-infra-private/ng-dev/utils/console';
import {error} from '@angular/dev-infra-private/ng-dev';
import chalk from 'chalk';
import {existsSync} from 'fs';
import {sync as glob} from 'glob';
Expand Down
3 changes: 1 addition & 2 deletions tools/release-checks/npm-package-output/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {SemVer} from 'semver';
import {checkReleasePackage} from './check-package';
import {BuiltPackage} from '@angular/dev-infra-private/ng-dev/release/config';
import {error} from '@angular/dev-infra-private/ng-dev/utils/console';
import {BuiltPackage, error} from '@angular/dev-infra-private/ng-dev';
import chalk from 'chalk';

/** Asserts that the given built packages are valid for public consumption. */
Expand Down

0 comments on commit d496ff3

Please sign in to comment.