-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(typescript-config)!: add typeScript configuration files for `bro…
…wser`, `service`, `browser-package` and `node-package` environments (#28)
- Loading branch information
Showing
14 changed files
with
97 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
{ | ||
"extends": "@nexim/typescript-config/tsconfig.json", | ||
"extends": "@nexim/typescript-config/tsconfig.browser.lib.json", | ||
"compilerOptions": { | ||
"rootDir": "src", | ||
"outDir": "dist", | ||
"emitDeclarationOnly": true, | ||
"composite": true, | ||
"types": ["@alwatr/nano-build", "@alwatr/type-helper"] | ||
}, | ||
"include": ["src/**/*.ts"], | ||
"references": [] | ||
"include": ["src/**/*.ts", "src/*.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
{ | ||
"extends": "@nexim/typescript-config/tsconfig.json", | ||
"extends": "@nexim/typescript-config/tsconfig.browser.lib.json", | ||
"compilerOptions": { | ||
"rootDir": "src", | ||
"outDir": "dist", | ||
"emitDeclarationOnly": true, | ||
"composite": true, | ||
"types": ["@alwatr/nano-build", "@alwatr/type-helper"] | ||
}, | ||
"include": ["src/**/*.ts"], | ||
"references": [] | ||
"include": ["src/**/*.ts", "src/*.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
{ | ||
"extends": "@nexim/typescript-config/tsconfig.json", | ||
"extends": "@nexim/typescript-config/tsconfig.browser.lib.json", | ||
"compilerOptions": { | ||
"rootDir": "src", | ||
"outDir": "dist", | ||
"emitDeclarationOnly": true, | ||
"composite": true, | ||
"types": ["@alwatr/nano-build", "@alwatr/type-helper"] | ||
}, | ||
"include": ["src/**/*.ts"], | ||
"references": [] | ||
"include": ["src/**/*.ts", "src/*.ts"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
{ | ||
"extends": "@nexim/typescript-config/tsconfig.json", | ||
"extends": "@nexim/typescript-config/tsconfig.browser.lib.json", | ||
"compilerOptions": { | ||
"rootDir": "src", | ||
"outDir": "dist", | ||
"emitDeclarationOnly": true, | ||
"composite": true, | ||
"types": ["@alwatr/nano-build", "@alwatr/type-helper"] | ||
}, | ||
"include": ["src/**/*.ts"], | ||
"references": [] | ||
"include": ["src/**/*.ts", "src/*.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,68 @@ | ||
# Nexim TypeScript Config | ||
# Nexim TypeScript Configuration | ||
|
||
![NPM Version](https://img.shields.io/npm/v/@nexim/typescript-config) | ||
![Build & Lint & Test](https://github.com/the-nexim/nanolib/actions/workflows/build-lint-test.yaml/badge.svg) | ||
![NPM Downloads](https://img.shields.io/npm/dm/@nexim/typescript-config) | ||
![NPM License](https://img.shields.io/npm/l/@nexim/typescript-config) | ||
|
||
## Overview | ||
This package provides pre-configured settings for using TypeScript in Nexim projects. | ||
|
||
This is a base TypeScript configuration for Nexim projects. | ||
## Installation | ||
|
||
## installation | ||
Install the package as a development dependency: | ||
|
||
```bash | ||
yarn add -D @nexim/typescript-config | ||
``` | ||
|
||
## Usage | ||
|
||
Create a `tsconfig.json` file in the root of your project: | ||
To use this configuration, create a `tsconfig.json` file in the root of your project and extend one of the provided configurations: | ||
|
||
### Base Configuration (`tsconfig.base.json`) | ||
|
||
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. | ||
|
||
### Browser Application (`tsconfig.browser.app.json`) | ||
|
||
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. | ||
|
||
```json | ||
{ | ||
"extends": "@nexim/typescript-config/tsconfig.browser.app.json", | ||
"include": ["src/**/*.ts", "src/*.ts"] // Include all TypeScript files in your source directory | ||
} | ||
``` | ||
|
||
### Browser Library (`tsconfig.browser.lib.json`) | ||
|
||
Use this configuration for browser-based libraries. extends the base configuration, generates declaration files (\*.d.ts), and supports referencing other projects. | ||
|
||
```json | ||
{ | ||
"extends": "@nexim/typescript-config/tsconfig.browser.lib.json", | ||
"include": ["src/**/*.ts", "src/*.ts"] // Include all TypeScript files in your source directory | ||
} | ||
``` | ||
|
||
### Node.js Application (`tsconfig.node.app.json`) | ||
|
||
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. | ||
|
||
```json | ||
{ | ||
"extends": "@nexim/typescript-config/tsconfig.node.app.json", | ||
"include": ["src/**/*.ts", "src/*.ts"] // Include all TypeScript files in your source directory | ||
} | ||
``` | ||
|
||
### Node.js Library (`tsconfig.node.lib.json`) | ||
|
||
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. | ||
|
||
```json | ||
{ | ||
"extends": "@nexim/typescript-config", | ||
"compilerOptions": { | ||
"rootDir": "src", | ||
"outDir": "dist" | ||
}, | ||
"include": ["src/**/*.ts"] | ||
"extends": "@nexim/typescript-config/tsconfig.node.lib.json", | ||
"include": ["src/**/*.ts", "src/*.ts"] // Include all TypeScript files in your source directory | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,10 +23,13 @@ | |
"contributors": [ | ||
"Arash Ghardashpoor <[email protected]> (https://www.agpagp.ir)" | ||
], | ||
"main": "tsconfig.json", | ||
"peerDependencies": { | ||
"typescript": "^5" | ||
}, | ||
"main": "tsconfig.base.json", | ||
"files": [ | ||
"**/*.{js,mjs,cjs,map,d.ts,html,md,LEGAL.txt}", | ||
"tsconfig.json", | ||
"tsconfig*.json", | ||
"LICENSE" | ||
], | ||
"publishConfig": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": "./tsconfig.base.json", | ||
"compilerOptions": { | ||
"noEmit": true, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "./tsconfig.base.json", | ||
"compilerOptions": { | ||
"emitDeclarationOnly": true, | ||
"composite": true, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "./tsconfig.base.json", | ||
"compilerOptions": { | ||
"noEmit": true, | ||
"types": ["node"] | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "./tsconfig.base.json", | ||
"compilerOptions": { | ||
"emitDeclarationOnly": true, | ||
"composite": true, | ||
"types": ["node"] | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters