mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
Merge pull request #404 from AntlerVC/feature/cloud-run
Feature/cloud run
This commit is contained in:
@@ -123,12 +123,17 @@ export default function SparksEditor() {
|
||||
onValideStatusUpdate={({ isValid }) => {
|
||||
setIsSparksValid(isValid);
|
||||
}}
|
||||
diagnosticsOptions={{
|
||||
noSemanticValidation: false,
|
||||
noSyntaxValidation: true,
|
||||
noSuggestionDiagnostics: true,
|
||||
}}
|
||||
/>
|
||||
{!isSparksValid &&
|
||||
<Alert severity="error">
|
||||
You need to resolve all errors before you are able to save."
|
||||
</Alert>
|
||||
}
|
||||
{!isSparksValid && (
|
||||
<Alert severity="error">
|
||||
You need to resolve all errors before you are able to save."
|
||||
</Alert>
|
||||
)}
|
||||
</>
|
||||
}
|
||||
actions={{
|
||||
|
||||
@@ -27,6 +27,7 @@ export default function CodeEditor(props: any) {
|
||||
script,
|
||||
height = 400,
|
||||
onValideStatusUpdate,
|
||||
diagnosticsOptions,
|
||||
} = props;
|
||||
const theme = useTheme();
|
||||
const monacoInstance = useMonaco();
|
||||
@@ -60,27 +61,26 @@ export default function CodeEditor(props: any) {
|
||||
const firestoreDefsFile = await fetch(
|
||||
`${process.env.PUBLIC_URL}/firestore.d.ts`
|
||||
);
|
||||
// const firebaseAuthDefsFile = await fetch(
|
||||
// `${process.env.PUBLIC_URL}/auth.d.ts`
|
||||
// );
|
||||
const firebaseAuthDefsFile = await fetch(
|
||||
`${process.env.PUBLIC_URL}/auth.d.ts`
|
||||
);
|
||||
const firestoreDefs = await firestoreDefsFile.text();
|
||||
// const firebaseAuthDefs = await firebaseAuthDefsFile.text();
|
||||
// console.timeLog(firebaseAuthDefs);
|
||||
// monaco
|
||||
// .init()
|
||||
// .then((monacoInstance) => {
|
||||
const firebaseAuthDefs = (await firebaseAuthDefsFile.text())
|
||||
?.replace("export", "declare")
|
||||
?.replace("admin.auth", "adminauth");
|
||||
console.timeLog(firebaseAuthDefs);
|
||||
|
||||
try {
|
||||
monacoInstance.languages.typescript.javascriptDefaults.addExtraLib(
|
||||
firestoreDefs
|
||||
);
|
||||
// monacoInstance.languages.typescript.javascriptDefaults.addExtraLib(
|
||||
// firebaseAuthDefs
|
||||
// );
|
||||
monacoInstance.languages.typescript.javascriptDefaults.addExtraLib(
|
||||
firebaseAuthDefs
|
||||
);
|
||||
monacoInstance.languages.typescript.javascriptDefaults.setDiagnosticsOptions(
|
||||
{
|
||||
noSemanticValidation: false,
|
||||
noSyntaxValidation: true,
|
||||
noSuggestionDiagnostics: true,
|
||||
diagnosticsOptions ?? {
|
||||
noSemanticValidation: true,
|
||||
noSyntaxValidation: false,
|
||||
}
|
||||
);
|
||||
// compiler options
|
||||
@@ -302,7 +302,7 @@ export default function CodeEditor(props: any) {
|
||||
monacoInstance.languages.typescript.javascriptDefaults.addExtraLib(
|
||||
[
|
||||
" const db:FirebaseFirestore.Firestore;",
|
||||
// " const auth:admin.auth;",
|
||||
" const auth:adminauth.BaseAuth;",
|
||||
"declare class row {",
|
||||
" /**",
|
||||
" * Returns the row fields",
|
||||
|
||||
Reference in New Issue
Block a user