Skip to content

Commit

Permalink
Tweak project validation error message based on DX feedback
Browse files Browse the repository at this point in the history
Drops including the "project root" filesystem path, and just has the message say project root.
  • Loading branch information
mendel-at-hubspot committed Nov 7, 2023
1 parent 2f9ba49 commit 635d445
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion packages/cli/lang/en.lyaml
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ en:
fileChangeError: "Failed to notify local dev server of file change: {{ message }}"
projects:
config:
srcOutsideProjectDir: "Invalid line in {{ projectConfig}}: {{#bold}}srcDir: \"{{ srcDir }}\"{{/bold}}\n\t`srcDir` should be a relative path to a directory within {{ projectDir }}, such as \".\" or \"./src\""
srcOutsideProjectDir: "Invalid value for 'srcDir' in {{ projectConfig }}: {{#bold}}srcDir: \"{{ srcDir }}\"{{/bold}}\n\t'srcDir' must be a relative path to a folder under the project root, such as \".\" or \"./src\""
uploadProjectFiles:
add: "Uploading {{#bold}}{{ projectName }}{{/bold}} project files to {{ accountIdentifier }}"
fail: "Failed to upload {{#bold}}{{ projectName }}{{/bold}} project files to {{ accountIdentifier }}"
Expand Down
9 changes: 0 additions & 9 deletions packages/cli/lib/__tests__/projects.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ describe('@hubspot/cli/lib/projects', () => {
expect(errorSpy).toHaveBeenCalledWith(
expect.stringContaining('srcDir: ".."')
);
expect(errorSpy).toHaveBeenCalledWith(
expect.stringContaining(`within ${projectDir}`)
);
});

it('for root directory', () => {
Expand All @@ -86,9 +83,6 @@ describe('@hubspot/cli/lib/projects', () => {
expect(errorSpy).toHaveBeenCalledWith(
expect.stringContaining('srcDir: "/"')
);
expect(errorSpy).toHaveBeenCalledWith(
expect.stringContaining(`within ${projectDir}`)
);
});

it('for complicated directory', () => {
Expand All @@ -100,9 +94,6 @@ describe('@hubspot/cli/lib/projects', () => {
expect(errorSpy).toHaveBeenCalledWith(
expect.stringContaining(`srcDir: "${srcDir}"`)
);
expect(errorSpy).toHaveBeenCalledWith(
expect.stringContaining(`within ${projectDir}`)
);
});
});

Expand Down
1 change: 0 additions & 1 deletion packages/cli/lib/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ const validateProjectConfig = (projectConfig, projectDir) => {
logger.error(
i18n(`${i18nKey}.config.srcOutsideProjectDir`, {
srcDir: projectConfig.srcDir,
projectDir,
projectConfig: projectConfigFile,
})
);
Expand Down

0 comments on commit 635d445

Please sign in to comment.