diff --git a/.env.vault b/.env.vault new file mode 100644 index 000000000..9816ad7cf --- /dev/null +++ b/.env.vault @@ -0,0 +1,12 @@ +################################################################################# +# # +# This file uniquely identifies your project in dotenv-vault. # +# You SHOULD commit this file to source control. # +# # +# Generated with 'npx dotenv-vault new' # +# # +# Learn more at https://dotenv.org/env-vault # +# # +################################################################################# + +DOTENV_VAULT=vlt_a7698f74e5365a7834b9f3a62cc555169343e436f2cde5d317afa8c4adfa4eda \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1aaecb473..eccb6ec6c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,10 +2,7 @@ node_modules npm-debug.log .DS_Store -packages/indexed-db/build build/ -stageBuild/ -dev/ cypress/screenshots cypress/videos @@ -91,11 +88,6 @@ typings/ # Yarn Integrity file .yarn-integrity -# dotenv environment variables file -.env -.env.test -.env* - # parcel-bundler cache (https://parceljs.org/) .cache @@ -133,4 +125,13 @@ dist !.yarn/releases/* # Declaration files -*.d.ts \ No newline at end of file +*.d.ts + +# dotenv environment variables file +.env +.env.test +.env.production +.env* +.flaskenv* +!.env.project +!.env.vault \ No newline at end of file diff --git a/package.json b/package.json index 0aa744af3..4a5179146 100644 --- a/package.json +++ b/package.json @@ -9,19 +9,19 @@ "scripts": { "build:monorepo": "lerna run build --scope=@firecamp/js-executor --scope=@firecamp/rest-executor", "start": "npx webpack serve --config ./webpack.dev.js", - "dev": "APP_VERSION=$npm_package_version RELEASE_SERVER=dev APP_FORMAT=extension && node scripts/build && npm run build:monorepo && yarn start", + "dev": "APP_VERSION=$npm_package_version AppFormat=webapp && node scripts/build && npm run build:monorepo && yarn start", "electron": "npx electron .", - "release:web-app": "export APP_FORMAT=webapp && node scripts/release production", - "release:web-app:staging": "export APP_FORMAT=webapp && node scripts/release staging", - "release:extension": "export APP_FORMAT=extension && node scripts/release production", - "release:prod:mac-dmg": "export APP_FORMAT=dmg && node scripts/release production p", - "release:prod:linux-appImage": "export APP_FORMAT=appImage && node scripts/release production", - "release:prod:linux-snap": "export APP_FORMAT=snap && node scripts/release production p", - "release:prod:win32-nsis": "export APP_FORMAT=nsis && node scripts/release production p", - "release:canary:mac-dmg": "export APP_FORMAT=dmg && node scripts/release canary p", - "release:canary:linux-appImage": "export APP_FORMAT=appImage && node scripts/release canary p", - "release:canary:win32-nsis": "export APP_FORMAT=nsis && node scripts/release canary p", - "clean": "rimraf build/ dev/ *.zip* .crx", + "release:web-app": "AppFormat=webapp && node scripts/release production", + "release:web-app:staging": "AppFormat=webapp && node scripts/release staging", + "release:extension": "export AppFormat=extension && node scripts/release production", + "release:prod:mac-dmg": "export AppFormat=dmg && node scripts/release production p", + "release:prod:linux-appImage": "export AppFormat=appImage && node scripts/release production", + "release:prod:linux-snap": "export AppFormatode scripts/release production p", + "release:prod:win32-nsis": "export AppFormat=nsis && node scripts/release production p", + "release:canary:mac-dmg": "export AppFormatdmg && node scripts/release canary p", + "release:canary:linux-appImage": "export AppFormatappImage && node scripts/release canary p", + "release:canary:win32-nsis": "export AppFormat=nsis && node scripts/release canary p", + "clean": "rimraf build/ development/ *.zip* .crx", "lint": "eslint packages/firecamp-rest/src/**/*.{ts|tsx} packages/*.js packages-clients/*.js scripts webpack/*.js", "test-e2e": "cross-env NODE_ENV=test mocha -r ./test/setup-app test/e2e", "_test": "cross-env NODE_ENV=test mocha -r ./test/setup-app test/app", diff --git a/packages/firecamp-core/public/views/identity.pug b/packages/firecamp-core/public/views/identity.pug index 128ef94bd..482e5c366 100644 --- a/packages/firecamp-core/public/views/identity.pug +++ b/packages/firecamp-core/public/views/identity.pug @@ -1,5 +1,5 @@ - let publicPath = process.env.NODE_ENV === 'development' ? '/' : '/js/' -- publicPath = process.env.APP_FORMAT === 'webapp' ? './js/' : publicPath +- publicPath = process.env.AppFormat === 'webapp' ? './js/' : publicPath doctype html diff --git a/packages/firecamp-core/public/views/app.html b/packages/firecamp-core/public/views/index.html similarity index 100% rename from packages/firecamp-core/public/views/app.html rename to packages/firecamp-core/public/views/index.html diff --git a/packages/firecamp-core/public/views/app.pug b/packages/firecamp-core/public/views/index.pug similarity index 87% rename from packages/firecamp-core/public/views/app.pug rename to packages/firecamp-core/public/views/index.pug index 25eeb2257..d7f53196e 100644 --- a/packages/firecamp-core/public/views/app.pug +++ b/packages/firecamp-core/public/views/index.pug @@ -1,5 +1,5 @@ - let publicPath = process.env.NODE_ENV === 'development' ? '/' : '/js/' -- publicPath = process.env.APP_FORMAT === 'webapp' ? './js/' : publicPath +- publicPath = process.env.AppFormat === 'webapp' ? './js/' : publicPath doctype html diff --git a/packages/firecamp-core/src/components/modals-v3/request/edit-request/EditRequest.tsx b/packages/firecamp-core/src/components/modals-v3/request/edit-request/EditRequest.tsx index 56f14181a..896f6957f 100644 --- a/packages/firecamp-core/src/components/modals-v3/request/edit-request/EditRequest.tsx +++ b/packages/firecamp-core/src/components/modals-v3/request/edit-request/EditRequest.tsx @@ -4,20 +4,18 @@ import { TextArea, TabHeader, Button, - - Modal, IModal, ProgressBar, } from '@firecamp/ui-kit'; import { _misc } from '@firecamp/utils'; +import { TId } from '@firecamp/types'; -import { useWorkspaceStore } from '../../../../store/workspace'; -import { useRequestStore } from '../../../../store/request'; import { useModalStore } from '../../../../store/modal'; -import { TId } from '@firecamp/types'; +import { useWorkspaceStore } from '../../../../store/workspace' +import AppService from '../../../../services/app' -type TModalMeta = { name: string, description: string, request_id: TId, collection_id: TId }; +type TModalMeta = { name: string, description: string, request_id: TId, collection_id: TId, folder_id?: TId }; const EditRequest: FC = ({ isOpen = false, @@ -26,7 +24,7 @@ const EditRequest: FC = ({ width = '500px', }) => { - const { name, description, request_id, collection_id } = useModalStore.getState().meta as TModalMeta; + const { name, description, request_id, collection_id, folder_id } = useModalStore.getState().meta as TModalMeta; const [request, setRequest] = useState({ name, description @@ -40,37 +38,34 @@ const EditRequest: FC = ({ setRequest((r) => ({ ...r, [name]: value })); }; - const onCreate = () => { + const onUpdate = () => { if (isRequesting) return; const name = request.name.trim(); if (!name || name.length < 3) { - setError({ name: 'The request name must have minimun 3 characters' }); + setError({ name: 'The request name must have minimum 3 characters' }); return; } const _request = { - ...request, - name, - description: request?.description?.trim(), + meta: { + name, + description: request?.description?.trim(), + }, + _meta: { + id: request_id, + collection_id, + folder_id + } }; setIsRequesting(true); - // console.log({ _request }); - - useRequestStore.getState().onEditRequest(_request); - - // createRequest(_request) - // .then((r)=> { - - // console.log(r, "r......") - // AppService.modals.close(); - // }) - // .catch((e)=> { - // console.log(e.response, e.response?.data) - // AppService.notify.alert(e?.response?.data?.message || e.message ) - // }) - // .finally(()=> { - // setIsRequesting(false); - // }); + const { updateRequest } = useWorkspaceStore.getState() + updateRequest(request_id, _request) + .then((res)=> { + AppService.modals.close(); + }) + .finally(()=> { + setIsRequesting(false); + }); }; return ( @@ -134,7 +129,7 @@ const EditRequest: FC = ({ text={isRequesting ? 'Updating...' : 'Update'} primary sm - onClick={onCreate} + onClick={onUpdate} disabled={isRequesting} /> diff --git a/packages/firecamp-core/src/services/auth/helper.ts b/packages/firecamp-core/src/services/auth/helper.ts deleted file mode 100644 index 30027c736..000000000 --- a/packages/firecamp-core/src/services/auth/helper.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { IAuthResponse } from './types'; - -// Validate auth API response -export const validateAuthResponse = (response: IAuthResponse): boolean => { - if ( - response?.user?.email && - response?.user?._meta?.id && - response?.meta?.access_token && - response?.meta?.active_workspace && - response?.workspace?.name && - response?.workspace?.meta?.is_default && - response?.workspace?.meta?.type && - response?.workspace?._meta?.id - ) - return true; - - return false; -}; diff --git a/packages/firecamp-core/src/services/auth/sign-in.ts b/packages/firecamp-core/src/services/auth/sign-in.ts index 0a06c7dd5..c572e9d69 100644 --- a/packages/firecamp-core/src/services/auth/sign-in.ts +++ b/packages/firecamp-core/src/services/auth/sign-in.ts @@ -1,11 +1,8 @@ import { Rest } from '@firecamp/cloud-apis'; import { EProvider, IAuthResponse } from './types'; -import { validateAuthResponse } from './helper'; import { githubAuth, googleAuth } from './oauth2'; -/** - * credentials require while sign-in using Firecamp domain - */ +/** credentials require while sign-in using Firecamp domain */ export interface ICredentials { username: string; password: string; @@ -22,25 +19,16 @@ export default async ( try { const { username = '', password = '' } = credentials; - // TODO: - // if (F.userMeta.isLoggedIn) return Promise.resolve(); - switch (provider) { case EProvider.LOCAL: { // Request to sign-in via Firecamp domain try { const response = await Rest.auth.signIn(username, password); - // validate auth response - if (validateAuthResponse(response?.data)) { - return Promise.resolve({ - response: response.data, - provider: EProvider.LOCAL, - }); - } else - return Promise.reject({ - message: 'failed to sign in into your account', - }); + return Promise.resolve({ + response: response.data, + provider: EProvider.LOCAL, + }); } catch (e) { console.log(e, 'e...'); if (e.message == 'Network Error') @@ -55,17 +43,11 @@ export default async ( // Send token to authenticate const response = await Rest.auth.viaGoogle(token); - debugger; - if (validateAuthResponse(response?.data)) { - return Promise.resolve({ - response: response.data, - provider: EProvider.GOOGLE, - }); - } else - return Promise.reject({ - message: 'Failed to sign-in into your account', - }); + return Promise.resolve({ + response: response.data, + provider: EProvider.GOOGLE, + }); } case EProvider.GITHUB: // Fetch auth code diff --git a/packages/firecamp-core/src/services/auth/sign-up.ts b/packages/firecamp-core/src/services/auth/sign-up.ts index 5bd46e2d3..f2f63c09d 100644 --- a/packages/firecamp-core/src/services/auth/sign-up.ts +++ b/packages/firecamp-core/src/services/auth/sign-up.ts @@ -1,6 +1,5 @@ import { Rest } from '@firecamp/cloud-apis'; import { EProvider, IAuthResponse } from './types'; -import { validateAuthResponse } from './helper'; /** * credentials require for sign-up using Firecamp domain @@ -24,15 +23,10 @@ export default async ({ const response = await Rest.auth.signUp(username, email, password); // validate auth response - if (validateAuthResponse(response?.data)) { - return Promise.resolve({ - response: response.data, - provider: EProvider.LOCAL, - }); - } else - return Promise.reject({ - message: 'Failed to sign-up for your account', - }); + return Promise.resolve({ + response: response.data, + provider: EProvider.LOCAL, + }); } catch (error) { return Promise.reject({ message: error?.data?.message diff --git a/packages/firecamp-core/src/store/workspace.ts b/packages/firecamp-core/src/store/workspace.ts index ac37733a7..4a78a701f 100644 --- a/packages/firecamp-core/src/store/workspace.ts +++ b/packages/firecamp-core/src/store/workspace.ts @@ -79,7 +79,7 @@ export interface IWorkspaceStore { // request onNewRequestCreate: (request: any) => void; createRequest: (payload: { [k: string]: any }) => void; - updateRequest: (rId: string, payload: { [k: string]: any }) => void; + updateRequest: (rId: string, payload: { [k: string]: any }) => Promise; deleteRequest: (rId: TId) => void; // change orders @@ -568,7 +568,7 @@ export const useWorkspaceStore = create( s.explorer.tdpInstance?.updateRequestItem(request); const requests = s.explorer.requests.map((r) => { if (r._meta.id == request._meta.id) - r = { ...r, meta: { ...r.meta, name: request.meta.name } }; //note: this condition is used considering only renaming usecase + r = { ...r, meta: { ...r.meta, name: request.meta.name } }; //note: this condition is used considering only renaming use case return r; }); return { explorer: { ...s.explorer, requests } }; diff --git a/scripts/build.js b/scripts/build.js index 493555620..2bc53cf13 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -1,7 +1,9 @@ +/* eslint-disable no-console */ require('dotenv').config(); const fs = require('fs'); const path = require('path'); const colors = require('colors'); +const { Environment, AppFormat } = require('./constants'); const build = require('../webpack.prod'); require('shelljs/global'); @@ -33,9 +35,9 @@ module.exports = async () => { // Copy project assets and generate config. const directoryPaths = [ path.join(`${__dirname}/../build`), - path.join(`${__dirname}/../build/dev`), + path.join(`${__dirname}/../build/development`), path.join(`${__dirname}/../build/production`), - path.join(`${__dirname}/../build/dev/build-scripts`), + path.join(`${__dirname}/../build/development/build-scripts`), path.join(`${__dirname}/../build/production/build-scripts`), path.join(`${__dirname}/../build/production/services`), path.join(`${__dirname}/../build/production/packages-executors`), @@ -43,7 +45,7 @@ module.exports = async () => { // Hold the build path as per the environment mode const buildPath = - process.env.NODE_ENV === 'development' + process.env.NODE_ENV === Environment.Development ? directoryPaths[1] : directoryPaths[2]; @@ -56,13 +58,13 @@ module.exports = async () => { }); // Copy build-scripts to generate build - cp( - '-R', - path.join( - `${__dirname}/../packages/firecamp-desktop-app/src/build-scripts/*` - ), - `${buildPath}/build-scripts` - ); + // cp( + // '-R', + // path.join( + // `${__dirname}/../packages/firecamp-desktop-app/src/build-scripts/*` + // ), + // `${buildPath}/build-scripts` + // ); // Copy react app assets cp( @@ -72,7 +74,7 @@ module.exports = async () => { ); // generate package.json and manifest based on app environment - if (process.env.NODE_ENV === 'development') + if (process.env.NODE_ENV === Environment.Development) exec(`node ${buildPath}/build-scripts/init-package.js`); else exec(`node ${buildPath}/build-scripts/init-package.js`); @@ -94,8 +96,8 @@ module.exports = async () => { // Copy electron agent assets, config and services if ( - process.env.NODE_ENV === 'production' && - process.env.APP_FORMAT !== 'extension' + process.env.NODE_ENV === Environment.Production && + process.env.AppFormat !== AppFormat.WebApp ) { // Copy electron agent services cp( @@ -114,13 +116,13 @@ module.exports = async () => { ); // Copy dmg app assets - if (process.env.APP_FORMAT === 'dmg') { + if (process.env.AppFormat === AppFormat.Dmg) { mkdir(`${buildPath}/build`); cp( '-R', path.join( - `${__dirname}/../packages/firecamp-desktop-app/public/assets/${process.env.RELEASE_SERVER}/mac/*` + `${__dirname}/../packages/firecamp-desktop-app/public/assets/${process.env.NODE_ENV}/mac/*` ), `${buildPath}/build` ); @@ -131,9 +133,7 @@ module.exports = async () => { '-R', path.join( `${__dirname}/../packages/firecamp-desktop-app/public/assets/${ - ['production', 'staging', 'dev'].includes( - process.env.RELEASE_SERVER - ) + [...Object.values(Environment)].includes(process.env.NODE_ENV) ? 'production' : 'canary' }` @@ -153,7 +153,7 @@ module.exports = async () => { }; if (process.env.NODE_ENV === 'development') { - if (process.env.RELEASE_SERVER === 'production') { + if (process.env.NODE_ENV === Environment.Production) { console.log( `${colors.red( 'Error:' @@ -164,11 +164,11 @@ if (process.env.NODE_ENV === 'development') { process.exit(); } - if (process.env.RELEASE_SERVER === 'dev') module.exports(); + if (process.env.NODE_ENV === Environment.Development) module.exports(); } if (process.env.NODE_ENV === 'production') { - if (process.env.RELEASE_SERVER === 'dev') { + if (process.env.NODE_ENV === Environment.Development) { console.log( `${colors.red( 'Error:' diff --git a/scripts/constants.js b/scripts/constants.js new file mode 100644 index 000000000..92b418f7c --- /dev/null +++ b/scripts/constants.js @@ -0,0 +1,16 @@ +const Environment = { + Development: 'development', + Staging: 'staging', // staging will be for testing purpose + Production: 'production', + Canary: 'canary', // Canary is production but for early adopter +}; + +const AppFormat = { + WebApp: 'webapp', + Dmg: 'dmg', + AppImage: 'appImage', + Snap: 'snap', + NSIS: 'nsis', +}; + +module.exports = { Environment, AppFormat }; diff --git a/scripts/release.js b/scripts/release.js index 078528903..1575a6c04 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ require('dotenv').config(); const colors = require('colors'); const semver = require('semver'); @@ -5,6 +6,8 @@ require('shelljs/global'); const build = require('./build'); const { version } = require('../package.json'); +const { Environment, AppFormat } = require('./constants'); + const variables = [ // 'FIRECAMP_API_HOST', // 'CSC_KEY_PASSWORD', @@ -24,9 +27,6 @@ if (!semver.valid(version)) { // Set app version in the environment process.env.APP_VERSION = version; -// Set release server production/staging/canary -process.env.RELEASE_SERVER = process.argv[2]; - // Check if environment variables set variables.forEach((variable) => { if ( @@ -43,7 +43,7 @@ variables.forEach((variable) => { // Check FIRECAMP_API_HOST env. variable value does not contains invalid value if ( - process.env.RELEASE_SERVER !== 'staging' && + process.env.NODE_ENV !== Environment.Staging && (process.env.FIRECAMP_API_HOST.includes('localhost') || process.env.FIRECAMP_API_HOST.includes('testing') || process.env.FIRECAMP_API_HOST.includes('127.0.0.1')) @@ -87,22 +87,27 @@ ${colors.red('Error: ')}Failed to execute command: ${command}` const preBuildCliCommands = async () => { // Prevent check git tag while staging build - if (process.env.RELEASE_SERVER === 'staging') return Promise.resolve(); + if (process.env.NODE_ENV === Environment.Staging) return Promise.resolve(); // Check is tag was checked out or not - const result = await _exec('git describe --tags', { async: true }); - if (result.replace(/\n/g, '') !== `v${version}`) { - console.log( - ` - ${colors.red('Error:')} Please checkout tag '${colors.yellow( - `v${version}` - )}' for release` - ); - process.exit(); - } else return Promise.resolve(); + // await _exec('git describe --tags', { async: true }) + // .then((result) => { + // console.log(result); + // if (result.replace(/\n/g, '') !== `v${version}`) { + // console.log( + // `${colors.red('Error:')} Please checkout tag '${colors.yellow( + // `v${version}` + // )}' for release` + // ); + // process.exit(); + // } else return Promise.resolve(); + // }) + // .catch((e) => { + // console.log(e, 'this is the error'); + // }); }; -if (process.env.NODE_ENV === 'production') { +if (process.env.NODE_ENV === Environment.Production) { try { preBuildCliCommands().then(async () => { /** @@ -113,13 +118,13 @@ if (process.env.NODE_ENV === 'production') { await build(); // Finished the process if build=chrome - if (['extension', 'webapp'].includes(process.env.APP_FORMAT)) { + if (['extension', AppFormat.WebApp].includes(process.env.AppFormat)) { // Remove unused packages rm('-rf', 'build/production/build-scripts'); rm('-rf', 'build/production/packages-executors'); rm('-rf', 'build/production/services'); - if (process.env.APP_FORMAT === 'webapp') { + if (process.env.AppFormat === AppFormat.WebApp) { // Remove chrome extension app files rm('-rf', 'build/production/splashscreen.html'); rm('-rf', 'build/production/manifest.json'); @@ -134,9 +139,9 @@ if (process.env.NODE_ENV === 'production') { } // Set bundle id for electron app - if (process.env.RELEASE_SERVER === 'production') + if (process.env.NODE_ENV === Environment.Production) process.env.appBundleId = 'com.firecamp.app'; - else if (process.env.RELEASE_SERVER === 'canary') + else if (process.env.NODE_ENV === Environment.Canary) process.env.appBundleId = 'com.firecamp.canary'; // Copy release note and post build checks @@ -161,7 +166,7 @@ if (process.env.NODE_ENV === 'production') { exec('yarn add ../../../firecamp-forks/electron-oauth-helper -W'); // Prepare linux os 'AppImage' build - if (process.env.APP_FORMAT === 'appImage') { + if (process.env.AppFormat === AppFormat.AppImage) { // do not publish the app if (process.argv[3] === 'l') exec('electron-builder --linux AppImage'); @@ -181,7 +186,7 @@ if (process.env.NODE_ENV === 'production') { } // Prepare linux os 'Snap' build - if (process.env.APP_FORMAT === 'snap') { + if (process.env.AppFormat === AppFormat.Snap) { // do not publish the app if (process.argv[3] === 'l') exec('electron-builder --linux Snap'); @@ -191,7 +196,7 @@ if (process.env.NODE_ENV === 'production') { } // Prepare windows os 'nsis' build - if (process.env.APP_FORMAT === 'nsis') { + if (process.env.AppFormat === AppFormat.NSIS) { // do not publish the app if (process.argv[3] === 'l') exec('electron-builder --win'); @@ -211,7 +216,7 @@ if (process.env.NODE_ENV === 'production') { } // Prepare mac os 'dmg' build - if (process.env.APP_FORMAT === 'dmg') { + if (process.env.AppFormat === AppFormat.Dmg) { // do not publish the app if (process.argv[3] === 'l') exec('electron-builder --mac'); diff --git a/webpack.config.js b/webpack.config.js index 303dd7f1a..c43d12c11 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,13 +1,15 @@ +/* eslint-disable no-console */ // import environments require('dotenv').config(); const webpack = require('webpack'); const path = require('path'); -const metadata = require('./package.json'); const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); const NodePolyfillPlugin = require('node-polyfill-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); +const metadata = require('./package.json'); + exports.common = { entry: { app: path.join( @@ -58,19 +60,21 @@ exports.output = { }; if (process.env.NODE_ENV === 'development') { - exports.output['path'] = path.join(__dirname, './build/dev/js'); - exports.output['clean'] = true; + exports.output.path = path.join(__dirname, './build/development/js'); + exports.output.clean = true; } else { - exports.output['path'] = path.join(__dirname, './build/production/js'); + exports.output.path = path.join(__dirname, './build/production/js'); } exports.env = { NODE_ENV: JSON.stringify(process.env.NODE_ENV), FIRECAMP_API_HOST: JSON.stringify(process.env.FIRECAMP_API_HOST), FIRECAMP_PROXY_API_HOST: JSON.stringify(process.env.FIRECAMP_PROXY_API_HOST), - FIRECAMP_EXTENSION_AGENT_ID: JSON.stringify(process.env.FIRECAMP_EXTENSION_AGENT_ID), + FIRECAMP_EXTENSION_AGENT_ID: JSON.stringify( + process.env.FIRECAMP_EXTENSION_AGENT_ID + ), APP_VERSION: JSON.stringify(metadata.version), - APP_FORMAT: JSON.stringify(process.env.APP_FORMAT), + AppFormat: JSON.stringify(process.env.AppFormat), SENTRY_DSN: JSON.stringify(process.env.SENTRY_DSN), CRISP_WEBSITE_ID: JSON.stringify(process.env.CRISP_WEBSITE_ID), GOOGLE_OAUTH2_CLIENT_ID: JSON.stringify(process.env.GOOGLE_OAUTH2_CLIENT_ID), @@ -92,7 +96,7 @@ exports.env = { exports.plugins = [ new HtmlWebpackPlugin({ inject: false, - template: path.join(__dirname, './build/dev/app.html'), + template: path.join(__dirname, './build/development/index.html'), }), new NodePolyfillPlugin(), new webpack.ProgressPlugin({ @@ -102,7 +106,7 @@ exports.plugins = [ profile: true, handler: (percentage, message, ...args) => { console.clear(); - console.log((percentage * 100).toFixed() + '%', message, ...args); + console.log(`${(percentage * 100).toFixed()}%`, message, ...args); }, }), new MonacoWebpackPlugin({ diff --git a/webpack.dev.js b/webpack.dev.js index 9f02b2c25..4e60df682 100644 --- a/webpack.dev.js +++ b/webpack.dev.js @@ -15,7 +15,7 @@ module.exports = { devtool: 'eval-cheap-module-source-map', devServer: { //server: 'https', - static: path.join(__dirname, './build/dev'), + static: path.join(__dirname, './build/development'), compress: true, port: 3000, open: true, @@ -36,7 +36,9 @@ module.exports = { new webpack.DefinePlugin({ 'process.env': { ...env, - FIRECAMP_EXTENSION_AGENT_ID: JSON.stringify(process.env.FIRECAMP_EXTENSION_AGENT_ID), + FIRECAMP_EXTENSION_AGENT_ID: JSON.stringify( + process.env.FIRECAMP_EXTENSION_AGENT_ID + ), }, }), // new BundleAnalyzerPlugin(),