Skip to content

Commit 1dbbcb1

Browse files
HerveH44ZeldaZach
authored andcommitted
Refactor using Webpack and JSX (#84)
1 parent 16be178 commit 1dbbcb1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+9416
-985
lines changed

.babelrc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"presets": [
3+
"stage-2", "stage-3", "react", ["env", {
4+
"targets": {
5+
"browsers": ["last 2 versions", "safari >= 7"]
6+
}
7+
}]
8+
]
9+
}

.dockerignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
data/*
2+
!data/mws.json
3+
node_modules
4+
public/lib

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ end_of_line = lf
66
insert_final_newline = true
77
trim_trailing_whitespace = true
88

9-
[*.{js,css,js.default}]
9+
[*.{js,jsx,css,js.default}]
1010
indent_size = 2
1111
indent_style = space

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*.swp
22
.DS_Store
33
node_modules
4+
.vscode
45

56
data
67
public/out

Dockerfile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM node:8.4.0-alpine
2+
ENV NPM_CONFIG_LOGLEVEL warn
3+
4+
# Install "git"
5+
RUN apk update \
6+
&& apk add alpine-sdk
7+
8+
# Set working dir as /app
9+
WORKDIR /app
10+
11+
# Add sources to /app
12+
ADD . .
13+
14+
# Install the dependencies
15+
RUN npm install --unsafe-perm
16+
17+
# Publish the port 1337
18+
EXPOSE 1337
19+
20+
# Run the server
21+
ENTRYPOINT [ "npm", "start" ]

Makefile

-51
This file was deleted.

README.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,23 @@
66
It supports all of the features of `drafts.ninja`, and more.
77

88
dr4ft is a NodeJS application.<br>
9-
dr4ft is written in [ES6] and transpiled with [Traceur], and uses [React]
9+
dr4ft is written in [ES6] and transpiled with [Traceur] and [BabelJS], and uses [React]
1010
on the client-side.
1111

1212
Bugs or feature requests? Feel free to [open an issue](https://github.com/dr4fters/dr4ft/issues/new).
1313

1414
# Installation
1515

16-
Install NodeJS, then just run `make run`
16+
Install NodeJS, then just run `npm install && npm start`
1717
in your terminal and visit [http://localhost:1337](http://localhost:1337).
1818

19+
# Docker
20+
21+
If you want, instead of hosting the server on your system, you can create a dr4ft container.
22+
23+
Just download docker and build the container:<br>`docker build -t dr4ftApp .`
24+
25+
Then run it:<br>`docker run -dp 1337:1337 dr4ftApp`<br> and visit [http://localhost:1337](http://localhost:1337).
1926

2027
<br><br>
2128
The project is unaffiliated with Wizards of the Coast,

app.json

-17
This file was deleted.

config.client.js.default

-24
This file was deleted.

config/config.client.js.default

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import React from "react"
2+
3+
export const STRINGS = {
4+
BRANDING: {
5+
SITE_TITLE: ['dr4ft', 'com'].join('.'),
6+
SITE_NAME: <span>DR<img src='4.png' alt='4'/>FT</span>,
7+
DEFAULT_USERNAME: 'dr4fter',
8+
PAYPAL: '',
9+
},
10+
11+
PAGE_SECTIONS: {
12+
MOTD: null, // message of the day; can be a React element
13+
14+
FOOTER:
15+
<div>
16+
<strong>dr4ft</strong>is a fork of
17+
the <code>drafts.ninja</code> arxanas fork of
18+
the <code >draft</code> project by aeosynth.
19+
Contributions welcome! <a href = 'https://github.com/dr4fters/dr4ft'>
20+
https: //github.com/dr4fters/dr4ft</a>
21+
</div>
22+
}
23+
}

config.server.js.default config/config.server.js.default

+8-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22

33
const execSync = require('child_process').execSync
44

5-
let versionInfo = execSync('git describe --always --long')
6-
.toString()
7-
.trim()
5+
var versionInfo = "noVersion"
6+
try {
7+
versionInfo = execSync('git describe --always --long')
8+
.toString().trim()
9+
} catch(err) {
10+
}
11+
812
let versionInfoParts = versionInfo.split('-')
913

1014
const VERSION =
@@ -21,7 +25,7 @@ const VERSION =
2125
: versionInfo
2226

2327
module.exports = {
24-
PORT: 1337,
28+
PORT: process.env.PORT || 1337,
2529
VERSION,
2630
STRINGS: {
2731
BRANDING: {

0 commit comments

Comments
 (0)