From 37dbeb50c5e290b372854931dc707c53ce86607e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Ramos?= Date: Fri, 6 Apr 2018 15:53:44 +0100 Subject: [PATCH] feat(templates): bootstrap --- .eslintignore | 9 +- .eslintrc | 6 +- bundle/.yarnclean | 0 bundle/package.json | 17 +- bundle/src/images.js | 14 + bundle/src/instances.js | 14 + bundle/src/navigation.js | 14 + bundle/src/server.js | 9 +- bundle/src/service-groups.js | 74 + bundle/src/templates.js | 74 + commitlint.config.js | 11 +- consoles/my-joy-images/.eslintrc | 10 - consoles/my-joy-images/lib/index.js | 1 + consoles/my-joy-images/package.json | 3 +- .../src/components/create-image/details.js | 14 +- .../src/components/create-image/title.js | 4 +- .../src/components/description.js | 2 +- .../my-joy-images/src/components/empty.js | 2 +- .../my-joy-images/src/components/image.js | 18 +- .../my-joy-images/src/components/summary.js | 18 +- consoles/my-joy-images/src/components/tags.js | 3 +- .../my-joy-images/src/components/toolbar.js | 2 +- .../src/containers/breadcrumb.js | 2 +- .../src/containers/create-image/details.js | 11 +- .../src/containers/create-image/tags.js | 20 +- .../my-joy-images/src/containers/create.js | 8 +- consoles/my-joy-images/src/containers/list.js | 10 +- consoles/my-joy-images/src/containers/menu.js | 2 +- .../my-joy-images/src/containers/summary.js | 4 +- consoles/my-joy-images/src/containers/tags.js | 16 +- consoles/my-joy-images/src/html.js | 2 +- consoles/my-joy-images/src/server-error.js | 2 +- .../my-joy-images/src/state/validators.js | 4 +- consoles/my-joy-instances/.eslintignore | 5 - consoles/my-joy-instances/.eslintrc | 10 - consoles/my-joy-instances/lib/index.js | 1 + consoles/my-joy-instances/package.json | 7 +- .../__tests__/__snapshots__/list.spec.js.snap | 2108 ++--- .../__snapshots__/metadata.spec.js.snap | 1062 ++- .../__snapshots__/snapshots.spec.js.snap | 999 ++- .../__snapshots__/summary.spec.js.snap | 69 +- .../__snapshots__/toolbar.spec.js.snap | 14 +- .../src/components/instances/footer.js | 260 +- .../src/components/instances/list.js | 16 +- .../src/components/instances/metadata.js | 2 +- .../src/components/instances/snapshots.js | 19 +- .../src/components/instances/summary.js | 425 +- .../src/components/instances/toolbar.js | 2 +- .../my-joy-instances/src/containers/create.js | 102 +- .../__tests__/__snapshots__/cns.spec.js.snap | 755 +- .../__snapshots__/firewall.spec.js.snap | 134 +- .../__tests__/__snapshots__/list.spec.js.snap | 4654 ++++++----- .../__snapshots__/metadata.spec.js.snap | 451 +- .../__snapshots__/networks.spec.js.snap | 174 +- .../__snapshots__/summary.spec.js.snap | 175 +- .../__tests__/__snapshots__/tags.spec.js.snap | 1086 +-- .../instances/__tests__/firewall.spec.js | 1 - .../instances/__tests__/firewall.ui.js | 1 - .../instances/__tests__/networks.spec.js | 1 - .../instances/__tests__/networks.ui.js | 1 - .../src/containers/instances/cns.js | 27 +- .../src/containers/instances/firewall.js | 15 +- .../src/containers/instances/list.js | 21 +- .../src/containers/instances/metadata.js | 32 +- .../src/containers/instances/networks.js | 5 +- .../src/containers/instances/snapshots.js | 16 +- .../src/containers/instances/summary.js | 4 +- .../src/containers/instances/tags.js | 25 +- .../src/containers/instances/user-script.js | 4 +- .../__snapshots__/breadcrumb.spec.js.snap | 4 +- .../src/containers/navigation/breadcrumb.js | 2 +- consoles/my-joy-instances/src/html.js | 2 +- consoles/my-joy-instances/src/server-error.js | 7 +- .../my-joy-instances/src/state/validators.js | 4 +- consoles/my-joy-navigation/.eslintignore | 2 - consoles/my-joy-navigation/.eslintrc | 13 - consoles/my-joy-navigation/lib/index.js | 1 + consoles/my-joy-navigation/package.json | 2 - .../src/containers/account.js | 4 +- consoles/my-joy-templates/.babelrc | 12 + consoles/my-joy-templates/.gitignore | 25 + consoles/my-joy-templates/.lighthouserc | 8 + consoles/my-joy-templates/.npmignore | 27 + consoles/my-joy-templates/.stylelintrc | 4 + consoles/my-joy-templates/.tern-project | 13 + consoles/my-joy-templates/.yarnclean | 0 consoles/my-joy-templates/lib/index.js | 92 + consoles/my-joy-templates/package.json | 56 + .../my-joy-templates/public/manifest.json | 15 + .../public/static/css/libre-franklin.css | 31 + .../public/static/css/roboto-mono.css | 15 + .../libre-franklin/libre-franklin-bold.ttf | Bin 0 -> 81244 bytes .../libre-franklin/libre-franklin-light.ttf | Bin 0 -> 76968 bytes .../libre-franklin/libre-franklin-medium.ttf | Bin 0 -> 80732 bytes .../libre-franklin/libre-franklin-regular.ttf | Bin 0 -> 78768 bytes .../libre-franklin-semibold.ttf | Bin 0 -> 80352 bytes .../static/fonts/libre-franklin/license.txt | 93 + .../static/fonts/roboto-mono/license.txt | 202 + .../fonts/roboto-mono/roboto-mono-bold.ttf | Bin 0 -> 114752 bytes .../fonts/roboto-mono/roboto-mono-regular.ttf | Bin 0 -> 114624 bytes consoles/my-joy-templates/readme.md | 20 + consoles/my-joy-templates/src/_aliases.js | 1 + consoles/my-joy-templates/src/_document.js | 54 + consoles/my-joy-templates/src/app.js | 10 + .../my-joy-templates/src/components/list.js | 190 + .../src/components/summary.js | 399 + .../src/components/toolbar.js | 46 + consoles/my-joy-templates/src/constants.js | 14 + .../__snapshots__/breadcrumb.spec.js.snap | 503 ++ .../containers/__tests__/breadcrumb.spec.js | 36 + .../src/containers/breadcrumb.js | 40 + .../my-joy-templates/src/containers/create.js | 343 + .../src/containers/duplicate.js | 222 + .../my-joy-templates/src/containers/list.js | 210 + .../src/containers/summary.js | 157 + .../src/graphql/create-template.gql | 21 + .../src/graphql/get-template.gql | 20 + .../src/graphql/list-templates.gql | 9 + .../src/graphql/remove-template.gql | 5 + consoles/my-joy-templates/src/html.js | 28 + consoles/my-joy-templates/src/index.js | 31 + .../my-joy-templates/src/mocks/__aliases__.js | 6 + .../src/mocks/declarative-redux-form.js | 3 + .../src/mocks/react-responsive.js | 7 + .../src/mocks/react-router-dom.js | 4 + .../my-joy-templates/src/mocks/redux-form.js | 4 + consoles/my-joy-templates/src/mocks/theme.js | 23 + consoles/my-joy-templates/src/routes.js | 81 + consoles/my-joy-templates/src/server-error.js | 35 + .../src/state/apollo-client.js | 39 + .../my-joy-templates/src/state/confirm.js | 5 + consoles/my-joy-templates/src/state/global.js | 26 + .../my-joy-templates/src/state/parse-error.js | 4 + .../my-joy-templates/src/state/redux-store.js | 24 + consoles/my-joy-templates/src/state/theme.js | 21 + package.json | 4 +- packages/icons/.eslintrc | 8 - packages/icons/package.json | 2 - .../__snapshots__/icons.spec.js.snap | 28 + packages/icons/src/cns.js | 15 +- packages/icons/src/metadata.js | 5 +- packages/instance-steps/package.json | 3 + .../instance-steps/src/affinity/components.js | 36 +- packages/instance-steps/src/affinity/index.js | 55 +- packages/instance-steps/src/cns/index.js | 56 +- packages/instance-steps/src/constants.js | 66 +- .../instance-steps/src/firewall/components.js | 2 +- packages/instance-steps/src/firewall/index.js | 40 +- .../instance-steps/src/image/components.js | 12 +- packages/instance-steps/src/image/index.js | 18 +- packages/instance-steps/src/index.js | 90 +- .../instance-steps/src/metadata/components.js | 11 +- packages/instance-steps/src/metadata/index.js | 47 +- packages/instance-steps/src/name/index.js | 118 +- packages/instance-steps/src/networks/index.js | 20 +- .../instance-steps/src/package/components.js | 34 +- packages/instance-steps/src/package/index.js | 40 +- packages/instance-steps/src/tags/index.js | 51 +- .../src/user-script/components.js | 4 +- .../instance-steps/src/user-script/index.js | 22 +- packages/logos/.eslintrc | 8 - packages/logos/package.json | 2 - packages/resource-step/package.json | 3 +- packages/resource-step/src/index.js | 61 +- packages/resource-step/src/status-icon.js | 1 - packages/resource-widgets/package.json | 13 +- .../__tests__/__snapshots__/cns.spec.js.snap | 6 +- .../__snapshots__/firewall.spec.js.snap | 7 + .../__snapshots__/network.spec.js.snap | 30 +- .../src/__tests__/firewall.spec.js | 1 - .../src/__tests__/network.spec.js | 1 - packages/resource-widgets/src/cns/index.js | 40 +- packages/resource-widgets/src/empty/index.js | 2 +- .../resource-widgets/src/firewall/index.js | 30 +- packages/resource-widgets/src/index.js | 10 + .../__snapshots__/key-value.spec.js.snap | 7281 ++++++++--------- .../src/key-value/__tests__/key-value.spec.js | 2 +- .../src/key-value/index.js | 167 +- .../resource-widgets/src/network/index.js | 51 +- packages/resource-widgets/src/post/index.js | 63 + packages/ui-toolkit/.eslintrc | 9 - packages/ui-toolkit/package.json | 2 - packages/ui-toolkit/src/base/global.js | 5 + .../__snapshots__/index.spec.js.snap | 4 +- packages/ui-toolkit/src/breadcrumb/index.js | 2 +- .../__snapshots__/button.spec.js.snap | 10 +- packages/ui-toolkit/src/button/index.js | 2 +- packages/ui-toolkit/src/card/demo.md | 78 +- packages/ui-toolkit/src/card/header.js | 4 +- packages/ui-toolkit/src/divider/index.js | 1 + packages/ui-toolkit/src/download.md | 6 +- packages/ui-toolkit/src/editor/index.js | 10 +- packages/ui-toolkit/src/footer/index.js | 2 +- .../footer/{sticky-footer.js => sticky.js} | 2 +- packages/ui-toolkit/src/form/base/input.js | 79 +- .../ui-toolkit/src/form/copiable-field.js | 2 +- packages/ui-toolkit/src/grids/Readme.md | 28 +- packages/ui-toolkit/src/grids/vertical.md | 63 +- packages/ui-toolkit/src/hr/index.js | 2 +- packages/ui-toolkit/src/icons/functional.md | 2 +- packages/ui-toolkit/src/index.js | 3 +- packages/ui-toolkit/src/label/index.js | 5 + .../__snapshots__/message.spec.js.snap | 12 +- packages/ui-toolkit/src/pagination/index.js | 40 +- .../__snapshots__/popover.spec.js.snap | 5 +- packages/ui-toolkit/src/popover/divider.js | 2 +- packages/ui-toolkit/src/popover/item.js | 5 +- packages/ui-toolkit/src/principles/readme.md | 6 +- .../__snapshots__/loading.spec.js.snap | 1 + .../ui-toolkit/src/status-loader/index.js | 4 +- packages/ui-toolkit/src/table/Readme.md | 10 +- packages/ui-toolkit/src/table/index.js | 13 +- packages/ui-toolkit/src/tags/Readme.md | 8 +- packages/ui-toolkit/src/tags/list.js | 1 - .../__tests__/__snapshots__/text.spec.js.snap | 8 +- .../src/text/__tests__/text.spec.js | 2 +- packages/ui-toolkit/src/text/headings.js | 7 +- packages/ui-toolkit/src/text/p.js | 1 + packages/ui-toolkit/src/theme/colors.js | 12 +- packages/ui-toolkit/src/theme/colors.md | 2 +- packages/ui-toolkit/src/theme/index.js | 3 +- prototypes/console-boilerplate/.babelrc | 12 + .../console-boilerplate}/.eslintignore | 0 prototypes/console-boilerplate/.gitignore | 25 + prototypes/console-boilerplate/.lighthouserc | 8 + prototypes/console-boilerplate/.npmignore | 27 + prototypes/console-boilerplate/.stylelintrc | 4 + prototypes/console-boilerplate/.tern-project | 13 + prototypes/console-boilerplate/.yarnclean | 0 prototypes/console-boilerplate/lib/index.js | 92 + prototypes/console-boilerplate/package.json | 52 + .../console-boilerplate/public/manifest.json | 15 + .../public/static/css/libre-franklin.css | 31 + .../public/static/css/roboto-mono.css | 15 + .../libre-franklin/libre-franklin-bold.ttf | Bin 0 -> 81244 bytes .../libre-franklin/libre-franklin-light.ttf | Bin 0 -> 76968 bytes .../libre-franklin/libre-franklin-medium.ttf | Bin 0 -> 80732 bytes .../libre-franklin/libre-franklin-regular.ttf | Bin 0 -> 78768 bytes .../libre-franklin-semibold.ttf | Bin 0 -> 80352 bytes .../static/fonts/libre-franklin/license.txt | 93 + .../static/fonts/roboto-mono/license.txt | 202 + .../fonts/roboto-mono/roboto-mono-bold.ttf | Bin 0 -> 114752 bytes .../fonts/roboto-mono/roboto-mono-regular.ttf | Bin 0 -> 114624 bytes prototypes/console-boilerplate/readme.md | 20 + .../console-boilerplate/src/_aliases.js | 1 + .../console-boilerplate/src/_document.js | 56 + prototypes/console-boilerplate/src/app.js | 10 + .../navigation/__tests__/menu.spec.js | 61 + .../src/components/navigation/index.js | 1 + .../src/components/navigation/menu.js | 38 + .../src/containers/index.js | 3 + .../navigation/__tests__/breadcrumb.spec.js | 36 + .../src/containers/navigation/breadcrumb.js | 37 + .../src/containers/navigation/index.js | 2 + .../src/containers/navigation/menu.js | 19 + prototypes/console-boilerplate/src/index.js | 31 + prototypes/console-boilerplate/src/routes.js | 82 + .../console-boilerplate/src/server-error.js | 38 + .../src/state/apollo-client.js | 39 + .../console-boilerplate/src/state/global.js | 26 + .../src/state/parse-error.js | 4 + .../src/state/redux-store.js | 36 + .../console-boilerplate/src/state/theme.js | 21 + prototypes/cra-boilerplate/.eslintrc | 7 - prototypes/cra-boilerplate/package.json | 2 - yarn.lock | 661 +- 266 files changed, 16144 insertions(+), 11063 deletions(-) create mode 100644 bundle/.yarnclean create mode 100644 bundle/src/service-groups.js create mode 100644 bundle/src/templates.js delete mode 100644 consoles/my-joy-images/.eslintrc delete mode 100644 consoles/my-joy-instances/.eslintignore delete mode 100644 consoles/my-joy-instances/.eslintrc delete mode 100644 consoles/my-joy-navigation/.eslintignore delete mode 100644 consoles/my-joy-navigation/.eslintrc create mode 100644 consoles/my-joy-templates/.babelrc create mode 100644 consoles/my-joy-templates/.gitignore create mode 100644 consoles/my-joy-templates/.lighthouserc create mode 100644 consoles/my-joy-templates/.npmignore create mode 100644 consoles/my-joy-templates/.stylelintrc create mode 100644 consoles/my-joy-templates/.tern-project create mode 100644 consoles/my-joy-templates/.yarnclean create mode 100644 consoles/my-joy-templates/lib/index.js create mode 100644 consoles/my-joy-templates/package.json create mode 100644 consoles/my-joy-templates/public/manifest.json create mode 100644 consoles/my-joy-templates/public/static/css/libre-franklin.css create mode 100644 consoles/my-joy-templates/public/static/css/roboto-mono.css create mode 100755 consoles/my-joy-templates/public/static/fonts/libre-franklin/libre-franklin-bold.ttf create mode 100755 consoles/my-joy-templates/public/static/fonts/libre-franklin/libre-franklin-light.ttf create mode 100755 consoles/my-joy-templates/public/static/fonts/libre-franklin/libre-franklin-medium.ttf create mode 100755 consoles/my-joy-templates/public/static/fonts/libre-franklin/libre-franklin-regular.ttf create mode 100755 consoles/my-joy-templates/public/static/fonts/libre-franklin/libre-franklin-semibold.ttf create mode 100755 consoles/my-joy-templates/public/static/fonts/libre-franklin/license.txt create mode 100755 consoles/my-joy-templates/public/static/fonts/roboto-mono/license.txt create mode 100755 consoles/my-joy-templates/public/static/fonts/roboto-mono/roboto-mono-bold.ttf create mode 100755 consoles/my-joy-templates/public/static/fonts/roboto-mono/roboto-mono-regular.ttf create mode 100644 consoles/my-joy-templates/readme.md create mode 100644 consoles/my-joy-templates/src/_aliases.js create mode 100644 consoles/my-joy-templates/src/_document.js create mode 100644 consoles/my-joy-templates/src/app.js create mode 100644 consoles/my-joy-templates/src/components/list.js create mode 100644 consoles/my-joy-templates/src/components/summary.js create mode 100644 consoles/my-joy-templates/src/components/toolbar.js create mode 100644 consoles/my-joy-templates/src/constants.js create mode 100644 consoles/my-joy-templates/src/containers/__tests__/__snapshots__/breadcrumb.spec.js.snap create mode 100644 consoles/my-joy-templates/src/containers/__tests__/breadcrumb.spec.js create mode 100644 consoles/my-joy-templates/src/containers/breadcrumb.js create mode 100644 consoles/my-joy-templates/src/containers/create.js create mode 100644 consoles/my-joy-templates/src/containers/duplicate.js create mode 100644 consoles/my-joy-templates/src/containers/list.js create mode 100644 consoles/my-joy-templates/src/containers/summary.js create mode 100644 consoles/my-joy-templates/src/graphql/create-template.gql create mode 100644 consoles/my-joy-templates/src/graphql/get-template.gql create mode 100644 consoles/my-joy-templates/src/graphql/list-templates.gql create mode 100644 consoles/my-joy-templates/src/graphql/remove-template.gql create mode 100644 consoles/my-joy-templates/src/html.js create mode 100644 consoles/my-joy-templates/src/index.js create mode 100644 consoles/my-joy-templates/src/mocks/__aliases__.js create mode 100644 consoles/my-joy-templates/src/mocks/declarative-redux-form.js create mode 100644 consoles/my-joy-templates/src/mocks/react-responsive.js create mode 100644 consoles/my-joy-templates/src/mocks/react-router-dom.js create mode 100644 consoles/my-joy-templates/src/mocks/redux-form.js create mode 100644 consoles/my-joy-templates/src/mocks/theme.js create mode 100644 consoles/my-joy-templates/src/routes.js create mode 100644 consoles/my-joy-templates/src/server-error.js create mode 100644 consoles/my-joy-templates/src/state/apollo-client.js create mode 100644 consoles/my-joy-templates/src/state/confirm.js create mode 100644 consoles/my-joy-templates/src/state/global.js create mode 100644 consoles/my-joy-templates/src/state/parse-error.js create mode 100644 consoles/my-joy-templates/src/state/redux-store.js create mode 100644 consoles/my-joy-templates/src/state/theme.js delete mode 100644 packages/icons/.eslintrc delete mode 100644 packages/logos/.eslintrc rename packages/{ui-toolkit => resource-widgets}/src/key-value/__tests__/__snapshots__/key-value.spec.js.snap (89%) rename packages/{ui-toolkit => resource-widgets}/src/key-value/__tests__/key-value.spec.js (98%) rename packages/{ui-toolkit => resource-widgets}/src/key-value/index.js (73%) create mode 100644 packages/resource-widgets/src/post/index.js delete mode 100644 packages/ui-toolkit/.eslintrc rename packages/ui-toolkit/src/footer/{sticky-footer.js => sticky.js} (93%) create mode 100644 prototypes/console-boilerplate/.babelrc rename {consoles/my-joy-images => prototypes/console-boilerplate}/.eslintignore (100%) create mode 100644 prototypes/console-boilerplate/.gitignore create mode 100644 prototypes/console-boilerplate/.lighthouserc create mode 100644 prototypes/console-boilerplate/.npmignore create mode 100644 prototypes/console-boilerplate/.stylelintrc create mode 100644 prototypes/console-boilerplate/.tern-project create mode 100644 prototypes/console-boilerplate/.yarnclean create mode 100644 prototypes/console-boilerplate/lib/index.js create mode 100644 prototypes/console-boilerplate/package.json create mode 100644 prototypes/console-boilerplate/public/manifest.json create mode 100644 prototypes/console-boilerplate/public/static/css/libre-franklin.css create mode 100644 prototypes/console-boilerplate/public/static/css/roboto-mono.css create mode 100755 prototypes/console-boilerplate/public/static/fonts/libre-franklin/libre-franklin-bold.ttf create mode 100755 prototypes/console-boilerplate/public/static/fonts/libre-franklin/libre-franklin-light.ttf create mode 100755 prototypes/console-boilerplate/public/static/fonts/libre-franklin/libre-franklin-medium.ttf create mode 100755 prototypes/console-boilerplate/public/static/fonts/libre-franklin/libre-franklin-regular.ttf create mode 100755 prototypes/console-boilerplate/public/static/fonts/libre-franklin/libre-franklin-semibold.ttf create mode 100755 prototypes/console-boilerplate/public/static/fonts/libre-franklin/license.txt create mode 100755 prototypes/console-boilerplate/public/static/fonts/roboto-mono/license.txt create mode 100755 prototypes/console-boilerplate/public/static/fonts/roboto-mono/roboto-mono-bold.ttf create mode 100755 prototypes/console-boilerplate/public/static/fonts/roboto-mono/roboto-mono-regular.ttf create mode 100644 prototypes/console-boilerplate/readme.md create mode 100644 prototypes/console-boilerplate/src/_aliases.js create mode 100644 prototypes/console-boilerplate/src/_document.js create mode 100644 prototypes/console-boilerplate/src/app.js create mode 100644 prototypes/console-boilerplate/src/components/navigation/__tests__/menu.spec.js create mode 100644 prototypes/console-boilerplate/src/components/navigation/index.js create mode 100644 prototypes/console-boilerplate/src/components/navigation/menu.js create mode 100644 prototypes/console-boilerplate/src/containers/index.js create mode 100644 prototypes/console-boilerplate/src/containers/navigation/__tests__/breadcrumb.spec.js create mode 100644 prototypes/console-boilerplate/src/containers/navigation/breadcrumb.js create mode 100644 prototypes/console-boilerplate/src/containers/navigation/index.js create mode 100644 prototypes/console-boilerplate/src/containers/navigation/menu.js create mode 100644 prototypes/console-boilerplate/src/index.js create mode 100644 prototypes/console-boilerplate/src/routes.js create mode 100644 prototypes/console-boilerplate/src/server-error.js create mode 100644 prototypes/console-boilerplate/src/state/apollo-client.js create mode 100644 prototypes/console-boilerplate/src/state/global.js create mode 100644 prototypes/console-boilerplate/src/state/parse-error.js create mode 100644 prototypes/console-boilerplate/src/state/redux-store.js create mode 100644 prototypes/console-boilerplate/src/state/theme.js delete mode 100644 prototypes/cra-boilerplate/.eslintrc diff --git a/.eslintignore b/.eslintignore index 8f24d4ab..1268706e 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,9 @@ -packages/*/** -prototypes/*/** artifacts reports +.nyc_output +coverage +dist +styleguide +build +lib/app +node_modules \ No newline at end of file diff --git a/.eslintrc b/.eslintrc index 2d9d8311..3acd62ef 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,8 +1,10 @@ { "extends": "joyent-portal", "rules": { - "jsx-a11y/href-no-hash": 0, + "no-console": 1, "new-cap": 0, - "no-console": 0 + "jsx-a11y/href-no-hash": 0, + "no-negated-condition": 1, + "camelcase": 1 } } diff --git a/bundle/.yarnclean b/bundle/.yarnclean new file mode 100644 index 00000000..e69de29b diff --git a/bundle/package.json b/bundle/package.json index f256074f..35767072 100644 --- a/bundle/package.json +++ b/bundle/package.json @@ -9,24 +9,21 @@ "build:lib": "echo 0", "build:bundle": "echo 0", "prepublish": "echo 0", - "lint": "echo 0", - "lint:ci": "echo 0", "test": "echo 0", "test:ci": "echo 0" }, "dependencies": { "apr-main": "^4.0.3", - "brule": "^3.1.0", - "cloudapi-gql": "^7.1.4", + "cloudapi-gql": "^8.0.0", "execa": "^0.10.0", - "h2o2": "^8.0.1", - "hapi": "^17.3.1", - "hapi-triton-auth": "^2.0.1", - "hapi-webconsole-nav": "^1.2.0", - "inert": "^5.1.0", + "graphi": "^5.7.0", + "h2o2": "^8.1.2", + "hapi": "^17.4.0", + "hapi-triton-auth": "^3.0.0", + "hapi-webconsole-nav": "^2.1.0", "my-joy-images": "*", "my-joy-instances": "*", "my-joy-navigation": "*", - "rollover": "^1.0.0" + "tsg-graphql": "^1.0.0" } } diff --git a/bundle/src/images.js b/bundle/src/images.js index ee1d313e..e6cea0e7 100644 --- a/bundle/src/images.js +++ b/bundle/src/images.js @@ -1,5 +1,8 @@ +require('../.env.js'); + const Main = require('apr-main'); const CloudApiGql = require('cloudapi-gql'); +const Graphi = require('graphi'); const Url = require('url'); const Server = require('./server'); @@ -28,6 +31,17 @@ Main(async () => { }); await server.register([ + { + plugin: Graphi, + options: { + graphqlPath: '/graphql', + graphiqlPath: '/graphiql', + authStrategy: 'sso' + }, + routes: { + prefix: `/${PREFIX}` + } + }, { plugin: CloudApiGql, options: { diff --git a/bundle/src/instances.js b/bundle/src/instances.js index 3fbcb4ee..26a3f45a 100644 --- a/bundle/src/instances.js +++ b/bundle/src/instances.js @@ -1,5 +1,8 @@ +require('../.env.js'); + const Main = require('apr-main'); const CloudApiGql = require('cloudapi-gql'); +const Graphi = require('graphi'); const Url = require('url'); const Server = require('./server'); @@ -28,6 +31,17 @@ Main(async () => { }); await server.register([ + { + plugin: Graphi, + options: { + graphqlPath: '/graphql', + graphiqlPath: '/graphiql', + authStrategy: 'sso' + }, + routes: { + prefix: `/${PREFIX}` + } + }, { plugin: CloudApiGql, options: { diff --git a/bundle/src/navigation.js b/bundle/src/navigation.js index 94f7eee1..859b9d2a 100644 --- a/bundle/src/navigation.js +++ b/bundle/src/navigation.js @@ -1,5 +1,8 @@ +require('../.env.js'); + const Main = require('apr-main'); const Nav = require('hapi-webconsole-nav'); +const Graphi = require('graphi'); const Url = require('url'); const Server = require('./server'); @@ -33,6 +36,17 @@ Main(async () => { }); await server.register([ + { + plugin: Graphi, + options: { + graphqlPath: '/graphql', + graphiqlPath: '/graphiql', + authStrategy: 'sso' + }, + routes: { + prefix: `/${PREFIX}` + } + }, { plugin: Nav, options: { diff --git a/bundle/src/server.js b/bundle/src/server.js index 6378cae1..6be55cfb 100644 --- a/bundle/src/server.js +++ b/bundle/src/server.js @@ -1,6 +1,7 @@ +require('../.env.js'); + const Hapi = require('hapi'); const Sso = require('hapi-triton-auth'); -const Url = require('url'); const { COOKIE_PASSWORD, @@ -8,12 +9,10 @@ const { SDC_KEY_PATH, SDC_ACCOUNT, SDC_KEY_ID, - SDC_URL, - DC_NAME + SDC_URL } = process.env; module.exports = async ({ PORT, BASE_URL }) => { - const dcName = DC_NAME || Url.parse(SDC_URL).host.split('.')[0]; const keyPath = SDC_KEY_PATH; const keyId = `/${SDC_ACCOUNT}/keys/${SDC_KEY_ID}`; const apiBaseUrl = SDC_URL; @@ -50,6 +49,7 @@ module.exports = async ({ PORT, BASE_URL }) => { server.events.on('log', (event, tags) => { if (tags.error) { + // eslint-disable-next-line no-console console.log(event); } }); @@ -58,6 +58,7 @@ module.exports = async ({ PORT, BASE_URL }) => { const { tags } = event; if (tags.includes('error') && event.data && event.data.errors) { event.data.errors.forEach(error => { + // eslint-disable-next-line no-console console.log(error); }); } diff --git a/bundle/src/service-groups.js b/bundle/src/service-groups.js new file mode 100644 index 00000000..f9819cbb --- /dev/null +++ b/bundle/src/service-groups.js @@ -0,0 +1,74 @@ +require('../.env.js'); + +const Main = require('apr-main'); +const CloudApiGql = require('cloudapi-gql'); +const Tsg = require('tsg-graphql'); +const Graphi = require('graphi'); +const Url = require('url'); + +const Server = require('./server'); + +const { + PORT = 4004, + BASE_URL = `http://0.0.0.0:${PORT}`, + PREFIX = 'service-groups', + DC_NAME, + TSG_URL = 'http://0.0.0.0:3000', + SDC_URL, + SDC_KEY_PATH, + SDC_ACCOUNT, + SDC_KEY_ID +} = process.env; + +const dcName = DC_NAME || Url.parse(SDC_URL).host.split('.')[0]; +const keyPath = SDC_KEY_PATH; +const keyId = `/${SDC_ACCOUNT}/keys/${SDC_KEY_ID}`; + +Main(async () => { + const server = await Server({ + PORT, + BASE_URL + }); + + await server.register([ + { + plugin: Graphi, + options: { + graphqlPath: '/graphql', + graphiqlPath: '/graphiql', + authStrategy: 'sso' + }, + routes: { + prefix: `/${PREFIX}` + } + }, + { + plugin: Tsg, + options: { + authStrategy: 'sso', + keyPath, + keyId, + apiBaseUrl: TSG_URL, + dcName + }, + routes: { + prefix: `/${PREFIX}` + } + }, + { + plugin: CloudApiGql, + options: { + authStrategy: 'sso', + keyPath, + keyId, + apiBaseUrl: SDC_URL, + dcName + }, + routes: { + prefix: `/${PREFIX}` + } + } + ]); + + await server.start(); +}); diff --git a/bundle/src/templates.js b/bundle/src/templates.js new file mode 100644 index 00000000..2bd6a8a3 --- /dev/null +++ b/bundle/src/templates.js @@ -0,0 +1,74 @@ +require('../.env.js'); + +const Main = require('apr-main'); +const CloudApiGql = require('cloudapi-gql'); +const Tsg = require('tsg-graphql'); +const Graphi = require('graphi'); +const Url = require('url'); + +const Server = require('./server'); + +const { + PORT = 4005, + BASE_URL = `http://0.0.0.0:${PORT}`, + PREFIX = 'templates', + DC_NAME, + TSG_URL = 'http://0.0.0.0:3000', + SDC_URL, + SDC_KEY_PATH, + SDC_ACCOUNT, + SDC_KEY_ID +} = process.env; + +const dcName = DC_NAME || Url.parse(SDC_URL).host.split('.')[0]; +const keyPath = SDC_KEY_PATH; +const keyId = `/${SDC_ACCOUNT}/keys/${SDC_KEY_ID}`; + +Main(async () => { + const server = await Server({ + PORT, + BASE_URL + }); + + await server.register([ + { + plugin: Graphi, + options: { + graphqlPath: '/graphql', + graphiqlPath: '/graphiql', + authStrategy: 'sso' + }, + routes: { + prefix: `/${PREFIX}` + } + }, + { + plugin: Tsg, + options: { + authStrategy: 'sso', + keyPath, + keyId, + apiBaseUrl: TSG_URL, + dcName + }, + routes: { + prefix: `/${PREFIX}` + } + }, + { + plugin: CloudApiGql, + options: { + authStrategy: 'sso', + keyPath, + keyId, + apiBaseUrl: SDC_URL, + dcName + }, + routes: { + prefix: `/${PREFIX}` + } + } + ]); + + await server.start(); +}); diff --git a/commitlint.config.js b/commitlint.config.js index da6b1b5f..3aff4a4f 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -4,7 +4,16 @@ module.exports = { 'scope-enum': [ 2, 'always', - ['ui-toolkit', 'icons', 'instances', 'navigation', 'bundle', 'images'] + [ + 'ui-toolkit', + 'icons', + 'instances', + 'navigation', + 'bundle', + 'images', + 'sg', + 'templates' + ] ] } }; diff --git a/consoles/my-joy-images/.eslintrc b/consoles/my-joy-images/.eslintrc deleted file mode 100644 index 435e02c4..00000000 --- a/consoles/my-joy-images/.eslintrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "joyent-portal", - "rules": { - "no-console": 0, - "new-cap": 0, - "camelcase": 1, - "jsx-a11y/href-no-hash": 0, - "no-negated-condition": 0 - } -} diff --git a/consoles/my-joy-images/lib/index.js b/consoles/my-joy-images/lib/index.js index 75c7af75..7e3e9199 100644 --- a/consoles/my-joy-images/lib/index.js +++ b/consoles/my-joy-images/lib/index.js @@ -16,6 +16,7 @@ exports.register = async server => { if (NODE_ENV === 'production') { throw err; } else { + // eslint-disable-next-line no-console console.error(err); } } diff --git a/consoles/my-joy-images/package.json b/consoles/my-joy-images/package.json index ccd520ad..6e085671 100644 --- a/consoles/my-joy-images/package.json +++ b/consoles/my-joy-images/package.json @@ -11,8 +11,6 @@ "build:lib": "echo 0", "build:bundle": "NAMESPACE=images NODE_ENV=production redrun -p build:frontend build:ssr", "prepublish": "NODE_ENV=production redrun build:bundle", - "lint": "redrun lint:ci -- --fix", - "lint:ci": "NODE_ENV=test eslint . --ext .js --ext .md", "test": "echo 0", "test:ci": "echo 0", "build:frontend": "joyent-react-scripts build", @@ -38,6 +36,7 @@ "inert": "^5.1.0", "joyent-logo-assets": "^1.1.0", "joyent-react-styled-flexboxgrid": "^2.2.3", + "joyent-ui-resource-widgets": "^1.0.0", "joyent-ui-toolkit": "^6.0.0", "lodash.assign": "^4.2.0", "lodash.find": "^4.6.0", diff --git a/consoles/my-joy-images/src/components/create-image/details.js b/consoles/my-joy-images/src/components/create-image/details.js index 48bd15a9..e7d1870c 100644 --- a/consoles/my-joy-images/src/components/create-image/details.js +++ b/consoles/my-joy-images/src/components/create-image/details.js @@ -6,7 +6,6 @@ import remcalc from 'remcalc'; import { Row, Col } from 'joyent-react-styled-flexboxgrid'; import { - Divider, FormGroup, FormLabel, Input, @@ -22,15 +21,14 @@ export default ({ placeholderName, randomizing, onRandomize }) => ( Image name - + - - +