diff --git a/.circleci/config.yml b/.circleci/config.yml index e99026b96..c3df332d8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,16 +24,10 @@ jobs: command: | cd server-phoenix && mix local.rebar --force && mix test - build: + build-react: docker: # specify the version you desire here - - image: cimg/ruby:2.6.9 - - image: redis - - image: cimg/postgres:14.1 - environment: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: helios_test + - image: cimg/node:16.14.0 # Specify service dependencies here if necessary # CircleCI maintains a library of pre-built images @@ -43,85 +37,32 @@ jobs: working_directory: ~/repo steps: - - run: - name: install node/yarn - command: | - curl -sL https://deb.nodesource.com/setup_16.x | sudo bash && sudo apt-get update -qq && sudo apt-get install -yq build-essential nodejs unzip && sudo npm install -g yarn - - checkout - restore_cache: keys: - - gem-cache-{{ checksum "Gemfile.lock" }} - # fallback to using the latest cache if no exact match is found - - gem-cache- - - - run: - name: install gem dependencies - command: | - bundle install --jobs=4 --retry=3 --path vendor/bundle - - - save_cache: - paths: - - ./vendor/bundle - key: gem-cache-{{ checksum "Gemfile.lock" }} - - - restore_cache: - keys: - - yarn-cache-{{ checksum "yarn.lock" }} + - yarn-cache-{{ checksum "client-react/yarn.lock" }} # fallback to using the latest cache if no exact match is found - yarn-cache- - run: name: install yarn dependencies command: | - yarn install + cd client-react && yarn install - save_cache: paths: - ~/.yarn-cache - key: yarn-cache-{{ checksum "yarn.lock" }} - - - run: yarn run prettier:check - - run: yarn run lint - - run: yarn run test + key: yarn-cache-{{ checksum "client-react/yarn.lock" }} - - run: bundle exec rubocop - - # Database setup - - run: bundle exec rake db:create - - run: bundle exec rake db:schema:load - - - run: - name: run diff on schema.json - command: | - bundle exec rake graphql:schema:dump - git diff --quiet schema.graphql - - # run tests! - - run: - name: run tests - command: | - mkdir /tmp/test-results - TEST_FILES="$(circleci tests glob 'spec/**/*_spec.rb' | circleci tests split --split-by=timings)" - - bundle exec rspec --format progress \ - --format RspecJunitFormatter \ - --out /tmp/test-results/rspec.xml \ - --format progress \ - $TEST_FILES - - # collect reports - - store_test_results: - path: /tmp/test-results - - store_artifacts: - path: /tmp/test-results - destination: test-results + - run: cd client-react && yarn run prettier:check + - run: cd client-react && yarn run lint + - run: cd client-react && yarn run test workflows: version: 2 - build_and_phoenix: + build: jobs: - build-phoenix - - build + - build-react diff --git a/Procfile.development b/Procfile.development index 6d2bf6329..b54ac47d5 100644 --- a/Procfile.development +++ b/Procfile.development @@ -1,2 +1,2 @@ phoenix: cd ./server-phoenix/ && mix phx.server -webpack: yarn serve +webpack: yarn --cwd client-react/ serve diff --git a/.babelrc b/client-react/.babelrc similarity index 100% rename from .babelrc rename to client-react/.babelrc diff --git a/.eslintrc.js b/client-react/.eslintrc.js similarity index 91% rename from .eslintrc.js rename to client-react/.eslintrc.js index 857597c2e..712147d86 100644 --- a/.eslintrc.js +++ b/client-react/.eslintrc.js @@ -10,7 +10,7 @@ module.exports = { 'error', { env: 'apollo', - schemaJson: require('./app/javascript/schema.json'), + schemaJson: require('./src/schema.json'), }, ], 'react/jsx-one-expression-per-line': [0], diff --git a/.postcssrc.yml b/client-react/.postcssrc.yml similarity index 100% rename from .postcssrc.yml rename to client-react/.postcssrc.yml diff --git a/.prettierrc b/client-react/.prettierrc similarity index 100% rename from .prettierrc rename to client-react/.prettierrc diff --git a/__mocks__/emptyMock.js b/client-react/__mocks__/emptyMock.js similarity index 100% rename from __mocks__/emptyMock.js rename to client-react/__mocks__/emptyMock.js diff --git a/__mocks__/fileMock.js b/client-react/__mocks__/fileMock.js similarity index 100% rename from __mocks__/fileMock.js rename to client-react/__mocks__/fileMock.js diff --git a/app/assets/images/.keep b/client-react/assets/images/.keep similarity index 100% rename from app/assets/images/.keep rename to client-react/assets/images/.keep diff --git a/app/assets/images/boulder_buildings.svg b/client-react/assets/images/boulder_buildings.svg similarity index 100% rename from app/assets/images/boulder_buildings.svg rename to client-react/assets/images/boulder_buildings.svg diff --git a/app/assets/images/buildings.png b/client-react/assets/images/buildings.png similarity index 100% rename from app/assets/images/buildings.png rename to client-react/assets/images/buildings.png diff --git a/app/assets/images/commit.png b/client-react/assets/images/commit.png similarity index 100% rename from app/assets/images/commit.png rename to client-react/assets/images/commit.png diff --git a/app/assets/images/displayCommit.png b/client-react/assets/images/displayCommit.png similarity index 100% rename from app/assets/images/displayCommit.png rename to client-react/assets/images/displayCommit.png diff --git a/app/assets/images/displayPR.png b/client-react/assets/images/displayPR.png similarity index 100% rename from app/assets/images/displayPR.png rename to client-react/assets/images/displayPR.png diff --git a/app/assets/images/displaySlack.png b/client-react/assets/images/displaySlack.png similarity index 100% rename from app/assets/images/displaySlack.png rename to client-react/assets/images/displaySlack.png diff --git a/app/assets/images/icons/icon-1-cloud.svg b/client-react/assets/images/icons/icon-1-cloud.svg similarity index 100% rename from app/assets/images/icons/icon-1-cloud.svg rename to client-react/assets/images/icons/icon-1-cloud.svg diff --git a/app/assets/images/icons/icon-17-cloud-snowflakes.svg b/client-react/assets/images/icons/icon-17-cloud-snowflakes.svg similarity index 100% rename from app/assets/images/icons/icon-17-cloud-snowflakes.svg rename to client-react/assets/images/icons/icon-17-cloud-snowflakes.svg diff --git a/app/assets/images/icons/icon-2-cloud-sun.svg b/client-react/assets/images/icons/icon-2-cloud-sun.svg similarity index 100% rename from app/assets/images/icons/icon-2-cloud-sun.svg rename to client-react/assets/images/icons/icon-2-cloud-sun.svg diff --git a/app/assets/images/icons/icon-24-cloud-fog.svg b/client-react/assets/images/icons/icon-24-cloud-fog.svg similarity index 100% rename from app/assets/images/icons/icon-24-cloud-fog.svg rename to client-react/assets/images/icons/icon-24-cloud-fog.svg diff --git a/app/assets/images/icons/icon-28-moon.svg b/client-react/assets/images/icons/icon-28-moon.svg similarity index 100% rename from app/assets/images/icons/icon-28-moon.svg rename to client-react/assets/images/icons/icon-28-moon.svg diff --git a/app/assets/images/icons/icon-29-sun.svg b/client-react/assets/images/icons/icon-29-sun.svg similarity index 100% rename from app/assets/images/icons/icon-29-sun.svg rename to client-react/assets/images/icons/icon-29-sun.svg diff --git a/app/assets/images/icons/icon-3-cloud-moon.svg b/client-react/assets/images/icons/icon-3-cloud-moon.svg similarity index 100% rename from app/assets/images/icons/icon-3-cloud-moon.svg rename to client-react/assets/images/icons/icon-3-cloud-moon.svg diff --git a/app/assets/images/icons/icon-4-cloud-rain.svg b/client-react/assets/images/icons/icon-4-cloud-rain.svg similarity index 100% rename from app/assets/images/icons/icon-4-cloud-rain.svg rename to client-react/assets/images/icons/icon-4-cloud-rain.svg diff --git a/app/assets/images/icons/icon-43-wind.svg b/client-react/assets/images/icons/icon-43-wind.svg similarity index 100% rename from app/assets/images/icons/icon-43-wind.svg rename to client-react/assets/images/icons/icon-43-wind.svg diff --git a/app/assets/images/icons/icon-7-cloud-snow.svg b/client-react/assets/images/icons/icon-7-cloud-snow.svg similarity index 100% rename from app/assets/images/icons/icon-7-cloud-snow.svg rename to client-react/assets/images/icons/icon-7-cloud-snow.svg diff --git a/app/assets/images/icons/icon-calendar.svg b/client-react/assets/images/icons/icon-calendar.svg similarity index 100% rename from app/assets/images/icons/icon-calendar.svg rename to client-react/assets/images/icons/icon-calendar.svg diff --git a/app/assets/images/icons/icon-gift.svg b/client-react/assets/images/icons/icon-gift.svg similarity index 100% rename from app/assets/images/icons/icon-gift.svg rename to client-react/assets/images/icons/icon-gift.svg diff --git a/app/assets/images/icons/icon-key.svg b/client-react/assets/images/icons/icon-key.svg similarity index 100% rename from app/assets/images/icons/icon-key.svg rename to client-react/assets/images/icons/icon-key.svg diff --git a/app/assets/images/icons/icon-like.svg b/client-react/assets/images/icons/icon-like.svg similarity index 100% rename from app/assets/images/icons/icon-like.svg rename to client-react/assets/images/icons/icon-like.svg diff --git a/app/assets/images/icons/icon-reply.svg b/client-react/assets/images/icons/icon-reply.svg similarity index 100% rename from app/assets/images/icons/icon-reply.svg rename to client-react/assets/images/icons/icon-reply.svg diff --git a/app/assets/images/icons/icon-retweet.svg b/client-react/assets/images/icons/icon-retweet.svg similarity index 100% rename from app/assets/images/icons/icon-retweet.svg rename to client-react/assets/images/icons/icon-retweet.svg diff --git a/app/assets/images/icons/icon-star.svg b/client-react/assets/images/icons/icon-star.svg similarity index 100% rename from app/assets/images/icons/icon-star.svg rename to client-react/assets/images/icons/icon-star.svg diff --git a/app/assets/images/icons/icon-user-plus.svg b/client-react/assets/images/icons/icon-user-plus.svg similarity index 100% rename from app/assets/images/icons/icon-user-plus.svg rename to client-react/assets/images/icons/icon-user-plus.svg diff --git a/app/assets/images/icons/icon-users.svg b/client-react/assets/images/icons/icon-users.svg similarity index 100% rename from app/assets/images/icons/icon-users.svg rename to client-react/assets/images/icons/icon-users.svg diff --git a/app/assets/images/icons/icon-wifi.svg b/client-react/assets/images/icons/icon-wifi.svg similarity index 100% rename from app/assets/images/icons/icon-wifi.svg rename to client-react/assets/images/icons/icon-wifi.svg diff --git a/app/assets/images/lock.png b/client-react/assets/images/lock.png similarity index 100% rename from app/assets/images/lock.png rename to client-react/assets/images/lock.png diff --git a/app/assets/images/logo.png b/client-react/assets/images/logo.png similarity index 100% rename from app/assets/images/logo.png rename to client-react/assets/images/logo.png diff --git a/app/assets/images/pr.png b/client-react/assets/images/pr.png similarity index 100% rename from app/assets/images/pr.png rename to client-react/assets/images/pr.png diff --git a/app/assets/images/raincloud.png b/client-react/assets/images/raincloud.png similarity index 100% rename from app/assets/images/raincloud.png rename to client-react/assets/images/raincloud.png diff --git a/app/assets/images/slack.png b/client-react/assets/images/slack.png similarity index 100% rename from app/assets/images/slack.png rename to client-react/assets/images/slack.png diff --git a/app/assets/images/sunmoon.png b/client-react/assets/images/sunmoon.png similarity index 100% rename from app/assets/images/sunmoon.png rename to client-react/assets/images/sunmoon.png diff --git a/app/assets/images/twitter-mojo.svg b/client-react/assets/images/twitter-mojo.svg similarity index 100% rename from app/assets/images/twitter-mojo.svg rename to client-react/assets/images/twitter-mojo.svg diff --git a/app/assets/images/unlocked.svg b/client-react/assets/images/unlocked.svg similarity index 100% rename from app/assets/images/unlocked.svg rename to client-react/assets/images/unlocked.svg diff --git a/app/assets/images/wifi_name.svg b/client-react/assets/images/wifi_name.svg similarity index 100% rename from app/assets/images/wifi_name.svg rename to client-react/assets/images/wifi_name.svg diff --git a/app/assets/images/wifi_password.svg b/client-react/assets/images/wifi_password.svg similarity index 100% rename from app/assets/images/wifi_password.svg rename to client-react/assets/images/wifi_password.svg diff --git a/app/assets/stylesheets/base.scss b/client-react/assets/stylesheets/base.scss similarity index 100% rename from app/assets/stylesheets/base.scss rename to client-react/assets/stylesheets/base.scss diff --git a/package.json b/client-react/package.json similarity index 80% rename from package.json rename to client-react/package.json index 0af4c51f4..dbf5c4d72 100644 --- a/package.json +++ b/client-react/package.json @@ -109,13 +109,13 @@ "webpack-sources": "^1.3.0" }, "scripts": { - "lint": "./node_modules/.bin/eslint --ext js --ext jsx app/javascript/", + "lint": "./node_modules/.bin/eslint --ext js --ext jsx src/", "test": "jest", "cy:open": "cypress open", "cy:run": "cypress run", "relative-to-alias": "jscodeshift --extensions jsx -t ./config/transforms/relative_to_alias_path.js ./ ", - "prettier:format": "prettier --write '{app/javascript/,__mocks__}/**/*.{js,jsx}' package.json webpack.config.js", - "prettier:check": "prettier --check '{app/javascript/,__mocks__}/**/*.{js,jsx}' package.json webpack.config.js", + "prettier:format": "prettier --write '{src/,__mocks__}/**/*.{js,jsx}' package.json webpack.config.js", + "prettier:check": "prettier --check '{src/,__mocks__}/**/*.{js,jsx}' package.json webpack.config.js", "build": "webpack", "serve": "webpack-dev-server" }, @@ -123,29 +123,29 @@ "verbose": true, "testURL": "http://localhost/", "roots": [ - "app/javascript" + "src" ], "moduleNameMapper": { "\\.(png|jpg|gif|ttf|eot|svg)$": "/__mocks__/fileMock.js", "react-hls-player": "/__mocks__/emptyMock.js", "^@root(.*)$": "/$1", - "^@app(.*)$": "/app$1", - "^@javascript(.*)$": "/app/javascript$1", - "^@lib(.*)$": "/app/javascript/lib$1", - "^@components(.*)$": "/app/javascript/components$1", - "^@widgets(.*)$": "/app/javascript/components/widgets$1", - "^@messages(.*)$": "/app/javascript/components/widgets/messages$1", - "^@numbers(.*)$": "/app/javascript/components/widgets/numbers$1", - "^@weather(.*)$": "/app/javascript/components/widgets/weather$1", - "^@twitter(.*)$": "/app/javascript/components/widgets/twitter$1", - "^@hocs(.*)$": "/app/javascript/components/hocs$1", + "^@app(.*)$": "/src$1", + "^@javascript(.*)$": "/src$1", + "^@lib(.*)$": "/src/lib$1", + "^@components(.*)$": "/src/components$1", + "^@widgets(.*)$": "/src/components/widgets$1", + "^@messages(.*)$": "/src/components/widgets/messages$1", + "^@numbers(.*)$": "/src/components/widgets/numbers$1", + "^@weather(.*)$": "/src/components/widgets/weather$1", + "^@twitter(.*)$": "/src/components/widgets/twitter$1", + "^@hocs(.*)$": "/src/components/hocs$1", "^@assets(.*)$": "/app/assets$1", "^@images(.*)$": "/app/assets/images$1", "^@icons(.*)$": "/app/assets/images/icons$1" }, "moduleDirectories": [ "node_modules", - "app/javascript" + "src" ] } } diff --git a/app/javascript/components/.keep b/client-react/src/components/.keep similarity index 100% rename from app/javascript/components/.keep rename to client-react/src/components/.keep diff --git a/app/javascript/components/__snapshots__/widget-display.test.jsx.snap b/client-react/src/components/__snapshots__/widget-display.test.jsx.snap similarity index 100% rename from app/javascript/components/__snapshots__/widget-display.test.jsx.snap rename to client-react/src/components/__snapshots__/widget-display.test.jsx.snap diff --git a/app/javascript/components/app.jsx b/client-react/src/components/app.jsx similarity index 100% rename from app/javascript/components/app.jsx rename to client-react/src/components/app.jsx diff --git a/app/javascript/components/bathroom.jsx b/client-react/src/components/bathroom.jsx similarity index 100% rename from app/javascript/components/bathroom.jsx rename to client-react/src/components/bathroom.jsx diff --git a/app/javascript/components/city-name.jsx b/client-react/src/components/city-name.jsx similarity index 100% rename from app/javascript/components/city-name.jsx rename to client-react/src/components/city-name.jsx diff --git a/app/javascript/components/date.jsx b/client-react/src/components/date.jsx similarity index 100% rename from app/javascript/components/date.jsx rename to client-react/src/components/date.jsx diff --git a/app/javascript/components/full-panel.jsx b/client-react/src/components/full-panel.jsx similarity index 100% rename from app/javascript/components/full-panel.jsx rename to client-react/src/components/full-panel.jsx diff --git a/app/javascript/components/get-weather-query.jsx b/client-react/src/components/get-weather-query.jsx similarity index 100% rename from app/javascript/components/get-weather-query.jsx rename to client-react/src/components/get-weather-query.jsx diff --git a/app/javascript/components/hocs/with-fragment.jsx b/client-react/src/components/hocs/with-fragment.jsx similarity index 100% rename from app/javascript/components/hocs/with-fragment.jsx rename to client-react/src/components/hocs/with-fragment.jsx diff --git a/app/javascript/components/hocs/with-fragment.test.jsx b/client-react/src/components/hocs/with-fragment.test.jsx similarity index 100% rename from app/javascript/components/hocs/with-fragment.test.jsx rename to client-react/src/components/hocs/with-fragment.test.jsx diff --git a/app/javascript/components/live-stream.jsx b/client-react/src/components/live-stream.jsx similarity index 100% rename from app/javascript/components/live-stream.jsx rename to client-react/src/components/live-stream.jsx diff --git a/app/javascript/components/logo.jsx b/client-react/src/components/logo.jsx similarity index 100% rename from app/javascript/components/logo.jsx rename to client-react/src/components/logo.jsx diff --git a/app/javascript/components/panel-wrapper.jsx b/client-react/src/components/panel-wrapper.jsx similarity index 100% rename from app/javascript/components/panel-wrapper.jsx rename to client-react/src/components/panel-wrapper.jsx diff --git a/app/javascript/components/row.jsx b/client-react/src/components/row.jsx similarity index 100% rename from app/javascript/components/row.jsx rename to client-react/src/components/row.jsx diff --git a/app/javascript/components/side-panel.jsx b/client-react/src/components/side-panel.jsx similarity index 100% rename from app/javascript/components/side-panel.jsx rename to client-react/src/components/side-panel.jsx diff --git a/app/javascript/components/tab-bar.jsx b/client-react/src/components/tab-bar.jsx similarity index 100% rename from app/javascript/components/tab-bar.jsx rename to client-react/src/components/tab-bar.jsx diff --git a/app/javascript/components/tabs.jsx b/client-react/src/components/tabs.jsx similarity index 100% rename from app/javascript/components/tabs.jsx rename to client-react/src/components/tabs.jsx diff --git a/app/javascript/components/time-hero.jsx b/client-react/src/components/time-hero.jsx similarity index 100% rename from app/javascript/components/time-hero.jsx rename to client-react/src/components/time-hero.jsx diff --git a/app/javascript/components/time.jsx b/client-react/src/components/time.jsx similarity index 100% rename from app/javascript/components/time.jsx rename to client-react/src/components/time.jsx diff --git a/app/javascript/components/top-corner-controller.jsx b/client-react/src/components/top-corner-controller.jsx similarity index 100% rename from app/javascript/components/top-corner-controller.jsx rename to client-react/src/components/top-corner-controller.jsx diff --git a/app/javascript/components/typography.jsx b/client-react/src/components/typography.jsx similarity index 100% rename from app/javascript/components/typography.jsx rename to client-react/src/components/typography.jsx diff --git a/app/javascript/components/version-compare.jsx b/client-react/src/components/version-compare.jsx similarity index 100% rename from app/javascript/components/version-compare.jsx rename to client-react/src/components/version-compare.jsx diff --git a/app/javascript/components/weather-corner.jsx b/client-react/src/components/weather-corner.jsx similarity index 100% rename from app/javascript/components/weather-corner.jsx rename to client-react/src/components/weather-corner.jsx diff --git a/app/javascript/components/widget-controller.jsx b/client-react/src/components/widget-controller.jsx similarity index 100% rename from app/javascript/components/widget-controller.jsx rename to client-react/src/components/widget-controller.jsx diff --git a/app/javascript/components/widget-display.jsx b/client-react/src/components/widget-display.jsx similarity index 100% rename from app/javascript/components/widget-display.jsx rename to client-react/src/components/widget-display.jsx diff --git a/app/javascript/components/widget-display.test.jsx b/client-react/src/components/widget-display.test.jsx similarity index 100% rename from app/javascript/components/widget-display.test.jsx rename to client-react/src/components/widget-display.test.jsx diff --git a/app/javascript/components/widget-transition-controls.jsx b/client-react/src/components/widget-transition-controls.jsx similarity index 100% rename from app/javascript/components/widget-transition-controls.jsx rename to client-react/src/components/widget-transition-controls.jsx diff --git a/app/javascript/components/widget-transition-controls.test.jsx b/client-react/src/components/widget-transition-controls.test.jsx similarity index 100% rename from app/javascript/components/widget-transition-controls.test.jsx rename to client-react/src/components/widget-transition-controls.test.jsx diff --git a/app/javascript/components/widgets.jsx b/client-react/src/components/widgets.jsx similarity index 100% rename from app/javascript/components/widgets.jsx rename to client-react/src/components/widgets.jsx diff --git a/app/javascript/components/widgets/events/index.jsx b/client-react/src/components/widgets/events/index.jsx similarity index 100% rename from app/javascript/components/widgets/events/index.jsx rename to client-react/src/components/widgets/events/index.jsx diff --git a/app/javascript/components/widgets/events/panel.jsx b/client-react/src/components/widgets/events/panel.jsx similarity index 100% rename from app/javascript/components/widgets/events/panel.jsx rename to client-react/src/components/widgets/events/panel.jsx diff --git a/app/javascript/components/widgets/guests/index.jsx b/client-react/src/components/widgets/guests/index.jsx similarity index 100% rename from app/javascript/components/widgets/guests/index.jsx rename to client-react/src/components/widgets/guests/index.jsx diff --git a/app/javascript/components/widgets/guests/panel.jsx b/client-react/src/components/widgets/guests/panel.jsx similarity index 100% rename from app/javascript/components/widgets/guests/panel.jsx rename to client-react/src/components/widgets/guests/panel.jsx diff --git a/app/javascript/components/widgets/messages/default-messages.jsx b/client-react/src/components/widgets/messages/default-messages.jsx similarity index 100% rename from app/javascript/components/widgets/messages/default-messages.jsx rename to client-react/src/components/widgets/messages/default-messages.jsx diff --git a/app/javascript/components/widgets/messages/message.jsx b/client-react/src/components/widgets/messages/message.jsx similarity index 100% rename from app/javascript/components/widgets/messages/message.jsx rename to client-react/src/components/widgets/messages/message.jsx diff --git a/app/javascript/components/widgets/numbers/ducks.jsx b/client-react/src/components/widgets/numbers/ducks.jsx similarity index 100% rename from app/javascript/components/widgets/numbers/ducks.jsx rename to client-react/src/components/widgets/numbers/ducks.jsx diff --git a/app/javascript/components/widgets/numbers/ducks.test.js b/client-react/src/components/widgets/numbers/ducks.test.js similarity index 100% rename from app/javascript/components/widgets/numbers/ducks.test.js rename to client-react/src/components/widgets/numbers/ducks.test.js diff --git a/app/javascript/components/widgets/numbers/falling-blocks.jsx b/client-react/src/components/widgets/numbers/falling-blocks.jsx similarity index 100% rename from app/javascript/components/widgets/numbers/falling-blocks.jsx rename to client-react/src/components/widgets/numbers/falling-blocks.jsx diff --git a/app/javascript/components/widgets/numbers/index.jsx b/client-react/src/components/widgets/numbers/index.jsx similarity index 100% rename from app/javascript/components/widgets/numbers/index.jsx rename to client-react/src/components/widgets/numbers/index.jsx diff --git a/app/javascript/components/widgets/numbers/panel.jsx b/client-react/src/components/widgets/numbers/panel.jsx similarity index 100% rename from app/javascript/components/widgets/numbers/panel.jsx rename to client-react/src/components/widgets/numbers/panel.jsx diff --git a/app/javascript/components/widgets/numbers/queries.js b/client-react/src/components/widgets/numbers/queries.js similarity index 100% rename from app/javascript/components/widgets/numbers/queries.js rename to client-react/src/components/widgets/numbers/queries.js diff --git a/app/javascript/components/widgets/traffic/index.jsx b/client-react/src/components/widgets/traffic/index.jsx similarity index 100% rename from app/javascript/components/widgets/traffic/index.jsx rename to client-react/src/components/widgets/traffic/index.jsx diff --git a/app/javascript/components/widgets/traffic/panel.jsx b/client-react/src/components/widgets/traffic/panel.jsx similarity index 100% rename from app/javascript/components/widgets/traffic/panel.jsx rename to client-react/src/components/widgets/traffic/panel.jsx diff --git a/app/javascript/components/widgets/twitter/index.jsx b/client-react/src/components/widgets/twitter/index.jsx similarity index 100% rename from app/javascript/components/widgets/twitter/index.jsx rename to client-react/src/components/widgets/twitter/index.jsx diff --git a/app/javascript/components/widgets/twitter/panel.jsx b/client-react/src/components/widgets/twitter/panel.jsx similarity index 100% rename from app/javascript/components/widgets/twitter/panel.jsx rename to client-react/src/components/widgets/twitter/panel.jsx diff --git a/app/javascript/components/widgets/twitter/tweet.jsx b/client-react/src/components/widgets/twitter/tweet.jsx similarity index 100% rename from app/javascript/components/widgets/twitter/tweet.jsx rename to client-react/src/components/widgets/twitter/tweet.jsx diff --git a/app/javascript/components/widgets/twitter/tweet_body.jsx b/client-react/src/components/widgets/twitter/tweet_body.jsx similarity index 100% rename from app/javascript/components/widgets/twitter/tweet_body.jsx rename to client-react/src/components/widgets/twitter/tweet_body.jsx diff --git a/app/javascript/components/widgets/twitter/tweet_content.jsx b/client-react/src/components/widgets/twitter/tweet_content.jsx similarity index 100% rename from app/javascript/components/widgets/twitter/tweet_content.jsx rename to client-react/src/components/widgets/twitter/tweet_content.jsx diff --git a/app/javascript/components/widgets/twitter/tweet_profile.jsx b/client-react/src/components/widgets/twitter/tweet_profile.jsx similarity index 100% rename from app/javascript/components/widgets/twitter/tweet_profile.jsx rename to client-react/src/components/widgets/twitter/tweet_profile.jsx diff --git a/app/javascript/components/widgets/twitter/tweet_stats.jsx b/client-react/src/components/widgets/twitter/tweet_stats.jsx similarity index 100% rename from app/javascript/components/widgets/twitter/tweet_stats.jsx rename to client-react/src/components/widgets/twitter/tweet_stats.jsx diff --git a/app/javascript/components/widgets/weather/current-temp.jsx b/client-react/src/components/widgets/weather/current-temp.jsx similarity index 100% rename from app/javascript/components/widgets/weather/current-temp.jsx rename to client-react/src/components/widgets/weather/current-temp.jsx diff --git a/app/javascript/components/widgets/weather/current-weather.jsx b/client-react/src/components/widgets/weather/current-weather.jsx similarity index 100% rename from app/javascript/components/widgets/weather/current-weather.jsx rename to client-react/src/components/widgets/weather/current-weather.jsx diff --git a/app/javascript/components/widgets/weather/daily-weather.jsx b/client-react/src/components/widgets/weather/daily-weather.jsx similarity index 100% rename from app/javascript/components/widgets/weather/daily-weather.jsx rename to client-react/src/components/widgets/weather/daily-weather.jsx diff --git a/app/javascript/components/widgets/weather/hourly-temps.jsx b/client-react/src/components/widgets/weather/hourly-temps.jsx similarity index 100% rename from app/javascript/components/widgets/weather/hourly-temps.jsx rename to client-react/src/components/widgets/weather/hourly-temps.jsx diff --git a/app/javascript/components/widgets/weather/index.jsx b/client-react/src/components/widgets/weather/index.jsx similarity index 100% rename from app/javascript/components/widgets/weather/index.jsx rename to client-react/src/components/widgets/weather/index.jsx diff --git a/app/javascript/components/widgets/weather/moon-phase.jsx b/client-react/src/components/widgets/weather/moon-phase.jsx similarity index 100% rename from app/javascript/components/widgets/weather/moon-phase.jsx rename to client-react/src/components/widgets/weather/moon-phase.jsx diff --git a/app/javascript/components/widgets/weather/panel.jsx b/client-react/src/components/widgets/weather/panel.jsx similarity index 100% rename from app/javascript/components/widgets/weather/panel.jsx rename to client-react/src/components/widgets/weather/panel.jsx diff --git a/app/javascript/components/widgets/weather/semi-circle.jsx b/client-react/src/components/widgets/weather/semi-circle.jsx similarity index 100% rename from app/javascript/components/widgets/weather/semi-circle.jsx rename to client-react/src/components/widgets/weather/semi-circle.jsx diff --git a/app/javascript/components/widgets/weather/sky-icons.jsx b/client-react/src/components/widgets/weather/sky-icons.jsx similarity index 100% rename from app/javascript/components/widgets/weather/sky-icons.jsx rename to client-react/src/components/widgets/weather/sky-icons.jsx diff --git a/app/javascript/components/widgets/weather/sunrise-sunset.jsx b/client-react/src/components/widgets/weather/sunrise-sunset.jsx similarity index 100% rename from app/javascript/components/widgets/weather/sunrise-sunset.jsx rename to client-react/src/components/widgets/weather/sunrise-sunset.jsx diff --git a/app/javascript/components/widgets/weather/sunrise-sunset.test.jsx b/client-react/src/components/widgets/weather/sunrise-sunset.test.jsx similarity index 100% rename from app/javascript/components/widgets/weather/sunrise-sunset.test.jsx rename to client-react/src/components/widgets/weather/sunrise-sunset.test.jsx diff --git a/app/javascript/components/widgets/weather/weather-effect.jsx b/client-react/src/components/widgets/weather/weather-effect.jsx similarity index 100% rename from app/javascript/components/widgets/weather/weather-effect.jsx rename to client-react/src/components/widgets/weather/weather-effect.jsx diff --git a/app/javascript/components/widgets/weather/weather-icon.jsx b/client-react/src/components/widgets/weather/weather-icon.jsx similarity index 100% rename from app/javascript/components/widgets/weather/weather-icon.jsx rename to client-react/src/components/widgets/weather/weather-icon.jsx diff --git a/app/javascript/components/wifi.jsx b/client-react/src/components/wifi.jsx similarity index 100% rename from app/javascript/components/wifi.jsx rename to client-react/src/components/wifi.jsx diff --git a/app/javascript/lib/circle-math.js b/client-react/src/lib/circle-math.js similarity index 100% rename from app/javascript/lib/circle-math.js rename to client-react/src/lib/circle-math.js diff --git a/app/javascript/lib/circle-math.test.js b/client-react/src/lib/circle-math.test.js similarity index 100% rename from app/javascript/lib/circle-math.test.js rename to client-react/src/lib/circle-math.test.js diff --git a/app/javascript/lib/datetime.js b/client-react/src/lib/datetime.js similarity index 100% rename from app/javascript/lib/datetime.js rename to client-react/src/lib/datetime.js diff --git a/app/javascript/lib/datetime.test.js b/client-react/src/lib/datetime.test.js similarity index 100% rename from app/javascript/lib/datetime.test.js rename to client-react/src/lib/datetime.test.js diff --git a/app/javascript/lib/phoenix-graphql-backend.js b/client-react/src/lib/phoenix-graphql-backend.js similarity index 100% rename from app/javascript/lib/phoenix-graphql-backend.js rename to client-react/src/lib/phoenix-graphql-backend.js diff --git a/app/javascript/lib/rails-graphql-backend.js b/client-react/src/lib/rails-graphql-backend.js similarity index 100% rename from app/javascript/lib/rails-graphql-backend.js rename to client-react/src/lib/rails-graphql-backend.js diff --git a/app/javascript/lib/theme.js b/client-react/src/lib/theme.js similarity index 100% rename from app/javascript/lib/theme.js rename to client-react/src/lib/theme.js diff --git a/app/javascript/lib/util.js b/client-react/src/lib/util.js similarity index 100% rename from app/javascript/lib/util.js rename to client-react/src/lib/util.js diff --git a/app/javascript/lib/util.test.js b/client-react/src/lib/util.test.js similarity index 100% rename from app/javascript/lib/util.test.js rename to client-react/src/lib/util.test.js diff --git a/app/javascript/lib/widget-shape.js b/client-react/src/lib/widget-shape.js similarity index 100% rename from app/javascript/lib/widget-shape.js rename to client-react/src/lib/widget-shape.js diff --git a/app/javascript/packs/application.js b/client-react/src/packs/application.js similarity index 94% rename from app/javascript/packs/application.js rename to client-react/src/packs/application.js index 4308f123d..3d682e487 100644 --- a/app/javascript/packs/application.js +++ b/client-react/src/packs/application.js @@ -11,7 +11,7 @@ import React from 'react'; import { render } from 'react-dom'; import App from '../components/app'; -import '@app/assets/stylesheets/base.scss'; +import '@assets/stylesheets/base.scss'; document.addEventListener('DOMContentLoaded', () => { const container = document.body.appendChild(document.createElement('div')); diff --git a/app/javascript/schema.json b/client-react/src/schema.json similarity index 100% rename from app/javascript/schema.json rename to client-react/src/schema.json diff --git a/app/javascript/styles.js b/client-react/src/styles.js similarity index 100% rename from app/javascript/styles.js rename to client-react/src/styles.js diff --git a/webpack.config.js b/client-react/webpack.config.js similarity index 83% rename from webpack.config.js rename to client-react/webpack.config.js index cd633a90c..d2dc22fdc 100644 --- a/webpack.config.js +++ b/client-react/webpack.config.js @@ -6,7 +6,7 @@ const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin'); const PnpWebpackPlugin = require('pnp-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); -require('dotenv').config({ path: path.resolve(__dirname, '.env') }); +require('dotenv').config({ path: path.resolve(__dirname, '../.env') }); module.exports = { mode: 'development', @@ -14,7 +14,7 @@ module.exports = { filename: 'js/[name]-[contenthash].js', chunkFilename: 'js/[name]-[contenthash].chunk.js', hotUpdateChunkFilename: 'js/[id]-[hash].hot-update.js', - path: path.resolve(__dirname, './server-phoenix/priv/static'), + path: path.resolve(__dirname, '../server-phoenix/priv/static'), publicPath: '/', pathinfo: true, }, @@ -38,33 +38,20 @@ module.exports = { plugins: [PnpWebpackPlugin], alias: { '@root': __dirname, - '@app': path.resolve(__dirname, 'app'), - '@javascript': path.resolve(__dirname, 'app/javascript'), - '@lib': path.resolve(__dirname, 'app/javascript/lib'), - '@components': path.resolve(__dirname, 'app/javascript/components'), - '@widgets': path.resolve(__dirname, 'app/javascript/components/widgets'), - '@messages': path.resolve( - __dirname, - 'app/javascript/components/widgets/messages', - ), - '@numbers': path.resolve( - __dirname, - 'app/javascript/components/widgets/numbers', - ), - '@weather': path.resolve( - __dirname, - 'app/javascript/components/widgets/weather', - ), - '@twitter': path.resolve( - __dirname, - 'app/javascript/components/widgets/twitter', - ), - '@hocs': path.resolve(__dirname, 'app/javascript/components/hocs'), - '@assets': path.resolve(__dirname, 'app/assets'), - '@images': path.resolve(__dirname, 'app/assets/images'), - '@icons': path.resolve(__dirname, 'app/assets/images/icons'), + '@javascript': path.resolve(__dirname, 'src'), + '@lib': path.resolve(__dirname, 'src/lib'), + '@components': path.resolve(__dirname, 'src/components'), + '@widgets': path.resolve(__dirname, 'src/components/widgets'), + '@messages': path.resolve(__dirname, 'src/components/widgets/messages'), + '@numbers': path.resolve(__dirname, 'src/components/widgets/numbers'), + '@weather': path.resolve(__dirname, 'src/components/widgets/weather'), + '@twitter': path.resolve(__dirname, 'src/components/widgets/twitter'), + '@hocs': path.resolve(__dirname, 'src/components/hocs'), + '@assets': path.resolve(__dirname, 'assets'), + '@images': path.resolve(__dirname, 'assets/images'), + '@icons': path.resolve(__dirname, 'assets/images/icons'), }, - modules: [path.resolve(__dirname, 'app/javascript'), 'node_modules'], + modules: [path.resolve(__dirname, 'src'), 'node_modules'], }, resolveLoader: { modules: ['node_modules'], @@ -88,7 +75,7 @@ module.exports = { port: 5000, https: false, hot: false, - contentBase: path.resolve(__dirname, './server-phoenix/priv/static'), + contentBase: path.resolve(__dirname, '../server-phoenix/priv/static'), inline: true, useLocalIp: false, public: 'localhost:5000', @@ -124,7 +111,7 @@ module.exports = { ], }, entry: { - application: path.resolve(__dirname, 'app/javascript/packs/application.js'), + application: path.resolve(__dirname, 'src/packs/application.js'), }, module: { strictExportPresence: true, @@ -144,12 +131,12 @@ module.exports = { loader: 'file-loader', options: { name: function(file) { - if (file.includes('app/javascript')) { + if (file.includes('src')) { return 'media/[path][name]-[hash].[ext]'; } return 'media/[folder]/[name]-[hash:8].[ext]'; }, - context: 'app/javascript', + context: 'src', }, }, ], @@ -325,7 +312,7 @@ module.exports = { }, { test: new RegExp('\\.(js|jsx|mjs)?(\\.erb)?$', ''), - include: [path.resolve(__dirname, 'app/javascript')], + include: [path.resolve(__dirname, 'src')], exclude: new RegExp('node_modules', ''), use: [ { diff --git a/yarn.lock b/client-react/yarn.lock similarity index 100% rename from yarn.lock rename to client-react/yarn.lock