Skip to content
Permalink
Browse files

Project structure changes

  • Loading branch information...
yandeu committed May 13, 2019
1 parent 6a272eb commit 77bcaa7a8aedafeb2aac0bd90638dc62eb1be170
@@ -9,4 +9,6 @@ packages/tests/output
/lib
*/client/lib*
*/common/lib*
*/server/lib*
*/server/lib*
bundles/test*
*/.tmp/*
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -4,5 +4,5 @@ module.exports = {
coverageDirectory: 'output/coverage/jest',
preset: 'jest-puppeteer',
coverageReporters: ['text', 'cobertura'],
roots: ['packages/']
roots: ['test/']
}
@@ -18,7 +18,8 @@
"dev": "cd packages/chatApp && npm run dev",
"prettier": "prettier --write 'src/**/*.ts' && prettier --write 'dev/chatApp/**/*.ts'",
"postinstall": "lerna bootstrap --no-ci && npm run build",
"test": "jest --forceExit"
"test": "npm run build-client-bundle && jest --forceExit",
"build-client-bundle": "webpack --config packages/client/webpack/webpack.prod.js --path=../../../test/.tmp --packageVersion=latest"
},
"keywords": [
"realtime",
@@ -38,8 +38,8 @@
},
"scripts": {
"bundle": "npm run bundle:version && npm run bundle:latest",
"bundle:latest": "../../node_modules/.bin/webpack --config webpack/webpack.prod.js --packageVersion=latest",
"bundle:version": "../../node_modules/.bin/webpack --config webpack/webpack.prod.js --packageVersion=${npm_package_version}",
"bundle:version": "../../node_modules/.bin/webpack --config webpack/webpack.prod.js --path=../../../bundles --packageVersion=${npm_package_version}",
"bundle:latest": "../../node_modules/.bin/webpack --config webpack/webpack.prod.js --path=../../../bundles/latest --packageVersion=latest",
"build": "tsc --build tsconfig.json",
"prepublishOnly": "npm run build"
},
@@ -6,9 +6,9 @@ const path = require('path')
module.exports = (env, argv) => {
return {
mode: 'production',
entry: './src/bundle.ts',
entry: path.resolve(__dirname, '../src/bundle.ts'),
output: {
path: path.resolve(__dirname, `../../../bundles/${argv.packageVersion === 'latest' ? 'latest' : 'versions'}`),
path: path.resolve(__dirname, `${argv.path}`),
filename: `geckos.io-client.${argv.packageVersion}.min.js`,
library: 'geckos',
libraryExport: 'default'

This file was deleted.

@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Chat App with geckos.io</title>
<script src="./static/geckos.io-client.latest.min.js"></script>
<script src="test/.tmp/geckos.io-client.latest.min.js"></script>
</head>
<body>
<h1>Simple Chat App with geckos.io</h1>
@@ -1,12 +1,12 @@
const geckos = require('../../server/lib').default
const geckos = require('../packages/server/lib').default
const http = require('http')
const express = require('express')
const path = require('path')
const app = express()
const server = http.createServer(app)
const io = geckos({ iceTransportPolicy: 'relay' })

app.use('/static', express.static(path.join(__dirname, '../../../bundles/latest')))
app.use('/', express.static(path.join(__dirname, '../')))
app.get('/server.html', (req, res) => res.sendFile(path.join(__dirname, 'server.html')))

io.addServer(server)
@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Chat App with geckos.io</title>
<script src="./static/geckos.io-client.latest.min.js"></script>
<script src="test/.tmp/geckos.io-client.latest.min.js"></script>
</head>
<body>
<h1>Simple Chat App with geckos.io</h1>
@@ -1,11 +1,11 @@
const geckos = require('../../server/lib').default
const geckos = require('../packages/server/lib').default
const io = geckos()

const express = require('express')
const path = require('path')
const app = express()

app.use('/static', express.static(path.join(__dirname, '../../../bundles/latest')))
app.use('/', express.static(path.join(__dirname, '../')))
app.get('/simple.html', (req, res) => res.sendFile(path.join(__dirname, 'simple.html')))

app.listen(3033)

0 comments on commit 77bcaa7

Please sign in to comment.
You can’t perform that action at this time.