dev-dict 0.7.4 → 0.8.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 +30 -90
- package/package.json +1 -3
package/README.md
CHANGED
|
@@ -92,10 +92,12 @@ const dictionary = getTerms({ terms, locale: 'en-US' })
|
|
|
92
92
|
import { terms, types, tags, locales } from 'dev-dict'
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
| Export | Description |
|
|
96
|
+
|--------|-------------|
|
|
97
|
+
| `terms` | Raw terms dictionary |
|
|
98
|
+
| `types` | Type constants and definitions |
|
|
99
|
+
| `tags` | Tag constants and definitions |
|
|
100
|
+
| `locales` | Locale constants |
|
|
99
101
|
|
|
100
102
|
### Helper Functions
|
|
101
103
|
|
|
@@ -105,92 +107,40 @@ Import from `dev-dict/utils`:
|
|
|
105
107
|
import { getTerms, getTermsDict, getTypes, getTypesDict, getTags, getTagsDict } from 'dev-dict/utils'
|
|
106
108
|
```
|
|
107
109
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
Get all terms as a dictionary object.
|
|
111
|
-
|
|
112
|
-
```typescript
|
|
113
|
-
const termsDict = getTermsDict({
|
|
114
|
-
terms,
|
|
115
|
-
locale: 'en-US',
|
|
116
|
-
populateEmpty: true
|
|
117
|
-
})
|
|
118
|
-
// { react: { id: "react", name: "React", ... }, vue: { id: "vue", name: "Vue", ... } }
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
**Options:**
|
|
122
|
-
- `terms: TTermsDict` - The terms dictionary (required)
|
|
123
|
-
- `locale?: string` - Target locale (default: `'en-US'`)
|
|
124
|
-
- `populateEmpty?: boolean` - Populate empty locale records with en-US values (default: `true`)
|
|
125
|
-
|
|
126
|
-
**Returns:** `Partial<TTermsDictLocalized>` - Dictionary of localised terms
|
|
127
|
-
|
|
128
|
-
#### `getTerms(options)`
|
|
129
|
-
|
|
130
|
-
Get all terms as an array.
|
|
110
|
+
**Example usage:**
|
|
131
111
|
|
|
132
112
|
```typescript
|
|
113
|
+
// Get terms as an array
|
|
133
114
|
const dictionary = getTerms({
|
|
134
|
-
terms,
|
|
135
|
-
locale: 'en-US',
|
|
136
|
-
populateEmpty: true
|
|
115
|
+
terms, // Required: the terms dictionary
|
|
116
|
+
locale: 'en-US', // Optional: defaults to 'en-US'
|
|
117
|
+
populateEmpty: true // Optional: defaults to true
|
|
137
118
|
})
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
**Options:**
|
|
141
|
-
- `terms: TTermsDict` - The terms dictionary (required)
|
|
142
|
-
- `locale?: string` - Target locale (default: `'en-US'`)
|
|
143
|
-
- `populateEmpty?: boolean` - Populate empty locale records with en-US values (default: `true`)
|
|
144
|
-
|
|
145
|
-
**Returns:** `TTermLocalized[]` - Array of localised terms
|
|
119
|
+
// [{ id: "react", name: "React", ... }, { id: "vue", name: "Vue", ... }]
|
|
146
120
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
```typescript
|
|
152
|
-
const typesDict = getTypesDict({
|
|
153
|
-
terms,
|
|
154
|
-
locale: 'en-US'
|
|
155
|
-
})
|
|
156
|
-
// { library: { id: "library", name: "Library" }, framework: { id: "framework", name: "Framework" }, ... }
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
#### `getTypes(options)`
|
|
160
|
-
|
|
161
|
-
Get all term types as an array.
|
|
162
|
-
|
|
163
|
-
```typescript
|
|
164
|
-
const types = getTypes({
|
|
165
|
-
terms,
|
|
166
|
-
locale: 'en-US'
|
|
167
|
-
})
|
|
168
|
-
// [{ id: "library", name: "Library" }, { id: "framework", name: "Framework" }, ...]
|
|
121
|
+
// Get terms as a dictionary object
|
|
122
|
+
const termsDict = getTermsDict({ terms, locale: 'en-US' })
|
|
123
|
+
// { react: { id: "react", name: "React", ... }, vue: { id: "vue", name: "Vue", ... } }
|
|
169
124
|
```
|
|
170
125
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
Get all term tags as a dictionary object.
|
|
174
|
-
|
|
175
|
-
```typescript
|
|
176
|
-
const tagsDict = getTagsDict({
|
|
177
|
-
terms,
|
|
178
|
-
locale: 'en-US'
|
|
179
|
-
})
|
|
180
|
-
// { frontend: { id: "frontend", name: "Frontend" }, backend: { id: "backend", name: "Backend" }, ... }
|
|
181
|
-
```
|
|
126
|
+
**Options:**
|
|
182
127
|
|
|
183
|
-
|
|
128
|
+
| Parameter | Type | Required | Default | Description |
|
|
129
|
+
|-----------|------|----------|---------|-------------|
|
|
130
|
+
| `terms` | `TTermsDict` | Yes | - | The terms dictionary |
|
|
131
|
+
| `locale` | `string` | No | `'en-US'` | Target locale |
|
|
132
|
+
| `populateEmpty` | `boolean` | No | `true` | Populate empty locale records with en-US values |
|
|
184
133
|
|
|
185
|
-
|
|
134
|
+
**Available functions:**
|
|
186
135
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
136
|
+
| Function | Returns | Description |
|
|
137
|
+
|----------|---------|-------------|
|
|
138
|
+
| `getTermsDict(options)` | `Partial<TTermsDictLocalized>` | Get all terms as a dictionary object |
|
|
139
|
+
| `getTerms(options)` | `TTermLocalized[]` | Get all terms as an array |
|
|
140
|
+
| `getTypesDict(options)` | Dictionary | Get all term types as a dictionary object |
|
|
141
|
+
| `getTypes(options)` | Array | Get all term types as an array |
|
|
142
|
+
| `getTagsDict(options)` | Dictionary | Get all term tags as a dictionary object |
|
|
143
|
+
| `getTags(options)` | Array | Get all term tags as an array |
|
|
194
144
|
|
|
195
145
|
### Term Structure
|
|
196
146
|
|
|
@@ -228,12 +178,6 @@ const tags = getTags({
|
|
|
228
178
|
|
|
229
179
|
Want to add a language? See [CONTRIBUTING.md](./CONTRIBUTING.md#adding-a-new-language)
|
|
230
180
|
|
|
231
|
-
## Browse Terms
|
|
232
|
-
|
|
233
|
-
- **[Terms](./docs/TERMS.md)** - All software development terms
|
|
234
|
-
- **[Types](./docs/TYPES.md)** - Term categories
|
|
235
|
-
- **[Tags](./docs/TAGS.md)** - Additional classifications
|
|
236
|
-
|
|
237
181
|
## Contributing
|
|
238
182
|
|
|
239
183
|
Contributions welcome! Add terms, provide translations, fix errors, or suggest improvements.
|
|
@@ -250,7 +194,3 @@ pnpm demo:build # Build demo site
|
|
|
250
194
|
```
|
|
251
195
|
|
|
252
196
|
See [CLAUDE.md](./.claude/CLAUDE.md) for detailed development guidance.
|
|
253
|
-
|
|
254
|
-
## License
|
|
255
|
-
|
|
256
|
-
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dev-dict",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "A community-driven collection of software development terms with explanations in multiple languages. Perfect for building multilingual developer tools, documentation sites, and educational platforms.",
|
|
5
5
|
"author": "Cornelius Weidmann <cornelius@kyco.io> (https://kyco.io)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -77,8 +77,6 @@
|
|
|
77
77
|
"demo:dev": "pnpm build && (pnpm build:watch & cd demo && pnpm dev)",
|
|
78
78
|
"demo:build": "pnpm build && cd demo && pnpm build",
|
|
79
79
|
"demo:preview": "cd demo && pnpm preview",
|
|
80
|
-
"docs:generate": "pnpm build && tsx scripts/generate-docs.ts",
|
|
81
|
-
"prepublishOnly": "pnpm docs:generate",
|
|
82
80
|
"test": "echo \"This project does not have any tests which can be run yet...\"",
|
|
83
81
|
"bundle-analyzer": "npx vite-bundle-visualizer",
|
|
84
82
|
"update-packages": "pnpm dlx npm-check-updates -u"
|