chore: basic init

pull/13/head
moonrailgun 4 years ago
parent ee410ce9e7
commit b41556ef96

@ -0,0 +1,9 @@
{
"name": "pawchat-app",
"version": "1.0.0",
"main": "index.js",
"repository": "https://github.com/pawchat/pawchat.git",
"author": "moonrailgun <moonrailgun@gmail.com>",
"license": "GPLv3",
"private": true
}

@ -2,22 +2,13 @@
"name": "pawchat",
"version": "1.0.0",
"main": "index.js",
"workspaces": [
"web",
"shared",
"app"
],
"repository": "https://github.com/pawchat/pawchat.git",
"author": "moonrailgun <moonrailgun@gmail.com>",
"license": "GPLv3",
"private": true,
"scripts": {
"test": "ts-node test/client.ts"
},
"dependencies": {
"node-fetch": "^2.6.1",
"socket.io-client": "^4.1.2"
},
"devDependencies": {
"@types/node": "^15.12.2",
"@types/node-fetch": "^2.5.10",
"snowpack": "^3.5.9",
"ts-node": "^10.0.0",
"typescript": "^4.3.3"
}
"private": true
}

@ -0,0 +1,9 @@
{
"name": "pawchat-shared",
"version": "1.0.0",
"main": "index.js",
"repository": "https://github.com/pawchat/pawchat.git",
"author": "moonrailgun <moonrailgun@gmail.com>",
"license": "GPLv3",
"private": true
}

3265
web/package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,25 @@
{
"name": "pawchat-web",
"version": "1.0.0",
"main": "index.js",
"repository": "https://github.com/pawchat/pawchat.git",
"author": "moonrailgun <moonrailgun@gmail.com>",
"license": "GPLv3",
"private": true,
"scripts": {
"build": "webpack"
},
"dependencies": {
"socket.io-client": "^4.1.2"
},
"devDependencies": {
"@types/node": "^15.12.5",
"@types/webpack": "^5.28.0",
"esbuild-loader": "^2.13.1",
"ts-node": "^10.0.0",
"typescript": "^4.3.4",
"webpack": "^5.41.0",
"webpack-cli": "^4.7.2",
"webpack-dev-server": "^3.11.2"
}
}

@ -0,0 +1 @@
console.log('Hello World');

@ -14,8 +14,6 @@ function createIO(authToken: string) {
// client-side
socket.on('connect', () => {
console.log('socket.id:', socket.id); // x8WIv7-mJelg7on_ALbx
socket.emit(
'debug.echo',
{
@ -59,6 +57,7 @@ fetch('http://127.0.0.1:11000/api/user/login', {
})
.then((res: any) => res.json())
.then((data: any) => {
console.log('data', data);
const token = data.user.token;
createIO(token);
});

@ -0,0 +1,9 @@
{
"compilerOptions": {
"target": "esnext",
"moduleResolution": "node",
"esModuleInterop": true,
"lib": ["DOM"],
"typeRoots": ["./node_modules/@types", "./types"]
}
}

@ -0,0 +1,35 @@
/**
* Reference: https://webpack.js.org/configuration/configuration-languages/
*/
import { Configuration } from 'webpack';
import path from 'path';
const ROOT_PATH = path.resolve(__dirname, './');
const DIST_PATH = path.resolve(ROOT_PATH, './dist');
const ASSET_PATH = process.env.ASSET_PATH || '/';
const config: Configuration = {
entry: {
app: './src/index.tsx',
},
output: {
path: DIST_PATH,
filename: '[name].[contenthash].js',
publicPath: ASSET_PATH,
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'esbuild-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
};
export default config;

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save