DXOS Console -> Kubenet Console. Fix console-app to honor CONFIG_FILE.

This commit is contained in:
Thomas E Lackey 2020-07-20 15:20:36 -05:00
parent c0ff3a7969
commit d96af1ef1b
21 changed files with 47 additions and 40 deletions

View File

@ -1,5 +1,5 @@
# Console # Console
DXOS Network GraphQL server and console application. DXOS Kubenet GraphQL server and console application.
![Console](./docs/images/console.png) ![Console](./docs/images/console.png)

View File

@ -1,7 +1,7 @@
{ {
"name": "@dxos/console", "name": "@dxos/console",
"version": "1.0.0-beta.0", "version": "1.0.0-beta.0",
"description": "DXOS Console", "description": "Kubenet Console",
"main": "index.js", "main": "index.js",
"private": true, "private": true,
"scripts": { "scripts": {

View File

@ -1,5 +1,5 @@
name: dxos.network/console-app name: dxos.network/console-app
displayName: DXOS Console Client displayName: Kubenet Console Client
build: yarn dist build: yarn dist
version: 0.0.6 version: 0.0.6
package: QmZpM8u7ZUfQpXLgtdB1ug7nGExUrXhebtTSfSBPrRwcLX package: QmZpM8u7ZUfQpXLgtdB1ug7nGExUrXhebtTSfSBPrRwcLX

View File

@ -1,11 +1,11 @@
# #
# NODE_ENV === production # NODE_ENV=development
# NOTE: Set CONFIG_FILE to swap out this config file. # NOTE: Set CONFIG_FILE to swap out this config file.
# #
app: app:
title: 'Console' title: 'Kubnet Console'
org': 'DXOS' org': 'DXOS.org'
theme: 'dark' theme: 'dark'
website: 'https://dxos.org' website: 'https://dxos.org'
publicUrl: '/console' publicUrl: '/console'

View File

@ -1,11 +1,11 @@
# #
# NODE_ENV === production # NODE_ENV=development
# NOTE: Set CONFIG_FILE to swap out this config file. # NOTE: Set CONFIG_FILE to swap out this config file.
# #
app: app:
title: 'Console' title: 'Kubnet Console'
org': 'DXOS' org': 'DXOS.org'
theme: 'dark' theme: 'dark'
website: 'https://dxos.org' website: 'https://dxos.org'
publicUrl: '/console' publicUrl: '/console'

View File

@ -1,11 +1,11 @@
# #
# NODE_ENV === production # NODE_ENV=production
# NOTE: Set CONFIG_FILE to swap out this config file. # NOTE: Set CONFIG_FILE to swap out this config file.
# #
app: app:
title: 'Console' title: 'Kubenet Console'
org': 'DXOS' org': 'DXOS.org'
theme: 'dark' theme: 'dark'
website: 'https://dxos.org' website: 'https://dxos.org'
publicUrl: '/console' publicUrl: '/console'

View File

@ -1,11 +1,11 @@
# #
# NODE_ENV === production # NODE_ENV=development
# NOTE: Set CONFIG_FILE to swap out this config file. # NOTE: Set CONFIG_FILE to swap out this config file.
# #
app: app:
title: 'Console' title: 'Kubenet Console'
org': 'DXOS' org': 'DXOS.org'
theme: 'dark' theme: 'dark'
website: 'https://dxos.org' website: 'https://dxos.org'
publicUrl: '/console' publicUrl: '/console'

View File

@ -1,7 +1,7 @@
{ {
"name": "@dxos/console-app", "name": "@dxos/console-app",
"version": "1.0.0-beta.17", "version": "1.0.0-beta.17",
"description": "DXOS Console Client", "description": "Kubenet Console Client",
"main": "dist/es/index.js", "main": "dist/es/index.js",
"files": [ "files": [
"src/gql" "src/gql"
@ -10,10 +10,10 @@
"analyzer": "webpack --config webpack-analyzer.config.js", "analyzer": "webpack --config webpack-analyzer.config.js",
"build:babel": "babel ./src --out-dir ./dist/es --ignore \"**/*.test.js\" --source-maps inline", "build:babel": "babel ./src --out-dir ./dist/es --ignore \"**/*.test.js\" --source-maps inline",
"build": "yarn dist", "build": "yarn dist",
"dist": "yarn clean && cp -f config-production.yml config.yml && yarn build:babel && webpack", "dist": "yarn clean && CONFIG_FILE=config-production.yml yarn build:babel && webpack",
"clean": "rm -rf dist", "clean": "rm -rf dist",
"lint": "semistandard 'src/**/*.js'", "lint": "semistandard 'src/**/*.js'",
"start": "cp -f ${CONFIG_FILE:-config-local.yml} config.yml && VERBOSE=true webpack-dev-server --mode development", "start": "CONFIG_FILE=${CONFIG_FILE:-config-testnet.yml} VERBOSE=true webpack-dev-server --mode development",
"test": "jest --rootDir ./src --passWithNoTests --no-cache" "test": "jest --rootDir ./src --passWithNoTests --no-cache"
}, },
"author": "DXOS.org", "author": "DXOS.org",

View File

@ -1,5 +1,5 @@
// //
// Copyright 2020 DXOS.org.org // Copyright 2020 DXOS.org
// //
import React from 'react'; import React from 'react';

View File

@ -1,5 +1,5 @@
// //
// Copyright 2020 DXOS.org.org // Copyright 2020 DXOS.org
// //
import React from 'react'; import React from 'react';

View File

@ -1,5 +1,5 @@
// //
// Copyright 2020 DXOS.org.org // Copyright 2020 DXOS.org
// //
import React from 'react'; import React from 'react';

View File

@ -0,0 +1,8 @@
//
// Copyright 2020 DXOS.org
//
// See webpack-common.config.js
import config from '__CONFIG_FILE__';
export default config;

View File

@ -6,7 +6,7 @@ import debug from 'debug';
import React from 'react'; import React from 'react';
import { render } from 'react-dom'; import { render } from 'react-dom';
import config from '../config.yml'; import config from './config';
import Main from './containers/Main'; import Main from './containers/Main';

View File

@ -1,7 +1,7 @@
{ {
"build": { "build": {
"name": "@dxos/console-app", "name": "@dxos/console-app",
"buildDate": "2020-07-20T17:06:29.786Z", "buildDate": "2020-07-20T20:15:46.769Z",
"version": "1.0.0-beta.16" "version": "1.0.0-beta.17"
} }
} }

View File

@ -9,8 +9,7 @@ const webpack = require('webpack');
const PUBLIC_URL = process.env.PUBLIC_URL || ''; const PUBLIC_URL = process.env.PUBLIC_URL || '';
// TODO(burdon): Remove. const CONFIG_FILE = path.relative('./src', process.env.CONFIG_FILE || 'config-local.yml');
const STACK_CONFIG = process.env.CONFIG || 'default';
module.exports = { module.exports = {
devtool: 'eval-source-map', devtool: 'eval-source-map',
@ -76,8 +75,8 @@ module.exports = {
// Define the build config file based on the target. // Define the build config file based on the target.
// https://webpack.js.org/plugins/normal-module-replacement-plugin // https://webpack.js.org/plugins/normal-module-replacement-plugin
new webpack.NormalModuleReplacementPlugin(/(.*)__STACK_CONFIG__/, (resource) => { new webpack.NormalModuleReplacementPlugin(/(.*)__CONFIG_FILE__/, (resource) => {
resource.request = resource.request.replace(/__STACK_CONFIG__/, STACK_CONFIG); resource.request = resource.request.replace(/__CONFIG_FILE__/, CONFIG_FILE);
}), }),
// https://www.npmjs.com/package/webpack-version-file-plugin // https://www.npmjs.com/package/webpack-version-file-plugin

View File

@ -15,7 +15,7 @@ module.exports = merge(commonConfig, {
new HtmlWebPackPlugin({ new HtmlWebPackPlugin({
template: './public/index.html', template: './public/index.html',
templateParameters: { templateParameters: {
title: 'DXOS Console' title: 'Kubenet Console'
} }
}) })
] ]

View File

@ -1,11 +1,11 @@
# #
# NODE_ENV === production # NODE_ENV=development
# NOTE: Set CONFIG_FILE to swap out this config file. # NOTE: Set CONFIG_FILE to swap out this config file.
# #
app: app:
title: 'Console' title: 'Kubenet Console'
org': 'DXOS' org': 'DXOS.org'
theme: 'dark' theme: 'dark'
website: 'https://dxos.org' website: 'https://dxos.org'
publicUrl: '/console' publicUrl: '/console'

View File

@ -1,11 +1,11 @@
# #
# NODE_ENV === production # NODE_ENV=development
# NOTE: Set CONFIG_FILE to swap out this config file. # NOTE: Set CONFIG_FILE to swap out this config file.
# #
app: app:
title: 'Console' title: 'Kubenet Console'
org': 'DXOS' org': 'DXOS.org'
theme: 'dark' theme: 'dark'
website: 'https://dxos.org' website: 'https://dxos.org'
publicUrl: '/console' publicUrl: '/console'

View File

@ -1,11 +1,11 @@
# #
# NODE_ENV === production # NODE_ENV=production
# NOTE: Set CONFIG_FILE to swap out this config file. # NOTE: Set CONFIG_FILE to swap out this config file.
# #
app: app:
title: 'Console' title: 'Kubenet Console'
org': 'DXOS' org': 'DXOS.org'
theme: 'dark' theme: 'dark'
website: 'https://dxos.org' website: 'https://dxos.org'
publicUrl: '/console' publicUrl: '/console'

View File

@ -1,7 +1,7 @@
{ {
"name": "@dxos/console-server", "name": "@dxos/console-server",
"version": "1.0.0-beta.17", "version": "1.0.0-beta.17",
"description": "DXOS Console Server", "description": "Kubenet Console Server",
"main": "dist/es/index.js", "main": "dist/es/index.js",
"bin": { "bin": {
"dxos-console": "bin/console.js" "dxos-console": "bin/console.js"

View File

@ -67,7 +67,7 @@ module.exports = {
new HtmlWebPackPlugin({ new HtmlWebPackPlugin({
template: './public/index.html', template: './public/index.html',
templateParameters: { templateParameters: {
title: 'DXOS Console' title: 'Kubenet Console'
} }
}), }),