|
@@ -62,6 +62,7 @@ export const CompileContextPropTypes = {
|
|
|
showLogs: PropTypes.bool.isRequired,
|
|
showLogs: PropTypes.bool.isRequired,
|
|
|
stopOnFirstError: PropTypes.bool.isRequired,
|
|
stopOnFirstError: PropTypes.bool.isRequired,
|
|
|
stopOnValidationError: PropTypes.bool.isRequired,
|
|
stopOnValidationError: PropTypes.bool.isRequired,
|
|
|
|
|
+ stoppedOnFirstError: PropTypes.bool.isRequired,
|
|
|
uncompiled: PropTypes.bool,
|
|
uncompiled: PropTypes.bool,
|
|
|
validationIssues: PropTypes.object,
|
|
validationIssues: PropTypes.object,
|
|
|
firstRenderDone: PropTypes.func,
|
|
firstRenderDone: PropTypes.func,
|
|
@@ -164,6 +165,9 @@ export function LocalCompileProvider({ children }) {
|
|
|
true
|
|
true
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
+ // whether the last compiles stopped on first error
|
|
|
|
|
+ const [stoppedOnFirstError, setStoppedOnFirstError] = useState(false)
|
|
|
|
|
+
|
|
|
// 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}`,
|
|
@@ -221,12 +225,12 @@ export function LocalCompileProvider({ children }) {
|
|
|
|
|
|
|
|
// keep draft setting in sync with the compiler
|
|
// keep draft setting in sync with the compiler
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
- compiler.draft = draft
|
|
|
|
|
|
|
+ compiler.setOption('draft', draft)
|
|
|
}, [compiler, draft])
|
|
}, [compiler, draft])
|
|
|
|
|
|
|
|
// keep stop on first error setting in sync with the compiler
|
|
// keep stop on first error setting in sync with the compiler
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
- compiler.stopOnFirstError = stopOnFirstError
|
|
|
|
|
|
|
+ compiler.setOption('stopOnFirstError', stopOnFirstError)
|
|
|
}, [compiler, stopOnFirstError])
|
|
}, [compiler, stopOnFirstError])
|
|
|
|
|
|
|
|
// pass the "uncompiled" value up into the scope for use outside this context provider
|
|
// pass the "uncompiled" value up into the scope for use outside this context provider
|
|
@@ -311,6 +315,11 @@ export function LocalCompileProvider({ children }) {
|
|
|
setShowLogs(false)
|
|
setShowLogs(false)
|
|
|
break
|
|
break
|
|
|
|
|
|
|
|
|
|
+ case 'stopped-on-first-error':
|
|
|
|
|
+ setError(undefined)
|
|
|
|
|
+ setShowLogs(true)
|
|
|
|
|
+ break
|
|
|
|
|
+
|
|
|
case 'clsi-maintenance':
|
|
case 'clsi-maintenance':
|
|
|
case 'compile-in-progress':
|
|
case 'compile-in-progress':
|
|
|
case 'exited':
|
|
case 'exited':
|
|
@@ -354,6 +363,8 @@ export function LocalCompileProvider({ children }) {
|
|
|
setError('error')
|
|
setError('error')
|
|
|
break
|
|
break
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ setStoppedOnFirstError(data.status === 'stopped-on-first-error')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return () => {
|
|
return () => {
|
|
@@ -484,6 +495,7 @@ export function LocalCompileProvider({ children }) {
|
|
|
stopCompile,
|
|
stopCompile,
|
|
|
stopOnFirstError,
|
|
stopOnFirstError,
|
|
|
stopOnValidationError,
|
|
stopOnValidationError,
|
|
|
|
|
+ stoppedOnFirstError,
|
|
|
uncompiled,
|
|
uncompiled,
|
|
|
validationIssues,
|
|
validationIssues,
|
|
|
firstRenderDone,
|
|
firstRenderDone,
|
|
@@ -523,6 +535,7 @@ export function LocalCompileProvider({ children }) {
|
|
|
stopCompile,
|
|
stopCompile,
|
|
|
stopOnFirstError,
|
|
stopOnFirstError,
|
|
|
stopOnValidationError,
|
|
stopOnValidationError,
|
|
|
|
|
+ stoppedOnFirstError,
|
|
|
uncompiled,
|
|
uncompiled,
|
|
|
validationIssues,
|
|
validationIssues,
|
|
|
firstRenderDone,
|
|
firstRenderDone,
|