|
@@ -57,8 +57,10 @@ export const CompileContextPropTypes = {
|
|
|
setPosition: PropTypes.func.isRequired,
|
|
setPosition: PropTypes.func.isRequired,
|
|
|
setShowLogs: PropTypes.func.isRequired,
|
|
setShowLogs: PropTypes.func.isRequired,
|
|
|
toggleLogs: PropTypes.func.isRequired,
|
|
toggleLogs: PropTypes.func.isRequired,
|
|
|
|
|
+ setStopOnFirstError: PropTypes.func.isRequired,
|
|
|
setStopOnValidationError: PropTypes.func.isRequired,
|
|
setStopOnValidationError: PropTypes.func.isRequired,
|
|
|
showLogs: PropTypes.bool.isRequired,
|
|
showLogs: PropTypes.bool.isRequired,
|
|
|
|
|
+ stopOnFirstError: PropTypes.bool.isRequired,
|
|
|
stopOnValidationError: PropTypes.bool.isRequired,
|
|
stopOnValidationError: PropTypes.bool.isRequired,
|
|
|
uncompiled: PropTypes.bool,
|
|
uncompiled: PropTypes.bool,
|
|
|
validationIssues: PropTypes.object,
|
|
validationIssues: PropTypes.object,
|
|
@@ -155,6 +157,13 @@ export function LocalCompileProvider({ children }) {
|
|
|
// whether the compile should run in draft mode
|
|
// whether the compile should run in draft mode
|
|
|
const [draft, setDraft] = usePersistedState(`draft:${projectId}`, false, true)
|
|
const [draft, setDraft] = usePersistedState(`draft:${projectId}`, false, true)
|
|
|
|
|
|
|
|
|
|
+ // whether compiling should stop on first error
|
|
|
|
|
+ const [stopOnFirstError, setStopOnFirstError] = usePersistedState(
|
|
|
|
|
+ `stop_on_first_error:${projectId}`,
|
|
|
|
|
+ false,
|
|
|
|
|
+ true
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
// whether compiling should be prevented if there are linting errors
|
|
// whether compiling should be prevented if there are linting errors
|
|
|
const [stopOnValidationError, setStopOnValidationError] = usePersistedState(
|
|
const [stopOnValidationError, setStopOnValidationError] = usePersistedState(
|
|
|
`stop_on_validation_error:${projectId}`,
|
|
`stop_on_validation_error:${projectId}`,
|
|
@@ -463,10 +472,12 @@ export function LocalCompileProvider({ children }) {
|
|
|
setPosition,
|
|
setPosition,
|
|
|
setShowLogs,
|
|
setShowLogs,
|
|
|
toggleLogs,
|
|
toggleLogs,
|
|
|
|
|
+ setStopOnFirstError,
|
|
|
setStopOnValidationError,
|
|
setStopOnValidationError,
|
|
|
showLogs,
|
|
showLogs,
|
|
|
startCompile,
|
|
startCompile,
|
|
|
stopCompile,
|
|
stopCompile,
|
|
|
|
|
+ stopOnFirstError,
|
|
|
stopOnValidationError,
|
|
stopOnValidationError,
|
|
|
uncompiled,
|
|
uncompiled,
|
|
|
validationIssues,
|
|
validationIssues,
|
|
@@ -500,10 +511,12 @@ export function LocalCompileProvider({ children }) {
|
|
|
setHasLintingError, // only for stories
|
|
setHasLintingError, // only for stories
|
|
|
setHighlights,
|
|
setHighlights,
|
|
|
setPosition,
|
|
setPosition,
|
|
|
|
|
+ setStopOnFirstError,
|
|
|
setStopOnValidationError,
|
|
setStopOnValidationError,
|
|
|
showLogs,
|
|
showLogs,
|
|
|
startCompile,
|
|
startCompile,
|
|
|
stopCompile,
|
|
stopCompile,
|
|
|
|
|
+ stopOnFirstError,
|
|
|
stopOnValidationError,
|
|
stopOnValidationError,
|
|
|
uncompiled,
|
|
uncompiled,
|
|
|
validationIssues,
|
|
validationIssues,
|