@hubspot/local-dev-lib 0.7.4-experimental.2 → 0.7.4-experimental.3

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.
@@ -1,4 +1,4 @@
1
1
  import { HsSettingsFile } from '../types/HsSettings.js';
2
2
  export declare function getHsSettingsFilePath(): string | null;
3
- export declare function getHsSettingsFile(): HsSettingsFile | null;
3
+ export declare function getHsSettingsFileIfExists(): HsSettingsFile | null;
4
4
  export declare function writeHsSettingsFile(settingsFile: HsSettingsFile): void;
@@ -20,7 +20,7 @@ export function getHsSettingsFilePath() {
20
20
  cwd: getCwd(),
21
21
  });
22
22
  }
23
- export function getHsSettingsFile() {
23
+ export function getHsSettingsFileIfExists() {
24
24
  const hsSettingsFilePath = getHsSettingsFilePath();
25
25
  if (!hsSettingsFilePath) {
26
26
  return null;
package/config/index.d.ts CHANGED
@@ -18,7 +18,7 @@ export declare function getConfigAccountIfExists(identifier: number | string): H
18
18
  export declare function getConfigDefaultAccount(): HubSpotConfigAccount;
19
19
  export declare function getConfigDefaultAccountIfExists(): HubSpotConfigAccount | undefined;
20
20
  export declare function getAllConfigAccounts(): HubSpotConfigAccount[];
21
- export declare function getLinkedConfigAccounts(): HubSpotConfigAccount[];
21
+ export declare function getLinkedOrAllConfigAccounts(): HubSpotConfigAccount[];
22
22
  export declare function getConfigAccountEnvironment(identifier: number | string): Environment;
23
23
  export declare function addConfigAccount(accountToAdd: HubSpotConfigAccount): void;
24
24
  export declare function updateConfigAccount(updatedAccount: HubSpotConfigAccount): void;
package/config/index.js CHANGED
@@ -11,7 +11,7 @@ import { HubSpotConfigError } from '../models/HubSpotConfigError.js';
11
11
  import { HUBSPOT_CONFIG_ERROR_TYPES } from '../constants/config.js';
12
12
  import { isDeepEqual } from '../lib/isDeepEqual.js';
13
13
  import { getCwd } from '../lib/path.js';
14
- import { getHsSettingsFile } from './hsSettings.js';
14
+ import { getHsSettingsFileIfExists } from './hsSettings.js';
15
15
  const EMPTY_CONFIG = { accounts: [] };
16
16
  export function getGlobalConfigFilePath() {
17
17
  return GLOBAL_CONFIG_PATH;
@@ -153,7 +153,7 @@ export function getConfigAccountIfExists(identifier) {
153
153
  export function getConfigDefaultAccount() {
154
154
  const { accounts, defaultAccount } = getConfig();
155
155
  let defaultAccountToUse = defaultAccount;
156
- const hsSettingsFile = getHsSettingsFile();
156
+ const hsSettingsFile = getHsSettingsFileIfExists();
157
157
  if (hsSettingsFile && hsSettingsFile.localDefaultAccount) {
158
158
  defaultAccountToUse = hsSettingsFile.localDefaultAccount;
159
159
  }
@@ -179,7 +179,7 @@ export function getConfigDefaultAccount() {
179
179
  export function getConfigDefaultAccountIfExists() {
180
180
  const { accounts, defaultAccount } = getConfig();
181
181
  let defaultAccountToUse = defaultAccount;
182
- const hsSettingsFile = getHsSettingsFile();
182
+ const hsSettingsFile = getHsSettingsFileIfExists();
183
183
  if (hsSettingsFile && hsSettingsFile.localDefaultAccount) {
184
184
  defaultAccountToUse = hsSettingsFile.localDefaultAccount;
185
185
  }
@@ -201,9 +201,9 @@ export function getAllConfigAccounts() {
201
201
  const { accounts } = getConfig();
202
202
  return accounts;
203
203
  }
204
- export function getLinkedConfigAccounts() {
204
+ export function getLinkedOrAllConfigAccounts() {
205
205
  const { accounts } = getConfig();
206
- const hsSettingsFile = getHsSettingsFile();
206
+ const hsSettingsFile = getHsSettingsFileIfExists();
207
207
  if (!hsSettingsFile) {
208
208
  return accounts;
209
209
  }
@@ -1,4 +1,4 @@
1
1
  import { GitInclusionResult } from '../types/Config.js';
2
2
  export declare function checkAndAddConfigToGitignore(configPath: string): void;
3
- export declare function checkAndAddSettingsToGitignore(settingsPath: string): void;
3
+ export declare function checkAndAddHsFolderToGitignore(settingsPath: string): void;
4
4
  export declare function checkGitInclusion(configPath: string): GitInclusionResult;
package/lib/gitignore.js CHANGED
@@ -23,7 +23,7 @@ export function checkAndAddConfigToGitignore(configPath) {
23
23
  throw new Error(i18n(`${i18nKey}.errors.configIgnore`), { cause: e });
24
24
  }
25
25
  }
26
- export function checkAndAddSettingsToGitignore(settingsPath) {
26
+ export function checkAndAddHsFolderToGitignore(settingsPath) {
27
27
  try {
28
28
  const hsDirPath = path.resolve(path.dirname(settingsPath));
29
29
  const { configIgnored, gitignoreFiles } = checkGitInclusion(hsDirPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/local-dev-lib",
3
- "version": "0.7.4-experimental.2",
3
+ "version": "0.7.4-experimental.3",
4
4
  "type": "module",
5
5
  "description": "Provides library functionality for HubSpot local development tooling, including the HubSpot CLI",
6
6
  "repository": {