@hubspot/local-dev-lib 5.10.1 → 5.10.2

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/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # hubspot/local-dev-lib
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/@hubspot/local-dev-lib.svg)](https://www.npmjs.com/package/@hubspot/local-dev-lib)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@hubspot/local-dev-lib)](https://www.npmjs.com/package/@hubspot/local-dev-lib)
5
+ [![npm license](https://img.shields.io/npm/l/@hubspot/local-dev-lib)](https://www.npmjs.com/package/@hubspot/local-dev-lib)
6
+ [![node version](https://img.shields.io/node/v/@hubspot/local-dev-lib)](https://www.npmjs.com/package/@hubspot/local-dev-lib)
7
+
3
8
  Provides library functionality for HubSpot local development tooling, including the [HubSpot CLI](https://github.com/HubSpot/hubspot-cli).
4
9
 
5
10
  **NOTE:** This library is intended to replace the deprecated [@hubspot/cli-lib](https://github.com/HubSpot/cli-lib) library.
package/lib/cms/themes.js CHANGED
@@ -1,7 +1,5 @@
1
1
  import findup from 'findup-sync';
2
- import { getHubSpotWebsiteOrigin } from '../urls.js';
3
- import { ENVIRONMENTS } from '../../constants/environments.js';
4
- import { getConfigAccountEnvironment } from '../../config/index.js';
2
+ import { getHubSpotWebsiteOriginByAccountId } from '../urls.js';
5
3
  export function getThemeJSONPath(path) {
6
4
  return findup('theme.json', {
7
5
  cwd: path,
@@ -21,8 +19,6 @@ export function getThemePreviewUrl(filePath, accountId) {
21
19
  const themeName = getThemeNameFromPath(filePath);
22
20
  if (!themeName)
23
21
  return;
24
- const baseUrl = getHubSpotWebsiteOrigin(getConfigAccountEnvironment(accountId) === 'qa'
25
- ? ENVIRONMENTS.QA
26
- : ENVIRONMENTS.PROD);
22
+ const baseUrl = getHubSpotWebsiteOriginByAccountId(accountId);
27
23
  return `${baseUrl}/theme-previewer/${accountId}/edit/${encodeURIComponent(themeName)}`;
28
24
  }
package/lib/urls.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export declare const getHubSpotWebsiteOrigin: (env: string) => string;
2
+ export declare function getHubSpotWebsiteOriginByAccountId(accountId: number): string;
2
3
  export declare function getHubSpotApiOrigin(env?: string, useLocalHost?: boolean): string;
package/lib/urls.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ENVIRONMENTS } from '../constants/environments.js';
2
+ import { getConfigAccountEnvironment } from '../config/index.js';
2
3
  function getEnvUrlString(env) {
3
4
  if (typeof env !== 'string') {
4
5
  return '';
@@ -6,6 +7,11 @@ function getEnvUrlString(env) {
6
7
  return env.toLowerCase() === ENVIRONMENTS.QA ? ENVIRONMENTS.QA : '';
7
8
  }
8
9
  export const getHubSpotWebsiteOrigin = (env) => `https://app.hubspot${getEnvUrlString(env)}.com`;
10
+ export function getHubSpotWebsiteOriginByAccountId(accountId) {
11
+ return getHubSpotWebsiteOrigin(getConfigAccountEnvironment(accountId) === ENVIRONMENTS.QA
12
+ ? ENVIRONMENTS.QA
13
+ : ENVIRONMENTS.PROD);
14
+ }
9
15
  export function getHubSpotApiOrigin(env, useLocalHost) {
10
16
  let domain;
11
17
  const domainOverride = process.env.HUBAPI_DOMAIN_OVERRIDE;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/local-dev-lib",
3
- "version": "5.10.1",
3
+ "version": "5.10.2",
4
4
  "type": "module",
5
5
  "description": "Provides library functionality for HubSpot local development tooling, including the HubSpot CLI",
6
6
  "files": [
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "license": "Apache-2.0",
29
29
  "devDependencies": {
30
- "@hubspot/npm-scripts": "0.0.6",
30
+ "@hubspot/npm-scripts": "^0.3.3",
31
31
  "@types/content-disposition": "^0.5.5",
32
32
  "@types/cors": "^2.8.15",
33
33
  "@types/debounce": "^1.2.1",