From 1962a878b0446bea8edd99ffce524f51d74c3822 Mon Sep 17 00:00:00 2001 From: Romain Beaumont Date: Sat, 27 Feb 2021 22:28:08 +0000 Subject: [PATCH] fix package.json --- .github/workflows/publish.yml | 1 + .npmignore | 3 +++ package.json | 44 ++++++++++++++++++++++++----------- server.js | 2 ++ webpack.config.js | 10 ++++---- 5 files changed, 42 insertions(+), 18 deletions(-) create mode 100644 .npmignore diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 387db4010..95c3355e2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,6 +14,7 @@ jobs: uses: actions/setup-node@master with: node-version: 14.0.0 + - run: npm install - id: publish uses: JS-DevTools/npm-publish@v1 with: diff --git a/.npmignore b/.npmignore new file mode 100644 index 000000000..3ff87f131 --- /dev/null +++ b/.npmignore @@ -0,0 +1,3 @@ +node_modules/ +package-lock.json +.vscode \ No newline at end of file diff --git a/package.json b/package.json index 50f0e3a1c..fd15d0974 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,7 @@ { - "name": "web_client", - "private": true, + "name": "prismarine-web-client", "version": "1.0.0", - "description": "web_client", + "description": "A minecraft client running in a browser", "main": "index.js", "scripts": { "prepare": "webpack", @@ -13,38 +12,57 @@ "fix": "standard --fix", "test": "npm run lint && mocha" }, + "repository": { + "type": "git", + "url": "git+https://github.com/PrismarineJS/prismarine-web-client.git" + }, + "keywords": [ + "prismarine", + "web", + "client" + ], + "author": "Romain Beaumont", + "license": "MIT", + "bin": { + "prismarine-web-client": "./server.js" + }, + "bugs": { + "url": "https://github.com/PrismarineJS/prismarine-web-client/issues" + }, + "homepage": "https://github.com/PrismarineJS/prismarine-web-client#readme", "dependencies": { + "body-parser": "^1.19.0", + "express": "^4.17.1", + "net-browserify": "^0.2.4", + "request": "^2.88.2", + "compression": "^1.7.4" + }, + "devDependencies": { "assert": "^2.0.0", "browserify-zlib": "^0.2.0", "buffer": "^6.0.3", "clean-webpack-plugin": "^3.0.0", - "compression": "^1.7.4", "constants-browserify": "^1.0.0", "copy-webpack-plugin": "^7.0.0", "crypto-browserify": "^3.12.0", "events": "^3.2.0", - "express": "^4.17.1", "http-browserify": "^1.7.0", + "http-server": "^0.12.3", "https-browserify": "^1.0.0", + "lodash-webpack-plugin": "^0.11.6", "memfs": "^3.2.0", "mineflayer": "^2.39.2", - "net-browserify": "^0.2.4", + "mocha": "^8.3.0", "os-browserify": "^0.3.0", "path-browserify": "^1.0.1", "prismarine-viewer": "^1.14.0", "process": "^0.11.10", - "request": "^2.88.2", + "standard": "^16.0.3", "stream-browserify": "^3.0.0", "three": "^0.124.0", "timers-browserify": "^2.0.12", "webpack": "^5.11.0", "webpack-cli": "^4.2.0", "webpack-dev-server": "^3.11.0" - }, - "devDependencies": { - "http-server": "^0.12.3", - "lodash-webpack-plugin": "^0.11.6", - "mocha": "^8.3.0", - "standard": "^16.0.3" } } diff --git a/server.js b/server.js index 0163072c5..929ed653f 100644 --- a/server.js +++ b/server.js @@ -1,3 +1,5 @@ +#!/usr/bin/env node + const express = require('express') const netApi = require('net-browserify') const bodyParser = require('body-parser') diff --git a/webpack.config.js b/webpack.config.js index 12b1fa2b4..1fc85d01c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -57,11 +57,11 @@ const config = { ), new CopyPlugin({ patterns: [ - { from: 'index.html', to: './index.html' }, - { from: 'node_modules/prismarine-viewer/public/blocksStates/', to: './blocksStates/' }, - { from: 'node_modules/prismarine-viewer/public/textures/', to: './textures/' }, - { from: 'node_modules/prismarine-viewer/public/worker.js', to: './' }, - { from: 'node_modules/prismarine-viewer/public/supportedVersions.json', to: './' } + { from: path.join(__dirname, '/index.html'), to: './index.html' }, + { from: path.join(__dirname, '/node_modules/prismarine-viewer/public/blocksStates/'), to: './blocksStates/' }, + { from: path.join(__dirname, '/node_modules/prismarine-viewer/public/textures/'), to: './textures/' }, + { from: path.join(__dirname, '/node_modules/prismarine-viewer/public/worker.js'), to: './' }, + { from: path.join(__dirname, '/node_modules/prismarine-viewer/public/supportedVersions.json'), to: './' } ] }), new webpack.optimize.ModuleConcatenationPlugin(),