@hubspot/cli 7.7.2-experimental.0 → 7.7.3-experimental.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/commands/project/dev/unifiedFlow.js +5 -7
- package/lang/en.d.ts +1 -0
- package/lang/en.js +1 -0
- package/lib/projects/localDev/LocalDevLogger.js +1 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.js +2 -2
- package/lib/projects/urls.d.ts +1 -0
- package/lib/projects/urls.js +8 -2
- package/package.json +2 -2
|
@@ -24,6 +24,7 @@ const accountTypes_1 = require("../../../lib/accountTypes");
|
|
|
24
24
|
const ui_1 = require("../../../lib/ui");
|
|
25
25
|
const logger_1 = require("../../../lib/ui/logger");
|
|
26
26
|
const en_1 = require("../../../lang/en");
|
|
27
|
+
const LocalDevWebsocketServer_1 = __importDefault(require("../../../lib/projects/localDev/LocalDevWebsocketServer"));
|
|
27
28
|
async function unifiedProjectDevFlow({ args, targetProjectAccountId, providedTargetTestingAccountId, projectConfig, projectDir, profileConfig, }) {
|
|
28
29
|
const env = (0, environment_1.getValidEnv)((0, config_2.getEnv)(targetProjectAccountId));
|
|
29
30
|
let projectNodes;
|
|
@@ -131,23 +132,20 @@ async function unifiedProjectDevFlow({ args, targetProjectAccountId, providedTar
|
|
|
131
132
|
await localDevProcess.start();
|
|
132
133
|
const watcher = new LocalDevWatcher_1.default(localDevProcess);
|
|
133
134
|
watcher.start();
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
// args.debug
|
|
137
|
-
// );
|
|
138
|
-
// await websocketServer.start();
|
|
135
|
+
const websocketServer = new LocalDevWebsocketServer_1.default(localDevProcess, args.debug);
|
|
136
|
+
await websocketServer.start();
|
|
139
137
|
(0, process_1.handleKeypress)(async (key) => {
|
|
140
138
|
if ((key.ctrl && key.name === 'c') || key.name === 'q') {
|
|
141
139
|
await Promise.all([
|
|
142
140
|
localDevProcess.stop(),
|
|
143
141
|
watcher.stop(),
|
|
144
|
-
|
|
142
|
+
websocketServer.shutdown(),
|
|
145
143
|
]);
|
|
146
144
|
}
|
|
147
145
|
});
|
|
148
146
|
(0, process_1.handleExit)(({ isSIGHUP }) => {
|
|
149
147
|
localDevProcess.stop(!isSIGHUP);
|
|
150
148
|
watcher.stop();
|
|
151
|
-
|
|
149
|
+
websocketServer.shutdown();
|
|
152
150
|
});
|
|
153
151
|
}
|
package/lang/en.d.ts
CHANGED
|
@@ -2258,6 +2258,7 @@ export declare const lib: {
|
|
|
2258
2258
|
readonly running: (projectName: string, accountIdentifier: string) => string;
|
|
2259
2259
|
readonly quitHelper: `Press ${string} to stop the local dev server`;
|
|
2260
2260
|
readonly viewProjectLink: (name: string, accountId: number) => string;
|
|
2261
|
+
readonly viewLocalDevUILink: (accountId: number) => string;
|
|
2261
2262
|
readonly viewTestAccountLink: "View developer test account in HubSpot";
|
|
2262
2263
|
readonly exitingStart: "Stopping local dev server ...";
|
|
2263
2264
|
readonly exitingSucceed: "Successfully exited";
|
package/lang/en.js
CHANGED
|
@@ -2257,6 +2257,7 @@ exports.lib = {
|
|
|
2257
2257
|
running: (projectName, accountIdentifier) => chalk_1.default.hex(ui_1.UI_COLORS.SORBET)(`Running ${chalk_1.default.bold(projectName)} locally on ${accountIdentifier}, waiting for changes ...`),
|
|
2258
2258
|
quitHelper: `Press ${chalk_1.default.bold('q')} to stop the local dev server`,
|
|
2259
2259
|
viewProjectLink: (name, accountId) => (0, ui_1.uiLink)('View project in HubSpot', (0, urls_1.getProjectDetailUrl)(name, accountId) || ''),
|
|
2260
|
+
viewLocalDevUILink: (accountId) => (0, ui_1.uiLink)('View local dev session in HubSpot', (0, urls_1.getLocalDevUiUrl)(accountId)),
|
|
2260
2261
|
viewTestAccountLink: 'View developer test account in HubSpot',
|
|
2261
2262
|
exitingStart: 'Stopping local dev server ...',
|
|
2262
2263
|
exitingSucceed: 'Successfully exited',
|
|
@@ -101,6 +101,7 @@ class LocalDevLogger {
|
|
|
101
101
|
logger_2.uiLogger.log('');
|
|
102
102
|
logger_2.uiLogger.log(en_1.lib.LocalDevManager.running(this.state.projectConfig.name, (0, ui_1.uiAccountDescription)(this.state.targetProjectAccountId)));
|
|
103
103
|
logger_2.uiLogger.log(en_1.lib.LocalDevManager.viewProjectLink(this.state.projectConfig.name, this.state.targetProjectAccountId));
|
|
104
|
+
logger_2.uiLogger.log(en_1.lib.LocalDevManager.viewLocalDevUILink(this.state.targetTestingAccountId));
|
|
104
105
|
logger_2.uiLogger.log('');
|
|
105
106
|
logger_2.uiLogger.log(en_1.lib.LocalDevManager.quitHelper);
|
|
106
107
|
(0, ui_1.uiLine)();
|
|
@@ -13,8 +13,8 @@ class LocalDevWebsocketServer {
|
|
|
13
13
|
debug;
|
|
14
14
|
localDevProcess;
|
|
15
15
|
ALLOWED_ORIGINS = [
|
|
16
|
-
'https://hubspot.com',
|
|
17
|
-
'https://hubspotqa.com',
|
|
16
|
+
'https://app.hubspot.com',
|
|
17
|
+
'https://app.hubspotqa.com',
|
|
18
18
|
'https://local.hubspot.com',
|
|
19
19
|
'https://local.hubspotqa.com',
|
|
20
20
|
];
|
package/lib/projects/urls.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ export declare function getProjectSettingsUrl(projectName: string, accountId: nu
|
|
|
3
3
|
export declare function getProjectActivityUrl(projectName: string, accountId: number): string;
|
|
4
4
|
export declare function getProjectBuildDetailUrl(projectName: string, buildId: number, accountId: number): string;
|
|
5
5
|
export declare function getProjectDeployDetailUrl(projectName: string, deployId: number, accountId: number): string;
|
|
6
|
+
export declare function getLocalDevUiUrl(accountId: number): string;
|
package/lib/projects/urls.js
CHANGED
|
@@ -5,12 +5,15 @@ exports.getProjectSettingsUrl = getProjectSettingsUrl;
|
|
|
5
5
|
exports.getProjectActivityUrl = getProjectActivityUrl;
|
|
6
6
|
exports.getProjectBuildDetailUrl = getProjectBuildDetailUrl;
|
|
7
7
|
exports.getProjectDeployDetailUrl = getProjectDeployDetailUrl;
|
|
8
|
+
exports.getLocalDevUiUrl = getLocalDevUiUrl;
|
|
8
9
|
const urls_1 = require("@hubspot/local-dev-lib/urls");
|
|
9
10
|
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
10
11
|
const environments_1 = require("@hubspot/local-dev-lib/constants/environments");
|
|
12
|
+
function getBaseUrl(accountId) {
|
|
13
|
+
return (0, urls_1.getHubSpotWebsiteOrigin)((0, config_1.getEnv)(accountId) === 'qa' ? environments_1.ENVIRONMENTS.QA : environments_1.ENVIRONMENTS.PROD);
|
|
14
|
+
}
|
|
11
15
|
function getProjectHomeUrl(accountId) {
|
|
12
|
-
|
|
13
|
-
return `${baseUrl}/developer-projects/${accountId}`;
|
|
16
|
+
return `${getBaseUrl(accountId)}/developer-projects/${accountId}`;
|
|
14
17
|
}
|
|
15
18
|
function getProjectDetailUrl(projectName, accountId) {
|
|
16
19
|
if (!projectName)
|
|
@@ -31,3 +34,6 @@ function getProjectBuildDetailUrl(projectName, buildId, accountId) {
|
|
|
31
34
|
function getProjectDeployDetailUrl(projectName, deployId, accountId) {
|
|
32
35
|
return `${getProjectActivityUrl(projectName, accountId)}/deploy/${deployId}`;
|
|
33
36
|
}
|
|
37
|
+
function getLocalDevUiUrl(accountId) {
|
|
38
|
+
return `${getBaseUrl(accountId)}/developer-projects-local-dev/${accountId}`;
|
|
39
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cli",
|
|
3
|
-
"version": "7.7.
|
|
3
|
+
"version": "7.7.3-experimental.0",
|
|
4
4
|
"description": "The official CLI for developing on HubSpot",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": "https://github.com/HubSpot/hubspot-cli",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@hubspot/local-dev-lib": "3.7.1",
|
|
9
|
-
"@hubspot/project-parsing-lib": "0.3.
|
|
9
|
+
"@hubspot/project-parsing-lib": "0.3.0",
|
|
10
10
|
"@hubspot/serverless-dev-runtime": "7.0.2",
|
|
11
11
|
"@hubspot/theme-preview-dev-server": "0.0.10",
|
|
12
12
|
"@hubspot/ui-extensions-dev-server": "0.9.2",
|