@zayne-labs/tsconfig 0.0.7 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,52 @@
1
+ name: Changesets Release and Publish
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+
7
+ concurrency: ${{ github.workflow }}-${{ github.ref }}
8
+
9
+ permissions:
10
+ contents: write
11
+ pull-requests: write
12
+
13
+ jobs:
14
+ release:
15
+ # if: ${{ github.event.workflow_run.conclusion == 'success' }}
16
+ runs-on: ubuntu-latest
17
+ timeout-minutes: 15
18
+ strategy:
19
+ matrix:
20
+ node-version: [20.x]
21
+ steps:
22
+ - name: checkout code repository
23
+ uses: actions/checkout@v4
24
+ with:
25
+ # This makes Actions fetch all Git history so that Changesets
26
+ # can generate changelogs with the correct commits.
27
+ fetch-depth: 0
28
+
29
+ - name: Setup pnpm
30
+ uses: pnpm/action-setup@v4
31
+ with:
32
+ version: 9.11.0
33
+
34
+ - name: Setup Node.js 20.x
35
+ uses: actions/setup-node@v4
36
+ with:
37
+ node-version: ${{ matrix.node-version }}
38
+ cache: "pnpm"
39
+
40
+ - name: Install dependencies
41
+ run: pnpm install --frozen-lockfile
42
+
43
+ - name: Create Release Pull Request or Publish to npm
44
+ uses: changesets/action@v1
45
+ with:
46
+ commit: "ci: update package version"
47
+ title: "ci: update package version"
48
+ publish: pnpm release
49
+
50
+ env:
51
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
package/CHANGELOG.md ADDED
@@ -0,0 +1,37 @@
1
+ # @zayne-labs/tsconfig
2
+
3
+ ## 0.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - b92f8e1: fix provenance
8
+
9
+ ## 0.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 599c354: feat: remove vite config
14
+
15
+ ## 1.0.0
16
+
17
+ ### Major Changes
18
+
19
+ - 9dadb83: feat:! removed vite config
20
+
21
+ ## 0.1.2
22
+
23
+ ### Patch Changes
24
+
25
+ - cd7243e: add provenance
26
+
27
+ ## 0.1.1
28
+
29
+ ### Patch Changes
30
+
31
+ - 3ef8a97: .
32
+
33
+ ## 0.1.0
34
+
35
+ ### Minor Changes
36
+
37
+ - 195899d: added new import paths
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # `@zayne-labs/tsconfig`
2
2
 
3
- This package helps set proper presets for most projects. Inspired by Matt Pocock's [TSConfig Cheat Sheet](https://www.totaltypescript.com/tsconfig-cheat-sheet).
3
+ This package helps set proper tsconfig presets for most projects. Inspired by Matt Pocock's [TSConfig Cheat Sheet](https://www.totaltypescript.com/tsconfig-cheat-sheet).
4
4
 
5
5
  ## Setup
6
6
 
@@ -8,7 +8,7 @@ This package helps set proper presets for most projects. Inspired by Matt Pocock
8
8
 
9
9
  ```bash
10
10
  # Npm
11
- npm install --save-dev @zayne-labs/tsconfig
11
+ npm install --save-dev @zayne-labs/tsconfig
12
12
 
13
13
  # Pnpm
14
14
  pnpm add -D @zayne-labs/tsconfig
@@ -20,8 +20,8 @@ pnpm add -D @zayne-labs/tsconfig
20
20
 
21
21
  ```jsonc
22
22
  {
23
- // When building an app that runs in the DOM with an external bundler
24
- "extends": "@zayne-labs/tsconfig/bundler/dom/app",
23
+ // For building an app that runs in the DOM with an external bundler
24
+ "extends": "@zayne-labs/tsconfig/bundler/dom/app"
25
25
  }
26
26
  ```
27
27
 
@@ -35,13 +35,15 @@ If yes, use this selection of configs:
35
35
 
36
36
  ```jsonc
37
37
  {
38
- // For code that runs in the DOM:
39
- "extends": "@zayne-labs/tsconfig/tsc/dom/app", // For an app
40
- "extends": "@zayne-labs/tsconfig/tsc/dom/library", // For a library
41
-
42
- // For code that doesn't run in the DOM (for instance, in Node.js):
43
- "extends": "@zayne-labs/tsconfig/tsc/no-dom/app", // For an app
44
- "extends": "@zayne-labs/tsconfig/tsc/no-dom/library", // For a library
38
+ // For code that runs in the DOM:
39
+ "extends": "@zayne-labs/tsconfig/tsc/dom/app", // For an app
40
+ "extends": "@zayne-labs/tsconfig/tsc/dom/library", // For a library
41
+ "extends": "@zayne-labs/tsconfig/tsc/dom/library-monorepo", // For a library in a monorepo
42
+
43
+ // For code that doesn't run in the DOM (for instance, in Node.js):
44
+ "extends": "@zayne-labs/tsconfig/tsc/no-dom/app", // For an app
45
+ "extends": "@zayne-labs/tsconfig/tsc/no-dom/library", // For a library
46
+ "extends": "@zayne-labs/tsconfig/tsc/no-dom/library-monorepo" // For a library in a monorepo
45
47
  }
46
48
  ```
47
49
 
@@ -51,13 +53,15 @@ If no, you're probably using an external bundler.
51
53
 
52
54
  ```jsonc
53
55
  {
54
- // For code that runs in the DOM:
55
- "extends": "@zayne-labs/tsconfig/bundler/dom/app", // For an app
56
- "extends": "@zayne-labs/tsconfig/bundler/dom/library", // For a library
57
-
58
- // For code that doesn't run in the DOM (for instance, in Node.js):
59
- "extends": "@zayne-labs/tsconfig/bundler/no-dom/app", // For an app
60
- "extends": "@zayne-labs/tsconfig/bundler/no-dom/library", // For a library
56
+ // For code that runs in the DOM:
57
+ "extends": "@zayne-labs/tsconfig/bundler/dom/app", // For an app
58
+ "extends": "@zayne-labs/tsconfig/bundler/dom/library", // For a library
59
+ "extends": "@zayne-labs/tsconfig/bundler/dom/library-monorepo", // For a library in a monorepo
60
+
61
+ // For code that doesn't run in the DOM (for instance, in Node.js):
62
+ "extends": "@zayne-labs/tsconfig/bundler/no-dom/app", // For an app
63
+ "extends": "@zayne-labs/tsconfig/bundler/no-dom/library", // For a library
64
+ "extends": "@zayne-labs/tsconfig/bundler/no-dom/library-monorepo" // For a library in a monorepo
61
65
  }
62
66
  ```
63
67
 
@@ -67,10 +71,7 @@ The following are currently supported framework-specific options, will add more
67
71
 
68
72
  ```jsonc
69
73
  {
70
- // For a vite app
71
- "extends": "@zayne-labs/tsconfig/bundler/dom/vite",
72
-
73
- // For a nextjs app
74
- "extends": "@zayne-labs/tsconfig/bundler/dom/next",
74
+ // For a nextjs app
75
+ "extends": "@zayne-labs/tsconfig/bundler/dom/next"
75
76
  }
76
77
  ```
@@ -26,6 +26,7 @@
26
26
 
27
27
  /* Bundler Mode: */
28
28
  "module": "Preserve",
29
+ // "moduleResolution": "Bundler", // This is inferred from module: "Preserve"
29
30
  "target": "ESNext",
30
31
  "noEmit": true,
31
32
  "jsx": "preserve",
@@ -24,7 +24,7 @@
24
24
  "noErrorTruncation": true,
25
25
  "noUncheckedIndexedAccess": true,
26
26
 
27
- /* If NOT transpiling with TypeScript: */
27
+ /* Bundler Mode: */
28
28
  "module": "Preserve",
29
29
  "target": "ESNext",
30
30
  "noEmit": true,
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@zayne-labs/tsconfig",
3
- "version": "0.0.7",
3
+ "version": "0.2.1",
4
+ "type": "module",
4
5
  "description": "A collection of TypeScript configurations for various projects, based on Total TypeScript's TSConfig Cheat Sheet, with a few additions.",
5
6
  "repository": {
6
7
  "type": "git",
@@ -9,25 +10,33 @@
9
10
  "homepage": "https://github.com/ryan-zayne/tsconfig#readme",
10
11
  "license": "MIT",
11
12
  "author": "Ryan Zayne",
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
12
16
  "exports": {
13
17
  "./tsc": "./tsc/dom/tsconfig.app.json",
14
18
  "./tsc/dom": "./tsc/dom/tsconfig.app.json",
15
19
  "./tsc/dom/app": "./tsc/dom/tsconfig.app.json",
16
- "./tsc/dom/library": "./tsc/dom/tsconfig.lib.json",
20
+ "./tsc/dom/library": "./tsc/dom/tsconfig.library.json",
21
+ "./tsc/dom/library-monorepo": "./tsc/dom/tsconfig.library-monorepo.json",
17
22
  "./tsc/no-dom": "./tsc/no-dom/tsconfig.app.json",
18
23
  "./tsc/no-dom/app": "./tsc/no-dom/tsconfig.app.json",
19
- "./tsc/no-dom/library": "./tsc/no-dom/tsconfig.lib.json",
24
+ "./tsc/no-dom/library": "./tsc/no-dom/tsconfig.library.json",
20
25
  "./bundler": "./bundler/tsconfig.dom.json",
21
26
  "./bundler/dom": "./bundler/tsconfig.dom.json",
22
27
  "./bundler/dom/app": "./bundler/tsconfig.dom.json",
23
28
  "./bundler/dom/library": "./bundler/tsconfig.dom.json",
29
+ "./bundler/dom/library-monorepo": "./bundler/tsconfig.dom.json",
30
+ "./bundler/next": "./bundler/tsconfig.next.json",
24
31
  "./bundler/no-dom": "./bundler/tsconfig.no-dom.json",
25
32
  "./bundler/no-dom/app": "./bundler/tsconfig.no-dom.json",
26
33
  "./bundler/no-dom/library": "./bundler/tsconfig.no-dom.json",
27
- "./bundler/vite": "./bundler/tsconfig.vite.json",
28
- "./bundler/next": "./bundler/tsconfig.next.json"
34
+ "./bundler/no-dom/library-monorepo": "./bundler/tsconfig.no-dom.json"
29
35
  },
30
36
  "devDependencies": {
31
37
  "@changesets/cli": "^2.27.5"
38
+ },
39
+ "scripts": {
40
+ "release": "changeset publish"
32
41
  }
33
42
  }
@@ -5,9 +5,9 @@
5
5
  "skipLibCheck": true,
6
6
  "resolveJsonModule": true,
7
7
  "moduleDetection": "force",
8
- "useDefineForClassFields": true,
9
8
  "isolatedModules": true,
10
9
  "verbatimModuleSyntax": true,
10
+ "useDefineForClassFields": true,
11
11
 
12
12
  /* Don't allow importing JavaScript files by default, to avoid mistake "any" (burnt me before): */
13
13
  "allowJs": false,
@@ -24,16 +24,20 @@
24
24
  "noErrorTruncation": true,
25
25
  "noUncheckedIndexedAccess": true,
26
26
 
27
- /* Bundler mode: */
28
- "module": "Preserve",
29
- "target": "ESNext",
30
- "noEmit": true,
31
- "jsx": "preserve",
27
+ /* If transpiling with TypeScript: */
28
+ "module": "NodeNext",
29
+ "sourceMap": true,
30
+ "target": "ES2022",
31
+ "outDir": "dist",
32
+
33
+ /* If you're building for a library: */
34
+ "declaration": true,
32
35
 
33
- /* Vite Bundler mode: */
34
- "types": ["vite/client"],
36
+ /* AND if you're building for a library in a monorepo: */
37
+ "composite": true,
38
+ "declarationMap": true,
35
39
 
36
40
  /* If your code runs in the DOM: */
37
- "lib": ["ESNext", "DOM", "DOM.Iterable"]
41
+ "lib": ["ES2022", "DOM", "DOM.Iterable"]
38
42
  }
39
43
  }
@@ -0,0 +1,43 @@
1
+ {
2
+ "compilerOptions": {
3
+ /* Base Options: */
4
+ "esModuleInterop": true,
5
+ "skipLibCheck": true,
6
+ "resolveJsonModule": true,
7
+ "moduleDetection": "force",
8
+ "isolatedModules": true,
9
+ "verbatimModuleSyntax": true,
10
+ "useDefineForClassFields": true,
11
+
12
+ /* Don't allow importing JavaScript files by default, to avoid mistake "any" (burnt me before): */
13
+ "allowJs": false,
14
+
15
+ /* Linting: */
16
+ "strict": true,
17
+ "noImplicitOverride": true,
18
+ "noImplicitReturns": true,
19
+ "noImplicitThis": true,
20
+ "noFallthroughCasesInSwitch": true,
21
+ "allowUnreachableCode": false,
22
+ "allowSyntheticDefaultImports": true,
23
+ "forceConsistentCasingInFileNames": true,
24
+ "noErrorTruncation": true,
25
+ "noUncheckedIndexedAccess": true,
26
+
27
+ /* If transpiling with TypeScript: */
28
+ "module": "NodeNext",
29
+ "sourceMap": true,
30
+ "target": "ES2022",
31
+ "outDir": "dist",
32
+
33
+ /* If you're building for a library: */
34
+ "declaration": true,
35
+
36
+ /* AND if you're building for a library in a monorepo: */
37
+ "composite": true,
38
+ "declarationMap": true,
39
+
40
+ /* If your code doesn't run in the DOM: */
41
+ "lib": ["ES2022"]
42
+ }
43
+ }