@sandustry-modding/types 0.3.0 → 0.3.1

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.
@@ -5,6 +5,18 @@ All notable changes to this project are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.3.1] - 2026-08-27
9
+
10
+ ### Fixed
11
+
12
+ - Deep package imports such as `@sandustry-modding/types/sandkit/engine` (Node `exports` `*` matches one path segment; map file and `index.d.ts` targets under `src/`)
13
+ - Ship root `CHANGELOG.md` and `LICENSE` in the npm tarball
14
+ - Document ambient setup with `/// <reference types="@sandustry-modding/types" />` (do not list this package under `compilerOptions.types`)
15
+
16
+ ### Added
17
+
18
+ - `npm run validate` gate: declaration typecheck, unit tests, and packed-tarball consumer probes
19
+
8
20
  ## [0.3.0] - 2026-08-27
9
21
 
10
22
  ### Changed
@@ -40,6 +52,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
40
52
  - Ambient `sandkit` free variable and type aliases via `global.d.ts`
41
53
  - Docsify API reference generated from the declarations
42
54
 
55
+ [0.3.1]: https://github.com/sandustry-modding/SandustryTypes/releases/tag/v0.3.1
43
56
  [0.3.0]: https://github.com/sandustry-modding/SandustryTypes/releases/tag/v0.3.0
44
57
  [0.2.0]: https://github.com/sandustry-modding/SandustryTypes/releases/tag/v0.2.0
45
58
  [0.1.1]: https://github.com/sandustry-modding/SandustryTypes/releases/tag/v0.1.1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 sandustry-modding
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
@@ -37,31 +37,17 @@ Declaration files use `export namespace` because it is the usual `.d.ts` pattern
37
37
  npm install @sandustry-modding/types
38
38
  ```
39
39
 
40
- ### Project config (preferred)
40
+ ### Ambient types (preferred)
41
41
 
42
- Add the package to `compilerOptions.types` in `tsconfig.json` or `jsconfig.json`:
43
-
44
- ```json
45
- {
46
- "compilerOptions": {
47
- "types": ["@sandustry-modding/types"]
48
- }
49
- }
50
- ```
51
-
52
- If you already list other packages in `types` (for example `"react"` or `"node"`), keep those entries and add `"@sandustry-modding/types"` to the same array. A non-empty `types` list replaces TypeScript’s default auto-inclusion of all `@types/*` packages.
53
-
54
- `jsconfig.json` uses the same shape for JavaScript mods.
55
-
56
- ### Per-file reference
57
-
58
- You can also pull the ambient types into one file:
42
+ Pull the host `sandkit` ambient into your project with a triple-slash reference. Put it at the top of `main.js` / `worker.js`, or in a small ambient `.d.ts` that your `tsconfig` / `jsconfig` includes:
59
43
 
60
44
  ```ts
61
45
  /// <reference types="@sandustry-modding/types" />
62
46
  ```
63
47
 
64
- That triple-slash directive works in `.ts` and `.js` (including checked JS with `checkJs`). Put it at the top of `main.js` / `worker.js`, or in a small ambient `.d.ts` included by your project.
48
+ That works in `.ts` and `.js` (including checked JS with `checkJs`).
49
+
50
+ Do **not** list `@sandustry-modding/types` under `compilerOptions.types`. That list only loads packages from `node_modules/@types` (for example `"react"` or `"node"`).
65
51
 
66
52
  Deep declaration modules are also available, for example:
67
53
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sandustry-modding/types",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "TypeScript declarations and API docs for the Sandustry Sandkit host API",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -17,14 +17,61 @@
17
17
  "types": "./src/global.d.ts"
18
18
  },
19
19
  "./package.json": "./package.json",
20
- "./*": {
21
- "types": "./src/*"
20
+ "./sandkit": {
21
+ "types": "./src/sandkit/index.d.ts"
22
+ },
23
+ "./sandkit/*": {
24
+ "types": [
25
+ "./src/sandkit/*.d.ts",
26
+ "./src/sandkit/*/index.d.ts"
27
+ ]
28
+ },
29
+ "./sandkit/*/*": {
30
+ "types": [
31
+ "./src/sandkit/*/*.d.ts",
32
+ "./src/sandkit/*/*/index.d.ts"
33
+ ]
34
+ },
35
+ "./sandkit/*/*/*": {
36
+ "types": [
37
+ "./src/sandkit/*/*/*.d.ts",
38
+ "./src/sandkit/*/*/*/index.d.ts"
39
+ ]
40
+ },
41
+ "./shared": {
42
+ "types": "./src/shared/index.d.ts"
43
+ },
44
+ "./shared/*": {
45
+ "types": [
46
+ "./src/shared/*.d.ts",
47
+ "./src/shared/*/index.d.ts"
48
+ ]
49
+ },
50
+ "./shared/*/*": {
51
+ "types": [
52
+ "./src/shared/*/*.d.ts",
53
+ "./src/shared/*/*/index.d.ts"
54
+ ]
55
+ },
56
+ "./worker": {
57
+ "types": "./src/worker/index.d.ts"
58
+ },
59
+ "./worker/*": {
60
+ "types": [
61
+ "./src/worker/*.d.ts",
62
+ "./src/worker/*/index.d.ts"
63
+ ]
64
+ },
65
+ "./worker/*/*": {
66
+ "types": [
67
+ "./src/worker/*/*.d.ts",
68
+ "./src/worker/*/*/index.d.ts"
69
+ ]
22
70
  }
23
71
  },
24
72
  "files": [
25
73
  "src/**/*.d.ts",
26
74
  "CHANGELOG.md",
27
- "docs/Changelog.md",
28
75
  "LICENSE",
29
76
  "README.md"
30
77
  ],
@@ -33,7 +80,10 @@
33
80
  "docs:api": "node scripts/generate-api-docs.mjs",
34
81
  "docs:serve": "npx --yes docsify-cli serve docs",
35
82
  "test": "node --test scripts/api-search.test.js",
36
- "typecheck": "tsc -p tsconfig.json --noEmit"
83
+ "typecheck": "tsc -p tsconfig.json --noEmit",
84
+ "verify-package": "node scripts/verify-package.mjs",
85
+ "validate": "npm run typecheck && npm test && npm run verify-package",
86
+ "prepack": "npm run validate"
37
87
  },
38
88
  "devDependencies": {
39
89
  "@types/react": "^18.3.1",
package/docs/README.md DELETED
@@ -1,62 +0,0 @@
1
- # Sandkit API
2
-
3
- > [!WARNING]
4
- > **Unofficial** community docs. Not affiliated with Lantto Games, Hooded Horse, or the [official Sandustry wiki](https://wiki.hoodedhorse.com/Sandustry/Sandustry_Official_Wiki). See the [official Sandkit docs](https://sandustry.com/sandkit.html).
5
-
6
- Community TypeScript reference for the live Sandustry `sandkit` host API. Package: [`@sandustry-modding/types`](https://www.npmjs.com/package/@sandustry-modding/types).
7
-
8
- ## Start here
9
-
10
- | Go to | When you need |
11
- | --- | --- |
12
- | [Namespaces](modules.md) | Browse namespaces by group |
13
- | [Full API reference](full.md) | All namespaces on one page |
14
- | [Main thread](api/sandkit.api.md) | `main.js` APIs (`sandkit.api`) |
15
- | [Worker thread](api/sandkit.api.worker.md) | `worker.js` APIs (subset + direct mutations) |
16
- | [Engine](api/sandkit.engine.md) | Escape hatch (`sandkit.engine`) |
17
- | [Enums](api/sandkit.enums.md) | Runtime enum values |
18
- | [React](api/sandkit.react.md) | HUD JSX helpers |
19
-
20
- ## Install types
21
-
22
- ```bash
23
- npm install @sandustry-modding/types
24
- ```
25
-
26
- ### Project config (preferred)
27
-
28
- In `tsconfig.json` or `jsconfig.json`:
29
-
30
- ```json
31
- {
32
- "compilerOptions": {
33
- "types": ["@sandustry-modding/types"]
34
- }
35
- }
36
- ```
37
-
38
- If `types` already lists other packages (for example `"react"` or `"node"`), add `"@sandustry-modding/types"` to that array. A non-empty `types` list replaces auto-inclusion of all `@types/*` packages.
39
-
40
- ### Per-file reference
41
-
42
- ```ts
43
- /// <reference types="@sandustry-modding/types" />
44
- ```
45
-
46
- Works in `.ts` and `.js` (including checked JS). Put it at the top of a source file, or in an ambient `.d.ts` included by the project.
47
-
48
- Use the ambient `sandkit` free name in `main.js`. In `worker.js`, type the API as `WorkerSandkitApi` — worker and main surfaces overlap but are not interchangeable.
49
-
50
- ## Also useful
51
-
52
- - [Official Sandkit docs](https://sandustry.com/sandkit.html)
53
- - [Sandustry Mod Template](https://sandustry-modding.github.io/SandustryModTemplate/#/)
54
- - [Official Sandustry wiki](https://wiki.hoodedhorse.com/Sandustry/Sandustry_Official_Wiki)
55
-
56
- ## Regenerate
57
-
58
- From the package repo root:
59
-
60
- ```bash
61
- npm run docs:api
62
- ```