├── CODEOWNERS ├── .codesandbox └── ci.json ├── .prettierrc ├── src ├── index.ts └── __tests__ │ └── helloWorld.test.ts ├── .prettierignore ├── tsconfig.eslint.json ├── tsconfig.build.json ├── cspell-dict.txt ├── .npmrc ├── tsconfig.test.json ├── .npmignore ├── tsconfig.json ├── .changeset └── config.json ├── .envrc ├── jest.config.ts ├── .gitignore ├── .eslintrc.cjs ├── renovate.json5 ├── tsconfig.base.json ├── .github └── workflows │ └── release-pr.yml ├── LICENSE ├── cspell.yaml ├── package.json ├── .circleci └── config.yml └── README.md /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @trevor-scheer -------------------------------------------------------------------------------- /.codesandbox/ci.json: -------------------------------------------------------------------------------- 1 | { 2 | "sandboxes": [], 3 | "node": "18" 4 | } 5 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "all", 3 | "singleQuote": true 4 | } 5 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | export function helloWorld() { 2 | return 'Hello World!'; 3 | } 4 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | *.json 2 | *.json5 3 | *.yml 4 | *.md 5 | 6 | dist/ 7 | 8 | .volta 9 | -------------------------------------------------------------------------------- /tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.base.json", 3 | "include": ["src/**/*.ts"], 4 | } -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.base.json", 3 | "include": ["src/**/*"], 4 | "exclude": ["**/__tests__"], 5 | } 6 | -------------------------------------------------------------------------------- /cspell-dict.txt: -------------------------------------------------------------------------------- 1 | apollographql 2 | asynciterable 3 | changesets 4 | cimg 5 | circleci 6 | codesandbox 7 | direnv 8 | npmrc 9 | opde 10 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | # Publish NPM packages with provenance 2 | # Ref: https://github.blog/2023-04-19-introducing-npm-package-provenance/ 3 | provenance=true 4 | engine-strict=true -------------------------------------------------------------------------------- /tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.base.json", 3 | "include": ["src/**/*"], 4 | "compilerOptions": { 5 | "noEmit": true, 6 | "types": ["node", "jest"] 7 | } 8 | } -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | * 2 | !src/**/* 3 | src/**/__tests__/** 4 | !dist/**/* 5 | dist/**/__tests__/** 6 | !package.json 7 | !README.md 8 | !tsconfig.base.json 9 | !tsconfig.json 10 | !tsconfig.build.json -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true 4 | }, 5 | "files": [], 6 | "include": [], 7 | "references": [ 8 | { "path": "./tsconfig.build.json" }, 9 | { "path": "./tsconfig.test.json" }, 10 | ] 11 | } -------------------------------------------------------------------------------- /src/__tests__/helloWorld.test.ts: -------------------------------------------------------------------------------- 1 | import { helloWorld } from '..'; 2 | import { describe, it, expect } from '@jest/globals'; 3 | 4 | describe('helloWorld', () => { 5 | it('says hello', () => { 6 | expect(helloWorld()).toEqual('Hello World!'); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config@1.6.3/schema.json", 3 | "changelog": [ 4 | "@changesets/changelog-github", 5 | { "repo": "apollographql/typescript-repo-template" } 6 | ], 7 | "commit": false, 8 | "access": "public", 9 | "baseBranch": "main" 10 | } 11 | -------------------------------------------------------------------------------- /.envrc: -------------------------------------------------------------------------------- 1 | export VOLTA_HOME="$PWD/.volta" 2 | PATH_add "$VOLTA_HOME/bin" 3 | 4 | if ! [ -f "$VOLTA_HOME/bin/volta" ]; then 5 | echo "Volta not found in $VOLTA_HOME/bin/volta, installing..." 6 | curl https://get.volta.sh/ | bash 7 | fi 8 | 9 | # Allow you to run jest and other things in node_modules/.bin without npx. 10 | layout node -------------------------------------------------------------------------------- /jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | roots: ['src'], 7 | globals: { 8 | 'ts-jest': { 9 | tsconfig: 'tsconfig.test.json', 10 | }, 11 | }, 12 | testRegex: '/__tests__/.*.test.ts$', 13 | verbose: true, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore the compiled output. 2 | dist/ 3 | 4 | # TypeScript incremental compilation cache 5 | *.tsbuildinfo 6 | 7 | # Logs 8 | logs 9 | *.log 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Coverage (from Jest) 15 | coverage/ 16 | 17 | # JUnit Reports (used mainly in CircleCI) 18 | reports/ 19 | junit.xml 20 | 21 | # Node modules 22 | node_modules/ 23 | 24 | # Mac OS 25 | .DS_Store 26 | 27 | # Intellij Configuration Files 28 | .idea/ 29 | 30 | # Volta binaries (when using direnv/.envrc) 31 | .volta -------------------------------------------------------------------------------- /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | overrides: [ 3 | { 4 | files: ['src/**/*.ts'], 5 | parser: '@typescript-eslint/parser', 6 | plugins: ['@typescript-eslint'], 7 | parserOptions: { 8 | project: 'tsconfig.eslint.json', 9 | tsconfigRootDir: __dirname, 10 | }, 11 | extends: [ 12 | 'eslint:recommended', 13 | 'plugin:@typescript-eslint/recommended', 14 | 'plugin:@typescript-eslint/recommended-requiring-type-checking', 15 | ], 16 | rules: { 17 | '@typescript-eslint/consistent-type-imports': 'error', 18 | }, 19 | }, 20 | ], 21 | root: true, 22 | }; 23 | -------------------------------------------------------------------------------- /renovate.json5: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "config:js-lib", 4 | "group:allNonMajor", 5 | "group:jestPlusTSJest", 6 | "group:jestPlusTypes", 7 | // Our default configuration. See 8 | // https://github.com/apollographql/renovate-config-apollo-open-source/blob/master/package.json 9 | "apollo-open-source", 10 | ], 11 | "packageRules": [ 12 | // We set this to the lowest supported Node.js version to ensure we don't 13 | // use newer Node.js APIs unknowingly during development which are going to 14 | // fail in CI anyway when they're run against the full range of Node.js 15 | // versions we support. 16 | { 17 | "matchPackageNames": ["@types/node"], 18 | "allowedVersions": "16.x" 19 | }, 20 | ], 21 | } 22 | -------------------------------------------------------------------------------- /tsconfig.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "rootDir": "./src", 4 | "outDir": "./dist", 5 | "target": "es2021", 6 | "module": "commonjs", 7 | "moduleResolution": "node", 8 | "esModuleInterop": true, 9 | "sourceMap": true, 10 | "declaration": true, 11 | "declarationMap": true, 12 | "removeComments": true, 13 | "strict": true, 14 | "noImplicitAny": true, 15 | "noImplicitReturns": true, 16 | "noImplicitOverride": true, 17 | "noFallthroughCasesInSwitch": true, 18 | "noUnusedParameters": true, 19 | "noUnusedLocals": true, 20 | "forceConsistentCasingInFileNames": true, 21 | "lib": ["es2021"], 22 | "types": ["node"], 23 | "baseUrl": ".", 24 | "paths": { 25 | "*" : ["types/*"] 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /.github/workflows/release-pr.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | release: 10 | name: Release 11 | runs-on: ubuntu-latest 12 | permissions: 13 | # OpenID Connect token, used for publishing with provenance 14 | # Ref: https://github.blog/2023-04-19-introducing-npm-package-provenance/ 15 | id-token: write 16 | contents: write 17 | pull-requests: write 18 | steps: 19 | - name: Checkout Repo 20 | uses: actions/checkout@v4 21 | with: 22 | # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits 23 | fetch-depth: 0 24 | 25 | - name: Setup Node.js 18.x 26 | uses: actions/setup-node@v4 27 | with: 28 | node-version: 18.x 29 | 30 | - name: Install Dependencies 31 | run: npm i 32 | 33 | - name: Create Release Pull Request / NPM Publish 34 | uses: changesets/action@v1 35 | with: 36 | publish: npm run publish-changeset 37 | env: 38 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 39 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 40 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2022- Apollo Graph, Inc. (Formerly Meteor Development Group, Inc.) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /cspell.yaml: -------------------------------------------------------------------------------- 1 | # Configuration for the cspell command-line tool and the Code Spell Checker 2 | # VSCode extension 3 | # (https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker). 4 | 5 | # Add a repo-specific dictionary. Any new real words can be added to 6 | # cspell-dict.txt, one per line. 7 | dictionaryDefinitions: 8 | - name: workspace 9 | path: './cspell-dict.txt' 10 | description: Custom Workspace Dictionary 11 | addWords: true 12 | scope: workspace 13 | dictionaries: 14 | - workspace 15 | 16 | # Ignore files that aren't check in to git as well as files that aren't written 17 | # by hand. Note that we do want to check, say, JSON files (as package.json 18 | # contains English text like package descriptions). 19 | useGitignore: true 20 | ignorePaths: 21 | - cspell.yaml 22 | - .changeset/**/* 23 | - CODEOWNERS 24 | 25 | ignoreRegExpList: 26 | # GitHub Security Advisories 27 | - GHSA-[-\w]+ 28 | 29 | overrides: 30 | # Ignore anything in a changelog file that looks like a GitHub username. 31 | - filename: '**/CHANGELOG.md' 32 | ignoreRegExpList: 33 | - "@[-\\w]+" 34 | # Ignore the targets of links in Markdown/MDX files. 35 | - filename: '**/*.md*' 36 | ignoreRegExpList: 37 | - "\\]\\([^)]+\\)" 38 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@apollo/typescript-repo-template", 3 | "private": true, 4 | "description": "A template for TypeScript projects with pre-configured tooling", 5 | "version": "0.0.0", 6 | "author": "Apollo ", 7 | "license": "MIT", 8 | "repository": { 9 | "type": "git", 10 | "url": "git+https://github.com/apollographql/typescript-repo-template" 11 | }, 12 | "homepage": "https://github.com/apollographql/typescript-repo-template#readme", 13 | "bugs": { 14 | "url": "https://github.com/apollographql/typescript-repo-template/issues" 15 | }, 16 | "main": "dist/index.js", 17 | "types": "dist/index.d.ts", 18 | "engines": { 19 | "node": ">=18.0" 20 | }, 21 | "scripts": { 22 | "build": "tsc --build tsconfig.build.json", 23 | "clean": "git clean -dfqX", 24 | "prepack": "npm run build", 25 | "prettier-check": "prettier --check .", 26 | "prettier-fix": "prettier --write .", 27 | "publish-changeset": "changeset publish", 28 | "spell-check": "cspell lint '**' '.changeset/**' --no-progress || (echo 'Add any real words to cspell-dict.txt.'; exit 1)", 29 | "test": "jest", 30 | "test:ci": "jest --coverage --ci --maxWorkers=2 --reporters=default --reporters=jest-junit", 31 | "watch": "tsc --build --watch", 32 | "lint": "eslint ." 33 | }, 34 | "devDependencies": { 35 | "@changesets/changelog-github": "0.4.8", 36 | "@changesets/cli": "2.26.2", 37 | "@jest/globals": "29.7.0", 38 | "@types/jest": "29.5.8", 39 | "@types/node": "18.18.11", 40 | "@typescript-eslint/eslint-plugin": "6.11.0", 41 | "@typescript-eslint/parser": "6.11.0", 42 | "cspell": "7.3.9", 43 | "eslint": "8.54.0", 44 | "jest": "29.7.0", 45 | "jest-junit": "16.0.0", 46 | "prettier": "3.1.0", 47 | "ts-jest": "29.1.1", 48 | "ts-node": "10.9.1", 49 | "typescript": "5.2.2" 50 | }, 51 | "volta": { 52 | "node": "20.9.0", 53 | "npm": "10.2.4" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | 3 | orbs: 4 | node: circleci/node@5.1.0 5 | 6 | commands: 7 | install-volta: 8 | description: Install volta to manage Node/npm versions 9 | steps: 10 | - run: 11 | name: Install volta 12 | # Teach the volta installer to update Circle's special env 13 | # file instead of the default. 14 | command: | 15 | curl https://get.volta.sh | PROFILE="$BASH_ENV" bash 16 | 17 | setup-node: 18 | parameters: 19 | node-version: 20 | type: string 21 | default: '' 22 | steps: 23 | - install-volta 24 | - checkout 25 | - when: 26 | condition: << parameters.node-version >> 27 | steps: 28 | - run: volta pin node@<< parameters.node-version >> 29 | - run: node --version 30 | - run: npm --version 31 | - node/install-packages 32 | 33 | jobs: 34 | NodeJS: 35 | parameters: 36 | node-version: 37 | type: string 38 | docker: 39 | - image: cimg/base:stable 40 | steps: 41 | - setup-node: 42 | node-version: <> 43 | - run: npm run build 44 | - run: npm run test:ci 45 | - store_test_results: 46 | path: junit.xml 47 | 48 | Prettier: 49 | docker: 50 | - image: cimg/base:stable 51 | steps: 52 | - setup-node 53 | - run: npm run prettier-check 54 | 55 | Lint: 56 | docker: 57 | - image: cimg/base:stable 58 | steps: 59 | - setup-node 60 | - run: npm run lint 61 | 62 | Spell Check: 63 | docker: 64 | - image: cimg/base:stable 65 | steps: 66 | - setup-node 67 | - run: npm run spell-check 68 | 69 | workflows: 70 | version: 2 71 | Build: 72 | jobs: 73 | - NodeJS: 74 | name: NodeJS << matrix.node-version >> 75 | matrix: 76 | parameters: 77 | node-version: 78 | - "18" 79 | - "20" 80 | - Prettier 81 | - Lint 82 | - Spell Check -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TypeScript Template 2 | 3 | This repo is meant to act as a reasonable foundation for a single NPM package developed in TypeScript. It makes use of a few tools that we've found particularly useful. Below are some notes on how to get started using these tools and ways in which you might want (or need) to configure them. 4 | 5 | ## GitHub 6 | 7 | In the GitHub settings tab, we typically configure a few things. 8 | 9 | **General** 10 | ✅ Automatically delete head branches 11 | 12 | **Collaborators and Teams** 13 | Add relevant teams and contributors with appropriate roles 14 | 15 | **Branches** 16 | Typically we add a branch protection rule for `main` 17 | Generally, this rule enables: 18 | * ✅ Require a pull request before merging 19 | * ✅ Require approvals (1) 20 | * ✅ Require status checks to pass before merging 21 | * Each status check must be selected via the search box. Typing "ci/" will show you a list of the ones which exist within this template. "CLA" should also be enabled. 22 | 23 | **Code Security and Analysis** 24 | * Enable "Dependabot security updates" to receive security-related PRs from Dependabot 25 | 26 | ## CircleCI 27 | 28 | This repo comes with a few Circle jobs already implemented (see [`.circleci/config.yml`](.circleci/config.yml)). Circle will run tests on the versions of Node specified in the matrix and enforce linting via Prettier. 29 | 30 | In order to enable CircleCI on your new repo, visit the [Apollo org's dashboard](https://app.circleci.com/projects/project-dashboard/github/apollographql/) and add your project. If your repo has already been initialized and added to the apollographql org, you should see the option to add your new project. 31 | 32 | ## Jest 33 | 34 | Jest is a testing framework used by most of Apollo's current projects. 35 | 36 | To run tests in the repo: 37 | `npm test` 38 | 39 | The Jest configuration can be found at `jest.config.ts`. As configured, Jest will run all files named `*.test.ts` found within any `__tests__` folder. This is simply a convention chosen by this repo and can be reconfigured via the `testRegex` configuration option in [`jest.config.ts`](jest.config.ts). 40 | 41 | For more information on configuring Jest see the [Jest docs](https://jestjs.io/docs/configuration). 42 | 43 | ## Changesets 44 | 45 | Changesets is a tool for managing package versioning, NPM releases, GitHub releases, and CHANGELOG entries. In this template, it comes configured for all of the above. 46 | 47 | ### Basic usage 48 | 49 | Changesets uses changeset files in the `.changeset` directory to determine what versioning upgrades need to happen next, along with related `CHANGELOG` updates and release notes. A changeset file is created by running `npx changeset` and following the prompts. PRs which make functional changes to the package should always come with an accompanying changeset file. The Changeset bot (details below) will comment on PRs as a reminder to contributors to include a changeset file when appropriate. 50 | 51 | ### Changeset bot 52 | 53 | #### Installation 54 | 55 | [GitHub app](https://github.com/apps/changeset-bot) 56 | > Note: a GitHub _org_ admin must approve app installations. By adding a GitHub app to your repo, you'll be submitting a request for approval. At the time of writing this, the GitHub UI doesn't make this clear. 57 | 58 | 59 | You might also be interested in adding `changeset-bot` to the repo - it leaves comments about the changeset (or lack thereof) for each PR. This serves as a nice reminder and set of instructions for how to create a changeset. 60 | 61 | ### Changesets enforced in CI (alternative to Changeset bot) 62 | 63 | The `changeset-bot` will leave a comment on every PR. If you'd prefer to enforce changesets in CI without the additional noise, you can do so by adding a step to your CircleCI config. We use the following in the Apollo Server repo: 64 | 65 | ```yaml 66 | # Ensure that any PR that changes packages has a changeset on it (perhaps 67 | # an empty one created with `changeset --empty`). 68 | # We run the Changesets job itself on all branches so that we can require 69 | # it to pass, but we don't run any steps on the "Version Packages" PRs 70 | # themselves. 71 | Changesets: 72 | docker: 73 | - image: cimg/base:stable 74 | steps: 75 | - run: echo Ensure there is at least one step 76 | - unless: 77 | condition: 78 | matches: 79 | pattern: "^changeset-release/.+$" 80 | value: << pipeline.git.branch >> 81 | steps: 82 | - setup-node 83 | - run: npm run changeset-check 84 | ``` 85 | 86 | The referenced script `changeset-check` is defined in `package.json` and is a simple script that runs `changeset status` and exits with a non-zero status if there are any changesets missing like so: 87 | 88 | ```json 89 | { 90 | // ... 91 | "scripts": { 92 | // ... 93 | "changeset-check": "changeset-check": "changeset status --verbose --since=origin/main" 94 | } 95 | } 96 | ``` 97 | 98 | ### CHANGELOG updates 99 | 100 | For proper CHANGELOG management, you MUST configure the [`.changeset/config.json`](.changeset/config.json) file for your repo. The `changelog.repo` field must be the `/` of the repo. 101 | 102 | ### NPM Publishing 103 | 104 | Changesets manages and updates a release PR automatically via a GitHub action [`.github/workflows/release-pr.yml`](.github/workflows/release-pr.yml). The PR consumes all of the committed changesets on `main` in order to bump versions of packages and update the `CHANGELOG` accordingly. Merging this PR will result in publishes to npm IF you've provided an `NPM_TOKEN` as a secret to your repo's GitHub actions (`https://github.com/apollographql//settings/secrets/actions`). Please reach out to anyone in the `#npm-apollo-bot-owners` Slack channel for a token. Changesets will also publish a GitHub release when this PR is merged. 105 | 106 | > Our action borrows directly from the action provided by `changesets`. Visit [the changesets action repo](https://github.com/changesets/action) for more info. 107 | 108 | Packages using this template will publish [with provenance](https://github.blog/2023-04-19-introducing-npm-package-provenance/). This is enabled in the `.npmrc` file. 109 | 110 | ### Removing Changesets 111 | 112 | If you're not interested in using `changesets`, just delete the [workflow](.github/workflows/release-pr.yml), uninstall the related dependencies, and delete the related scripts. 113 | 114 | > For additional information on `changesets`, [visit the docs](https://github.com/changesets/changesets#documentation). 115 | 116 | ## CodeSandbox CI 117 | 118 | > At the time of writing this, CodeSandbox CI only works for public repos. 119 | 120 | ### Installation 121 | 122 | [GitHub app](https://github.com/apps/codesandbox) 123 | > Note: a GitHub _org_ admin must approve app installations. By adding a GitHub app to your repo, you'll be submitting a request for approval. At the time of writing this, the GitHub UI doesn't make this clear. 124 | 125 | CodeSandbox CI provides an installable build of your package on every PR. If your package builds successfully, CS:CI will leave a comment on the PR with instructions on how to try out your build in a project. This gives contributors access to their work immediately, allowing them to manually test their builds or even use a fix right away. 126 | 127 | CS:CI will also provide links to sandboxes which use your newly built package if you choose. This is configurable via the `sandboxes` field in [`.codesandbox/ci.json`](.codesandbox/ci.json). This field is a list of sandbox IDs which you can find via the CodeSandbox web interface. For example, the Apollo Server repo specifies both JS and TS Apollo Server sandboxes like so: `["apollo-server-typescript-3opde","apollo-server"]`. 128 | 129 | > For additional information on configuring CS:CI, [visit the docs](https://codesandbox.io/docs/ci). 130 | 131 | ## Renovate 132 | 133 | ### Installation 134 | 135 | [GitHub app](https://github.com/apps/renovate) 136 | 137 | > Note: a GitHub _org_ admin must approve app installations. By adding a GitHub app to your repo, you'll be submitting a request for approval. At the time of writing this, the GitHub UI doesn't make this clear. 138 | 139 | Renovate automates dependency updates. The bot will open and merge PRs with updates to a variety of dependencies (including but not limited to npm dependencies). Renovate is _highly_ configurable via the [renovate.json5](renovate.json5) file. Package restrictions and scheduling are just a couple things that we commonly configure. 140 | 141 | If you've configured PRs to require approval (mentioned in [GitHub](#github)), you may want to also install [Renovate's Approve bot](https://github.com/apps/renovate-approve). The approve bot will approve all renovate PRs in order to appease the PR approval requirement. 142 | 143 | If you're unfamiliar with Renovate, the docs are really worth perusing even if just to get an idea of what kinds of configuration are possible. 144 | 145 | > For additional information on configuring Renovate, [visit the docs](https://docs.renovatebot.com/). 146 | 147 | ## Prettier 148 | 149 | Prettier is an opinionated code formatting tool. 150 | 151 | To check for formatting issues: 152 | `npm run prettier:check` 153 | 154 | To auto-fix formatting issues: 155 | `npm run prettier:fix` 156 | 157 | This is enforced in CI via the `Prettier` job. 158 | 159 | > For additional information on configuring Prettier, [visit the docs](https://prettier.io/docs/en/options). 160 | 161 | ## Volta 162 | 163 | Volta is a fast JS toolchain manager. Similar in effect to nvm, Volta allows for projects to specify their node / npm versions and will automatically handle the switching for you. 164 | 165 | If using [direnv](https://direnv.net/), Volta will automatically be installed for you. The node and npm versions are specified in [`package.json`](package.json) and Renovate handles keeping these versions up to date. 166 | 167 | > For additional information on configuring Volta, [visit the docs](https://docs.volta.sh/guide/). --------------------------------------------------------------------------------