From d186c09a0b3cb93ea4f19d857146d98e0887ea50 Mon Sep 17 00:00:00 2001 From: Romain Beaumont Date: Sat, 27 Feb 2021 22:27:59 +0100 Subject: [PATCH] Initial commit --- .github/ISSUE_TEMPLATE/bug_report.md | 32 ++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++ .github/ISSUE_TEMPLATE/question.md | 46 +++++++++++++++++++++++ .github/workflows/ci.yml | 25 ++++++++++++ .github/workflows/publish.yml | 32 ++++++++++++++++ .gitignore | 3 ++ .gitpod | 4 ++ .gitpod.DockerFile | 8 ++++ .npmrc | 1 + HISTORY.md | 5 +++ LICENSE | 21 +++++++++++ README.md | 23 ++++++++++++ example.js | 3 ++ index.js | 9 +++++ package.json | 31 +++++++++++++++ test/basic.test.js | 7 ++++ 16 files changed, 270 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/question.md create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/publish.yml create mode 100644 .gitignore create mode 100644 .gitpod create mode 100644 .gitpod.DockerFile create mode 100644 .npmrc create mode 100644 HISTORY.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 example.js create mode 100644 index.js create mode 100644 package.json create mode 100644 test/basic.test.js diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..10442d1 --- /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 0000000..61ba3ab --- /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 0000000..67191ee --- /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 0000000..e8525e8 --- /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 0000000..387db40 --- /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 0000000..3ff87f1 --- /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 0000000..061cf30 --- /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 0000000..061bf59 --- /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 0000000..43c97e7 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/HISTORY.md b/HISTORY.md new file mode 100644 index 0000000..a2f2d69 --- /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 0000000..ee939a6 --- /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 0000000..320d7c4 --- /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 0000000..ceadd46 --- /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 0000000..4bd4c75 --- /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 0000000..3f1a05d --- /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 0000000..968ec21 --- /dev/null +++ b/test/basic.test.js @@ -0,0 +1,7 @@ +/* eslint-env jest */ + +describe('basic', () => { + test('test', () => { + + }) +})