@bento/types 0.1.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/LICENSE +9 -0
- package/README.md +39 -0
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +16 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/package.json +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 GoDaddy Operating Company, LLC.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# @bento/types
|
|
2
|
+
|
|
3
|
+
A shared TypeScript types package for the Bento library. This package centralizes common type definitions to reduce duplication, improve consistency, and simplify type maintenance across the Bento library.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @bento/types
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
Import types directly from the package. Eg:
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import type { UnknownObject } from '@bento/types';
|
|
17
|
+
|
|
18
|
+
interface Data {
|
|
19
|
+
elements: UnknownObject
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Contributing
|
|
24
|
+
|
|
25
|
+
When adding new types to the library, follow these guidelines:
|
|
26
|
+
|
|
27
|
+
1. Organize types into appropriate categories
|
|
28
|
+
2. Document types with JSDoc comments
|
|
29
|
+
3. Add tests for the types in the `test` directory
|
|
30
|
+
4. Ensure exported types have descriptive names
|
|
31
|
+
5. Export them from the main `src/index.ts` file
|
|
32
|
+
|
|
33
|
+
## Testing
|
|
34
|
+
|
|
35
|
+
Tests are written using [`Vitest's type testing approach`](https://vitest.dev/guide/testing-types). To run the tests for the types, run the following command:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm test
|
|
39
|
+
```
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents an object with string keys and any values.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
type AnyObject = Record<string, any>;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Represents an object with string keys and unknown values.
|
|
10
|
+
* Safer alternative to AnyObject when the value types are not known.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
type UnknownObject = Record<string, unknown>;
|
|
15
|
+
|
|
16
|
+
export type { AnyObject, UnknownObject };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents an object with string keys and any values.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
type AnyObject = Record<string, any>;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Represents an object with string keys and unknown values.
|
|
10
|
+
* Safer alternative to AnyObject when the value types are not known.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
type UnknownObject = Record<string, unknown>;
|
|
15
|
+
|
|
16
|
+
export type { AnyObject, UnknownObject };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bento/types",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared TypeScript types used across the Bento library.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsup-node",
|
|
9
|
+
"lint": "biome lint && tsc --noEmit",
|
|
10
|
+
"posttest": "npm run lint",
|
|
11
|
+
"pretest": "npm run build",
|
|
12
|
+
"test": "vitest --run",
|
|
13
|
+
"test:watch": "vitest"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/godaddy/bento.git"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"bento",
|
|
21
|
+
"component",
|
|
22
|
+
"library",
|
|
23
|
+
"react",
|
|
24
|
+
"types",
|
|
25
|
+
"typescript",
|
|
26
|
+
"value"
|
|
27
|
+
],
|
|
28
|
+
"author": "GoDaddy Operating Company, LLC",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/godaddy/bento/issues"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://github.com/godaddy/bento#readme",
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"package.json"
|
|
37
|
+
],
|
|
38
|
+
"exports": {
|
|
39
|
+
".": {
|
|
40
|
+
"import": {
|
|
41
|
+
"types": "./dist/index.d.ts",
|
|
42
|
+
"default": "./dist/index.js"
|
|
43
|
+
},
|
|
44
|
+
"require": {
|
|
45
|
+
"types": "./dist/index.d.cts",
|
|
46
|
+
"default": "./dist/index.cjs"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public",
|
|
52
|
+
"registry": "https://registry.npmjs.org/"
|
|
53
|
+
}
|
|
54
|
+
}
|