Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
KhudaDad414 committed Mar 20, 2024
1 parent 540cb00 commit bd33320
Show file tree
Hide file tree
Showing 102 changed files with 23 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Navigationv3 } from './Navigationv3';
import { Template } from './Template';
import { VisualiserTemplate } from './Visualiser';

import { debounce } from '../helpers';
import { debounce } from '../lib';
import { usePanelsState, useDocumentsState } from '../state';

import type { FunctionComponent } from 'react';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMemo } from 'react';
import dynamic from 'next/dynamic';
import { debounce } from '../../helpers';
import { debounce } from '../../lib';
import { useServices } from '../../services';
import { useFilesState, useSettingsState } from '../../state';

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ConfirmModal } from './index';
import { useServices } from '../../services';
import { useDocumentsState } from '../../state';

import type { SpecVersions } from '../../types';
import type { SpecVersions } from '../../../src/types';

export const ConvertModal = create(() => {
const { editorSvc, specificationSvc } = useServices();
Expand Down

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { SettingsModal } from '../Modals/Settings/SettingsModal';

import { Tooltip } from '../common';
import { useServices } from '../../services';
import { debounce } from '../../helpers';
import { debounce } from '../../lib';
import { useDocumentsState, useSettingsState } from '../../state';

import type { FunctionComponent } from 'react';
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState, useRef } from 'react';

import { useOutsideClickCallback } from '../../helpers';
import { useOutsideClickCallback } from '../../lib';

import type { FunctionComponent, PropsWithChildren, ReactNode } from 'react';

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion apps/studio/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import React, { useEffect, useState } from 'react';
import { StrictMode } from 'react';
import { Provider as ModalsProvider } from '@ebay/nice-modal-react';
import { createServices, Services, ServicesProvider } from '../src/services';
import { createServices, Services, ServicesProvider } from './services';
import { App} from '../src/App';

function configureMonacoEnvironment() {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AbstractService } from './abstract.service';
import YAML from 'js-yaml';

import { documentsState, filesState } from '../state';
import type { SpecVersions } from '../types';
import type { SpecVersions } from '../../src/types';
import type { JSONSchema7 } from 'json-schema';

export class MonacoService extends AbstractService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { AvroSchemaParser } from '@asyncapi/avro-schema-parser';
import { ProtoBuffSchemaParser } from '@asyncapi/protobuf-schema-parser';
import { untilde } from '@asyncapi/parser/cjs/utils';

import { isDeepEqual } from '../helpers';
import { isDeepEqual } from '../lib';
import { filesState, documentsState, settingsState } from '../state';

import type { Diagnostic, ParseOptions } from '@asyncapi/parser';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AbstractService } from './abstract.service';

import { isDeepEqual } from '../helpers';
import { isDeepEqual } from '../lib';
import { settingsState } from '../state';

import type { SettingsState } from '../state/settings.state';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ConvertToLatestModal } from '../components/Modals';

import { documentsState, settingsState } from '../state';

import type { SpecVersions } from '../types';
import type { SpecVersions } from '../../src/types';

export class SpecificationService extends AbstractService {
private keySessionStorage = 'informed-about-latest';
Expand All @@ -21,7 +21,7 @@ export class SpecificationService extends AbstractService {
}

get latestVersion(): SpecVersions {
return Object.keys(this.specs).pop() as SpecVersions;
return Object.keys(this.specs).pop() as SpecVersions;
}

getSpec(version: SpecVersions) {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ export const filesState = create<FilesState & FilesActions>(set => ({
asyncapi: {
uri: 'asyncapi',
name: 'asyncapi',
content: schema,
content: schema!!,
from: 'storage',
source: undefined,
language: schema.trimStart()[0] === '{' ? 'json' : 'yaml',
language: schema?.trimStart()[0] === '{' ? 'json' : 'yaml',
modified: false,
stat: {
mtime: (new Date()).getTime(),
Expand All @@ -252,4 +252,4 @@ export const filesState = create<FilesState & FilesActions>(set => ({
}
}));

export const useFilesState = filesState;
export const useFilesState = filesState;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions apps/studio/scripts/template-parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import fs from 'fs';
import path from 'path';
import { JSONSchema7 } from 'json-schema';

const DESTINATION_JSON = path.join(__dirname, '../src/components/Modals/Generator/template-parameters.json');
const DESTINATION_JSON = path.join(__dirname, '../app/components/Modals/Generator/template-parameters.json');
const TEMPLATES: Record<string, string> = {
'@asyncapi/dotnet-nats-template': '.NET Nats Project',
'@asyncapi/go-watermill-template': 'GO Lang Watermill Project',
Expand Down Expand Up @@ -65,12 +65,12 @@ function serializeTemplateParameters(config: TemplateConfig): JSONSchema7 | unde
const required: string[] = [];
for (const parameter in configParameters) {
const configParam = configParameters[String(parameter)];

const param = serializeParam(configParam);
if (configParam.required) {
required.push(parameter);
}

parameters[String(parameter)] = param;
}

Expand Down
54 changes: 0 additions & 54 deletions apps/studio/src/index.tsx

This file was deleted.

6 changes: 3 additions & 3 deletions apps/studio/src/studio.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { useEffect } from 'react';
import toast, { Toaster } from 'react-hot-toast';

import { Content, Sidebar, Template, Toolbar } from './components';
import { Content, Sidebar, Template, Toolbar } from '../app/components';

import { afterAppInit, useServices } from './services';
import { appState } from './state';
import { afterAppInit, useServices } from '../app/services';
import { appState } from '../app/state';

export interface AsyncAPIStudioProps {}

Expand Down
2 changes: 1 addition & 1 deletion apps/studio/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"include": [
"src",
".next/types/**/*.ts"
],
, "app/components", "app/examples", "app/lib", "app/services", "app/state" ],
"exclude": [
"node_modules"
]
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bd33320

Please sign in to comment.