@owlmeans/dep-config 0.1.3

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/README.md ADDED
@@ -0,0 +1,122 @@
1
+ # @owlmeans/dep-config
2
+
3
+ Shared TypeScript configuration for all `@owlmeans/*` packages. Provides base compiler options, React/JSX settings, server/Node/Bun runtime settings, and a consistent strict configuration aligned with TypeScript 6.0+.
4
+
5
+ ## Configs
6
+
7
+ | File | Purpose |
8
+ |------|---------|
9
+ | `tsconfig.base.json` | Core strict settings, ESNext target, Bundler module resolution |
10
+ | `tsconfig.react.json` | JSX + DOM lib (for React/React Native packages) |
11
+ | `tsconfig.server.json` | Server-side base: `lib: ["ESNext"]` only (no DOM) |
12
+ | `tsconfig.node.json` | Extends server + adds `types: ["node"]` (Node.js globals) |
13
+ | `tsconfig.bun.json` | Extends server + adds `types: ["bun"]` + `allowImportingTsExtensions` |
14
+
15
+ ## Usage
16
+
17
+ Add to your package's `devDependencies`:
18
+
19
+ ```json
20
+ "@owlmeans/dep-config": "workspace:*"
21
+ ```
22
+
23
+ Then create a `tsconfig.json` in your package using one of the flavors below:
24
+
25
+ ### Basic package (no JSX, no runtime-specific types)
26
+
27
+ ```json
28
+ {
29
+ "extends": [
30
+ "@owlmeans/dep-config/tsconfig.base.json"
31
+ ],
32
+ "compilerOptions": {
33
+ "rootDir": "./src/",
34
+ "outDir": "./build/"
35
+ },
36
+ "exclude": ["./dist/**/*", "./build/**/*", "./*.ts"]
37
+ }
38
+ ```
39
+
40
+ Used by: core packages, infrastructure packages.
41
+
42
+ ### Server package (no DOM, runtime-agnostic)
43
+
44
+ ```json
45
+ {
46
+ "extends": [
47
+ "@owlmeans/dep-config/tsconfig.base.json",
48
+ "@owlmeans/dep-config/tsconfig.server.json"
49
+ ],
50
+ "compilerOptions": {
51
+ "rootDir": "./src/",
52
+ "outDir": "./build/"
53
+ },
54
+ "exclude": ["./dist/**/*", "./build/**/*", "./*.ts"]
55
+ }
56
+ ```
57
+
58
+ Used by: server packages that don't need Node.js or Bun-specific APIs.
59
+
60
+ ### Node.js package
61
+
62
+ ```json
63
+ {
64
+ "extends": [
65
+ "@owlmeans/dep-config/tsconfig.base.json",
66
+ "@owlmeans/dep-config/tsconfig.node.json"
67
+ ],
68
+ "compilerOptions": {
69
+ "rootDir": "./src/",
70
+ "outDir": "./build/"
71
+ },
72
+ "exclude": ["./dist/**/*", "./build/**/*", "./*.ts"]
73
+ }
74
+ ```
75
+
76
+ Used by: packages using Node.js built-ins (fs, path, crypto, net, etc.). Requires `@types/node` in devDependencies.
77
+
78
+ ### Bun package
79
+
80
+ ```json
81
+ {
82
+ "extends": [
83
+ "@owlmeans/dep-config/tsconfig.base.json",
84
+ "@owlmeans/dep-config/tsconfig.bun.json"
85
+ ],
86
+ "compilerOptions": {
87
+ "rootDir": "./src/",
88
+ "outDir": "./build/"
89
+ },
90
+ "exclude": ["./dist/**/*", "./build/**/*", "./*.ts"]
91
+ }
92
+ ```
93
+
94
+ Used by: packages using Bun-specific APIs (Bun.serve, Bun.file, etc.). Requires `@types/bun` in devDependencies.
95
+
96
+ ### React package (JSX enabled)
97
+
98
+ ```json
99
+ {
100
+ "extends": [
101
+ "@owlmeans/dep-config/tsconfig.base.json",
102
+ "@owlmeans/dep-config/tsconfig.react.json"
103
+ ],
104
+ "compilerOptions": {
105
+ "rootDir": "./src/",
106
+ "outDir": "./build/"
107
+ },
108
+ "exclude": ["./dist/**/*", "./build/**/*", "./*.ts"]
109
+ }
110
+ ```
111
+
112
+ Used by: client packages, web packages, native packages, and any package that imports React components.
113
+
114
+ ## Key Settings (tsconfig.base.json)
115
+
116
+ - **target / module**: ESNext
117
+ - **moduleResolution**: Bundler — compatible with Bun and modern bundlers, no `.js` extension requirements on relative imports
118
+ - **isolatedModules**: true — ensures each file is independently transpilable
119
+ - **strict**: true — all strict type checks enabled
120
+ - **declaration / declarationMap / sourceMap**: true — full type and source map output
121
+ - **noUnusedLocals / noUnusedParameters**: true — clean code enforcement
122
+ - **skipLibCheck**: true — skip checking external `.d.ts` files
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@owlmeans/dep-config",
3
+ "version": "0.1.3",
4
+ "description": "Shared TypeScript configuration for @owlmeans packages",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "exports": {
8
+ "./tsconfig.base.json": "./tsconfig.base.json",
9
+ "./tsconfig.react.json": "./tsconfig.react.json",
10
+ "./tsconfig.server.json": "./tsconfig.server.json",
11
+ "./tsconfig.node.json": "./tsconfig.node.json",
12
+ "./tsconfig.bun.json": "./tsconfig.bun.json"
13
+ },
14
+ "devDependencies": {
15
+ "typescript": "^6.0.2"
16
+ },
17
+ "publishConfig": {
18
+ "access": "public"
19
+ }
20
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ESNext",
4
+ "module": "ESNext",
5
+ "moduleResolution": "Bundler",
6
+ "resolveJsonModule": true,
7
+ "allowArbitraryExtensions": true,
8
+ "allowJs": true,
9
+ "isolatedModules": true,
10
+ "esModuleInterop": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "declaration": true,
13
+ "declarationMap": true,
14
+ "sourceMap": true,
15
+ "strict": true,
16
+ "noUnusedLocals": true,
17
+ "noUnusedParameters": true,
18
+ "noImplicitOverride": true,
19
+ "useUnknownInCatchVariables": true,
20
+ "skipLibCheck": true
21
+ }
22
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": ["@owlmeans/dep-config/tsconfig.server.json"],
3
+ "compilerOptions": {
4
+ "types": ["bun"],
5
+ "allowImportingTsExtensions": true,
6
+ "rewriteRelativeImportExtensions": true,
7
+ }
8
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": ["@owlmeans/dep-config/tsconfig.server.json"],
3
+ "compilerOptions": {
4
+ "types": ["node"]
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "compilerOptions": {
3
+ "jsx": "react-jsx",
4
+ "lib": ["DOM", "DOM.Iterable", "ESNext"]
5
+ }
6
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "compilerOptions": {
3
+ "lib": ["ESNext"]
4
+ }
5
+ }