Skip to content

Commit

Permalink
Run eslint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
apedroferreira committed Feb 23, 2024
1 parent 216fdd1 commit a8331fb
Show file tree
Hide file tree
Showing 43 changed files with 302 additions and 71 deletions.
233 changes: 232 additions & 1 deletion docs/data/pages.ts
Original file line number Diff line number Diff line change
@@ -1 +1,232 @@
/Users/adeeefioprrrr / Documents / Projects / mui - studio - pedro / prettier.config.js;
import type { MuiPage } from '@mui/monorepo/docs/src/MuiPage';
import componentsManifest from './studio/reference/components/manifest.json';

const pages: MuiPage[] = [
{
pathname: '/studio/getting-started-group',
title: 'Getting Started',
children: [
{ pathname: '/studio/getting-started', title: 'Overview' },
{ pathname: '/studio/getting-started/installation' },
{ pathname: '/studio/getting-started/why-studio', title: 'Why Studio?' },
{ pathname: '/studio/getting-started/first-app', title: 'Build your first app' },
{
pathname: '/studio/examples-group',
title: 'Examples',
children: [
{ pathname: '/studio/examples', title: 'Overview' },
{ pathname: '/studio/examples/npm-stats', title: 'npm stats' },
{ pathname: '/studio/examples/basic-crud-app', title: 'Basic CRUD application' },
{ pathname: '/studio/examples/qr-generator', title: 'QR Code generator' },
],
},
{ pathname: '/studio/getting-started/roadmap' },
{
pathname: '/studio/getting-started/support',
title: 'Support',
},
],
},
{
pathname: '/studio/concepts',
children: [
{
pathname: '/studio/concepts/building-ui',
title: 'Building UI',
},
{
pathname: '/studio/concepts/connecting-to-data',
title: 'Connecting to data',
children: [
{
pathname: '/studio/concepts/queries',
title: 'Overview',
},
{
pathname: '/studio/concepts/http-requests',
title: 'HTTP requests',
},
{
pathname: '/studio/concepts/custom-functions',
title: 'Custom functions',
},
{
pathname: '/studio/concepts/data-providers',
title: 'Data providers',
},
],
},
{
pathname: '/studio/concepts/data-binding',
title: 'Data binding',
},
{
pathname: '/studio/concepts/event-handling',
},
{
pathname: '/studio/concepts/file-structure',
title: 'File structure',
},
{
pathname: '/studio/concepts/deployment',
},
{
pathname: '/studio/concepts/custom-components',
},
{
pathname: '/studio/concepts/theming',
},
{
pathname: '/studio/concepts/page-properties',
},
{
pathname: '/studio/concepts/authorization',
title: 'Authorization',
children: [
{
pathname: '/studio/concepts/authentication',
title: 'Authentication',
},
{
pathname: '/studio/concepts/rbac',
title: 'Role-based access control',
},
],
},
{ pathname: '/studio/concepts/custom-server' },
],
},
{
pathname: '/studio/components',
children: [
{ pathname: '/studio/components/button' },
{
pathname: '/studio/components/datagrid',
title: 'Data Grid',
},
],
},
{
pathname: '/studio/how-to-guides',
title: 'How-to guides',
children: [
{
pathname: '/studio/how-to-guides/connect-to-datasource',
subheader: 'Connect to datasource',
children: [
{
pathname: '/studio/how-to-guides/connect-to-databases',
title: 'MySQL',
},
{
pathname: '/studio/how-to-guides/connect-to-googlesheets',
title: 'Google Sheets',
},
],
},
{
pathname: '/studio/how-to-guides/deployment',
subheader: 'Deployment',
children: [
{
pathname: '/studio/how-to-guides/render-deploy',
title: 'Deploy to Render',
},
],
},
{
pathname: '/studio/how-to-guides/custom-components',
subheader: 'Create custom components',
children: [
{
pathname: '/studio/how-to-guides/map-display',
title: 'Map component',
},
{
pathname: '/studio/how-to-guides/cube-component',
title: '3D cube component',
},
],
},
{
pathname: '/studio/how-to-guides/misc',
subheader: 'Miscellaneous',
children: [
{
pathname: '/studio/how-to-guides/customize-datagrid',
title: 'Customize data grids',
},
{
pathname: '/studio/how-to-guides/delete-datagrid-row',
title: 'Delete a data grid row',
},
{
pathname: '/studio/how-to-guides/embed-pages',
title: 'Embedding Studio pages',
},
{
pathname: '/studio/how-to-guides/basic-auth',
title: 'Enable basic auth',
},
{
pathname: '/studio/how-to-guides/editor-path',
title: 'Troubleshoot missing editor',
},
],
},
],
},
{
pathname: '/studio/reference-group',
title: 'Reference',
children: [
{
pathname: '/studio/reference/file-schema',
title: 'File schema',
},
{
pathname: '/studio/reference/components-group',
title: 'Components',
children: componentsManifest.pages,
},
{
pathname: '/studio/reference/api-group',
title: 'API',
children: [
{
pathname: '/studio/reference/api',
title: 'Index',
},
{
pathname: '/studio/reference/api/functions-group',
subheader: 'Functions',
children: [
{
title: 'createComponent',
pathname: '/studio/reference/api/create-component',
},
{
title: 'createDataProvider',
pathname: '/studio/reference/api/create-data-provider',
},
{
title: 'createFunction',
pathname: '/studio/reference/api/create-function',
},
{
title: 'createHandler',
pathname: '/studio/reference/api/create-handler',
},
{
title: 'getContext',
pathname: '/studio/reference/api/get-context',
},
],
},
],
},
],
},
];

export default pages;
4 changes: 2 additions & 2 deletions packages/studio-app/src/project.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Emitter } from '../../studio-utils/dist/events';
import { QueryClient, useQueryClient, useSuspenseQuery } from '@tanstack/react-query';
import * as React from 'react';
import { useNonNullableContext } from '../../studio-utils/dist/react';
import invariant from 'invariant';
import { useNonNullableContext } from '../../studio-utils/dist/react';
import { Emitter } from '../../studio-utils/dist/events';
import { ProjectEvents } from './types';
import { ServerDefinition } from './server/projectRpcServer';
import { createRpcApi } from './rpcClient';
Expand Down
2 changes: 1 addition & 1 deletion packages/studio-app/src/runtime/CanvasHooksContext.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ComponentConfig, NodeHashes } from '../../../studio-core/dist';
import * as React from 'react';
import { ComponentConfig, NodeHashes } from '../../../studio-core/dist';
import * as appDom from '../../../studio-core/dist/appDom';

export interface NavigateToPage {
Expand Down
2 changes: 1 addition & 1 deletion packages/studio-app/src/runtime/auth.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { asArray } from '../../../studio-utils/dist/collections';
import { Box } from '@mui/material';
import { asArray } from '../../../studio-utils/dist/collections';
import { AuthContext } from './useAuth';

export interface RequireAuthorizationProps {
Expand Down
4 changes: 2 additions & 2 deletions packages/studio-app/src/runtime/evalJsBindings.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { setWith, clone, set as setObjectPath } from 'lodash-es';
import { BindingEvaluationResult, JsRuntime } from '../../../studio-core/dist';
import { mapValues } from '../../../studio-utils/dist/collections';
// TODO: remove these lodash-es imports
// eslint-disable-next-line no-restricted-imports
import { setWith, clone, set as setObjectPath } from 'lodash-es';

import { getBindingType } from './bindings';
/**
* Updates an object's property value for a given path in an immutable way.
Expand Down
2 changes: 1 addition & 1 deletion packages/studio-app/src/runtime/useAuth.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
import * as appDom from '../../../studio-core/dist/appDom';
import { useNonNullableContext } from '../../../studio-utils/dist/react';
import { useLocation, useNavigate } from 'react-router-dom';
import { AppHostContext } from './AppHostContext';

const AUTH_API_PATH = '/api/auth';
Expand Down
6 changes: 3 additions & 3 deletions packages/studio-app/src/server/DataManager.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { NodeId, ExecFetchResult } from '../../../studio-core/dist';
import { withContext, createServerContext } from '../../../studio-core/dist/serverRuntime';
import { createServerJsRuntime } from '../../../studio-core/dist/jsServerRuntime';
import express, { Router } from 'express';
import cors from 'cors';
import invariant from 'invariant';
import { NodeId, ExecFetchResult } from '../../../studio-core/dist';
import { withContext, createServerContext } from '../../../studio-core/dist/serverRuntime';
import { createServerJsRuntime } from '../../../studio-core/dist/jsServerRuntime';
import { errorFrom, serializeError, SerializedError } from '../../../studio-utils/dist/errors';
import * as appDom from '../../../studio-core/dist/appDom';
import type { RuntimeConfig, Methods, ServerDataSource, StudioProjectOptions } from '../types';
Expand Down
2 changes: 1 addition & 1 deletion packages/studio-app/src/server/EnvManager.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as path from 'path';
import * as chokidar from 'chokidar';
import * as dotenv from 'dotenv';
import { Emitter } from '../../../studio-utils/dist/events';
import chalk from 'chalk';
import { Emitter } from '../../../studio-utils/dist/events';
import { truncate } from '../../../studio-utils/dist/strings';
import { Awaitable } from '../../../studio-utils/dist/types';
import { ProjectEvents, StudioProjectOptions } from '../types';
Expand Down
12 changes: 6 additions & 6 deletions packages/studio-app/src/server/FunctionsManager.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import * as path from 'path';
import * as fs from 'fs/promises';
import { Emitter } from '../../../studio-utils/dist/events';
import * as esbuild from 'esbuild';
import { ensureSuffix, indent } from '../../../studio-utils/dist/strings';
import * as chokidar from 'chokidar';
import chalk from 'chalk';
import { glob } from 'glob';
import { writeFileRecursive, fileExists, readJsonFile } from '../../../studio-utils/dist/fs';
import Piscina from 'piscina';
import * as url from 'node:url';
import type { GridRowId } from '@mui/x-data-grid';
import invariant from 'invariant';
import { writeFileRecursive, fileExists, readJsonFile } from '../../../studio-utils/dist/fs';
import {
ExecFetchResult,
GetRecordsParams,
Expand All @@ -16,9 +17,8 @@ import {
} from '../../../studio-core/dist';
import { errorFrom } from '../../../studio-utils/dist/errors';
import { StudioDataProviderIntrospection } from '../../../studio-core/dist/runtime';
import * as url from 'node:url';
import type { GridRowId } from '@mui/x-data-grid';
import invariant from 'invariant';
import { ensureSuffix, indent } from '../../../studio-utils/dist/strings';
import { Emitter } from '../../../studio-utils/dist/events';
import { Awaitable } from '../../../studio-utils/dist/types';
import EnvManager from './EnvManager';
import { ProjectEvents, StudioProjectOptions } from '../types';
Expand Down
2 changes: 1 addition & 1 deletion packages/studio-app/src/server/evalExpression.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createServerJsRuntime } from '../../../studio-core/dist/jsServerRuntime';
import { describe, test, expect } from 'vitest';
import { createServerJsRuntime } from '../../../studio-core/dist/jsServerRuntime';

async function evalExpression(expression: string, globalScope: Record<string, unknown> = {}) {
const jsServerRuntime = await createServerJsRuntime();
Expand Down
2 changes: 1 addition & 1 deletion packages/studio-app/src/server/functionsRuntime.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as path from 'path';
import * as fs from 'fs/promises';
import { STUDIO_DATA_PROVIDER_MARKER, StudioDataProvider } from '../../../studio-core/dist/server';
import * as z from 'zod';
import { fromZodError } from 'zod-validation-error';
import * as crypto from 'crypto';
import { STUDIO_DATA_PROVIDER_MARKER, StudioDataProvider } from '../../../studio-core/dist/server';

async function loadExports(filePath: string): Promise<Map<string, unknown>> {
const fullPath = path.resolve(filePath);
Expand Down
2 changes: 1 addition & 1 deletion packages/studio-app/src/server/har.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fetch from 'node-fetch';
import { listen } from '../../../studio-utils/dist/http';
import { describe, test, expect } from 'vitest';
import { listen } from '../../../studio-utils/dist/http';
import { createHarLog, withHarInstrumentation } from './har';
import { streamToString } from '../utils/streams';

Expand Down
6 changes: 3 additions & 3 deletions packages/studio-app/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import { Worker, MessageChannel } from 'worker_threads';
import express from 'express';
import getPort from 'get-port';
import { createProxyMiddleware } from 'http-proxy-middleware';
import { mapValues } from '../../../studio-utils/dist/collections';
import prettyBytes from 'pretty-bytes';
import type { ViteDevServer } from 'vite';
import { WebSocket, WebSocketServer } from 'ws';
import { listen } from '../../../studio-utils/dist/http';
import openBrowser from 'react-dev-utils/openBrowser.js';
import chalk from 'chalk';
import { serveRpc } from '../../../studio-utils/dist/workerRpc';
import * as url from 'node:url';
import cors from 'cors';
import { serveRpc } from '../../../studio-utils/dist/workerRpc';
import { listen } from '../../../studio-utils/dist/http';
import { mapValues } from '../../../studio-utils/dist/collections';
import { asyncHandler } from '../utils/express';
import { createProdHandler } from './studioAppServer';
import { initProject, resolveProjectDir, type StudioProject } from './localMode';
Expand Down
Loading

0 comments on commit a8331fb

Please sign in to comment.