Changes to run console-app with laconicd (#2)

* Resolve missing dependency issues

* Use laconic-sdk for GQL queries and record names workaround
This commit is contained in:
nikugogoi 2022-12-02 13:50:31 +05:30 committed by GitHub
parent ca2c1de1ed
commit 590eadf974
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 6851 additions and 3027 deletions

View File

@ -30,11 +30,11 @@
"lerna": "^3.19.0" "lerna": "^3.19.0"
}, },
"devDependencies": { "devDependencies": {
"@dxos/cli": "2.0.20-alpha.0", "@dxos/cli": "0.1.13",
"@dxos/cli-app": "2.0.20-alpha.0", "@dxos/cli-app": "2.20.4",
"@dxos/cli-bot": "2.0.20-alpha.0", "@dxos/cli-bot": "2.20.4",
"@dxos/cli-data": "2.0.20-alpha.0", "@dxos/cli-party": "2.20.4",
"@dxos/cli-wns": "2.0.20-alpha.0", "@dxos/cli-dxns": "2.20.4",
"babel-eslint": "^10.0.3", "babel-eslint": "^10.0.3",
"eslint": "^6.7.2", "eslint": "^6.7.2",
"eslint-config-semistandard": "^15.0.0", "eslint-config-semistandard": "^15.0.0",

View File

@ -29,9 +29,18 @@
"@apollo/react-components": "^3.1.5", "@apollo/react-components": "^3.1.5",
"@apollo/react-hooks": "^3.1.5", "@apollo/react-hooks": "^3.1.5",
"@babel/runtime": "^7.8.7", "@babel/runtime": "^7.8.7",
"@dxos/debug": "^1.0.0-beta.2", "@dxos/debug": "^1.0.0-beta.78",
"@dxos/gem-core": "^1.0.0-beta.25", "@dxos/gem-core": "^1.0.0-beta.25",
"@dxos/react-ux": "^1.1.0-beta.0", "@dxos/react-components": "~2.31.4",
"@emotion/core": "^11.0.0",
"@emotion/react": "^11.4.1",
"@emotion/styled": "^11.3.0",
"@mui/icons-material": "^5.0.0",
"@mui/lab": "^5.0.0-alpha.51",
"@mui/material": "^5.0.0",
"@mui/styles": "^5.0.0",
"@mui/system": "^5.0.0",
"@mui/x-data-grid": "^5.0.0-beta.1",
"@material-ui/core": "^4.10.0", "@material-ui/core": "^4.10.0",
"@material-ui/icons": "^4.9.1", "@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.54", "@material-ui/lab": "^4.0.0-alpha.54",
@ -39,7 +48,6 @@
"@visx/network": "^1.0.0", "@visx/network": "^1.0.0",
"@visx/tooltip": "^1.0.0", "@visx/tooltip": "^1.0.0",
"@visx/zoom": "^1.0.0", "@visx/zoom": "^1.0.0",
"@wirelineio/registry-client": "^1.1.0-beta.2",
"apollo-cache-inmemory": "^1.6.6", "apollo-cache-inmemory": "^1.6.6",
"apollo-client": "^2.6.10", "apollo-client": "^2.6.10",
"apollo-link": "^1.2.14", "apollo-link": "^1.2.14",
@ -53,8 +61,8 @@
"lodash.defaultsdeep": "^4.6.1", "lodash.defaultsdeep": "^4.6.1",
"lodash.get": "^4.4.2", "lodash.get": "^4.4.2",
"moment": "^2.26.0", "moment": "^2.26.0",
"react": "^16.13.1", "react": "^17.0.2",
"react-dom": "^16.13.1", "react-dom": "^17.0.2",
"react-router": "^5.2.0", "react-router": "^5.2.0",
"react-router-dom": "^5.2.0", "react-router-dom": "^5.2.0",
"source-map-support": "^0.5.12" "source-map-support": "^0.5.12"

View File

@ -31,9 +31,9 @@ const getAppUrl = (config, { wrn }) => {
* @param {string} name * @param {string} name
* @param {string} [text] * @param {string} [text]
*/ */
const AppLink = ({ config, wrn, text }) => { const AppLink = ({ config, crn, text }) => {
const fullURL = getAppUrl(config, { wrn }); const fullURL = getAppUrl(config, { crn });
return <Link href={fullURL} target={wrn}>{text || wrn}</Link>; return <Link href={fullURL} target={crn}>{text || crn}</Link>;
}; };
export default AppLink; export default AppLink;

View File

@ -5,7 +5,7 @@
import React from 'react'; import React from 'react';
import { makeStyles } from '@material-ui/core'; import { makeStyles } from '@material-ui/core';
import { JsonTreeView } from '@dxos/react-ux'; import { JsonTreeView } from '@dxos/react-components';
import { omitDeep } from '../util/omit'; import { omitDeep } from '../util/omit';

View File

@ -37,7 +37,7 @@ const useStyles = makeStyles(theme => ({
const types = [ const types = [
{ key: 'authority', label: 'Authority' }, { key: 'authority', label: 'Authority' },
{ key: 'wrn', label: 'WRN' } { key: 'crn', label: 'CRN' }
]; ];
export const LookupType = ({ scope = types[0].key, onChange }) => { export const LookupType = ({ scope = types[0].key, onChange }) => {
@ -87,9 +87,9 @@ const RegistryLookup = ({ scope }) => {
const getNames = () => { const getNames = () => {
let ret; let ret;
switch (scope) { switch (scope) {
case 'wrn': { case 'crn': {
ret = []; ret = [];
records.forEach(item => ret.push(...item.names)); records.forEach(item => ret.push(...(item.names || [])));
break; break;
} }
@ -98,9 +98,9 @@ const RegistryLookup = ({ scope }) => {
// TODO(telackey): Should we be able to query WNS for a list of authorities? // TODO(telackey): Should we be able to query WNS for a list of authorities?
const names = new Set(); const names = new Set();
for (const record of records) { for (const record of records) {
for (const name of record.names) { for (const name of (record.names || [])) {
// TODO(telackey): We need a general purpose WRN handling library. // TODO(telackey): We need a general purpose CRN handling library.
names.add(name.replace('wrn://', '').split('/')[0]); names.add(name.replace('crn://', '').split('/')[0]);
} }
} }
ret = Array.from(names.values()); ret = Array.from(names.values());
@ -120,7 +120,7 @@ const RegistryLookup = ({ scope }) => {
let result; let result;
switch (scope) { switch (scope) {
case 'wrn': case 'crn':
result = await registry.lookupNames([newInputValue], true); result = await registry.lookupNames([newInputValue], true);
break; break;

View File

@ -31,13 +31,13 @@ const useStyles = makeStyles(theme => ({
const types = [ const types = [
{ key: null, label: 'ALL' }, { key: null, label: 'ALL' },
{ key: 'wrn:kube', label: 'Kube' }, { key: 'crn:kube', label: 'Kube' },
{ key: 'wrn:service', label: 'Service' }, { key: 'crn:service', label: 'Service' },
{ key: 'wrn:app', label: 'App' }, { key: 'crn:app', label: 'App' },
{ key: 'wrn:bot', label: 'Bot' }, { key: 'crn:bot', label: 'Bot' },
{ key: 'wrn:bot-factory', label: 'Bot Factory' }, { key: 'crn:bot-factory', label: 'Bot Factory' },
{ key: 'wrn:file', label: 'File' }, { key: 'crn:file', label: 'File' },
{ key: 'wrn:type', label: 'Type' } { key: 'crn:type', label: 'Type' }
]; ];
export const RecordType = ({ type = types[0].key, onChange }) => { export const RecordType = ({ type = types[0].key, onChange }) => {
@ -104,12 +104,12 @@ const RegistryRecords = ({ type }) => {
pkgLink = (<PackageLink config={config} type={type} pkg={pkg} />); pkgLink = (<PackageLink config={config} type={type} pkg={pkg} />);
} }
if (type === 'wrn:app') { if (type === 'crn:app') {
appLinks = ( appLinks = (
<> <>
{names.map(wrn => {(names || []).map(crn =>
<div key={wrn}> <div key={crn}>
<AppLink config={config} wrn={wrn} /> <AppLink config={config} crn={crn} />
</div> </div>
)} )}
</> </>
@ -120,7 +120,7 @@ const RegistryRecords = ({ type }) => {
<TableRow key={id} size='small'> <TableRow key={id} size='small'>
<TableCell monospace>{type}</TableCell> <TableCell monospace>{type}</TableCell>
<TableCell monospace> <TableCell monospace>
{appLinks || names.map(name => <div key={name}>{name}</div>)} {appLinks || (names || []).map(name => <div key={name}>{name}</div>)}
</TableCell> </TableCell>
<TableCell monospace> <TableCell monospace>
{version} {version}

View File

@ -2,7 +2,7 @@
// Copyright 2020 DXOS.org // Copyright 2020 DXOS.org
// //
import { Registry } from '@wirelineio/registry-client'; import { Registry } from 'laconic-sdk';
import { getServiceUrl } from '../util/config'; import { getServiceUrl } from '../util/config';

View File

@ -4,7 +4,7 @@
import debug from 'debug'; import debug from 'debug';
import { Registry } from '@wirelineio/registry-client'; import { Registry } from 'laconic-sdk';
import { getServiceUrl } from './util/config'; import { getServiceUrl } from './util/config';

9800
yarn.lock

File diff suppressed because it is too large Load Diff