@crossbind/typescript-config 2.0.0-beta.50
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 +21 -0
- package/README.md +47 -0
- package/package.json +20 -0
- package/tsconfig.json +11 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Buğra Sarı and crossbind 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,47 @@
|
|
|
1
|
+
# @crossbind/typescript-config
|
|
2
|
+
|
|
3
|
+
Shared TypeScript configuration for crossbind projects. It wires the editor
|
|
4
|
+
types crossbind generates under `.crossbind/` — for C++ `.h` imports, app-local
|
|
5
|
+
Rust `.rs` imports and `cargo:` crate imports — extend it once and never
|
|
6
|
+
manage the wiring by hand:
|
|
7
|
+
|
|
8
|
+
```jsonc
|
|
9
|
+
// tsconfig.json (TS 5.5+)
|
|
10
|
+
{ "extends": "@crossbind/typescript-config" }
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```jsonc
|
|
14
|
+
// already extending another config? use the array form (TS 5.0+)
|
|
15
|
+
{ "extends": ["@react-native/typescript-config", "@crossbind/typescript-config"] }
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Install it as a direct devDependency (package-name `extends` resolves through
|
|
19
|
+
Node resolution, so a transitive copy is not enough under strict pnpm):
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
npm install -D @crossbind/typescript-config
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## What it wires
|
|
26
|
+
|
|
27
|
+
- `rootDirs` overlays your project root with `.crossbind/types/`, where crossbind
|
|
28
|
+
mirrors the declaration of every relative native import — C++ headers
|
|
29
|
+
(`import { Native } from './native/native.h'`) and app-local Rust files
|
|
30
|
+
(`import { Hull } from './native/geo_surface.rs'`) alike. Relative imports
|
|
31
|
+
are typed by path resolution, so this overlay is what keeps generated
|
|
32
|
+
`.d.ts` files out of your source folders. Each of those declarations also
|
|
33
|
+
types `initNative()`, the boot call every generated module exports.
|
|
34
|
+
- `include` pulls in `.crossbind/rust-crates/types/`, the ambient
|
|
35
|
+
`declare module 'cargo:<name>'` declarations for direct crate imports.
|
|
36
|
+
|
|
37
|
+
## Caveats
|
|
38
|
+
|
|
39
|
+
- `include` is overridden (not merged) when your tsconfig defines its own —
|
|
40
|
+
keep `.crossbind/rust-crates/types/**/*.d.ts` in your list in that case.
|
|
41
|
+
- Paths assume the default cache directory (`.crossbind`). If you override
|
|
42
|
+
`paths.cache` in `crossbind.config.js`, copy the two settings into your own
|
|
43
|
+
tsconfig with the custom path instead.
|
|
44
|
+
|
|
45
|
+
## License
|
|
46
|
+
|
|
47
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@crossbind/typescript-config",
|
|
3
|
+
"version": "2.0.0-beta.50",
|
|
4
|
+
"description": "Shared TypeScript configuration wiring the editor types crossbind generates under .crossbind/ (C++ .h and Rust .rs imports, cargo: crates) - extend it once and never manage the wiring by hand.",
|
|
5
|
+
"homepage": "https://github.com/crossbind/crossbind/tree/main/tooling/typescript-config#readme",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/crossbind/crossbind.git"
|
|
9
|
+
},
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"crossbind",
|
|
13
|
+
"typescript",
|
|
14
|
+
"tsconfig",
|
|
15
|
+
"rust"
|
|
16
|
+
],
|
|
17
|
+
"files": [
|
|
18
|
+
"tsconfig.json"
|
|
19
|
+
]
|
|
20
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @crossbind/typescript-config - wires the editor types crossbind generates under .crossbind/.
|
|
2
|
+
// Extend from your tsconfig (TS 5.5+; array form when you already extend another config):
|
|
3
|
+
// { "extends": "@crossbind/typescript-config" }
|
|
4
|
+
// ${configDir} resolves against YOUR config's directory, not this package.
|
|
5
|
+
// Note: a project-defined "include" overrides the one below - keep the glob in yours then.
|
|
6
|
+
{
|
|
7
|
+
"compilerOptions": {
|
|
8
|
+
"rootDirs": ["${configDir}", "${configDir}/.crossbind/types"]
|
|
9
|
+
},
|
|
10
|
+
"include": ["${configDir}/.crossbind/rust-crates/types/**/*.d.ts"]
|
|
11
|
+
}
|