From 20f01a70150e24ef281457c652db3b0c84f2123c Mon Sep 17 00:00:00 2001 From: Rick Carlino Date: Tue, 29 Jan 2019 08:16:44 -0600 Subject: [PATCH] WIP --- .sassrc.js | 4 +--- app/controllers/dashboard_controller.rb | 12 +++++++++++- app/views/dashboard/_common_assets.html.erb | 3 ++- docker-compose.yml | 16 ++++++++-------- webpack/css/_index.scss | 7 +++---- webpack/entry.tsx | 1 - webpack/front_page/front_page.tsx | 5 ++--- webpack/front_page/index.tsx | 2 -- webpack/routes.tsx | 1 - webpack/tos_update/component.tsx | 1 - 10 files changed, 27 insertions(+), 25 deletions(-) diff --git a/.sassrc.js b/.sassrc.js index 49b21240d..add08fb58 100644 --- a/.sassrc.js +++ b/.sassrc.js @@ -4,8 +4,6 @@ const CWD = process.cwd() module.exports = { "includePaths": [ - path.resolve(CWD, 'node_modules'), - path.resolve(CWD, 'node_modules', "@blueprintjs"), - path.resolve(CWD, 'webpack') + "node_modules" ] } diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 62091f35b..a728a1516 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -1,6 +1,16 @@ class DashboardController < ApplicationController before_action :set_global_config - + OUTPUT_DIR = "public/webpack" + BUNDLES = { + app_bundle: "./webpack/entry.tsx", + app_bundle: "./webpack/entry.tsx", + front_page: "./webpack/front_page/index.tsx", + front_page: "./webpack/front_page/index.tsx", + password_reset: "./webpack/password_reset/index.tsx", + password_reset: "./webpack/password_reset/index.tsx", + tos_update: "./webpack/tos_update/index.tsx", + tos_update: "./webpack/tos_update/index.tsx", + } def tos_update # I want to keep an eye on this one in prod. # If `tos_update` is firing without us knowing about it, it could cause a diff --git a/app/views/dashboard/_common_assets.html.erb b/app/views/dashboard/_common_assets.html.erb index be14fd921..a25082f9d 100644 --- a/app/views/dashboard/_common_assets.html.erb +++ b/app/views/dashboard/_common_assets.html.erb @@ -15,7 +15,8 @@ window.process = { <%= render "addons" %> -<%= stylesheet_link_tag 'application' %> +<%= stylesheet_link_tag "application" %> +<%= stylesheet_link_tag "/webpack/_index.css" %> <%# Rails.env.production? ? javascript_include_tag(*webpack_asset_paths("new_commons")) : "" %> <% if false %> diff --git a/docker-compose.yml b/docker-compose.yml index 2293040b5..c3997189a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -51,14 +51,14 @@ services: - RABBITMQ_CONFIG_FILE=/farmbot/farmbot_rmq_config volumes: - ./docker_volumes/rabbit:/farmbot - webpack: # ==================== - <<: *base_config - image: node:10.15.0 - working_dir: /farmbot - command: ./node_modules/.bin/webpack-dev-server --config config/webpack.config.js - volumes: - - .:/farmbot - ports: ["3808:3808"] # Webpack Dev Server + # webpack: # ==================== + # <<: *base_config + # image: node:10.15.0 + # working_dir: /farmbot + # command: ./node_modules/.bin/webpack-dev-server --config config/webpack.config.js + # volumes: + # - .:/farmbot + # ports: ["3808:3808"] # Webpack Dev Server delayed_job: # ==================== <<: *base_config <<: *rails diff --git a/webpack/css/_index.scss b/webpack/css/_index.scss index a8c38228c..841573040 100644 --- a/webpack/css/_index.scss +++ b/webpack/css/_index.scss @@ -1,8 +1,7 @@ // Blueprint -@import "~normalize.css"; -@import "~@blueprintjs/core/lib/css/blueprint"; -@import "~@blueprintjs/icons/lib/css/blueprint-icons"; -// Partials +// @import "~normalize.css"; +@import "@blueprintjs/core/lib/css/blueprint"; +// @import "@blueprintjs/icons/lib/css/blueprint-icons"; // Partials @import "animations"; @import "colors"; @import "fonts"; diff --git a/webpack/entry.tsx b/webpack/entry.tsx index 8b9d22242..7b3283552 100644 --- a/webpack/entry.tsx +++ b/webpack/entry.tsx @@ -8,7 +8,6 @@ import { shortRevision } from "./util"; import { stopIE } from "./util/stop_ie"; import { init } from "i18next"; import { attachAppToDom } from "./routes"; - stopIE(); console.log(shortRevision()); diff --git a/webpack/front_page/front_page.tsx b/webpack/front_page/front_page.tsx index 93f0b6af0..44da450ee 100644 --- a/webpack/front_page/front_page.tsx +++ b/webpack/front_page/front_page.tsx @@ -17,9 +17,8 @@ import { Content } from "../constants"; import { LaptopSplash } from "./laptop_splash"; import { TermsCheckbox } from "./terms_checkbox"; -export const attachFrontPage = () => { - attachToRoot(FrontPage, {}); -}; +export const attachFrontPage = + () => attachToRoot(FrontPage, {}); const showFor = (size: string[], extraClass?: string): string => { const ALL_SIZES = ["xs", "sm", "md", "lg", "xl"]; diff --git a/webpack/front_page/index.tsx b/webpack/front_page/index.tsx index e24714d47..c1ee81bbb 100644 --- a/webpack/front_page/index.tsx +++ b/webpack/front_page/index.tsx @@ -1,5 +1,3 @@ -import "../css/_index.scss"; -import "../css/laptop_splash.scss"; import { detectLanguage } from "../i18n"; import * as i18next from "i18next"; import { stopIE } from "../util/stop_ie"; diff --git a/webpack/routes.tsx b/webpack/routes.tsx index a8b887f98..0cb2d28e1 100644 --- a/webpack/routes.tsx +++ b/webpack/routes.tsx @@ -1,4 +1,3 @@ -import "./css/_index.scss"; import * as React from "react"; import { store as _store } from "./redux/store"; import { history } from "./history"; diff --git a/webpack/tos_update/component.tsx b/webpack/tos_update/component.tsx index 6e0d56203..59db9f348 100644 --- a/webpack/tos_update/component.tsx +++ b/webpack/tos_update/component.tsx @@ -6,7 +6,6 @@ import { AuthState } from "../auth/interfaces"; import { Session } from "../session"; import { prettyPrintApiErrors } from "../util"; import { API } from "../api"; -import "../css/_index.scss"; import { Row, Col, Widget, WidgetHeader, WidgetBody } from "../ui"; import { TermsCheckbox } from "../front_page/terms_checkbox";