@sister.software/tsconfig 9.2.0 → 10.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/README.md CHANGED
@@ -1,6 +1,44 @@
1
1
  # `@sister.software/tsconfig`
2
2
 
3
- This package contains the TypeScript configuration used by Sister Software.
3
+ The TypeScript configuration used by Sister Software. Three flavors, one shared base.
4
4
 
5
- While it is possible to use this configuration outside of our projects,
6
- you may find that it is not as useful as other popular configurations.
5
+ While it is possible to use this configuration outside of our projects, you may find that it is not
6
+ as useful as other popular configurations.
7
+
8
+ ## Usage
9
+
10
+ ```jsonc
11
+ // A package that runs on Node.
12
+ { "extends": "@sister.software/tsconfig/node" }
13
+ ```
14
+
15
+ ```jsonc
16
+ // A package that runs in a browser.
17
+ { "extends": "@sister.software/tsconfig/web" }
18
+ ```
19
+
20
+ ```jsonc
21
+ // A package that is neither — pure logic with no runtime globals.
22
+ { "extends": "@sister.software/tsconfig" }
23
+ ```
24
+
25
+ | Entry point | Adds to the base |
26
+ | ----------- | ----------------------------------------------------------------- |
27
+ | `.` | nothing — strict, `nodenext`, `lib: ["ESNext"]`, no ambient types |
28
+ | `./node` | `types: ["node"]` |
29
+ | `./web` | `lib: ["ESNext", "DOM", "DOM.Iterable"]`, `types: []`, `react-jsx` |
30
+
31
+ Pick by what the code _runs on_, not by what builds it. A browser package whose build scripts use
32
+ Node still extends `/web`; those scripts are excluded from the project.
33
+
34
+ ### Why `./web` sets `types: []`
35
+
36
+ An absent `types` auto-includes every `@types` package in `node_modules`. In a monorepo that hands a
37
+ browser package the whole tooling surface, so Node's globals resolve in code that will never see
38
+ them. Empty means "nothing ambient" — add what you need explicitly.
39
+
40
+ ### Compatibility
41
+
42
+ Subpath resolution for `extends` needs **TypeScript 5.0+**, which is when `extends` began resolving
43
+ through a package's `exports` map. `main` still points at the neutral config, so older TypeScript
44
+ resolves the bare specifier as it always did — it just cannot reach `/node` or `/web`.
package/node.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "./tsconfig.json",
4
+ "compilerOptions": {
5
+ // Node's globals (process, Buffer, node: builtins). Everything else is inherited.
6
+ "types": ["node"]
7
+ }
8
+ }
package/package.json CHANGED
@@ -1,10 +1,21 @@
1
1
  {
2
2
  "name": "@sister.software/tsconfig",
3
- "version": "9.2.0",
3
+ "version": "10.0.0",
4
4
  "description": "Sister Software's base TypeScript configuration.",
5
5
  "license": "AGPL-3.0",
6
6
  "author": "teffen@sister.software",
7
7
  "main": "tsconfig.json",
8
+ "exports": {
9
+ "./package.json": "./package.json",
10
+ ".": "./tsconfig.json",
11
+ "./node": "./node.json",
12
+ "./web": "./web.json"
13
+ },
14
+ "files": [
15
+ "tsconfig.json",
16
+ "node.json",
17
+ "web.json"
18
+ ],
8
19
  "type": "module",
9
20
  "engines": {
10
21
  "node": ">=24.0"
package/tsconfig.json CHANGED
@@ -8,7 +8,6 @@
8
8
  "incremental": true,
9
9
  "verbatimModuleSyntax": true,
10
10
  "lib": ["ESNext"],
11
- "types": ["node"],
12
11
  "newLine": "lf",
13
12
  "noFallthroughCasesInSwitch": true,
14
13
  "outDir": "${configDir}/out",
@@ -27,8 +26,7 @@
27
26
  "module": "nodenext",
28
27
  "moduleResolution": "nodenext",
29
28
  "allowImportingTsExtensions": true,
30
- "rootDir": "${configDir}",
31
- "jsx": "react-jsx"
29
+ "rootDir": "${configDir}"
32
30
  },
33
31
  "exclude": [
34
32
  // ---
package/web.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "./tsconfig.json",
4
+ "compilerOptions": {
5
+ "lib": ["ESNext", "DOM", "DOM.Iterable"],
6
+ // Empty rather than absent: absent auto-includes every @types package in node_modules, which in a
7
+ // monorepo hands a browser package the whole tooling surface. Add what you need explicitly.
8
+ "types": [],
9
+ // Inert for a package with no .tsx — set here so a browser package that grows one needs no config change.
10
+ "jsx": "react-jsx"
11
+ }
12
+ }