Skip to content

Commit 971a74e

Browse files
committed
iluwatar#509: Component Object Pattern
1 parent 987994f commit 971a74e

33 files changed

+4407
-1
lines changed

component-object/pom.xml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3+
<modelVersion>4.0.0</modelVersion>
4+
<parent>
5+
<groupId>com.iluwatar</groupId>
6+
<artifactId>java-design-patterns</artifactId>
7+
<version>1.20.0-SNAPSHOT</version>
8+
</parent>
9+
<artifactId>component-object</artifactId>
10+
<dependencies>
11+
<dependency>
12+
<groupId>org.springframework.boot</groupId>
13+
<artifactId>spring-boot-starter-web</artifactId>
14+
<scope>compile</scope>
15+
<exclusions>
16+
<exclusion>
17+
<artifactId>commons-logging</artifactId>
18+
<groupId>commons-logging</groupId>
19+
</exclusion>
20+
</exclusions>
21+
</dependency>
22+
<dependency>
23+
<groupId>org.springframework.boot</groupId>
24+
<artifactId>spring-boot-starter-test</artifactId>
25+
<scope>test</scope>
26+
</dependency>
27+
<dependency>
28+
<groupId>io.github.bonigarcia</groupId>
29+
<artifactId>webdrivermanager</artifactId>
30+
<version>1.4.6</version>
31+
<scope>test</scope>
32+
</dependency>
33+
</dependencies>
34+
<dependencyManagement>
35+
<dependencies>
36+
<dependency>
37+
<groupId>org.springframework.boot</groupId>
38+
<artifactId>spring-boot-starter-parent</artifactId>
39+
<version>1.4.1.RELEASE</version>
40+
<scope>import</scope>
41+
<type>pom</type>
42+
</dependency>
43+
</dependencies>
44+
</dependencyManagement>
45+
</project>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.iluwatar.component.app;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
6+
@SpringBootApplication
7+
public class TodoApp {
8+
9+
public static void main(String[] args) {
10+
SpringApplication.run(TodoApp.class, args);
11+
}
12+
}

component-object/src/main/resources/application.properties

Whitespace-only changes.

component-object/src/main/resources/static/dist/bundle.js

Lines changed: 3380 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Todos</title>
5+
</head>
6+
<body>
7+
<div id="root">
8+
</div>
9+
<script src="dist/bundle.js"></script>
10+
</body>
11+
</html>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"presets": ["es2015", "react"],
3+
"plugins": ["transform-object-rest-spread"]
4+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "airbnb",
3+
"parserOptions": {
4+
"ecmaFeatures": {
5+
"experimentalObjectRestSpread": true
6+
},
7+
},
8+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.DS_Store
2+
*.log
3+
dist
4+
node_modules
5+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import path from 'path';
2+
import webpack from 'webpack';
3+
import webpackDevMiddleware from 'webpack-dev-middleware';
4+
import config from './webpack.config.babel';
5+
import Express from 'express';
6+
7+
const app = new Express();
8+
const port = 3000;
9+
10+
const compiler = webpack(config);
11+
app.use(webpackDevMiddleware(compiler, {
12+
noInfo: true,
13+
publicPath: config.output.publicPath,
14+
}));
15+
16+
app.get('/', (req, res) => {
17+
res.sendFile(path.join(__dirname, 'index.html'));
18+
});
19+
20+
app.listen(port, error => {
21+
/* eslint-disable no-console */
22+
if (error) {
23+
console.error(error);
24+
} else {
25+
console.info(
26+
'🌎 Listening on port %s. Open up http://localhost:%s/ in your browser.',
27+
port,
28+
port
29+
);
30+
}
31+
/* eslint-enable no-console */
32+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Todos</title>
5+
</head>
6+
<body>
7+
<div id="root">
8+
</div>
9+
<script src="/static/bundle.js"></script>
10+
</body>
11+
</html>

0 commit comments

Comments
 (0)