@wsxjs/wsx-tsconfig 0.0.9

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 WSX Framework Contributors
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 ADDED
@@ -0,0 +1,136 @@
1
+ # @wsxjs/wsx-tsconfig
2
+
3
+ Shared TypeScript configuration for WSX Framework projects.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install --save-dev @wsxjs/wsx-tsconfig
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ### Basic Setup
14
+
15
+ Extend the base configuration in your `tsconfig.json`:
16
+
17
+ ```json
18
+ {
19
+ "extends": "@wsxjs/wsx-tsconfig/tsconfig.base.json",
20
+ "compilerOptions": {
21
+ "outDir": "./dist"
22
+ },
23
+ "include": ["src/**/*"]
24
+ }
25
+ ```
26
+
27
+ ### With Build Output
28
+
29
+ If you need to emit declaration files:
30
+
31
+ ```json
32
+ {
33
+ "extends": "@wsxjs/wsx-tsconfig/tsconfig.base.json",
34
+ "compilerOptions": {
35
+ "outDir": "./dist",
36
+ "rootDir": "./src",
37
+ "declaration": true,
38
+ "declarationMap": true,
39
+ "sourceMap": true
40
+ },
41
+ "include": ["src/**/*"],
42
+ "exclude": ["dist", "node_modules"]
43
+ }
44
+ ```
45
+
46
+ ### Development Only (No Emit)
47
+
48
+ For development projects that don't need to emit files:
49
+
50
+ ```json
51
+ {
52
+ "extends": "@wsxjs/wsx-tsconfig/tsconfig.json",
53
+ "include": ["src/**/*"]
54
+ }
55
+ ```
56
+
57
+ ## What's Included
58
+
59
+ The base configuration includes:
60
+
61
+ - ✅ **JSX Support**: `jsx: "react-jsx"` with `jsxImportSource: "@wsxjs/wsx-core"`
62
+ - ✅ **Decorator Support**: `experimentalDecorators: true` and `useDefineForClassFields: false` (required for `@state` decorator)
63
+ - ✅ **Modern ES Features**: ES2020 target with ESNext modules
64
+ - ✅ **Type Safety**: Strict mode enabled with additional checks
65
+ - ✅ **WSX Types**: Automatically includes `@wsxjs/wsx-core` types
66
+
67
+ ## Configuration Details
68
+
69
+ ### Required Options for @state Decorator
70
+
71
+ The configuration includes these critical options for `@state` decorator support:
72
+
73
+ ```json
74
+ {
75
+ "experimentalDecorators": true,
76
+ "useDefineForClassFields": false
77
+ }
78
+ ```
79
+
80
+ **Important**: Without these options, the `@state` decorator will not work correctly.
81
+
82
+ ## Examples
83
+
84
+ ### Vite Project
85
+
86
+ ```json
87
+ {
88
+ "extends": "@wsxjs/wsx-tsconfig/tsconfig.base.json",
89
+ "compilerOptions": {
90
+ "noEmit": true
91
+ },
92
+ "include": ["src/**/*", "src/**/*.wsx"]
93
+ }
94
+ ```
95
+
96
+ ### Library Package
97
+
98
+ ```json
99
+ {
100
+ "extends": "@wsxjs/wsx-tsconfig/tsconfig.base.json",
101
+ "compilerOptions": {
102
+ "outDir": "./dist",
103
+ "rootDir": "./src",
104
+ "declaration": true,
105
+ "declarationMap": true
106
+ },
107
+ "include": ["src/**/*"],
108
+ "exclude": ["dist", "node_modules", "**/__tests__/**"]
109
+ }
110
+ ```
111
+
112
+ ### Test Configuration
113
+
114
+ ```json
115
+ {
116
+ "extends": "@wsxjs/wsx-tsconfig/tsconfig.base.json",
117
+ "compilerOptions": {
118
+ "types": [
119
+ "@wsxjs/wsx-core",
120
+ "@testing-library/jest-dom",
121
+ "vitest/globals"
122
+ ]
123
+ },
124
+ "include": ["src/**/*", "src/**/*.test.ts"]
125
+ }
126
+ ```
127
+
128
+ ## Related Packages
129
+
130
+ - [`@wsxjs/wsx-core`](../core) - Core WSX Framework
131
+ - [`@wsxjs/wsx-vite-plugin`](../vite-plugin) - Vite plugin (required for `@state` decorator)
132
+
133
+ ## License
134
+
135
+ MIT
136
+
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@wsxjs/wsx-tsconfig",
3
+ "version": "0.0.9",
4
+ "description": "Shared TypeScript configuration for WSX Framework projects",
5
+ "type": "module",
6
+ "main": "./tsconfig.json",
7
+ "files": [
8
+ "tsconfig.json",
9
+ "tsconfig.base.json",
10
+ "README.md"
11
+ ],
12
+ "keywords": [
13
+ "wsx",
14
+ "typescript",
15
+ "tsconfig",
16
+ "web-components"
17
+ ],
18
+ "author": "WSX Framework",
19
+ "license": "MIT",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/wsxjs/wsxjs.git",
23
+ "directory": "packages/wsx-tsconfig"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ }
28
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "compilerOptions": {
4
+ "target": "ES2020",
5
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
6
+ "module": "ESNext",
7
+ "moduleResolution": "bundler",
8
+ "resolveJsonModule": true,
9
+ "allowImportingTsExtensions": true,
10
+ "isolatedModules": true,
11
+ "skipLibCheck": true,
12
+ "strict": true,
13
+ "noUnusedLocals": true,
14
+ "noUnusedParameters": true,
15
+ "noFallthroughCasesInSwitch": true,
16
+ "forceConsistentCasingInFileNames": true,
17
+ "esModuleInterop": true,
18
+ "allowSyntheticDefaultImports": true,
19
+ "jsx": "react-jsx",
20
+ "jsxImportSource": "@wsxjs/wsx-core",
21
+ "experimentalDecorators": true,
22
+ "emitDecoratorMetadata": true,
23
+ "useDefineForClassFields": false,
24
+ "types": ["@wsxjs/wsx-core"]
25
+ }
26
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "./tsconfig.base.json",
4
+ "compilerOptions": {
5
+ "noEmit": true
6
+ }
7
+ }