Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert localDev and LocalDevManager to TS #1339

Merged
merged 19 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions commands/project/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@ exports.handler = async options => {
});

try {
const result = await handleProjectUpload(
const { result, uploadError } = await handleProjectUpload(
derivedAccountId,
projectConfig,
projectDir,
pollProjectBuildAndDeploy,
message
);

if (result.uploadError) {
if (uploadError) {
if (
isSpecifiedError(result.uploadError, {
isSpecifiedError(uploadError, {
subCategory: PROJECT_ERROR_TYPES.PROJECT_LOCKED,
})
) {
Expand All @@ -67,7 +67,7 @@ exports.handler = async options => {
logger.log();
} else {
logError(
result.uploadError,
uploadError,
new ApiErrorContext({
accountId: derivedAccountId,
request: 'project upload',
Expand Down
8 changes: 4 additions & 4 deletions commands/project/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,16 @@ exports.handler = async options => {

// Upload all files if no build exists for this project yet
if (initialUpload || hasNoBuilds) {
const result = await handleProjectUpload(
const { uploadError } = await handleProjectUpload(
derivedAccountId,
projectConfig,
projectDir,
startWatching
);

if (result.uploadError) {
if (uploadError) {
if (
isSpecifiedError(result.uploadError, {
isSpecifiedError(uploadError, {
subCategory: PROJECT_ERROR_TYPES.PROJECT_LOCKED,
})
) {
Expand All @@ -131,7 +131,7 @@ exports.handler = async options => {
logger.log();
} else {
logError(
result.uploadError,
uploadError,
new ApiErrorContext({
accountId: derivedAccountId,
request: 'project upload',
Expand Down
3 changes: 3 additions & 0 deletions lang/en.lyaml
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,7 @@ en:
fileChangeError: "Failed to notify local dev server of file change: {{ message }}"
localDev:
confirmDefaultAccountIsTarget:
configError: "An error occurred while reading the default account from your config. Run {{ authCommand }} to re-auth this account"
declineDefaultAccountExplanation: "To develop on a different account, run {{ useCommand }} to change your default account, then re-run {{ devCommand }}."
checkIfDefaultAccountIsSupported:
publicApp: "This project contains a public app. Local development of public apps is only supported on developer accounts and developer test accounts. Change your default account using {{ useCommand }}, or link a new account with {{ authCommand }}."
Expand All @@ -1095,6 +1096,7 @@ en:
createInitialBuildForNewProject:
initialUploadMessage: "HubSpot Local Dev Server Startup"
projectLockedError: "Your project is locked. This may mean that another user is running the {{#bold}}`hs project watch`{{/bold}} command for this project. If this is you, unlock the project in Projects UI."
genericError: "An error occurred while creating the initial build for this project. Run {{ uploadCommand }} to try again."
checkIfParentAccountIsAuthed:
notAuthedError: "To develop this project locally, run {{ authCommand }} to authenticate the App Developer Account {{ accountId }} associated with {{ accountIdentifier }}."
projects:
Expand Down Expand Up @@ -1421,6 +1423,7 @@ en:
invalidUser: "Couldn't create {{#bold}}{{ accountName }}{{/bold}} because your account has been removed from {{#bold}}{{ parentAccountName }}{{/bold}} or your permission set doesn't allow you to create the sandbox. To update your permissions, contact a super admin in {{#bold}}{{ parentAccountName }}{{/bold}}."
403Gating: "Couldn't create {{#bold}}{{ accountName }}{{/bold}} because {{#bold}}{{ parentAccountName }}{{/bold}} does not have access to development sandboxes. To opt in to the CRM Development Beta and use development sandboxes, visit https://app.hubspot.com/l/product-updates/in-beta?update=13899236."
usageLimitsFetch: "Unable to fetch sandbox usage limits. Please try again."
generic: "An error occurred while creating a new sandbox. Please try again."
limit:
developer:
one: "{{#bold}}{{ accountName }}{{/bold}} reached the limit of {{ limit }} development sandbox.
Expand Down
Loading
Loading