npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@cuckoointernet/tsconfig

v0.1.5

Published

These are base shared `tsconfig.json`s from which all other `tsconfig.json`'s inherit from.

Downloads

19

Readme

tsconfig

These are base shared tsconfig.jsons from which all other tsconfig.json's inherit from.

@cuckoointernet/tsconfig/base.json
├── @cuckoointernet/tsconfig/esm.json
│   └── @cuckoointernet/tsconfig/esm-jsx.json
├── @cuckoointernet/tsconfig/cjs.json
│   └── @cuckoointernet/tsconfig/cjs-jsx.json
└── @cuckoointernet/tsconfig/nextjs.json

Usage

Finding source files

Define include, exclude, compilerOptions.rootDir, and compilerOptions.outDir yourself.

{
  "extends": "@cuckoointernet/tsconfig/nextjs.json",
  "include": ["next-env.d.ts", "src/**/*.mdx", "src/**/*.ts", "src/**/*.tsx"],
  "exclude": ["node_modules", "out"],
  "compilerOptions": {
    "rootDir": "./src",
    "outDir": "./dist"
  }
}

Managing test files

  1. If you include test files in your tsconfig.json
    • ✅ TypeScript and VSCode will type check your test files
    • ❌ Test files will end up in your ./dist
  2. If you exclude test files from your tsconfig.json
    • ❌ TypeScript and VSCode will not type check your test files
    • ✅ Test files will not end up in your ./dist

To avoid this, use your tsconfig.json for type checking everything (source and tests) but define separate eg. tsconfig.build.json files which exclude your tests when building your project.

Example

{
  "main": "./dist/cjs/index.js",
  "types": "./dist/esm/index.d.ts",
  "exports": {
    ".": {
      "import": "./dist/esm/index.js",
      "require": "./dist/cjs/index.js"
    }
  },
  "files": ["./dist/**"],
  "scripts": {
    "build:cjs": "tsc --project tsconfig.cjs.json",
    "build:esm": "tsc --project tsconfig.esm.json",
    "build": "npm run clean && npm run build:esm && npm run build:cjs",
    "clean": "rm -rf dist",
    "dev:cjs": "tsc --watch --project tsconfig.cjs.json",
    "dev:esm": "tsc --watch --project tsconfig.esm.json",
    "dev": "concurrently 'npm:dev:esm' 'npm:dev:cjs'"
  }
}

Summary

@cuckoointernet/tsconfig/base.json

The Default/Base/Root config which everything else inherits from, here we define how strict we want our packages to be by default.

@cuckoointernet/tsconfig/esm.json

To be used when building for modern browsers.

@cuckoointernet/tsconfig/esm-jsx.json

To be used when building React projects for modern browsers.

@cuckoointernet/tsconfig/cjs.json

To be used when building for older browsers.

@cuckoointernet/tsconfig/cjs-jsx.json

To be used when building React projects for older browsers.

@cuckoointernet/tsconfig/nextjs.json

To be used with Next.js projects.