├── .github ├── .kodiak.toml ├── CODEOWNERS ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── fossa.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── README.md ├── cookiecutter.json ├── hooks └── post_gen_project.py ├── package-lock.json ├── package.json ├── renovate.json5 └── {{cookiecutter.project_slug}} ├── .editorconfig ├── .eslintrc.cjs ├── .gitattributes ├── .github ├── .kodiak.toml ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── pull_request_template.md └── workflows │ ├── fossa.yml │ ├── labeler.yml │ ├── release-please.yml │ └── workflow.yml ├── .gitignore ├── .prettierrc.json ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── commitlint.config.cjs ├── package-lock.json ├── package.json ├── renovate.json5 ├── src └── main.ts ├── test └── main.js └── tsconfig.json /.github/.kodiak.toml: -------------------------------------------------------------------------------- 1 | version = 1 2 | 3 | [merge.automerge_dependencies] 4 | versions = ["minor", "patch"] 5 | usernames = ["renovate"] 6 | 7 | [approve] 8 | auto_approve_usernames = ["renovate"] -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @netlify/netlify-dev 2 | docs/ @netlify/department-docs 3 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 🎉 Thanks for submitting a pull request! 🎉 2 | 3 | #### Summary 4 | 5 | Fixes # 6 | 7 | 10 | 11 | --- 12 | 13 | For us to review and ship your PR efficiently, please perform the following steps: 14 | 15 | - [ ] Open a [bug/issue](https://github.com/netlify/node-template/issues/new/choose) before writing your code 🧑‍💻. This 16 | ensures we can discuss the changes and get feedback from everyone that should be involved. If you\`re fixing a 17 | typo or something that\`s on fire 🔥 (e.g. incident related), you can skip this step. 18 | - [ ] Read the [contribution guidelines](../CONTRIBUTING.md) 📖. This ensures your code follows our style guide and 19 | passes our tests. 20 | - [ ] Update or add tests (if any source code was changed or added) 🧪 21 | - [ ] Update or add documentation (if features were changed or added) 📝 22 | - [ ] Make sure the status checks below are successful ✅ 23 | 24 | **A picture of a cute animal (not mandatory, but encouraged)** 25 | -------------------------------------------------------------------------------- /.github/workflows/fossa.yml: -------------------------------------------------------------------------------- 1 | name: Dependency License Scanning 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - chore/fossa-workflow 8 | 9 | defaults: 10 | run: 11 | shell: bash 12 | 13 | jobs: 14 | fossa: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Checkout 18 | uses: actions/checkout@v2 19 | - name: Download fossa cli 20 | run: |- 21 | mkdir -p $HOME/.local/bin 22 | curl https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | bash -s -- -b $HOME/.local/bin 23 | echo "$HOME/.local/bin" >> $GITHUB_PATH 24 | 25 | - name: Fossa init 26 | run: fossa init 27 | - name: Upload dependencies 28 | run: fossa analyze --debug 29 | env: 30 | FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }} 31 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making 6 | participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, 7 | disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, 8 | religion, or sexual identity and orientation. 9 | 10 | ## Our Standards 11 | 12 | Examples of behavior that contributes to creating a positive environment include: 13 | 14 | - Using welcoming and inclusive language 15 | - Being respectful of differing viewpoints and experiences 16 | - Gracefully accepting constructive criticism 17 | - Focusing on what is best for the community 18 | - Showing empathy towards other community members 19 | 20 | Examples of unacceptable behavior by participants include: 21 | 22 | - The use of sexualized language or imagery and unwelcome sexual attention or advances 23 | - Trolling, insulting/derogatory comments, and personal or political attacks 24 | - Public or private harassment 25 | - Publishing others' private information, such as a physical or electronic address, without explicit permission 26 | - Other conduct which could reasonably be considered inappropriate in a professional setting 27 | 28 | ## Our Responsibilities 29 | 30 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take 31 | appropriate and fair corrective action in response to any instances of unacceptable behavior. 32 | 33 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, 34 | issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any 35 | contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 36 | 37 | ## Scope 38 | 39 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the 40 | project or its community. Examples of representing a project or community include using an official project e-mail 41 | address, posting via an official social media account, or acting as an appointed representative at an online or offline 42 | event. Representation of a project may be further defined and clarified by project maintainers. 43 | 44 | ## Enforcement 45 | 46 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at 47 | david@netlify.com. All complaints will be reviewed and investigated and will result in a response that is deemed 48 | necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to 49 | the reporter of an incident. Further details of specific enforcement policies may be posted separately. 50 | 51 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent 52 | repercussions as determined by other members of the project's leadership. 53 | 54 | ## Attribution 55 | 56 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at 57 | [http://contributor-covenant.org/version/1/4][version] 58 | 59 | [homepage]: http://contributor-covenant.org 60 | [version]: http://contributor-covenant.org/version/1/4/ 61 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributions 2 | 3 | 🎉 Thanks for considering contributing to this project! 🎉 4 | 5 | These guidelines will help you send a pull request. 6 | 7 | Please note that this project is not intended to be used outside our own projects so new features are unlikely to be 8 | accepted. 9 | 10 | If you're submitting an issue instead, please skip this document. 11 | 12 | If your pull request is related to a typo or the documentation being unclear, please click on the relevant page's `Edit` 13 | button (pencil icon) and directly suggest a correction instead. 14 | 15 | This project was made with ❤️. The simplest way to give back is by starring and sharing it online. 16 | 17 | Everyone is welcome regardless of personal background. We enforce a [Code of conduct](CODE_OF_CONDUCT.md) in order to 18 | promote a positive and inclusive environment. 19 | 20 | ## Development Process 21 | 22 | First fork and clone the repository. If you're not sure how to do this, please watch 23 | [these videos](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github). 24 | 25 | Most changes should be done to the template itself under `{{cookiecutter.project_slug}}`. 26 | Post template generation hook is under `hooks/post_gen_project.py` -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # node-template 2 | 3 | This is a GitHub [cookiecutter](https://cookiecutter.readthedocs.io/en/1.7.2/installation.html) template for Netlify Node.js repositories. 4 | 5 | Please feel free to use this template when starting a new Node.js repository. 6 | 7 | ## Setup 8 | 9 | - `cookiecutter gh:netlify/node-template` 10 | - Create a GitHub repository and push the generated local repo 11 | 12 | ### Release please setup 13 | 14 | We use [release please](https://github.com/google-github-actions/release-please-action) to automate release publishing. 15 | For the `release-please.yml` GitHub workflow to work you'll need to add 3 secrets to your repo: 16 | 17 | 1. `TOKENS_PRIVATE_KEY` - a GitHub app private key 18 | 2. `TOKENS_APP_ID` - a GitHub app id 19 | 3. `NPM_TOKEN` - an `npm` automation token 20 | 21 | The GitHub app is used to generate GitHub tokens to and should be installed on the repo and have `Contents` and `Pull requests` read & write permissions. 22 | You can create a new GitHub app by visiting `https://github.com/organizations//settings/apps/new` 23 | 24 | > It's useful to add those secrets at an organization level instead of at the repo level 25 | 26 | ## Contributors 27 | 28 | Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for instructions on how to set up and work on this repository. Thanks 29 | for contributing! 30 | -------------------------------------------------------------------------------- /cookiecutter.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_name": "Node Project", 3 | "project_slug": "{{ cookiecutter.project_name.lower().replace(' ', '-').replace('_', '-') }}", 4 | "project_description": "A Node Project to fix all bugs", 5 | "project_version": "1.0.0", 6 | "_copy_without_render": [ 7 | ".github/workflows/*.yml" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /hooks/post_gen_project.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import fileinput 3 | import os 4 | 5 | # This is required since we don't process GitHub actions 6 | project_slug = '{{ cookiecutter.project_slug }}' 7 | filename = os.path.join('.github', 'workflows', 'release-please.yml') 8 | with fileinput.FileInput(filename, inplace=True) as file: 9 | for line in file: 10 | print(line.replace('project_slug', project_slug), end='') 11 | 12 | 13 | subprocess.call(['git', 'init']) 14 | subprocess.call(['npm', 'install']) 15 | subprocess.call(['git', 'add', '.']) 16 | subprocess.call(['git', 'commit', '-m', 'chore: initial commit']) 17 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@netlify/node-template", 3 | "version": "0.1.0", 4 | "lockfileVersion": 2, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "@netlify/node-template", 9 | "version": "0.1.0", 10 | "license": "MIT", 11 | "engines": { 12 | "node": "^14.16.0 || >=16.0.0" 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@netlify/node-template", 3 | "private": true, 4 | "version": "0.1.0", 5 | "description": "A repository template to bootstrap Node.js projects for Netlify", 6 | "type": "module", 7 | "license": "MIT", 8 | "repository": "netlify/node-template", 9 | "bugs": { 10 | "url": "https://github.com/netlify/node-template/issues" 11 | }, 12 | "engines": { 13 | "node": "^14.16.0 || >=16.0.0" 14 | }, 15 | "author": "Netlify Inc." 16 | } 17 | -------------------------------------------------------------------------------- /renovate.json5: -------------------------------------------------------------------------------- 1 | { 2 | extends: ['github>netlify/renovate-config:esm'], 3 | ignorePresets: [':prHourlyLimit2'], 4 | semanticCommits: true, 5 | dependencyDashboard: true, 6 | automerge: true, 7 | packageRules: [], 8 | includePaths: [ 9 | '{{cookiecutter.project_slug}}/package.json', 10 | ], 11 | lockFileMaintenance: { 12 | enabled: false, 13 | }, 14 | } 15 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | max_line_length = 120 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const { overrides } = require('@netlify/eslint-config-node/.eslintrc_esm.cjs') 4 | 5 | module.exports = { 6 | extends: '@netlify/eslint-config-node/.eslintrc_esm.cjs', 7 | overrides: [...overrides], 8 | } 9 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.github/.kodiak.toml: -------------------------------------------------------------------------------- 1 | version = 1 2 | 3 | [merge.automerge_dependencies] 4 | versions = ["minor", "patch"] 5 | usernames = ["renovate"] 6 | 7 | [approve] 8 | auto_approve_usernames = ["renovate"] -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @netlify/netlify-dev 2 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: 'Please replace with a clear and descriptive title' 5 | labels: 'type: bug' 6 | assignees: '' 7 | --- 8 | 9 | Thanks for reporting this bug! 10 | 11 | Please search other issues to make sure this bug has not already been reported. 12 | 13 | Then fill in the sections below. 14 | 15 | **Describe the bug** 16 | 17 | A clear and concise description of what the bug is. 18 | 19 | **Configuration** 20 | 21 | Please enter the following command in a terminal and copy/paste its output: 22 | 23 | ```bash 24 | npx envinfo --system --binaries 25 | ``` 26 | 27 | **Pull requests** 28 | 29 | Pull requests are welcome! If you would like to help us fix this bug, please check our 30 | [contributions guidelines](../blob/main/CONTRIBUTING.md). 31 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: 'Please replace with a clear and descriptive title' 5 | labels: 'type: feature' 6 | assignees: '' 7 | --- 8 | 9 | 14 | 15 | **Which problem is this feature request solving?** 16 | 17 | 20 | 21 | **Describe the solution you'd like** 22 | 23 | 26 | 27 | **Describe alternatives you've considered** 28 | 29 | 32 | 33 | **Can you submit a pull request?** 34 | 35 | Yes/No. 36 | 37 | 41 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 🎉 Thanks for sending this pull request! 🎉 2 | 3 | Please make sure the title is clear and descriptive. 4 | 5 | If you are fixing a typo or documentation, please skip these instructions. 6 | 7 | Otherwise please fill in the sections below. 8 | 9 | **Which problem is this pull request solving?** 10 | 11 | Example: I'm always frustrated when [...] 12 | 13 | **List other issues or pull requests related to this problem** 14 | 15 | Example: This fixes #5012 16 | 17 | **Describe the solution you've chosen** 18 | 19 | Example: I've fixed this by [...] 20 | 21 | **Describe alternatives you've considered** 22 | 23 | Example: Another solution would be [...] 24 | 25 | **Checklist** 26 | 27 | Please add a `x` inside each checkbox: 28 | 29 | - [ ] I have read the [contribution guidelines](../blob/main/CONTRIBUTING.md). 30 | - [ ] The status checks are successful (continuous integration). Those can be seen below. 31 | 32 | **A picture of a cute animal (not mandatory but encouraged)** 33 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.github/workflows/fossa.yml: -------------------------------------------------------------------------------- 1 | name: Dependency License Scanning 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | defaults: 9 | run: 10 | shell: bash 11 | 12 | jobs: 13 | fossa: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Checkout 17 | uses: actions/checkout@v2 18 | - name: Fossa init 19 | run: |- 20 | curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | bash 21 | fossa init 22 | - name: Set env 23 | run: echo "line_number=$(grep -n "project" .fossa.yml | cut -f1 -d:)" >> $GITHUB_ENV 24 | - name: Configuration 25 | run: |- 26 | sed -i "${line_number}s|.*| project: git@github.com:${GITHUB_REPOSITORY}.git|" .fossa.yml 27 | cat .fossa.yml 28 | - name: Upload dependencies 29 | run: fossa analyze --debug 30 | env: 31 | FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }} 32 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.github/workflows/labeler.yml: -------------------------------------------------------------------------------- 1 | name: Label PR 2 | on: 3 | pull_request: 4 | types: [opened, edited] 5 | 6 | jobs: 7 | label-pr: 8 | if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false 9 | runs-on: ubuntu-latest 10 | strategy: 11 | matrix: 12 | pr: 13 | [ 14 | { prefix: 'fix', type: 'bug' }, 15 | { prefix: 'chore', type: 'chore' }, 16 | { prefix: 'test', type: 'chore' }, 17 | { prefix: 'ci', type: 'chore' }, 18 | { prefix: 'feat', type: 'feature' }, 19 | { prefix: 'security', type: 'security' }, 20 | ] 21 | steps: 22 | - uses: netlify/pr-labeler-action@v1.0.0 23 | if: startsWith(github.event.pull_request.title, matrix.pr.prefix) 24 | with: 25 | token: '${{ secrets.GITHUB_TOKEN }}' 26 | label: 'type: ${{ matrix.pr.type }}' 27 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.github/workflows/release-please.yml: -------------------------------------------------------------------------------- 1 | name: release-please 2 | on: 3 | push: 4 | branches: 5 | - main 6 | jobs: 7 | release-please: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: navikt/github-app-token-generator@2d70c12368d1958155af4d283f9f21c9a2a8cb98 11 | id: get-token 12 | with: 13 | private-key: ${{ secrets.TOKENS_PRIVATE_KEY }} 14 | app-id: ${{ secrets.TOKENS_APP_ID }} 15 | - uses: GoogleCloudPlatform/release-please-action@v2 16 | id: release 17 | with: 18 | token: ${{ steps.get-token.outputs.token }} 19 | release-type: node 20 | package-name: "@netlify/project_slug" 21 | - uses: actions/checkout@v2 22 | if: ${{ steps.release.outputs.release_created }} 23 | - uses: actions/setup-node@v2 24 | with: 25 | node-version: '*' 26 | cache: 'npm' 27 | check-latest: true 28 | registry-url: 'https://registry.npmjs.org' 29 | if: ${{ steps.release.outputs.release_created }} 30 | - run: npm publish 31 | if: ${{ steps.release.outputs.release_created }} 32 | env: 33 | NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} 34 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.github/workflows/workflow.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | on: 3 | # Ensure GitHub actions are not run twice for same commits 4 | push: 5 | branches: [main] 6 | tags: ['*'] 7 | pull_request: 8 | types: [opened, synchronize, reopened] 9 | jobs: 10 | build: 11 | runs-on: ${{ matrix.os }} 12 | timeout-minutes: 30 13 | strategy: 14 | matrix: 15 | os: [ubuntu-latest, macOS-latest, windows-latest] 16 | node-version: [12.20.0, '*'] 17 | exclude: 18 | - os: macOS-latest 19 | node-version: 12.20.0 20 | - os: windows-latest 21 | node-version: 12.20.0 22 | fail-fast: false 23 | steps: 24 | - name: Git checkout 25 | uses: actions/checkout@v2 26 | - name: Node.js ${{ matrix.node-version }} 27 | uses: actions/setup-node@v2 28 | with: 29 | node-version: ${{ matrix.node-version }} 30 | cache: 'npm' 31 | check-latest: true 32 | - name: Install dependencies 33 | run: npm ci 34 | - name: Linting 35 | run: npm run format:ci 36 | if: "${{ matrix.node-version == '*' }}" 37 | - name: Tests 38 | run: npm run test:ci 39 | - name: Get test coverage flags 40 | id: test-coverage-flags 41 | run: |- 42 | os=${{ matrix.os }} 43 | node=${{ matrix.node-version }} 44 | echo "::set-output name=os::${os/-latest/}" 45 | echo "::set-output name=node::node_${node//[.*]/}" 46 | shell: bash 47 | - uses: codecov/codecov-action@v1 48 | with: 49 | file: coverage/coverage-final.json 50 | flags: ${{ steps.test-coverage-flags.outputs.os }},${{ steps.test-coverage-flags.outputs.node }} 51 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.swp 3 | npm-debug.log 4 | node_modules 5 | /core 6 | .eslintcache 7 | .npmrc 8 | .yarn-error.log 9 | /coverage 10 | /build 11 | .vscode 12 | /dist 13 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.prettierrc.json: -------------------------------------------------------------------------------- 1 | "@netlify/eslint-config-node/.prettierrc.json" 2 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netlify/node-template/56361de535b02843aaca55ad6da40ed6b71ff133/{{cookiecutter.project_slug}}/CHANGELOG.md -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making 6 | participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, 7 | disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, 8 | religion, or sexual identity and orientation. 9 | 10 | ## Our Standards 11 | 12 | Examples of behavior that contributes to creating a positive environment include: 13 | 14 | - Using welcoming and inclusive language 15 | - Being respectful of differing viewpoints and experiences 16 | - Gracefully accepting constructive criticism 17 | - Focusing on what is best for the community 18 | - Showing empathy towards other community members 19 | 20 | Examples of unacceptable behavior by participants include: 21 | 22 | - The use of sexualized language or imagery and unwelcome sexual attention or advances 23 | - Trolling, insulting/derogatory comments, and personal or political attacks 24 | - Public or private harassment 25 | - Publishing others' private information, such as a physical or electronic address, without explicit permission 26 | - Other conduct which could reasonably be considered inappropriate in a professional setting 27 | 28 | ## Our Responsibilities 29 | 30 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take 31 | appropriate and fair corrective action in response to any instances of unacceptable behavior. 32 | 33 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, 34 | issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any 35 | contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 36 | 37 | ## Scope 38 | 39 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the 40 | project or its community. Examples of representing a project or community include using an official project e-mail 41 | address, posting via an official social media account, or acting as an appointed representative at an online or offline 42 | event. Representation of a project may be further defined and clarified by project maintainers. 43 | 44 | ## Enforcement 45 | 46 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at 47 | david@netlify.com. All complaints will be reviewed and investigated and will result in a response that is deemed 48 | necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to 49 | the reporter of an incident. Further details of specific enforcement policies may be posted separately. 50 | 51 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent 52 | repercussions as determined by other members of the project's leadership. 53 | 54 | ## Attribution 55 | 56 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at 57 | [http://contributor-covenant.org/version/1/4][version] 58 | 59 | [homepage]: http://contributor-covenant.org 60 | [version]: http://contributor-covenant.org/version/1/4/ 61 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributions 2 | 3 | 🎉 Thanks for considering contributing to this project! 🎉 4 | 5 | These guidelines will help you send a pull request. 6 | 7 | Please note that this project is not intended to be used outside my own projects so new features are unlikely to be 8 | accepted. 9 | 10 | If you're submitting an issue instead, please skip this document. 11 | 12 | If your pull request is related to a typo or the documentation being unclear, please click on the relevant page's `Edit` 13 | button (pencil icon) and directly suggest a correction instead. 14 | 15 | This project was made with ❤️. The simplest way to give back is by starring and sharing it online. 16 | 17 | Everyone is welcome regardless of personal background. We enforce a [Code of conduct](CODE_OF_CONDUCT.md) in order to 18 | promote a positive and inclusive environment. 19 | 20 | # Development process 21 | 22 | First fork and clone the repository. If you're not sure how to do this, please watch 23 | [these videos](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github). 24 | 25 | Run: 26 | 27 | ```bash 28 | npm install 29 | ``` 30 | 31 | Make sure everything is correctly setup with: 32 | 33 | ```bash 34 | npm test 35 | ``` 36 | 37 | After submitting the pull request, please make sure the Continuous Integration checks are passing. 38 | 39 | ## Releasing 40 | 41 | 1. Merge the release PR 42 | 2. Switch to the default branch `git checkout main` 43 | 3. Pull latest changes `git pull` 44 | 4. Publish the package `npm publish` 45 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2022 Netlify 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/README.md: -------------------------------------------------------------------------------- 1 | [![Build](https://github.com/netlify/{{cookiecutter.project_slug}}/workflows/Build/badge.svg)](https://github.com/netlify/{{cookiecutter.project_slug}}/actions) 2 | [![Node](https://img.shields.io/node/v/@netlify/{{cookiecutter.project_slug}}.svg?logo=node.js)](https://www.npmjs.com/package/@netlify/{{cookiecutter.project_slug}}) 3 | 4 | # {{cookiecutter.project_slug}} 5 | 6 | Update me! 7 | 8 | ## Contributors 9 | 10 | Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for instructions on how to set up and work on this repository. Thanks 11 | for contributing! 12 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/commitlint.config.cjs: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { extends: ['@commitlint/config-conventional'] } 4 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@netlify/{{cookiecutter.project_slug}}", 3 | "private": true, 4 | "version": "{{cookiecutter.project_version}}", 5 | "description": "{{cookiecutter.project_description}}", 6 | "type": "module", 7 | "main": "./dist/main.js", 8 | "exports": "./dist/main.js", 9 | "files": [ 10 | "dist/**/*.js", 11 | "dist/**/*.d.ts" 12 | ], 13 | "scripts": { 14 | "build": "tsc", 15 | "prepare": "husky install node_modules/@netlify/eslint-config-node/.husky/", 16 | "prepublishOnly": "npm ci && npm test", 17 | "prepack": "npm run build", 18 | "test": "run-s build format test:dev", 19 | "format": "run-s build format:check-fix:*", 20 | "format:ci": "run-s build format:check:*", 21 | "format:check-fix:lint": "run-e format:check:lint format:fix:lint", 22 | "format:check:lint": "cross-env-shell eslint $npm_package_config_eslint", 23 | "format:fix:lint": "cross-env-shell eslint --fix $npm_package_config_eslint", 24 | "format:check-fix:prettier": "run-e format:check:prettier format:fix:prettier", 25 | "format:check:prettier": "cross-env-shell prettier --check $npm_package_config_prettier", 26 | "format:fix:prettier": "cross-env-shell prettier --write $npm_package_config_prettier", 27 | "test:dev": "run-s build test:dev:*", 28 | "test:ci": "run-s build test:ci:*", 29 | "test:dev:ava": "ava", 30 | "test:ci:ava": "c8 -r lcovonly -r text -r json ava" 31 | }, 32 | "config": { 33 | "eslint": "--ignore-path .gitignore --cache --format=codeframe --max-warnings=0 \"{src,scripts,.github}/**/*.{js,ts,md,html}\" \"*.{js,ts,md,html}\" \".*.{js,ts,md,html}\"", 34 | "prettier": "--ignore-path .gitignore --loglevel=warn \"{src,scripts,.github}/**/*.{js,ts,md,yml,json,html}\" \"*.{js,ts,yml,json,html}\" \".*.{js,ts,yml,json,html}\" \"!**/package-lock.json\" \"!package-lock.json\"" 35 | }, 36 | "ava": { 37 | "verbose": true 38 | }, 39 | "keywords": [], 40 | "license": "MIT", 41 | "repository": "netlify/{{cookiecutter.project_slug}}", 42 | "bugs": { 43 | "url": "https://github.com/netlify/{{cookiecutter.project_slug}}/issues" 44 | }, 45 | "author": "Netlify Inc.", 46 | "directories": { 47 | "test": "test" 48 | }, 49 | "devDependencies": { 50 | "@commitlint/cli": "^17.0.0", 51 | "@commitlint/config-conventional": "^17.0.0", 52 | "@netlify/eslint-config-node": "^7.0.1", 53 | "ava": "^4.0.0", 54 | "c8": "^7.11.0", 55 | "husky": "^8.0.0", 56 | "typescript": "^5.0.0" 57 | }, 58 | "engines": { 59 | "node": "^14.16.0 || >=16.0.0" 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/renovate.json5: -------------------------------------------------------------------------------- 1 | { 2 | extends: ['github>netlify/renovate-config:esm'], 3 | ignorePresets: [':prHourlyLimit2'], 4 | semanticCommits: true, 5 | dependencyDashboard: true, 6 | automerge: true, 7 | packageRules: [], 8 | } 9 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/src/main.ts: -------------------------------------------------------------------------------- 1 | const mainFunction = () => true 2 | 3 | export { mainFunction } 4 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/test/main.js: -------------------------------------------------------------------------------- 1 | import test from 'ava' 2 | 3 | test('Template test', (t) => { 4 | t.pass() 5 | }) 6 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */ 4 | 5 | /* Basic Options */ 6 | "incremental": true, /* Enable incremental compilation */ 7 | "target": "ES2017", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ 8 | "module": "es2020", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ 9 | // "lib": [], /* Specify library files to be included in the compilation. */ 10 | "allowJs": true, /* Allow javascript files to be compiled. */ 11 | // "checkJs": true, /* Report errors in .js files. */ 12 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ 13 | "declaration": true, /* Generates corresponding '.d.ts' file. */ 14 | "declarationMap": false, /* Generates a sourcemap for each corresponding '.d.ts' file. */ 15 | "sourceMap": false, /* Generates corresponding '.map' file. */ 16 | // "outFile": "./", /* Concatenate and emit output to single file. */ 17 | "outDir": "./dist", /* Redirect output structure to the directory. */ 18 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 19 | // "composite": true, /* Enable project compilation */ 20 | // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ 21 | "removeComments": false, /* Do not emit comments to output. */ 22 | // "noEmit": true, /* Do not emit outputs. */ 23 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */ 24 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 25 | 26 | /* Strict Type-Checking Options */ 27 | "strict": true, /* Enable all strict type-checking options. */ 28 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 29 | // "strictNullChecks": true, /* Enable strict null checks. */ 30 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 31 | // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ 32 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 33 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 34 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 35 | 36 | /* Additional Checks */ 37 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 38 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 39 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 40 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 41 | 42 | /* Module Resolution Options */ 43 | "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ 44 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 45 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 46 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 47 | // "typeRoots": [], /* List of folders to include type definitions from. */ 48 | // "types": [], /* Type declaration files to be included in compilation. */ 49 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 50 | "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 51 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 52 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 53 | 54 | /* Source Map Options */ 55 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 56 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 57 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 58 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 59 | 60 | /* Experimental Options */ 61 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 62 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 63 | 64 | /* Advanced Options */ 65 | "skipLibCheck": true, /* Skip type checking of declaration files. */ 66 | "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ 67 | }, 68 | "include": ["src"] 69 | } 70 | --------------------------------------------------------------------------------