-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
51188d4
commit d2e74ee
Showing
18 changed files
with
999 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,43 @@ | ||
{ | ||
"name": "playgrodd-core", | ||
"version": "0.0.1", | ||
"main": "./dist/main/index.jsx", | ||
"main": "./dist/main/index.js", | ||
"typings": "./dist/main/index.d.ts", | ||
"module": "./dist/module/index.jsx", | ||
"source": "src/index.ts", | ||
"module": "./dist/module/index.js", | ||
"scripts": { | ||
"build": "run-s clean && run-p build:*", | ||
"build:main": "tsc -p tsconfig.json", | ||
"build:module": "tsc -p tsconfig.module.json", | ||
"fix": "run-s fix:*", | ||
"fix:prettier": "prettier \"src/**/*.{ts,tsx}\" --write", | ||
"fix:tslint": "tslint --fix --project .", | ||
"watch": "run-s clean build:main && run-p \"build:main -- -w\"", | ||
"clean": "trash dist" | ||
}, | ||
"dependencies": { | ||
"@babel/core": "^7.0.0-beta.42", | ||
"babel-loader": "^8.0.0-beta.1", | ||
"babel-polyfill": "^7.0.0-beta.3", | ||
"babel-traverse": "^6.26.0", | ||
"babel-types": "^6.26.0", | ||
"babylon": "^6.18.0", | ||
"connect-history-api-fallback": "^1.5.0", | ||
"del": "^3.0.0", | ||
"fast-glob": "^2.2.0", | ||
"html-webpack-plugin": "^3.1.0", | ||
"mkdirp": "^0.5.1", | ||
"webpack": "^4.2.0", | ||
"webpack-dev-server": "^3.1.1", | ||
"webpack-hot-middleware": "^2.21.2" | ||
}, | ||
"devDependencies": { | ||
"npm-run-all": "^4.1.2", | ||
"prettier": "^1.11.1", | ||
"trash-cli": "^1.4.0", | ||
"tslint": "^5.9.1", | ||
"tslint-config-prettier": "^1.10.0", | ||
"typescript": "^2.7.2" | ||
"@types/babel-traverse": "^6.25.3", | ||
"@types/babylon": "^6.16.2", | ||
"@types/connect-history-api-fallback": "^1.3.1", | ||
"@types/del": "^3.0.0", | ||
"@types/mkdirp": "^0.5.2", | ||
"@types/webpack": "^4.1.2", | ||
"@types/webpack-dev-server": "^2.9.4", | ||
"@types/webpack-hot-middleware": "^2.16.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
export { entriesMapper } from './files-parser' | ||
export { createCompiler } from './create-compiler' | ||
export { devServer } from './dev-server' |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,46 @@ | ||
// /import { Arguments } from 'yargs' | ||
import { Arguments } from 'yargs' | ||
import * as historyApiFallback from 'connect-history-api-fallback' | ||
import * as hotMiddleware from 'webpack-hot-middleware' | ||
import * as WebpackDevServer from 'webpack-dev-server' | ||
|
||
// import { entriesMapper } from './compiler' | ||
// import { createCompiler, devServer } from './compiler' | ||
import { entriesMapper } from './compiler' | ||
import { createCompiler } from './compiler' | ||
import * as paths from './config/paths' | ||
|
||
// import * as Koa from 'koa' | ||
// const historyApiFallback = require('connect-history-api-fallback') | ||
// const devServerMiddleware = require('webpack-dev-middleware') | ||
// const hotMiddleware = require('webpack-hot-middleware') | ||
const PROTOCOL = process.env.HTTPS === 'true' ? 'https' : 'http' | ||
const HOST = process.env.HOST || '0.0.0.0' | ||
|
||
// console.log(Koa) | ||
export const server = async ({ files: pattern }: Arguments) => { | ||
const entries = await entriesMapper(pattern) | ||
const compiler = await createCompiler(entries) | ||
|
||
export const server = ({ files: pattern }: any) => { | ||
// const app = new Koa() | ||
// const entries = await entriesMapper(pattern) | ||
// const compiler = await createCompiler(entries) | ||
// app.use(historyApiFallback()) | ||
// app.use(hotMiddleware(compiler, { log: false, heartbeat: 2000 })) | ||
// app.use(devServerMiddleware(compiler, devServer(compiler))) | ||
// app.listen(3000, () => { | ||
// console.log('Example app listening on port 3000!') | ||
// }) | ||
const app = new WebpackDevServer(compiler, { | ||
compress: true, | ||
clientLogLevel: 'none', | ||
contentBase: paths.DIST, | ||
watchContentBase: true, | ||
publicPath: '/', | ||
hot: true, | ||
quiet: true, | ||
noInfo: true, | ||
https: PROTOCOL === 'https', | ||
host: HOST, | ||
overlay: false, | ||
watchOptions: { | ||
ignored: /node_modules/, | ||
}, | ||
stats: { | ||
colors: true, | ||
chunks: false, | ||
chunkModules: false, | ||
}, | ||
before(app: any) { | ||
app.use(historyApiFallback()) | ||
app.use(hotMiddleware(compiler, { log: false, heartbeat: 2000 })) | ||
}, | ||
}) | ||
|
||
app.listen(3000, () => { | ||
console.log('Example app listening on port 3000!') | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"extends": "../../tslint.json" | ||
"extends": ["../../tslint.json"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"external": ["react", "react-dom", "react-router-dom", "history"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
declare module 'uuid' { | ||
export function v4(): string | ||
} | ||
|
||
declare const __PLAYGRODD_COMPONENTS__: any |
Oops, something went wrong.