diff --git a/.dependabot/config.yml b/.dependabot/config.yml new file mode 100644 index 0000000..6132a38 --- /dev/null +++ b/.dependabot/config.yml @@ -0,0 +1,12 @@ +version: 1 +update_configs: + - package_manager: "javascript" + update_schedule: "daily" + directory: "." + default_assignees: + # update to your username :party: + - "HugoDF" + automerged_updates: + - match: + dependency_type: "all" + update_type: "all" diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..a37bf7b --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +# http://editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +# The JSON files contain newlines inconsistently +[*.json] +insert_final_newline = ignore + +[*.md] +trim_trailing_whitespace = false + diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml new file mode 100644 index 0000000..59c69cd --- /dev/null +++ b/.github/workflows/nodejs.yml @@ -0,0 +1,28 @@ +name: Build & test + +on: [push] + +jobs: + lint_build_test: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [10.x, 12.x] + + env: + CI: true + + steps: + - uses: actions/checkout@v1 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: yarn install + run: yarn + - name: lint + run: yarn lint + - name: build & test + run: yarn build && yarn test diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..29e1bd4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,92 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# next.js build output +.next + +# nuxt.js build output +.nuxt + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ +dist +.rts2_cache_* +schema.json +_gen diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7193664 --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) +Copyright (c) 2019-2020 Hugo Di Francesco + + +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..60861ef --- /dev/null +++ b/README.md @@ -0,0 +1,54 @@ +![Build](https://github.com/HugoDF/buttondown/workflows/Build%20&%20test/badge.svg) + +microbundle-ts-pkg: A TypeScript npm package skeleton/starter project with microbundle, AVA and XO + +Comes with: + +- [SAMPLE_README.md](./SAMPLE_README.md) and [USE_CASES.md](./USE_CASES.md) for documentation. +- AVA for testing (see [./tests](./tests)) +- XO for linting/formatting +- microbundle for compiling TypeScript to UMD, ESM, CJS + +## Requirements + +- Node 10 +- Yarn 1.x or npm + +## Setup + +1. Clone the repository +2. Run `yarn` or `npm install` installs all required dependencies. +3. Run `yarn build` to build from TypeScript to common JavaScript distribution formats. +4. Run `yarn test` to run all tests :D. + +## npm scripts + +> Equivalent `npm run