Moved /app to /client
@ -3,14 +3,14 @@ import * as React from "react";
|
|||||||
import { Redirect, Route, Switch } from "react-router";
|
import { Redirect, Route, Switch } from "react-router";
|
||||||
import { Container } from "semantic-ui-react";
|
import { Container } from "semantic-ui-react";
|
||||||
|
|
||||||
import { MessagesView, NavBar } from "@app/components";
|
import { MessagesView, NavBar } from "@client/components";
|
||||||
import * as p from "@app/pages";
|
import * as p from "@client/pages";
|
||||||
import * as rp from "@app/routePaths";
|
import * as rp from "@client/routePaths";
|
||||||
|
|
||||||
// tslint:disable:ordered-imports
|
// tslint:disable:ordered-imports
|
||||||
import "font-awesome/css/font-awesome.css";
|
import "font-awesome/css/font-awesome.css";
|
||||||
import "semantic-ui-css/semantic.css";
|
import "semantic-ui-css/semantic.css";
|
||||||
import "@app/styles/app";
|
import "@client/styles/app";
|
||||||
|
|
||||||
function NavContainer() {
|
function NavContainer() {
|
||||||
return (
|
return (
|
@ -3,14 +3,14 @@ import { observer } from "mobx-react";
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Grid, Header, Icon, Item, SemanticICONS } from "semantic-ui-react";
|
import { Grid, Header, Icon, Item, SemanticICONS } from "semantic-ui-react";
|
||||||
|
|
||||||
import * as p from "@app/pages";
|
import * as p from "@client/pages";
|
||||||
import * as rp from "@app/routePaths";
|
import * as rp from "@client/routePaths";
|
||||||
import { AppState, injectState } from "@app/state";
|
import { AppState, injectState } from "@client/state";
|
||||||
import { ConnectionState as ConState } from "@common/sprinklersRpc";
|
import { ConnectionState as ConState } from "@common/sprinklersRpc";
|
||||||
import { Route, RouteComponentProps, withRouter } from "react-router";
|
import { Route, RouteComponentProps, withRouter } from "react-router";
|
||||||
import { ProgramTable, RunSectionForm, SectionRunnerView, SectionTable } from ".";
|
import { ProgramTable, RunSectionForm, SectionRunnerView, SectionTable } from ".";
|
||||||
|
|
||||||
import "@app/styles/DeviceView";
|
import "@client/styles/DeviceView";
|
||||||
|
|
||||||
const ConnectionState = observer(({ connectionState, className }:
|
const ConnectionState = observer(({ connectionState, className }:
|
||||||
{ connectionState: ConState, className?: string }) => {
|
{ connectionState: ConState, className?: string }) => {
|
||||||
@ -72,7 +72,7 @@ class DeviceView extends React.Component<DeviceViewProps & RouteComponentProps<a
|
|||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<Item>
|
<Item>
|
||||||
<Item.Image src={require("@app/images/raspberry_pi.png")} />
|
<Item.Image src={require("@client/images/raspberry_pi.png")} />
|
||||||
<Item.Content className="device">
|
<Item.Content className="device">
|
||||||
<Header as="h1">
|
<Header as="h1">
|
||||||
<div>Device <kbd>{id}</kbd></div>
|
<div>Device <kbd>{id}</kbd></div>
|
@ -2,7 +2,7 @@ import { observer } from "mobx-react";
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Item } from "semantic-ui-react";
|
import { Item } from "semantic-ui-react";
|
||||||
|
|
||||||
import DeviceView from "@app/components/DeviceView";
|
import DeviceView from "@client/components/DeviceView";
|
||||||
import { RouteComponentProps, withRouter } from "react-router";
|
import { RouteComponentProps, withRouter } from "react-router";
|
||||||
|
|
||||||
class DevicesView extends React.Component<{deviceId: string} & RouteComponentProps<any>> {
|
class DevicesView extends React.Component<{deviceId: string} & RouteComponentProps<any>> {
|
@ -4,7 +4,7 @@ import { Form, Input, InputProps } from "semantic-ui-react";
|
|||||||
|
|
||||||
import { Duration } from "@common/Duration";
|
import { Duration } from "@common/Duration";
|
||||||
|
|
||||||
import "@app/styles/DurationView";
|
import "@client/styles/DurationView";
|
||||||
|
|
||||||
export default class DurationView extends React.Component<{
|
export default class DurationView extends React.Component<{
|
||||||
label?: string,
|
label?: string,
|
@ -1,7 +1,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Button, Segment } from "semantic-ui-react";
|
import { Button, Segment } from "semantic-ui-react";
|
||||||
|
|
||||||
import { AppState, injectState } from "@app/state";
|
import { AppState, injectState } from "@client/state";
|
||||||
import { getRandomId } from "@common/utils";
|
import { getRandomId } from "@common/utils";
|
||||||
|
|
||||||
class MessageTest extends React.Component<{ appState: AppState }> {
|
class MessageTest extends React.Component<{ appState: AppState }> {
|
@ -3,9 +3,9 @@ import { observer } from "mobx-react";
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Message, MessageProps, TransitionGroup } from "semantic-ui-react";
|
import { Message, MessageProps, TransitionGroup } from "semantic-ui-react";
|
||||||
|
|
||||||
import { AppState, injectState, UiMessage, UiStore } from "@app/state/";
|
import { AppState, injectState, UiMessage, UiStore } from "@client/state/";
|
||||||
|
|
||||||
import "@app/styles/MessagesView";
|
import "@client/styles/MessagesView";
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
class MessageView extends React.Component<{
|
class MessageView extends React.Component<{
|
@ -3,8 +3,8 @@ import * as React from "react";
|
|||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { Menu } from "semantic-ui-react";
|
import { Menu } from "semantic-ui-react";
|
||||||
|
|
||||||
import * as rp from "@app/routePaths";
|
import * as rp from "@client/routePaths";
|
||||||
import { AppState, ConsumeState, injectState } from "@app/state";
|
import { AppState, ConsumeState, injectState } from "@client/state";
|
||||||
|
|
||||||
interface NavItemProps {
|
interface NavItemProps {
|
||||||
to: string;
|
to: string;
|
@ -4,11 +4,11 @@ import * as React from "react";
|
|||||||
import { SortableContainer, SortableElement, SortableHandle, SortEnd } from "react-sortable-hoc";
|
import { SortableContainer, SortableElement, SortableHandle, SortEnd } from "react-sortable-hoc";
|
||||||
import { Button, Form, Icon, List } from "semantic-ui-react";
|
import { Button, Form, Icon, List } from "semantic-ui-react";
|
||||||
|
|
||||||
import { DurationView, SectionChooser } from "@app/components/index";
|
import { DurationView, SectionChooser } from "@client/components/index";
|
||||||
import { Duration } from "@common/Duration";
|
import { Duration } from "@common/Duration";
|
||||||
import { ProgramItem, Section } from "@common/sprinklersRpc";
|
import { ProgramItem, Section } from "@common/sprinklersRpc";
|
||||||
|
|
||||||
import "@app/styles/ProgramSequenceView";
|
import "@client/styles/ProgramSequenceView";
|
||||||
|
|
||||||
type ItemChangeHandler = (index: number, newItem: ProgramItem) => void;
|
type ItemChangeHandler = (index: number, newItem: ProgramItem) => void;
|
||||||
type ItemRemoveHandler = (index: number) => void;
|
type ItemRemoveHandler = (index: number) => void;
|
@ -4,8 +4,8 @@ import * as React from "react";
|
|||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { Button, ButtonProps, Form, Icon, Table } from "semantic-ui-react";
|
import { Button, ButtonProps, Form, Icon, Table } from "semantic-ui-react";
|
||||||
|
|
||||||
import { ProgramSequenceView, ScheduleView } from "@app/components";
|
import { ProgramSequenceView, ScheduleView } from "@client/components";
|
||||||
import * as rp from "@app/routePaths";
|
import * as rp from "@client/routePaths";
|
||||||
import { Program, SprinklersDevice } from "@common/sprinklersRpc";
|
import { Program, SprinklersDevice } from "@common/sprinklersRpc";
|
||||||
|
|
||||||
@observer
|
@observer
|
@ -2,8 +2,8 @@ import { observer } from "mobx-react";
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Form, Header, Icon, Segment } from "semantic-ui-react";
|
import { Form, Header, Icon, Segment } from "semantic-ui-react";
|
||||||
|
|
||||||
import { DurationView, SectionChooser } from "@app/components";
|
import { DurationView, SectionChooser } from "@client/components";
|
||||||
import { UiStore } from "@app/state";
|
import { UiStore } from "@client/state";
|
||||||
import { Duration } from "@common/Duration";
|
import { Duration } from "@common/Duration";
|
||||||
import log from "@common/logger";
|
import log from "@common/logger";
|
||||||
import { Section, SprinklersDevice } from "@common/sprinklersRpc";
|
import { Section, SprinklersDevice } from "@common/sprinklersRpc";
|
@ -7,7 +7,7 @@ import ScheduleDate from "./ScheduleDate";
|
|||||||
import ScheduleTimes from "./ScheduleTimes";
|
import ScheduleTimes from "./ScheduleTimes";
|
||||||
import WeekdaysView from "./WeekdaysView";
|
import WeekdaysView from "./WeekdaysView";
|
||||||
|
|
||||||
import "@app/styles/ScheduleView";
|
import "@client/styles/ScheduleView";
|
||||||
|
|
||||||
export interface ScheduleViewProps {
|
export interface ScheduleViewProps {
|
||||||
label?: string | React.ReactNode | undefined;
|
label?: string | React.ReactNode | undefined;
|
@ -5,7 +5,7 @@ import { DropdownItemProps, DropdownProps, Form } from "semantic-ui-react";
|
|||||||
|
|
||||||
import { Section } from "@common/sprinklersRpc";
|
import { Section } from "@common/sprinklersRpc";
|
||||||
|
|
||||||
import "@app/styles/SectionChooser";
|
import "@client/styles/SectionChooser";
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
export default class SectionChooser extends React.Component<{
|
export default class SectionChooser extends React.Component<{
|
@ -7,7 +7,7 @@ import { Duration } from "@common/Duration";
|
|||||||
import log from "@common/logger";
|
import log from "@common/logger";
|
||||||
import { Section, SectionRun, SectionRunner } from "@common/sprinklersRpc";
|
import { Section, SectionRun, SectionRunner } from "@common/sprinklersRpc";
|
||||||
|
|
||||||
import "@app/styles/SectionRunnerView";
|
import "@client/styles/SectionRunnerView";
|
||||||
|
|
||||||
interface PausedStateProps {
|
interface PausedStateProps {
|
||||||
paused: boolean;
|
paused: boolean;
|
Before Width: | Height: | Size: 955 B After Width: | Height: | Size: 955 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 216 KiB After Width: | Height: | Size: 216 KiB |
@ -3,8 +3,8 @@ import * as ReactDOM from "react-dom";
|
|||||||
import { AppContainer } from "react-hot-loader";
|
import { AppContainer } from "react-hot-loader";
|
||||||
import { Router } from "react-router-dom";
|
import { Router } from "react-router-dom";
|
||||||
|
|
||||||
import App from "@app/components/App";
|
import App from "@client/components/App";
|
||||||
import { AppState, ProvideState } from "@app/state";
|
import { AppState, ProvideState } from "@client/state";
|
||||||
import logger from "@common/logger";
|
import logger from "@common/logger";
|
||||||
|
|
||||||
const state = new AppState();
|
const state = new AppState();
|
||||||
@ -30,8 +30,8 @@ const doRender = (Component: React.ComponentType) => {
|
|||||||
doRender(App);
|
doRender(App);
|
||||||
|
|
||||||
if (module.hot) {
|
if (module.hot) {
|
||||||
module.hot.accept("@app/components/App", () => {
|
module.hot.accept("@client/components/App", () => {
|
||||||
const NextApp = require<any>("@app/components/App").default as typeof App;
|
const NextApp = require<any>("@client/components/App").default as typeof App;
|
||||||
doRender(NextApp);
|
doRender(NextApp);
|
||||||
});
|
});
|
||||||
}
|
}
|
@ -3,10 +3,10 @@ import { observer } from "mobx-react";
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Container, Dimmer, Form, Header, InputOnChangeData, Loader, Message, Segment } from "semantic-ui-react";
|
import { Container, Dimmer, Form, Header, InputOnChangeData, Loader, Message, Segment } from "semantic-ui-react";
|
||||||
|
|
||||||
import { AppState, injectState } from "@app/state";
|
import { AppState, injectState } from "@client/state";
|
||||||
import log from "@common/logger";
|
import log from "@common/logger";
|
||||||
|
|
||||||
import "@app/styles/LoginPage";
|
import "@client/styles/LoginPage";
|
||||||
|
|
||||||
class LoginPageState {
|
class LoginPageState {
|
||||||
@observable username = "";
|
@observable username = "";
|
@ -1,7 +1,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Redirect } from "react-router";
|
import { Redirect } from "react-router";
|
||||||
|
|
||||||
import { AppState, ConsumeState } from "@app/state";
|
import { AppState, ConsumeState } from "@client/state";
|
||||||
|
|
||||||
export function LogoutPage() {
|
export function LogoutPage() {
|
||||||
function consumeState(appState: AppState) {
|
function consumeState(appState: AppState) {
|
@ -5,9 +5,9 @@ import * as React from "react";
|
|||||||
import { RouteComponentProps } from "react-router";
|
import { RouteComponentProps } from "react-router";
|
||||||
import { Button, CheckboxProps, Form, Icon, Input, InputOnChangeData, Menu, Modal } from "semantic-ui-react";
|
import { Button, CheckboxProps, Form, Icon, Input, InputOnChangeData, Menu, Modal } from "semantic-ui-react";
|
||||||
|
|
||||||
import { ProgramSequenceView, ScheduleView } from "@app/components";
|
import { ProgramSequenceView, ScheduleView } from "@client/components";
|
||||||
import * as rp from "@app/routePaths";
|
import * as rp from "@client/routePaths";
|
||||||
import { AppState, injectState } from "@app/state";
|
import { AppState, injectState } from "@client/state";
|
||||||
import log from "@common/logger";
|
import log from "@common/logger";
|
||||||
import { Program, SprinklersDevice } from "@common/sprinklersRpc";
|
import { Program, SprinklersDevice } from "@common/sprinklersRpc";
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { RouteComponentProps } from "react-router";
|
import { RouteComponentProps } from "react-router";
|
||||||
|
|
||||||
import { DevicesView, MessageTest} from "@app/components";
|
import { DevicesView, MessageTest} from "@client/components";
|
||||||
|
|
||||||
export { LoginPage } from "./LoginPage";
|
export { LoginPage } from "./LoginPage";
|
||||||
export { LogoutPage } from "./LogoutPage";
|
export { LogoutPage } from "./LogoutPage";
|
@ -1,7 +1,7 @@
|
|||||||
import { action, autorun, observable, when } from "mobx";
|
import { action, autorun, observable, when } from "mobx";
|
||||||
import { update } from "serializr";
|
import { update } from "serializr";
|
||||||
|
|
||||||
import { TokenStore } from "@app/state/TokenStore";
|
import { TokenStore } from "@client/state/TokenStore";
|
||||||
import { ErrorCode } from "@common/ErrorCode";
|
import { ErrorCode } from "@common/ErrorCode";
|
||||||
import * as rpc from "@common/jsonRpc";
|
import * as rpc from "@common/jsonRpc";
|
||||||
import logger from "@common/logger";
|
import logger from "@common/logger";
|
@ -2,9 +2,9 @@ import { createBrowserHistory, History } from "history";
|
|||||||
import { computed } from "mobx";
|
import { computed } from "mobx";
|
||||||
import { RouterStore, syncHistoryWithStore } from "mobx-react-router";
|
import { RouterStore, syncHistoryWithStore } from "mobx-react-router";
|
||||||
|
|
||||||
import { WebSocketRpcClient } from "@app/sprinklersRpc/WebSocketRpcClient";
|
import { WebSocketRpcClient } from "@client/sprinklersRpc/WebSocketRpcClient";
|
||||||
import HttpApi from "@app/state/HttpApi";
|
import HttpApi from "@client/state/HttpApi";
|
||||||
import { UiStore } from "@app/state/UiStore";
|
import { UiStore } from "@client/state/UiStore";
|
||||||
import ApiError from "@common/ApiError";
|
import ApiError from "@common/ApiError";
|
||||||
import { ErrorCode } from "@common/ErrorCode";
|
import { ErrorCode } from "@common/ErrorCode";
|
||||||
import log from "@common/logger";
|
import log from "@common/logger";
|
@ -1,4 +1,4 @@
|
|||||||
import { TokenStore } from "@app/state/TokenStore";
|
import { TokenStore } from "@client/state/TokenStore";
|
||||||
import ApiError from "@common/ApiError";
|
import ApiError from "@common/ApiError";
|
||||||
import { ErrorCode } from "@common/ErrorCode";
|
import { ErrorCode } from "@common/ErrorCode";
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
import { observable } from "mobx";
|
import { observable } from "mobx";
|
||||||
|
|
||||||
import HttpApi, { ApiError } from "@app/state/HttpApi";
|
import HttpApi, { ApiError } from "@client/state/HttpApi";
|
||||||
import { Token } from "@app/state/Token";
|
import { Token } from "@client/state/Token";
|
||||||
import { TokenGrantPasswordRequest, TokenGrantRefreshRequest, TokenGrantResponse } from "@common/httpApi";
|
import { TokenGrantPasswordRequest, TokenGrantRefreshRequest, TokenGrantResponse } from "@common/httpApi";
|
||||||
import logger from "@common/logger";
|
import logger from "@common/logger";
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { AppState } from "@app/state";
|
import { AppState } from "@client/state";
|
||||||
|
|
||||||
const StateContext = React.createContext<AppState | null>(null);
|
const StateContext = React.createContext<AppState | null>(null);
|
||||||
|
|
@ -21,8 +21,8 @@
|
|||||||
"@common/*": [
|
"@common/*": [
|
||||||
"./common/*"
|
"./common/*"
|
||||||
],
|
],
|
||||||
"@app/*": [
|
"@client/*": [
|
||||||
"./app/*"
|
"./client/*"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -111,7 +111,7 @@ const rules = (env) => {
|
|||||||
// Process TypeScript with TSC through HappyPack.
|
// Process TypeScript with TSC through HappyPack.
|
||||||
{
|
{
|
||||||
test: /\.tsx?$/, use: "happypack/loader?id=ts",
|
test: /\.tsx?$/, use: "happypack/loader?id=ts",
|
||||||
include: [ paths.appDir, paths.commonDir ],
|
include: [ paths.clientDir, paths.commonDir ],
|
||||||
},
|
},
|
||||||
// "file" loader makes sure those assets get served by WebpackDevServer.
|
// "file" loader makes sure those assets get served by WebpackDevServer.
|
||||||
// When you `import` an asset, you get its (virtual) filename.
|
// When you `import` an asset, you get its (virtual) filename.
|
||||||
@ -147,7 +147,7 @@ const getConfig = module.exports = (env) => {
|
|||||||
const plugins = [
|
const plugins = [
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
inject: true,
|
inject: true,
|
||||||
template: paths.appHtml,
|
template: paths.clientHtml,
|
||||||
minify: isProd ? {
|
minify: isProd ? {
|
||||||
removeComments: true,
|
removeComments: true,
|
||||||
collapseWhitespace: true,
|
collapseWhitespace: true,
|
||||||
@ -161,7 +161,7 @@ const getConfig = module.exports = (env) => {
|
|||||||
minifyURLs: true,
|
minifyURLs: true,
|
||||||
} : undefined,
|
} : undefined,
|
||||||
}),
|
}),
|
||||||
new FaviconsWebpackPlugin(path.resolve(paths.appDir, "images", "favicon-96x96.png")),
|
new FaviconsWebpackPlugin(path.resolve(paths.clientDir, "images", "favicon-96x96.png")),
|
||||||
// Makes some environment variables available to the JS code, for example:
|
// Makes some environment variables available to the JS code, for example:
|
||||||
// if (process.env.NODE_ENV === "production") { ... }. See `./env.js`.
|
// if (process.env.NODE_ENV === "production") { ... }. See `./env.js`.
|
||||||
// It is absolutely essential that NODE_ENV was set to production here.
|
// It is absolutely essential that NODE_ENV was set to production here.
|
||||||
@ -179,14 +179,14 @@ const getConfig = module.exports = (env) => {
|
|||||||
loaders: [{
|
loaders: [{
|
||||||
loader: "ts-loader",
|
loader: "ts-loader",
|
||||||
options: {
|
options: {
|
||||||
configFile: paths.appTsConfig,
|
configFile: paths.clientTsConfig,
|
||||||
happyPackMode: true,
|
happyPackMode: true,
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
}),
|
}),
|
||||||
new ForkTsCheckerWebpackPlugin({
|
new ForkTsCheckerWebpackPlugin({
|
||||||
checkSyntacticErrors: true,
|
checkSyntacticErrors: true,
|
||||||
tsconfig: paths.appTsConfig,
|
tsconfig: paths.clientTsConfig,
|
||||||
tslint: paths.resolveRoot("tslint.json"),
|
tslint: paths.resolveRoot("tslint.json"),
|
||||||
}),
|
}),
|
||||||
isDev && new DashboardPlugin(),
|
isDev && new DashboardPlugin(),
|
||||||
@ -212,10 +212,10 @@ const getConfig = module.exports = (env) => {
|
|||||||
isDev && require.resolve("react-hot-loader/patch"),
|
isDev && require.resolve("react-hot-loader/patch"),
|
||||||
isDev && require.resolve("react-dev-utils/webpackHotDevClient"),
|
isDev && require.resolve("react-dev-utils/webpackHotDevClient"),
|
||||||
require.resolve("./polyfills"),
|
require.resolve("./polyfills"),
|
||||||
paths.appEntry,
|
paths.clientEntry,
|
||||||
].filter(Boolean),
|
].filter(Boolean),
|
||||||
output: {
|
output: {
|
||||||
path: paths.appBuildDir,
|
path: paths.clientBuildDir,
|
||||||
pathinfo: isDev,
|
pathinfo: isDev,
|
||||||
filename: isProd ?
|
filename: isProd ?
|
||||||
'static/js/[name].[chunkhash:8].js' :
|
'static/js/[name].[chunkhash:8].js' :
|
||||||
@ -231,7 +231,7 @@ const getConfig = module.exports = (env) => {
|
|||||||
resolve: {
|
resolve: {
|
||||||
extensions: [".ts", ".tsx", ".js", ".json", ".scss"],
|
extensions: [".ts", ".tsx", ".js", ".json", ".scss"],
|
||||||
alias: {
|
alias: {
|
||||||
"@app": paths.appDir,
|
"@client": paths.clientDir,
|
||||||
"@common": paths.commonDir,
|
"@common": paths.commonDir,
|
||||||
}
|
}
|
||||||
},
|
},
|
@ -24,12 +24,12 @@ exports.publicPath = ensureSlash(url.parse(exports.publicUrl).pathname || "/", t
|
|||||||
|
|
||||||
exports.commonDir = resolveRoot("common");
|
exports.commonDir = resolveRoot("common");
|
||||||
|
|
||||||
exports.appDir = resolveRoot("app");
|
exports.clientDir = resolveRoot("client");
|
||||||
exports.appEntry = path.resolve(exports.appDir, "index.tsx");
|
exports.clientEntry = path.resolve(exports.clientDir, "index.tsx");
|
||||||
exports.appHtml = path.resolve(exports.appDir, "index.html");
|
exports.clientHtml = path.resolve(exports.clientDir, "index.html");
|
||||||
exports.appWebpackConfig = path.resolve(exports.appDir, "webpack.config.js");
|
exports.clientWebpackConfig = path.resolve(exports.clientDir, "webpack.config.js");
|
||||||
exports.appTsConfig = path.resolve(exports.appDir, "tsconfig.json");
|
exports.clientTsConfig = path.resolve(exports.clientDir, "tsconfig.json");
|
||||||
exports.appBuildDir = resolveRoot("public");
|
exports.clientBuildDir = resolveRoot("public");
|
||||||
exports.publicDir = exports.appBuildDir;
|
exports.publicDir = exports.appBuildDir;
|
||||||
|
|
||||||
exports.serverDir = resolveRoot("server");
|
exports.serverDir = resolveRoot("server");
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
"@common/*": [
|
"@common/*": [
|
||||||
"./common/*"
|
"./common/*"
|
||||||
],
|
],
|
||||||
"@app/*": [
|
"@client/*": [
|
||||||
"./app/*"
|
"./client/*"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -11,7 +11,7 @@ services:
|
|||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
- "8081:8081"
|
- "8081:8081"
|
||||||
volumes:
|
volumes:
|
||||||
- ./app:/app/app
|
- ./client:/app/client
|
||||||
- ./common:/app/common
|
- ./common:/app/common
|
||||||
- ./server:/app/server
|
- ./server:/app/server
|
||||||
env_file:
|
env_file:
|
||||||
|
@ -6,18 +6,18 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"clean": "rm -rf ./dist ./build ./public",
|
"clean": "rm -rf ./dist ./build ./public",
|
||||||
"build:app": "NODE_ENV=production webpack --config ./app/webpack.config.js --env prod",
|
"build:client": "NODE_ENV=production webpack --config ./client/webpack.config.js --env prod",
|
||||||
"build:server": "tsc --project server",
|
"build:server": "tsc --project server",
|
||||||
"build": "run-p build:*",
|
"build": "run-p build:*",
|
||||||
"watch:app": "yarn build:app --watch",
|
"watch:client": "yarn build:client --watch",
|
||||||
"watch:server": "yarn build:server --watch",
|
"watch:server": "yarn build:server --watch",
|
||||||
"start:dev-server": "NODE_ENV=development webpack-dev-server --config ./app/webpack.config.js --env dev",
|
"start:dev-server": "NODE_ENV=development webpack-dev-server --config ./client/webpack.config.js --env dev",
|
||||||
"start": "NODE_ENV=development node dist/server/index.js",
|
"start": "NODE_ENV=development node dist/server/index.js",
|
||||||
"start:pretty": "yarn start | node dist/server/logging/prettyPrint.js",
|
"start:pretty": "yarn start | node dist/server/logging/prettyPrint.js",
|
||||||
"start:nodemon": "nodemon --delay 0.5 --exec \"env NODE_ENV=development node dist/server/index.js | node dist/server/logging/prettyPrint.js\"",
|
"start:nodemon": "nodemon --delay 0.5 --exec \"env NODE_ENV=development node dist/server/index.js | node dist/server/logging/prettyPrint.js\"",
|
||||||
"start:watch": "run-p watch:server start:nodemon",
|
"start:watch": "run-p watch:server start:nodemon",
|
||||||
"start:dev": "run-p start:dev-server start:watch",
|
"start:dev": "run-p start:dev-server start:watch",
|
||||||
"lint:app": "tslint --project app --force --format verbose",
|
"lint:client": "tslint --project client --force --format verbose",
|
||||||
"lint:server": "tslint --project server --force --format verbose",
|
"lint:server": "tslint --project server --force --format verbose",
|
||||||
"lint": "run-p lint:*"
|
"lint": "run-p lint:*"
|
||||||
},
|
},
|
||||||
|
@ -7,7 +7,7 @@ import * as paths from "@common/paths";
|
|||||||
const index = path.join(paths.publicDir, "index.html");
|
const index = path.join(paths.publicDir, "index.html");
|
||||||
|
|
||||||
export default function serveApp(app: Express) {
|
export default function serveApp(app: Express) {
|
||||||
app.use(serveStatic(paths.appBuildDir));
|
app.use(serveStatic(paths.clientBuildDir));
|
||||||
app.get("/*", (req, res) => {
|
app.get("/*", (req, res) => {
|
||||||
res.sendFile(index);
|
res.sendFile(index);
|
||||||
});
|
});
|
||||||
|
@ -21,8 +21,8 @@
|
|||||||
"@common/*": [
|
"@common/*": [
|
||||||
"./common/*"
|
"./common/*"
|
||||||
],
|
],
|
||||||
"@app/*": [
|
"@client/*": [
|
||||||
"./app/*"
|
"./client/*"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|