@nexim/typescript-config 1.0.1 → 2.0.0

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,31 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.0.0](https://github.com/the-nexim/nanolib/compare/@nexim/typescript-config@1.1.0...@nexim/typescript-config@2.0.0) (2025-01-06)
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * **typescript-config:** rename `tsconfig.json` to `tsconfig.base.json`
11
+
12
+ ### Features
13
+
14
+ * **typescript-config:** add new tsconfig environment ([536a173](https://github.com/the-nexim/nanolib/commit/536a17360081edf2b02d363e90fd9dc903d7306c)) by @njfamirm
15
+
16
+ ### Bug Fixes
17
+
18
+ * **typescript-config:** remove root/out directory ([f0e6c9f](https://github.com/the-nexim/nanolib/commit/f0e6c9fa9dd31ec55df5cafb5b56d0209040225a)) by @njfamirm
19
+ * **typescript-config:** set typescript as peer dependency ([0c09cb2](https://github.com/the-nexim/nanolib/commit/0c09cb2593ac594593f8994449764cf22cd47879)) by @njfamirm
20
+
21
+ ### Code Refactoring
22
+
23
+ * **typescript-config:** rename `tsconfig.json` to `tsconfig.base.json` ([341ac77](https://github.com/the-nexim/nanolib/commit/341ac7718ff44f4f69f4f98bac906e7a86aed0cf)) by @arashagp
24
+
25
+ ## [1.1.0](https://github.com/the-nexim/nanolib/compare/@nexim/typescript-config@1.0.1...@nexim/typescript-config@1.1.0) (2025-01-05)
26
+
27
+ ### Features
28
+
29
+ * **service-worker:** add service worker utilities and logging support ([#18](https://github.com/the-nexim/nanolib/issues/18)) ([d428086](https://github.com/the-nexim/nanolib/commit/d428086dd98fbb5dfd077d14de4de8dd29ed78dc)) by @
30
+
6
31
  ## [1.0.1](https://github.com/the-nexim/nanolib/compare/@nexim/typescript-config@1.0.0...@nexim/typescript-config@1.0.1) (2024-12-10)
7
32
 
8
33
  **Note:** Version bump only for package @nexim/typescript-config
package/README.md CHANGED
@@ -1,14 +1,15 @@
1
- # Nexim TypeScript Config
1
+ # Nexim TypeScript Configuration
2
2
 
3
- ![NPM Version](https://img.shields.io/npm/v/%40nexim%2Ftypescript-config)
4
- ![npm bundle size](https://img.shields.io/bundlephobia/min/%40nexim%2Ftypescript-config)
3
+ ![NPM Version](https://img.shields.io/npm/v/@nexim/typescript-config)
5
4
  ![Build & Lint & Test](https://github.com/the-nexim/nanolib/actions/workflows/build-lint-test.yaml/badge.svg)
6
- ![NPM Downloads](https://img.shields.io/npm/dm/%40nexim%2Ftypescript-config)
7
- ![NPM License](https://img.shields.io/npm/l/%40nexim%2Ftypescript-config)
5
+ ![NPM Downloads](https://img.shields.io/npm/dm/@nexim/typescript-config)
6
+ ![NPM License](https://img.shields.io/npm/l/@nexim/typescript-config)
8
7
 
9
- This is a base TypeScript configuration for Nexim projects.
8
+ This package provides pre-configured settings for using TypeScript in Nexim projects.
10
9
 
11
- ## installation
10
+ ## Installation
11
+
12
+ Install the package as a development dependency:
12
13
 
13
14
  ```bash
14
15
  yarn add -D @nexim/typescript-config
@@ -16,15 +17,52 @@ yarn add -D @nexim/typescript-config
16
17
 
17
18
  ## Usage
18
19
 
19
- Create a `tsconfig.json` file in the root of your project:
20
+ To use this configuration, create a `tsconfig.json` file in the root of your project and extend one of the provided configurations:
21
+
22
+ ### Base Configuration (`tsconfig.base.json`)
23
+
24
+ This configuration contains the fundamental settings shared by all other configurations. It's generally not used directly, but serves as the foundation for other, more specific configurations.
25
+
26
+ ### Browser Application (`tsconfig.browser.app.json`)
27
+
28
+ Use this configuration for browser-based applications. It extends the base configuration and is primarily used for type checking during development. It doesn't produce build outputs.
29
+
30
+ ```json
31
+ {
32
+ "extends": "@nexim/typescript-config/tsconfig.browser.app.json",
33
+ "include": ["src/**/*.ts", "src/*.ts"] // Include all TypeScript files in your source directory
34
+ }
35
+ ```
36
+
37
+ ### Browser Library (`tsconfig.browser.lib.json`)
38
+
39
+ Use this configuration for browser-based libraries. extends the base configuration, generates declaration files (\*.d.ts), and supports referencing other projects.
40
+
41
+ ```json
42
+ {
43
+ "extends": "@nexim/typescript-config/tsconfig.browser.lib.json",
44
+ "include": ["src/**/*.ts", "src/*.ts"] // Include all TypeScript files in your source directory
45
+ }
46
+ ```
47
+
48
+ ### Node.js Application (`tsconfig.node.app.json`)
49
+
50
+ Use this configuration for nodejs-based applications. It extends the base configuration and includes Node.js specific type definitions. It doesn't produce build outputs and primarily used for type checking during development.
51
+
52
+ ```json
53
+ {
54
+ "extends": "@nexim/typescript-config/tsconfig.node.app.json",
55
+ "include": ["src/**/*.ts", "src/*.ts"] // Include all TypeScript files in your source directory
56
+ }
57
+ ```
58
+
59
+ ### Node.js Library (`tsconfig.node.lib.json`)
60
+
61
+ Use this configuration for nodejs-based libraries. extends the base configuration, incorporates Node.js type definitions, generates declaration files (\*.d.ts), and supports referencing other projects.
20
62
 
21
63
  ```json
22
64
  {
23
- "extends": "@nexim/typescript-config",
24
- "compilerOptions": {
25
- "rootDir": "src",
26
- "outDir": "dist"
27
- },
28
- "include": ["src/**/*.ts"]
65
+ "extends": "@nexim/typescript-config/tsconfig.node.lib.json",
66
+ "include": ["src/**/*.ts", "src/*.ts"] // Include all TypeScript files in your source directory
29
67
  }
30
68
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexim/typescript-config",
3
- "version": "1.0.1",
3
+ "version": "2.0.0",
4
4
  "description": "Base TypeScript configuration for Nexim projects.",
5
5
  "keywords": [
6
6
  "typescript",
@@ -19,19 +19,21 @@
19
19
  "directory": "packages/typescript-config"
20
20
  },
21
21
  "license": "AGPL-3.0-only",
22
- "author": "S. Amir Mohammad Najafi <njfamirm@gmail.com> (www.njfamirm.ir)",
22
+ "author": "S. Amir Mohammad Najafi <njfamirm@gmail.com> (https://www.njfamirm.ir)",
23
23
  "contributors": [
24
24
  "Arash Ghardashpoor <arash.qardashpoor@gmail.com> (https://www.agpagp.ir)"
25
25
  ],
26
- "main": "tsconfig.json",
26
+ "peerDependencies": {
27
+ "typescript": "^5"
28
+ },
29
+ "main": "tsconfig.base.json",
27
30
  "files": [
28
31
  "**/*.{js,mjs,cjs,map,d.ts,html,md,LEGAL.txt}",
29
- "tsconfig.json",
30
- "LICENSE",
31
- "!demo/**/*"
32
+ "tsconfig*.json",
33
+ "LICENSE"
32
34
  ],
33
35
  "publishConfig": {
34
36
  "access": "public"
35
37
  },
36
- "gitHead": "a02afd5953a471c872d63e4eb2e7ccbf90c21abb"
38
+ "gitHead": "8d72218409e5b93b27b5026d9cea8f0bf0b1414a"
37
39
  }
@@ -16,7 +16,6 @@
16
16
  // "outFile": "./",
17
17
  // "outDir": "./",
18
18
  // "rootDir": "./src",
19
- "composite": true,
20
19
  // "tsBuildInfoFile": ".tsbuildinfo",
21
20
  // "removeComments": true,
22
21
  // "noEmit": true,
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "./tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "noEmit": true,
5
+ },
6
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "./tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "emitDeclarationOnly": true,
5
+ "composite": true,
6
+ },
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "./tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "noEmit": true,
5
+ "types": ["node"]
6
+ },
7
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "./tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "emitDeclarationOnly": true,
5
+ "composite": true,
6
+ "types": ["node"]
7
+ },
8
+ }