Skip to content

Commit 55bae34

Browse files
committed
update for publishing to npm
1 parent 2272885 commit 55bae34

File tree

8 files changed

+189
-35
lines changed

8 files changed

+189
-35
lines changed

.github/workflows/ci.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
name: Continuous Integration
3+
4+
on: [push, pull_request]
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
node-version: [14.x, 16.x]
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Use Node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
- run: npm install
21+
- run: npm run build --if-present
22+
- run: npm test --if-present

.github/workflows/release.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This workflow allows the maintainers to trigger a new release manually
2+
name: Release
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
version-type:
8+
description: How major the changes are [ major | minor | patch | beta | exact_semver ]
9+
required: true
10+
default: patch
11+
12+
jobs:
13+
release:
14+
name: Github and NPM Release
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/setup-node@v2
19+
- name: Configure git credentials
20+
uses: OleksiyRudenko/gha-git-credentials@v2
21+
with:
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
name: ${{ github.actor }}
24+
email: ${{ github.actor }}@users.noreply.github.com
25+
- name: Bump version in package.json and add to CHANGELOG.md
26+
run: npx standard-version --release-as ${{ github.event.inputs.version-type == 'beta' && 'patch' || github.event.inputs.version-type }}
27+
- name: Push Tag to GitHub and Release new NPM version
28+
run: git push --follow-tags origin master && npm publish ${{ contains(github.event.inputs.version-type, 'beta') || '--tag beta' }}
29+
env:
30+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

+114-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,115 @@
1-
node_modules/
1+
## custom additions
2+
3+
# lockfiles because they cause trouble often
24
package-lock.json
3-
lib/
5+
yarn.lock
6+
7+
# compiled js files
8+
lib/
9+
10+
## defaults from github
11+
12+
# Logs
13+
logs
14+
*.log
15+
npm-debug.log*
16+
yarn-debug.log*
17+
yarn-error.log*
18+
lerna-debug.log*
19+
20+
# Diagnostic reports (https://nodejs.org/api/report.html)
21+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
22+
23+
# Runtime data
24+
pids
25+
*.pid
26+
*.seed
27+
*.pid.lock
28+
29+
# Directory for instrumented libs generated by jscoverage/JSCover
30+
lib-cov
31+
32+
# Coverage directory used by tools like istanbul
33+
coverage
34+
*.lcov
35+
36+
# nyc test coverage
37+
.nyc_output
38+
39+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
40+
.grunt
41+
42+
# Bower dependency directory (https://bower.io/)
43+
bower_components
44+
45+
# node-waf configuration
46+
.lock-wscript
47+
48+
# Compiled binary addons (https://nodejs.org/api/addons.html)
49+
build/Release
50+
51+
# Dependency directories
52+
node_modules/
53+
jspm_packages/
54+
55+
# TypeScript v1 declaration files
56+
typings/
57+
58+
# TypeScript cache
59+
*.tsbuildinfo
60+
61+
# Optional npm cache directory
62+
.npm
63+
64+
# Optional eslint cache
65+
.eslintcache
66+
67+
# Microbundle cache
68+
.rpt2_cache/
69+
.rts2_cache_cjs/
70+
.rts2_cache_es/
71+
.rts2_cache_umd/
72+
73+
# Optional REPL history
74+
.node_repl_history
75+
76+
# Output of 'npm pack'
77+
*.tgz
78+
79+
# Yarn Integrity file
80+
.yarn-integrity
81+
82+
# dotenv environment variables file
83+
.env
84+
.env.test
85+
86+
# parcel-bundler cache (https://parceljs.org/)
87+
.cache
88+
89+
# Next.js build output
90+
.next
91+
92+
# Nuxt.js build / generate output
93+
.nuxt
94+
dist
95+
96+
# Gatsby files
97+
.cache/
98+
# Comment in the public line in if your project uses Gatsby and *not* Next.js
99+
# https://nextjs.org/blog/next-9-1#public-directory-support
100+
# public
101+
102+
# vuepress build output
103+
.vuepress/dist
104+
105+
# Serverless directories
106+
.serverless/
107+
108+
# FuseBox cache
109+
.fusebox/
110+
111+
# DynamoDB Local files
112+
.dynamodb/
113+
114+
# TernJS port file
115+
.tern-port

.npmignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# specifically shouldn't be published to npm
2+
.gitignore
3+
.github/
4+
src/

CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4+
5+
## 0.0.0-beta.0 (2021-06-01)
6+
7+
version change back to 0.0.0 for publishing to npm; previous changes:
8+
9+
- initial implementation
10+
- moved proxyServer to [example repo](https://github.com/rob9315/mcproxy-example)
11+
- export connOptions
12+
- change how custom events are handled
13+
- fix typescript related install issues as a library

HISTORY.md

-28
This file was deleted.

package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"name": "mcproxy",
3-
"version": "1.2.2",
3+
"version": "0.0.0-beta.0",
44
"description": "a minecraft proxy library powered by mineflayer",
55
"main": "lib/index.js",
6+
"types": "lib/index.d.ts",
67
"scripts": {
78
"build": "npx tsc",
89
"postinstall": "npm run build"
@@ -20,10 +21,12 @@
2021
"author": "Rob9315",
2122
"license": "GPL-3.0",
2223
"dependencies": {
23-
"@types/node": "^14.14.30",
24-
"typescript": "^4.2.4",
2524
"minecraft-data": "^2.84.0",
2625
"minecraft-protocol": "^1.25.0",
2726
"mineflayer": "^3.6.0"
27+
},
28+
"devDependencies": {
29+
"@types/node": "^14.14.30",
30+
"typescript": "^4.2.4"
2831
}
2932
}

tsconfig.json

-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
"compilerOptions": {
33
"target": "es6",
44
"module": "commonjs",
5-
"sourceMap": true,
65
"declaration": true,
7-
"declarationMap": true,
86
"strict": true,
97
"noImplicitAny": true,
108
"resolveJsonModule": true,

0 commit comments

Comments
 (0)