@hubspot/npm-scripts 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/npm-scripts",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "Scripts for working with npm packages in the HubSpot ecosystem",
5
5
  "author": "",
6
6
  "license": "Apache-2.0",
package/src/release.js CHANGED
@@ -107,7 +107,9 @@ function buildHandler({ build, postLatestRelease, packageName, localVersion, reg
107
107
  await build();
108
108
  }
109
109
  else {
110
+ logger.log('Installing dependencies...');
110
111
  await exec('yarn');
112
+ logger.log('Building...');
111
113
  await exec(`yarn build`);
112
114
  }
113
115
  let otp = '';
@@ -1,5 +1,5 @@
1
1
  import { BuildRepoSyncScriptOptions, RepoSyncArguments } from './types.js';
2
- export declare function handleRepoSync({ targetRepositoryUrl, excludePatterns, buildCommitMessage, internalMainBranch, externalMainBranch, version, dryRun, sshKeyPath, }: BuildRepoSyncScriptOptions & RepoSyncArguments): Promise<void>;
2
+ export declare function handleRepoSync({ sourceDirectory, targetRepositoryUrl, excludePatterns, buildCommitMessage, internalMainBranch, externalMainBranch, version, dryRun, sshKeyPath, }: BuildRepoSyncScriptOptions & RepoSyncArguments): Promise<void>;
3
3
  export declare function buildRepoSyncScript({ buildHandlerOptions, }: {
4
4
  buildHandlerOptions: BuildRepoSyncScriptOptions;
5
5
  }): void;
package/src/repo-sync.js CHANGED
@@ -8,14 +8,16 @@ import { DEFAULT_INTERNAL_MAIN_BRANCH, DEFAULT_EXTERNAL_MAIN_BRANCH, SYNC_BRANCH
8
8
  import { checkoutBranch, cloneRepo, commitChanges, createBranch, getCurrentGitBranch, getGitEnvWithSshKey, pushBranch, } from './utils/git.js';
9
9
  import { copyFiles } from './utils/filesystem.js';
10
10
  import { confirm } from './utils/prompting.js';
11
- export async function handleRepoSync({ targetRepositoryUrl, excludePatterns, buildCommitMessage, internalMainBranch, externalMainBranch, version, dryRun, sshKeyPath, }) {
11
+ export async function handleRepoSync({ sourceDirectory, targetRepositoryUrl, excludePatterns, buildCommitMessage, internalMainBranch, externalMainBranch, version, dryRun, sshKeyPath, }) {
12
12
  if (!internalMainBranch) {
13
13
  internalMainBranch = DEFAULT_INTERNAL_MAIN_BRANCH;
14
14
  }
15
15
  if (!externalMainBranch) {
16
16
  externalMainBranch = DEFAULT_EXTERNAL_MAIN_BRANCH;
17
17
  }
18
- const originalRepoPath = process.cwd();
18
+ const originalRepoPath = sourceDirectory
19
+ ? path.resolve(sourceDirectory)
20
+ : process.cwd();
19
21
  let tempDir = '';
20
22
  try {
21
23
  logger.log(`Starting sync to target repository: ${targetRepositoryUrl}...`);
@@ -86,9 +88,10 @@ export async function handleRepoSync({ targetRepositoryUrl, excludePatterns, bui
86
88
  process.chdir(originalRepoPath);
87
89
  }
88
90
  }
89
- function buildHandler({ targetRepositoryUrl, excludePatterns, buildCommitMessage, internalMainBranch, externalMainBranch, }) {
91
+ function buildHandler({ sourceDirectory, targetRepositoryUrl, excludePatterns, buildCommitMessage, internalMainBranch, externalMainBranch, }) {
90
92
  return async function handler({ version, dryRun, sshKeyPath, }) {
91
93
  await handleRepoSync({
94
+ sourceDirectory,
92
95
  targetRepositoryUrl,
93
96
  excludePatterns,
94
97
  buildCommitMessage,
package/src/types.d.ts CHANGED
@@ -35,6 +35,7 @@ export interface BuildReleaseScriptOptions extends BuildReleaseScriptBase {
35
35
  registry: string;
36
36
  }
37
37
  export interface BuildRepoSyncScriptOptions {
38
+ sourceDirectory?: string;
38
39
  targetRepositoryUrl: string;
39
40
  buildCommitMessage: (version: string) => string;
40
41
  excludePatterns?: string[];