From 03767dea10a6f51919a6f9abad107bb52eb923d7 Mon Sep 17 00:00:00 2001 From: Uzlopak Date: Mon, 5 Sep 2022 14:44:36 +0200 Subject: [PATCH] Initial commit --- .github/.stale.yml | 21 ++++ .github/dependabot.yml | 13 ++ .github/tests_checker.yml | 8 ++ .github/workflows/ci.yml | 17 +++ .github/workflows/package-manager-ci.yml | 67 +++++++++++ .gitignore | 145 +++++++++++++++++++++++ .npmrc | 1 + README.md | 37 ++++++ docs/.gitkeep | 0 examples/.gitkeep | 0 test/.gitkeep | 0 types/.gitkeep | 0 12 files changed, 309 insertions(+) create mode 100644 .github/.stale.yml create mode 100644 .github/dependabot.yml create mode 100644 .github/tests_checker.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/package-manager-ci.yml create mode 100644 .gitignore create mode 100644 .npmrc create mode 100644 README.md create mode 100644 docs/.gitkeep create mode 100644 examples/.gitkeep create mode 100644 test/.gitkeep create mode 100644 types/.gitkeep diff --git a/.github/.stale.yml b/.github/.stale.yml new file mode 100644 index 0000000..2ee1269 --- /dev/null +++ b/.github/.stale.yml @@ -0,0 +1,21 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 15 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 7 +# Issues with these labels will never be considered stale +exemptLabels: + - "discussion" + - "feature request" + - "bug" + - "help wanted" + - "plugin suggestion" + - "good first issue" +# Label to use when marking an issue as stale +staleLabel: stale +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..dfa7fa6 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" + open-pull-requests-limit: 10 + + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 10 diff --git a/.github/tests_checker.yml b/.github/tests_checker.yml new file mode 100644 index 0000000..769469b --- /dev/null +++ b/.github/tests_checker.yml @@ -0,0 +1,8 @@ +comment: | + Hello! Thank you for contributing! + It appears that you have changed the code, but the tests that verify your change are missing. Could you please add them? +fileExtensions: + - '.ts' + - '.js' + +testDir: 'test' \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..325921f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,17 @@ +name: CI + +on: + push: + paths-ignore: + - 'docs/**' + - '*.md' + pull_request: + paths-ignore: + - 'docs/**' + - '*.md' + +jobs: + test: + uses: fastify/workflows/.github/workflows/plugins-ci.yml@v3 + with: + license-check: true diff --git a/.github/workflows/package-manager-ci.yml b/.github/workflows/package-manager-ci.yml new file mode 100644 index 0000000..7fb27ff --- /dev/null +++ b/.github/workflows/package-manager-ci.yml @@ -0,0 +1,67 @@ +name: package-manager-ci + +on: + push: + branches: + - master + +permissions: + contents: read + +jobs: + pnpm: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + # Maintenance and active LTS + node-version: [14, 16] + os: [ubuntu-18.04] + + steps: + - uses: actions/checkout@v3 + with: + persist-credentials: false + + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Install with pnpm + run: | + curl -L https://unpkg.com/@pnpm/self-installer | node + pnpm install + + - name: Run tests + run: | + pnpm run test + + yarn: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + # Maintenance and active LTS + node-version: [14, 16] + os: [ubuntu-18.04] + + steps: + - uses: actions/checkout@v3 + with: + persist-credentials: false + + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Install with yarn + run: | + curl -o- -L https://yarnpkg.com/install.sh | bash + yarn install --ignore-engines + + - name: Run tests + run: | + yarn run test + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c1b9a5c --- /dev/null +++ b/.gitignore @@ -0,0 +1,145 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-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/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp +.cache + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +# Vim swap files +*.swp + +# macOS files +.DS_Store + +# lock files +package-lock.json +pnpm-lock.yaml +yarn.lock + +# editor files +.vscode +.idea \ 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/README.md b/README.md new file mode 100644 index 0000000..2a2ee72 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# skeleton + +Template repository to create standardized Fastify plugins. + +# Getting started + +- Click on `Use this template` above to create a new repository based on this repository. + +# What's included? + +1. Github CI Actions for installing, testing your package. +2. Github CI Actions to validate different package managers. +3. Dependabot V2 config to automate dependency updates. +4. Template for the GitHub App [Stale](https://github.com/apps/stale) to mark issues as stale. +5. Template for the GitHub App [tests-checker](https://github.com/apps/tests-checker) to check if a PR contains tests. + +# Repository structure + +``` +├── .github +│ ├── workflows +│ │ ├── ci.yml +│ │ └── package-manager-ci.yml +│ ├── .stale.yml +│ ├── dependabot.yml +│ └── tests_checker.yml +│ +├── docs (Documentation) +│ +├── examples (Code examples) +│ +├── test (Application tests) +│ +├── types (Typescript types) +│ +└── README.md +``` \ No newline at end of file diff --git a/docs/.gitkeep b/docs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/examples/.gitkeep b/examples/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/test/.gitkeep b/test/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/types/.gitkeep b/types/.gitkeep new file mode 100644 index 0000000..e69de29