From 9303967f9010193976e8bdf0ef55f85e6e8d5468 Mon Sep 17 00:00:00 2001 From: Raiondesu Date: Mon, 11 Nov 2019 22:53:49 +0300 Subject: [PATCH] Add * - initial commit - based on eventhoven --- .coveralls.yml | 1 + .editorconfig | 9 + .github/CODE_OF_CONDUCT.md | 76 ++++ .github/CONTRIBUTING.md | 17 + .github/ISSUE_TEMPLATE/bug_report.md | 36 ++ .github/ISSUE_TEMPLATE/feature_request.md | 20 + .../question-support-request.md | 13 + .github/PULL_REQUEST_TEMPLATE.md | 65 ++++ .gitignore | 3 + .travis.yml | 16 + LICENSE | 21 ++ README.md | 17 + README.template.md | 20 + bili.config.ts | 15 + init/index.js | 32 ++ package-lock.json | 354 ++++++++++++++++++ package.json | 82 ++++ src/index.ts | 1 + tsconfig.json | 42 +++ tslint.json | 3 + 20 files changed, 843 insertions(+) create mode 100644 .coveralls.yml create mode 100644 .editorconfig create mode 100644 .github/CODE_OF_CONDUCT.md create mode 100644 .github/CONTRIBUTING.md 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-support-request.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 LICENSE create mode 100644 README.md create mode 100644 README.template.md create mode 100644 bili.config.ts create mode 100644 init/index.js create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 src/index.ts create mode 100644 tsconfig.json create mode 100644 tslint.json diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 0000000..cf27a37 --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1 @@ +service_name: travis-pro diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..9f73416 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..ccdf736 --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at a.raiondesu@gmail.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..0ae70f8 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,17 @@ +# Contributing to `{{package-name}}` + +Please note - we have a [code of conduct](./CODE_OF_CONDUCT.md), +please follow it in all your interactions with the project. + +1. [Start with an issue](https://github.com/{{owner}}/{{package-name}}/issues/new/choose).\ + If there's a bug or a feature request, feel free to [create an issue](https://github.com/{{owner}}/{{package-name}}/issues/new/choose) first. + + This prevents submitting changes that are not thought through and, as a consequence, allows for a healthier and more productive way of coming with solutions to problems. + +2. Fork the repo. +3. Clone the forked repo. +4. Create a new branch (generally named `fix/thing-you-want-to-fix` or `feature/name-of-the-feature`). +5. Commit changes to that branch. + Do not forget to `npm install` and `npm run dev` while making changes. +6. Propose a PR to the **release** branch of this repository (PR's to master will be rebased). +7. Request or wait for a review from maintainers of the repository. diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..b792f73 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,36 @@ +--- +name: Bug report +about: Create a report to help improve {{package-name}} +title: '' +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +--- + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +--- + +**Environment (please complete the following information):** + - OS: [e.g. Windows] + - Platform: + - [] Browser [e.g. chrome, safari] (**version**) + - [] Node (**version**) + - `{{package-name}}` version: **v0.10.0** +--- diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..c16b292 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest your own idea for {{package-name}} +title: '' +labels: enhancement +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-support-request.md b/.github/ISSUE_TEMPLATE/question-support-request.md new file mode 100644 index 0000000..7cd2ba8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question-support-request.md @@ -0,0 +1,13 @@ +--- +name: Question/support request +about: Lack understanding of a certain feature or just have a question? Use this. +title: '' +labels: question +assignees: Raiondesu + +--- + + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..670949d --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,65 @@ + + +## Description + + +Closes # (issue) + +## Type of change + + + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) +- [ ] This change requires a documentation update + +## How Has This Been Tested? + + + +- [ ] Test A +- [ ] Test B + +### Checklist: + +- [ ] My code follows the style guidelines of this project +- [ ] I have performed a self-review of my own code +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] I have made corresponding changes to the documentation +- [ ] My changes generate no new warnings +- [ ] I have added tests that prove my fix is effective or that my feature works +- [ ] New and existing unit tests pass locally with my changes diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d1feb08 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +coverage +node_modules +.vscode/settings.json diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..ed39429 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +language: node_js + +node_js: + - stable + +install: + - npm install + +script: + - npm t + - npm run build + +after_success: npm run coverage + +notifications: + email: false diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..14aa983 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 {{owner}} + +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..1882d39 --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# ts-lib-template + +A simple zero-setup typescript template for creating maintainable libraries. + +## Usage + +1. Create your own repository. + - Choose `ts-lib-template` as the repository template.\ + OR + - Clone this repository and: + - `rm .git` + - `git init` + +2. In the repo's folder run: + - `node init-ts {your-github-username-or-org}/{your-package-name}` + - `npm i` +3. You're ready to go! Adjust the contents as you see fit. diff --git a/README.template.md b/README.template.md new file mode 100644 index 0000000..80e8666 --- /dev/null +++ b/README.template.md @@ -0,0 +1,20 @@ +# {{package-name}} [![npm](https://img.shields.io/npm/v/{{package-name}}.svg?style=flat-square)](https://www.npmjs.com/package/{{package-name}} "NPM package page") + +> {{description}} + +[![travis](https://img.shields.io/travis/com/{{owner}}/{{package-name}}?style=flat-square)](https://travis-ci.com/{{owner}}/{{package-name}} "Latest Travis CI build") +[![npm](https://img.shields.io/npm/dm/{{package-name}}.svg?style=flat-square)](https://www.npmjs.com/package/{{package-name}} "Downloads per month, but who cares?") +[![size](https://img.shields.io/bundlephobia/minzip/{{package-name}}@latest?style=flat-square)](https://bundlephobia.com/result?p={{package-name}}@latest "minzipped size") +[![coveralls](https://img.shields.io/coveralls/github/{{owner}}/{{package-name}}?style=flat-square)](https://coveralls.io/github/{{owner}}/{{package-name}} "Code coverage") +[![code quality](https://img.shields.io/codeclimate/maintainability/{{owner}}/{{package-name}}?style=flat-square)](https://codeclimate.com/github/{{owner}}/{{package-name}}/maintainability "Code quality") + +[![code pen](https://img.shields.io/badge/playground-link-blueviolet?style=flat-square)](https://codepen.io/raiondesu/pen/qBBPPom "Link to in-browser playground") + +## Table of Contents + +## What is this? + +--- + +Something's missing or found a bug?\ +Feel free to [create an issue](https://github.com/{{owner}}/{{package-name}}/issues/new)! 😉 diff --git a/bili.config.ts b/bili.config.ts new file mode 100644 index 0000000..a1d8378 --- /dev/null +++ b/bili.config.ts @@ -0,0 +1,15 @@ +import { name } from 'package.json'; +import { Config } from 'bili'; + +export default { + input: 'src/index.ts', + output: { + moduleName: name, + fileName: 'umd.js', + format: 'umd-min', + target: 'browser', + }, + plugins: { + typescript2: true, + }, +} as Config; diff --git a/init/index.js b/init/index.js new file mode 100644 index 0000000..877e0ff --- /dev/null +++ b/init/index.js @@ -0,0 +1,32 @@ +const replace = require('replace-in-file'); + +const yargs = require('yargs') + .option('description', { + alias: 'd', + help: 'A short package description', + default: '' + }) + .argv; + +try { + const [packageOrg, packageName] = yargs._[0].split('/'); + + replace({ + files: process.cwd() + '/**', + from: /{{package-name}}/, + to: packageName + }); + + replace({ + files: process.cwd() + '/**', + from: /{{owner}}/, + to: packageOrg + }); + + return 0; +} catch (e) { + console.error(`Please, provide package information in the following format: + node init {github-username-or-org}/{package-name}`); + + return 1; +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..ff6328c --- /dev/null +++ b/package-lock.json @@ -0,0 +1,354 @@ +{ + "name": "{{package-name}}", + "version": "0.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "requires": { + "locate-path": "^3.0.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "p-limit": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", + "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "replace-in-file": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/replace-in-file/-/replace-in-file-4.2.0.tgz", + "integrity": "sha512-9PGYDbU8iQF3W5a0Ariaf4KzYjsZSkonCYiZylwMiYOu0w5Bg9IuT4DqNnibA4zGNVxH//F7Hxh1P25TofAHGw==", + "dev": true, + "requires": { + "chalk": "^2.4.2", + "glob": "^7.1.4", + "yargs": "^13.3.0" + }, + "dependencies": { + "yargs": { + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", + "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.1" + } + }, + "yargs-parser": { + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" + }, + "yargs": { + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.0.tgz", + "integrity": "sha512-/is78VKbKs70bVZH7w4YaZea6xcJWOAwkhbR0CFuZBmYtfTYF0xjGJF43AYd8g2Uii1yJwmS5GR2vBmrc32sbg==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^15.0.0" + } + }, + "yargs-parser": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.0.tgz", + "integrity": "sha512-xLTUnCMc4JhxrPEPUYD5IBR1mWCK/aT6+RJ/K29JY2y1vD+FhtgKK0AXRWvI262q3QSffAQuTouFIKUuHX89wQ==", + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..a347862 --- /dev/null +++ b/package.json @@ -0,0 +1,82 @@ +{ + "name": "{{package-name}}", + "version": "0.0.0", + "sideEffects": false, + "description": "{{description}}", + "main": "dist/js", + "module": "dist/es", + "unpkg": "dist/es", + "typings": "src", + "keywords": [], + "dependencies": {}, + "devDependencies": { + "@kazanexpress/tslint": "^1.0.5", + "@types/jest": "^24.0.18", + "@types/lodash.clonedeep": "^4.5.6", + "@types/node": "^12.11.7", + "@zoltu/typescript-transformer-append-js-extension": "^1.0.1", + "bili": "^4.8.1", + "coveralls": "^3.0.7", + "jest": "^24.9.0", + "lodash.clonedeep": "^4.5.0", + "madge": "^3.5.0", + "replace-in-file": "^4.2.0", + "rollup-plugin-typescript2": "^0.24.3", + "ts-jest": "^24.1.0", + "tslint": "^5.20.0", + "ttypescript": "^1.5.7", + "typescript": "^3.6.4", + "yargs": "^14.2.0" + }, + "scripts": { + "test": "jest -i", + "build:js": "ttsc --outDir dist/js -t ES2015", + "build:es": "ttsc --outDir dist/es -t ES2015 --module esnext", + "build:next": "ttsc --outDir dist/esnext --module esnext", + "build:umd": "bili", + "build": "npm run checks && npm run build:js && npm run build:es && npm run build:next && npm run build:umd", + "dev": "tsc --noEmit -w", + "coverage": "cat ./coverage/lcov.info | coveralls", + "checks": "madge --circular --extensions ts src/index.ts", + "commit-build": "(git diff --quiet && git diff --staged --quiet) || (git commit -am \"Update dist\")", + "preversion": "npm t && npm run build && npm run commit-build", + "prerelease": "npm version prerelease --preid=rc && npm publish --tag next && git push", + "pre-minor": "npm version preminor --preid=rc && npm publish --tag next && git push", + "pre-major": "npm version premajor --preid=rc && npm publish --tag next && git push", + "patch": "npm version patch && npm publish && git push", + "minor": "npm version minor && npm publish && git push", + "major": "npm version major && npm publish && git push" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/{{owner}}/{{package-name}}.git" + }, + "author": "{{author}}", + "license": "MIT", + "bugs": { + "url": "https://github.com/{{owner}}/{{package-name}}/issues" + }, + "homepage": "https://github.com/{{owner}}/{{package-name}}#readme", + "jest": { + "preset": "ts-jest", + "verbose": true, + "coverageReporters": [ + "lcov", + "text" + ], + "coveragePathIgnorePatterns": [ + "/node_modules/", + "/tests?/", + "/dist/" + ], + "coverageThreshold": { + "global": { + "branches": 90, + "functions": 100, + "lines": 100, + "statements": 100 + } + }, + "collectCoverage": true + } +} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..8d5cd18 --- /dev/null +++ b/src/index.ts @@ -0,0 +1 @@ +export default 'hello, typescript!'; \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..846ba80 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,42 @@ +{ + "compilerOptions": { + "target": "esnext", + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "outDir": "./dist", + "allowJs": true, + "downlevelIteration": true, + "sourceMap": true, + "strict": true, + "removeComments": true, + "esModuleInterop": true, + "skipLibCheck": true, + "skipDefaultLibCheck": true, + "alwaysStrict": true, + "allowSyntheticDefaultImports": true, + "experimentalDecorators": true, + "noImplicitThis": true, + "noImplicitReturns": true, + "noImplicitAny": false, + "lib": [ + "esnext" + ], + "types": [ + "@types/jest", + "@types/node" + ], + "plugins": [ + { + "transform": "@zoltu/typescript-transformer-append-js-extension/output/index.js", + "after": true, + } + ] + }, + "include": [ + "./src" + ], + "exclude": [ + "node_modules" + ] +} diff --git a/tslint.json b/tslint.json new file mode 100644 index 0000000..6902071 --- /dev/null +++ b/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "@kazanexpress/tslint" +}