@bearei/tsconfig 0.0.0-stage → 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 ADDED
@@ -0,0 +1,13 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file. The format is based on
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to
5
+ [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## 2.0.0 — 2026-10-26
8
+
9
+ ### Added
10
+
11
+ - `base.json` with the interop and library-check options shared by every Bearei project.
12
+ - `node.json` for NestJS and Node libraries, moving the previous `@bearei/nest` compiler options into a reusable preset.
13
+ - `react-native.json` for React Native projects, extending `@react-native/typescript-config` with the Bearei decorator, library and `verbatimModuleSyntax` settings.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Bearei
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.
package/README.md CHANGED
@@ -1,3 +1,48 @@
1
- # Temporary Holding Version
1
+ # @bearei/tsconfig
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Shared TypeScript presets for Bearei projects. Extend a preset by path; no build step is involved.
4
+
5
+ | Preset | Use for |
6
+ | ------------------- | ---------------------------------------- |
7
+ | `base.json` | Interop and library-check defaults |
8
+ | `node.json` | NestJS / Node libraries and services |
9
+ | `react-native.json` | React Native and React Native Web apps |
10
+
11
+ English | [中文](./README.zh-CN.md)
12
+
13
+ ## Usage
14
+
15
+ ```bash
16
+ yarn add -D @bearei/tsconfig typescript
17
+ ```
18
+
19
+ Node:
20
+
21
+ ```json
22
+ {
23
+ "extends": "@bearei/tsconfig/node.json"
24
+ }
25
+ ```
26
+
27
+ React Native:
28
+
29
+ ```bash
30
+ yarn add -D @react-native/typescript-config
31
+ ```
32
+
33
+ ```json
34
+ {
35
+ "extends": ["@react-native/typescript-config", "@bearei/tsconfig/react-native.json"],
36
+ "compilerOptions": {
37
+ "types": ["nativewind/types", "jest", "node"]
38
+ },
39
+ "include": ["**/*.ts", "**/*.tsx"]
40
+ }
41
+ ```
42
+
43
+ The React Native config stays in the consuming project so the preset resolves it from the same
44
+ `node_modules` tree as the app. Later entries in `extends` win, so the Bearei preset overrides only
45
+ the options it owns.
46
+
47
+ `include`, `exclude` and project-specific `types` stay in the consuming project. The presets only
48
+ cover options that must not drift between projects.
@@ -0,0 +1,46 @@
1
+ # @bearei/tsconfig
2
+
3
+ Bearei 项目的共享 TypeScript 预设。按路径 `extends` 即可,不需要构建。
4
+
5
+ | 预设 | 适用场景 |
6
+ | ------------------- | ----------------------------------- |
7
+ | `base.json` | 互操作与库检查的公共默认值 |
8
+ | `node.json` | NestJS / Node 库与服务 |
9
+ | `react-native.json` | React Native 与 React Native Web 应用 |
10
+
11
+ [English](./README.md) | 中文
12
+
13
+ ## 使用
14
+
15
+ ```bash
16
+ yarn add -D @bearei/tsconfig typescript
17
+ ```
18
+
19
+ Node:
20
+
21
+ ```json
22
+ {
23
+ "extends": "@bearei/tsconfig/node.json"
24
+ }
25
+ ```
26
+
27
+ React Native:
28
+
29
+ ```bash
30
+ yarn add -D @react-native/typescript-config
31
+ ```
32
+
33
+ ```json
34
+ {
35
+ "extends": ["@react-native/typescript-config", "@bearei/tsconfig/react-native.json"],
36
+ "compilerOptions": {
37
+ "types": ["nativewind/types", "jest", "node"]
38
+ },
39
+ "include": ["**/*.ts", "**/*.tsx"]
40
+ }
41
+ ```
42
+
43
+ React Native 的官方配置留在使用方,这样预设与应用从同一棵 `node_modules` 解析它。`extends`
44
+ 数组中靠后的配置优先,因此 Bearei 预设只会覆盖自己负责的选项。
45
+
46
+ `include`、`exclude` 与项目特有的 `types` 留在使用方。预设只收口那些不允许在项目之间漂移的选项。
package/base.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "Bearei base",
4
+ "compilerOptions": {
5
+ "esModuleInterop": true,
6
+ "skipLibCheck": true
7
+ }
8
+ }
package/node.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "Bearei Node",
4
+ "extends": "./base.json",
5
+ "compilerOptions": {
6
+ "allowSyntheticDefaultImports": true,
7
+ "declaration": true,
8
+ "emitDecoratorMetadata": true,
9
+ "experimentalDecorators": true,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "incremental": true,
12
+ "module": "NodeNext",
13
+ "moduleResolution": "NodeNext",
14
+ "noFallthroughCasesInSwitch": false,
15
+ "noImplicitAny": false,
16
+ "removeComments": true,
17
+ "sourceMap": true,
18
+ "strict": true,
19
+ "strictBindCallApply": false,
20
+ "strictNullChecks": true,
21
+ "strictPropertyInitialization": false,
22
+ "target": "ES2022"
23
+ }
24
+ }
package/package.json CHANGED
@@ -1,6 +1,42 @@
1
1
  {
2
2
  "name": "@bearei/tsconfig",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "2.0.0",
4
+ "description": "Shared TypeScript configurations for Bearei projects",
5
+ "keywords": [
6
+ "bearei",
7
+ "tsconfig",
8
+ "typescript"
9
+ ],
10
+ "homepage": "https://github.com/bear-ei/config/tree/main/packages/tsconfig#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/bear-ei/config/issues"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/bear-ei/config.git",
17
+ "directory": "packages/tsconfig"
18
+ },
19
+ "author": "bearei <bear_ei@outlook.com>",
20
+ "license": "MIT",
21
+ "files": [
22
+ "base.json",
23
+ "node.json",
24
+ "react-native.json",
25
+ "CHANGELOG.md"
26
+ ],
27
+ "engines": {
28
+ "node": ">=20"
29
+ },
30
+ "peerDependencies": {
31
+ "@react-native/typescript-config": ">=0.76",
32
+ "typescript": ">=5.5"
33
+ },
34
+ "peerDependenciesMeta": {
35
+ "@react-native/typescript-config": {
36
+ "optional": true
37
+ }
38
+ },
39
+ "publishConfig": {
40
+ "access": "public"
41
+ }
6
42
  }
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "Bearei React Native",
4
+ "extends": "./base.json",
5
+ "compilerOptions": {
6
+ "emitDecoratorMetadata": true,
7
+ "experimentalDecorators": true,
8
+ "lib": [
9
+ "ES2020",
10
+ "DOM",
11
+ "DOM.Iterable"
12
+ ],
13
+ "strictNullChecks": true,
14
+ "strictPropertyInitialization": false,
15
+ "verbatimModuleSyntax": true
16
+ }
17
+ }