More webpack reference removals.
parent
835ea510a4
commit
0959533319
|
@ -30,14 +30,14 @@ jobs:
|
||||||
- run:
|
- run:
|
||||||
name: Run linters
|
name: Run linters
|
||||||
command: |
|
command: |
|
||||||
sudo docker-compose run webpack npm run tslint
|
sudo docker-compose run parcel npm run tslint
|
||||||
sudo docker-compose run webpack npm run sass-lint
|
sudo docker-compose run parcel npm run sass-lint
|
||||||
sudo docker-compose run webpack npm run typecheck
|
sudo docker-compose run parcel npm run typecheck
|
||||||
- run:
|
- run:
|
||||||
name: Run JS tests
|
name: Run JS tests
|
||||||
command: |
|
command: |
|
||||||
sudo docker-compose run webpack npm run test-slow
|
sudo docker-compose run parcel npm run test-slow
|
||||||
sudo docker-compose run -e COVERALLS_REPO_TOKEN=lEX6nkql7y2YFCcIXVq5ORvdvMtYzfZdG webpack npm run coverage
|
sudo docker-compose run -e COVERALLS_REPO_TOKEN=lEX6nkql7y2YFCcIXVq5ORvdvMtYzfZdG parcel npm run coverage
|
||||||
- run:
|
- run:
|
||||||
name: Check Coveralls coverage on staging
|
name: Check Coveralls coverage on staging
|
||||||
command: |
|
command: |
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
webpack/**/*__test*
|
frontend/**/*__test*
|
||||||
webpack/**/*test*.ts
|
frontend/**/*test*.ts
|
||||||
webpack/**/*test*.tsx
|
frontend/**/*test*.tsx
|
||||||
**__test**
|
**__test**
|
||||||
**__tests__**
|
**__tests__**
|
||||||
**test**
|
**test**
|
||||||
webpack/entry.tsx
|
frontend/entry.tsx
|
||||||
webpack/password_reset/index.tsx
|
frontend/password_reset/index.tsx
|
||||||
|
|
|
@ -1,32 +1,26 @@
|
||||||
.cache
|
.cache
|
||||||
dist/ # Parcel "accidents" happen here.
|
|
||||||
.env
|
.env
|
||||||
.vscode
|
.vscode
|
||||||
log/
|
|
||||||
*.log
|
*.log
|
||||||
*.pem
|
*.pem
|
||||||
tmp
|
*scratchpad*
|
||||||
|
/config/master.key
|
||||||
|
api_docs.md
|
||||||
|
config/application.yml
|
||||||
|
config/credentials.yml.enc
|
||||||
|
coverage
|
||||||
|
coverage_api
|
||||||
|
coverage_fe
|
||||||
|
dist/ # Parcel "accidents" happen here.
|
||||||
docker_volumes
|
docker_volumes
|
||||||
|
erd_diagram.png
|
||||||
|
erd.pdf
|
||||||
latest_corpus.ts
|
latest_corpus.ts
|
||||||
|
log/
|
||||||
|
mqtt/
|
||||||
node_modules
|
node_modules
|
||||||
package-lock.json
|
package-lock.json
|
||||||
public/direct_upload/temp/*.jpg
|
public/direct_upload/temp/*.jpg
|
||||||
public/dist
|
public/dist
|
||||||
public/system
|
public/system
|
||||||
public/webpack
|
tmp
|
||||||
coverage_api
|
|
||||||
coverage_fe
|
|
||||||
|
|
||||||
api_docs.md
|
|
||||||
erd_diagram.png
|
|
||||||
erd.pdf
|
|
||||||
*scratchpad*
|
|
||||||
scratchpad.rb
|
|
||||||
|
|
||||||
/config/master.key
|
|
||||||
config/credentials.yml.enc
|
|
||||||
|
|
||||||
# Legacy
|
|
||||||
config/application.yml
|
|
||||||
coverage
|
|
||||||
mqtt/
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ options:
|
||||||
max-warnings: 0
|
max-warnings: 0
|
||||||
# File Options
|
# File Options
|
||||||
files:
|
files:
|
||||||
include: 'webpack/css/**/*.s+(a|c)ss'
|
include: 'frontend/css/**/*.s+(a|c)ss'
|
||||||
# Rule Configuration
|
# Rule Configuration
|
||||||
rules:
|
rules:
|
||||||
extends-before-mixins: 2
|
extends-before-mixins: 2
|
||||||
|
|
1
Gemfile
1
Gemfile
|
@ -28,7 +28,6 @@ gem "appsignal"
|
||||||
gem "skylight"
|
gem "skylight"
|
||||||
gem "tzinfo" # For validation of user selected timezone names
|
gem "tzinfo" # For validation of user selected timezone names
|
||||||
gem "valid_url"
|
gem "valid_url"
|
||||||
gem "webpack-rails"
|
|
||||||
gem "rabbitmq_http_api_client"
|
gem "rabbitmq_http_api_client"
|
||||||
gem "zero_downtime_migrations"
|
gem "zero_downtime_migrations"
|
||||||
gem "redis", "~> 4.0"
|
gem "redis", "~> 4.0"
|
||||||
|
|
|
@ -17,17 +17,8 @@ module FarmBot
|
||||||
config.active_job.queue_adapter = :delayed_job
|
config.active_job.queue_adapter = :delayed_job
|
||||||
config.action_dispatch.perform_deep_munge = false
|
config.action_dispatch.perform_deep_munge = false
|
||||||
I18n.enforce_available_locales = false
|
I18n.enforce_available_locales = false
|
||||||
LOCAL_API_HOST = ENV.fetch("API_HOST", "webpack")
|
LOCAL_API_HOST = ENV.fetch("API_HOST", "parcel")
|
||||||
WEBPACK_URL = "http://#{LOCAL_API_HOST}:3808"
|
WEBPACK_URL = "http://#{LOCAL_API_HOST}:3808"
|
||||||
config.webpack.dev_server.host = proc { request.host }
|
|
||||||
# PROBLEM: Containers run in docker. Default dev_server.manifest_host is
|
|
||||||
# "localhost", but our `dev_server` runs in a different docker
|
|
||||||
# container.
|
|
||||||
# SOLUTION: Explicitly set the hostname of the container where Webpack runs.
|
|
||||||
# In our case, that's `webpack`. See docker-compose.yml for all
|
|
||||||
# hostnames. -RC 1 OCT 18
|
|
||||||
config.webpack.dev_server.manifest_host = LOCAL_API_HOST
|
|
||||||
config.webpack.dev_server.manifest_port = 3808
|
|
||||||
config.generators do |g|
|
config.generators do |g|
|
||||||
g.template_engine :erb
|
g.template_engine :erb
|
||||||
g.test_framework :rspec, :fixture_replacement => :factory_bot, :views => false, :helper => false
|
g.test_framework :rspec, :fixture_replacement => :factory_bot, :views => false, :helper => false
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
|
|
||||||
var production = [
|
|
||||||
process.env.RAILS_ENV,
|
|
||||||
process.env.TARGET
|
|
||||||
].includes('production');
|
|
||||||
|
|
||||||
console.log(`
|
|
||||||
|
|
||||||
WEBPACK IS RUNNING IN ${ production ? "prod" : "dev"} MODE.
|
|
||||||
|
|
||||||
`)
|
|
||||||
var configFile = production ? "./webpack.prod" : "./webpack.dev";
|
|
||||||
|
|
||||||
module.exports = require(configFile);
|
|
|
@ -1,68 +0,0 @@
|
||||||
var path = require("path");
|
|
||||||
var StatsPlugin = require('stats-webpack-plugin');
|
|
||||||
var host = process.env["API_HOST"] || "localhost"
|
|
||||||
var devServerPort = 3808;
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
mode: "none",
|
|
||||||
output: {
|
|
||||||
// must match config.webpack.output_dir
|
|
||||||
path: path.join(__dirname, '..', 'public', 'webpack'),
|
|
||||||
publicPath: `//${host}:${devServerPort}/webpack/`,
|
|
||||||
filename: '[name].js'
|
|
||||||
},
|
|
||||||
entry: {
|
|
||||||
"app_bundle": "./webpack/entry.tsx",
|
|
||||||
"front_page": "./webpack/front_page/index.tsx",
|
|
||||||
"password_reset": "./webpack/password_reset/index.tsx",
|
|
||||||
"tos_update": "./webpack/tos_update/index.tsx"
|
|
||||||
},
|
|
||||||
devtool: "eval",
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
test: [/\.scss$/, /\.css$/],
|
|
||||||
use: ["style-loader", "css-loader", "sass-loader"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.tsx?$/,
|
|
||||||
use: "ts-loader"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: [/\.woff$/, /\.woff2$/, /\.ttf$/],
|
|
||||||
use: "url-loader"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: [/\.eot$/, /\.svg(\?v=\d+\.\d+\.\d+)?$/],
|
|
||||||
use: "file-loader"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
// Allows imports without file extensions.
|
|
||||||
resolve: {
|
|
||||||
extensions: [".js", ".ts", ".tsx", ".css", ".scss", ".json"]
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
new StatsPlugin('manifest.json', {
|
|
||||||
// We only need assetsByChunkName
|
|
||||||
chunkModules: false,
|
|
||||||
source: false,
|
|
||||||
chunks: false,
|
|
||||||
modules: false,
|
|
||||||
assets: true
|
|
||||||
})
|
|
||||||
],
|
|
||||||
node: {
|
|
||||||
fs: "empty"
|
|
||||||
},
|
|
||||||
devServer: {
|
|
||||||
port: devServerPort,
|
|
||||||
disableHostCheck: true,
|
|
||||||
watchOptions: {
|
|
||||||
aggregateTimeout: 300,
|
|
||||||
poll: 1000
|
|
||||||
},
|
|
||||||
host: "0.0.0.0",
|
|
||||||
headers: { 'Access-Control-Allow-Origin': '*' }
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -1,90 +0,0 @@
|
||||||
'use strict';
|
|
||||||
global.WEBPACK_ENV = "production";
|
|
||||||
var path = require("path");
|
|
||||||
var UglifyJsPlugin = require("webpack-uglify-js-plugin");
|
|
||||||
var OptimizeCssAssetsPlugin = require("optimize-css-assets-webpack-plugin");
|
|
||||||
var webpack = require("webpack");
|
|
||||||
var StatsPlugin = require('stats-webpack-plugin');
|
|
||||||
var publicPath = '/webpack/';
|
|
||||||
|
|
||||||
var conf = {
|
|
||||||
mode: "none",
|
|
||||||
devtool: "source-map",
|
|
||||||
entry: {
|
|
||||||
"app_bundle": "./webpack/entry.tsx",
|
|
||||||
"front_page": "./webpack/front_page/index.tsx",
|
|
||||||
"password_reset": "./webpack/password_reset/index.tsx",
|
|
||||||
"tos_update": "./webpack/tos_update/index.tsx"
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
path: path.join(__dirname, '..', 'public', 'webpack'),
|
|
||||||
publicPath,
|
|
||||||
filename: '[name]-[chunkhash].js',
|
|
||||||
chunkFilename: '[id].[name].[chunkhash].js'
|
|
||||||
},
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
test: [/\.scss$/, /\.css$/],
|
|
||||||
use: ["style-loader", "css-loader", "sass-loader"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.tsx?$/,
|
|
||||||
use: "ts-loader"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: [/\.woff$/, /\.woff2$/, /\.ttf$/],
|
|
||||||
use: "url-loader"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: [/\.eot$/, /\.svg(\?v=\d+\.\d+\.\d+)?$/],
|
|
||||||
use: "file-loader"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
// Allows imports without file extensions.
|
|
||||||
resolve: {
|
|
||||||
extensions: [".js", ".ts", ".tsx", ".css", ".scss", ".json"]
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
new StatsPlugin('manifest.json', {
|
|
||||||
// We only need assetsByChunkName
|
|
||||||
chunkModules: false,
|
|
||||||
source: false,
|
|
||||||
chunks: false,
|
|
||||||
modules: false,
|
|
||||||
assets: true
|
|
||||||
}),
|
|
||||||
new OptimizeCssAssetsPlugin({
|
|
||||||
assetNameRegExp: /\.css$/g,
|
|
||||||
cssProcessor: require("cssnano"),
|
|
||||||
cssProcessorOptions: { discardComments: { removeAll: true } },
|
|
||||||
canPrint: true
|
|
||||||
}),
|
|
||||||
new UglifyJsPlugin({
|
|
||||||
cacheFolder: path.resolve(__dirname, "../public/dist/cached_uglify/"),
|
|
||||||
debug: true,
|
|
||||||
minimize: true,
|
|
||||||
sourceMap: true,
|
|
||||||
screw_ie8: true,
|
|
||||||
output: { comments: false },
|
|
||||||
compressor: { warnings: false }
|
|
||||||
}),
|
|
||||||
new webpack.DefinePlugin({
|
|
||||||
'process.env': {
|
|
||||||
'NODE_ENV': JSON.stringify("production")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
],
|
|
||||||
node: {
|
|
||||||
fs: "empty"
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var accessToken = process.env.ROLLBAR_ACCESS_TOKEN
|
|
||||||
if (accessToken) {
|
|
||||||
var RollbarSourceMapPlugin = require('rollbar-sourcemap-webpack-plugin')
|
|
||||||
var version = process.env.BUILT_AT || process.env.HEROKU_SLUG_COMMIT || "????"
|
|
||||||
var plugin = new RollbarSourceMapPlugin({accessToken, version, publicPath})
|
|
||||||
conf.plugins.push(plugin)
|
|
||||||
}
|
|
||||||
module.exports = conf;
|
|
|
@ -51,7 +51,7 @@ services:
|
||||||
- RABBITMQ_CONFIG_FILE=/farmbot/farmbot_rmq_config
|
- RABBITMQ_CONFIG_FILE=/farmbot/farmbot_rmq_config
|
||||||
volumes:
|
volumes:
|
||||||
- ./docker_volumes/rabbit:/farmbot
|
- ./docker_volumes/rabbit:/farmbot
|
||||||
webpack: # ====================
|
parcel: # ====================
|
||||||
<<: *base_config
|
<<: *base_config
|
||||||
<<: *rails
|
<<: *rails
|
||||||
depends_on: ["db","mqtt", "web"]
|
depends_on: ["db","mqtt", "web"]
|
||||||
|
|
|
@ -19,8 +19,7 @@ export class API {
|
||||||
* factors such as hostname and protocol (HTTP vs. HTTPS). */
|
* factors such as hostname and protocol (HTTP vs. HTTPS). */
|
||||||
static inferPort(location = window.location): string {
|
static inferPort(location = window.location): string {
|
||||||
|
|
||||||
// ATTEMPT 1: Most devs running a webpack server on localhost
|
// ATTEMPT 1: Most devs run a server on localhost with the API on port 3000.
|
||||||
// run the API on port 3000.
|
|
||||||
if (location.port === "3808") { return "3000"; }
|
if (location.port === "3808") { return "3000"; }
|
||||||
|
|
||||||
// ATTEMPT 2: If they provide an explicit port (as in ://localhost:3000)
|
// ATTEMPT 2: If they provide an explicit port (as in ://localhost:3000)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue