Skip to content

Commit a29e889

Browse files
Merge pull request #39 from HubSpot/br-add-deprecation-comments
Add deprecation annotations to ported utils
2 parents 745916e + a987c16 commit a29e889

16 files changed

+221
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## Deprecated
2+
3+
This library is deprecated and is currently being replaced by the new [local-dev-lib](https://github.com/HubSpot/hubspot-local-dev-lib) library. This library will remain available for use, but no new functionality will be added to it
4+
15
## Table of Contents
26

37
- [Overview](#what-is-cli-lib-for)

api/fileMapper.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ async function deleteFolder(accountId, folderPath, options = {}) {
169169
}
170170

171171
/**
172+
* @deprecated
173+
* Use the corresponding export from local-dev-lib (@hubspot/local-dev-lib/trackUsage)
174+
* https://github.com/HubSpot/hubspot-local-dev-lib
175+
*
172176
* Track CMS CLI usage
173177
*
174178
* @async

archive.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ function cleanupTempDir(tmpDir) {
117117
}
118118
}
119119

120+
/**
121+
* @deprecated
122+
* Use the corresponding export from local-dev-lib
123+
* https://github.com/HubSpot/hubspot-local-dev-lib
124+
*/
120125
async function extractZipArchive(
121126
zip,
122127
name,

ignoreRules.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ const ignoreRules = ignore().add(ignoreList);
3333

3434
let searchDomain = null;
3535
let loaded = false;
36+
37+
/**
38+
* @deprecated
39+
* Use the corresponding export from local-dev-lib
40+
* https://github.com/HubSpot/hubspot-local-dev-lib
41+
*/
3642
function loadIgnoreConfig(isInProject = false) {
3743
if (loaded) {
3844
return;
@@ -54,6 +60,11 @@ function loadIgnoreConfig(isInProject = false) {
5460
loaded = true;
5561
}
5662

63+
/**
64+
* @deprecated
65+
* Use the corresponding export from local-dev-lib
66+
* https://github.com/HubSpot/hubspot-local-dev-lib
67+
*/
5768
function shouldIgnoreFile(file, isInProject) {
5869
loadIgnoreConfig(isInProject);
5970
const relativeTo = searchDomain || '/';
@@ -62,11 +73,21 @@ function shouldIgnoreFile(file, isInProject) {
6273
return !!relativePath && ignoreRules.ignores(relativePath);
6374
}
6475

76+
/**
77+
* @deprecated
78+
* Use the corresponding export from local-dev-lib
79+
* https://github.com/HubSpot/hubspot-local-dev-lib
80+
*/
6581
function createIgnoreFilter(isInProject) {
6682
loadIgnoreConfig(isInProject);
6783
return file => !shouldIgnoreFile(file);
6884
}
6985

86+
/**
87+
* @deprecated
88+
* Use the corresponding export from local-dev-lib
89+
* https://github.com/HubSpot/hubspot-local-dev-lib
90+
*/
7091
function ignoreFile(filePath) {
7192
ignoreRules.add(filePath);
7293
}

lib/environment.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
const { ENVIRONMENTS } = require('./constants');
22

33
/**
4+
* @deprecated
5+
* Use the corresponding export from local-dev-lib
6+
* https://github.com/HubSpot/hubspot-local-dev-lib
47
* Returns environment constant for QA and PROD or optional masked value for PROD
58
* @param {string} env Environment string, can be any case
69
* @param {(boolean|object)} shouldMaskProduction Returning alternate value for PROD

lib/files.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ const { getEnv } = require('@hubspot/local-dev-lib/config');
44
const { getHubSpotWebsiteOrigin } = require('./urls');
55
const { ENVIRONMENTS } = require('./constants');
66

7+
/**
8+
* @deprecated
9+
* Use the corresponding export from local-dev-lib (renamed to @hubspot/local-dev-lib/cms/themes)
10+
* https://github.com/HubSpot/hubspot-local-dev-lib
11+
*/
712
const getThemeJSONPath = path =>
813
findup('theme.json', {
914
cwd: path,
@@ -18,6 +23,11 @@ const getThemeNameFromPath = filePath => {
1823
return pathParts[pathParts.length - 2];
1924
};
2025

26+
/**
27+
* @deprecated
28+
* Use the corresponding export from local-dev-lib (renamed to @hubspot/local-dev-lib/cms/themes)
29+
* https://github.com/HubSpot/hubspot-local-dev-lib
30+
*/
2131
const getThemePreviewUrl = (filePath, accountId) => {
2232
const themeName = getThemeNameFromPath(filePath);
2333
if (!themeName) return;

lib/git.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ const checkAndWarnGitInclusion = configPath => {
104104
}
105105
};
106106

107+
/**
108+
* @deprecated
109+
* Use the corresponding export from local-dev-lib (renamed to @hubspot/local-dev-lib/gitignore)
110+
* https://github.com/HubSpot/hubspot-local-dev-lib
111+
*/
107112
const checkAndUpdateGitignore = configPath => {
108113
try {
109114
const { configIgnored, gitignoreFiles } = checkGitInclusion(configPath);

lib/table.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,22 @@ const tableConfigDefaults = {
3333
},
3434
};
3535

36+
/**
37+
* @deprecated
38+
* Use the corresponding export from local-dev-lib
39+
* https://github.com/HubSpot/hubspot-local-dev-lib
40+
*/
3641
const getTableContents = (tableData = [], tableConfig = {}) => {
3742
const mergedConfig = mergeDeep({}, tableConfigDefaults, tableConfig);
3843

3944
return table(tableData, mergedConfig);
4045
};
4146

47+
/**
48+
* @deprecated
49+
* Use the corresponding export from local-dev-lib
50+
* https://github.com/HubSpot/hubspot-local-dev-lib
51+
*/
4252
const getTableHeader = headerItems => {
4353
return headerItems.map(headerItem => chalk.bold(headerItem));
4454
};

lib/text.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* @deprecated
3+
* Use the corresponding export from local-dev-lib
4+
* https://github.com/HubSpot/hubspot-local-dev-lib
5+
*/
16
const commaSeparatedValues = (arr, conjunction = 'and', ifempty = '') => {
27
let l = arr.length;
38
if (!l) return ifempty;

lib/urls.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,20 @@ const getEnvUrlString = env => {
88
return env.toLowerCase() === ENVIRONMENTS.QA ? ENVIRONMENTS.QA : '';
99
};
1010

11+
/**
12+
* @deprecated
13+
* Use the corresponding export from local-dev-lib
14+
* https://github.com/HubSpot/hubspot-local-dev-lib
15+
*/
1116
const getHubSpotWebsiteOrigin = env => {
1217
return `https://app.hubspot${getEnvUrlString(env)}.com`;
1318
};
1419

20+
/**
21+
* @deprecated
22+
* Use the corresponding export from local-dev-lib
23+
* https://github.com/HubSpot/hubspot-local-dev-lib
24+
*/
1525
const getHubSpotApiOrigin = (env, useLocalHost) => {
1626
let domain = process.env.HUBAPI_DOMAIN_OVERRIDE;
1727

0 commit comments

Comments
 (0)