commit
ee835e8a82
2
.github/workflows/npm-publish.yml
vendored
2
.github/workflows/npm-publish.yml
vendored
@ -31,7 +31,7 @@ jobs:
|
|||||||
yarn lerna publish -y prerelease --dist-tag="beta" --force-publish
|
yarn lerna publish -y prerelease --dist-tag="beta" --force-publish
|
||||||
|
|
||||||
# Publish to WNS
|
# Publish to WNS
|
||||||
yarn wire profile init --name $WIRE_PROFILE --template-url https://signal1.dxos.network/dxos/ipfs/gateway/QmeJcwpcQuXeY1N94ezWAzYinSX5AA4kZoaZjp9JmmpaLN
|
yarn wire profile init --name $WIRE_PROFILE --template-url https://git.io/JUkhm
|
||||||
scripts/deploy_apps_to_wns.sh
|
scripts/deploy_apps_to_wns.sh
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "1.0.0-beta.24",
|
"version": "1.1.0-beta.0",
|
||||||
"useWorkspaces": true,
|
"useWorkspaces": true,
|
||||||
"npmClient": "yarn"
|
"npmClient": "yarn"
|
||||||
}
|
}
|
||||||
|
@ -30,9 +30,9 @@
|
|||||||
"lerna": "^3.19.0"
|
"lerna": "^3.19.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@dxos/cli": "^1.0.1-beta.5",
|
"@dxos/cli": "^1.1.0-beta.0",
|
||||||
"@dxos/cli-app": "^1.0.1-beta.5",
|
"@dxos/cli-app": "^1.1.0-beta.0",
|
||||||
"@wirelineio/cli-wns": "^1.0.1-beta.5",
|
"@dxos/cli-wns": "^1.1.0-beta.0",
|
||||||
"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",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name: dxos.network/console-app
|
name: console
|
||||||
displayName: Kubenet Console Client
|
|
||||||
build: yarn dist
|
build: yarn dist
|
||||||
version: 0.0.6
|
version: 0.0.25
|
||||||
package: QmZpM8u7ZUfQpXLgtdB1ug7nGExUrXhebtTSfSBPrRwcLX
|
package:
|
||||||
|
/: QmRTdeFtvdu41EXPoBovEhFc4V1RNKBUGjQ1GcBGMxBk1c
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@dxos/console-app",
|
"name": "@dxos/console-app",
|
||||||
"version": "1.0.0-beta.24",
|
"version": "1.1.0-beta.0",
|
||||||
"description": "Kubenet Console Client",
|
"description": "Kubenet Console Client",
|
||||||
"main": "dist/es/index.js",
|
"main": "dist/es/index.js",
|
||||||
"files": [
|
"files": [
|
||||||
|
@ -8,7 +8,7 @@ import Link from '@material-ui/core/Link';
|
|||||||
|
|
||||||
import { getServiceUrl } from '../util/config';
|
import { getServiceUrl } from '../util/config';
|
||||||
|
|
||||||
const getAppUrl = (config, { name, version }) => {
|
const getAppUrl = (config, { wrn }) => {
|
||||||
const base = getServiceUrl(config, 'app.server');
|
const base = getServiceUrl(config, 'app.server');
|
||||||
const pathComponents = [base];
|
const pathComponents = [base];
|
||||||
|
|
||||||
@ -21,11 +21,7 @@ const getAppUrl = (config, { name, version }) => {
|
|||||||
pathComponents.push(prefix.substring(1));
|
pathComponents.push(prefix.substring(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (version) {
|
pathComponents.push(encodeURIComponent(wrn));
|
||||||
pathComponents.push(`${name}@${version}`);
|
|
||||||
} else {
|
|
||||||
pathComponents.push(name);
|
|
||||||
}
|
|
||||||
return `${pathComponents.join('/')}/`;
|
return `${pathComponents.join('/')}/`;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -34,11 +30,10 @@ const getAppUrl = (config, { name, version }) => {
|
|||||||
* @param {Object} config
|
* @param {Object} config
|
||||||
* @param {string} name
|
* @param {string} name
|
||||||
* @param {string} [text]
|
* @param {string} [text]
|
||||||
* @param {string} [version]
|
|
||||||
*/
|
*/
|
||||||
const AppLink = ({ config, name, version, text }) => {
|
const AppLink = ({ config, wrn, text }) => {
|
||||||
const fullURL = getAppUrl(config, { name, version });
|
const fullURL = getAppUrl(config, { wrn });
|
||||||
return <Link href={fullURL} target={name}>{text || name}</Link>;
|
return <Link href={fullURL} target={wrn}>{text || wrn}</Link>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AppLink;
|
export default AppLink;
|
||||||
|
@ -10,24 +10,23 @@ import { getServiceUrl } from '../util/config';
|
|||||||
/**
|
/**
|
||||||
* Render IPFS links in package.
|
* Render IPFS links in package.
|
||||||
* @param {Object} config
|
* @param {Object} config
|
||||||
* @param {string} [type]
|
* @param {string} type
|
||||||
* @param {string} pkg
|
* @param {string} pkg
|
||||||
* @param {string} [text]
|
* @param {string} [text]
|
||||||
*/
|
*/
|
||||||
const PackageLink = ({ config, type, pkg, text }) => {
|
const PackageLink = ({ config, type, pkg, text }) => {
|
||||||
// TODO(burdon): Pass in expected arg types.
|
|
||||||
if (typeof pkg === 'string') {
|
|
||||||
const ipfsUrl = getServiceUrl(config, 'ipfs.gateway', { path: `${pkg}` });
|
|
||||||
return <Link href={ipfsUrl} key={pkg} target={pkg}>{text || pkg}</Link>;
|
|
||||||
}
|
|
||||||
|
|
||||||
// eslint-disable-next-line default-case
|
// eslint-disable-next-line default-case
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case 'wrn:app': {
|
||||||
|
const cid = pkg['/'];
|
||||||
|
const ipfsUrl = getServiceUrl(config, 'ipfs.gateway', { path: `${cid}` });
|
||||||
|
return <Link href={ipfsUrl} key={cid} target={cid}>{text || cid}</Link>;
|
||||||
|
}
|
||||||
case 'wrn:bot': {
|
case 'wrn:bot': {
|
||||||
const packageLinks = [];
|
const packageLinks = [];
|
||||||
Object.keys(pkg).forEach((platform, i) => {
|
Object.keys(pkg).forEach((platform, i) => {
|
||||||
Object.keys(pkg[platform]).forEach(arch => {
|
Object.keys(pkg[platform]).forEach(arch => {
|
||||||
const cid = pkg[platform][arch];
|
const cid = pkg[platform][arch]['/'];
|
||||||
const ipfsUrl = getServiceUrl(config, 'ipfs.gateway', { path: `${cid}` });
|
const ipfsUrl = getServiceUrl(config, 'ipfs.gateway', { path: `${cid}` });
|
||||||
packageLinks.push(
|
packageLinks.push(
|
||||||
<div>
|
<div>
|
||||||
|
@ -11,10 +11,9 @@ import { getServiceUrl } from '../util/config';
|
|||||||
|
|
||||||
const QUERY = `
|
const QUERY = `
|
||||||
query {
|
query {
|
||||||
queryRecords(attributes: [{ key: "name", value: { string: "%NAME%" } }]) {
|
getRecordsByIds(ids: [ "%ID%" ]) {
|
||||||
id
|
id
|
||||||
type
|
names
|
||||||
name
|
|
||||||
bondId
|
bondId
|
||||||
createTime
|
createTime
|
||||||
expiryTime
|
expiryTime
|
||||||
@ -33,13 +32,13 @@ const QUERY = `
|
|||||||
/**
|
/**
|
||||||
* Render link to record in WNS.
|
* Render link to record in WNS.
|
||||||
* @param {Object} config
|
* @param {Object} config
|
||||||
* @param {string} name
|
* @param {string} id
|
||||||
* @param {string} [text]
|
* @param {string} [text]
|
||||||
* @param {boolean} icon
|
* @param {boolean} icon
|
||||||
*/
|
*/
|
||||||
const QueryLink = ({ config, name, text, icon = false }) => {
|
const QueryLink = ({ config, id, text, icon = false }) => {
|
||||||
const baseURL = getServiceUrl(config, 'wns.webui');
|
const baseURL = getServiceUrl(config, 'wns.webui');
|
||||||
const query = QUERY.replace('%NAME%', name);
|
const query = QUERY.replace('%ID%', id);
|
||||||
|
|
||||||
// NOTE: Playground bug opens two tabs.
|
// NOTE: Playground bug opens two tabs.
|
||||||
const fullURL = encodeURI(`${baseURL}?query=${query}`);
|
const fullURL = encodeURI(`${baseURL}?query=${query}`);
|
||||||
@ -50,7 +49,7 @@ const QueryLink = ({ config, name, text, icon = false }) => {
|
|||||||
<LinkIcon />
|
<LinkIcon />
|
||||||
)}
|
)}
|
||||||
{!icon && (
|
{!icon && (
|
||||||
text || name
|
text || id
|
||||||
)}
|
)}
|
||||||
</Link>
|
</Link>
|
||||||
);
|
);
|
||||||
|
@ -42,29 +42,32 @@ const AppRecords = () => {
|
|||||||
<Table>
|
<Table>
|
||||||
<TableHead>
|
<TableHead>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell onClick={sortBy('name')}>Identifier</TableCell>
|
<TableCell onClick={sortBy('names[0]')}>Registered Names</TableCell>
|
||||||
<TableCell onClick={sortBy('version')} size='small'>Version</TableCell>
|
<TableCell onClick={sortBy('attributes.version')} size='small'>Version</TableCell>
|
||||||
<TableCell onClick={sortBy('attributes.displayName')}>Name</TableCell>
|
<TableCell onClick={sortBy('attributes.name')}>Name</TableCell>
|
||||||
<TableCell onClick={sortBy('createTime')} size='small'>Created</TableCell>
|
<TableCell onClick={sortBy('createTime')} size='small'>Created</TableCell>
|
||||||
<TableCell size='icon' />
|
<TableCell size='icon' />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHead>
|
</TableHead>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{appData.sort(sorter).map(({ id, name, version, createTime, attributes: { displayName, package: hash } }) => {
|
{appData.sort(sorter).map(({ id, names, createTime, attributes: { name: displayName, version, package: packageLink } }) => {
|
||||||
return (
|
return (
|
||||||
<TableRow key={id} size='small'>
|
<TableRow key={id} size='small'>
|
||||||
<TableCell monospace>
|
<TableCell monospace>
|
||||||
<AppLink config={config} name={name} />
|
{names.map(wrn => <div>
|
||||||
|
<AppLink config={config} wrn={wrn} />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell monospace>
|
<TableCell monospace>
|
||||||
<AppLink config={config} name={name} version={version} text={version} />
|
{version}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
{displayName}
|
{displayName}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>{moment.utc(createTime).fromNow()}</TableCell>
|
<TableCell>{moment.utc(createTime).fromNow()}</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<BooleanIcon yes={localRefs && localRefs.has(hash)} />
|
<BooleanIcon yes={localRefs && localRefs.has(packageLink['/'])} />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
);
|
);
|
||||||
|
@ -35,18 +35,18 @@ const BotRecords = () => {
|
|||||||
<Table>
|
<Table>
|
||||||
<TableHead>
|
<TableHead>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell onClick={sortBy('name')}>Identifier</TableCell>
|
<TableCell onClick={sortBy('names[0]')}>Identifier</TableCell>
|
||||||
<TableCell onClick={sortBy('version')} size='small'>Version</TableCell>
|
<TableCell onClick={sortBy('attributes.version')} size='small'>Version</TableCell>
|
||||||
<TableCell onClick={sortBy('attributes.displayName')}>Name</TableCell>
|
<TableCell onClick={sortBy('attributes.name')}>Name</TableCell>
|
||||||
<TableCell onClick={sortBy('createTime')} size='small'>Created</TableCell>
|
<TableCell onClick={sortBy('createTime')} size='small'>Created</TableCell>
|
||||||
<TableCell size='icon' />
|
<TableCell size='icon' />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHead>
|
</TableHead>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{records.sort(sorter).map(({ id, name, version, createTime, attributes: { displayName } }) => {
|
{records.sort(sorter).map(({ id, names, createTime, attributes: { name: displayName, version } }) => {
|
||||||
return (
|
return (
|
||||||
<TableRow key={id} size='small'>
|
<TableRow key={id} size='small'>
|
||||||
<TableCell monospace>{name}</TableCell>
|
<TableCell monospace>{names.map(name => <div>{name}</div>)}</TableCell>
|
||||||
<TableCell monospace>{version}</TableCell>
|
<TableCell monospace>{version}</TableCell>
|
||||||
<TableCell>{displayName}</TableCell>
|
<TableCell>{displayName}</TableCell>
|
||||||
<TableCell>{moment.utc(createTime).fromNow()}</TableCell>
|
<TableCell>{moment.utc(createTime).fromNow()}</TableCell>
|
||||||
|
@ -78,7 +78,7 @@ const IPFSStatus = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const ipfsData = JSON.parse(ipfsResponse.ipfs_status.json);
|
const ipfsData = JSON.parse(ipfsResponse.ipfs_status.json);
|
||||||
const registeredServers = JSON.parse(wnsResponse.wns_records.json);
|
const registeredServers = JSON.parse(wnsResponse.wns_records.json).filter(record => get(record, 'attributes.ipfs.active') !== false);
|
||||||
|
|
||||||
const displayServers = registeredServers.map((service) => {
|
const displayServers = registeredServers.map((service) => {
|
||||||
const addresses = get(service, 'attributes.ipfs.addresses');
|
const addresses = get(service, 'attributes.ipfs.addresses');
|
||||||
@ -93,10 +93,10 @@ const IPFSStatus = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: get(service, 'name'),
|
...service.attributes,
|
||||||
|
...service.attributes.ipfs,
|
||||||
|
names: get(service, 'names'),
|
||||||
version: get(service, 'version'),
|
version: get(service, 'version'),
|
||||||
description: get(service, 'attributes.description'),
|
|
||||||
ipfs: get(service, 'attributes.ipfs'),
|
|
||||||
connected
|
connected
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@ -115,19 +115,19 @@ const IPFSStatus = () => {
|
|||||||
<Table stickyHeader size='small' className={classes.table}>
|
<Table stickyHeader size='small' className={classes.table}>
|
||||||
<TableHead>
|
<TableHead>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell>Identifier</TableCell>
|
<TableCell>Registered Names</TableCell>
|
||||||
<TableCell size='medium'>Description</TableCell>
|
<TableCell size='medium'>Description</TableCell>
|
||||||
<TableCell>Address</TableCell>
|
<TableCell>Address</TableCell>
|
||||||
<TableCell size='small'>Connected</TableCell>
|
<TableCell size='small'>Connected</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHead>
|
</TableHead>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{displayServers.map(({ name, description, ipfs, connected }) => (
|
{displayServers.map(({ names, description, addresses, connected }) => (
|
||||||
<TableRow key={name}>
|
<TableRow key={names}>
|
||||||
<TableCell>{name}</TableCell>
|
<TableCell>{names.map(name => <>{name}<br /></>)}</TableCell>
|
||||||
<TableCell>{description}</TableCell>
|
<TableCell>{description}</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
{ipfs.addresses}
|
{addresses}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<BooleanIcon yes={connected} />
|
<BooleanIcon yes={connected} />
|
||||||
|
@ -26,7 +26,6 @@ import AppLink from '../../../components/AppLink';
|
|||||||
const types = [
|
const types = [
|
||||||
{ key: null, label: 'ALL' },
|
{ key: null, label: 'ALL' },
|
||||||
{ key: 'wrn:kube', label: 'Kube' },
|
{ key: 'wrn:kube', label: 'Kube' },
|
||||||
{ key: 'wrn:resource', label: 'Resource' },
|
|
||||||
{ key: 'wrn:service', label: 'Service' },
|
{ key: 'wrn:service', label: 'Service' },
|
||||||
{ key: 'wrn:app', label: 'App' },
|
{ key: 'wrn:app', label: 'App' },
|
||||||
{ key: 'wrn:bot', label: 'Bot' },
|
{ key: 'wrn:bot', label: 'Bot' },
|
||||||
@ -83,41 +82,47 @@ const WNSRecords = ({ type }) => {
|
|||||||
<Table>
|
<Table>
|
||||||
<TableHead>
|
<TableHead>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell onClick={sortBy('type')} size='medium'>Type</TableCell>
|
<TableCell onClick={sortBy('attributes.type')} size='medium'>Type</TableCell>
|
||||||
<TableCell onClick={sortBy('name')}>Identifier</TableCell>
|
<TableCell onClick={sortBy('names[0]')}>Registered Names</TableCell>
|
||||||
<TableCell onClick={sortBy('version')} size='small'>Version</TableCell>
|
<TableCell onClick={sortBy('attributes.version')} size='small'>Version</TableCell>
|
||||||
<TableCell onClick={sortBy('attributes.displayName')}>Name</TableCell>
|
<TableCell onClick={sortBy('attributes.name')}>Name</TableCell>
|
||||||
<TableCell onClick={sortBy('createTime')} size='small'>Created</TableCell>
|
<TableCell onClick={sortBy('createTime')} size='small'>Created</TableCell>
|
||||||
<TableCell onClick={sortBy('package')}>Package</TableCell>
|
<TableCell onClick={sortBy('attributes.package')}>Package</TableCell>
|
||||||
<TableCell size='icon' />
|
<TableCell size='icon' />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHead>
|
</TableHead>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{records.sort(sorter)
|
{records.sort(sorter)
|
||||||
.map((record) => {
|
.map((record) => {
|
||||||
const { id, type, name, version, createTime, attributes: { displayName, description, service, package: pkg } } = record;
|
const { id, names, createTime, attributes: { type, name: displayName, version, description, service, package: pkg } } = record;
|
||||||
|
|
||||||
let pkgLink;
|
let pkgLink;
|
||||||
let appLink;
|
let appLinks;
|
||||||
let verLink;
|
|
||||||
|
|
||||||
if (pkg) {
|
if (pkg) {
|
||||||
pkgLink = (<PackageLink config={config} type={type} pkg={pkg} />);
|
pkgLink = (<PackageLink config={config} type={type} pkg={pkg} />);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'wrn:app') {
|
if (type === 'wrn:app') {
|
||||||
appLink = (<AppLink config={config} name={name} />);
|
appLinks = (
|
||||||
verLink = (<AppLink config={config} name={name} version={version} text={version} />);
|
<>
|
||||||
|
{names.map(wrn =>
|
||||||
|
<div>
|
||||||
|
<AppLink config={config} wrn={wrn} />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TableRow key={id} size='small'>
|
<TableRow key={id} size='small'>
|
||||||
<TableCell monospace>{type}</TableCell>
|
<TableCell monospace>{type}</TableCell>
|
||||||
<TableCell monospace>
|
<TableCell monospace>
|
||||||
{appLink || name}
|
{appLinks || names.map(name => <div>{name}</div>)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell monospace>
|
<TableCell monospace>
|
||||||
{verLink || version}
|
{version}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
{displayName || service || description}
|
{displayName || service || description}
|
||||||
@ -129,7 +134,7 @@ const WNSRecords = ({ type }) => {
|
|||||||
{pkgLink}
|
{pkgLink}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<QueryLink config={config} name={name} icon />
|
<QueryLink config={config} id={id} icon />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
);
|
);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"build": {
|
"build": {
|
||||||
"name": "@dxos/console-app",
|
"name": "@dxos/console-app",
|
||||||
"buildDate": "2020-07-21T20:40:54.153Z",
|
"buildDate": "2020-08-27T18:22:17.963Z",
|
||||||
"version": "1.0.0-beta.22"
|
"version": "1.0.0-moon.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@dxos/console-server",
|
"name": "@dxos/console-server",
|
||||||
"version": "1.0.0-beta.24",
|
"version": "1.1.0-beta.0",
|
||||||
"description": "Kubenet Console Server",
|
"description": "Kubenet Console Server",
|
||||||
"main": "dist/es/index.js",
|
"main": "dist/es/index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
@ -31,7 +31,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/polyfill": "^7.8.7",
|
"@babel/polyfill": "^7.8.7",
|
||||||
"@babel/runtime": "^7.8.7",
|
"@babel/runtime": "^7.8.7",
|
||||||
"@dxos/console-app": "^1.0.0-beta.24",
|
"@dxos/console-app": "^1.1.0-beta.0",
|
||||||
"@wirelineio/wns-schema": "^0.1.1",
|
"@wirelineio/wns-schema": "^0.1.1",
|
||||||
"apollo-boost": "^0.4.9",
|
"apollo-boost": "^0.4.9",
|
||||||
"apollo-server-express": "^2.13.1",
|
"apollo-server-express": "^2.13.1",
|
||||||
|
@ -5,8 +5,8 @@ set -euo pipefail
|
|||||||
for appdir in `find ./packages -name '*-app' -type d | grep -v node_modules`; do
|
for appdir in `find ./packages -name '*-app' -type d | grep -v node_modules`; do
|
||||||
pushd $appdir
|
pushd $appdir
|
||||||
|
|
||||||
ORG="dxos.network"
|
WNS_ORG="dxos"
|
||||||
PKG_NAME=`cat package.json | jq -r '.name' | cut -d'/' -f2-`
|
PKG_NAME=`cat package.json | jq -r '.name' | cut -d'/' -f2- | sed 's/-app$//'`
|
||||||
PKG_DESC=`cat package.json | jq -r '.description'`
|
PKG_DESC=`cat package.json | jq -r '.description'`
|
||||||
PKG_VERSION=`cat package.json | jq -r '.version'`
|
PKG_VERSION=`cat package.json | jq -r '.version'`
|
||||||
|
|
||||||
@ -14,16 +14,15 @@ for appdir in `find ./packages -name '*-app' -type d | grep -v node_modules`; do
|
|||||||
PKG_DESC="$PKG_NAME"
|
PKG_DESC="$PKG_NAME"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
WNS_NAME="$ORG/$PKG_NAME"
|
WNS_NAME="$WNS_ORG/$PKG_NAME"
|
||||||
WNS_VERSION=`yarn -s wire app query --name "$WNS_NAME" | jq -r '.[0].version'`
|
WNS_VERSION=`yarn -s wire wns name resolve wrn://${WNS_ORG}/application/${PKG_NAME} | jq -r '.records[0].attributes.version'`
|
||||||
|
|
||||||
if [ -z "$WNS_VERSION" ]; then
|
if [ -z "$WNS_VERSION" ]; then
|
||||||
WNS_VERSION="0.0.0"
|
WNS_VERSION="0.0.1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat <<EOF > app.yml
|
cat <<EOF > app.yml
|
||||||
name: $WNS_NAME
|
name: $PKG_NAME
|
||||||
displayName: $PKG_DESC
|
|
||||||
build: yarn dist
|
build: yarn dist
|
||||||
version: $WNS_VERSION
|
version: $WNS_VERSION
|
||||||
EOF
|
EOF
|
||||||
@ -40,7 +39,7 @@ EOF
|
|||||||
else
|
else
|
||||||
yarn -s wire app publish
|
yarn -s wire app publish
|
||||||
fi
|
fi
|
||||||
yarn -s wire app register
|
yarn -s wire app register --name "wrn://${WNS_ORG}/application/${PKG_NAME}"
|
||||||
|
|
||||||
popd
|
popd
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user