Skip to content

Commit

Permalink
Merge pull request #4 from floodfx/packages
Browse files Browse the repository at this point in the history
Packages
  • Loading branch information
floodfx authored Jan 24, 2022
2 parents 56f13be + 68400ab commit 28b7bbb
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 145 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules
.cache/
.env
dist/
.parcel-cache/
.parcel-cache/
.DS_Store
12 changes: 12 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.parcel-cache/
.vscode/
coverage/
node_modules/
.editorconfig
.eslintrc.js
.gitignore
.gitattributes
.npmignore
jest.config.js
package-lock.json
tsconfig.json
32 changes: 14 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,24 @@
"source": "src/client/liveview.ts",
"context": "browser",
"distDir": "dist/client"
},
"framework": {
"source": "src/server/index.ts",
"context": "node",
"isLibrary": true,
"distDir": "dist/framework"
},
"examples": {
"source": "src/examples/index.ts",
"context": "node",
"distDir": "dist/examples"
}
},
"source": "src/server/index.ts",
"types": "dist/types/index.d.ts",
"main": "dist/server/index.js",
"types": "dist/server/index.d.ts",
"files": [
"dist/server/**/*.js",
"dist/server/**/*.d.ts"
],
"scripts": {
"examples": "nodemon -e js -w dist dist/examples/index.js",
"preexamples": "npm run build",
"build": "rm -rf dist; npm run check; parcel build",
"watch": "parcel watch",
"examples": "npm run prepublish; npm run client-build;nodemon -e js -w dist dist/examples/index.js",
"build": "tsc",
"watch": "tsc --watch",
"client-build": "npm run check; parcel build",
"client-watch": "parcel watch",
"check": "tsc --noEmit",
"test": "jest --expand"
"clean": "rm -rf dist",
"test": "jest --expand",
"prepublish": "npm run clean; npm run build"
},
"keywords": ["liveviewjs","liveview", "phoenix", "typescript", "javascript", "framework"],
"author": "Donnie Flood <[email protected]>",
Expand Down
4 changes: 3 additions & 1 deletion src/server/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export * from "./live_view_server";
export * from "./live_view_server";
export * from "./types";
export * from "./templates";
32 changes: 0 additions & 32 deletions src/server/socket/message_router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,8 @@ import http, { Server, createServer } from 'http';
// import { router } from '../live/router';
import { URLSearchParams } from 'url';
import { LiveViewComponent } from '../types';
import { app } from '../web/index';
import { LiveViewRouter } from '../types';



// const server = new Server();
// const wsServer = new WebSocket.Server({
// server
// });

// // listen for http requests
// server.on('request', app);

// const topicToPath: { [key: string]: string } = {}

// wsServer.on('connection', socket => {
// // console.log("socket connected", socket);

// socket.on('message', message => {

// onMessage(socket, message);

// });
// });


export function onMessage(ws: WebSocket, message: WebSocket.RawData, topicToPath: { [key: string]: string }, router: LiveViewRouter) {

console.log("message", String(message));
Expand Down Expand Up @@ -307,11 +283,3 @@ export function sendInternalMessage(socket: PhxSocket, component: LiveViewCompon
}
});
}

// export { wsServer };

// const port: number = 3002

// server.listen(port, function () {
// console.log(`App is listening on port ${port} !`)
// })
93 changes: 0 additions & 93 deletions src/server/web/index.ts

This file was deleted.

0 comments on commit 28b7bbb

Please sign in to comment.