|
15 | 15 |
|
16 | 16 | A comprehensive collection of TypeScript utilities for working with schemas, JSON-LD, API clients, and general-purpose development tools. |
17 | 17 |
|
18 | | -## Overview |
19 | | - |
20 | | -This monorepo provides a curated set of packages for building modern web applications, with a focus on: |
21 | | - |
22 | | -- **Type-Safe Schema Processing**: Convert JSON Schema and OpenAPI specifications to TypeScript |
23 | | -- **JSON-LD Tooling**: Advanced JSON-LD processing with filtering and graph operations |
24 | | -- **API Clients**: Lightweight HTTP clients for Node.js and browsers |
25 | | -- **Developer Utilities**: String manipulation, package detection, and object handling |
26 | | - |
27 | 18 | ## Packages |
28 | 19 |
|
29 | | -### Schema & TypeScript Generation |
30 | | - |
31 | | -#### [`schema-typescript`](./packages/schema-typescript) |
32 | | -Convert JSON schemas to TypeScript interfaces automatically with full support for `$ref` and `$defs`. |
33 | | - |
34 | | -```bash |
35 | | -npm install schema-typescript |
36 | | -``` |
37 | | - |
38 | | -**Features:** |
39 | | -- JSON Schema to TypeScript conversion |
40 | | -- Full support for references and definitions |
41 | | -- Type-safe interface generation |
42 | | -- Minimal dependencies |
43 | | - |
44 | | -#### [`schema-sdk`](./packages/schema-sdk) |
45 | | -Generate TypeScript clients from OpenAPI specifications with comprehensive type safety. |
46 | | - |
47 | | -```bash |
48 | | -npm install schema-sdk |
49 | | -``` |
50 | | - |
51 | | -**Features:** |
52 | | -- OpenAPI Specification (Swagger) support |
53 | | -- Automatic TypeScript client generation |
54 | | -- JSON Patch support for schema modifications |
55 | | -- Modular and reusable design |
56 | | - |
57 | | -#### [`@schema-typescript/cli`](./packages/cli) |
58 | | -Command-line interface for schema-typescript operations. |
59 | | - |
60 | | -```bash |
61 | | -npm install @schema-typescript/cli |
62 | | -``` |
63 | | - |
64 | | -### JSON-LD Tools |
65 | | - |
66 | | -#### [`jsonldjs`](./packages/jsonld-tools) |
67 | | -A powerful, generic JSON-LD builder with comprehensive entity and property filtering capabilities. |
68 | | - |
69 | | -```bash |
70 | | -npm install jsonldjs |
71 | | -``` |
72 | | - |
73 | | -**Features:** |
74 | | -- Configuration-first design with immutable builders |
75 | | -- Fluent interface for building complex filtering logic |
76 | | -- Property-level filtering by entity IDs or types |
77 | | -- Subgraph extraction with reference following |
78 | | -- Full TypeScript support with type inference |
79 | | - |
80 | | -**Quick Example:** |
81 | | -```typescript |
82 | | -import { createJsonLdBuilder } from 'jsonldjs'; |
83 | | - |
84 | | -const result = createJsonLdBuilder() |
85 | | - .baseGraph(jsonldGraph) |
86 | | - .includeTypes(['Organization', 'Person']) |
87 | | - .excludeTypes(['ImageObject']) |
88 | | - .build({ prettyPrint: true }); |
89 | | -``` |
90 | | - |
91 | | -### API Clients |
92 | | - |
93 | | -#### [`@interweb/node-api-client`](./packages/node-api-client) |
94 | | -Lightweight and flexible HTTP client for Node.js applications. |
95 | | - |
96 | | -```bash |
97 | | -npm install @interweb/node-api-client |
98 | | -``` |
99 | | - |
100 | | -**Features:** |
101 | | -- Support for GET, POST, PUT, PATCH, DELETE |
102 | | -- Customizable headers and query parameters |
103 | | -- Timeout configuration |
104 | | -- Node.js optimized |
105 | | - |
106 | | -#### [`@interweb/fetch-api-client`](./packages/fetch-api-client) |
107 | | -Universal HTTP client supporting both Node.js and browser environments. |
108 | | - |
109 | | -```bash |
110 | | -npm install @interweb/fetch-api-client |
111 | | -``` |
112 | | - |
113 | | -**Features:** |
114 | | -- Works in Node.js and browsers |
115 | | -- Fetch API based |
116 | | -- Common HTTP methods support |
117 | | -- Customizable options |
118 | | - |
119 | | -#### [`@interweb/http-errors`](./packages/http-errors) |
120 | | -HTTP error handling utilities for API clients. |
121 | | - |
122 | | -```bash |
123 | | -npm install @interweb/http-errors |
124 | | -``` |
125 | | - |
126 | | -### Utilities |
127 | | - |
128 | | -#### [`komoji`](./packages/komoji) |
129 | | -the tiny case transformer — effortlessly transform strings between naming conventions |
130 | | - |
131 | | -```bash |
132 | | -npm install komoji |
133 | | -``` |
134 | | - |
135 | | -#### [`@interweb/find-pkg`](./packages/find-pkg) |
136 | | -Locate and parse `package.json` files from within build directories or packages. |
137 | | - |
138 | | -```bash |
139 | | -npm install @interweb/find-pkg |
140 | | -``` |
141 | | - |
142 | | -**Example:** |
143 | | -```javascript |
144 | | -import { findPackageJson } from '@interweb/find-pkg'; |
145 | | - |
146 | | -const packageJson = findPackageJson(); |
147 | | -console.log('Package name:', packageJson.name); |
148 | | -console.log('Version:', packageJson.version); |
149 | | -``` |
150 | | - |
151 | | -#### [`nested-obj`](./packages/nested-obj) |
152 | | -Simple and lightweight utility for safely accessing and modifying nested object properties. |
153 | | - |
154 | | -```bash |
155 | | -npm install nested-obj |
156 | | -``` |
157 | | - |
158 | | -**Features:** |
159 | | -- Safe nested property access |
160 | | -- Set values at specific paths |
161 | | -- Check if paths exist |
162 | | -- TypeScript support |
163 | | - |
164 | | -**Example:** |
165 | | -```typescript |
166 | | -import objectPath from 'nested-obj'; |
167 | | - |
168 | | -const obj = { user: { name: 'John', address: { city: 'NYC' } } }; |
169 | | - |
170 | | -// Get nested values |
171 | | -const name = objectPath.get(obj, 'user.name'); // 'John' |
172 | | - |
173 | | -// Set nested values |
174 | | -objectPath.set(obj, 'user.address.zip', '10001'); |
175 | | - |
176 | | -// Check if path exists |
177 | | -const hasCity = objectPath.has(obj, 'user.address.city'); // true |
178 | | -``` |
179 | | - |
180 | | -#### [`strfy-js`](./packages/strfy-js) |
181 | | -Stringify JSON as JavaScript with extended serialization capabilities. |
182 | | - |
183 | | -```bash |
184 | | -npm install strfy-js |
185 | | -``` |
186 | | - |
187 | | -**Features:** |
188 | | -- Extended serialization beyond standard JSON |
189 | | -- Properties without quotes |
190 | | -- Customizable output (camelCase, quotes, etc.) |
191 | | -- Lightweight and optimized for performance |
192 | | - |
193 | | -**Example:** |
194 | | -```javascript |
195 | | -import { jsStringify } from 'strfy-js'; |
196 | | - |
197 | | -const obj = { |
198 | | - "$schema": "schema.json", |
199 | | - "chain_id": "cosmos-1" |
200 | | -}; |
201 | | - |
202 | | -console.log(jsStringify(obj, { camelCase: true, quotes: 'single' })); |
203 | | -// Output: { $schema: 'schema.json', chainId: 'cosmos-1' } |
204 | | -``` |
| 20 | +| Package | npm | Source | Description | |
| 21 | +|---------|-----|--------|-------------| |
| 22 | +| **appstash** | [](https://www.npmjs.com/package/appstash) | [GitHub](./packages/appstash) | Simple, clean application directory resolution | |
| 23 | +| **create-gen-app** | [](https://www.npmjs.com/package/create-gen-app) | [GitHub](./packages/create-gen-app) | Clone and customize template repositories with variable replacement | |
| 24 | +| **inquirerer** | [](https://www.npmjs.com/package/inquirerer) | [GitHub](./packages/inquirerer) | TypeScript-first library for building beautiful CLI interfaces with interactive prompts | |
| 25 | +| **jsonldjs** | [](https://www.npmjs.com/package/jsonldjs) | [GitHub](./packages/jsonld-tools) | Powerful JSON-LD builder with comprehensive filtering and subgraph extraction | |
| 26 | +| **komoji** | [](https://www.npmjs.com/package/komoji) | [GitHub](./packages/komoji) | the tiny case transformer — effortlessly transform strings between naming conventions | |
| 27 | +| **nested-obj** | [](https://www.npmjs.com/package/nested-obj) | [GitHub](./packages/nested-obj) | Safely access and modify nested object properties using string paths | |
| 28 | +| **schema-sdk** | [](https://www.npmjs.com/package/schema-sdk) | [GitHub](./packages/schema-sdk) | Convert JSON Schema OpenAPI Spec to TypeScript Clients | |
| 29 | +| **schema-typescript** | [](https://www.npmjs.com/package/schema-typescript) | [GitHub](./packages/schema-typescript) | Convert JSON Schema to TypeScript Definitions | |
| 30 | +| **strfy-js** | [](https://www.npmjs.com/package/strfy-js) | [GitHub](./packages/strfy-js) | Stringify JSON as JavaScript with extended serialization capabilities | |
| 31 | +| **yanse** | [](https://www.npmjs.com/package/yanse) | [GitHub](./packages/yanse) | Fast and lightweight terminal color styling library with chalk-like API | |
| 32 | +| **@interweb/fetch-api-client** | [](https://www.npmjs.com/package/@interweb/fetch-api-client) | [GitHub](./packages/fetch-api-client) | Universal Fetch-based HTTP client for Node.js and browsers | |
| 33 | +| **@interweb/find-pkg** | [](https://www.npmjs.com/package/@interweb/find-pkg) | [GitHub](./packages/find-pkg) | Find the package.json file from within a build/package | |
| 34 | +| **@interweb/http-errors** | [](https://www.npmjs.com/package/@interweb/http-errors) | [GitHub](./packages/http-errors) | HTTP error handling utilities for API clients | |
| 35 | +| **@interweb/node-api-client** | [](https://www.npmjs.com/package/@interweb/node-api-client) | [GitHub](./packages/node-api-client) | Lightweight HTTP client for Node.js RESTful APIs | |
| 36 | +| **@schema-typescript/cli** | [](https://www.npmjs.com/package/@schema-typescript/cli) | [GitHub](./packages/schema-ts-cli) | schema-typescript CLI | |
205 | 37 |
|
206 | 38 | ## Development |
207 | 39 |
|
@@ -238,31 +70,6 @@ pnpm test |
238 | 70 | pnpm lint |
239 | 71 | ``` |
240 | 72 |
|
241 | | -## Development |
242 | | - |
243 | | -### Setup |
244 | | - |
245 | | -1. Clone the repository: |
246 | | - |
247 | | -```bash |
248 | | -git clone https://github.com/hyperweb-io/dev-utils.git |
249 | | -``` |
250 | | - |
251 | | -2. Install dependencies: |
252 | | - |
253 | | -```bash |
254 | | -cd dev-utils |
255 | | -pnpm install |
256 | | -pnpm build |
257 | | -``` |
258 | | - |
259 | | -3. Test the package of interest: |
260 | | - |
261 | | -```bash |
262 | | -cd packages/<packagename> |
263 | | -pnpm test:watch |
264 | | -``` |
265 | | - |
266 | 73 | ## Disclaimer |
267 | 74 |
|
268 | 75 | AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. |
|
0 commit comments