diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..10442d12c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,32 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: possible bug +assignees: '' + +--- + +- [ ] The [readme](https://github.com/PrismarineJS/prismarine-template/README.md) doesn't contain a resolution to my issue +- [ ] The [example](https://github.com/PrismarineJS/prismarine-template/example.js) doesn't contain a resolution to my issue + + + +## Versions + - node: #.#.# + - prismarine-template: #.#.# + +## Detailed description of a problem +A clear and concise description of what the problem is. + +## Your current code +```js +console.log("Hello world.") +``` + +## Expected behavior +A clear and concise description of what you expected to happen. + +## Additional context +Add any other context about the problem here. +--- diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000..61ba3ab52 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: new feature +assignees: '' + +--- + +## Is your feature request related to a problem? Please describe. +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +## Describe the solution you'd like +A clear and concise description of what you want to happen. + +## Describe alternatives you've considered +A clear and concise description of any alternative solutions or features you've considered. + +## Additional context +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md new file mode 100644 index 000000000..67191ee99 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.md @@ -0,0 +1,46 @@ +--- +name: Question +about: Ask a question +title: '' +labels: question +assignees: '' + +--- + +- [ ] The [readme](https://github.com/PrismarineJS/prismarine-template/README.md) doesn't contain a resolution to my issue +- [ ] The [example](https://github.com/PrismarineJS/prismarine-template/example.js) doesn't contain a resolution to my issue + + + + +## Versions + + - mineflayer: #.#.# + - server: vanilla/spigot/paper #.#.# + - node: #.#.# + +## Clear question + +A clear question, with as much context as possible. +What are you building? What problem are you trying to solve? + +## What did you try yet? + +Did you try any method from the API? +Did you try any example? Any error from those? + +## Your current code + +Please put here any custom code you tried yet. + +```js + +/* +Some code here, replace this +*/ + +``` + +## Additional context + +Add any other context about the problem here. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..e8525e857 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm test \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..387db4010 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +name: npm-publish +on: + push: + branches: + - master # Change this to your default branch +jobs: + npm-publish: + name: npm-publish + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@master + - name: Set up Node.js + uses: actions/setup-node@master + with: + node-version: 14.0.0 + - id: publish + uses: JS-DevTools/npm-publish@v1 + with: + token: ${{ secrets.NPM_AUTH_TOKEN }} + - name: Create Release + if: steps.publish.outputs.type != 'none' + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.publish.outputs.version }} + release_name: Release ${{ steps.publish.outputs.version }} + body: ${{ steps.publish.outputs.version }} + draft: false + prerelease: false \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..3ff87f131 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +node_modules/ +package-lock.json +.vscode \ No newline at end of file diff --git a/.gitpod b/.gitpod new file mode 100644 index 000000000..061cf30ea --- /dev/null +++ b/.gitpod @@ -0,0 +1,4 @@ +image: + file: .gitpod.DockerFile +tasks: +- command: npm install diff --git a/.gitpod.DockerFile b/.gitpod.DockerFile new file mode 100644 index 000000000..061bf5962 --- /dev/null +++ b/.gitpod.DockerFile @@ -0,0 +1,8 @@ +FROM gitpod/workspace-full:latest + +RUN bash -c ". .nvm/nvm.sh \ + && nvm install 14 \ + && nvm use 14 \ + && nvm alias default 14" + +RUN echo "nvm use default &>/dev/null" >> ~/.bashrc.d/51-nvm-fix \ No newline at end of file diff --git a/.npmrc b/.npmrc new file mode 100644 index 000000000..43c97e719 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/HISTORY.md b/HISTORY.md new file mode 100644 index 000000000..a2f2d69ce --- /dev/null +++ b/HISTORY.md @@ -0,0 +1,5 @@ +## History + +### 1.0.0 + +* initial implementation diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..ee939a657 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 PrismarineJS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 000000000..320d7c467 --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# prismarine-template +[![NPM version](https://img.shields.io/npm/v/prismarine-template.svg)](http://npmjs.com/package/prismarine-template) +[![Build Status](https://github.com/PrismarineJS/prismarine-template/workflows/CI/badge.svg)](https://github.com/PrismarineJS/prismarine-template/actions?query=workflow%3A%22CI%22) +[![Discord](https://img.shields.io/badge/chat-on%20discord-brightgreen.svg)](https://discord.gg/GsEFRM8) +[![Gitter](https://img.shields.io/badge/chat-on%20gitter-brightgreen.svg)](https://gitter.im/PrismarineJS/general) +[![Irc](https://img.shields.io/badge/chat-on%20irc-brightgreen.svg)](https://irc.gitter.im/) +[![Try it on gitpod](https://img.shields.io/badge/try-on%20gitpod-brightgreen.svg)](https://gitpod.io/#https://github.com/PrismarineJS/prismarine-template) + +A template repository to make it easy to create new prismarine repo + +## Usage + +```js +const template = require('prismarine-template') + +template.helloWorld() +``` + +## API + +### helloWorld() + +Prints hello world diff --git a/example.js b/example.js new file mode 100644 index 000000000..ceadd46e3 --- /dev/null +++ b/example.js @@ -0,0 +1,3 @@ +const template = require('prismarine-template') + +template.helloWorld() diff --git a/index.js b/index.js new file mode 100644 index 000000000..4bd4c7509 --- /dev/null +++ b/index.js @@ -0,0 +1,9 @@ +if (typeof process !== 'undefined' && parseInt(process.versions.node.split('.')[0]) < 14) { + console.error('Your node version is currently', process.versions.node) + console.error('Please update it to a version >= 14.x.x from https://nodejs.org/') + process.exit(1) +} + +module.exports.helloWorld = function () { + console.log('Hello world !') +} diff --git a/package.json b/package.json new file mode 100644 index 000000000..3f1a05d8b --- /dev/null +++ b/package.json @@ -0,0 +1,31 @@ +{ + "name": "prismarine-template", + "version": "1.0.0", + "description": "A template repository to make it easy to create new prismarine repo", + "main": "index.js", + "scripts": { + "test": "jest --verbose", + "pretest": "npm run lint", + "lint": "standard", + "fix": "standard --fix" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/PrismarineJS/prismarine-template.git" + }, + "keywords": [ + "prismarine", + "template" + ], + "author": "Romain Beaumont", + "license": "MIT", + "bugs": { + "url": "https://github.com/PrismarineJS/prismarine-template/issues" + }, + "homepage": "https://github.com/PrismarineJS/prismarine-template#readme", + "devDependencies": { + "jest": "^26.1.0", + "prismarine-template": "file:.", + "standard": "^16.0.1" + } +} diff --git a/test/basic.test.js b/test/basic.test.js new file mode 100644 index 000000000..968ec21f8 --- /dev/null +++ b/test/basic.test.js @@ -0,0 +1,7 @@ +/* eslint-env jest */ + +describe('basic', () => { + test('test', () => { + + }) +})