@rbleattler/omp-ts-typegen 0.2025.0 → 0.2025.68
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/CHANGELOG.md +9 -9
- package/package.json +52 -43
- package/readme.md +130 -130
- package/schema-explained.md +192 -192
- package/scripts/generate-types.ts +184 -184
- package/scripts/test-types.ts +416 -416
- package/scripts/validator.ts +88 -88
- package/src/index.ts +1 -1
- package/src/types/omp.ts +776 -0
- package/theme-validation-details.md +16 -0
- package/theme-validation.md +2 -2
- package/tsconfig.json +44 -44
- package/.github/copilot-instructions.md +0 -74
- package/.github/workflows/nightly-types.yml +0 -42
- package/.vscode/settings.json +0 -5
- package/default.omp.json +0 -60
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/types/omp.d.ts +0 -368
- package/dist/types/omp.d.ts.map +0 -1
- package/dist/types/omp.js +0 -398
- package/dist/types/omp.js.map +0 -1
- package/tsconfig.scripts.json +0 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to the Oh My Posh TypeScript types will be documented in this file.
|
|
4
|
-
|
|
5
|
-
## [Initial Release]
|
|
6
|
-
|
|
7
|
-
- Created initial TypeScript types from Oh My Posh schema
|
|
8
|
-
- Set up automated type generation workflow
|
|
9
|
-
- Added testing against sample configuration
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the Oh My Posh TypeScript types will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [Initial Release]
|
|
6
|
+
|
|
7
|
+
- Created initial TypeScript types from Oh My Posh schema
|
|
8
|
+
- Set up automated type generation workflow
|
|
9
|
+
- Added testing against sample configuration
|
package/package.json
CHANGED
|
@@ -1,43 +1,52 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@rbleattler/omp-ts-typegen",
|
|
3
|
-
"version": "0.2025.
|
|
4
|
-
"contributors": [
|
|
5
|
-
{
|
|
6
|
-
"name": "Rob Bleattler",
|
|
7
|
-
"email": "omp-ts-typegen@rbleattler.com"
|
|
8
|
-
}
|
|
9
|
-
],
|
|
10
|
-
"author": "Rob Bleattler",
|
|
11
|
-
"description": "TypeScript type definitions for Oh My Posh schema",
|
|
12
|
-
"main": "dist/index.js",
|
|
13
|
-
"types": "dist/index.d.ts",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
},
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@rbleattler/omp-ts-typegen",
|
|
3
|
+
"version": "0.2025.68",
|
|
4
|
+
"contributors": [
|
|
5
|
+
{
|
|
6
|
+
"name": "Rob Bleattler",
|
|
7
|
+
"email": "omp-ts-typegen@rbleattler.com"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"author": "Rob Bleattler",
|
|
11
|
+
"description": "TypeScript type definitions for Oh My Posh schema",
|
|
12
|
+
"main": "dist/index.js",
|
|
13
|
+
"types": "dist/index.d.ts",
|
|
14
|
+
"files": [
|
|
15
|
+
"*.md",
|
|
16
|
+
"theme-validation-badge.svg",
|
|
17
|
+
"src/**/*",
|
|
18
|
+
"tsconfig.json",
|
|
19
|
+
"scripts/*.ts",
|
|
20
|
+
"cache/schema.json"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsc",
|
|
24
|
+
"generate-types": "ts-node --project tsconfig.scripts.json scripts/generate-types.ts",
|
|
25
|
+
"test-types": "ts-node --project tsconfig.scripts.json scripts/test-types.ts",
|
|
26
|
+
"prepublishOnly": "npm run build"
|
|
27
|
+
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/rbleattler/omp-typescript.git"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"oh-my-posh",
|
|
34
|
+
"typescript",
|
|
35
|
+
"types"
|
|
36
|
+
],
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"quicktype-core": "23.0.171"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/node": "22.13.9",
|
|
43
|
+
"axios": "1.8.2",
|
|
44
|
+
"chalk": "5.4.1",
|
|
45
|
+
"ts-node": "10.9.2",
|
|
46
|
+
"typescript": "5.8.2"
|
|
47
|
+
},
|
|
48
|
+
"bugs": {
|
|
49
|
+
"url": "https://github.com/rbleattler/omp-ts-typegen/issues"
|
|
50
|
+
},
|
|
51
|
+
"homepage": "https://github.com/rbleattler/omp-ts-typegen#readme"
|
|
52
|
+
}
|
package/readme.md
CHANGED
|
@@ -1,130 +1,130 @@
|
|
|
1
|
-
# Oh-My-Posh TypeScript Type Generator
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
|
|
5
|
-
[Oh-my-posh](https://ohmyposh.dev) ([JanDeDobbeleer
|
|
6
|
-
oh-my-posh | github](https://github.com/jandedobbeleer/oh-my-posh)) is "A prompt theme engine for any shell." This project generates typescript types from the `oh-my-posh` schema. These types can then be used in other typescript projects to validate and work with `oh-my-posh` configuration files.
|
|
7
|
-
|
|
8
|
-
The typescript/javascript in this directory is used to generate typescript types from the `oh-my-posh` [(oh-my-posh.dev)](https://ohmyposh.dev/) schema. These types can then be used in other typescript projects to validate and work with `oh-my-posh` configuration files.
|
|
9
|
-
|
|
10
|
-
For a detailed explanation of the schema, see [schema-explained.md](schema-explained.md).
|
|
11
|
-
|
|
12
|
-
## Goals
|
|
13
|
-
|
|
14
|
-
- Generate typescript types from the `oh-my-posh` schema
|
|
15
|
-
- Which can be used to:
|
|
16
|
-
- Validate `oh-my-posh` configuration files
|
|
17
|
-
- Work with `oh-my-posh` configuration files in typescript projects
|
|
18
|
-
- Generate documentation for `oh-my-posh` configuration files
|
|
19
|
-
- Build `oh-my-posh` configuration files programmatically
|
|
20
|
-
- Which are easy to:
|
|
21
|
-
- Understand
|
|
22
|
-
- Use
|
|
23
|
-
- Maintain
|
|
24
|
-
- Extend
|
|
25
|
-
- Generate documentation for `oh-my-posh` configuration files
|
|
26
|
-
- Which is easy to:
|
|
27
|
-
- Understand
|
|
28
|
-
- Use
|
|
29
|
-
- Maintain
|
|
30
|
-
- Extend
|
|
31
|
-
|
|
32
|
-
## Installation
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
# Clone the repository
|
|
36
|
-
git clone https://github.com/yourusername/omp-ts-typegen.git
|
|
37
|
-
cd omp-ts-typegen
|
|
38
|
-
|
|
39
|
-
# Install dependencies
|
|
40
|
-
npm install
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## How It Works
|
|
44
|
-
|
|
45
|
-
This project automatically generates TypeScript type definitions from the Oh My Posh JSON schema:
|
|
46
|
-
|
|
47
|
-
1. The script fetches the latest schema from the [Oh My Posh repository](https://github.com/JanDeDobbeleer/oh-my-posh)
|
|
48
|
-
2. The schema is cached locally for future reference
|
|
49
|
-
3. [quicktype](https://github.com/quicktype/quicktype) is used to convert the JSON schema into TypeScript types
|
|
50
|
-
4. The generated types are saved to the `src/types/omp.ts` file
|
|
51
|
-
5. These types are then exported via the main entry point (`src/index.ts`)
|
|
52
|
-
|
|
53
|
-
A GitHub workflow runs nightly to check for schema updates and regenerate types if needed.
|
|
54
|
-
|
|
55
|
-
## Usage
|
|
56
|
-
|
|
57
|
-
### Generating Types
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
# Generate types from the Oh My Posh schema
|
|
61
|
-
npm run generate-types
|
|
62
|
-
|
|
63
|
-
# Test the generated types against all Oh My Posh themes
|
|
64
|
-
# This will also generate a theme-validation.md report
|
|
65
|
-
npm run test-types
|
|
66
|
-
|
|
67
|
-
# Build the package
|
|
68
|
-
npm run build
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### Validation Report
|
|
72
|
-
|
|
73
|
-
When running `npm run test-types`, the script will:
|
|
74
|
-
|
|
75
|
-
1. Clone the Oh My Posh repository and test all themes against the generated types
|
|
76
|
-
2. Generate a markdown report (`theme-validation.md`) showing which themes are valid or invalid
|
|
77
|
-
3. Create a custom SVG badge showing validation status
|
|
78
|
-
4. Exit with a non-zero code if any themes are invalid
|
|
79
|
-
|
|
80
|
-
The validation report includes:
|
|
81
|
-
|
|
82
|
-
- A summary of validation results (total themes, valid count, invalid count)
|
|
83
|
-
- A table listing all themes with links to their source files
|
|
84
|
-
- Status indicators showing which themes pass validation
|
|
85
|
-
- A custom SVG badge that is displayed in the README
|
|
86
|
-
|
|
87
|
-
### Using the Generated Types
|
|
88
|
-
|
|
89
|
-
Once you've installed this package in your project, you can use the generated types:
|
|
90
|
-
|
|
91
|
-
```typescript
|
|
92
|
-
import { OhMyPosh } from 'omp-ts-typegen';
|
|
93
|
-
|
|
94
|
-
// Use the types to validate or work with Oh My Posh config files
|
|
95
|
-
const myConfig: OhMyPosh = {
|
|
96
|
-
// Your config here
|
|
97
|
-
};
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
## Project Structure
|
|
101
|
-
|
|
102
|
-
- `/scripts` - Contains the TypeScript scripts for generating and testing types
|
|
103
|
-
- `generate-types.ts` - Fetches the schema and generates types
|
|
104
|
-
- `test-types.ts` - Tests the generated types against sample configs
|
|
105
|
-
- `validator.ts` - Provides validation functionality
|
|
106
|
-
- `update-changelog.ts` - Updates the changelog when the types change
|
|
107
|
-
- `/src` - Contains the generated TypeScript types
|
|
108
|
-
- `types/omp.ts` - The generated TypeScript types
|
|
109
|
-
- `index.ts` - Exports the types for use in other projects
|
|
110
|
-
- `/cache` - Stores the cached schema for comparison
|
|
111
|
-
- `/cache/oh-my-posh` - Cached clone of the Oh My Posh repository for validation
|
|
112
|
-
- `/temp` - Temporary directory used during testing
|
|
113
|
-
- `theme-validation.md` - Report of theme validation results
|
|
114
|
-
- `theme-validation-badge.svg` - Visual badge showing theme validation status
|
|
115
|
-
- `/.github/workflows` - CI/CD workflows, including the nightly type generation
|
|
116
|
-
|
|
117
|
-
## Requirements
|
|
118
|
-
|
|
119
|
-
- Node.js 18+
|
|
120
|
-
- ESM-compatible environment (for chalk v5+ and other ESM dependencies)
|
|
121
|
-
|
|
122
|
-
## Contributing
|
|
123
|
-
|
|
124
|
-
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
125
|
-
|
|
126
|
-
1. Fork the repository
|
|
127
|
-
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
128
|
-
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
129
|
-
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
130
|
-
5. Open a Pull Request
|
|
1
|
+
# Oh-My-Posh TypeScript Type Generator
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
[Oh-my-posh](https://ohmyposh.dev) ([JanDeDobbeleer
|
|
6
|
+
oh-my-posh | github](https://github.com/jandedobbeleer/oh-my-posh)) is "A prompt theme engine for any shell." This project generates typescript types from the `oh-my-posh` schema. These types can then be used in other typescript projects to validate and work with `oh-my-posh` configuration files.
|
|
7
|
+
|
|
8
|
+
The typescript/javascript in this directory is used to generate typescript types from the `oh-my-posh` [(oh-my-posh.dev)](https://ohmyposh.dev/) schema. These types can then be used in other typescript projects to validate and work with `oh-my-posh` configuration files.
|
|
9
|
+
|
|
10
|
+
For a detailed explanation of the schema, see [schema-explained.md](schema-explained.md).
|
|
11
|
+
|
|
12
|
+
## Goals
|
|
13
|
+
|
|
14
|
+
- Generate typescript types from the `oh-my-posh` schema
|
|
15
|
+
- Which can be used to:
|
|
16
|
+
- Validate `oh-my-posh` configuration files
|
|
17
|
+
- Work with `oh-my-posh` configuration files in typescript projects
|
|
18
|
+
- Generate documentation for `oh-my-posh` configuration files
|
|
19
|
+
- Build `oh-my-posh` configuration files programmatically
|
|
20
|
+
- Which are easy to:
|
|
21
|
+
- Understand
|
|
22
|
+
- Use
|
|
23
|
+
- Maintain
|
|
24
|
+
- Extend
|
|
25
|
+
- Generate documentation for `oh-my-posh` configuration files
|
|
26
|
+
- Which is easy to:
|
|
27
|
+
- Understand
|
|
28
|
+
- Use
|
|
29
|
+
- Maintain
|
|
30
|
+
- Extend
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Clone the repository
|
|
36
|
+
git clone https://github.com/yourusername/omp-ts-typegen.git
|
|
37
|
+
cd omp-ts-typegen
|
|
38
|
+
|
|
39
|
+
# Install dependencies
|
|
40
|
+
npm install
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## How It Works
|
|
44
|
+
|
|
45
|
+
This project automatically generates TypeScript type definitions from the Oh My Posh JSON schema:
|
|
46
|
+
|
|
47
|
+
1. The script fetches the latest schema from the [Oh My Posh repository](https://github.com/JanDeDobbeleer/oh-my-posh)
|
|
48
|
+
2. The schema is cached locally for future reference
|
|
49
|
+
3. [quicktype](https://github.com/quicktype/quicktype) is used to convert the JSON schema into TypeScript types
|
|
50
|
+
4. The generated types are saved to the `src/types/omp.ts` file
|
|
51
|
+
5. These types are then exported via the main entry point (`src/index.ts`)
|
|
52
|
+
|
|
53
|
+
A GitHub workflow runs nightly to check for schema updates and regenerate types if needed.
|
|
54
|
+
|
|
55
|
+
## Usage
|
|
56
|
+
|
|
57
|
+
### Generating Types
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# Generate types from the Oh My Posh schema
|
|
61
|
+
npm run generate-types
|
|
62
|
+
|
|
63
|
+
# Test the generated types against all Oh My Posh themes
|
|
64
|
+
# This will also generate a theme-validation.md report
|
|
65
|
+
npm run test-types
|
|
66
|
+
|
|
67
|
+
# Build the package
|
|
68
|
+
npm run build
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Validation Report
|
|
72
|
+
|
|
73
|
+
When running `npm run test-types`, the script will:
|
|
74
|
+
|
|
75
|
+
1. Clone the Oh My Posh repository and test all themes against the generated types
|
|
76
|
+
2. Generate a markdown report (`theme-validation.md`) showing which themes are valid or invalid
|
|
77
|
+
3. Create a custom SVG badge showing validation status
|
|
78
|
+
4. Exit with a non-zero code if any themes are invalid
|
|
79
|
+
|
|
80
|
+
The validation report includes:
|
|
81
|
+
|
|
82
|
+
- A summary of validation results (total themes, valid count, invalid count)
|
|
83
|
+
- A table listing all themes with links to their source files
|
|
84
|
+
- Status indicators showing which themes pass validation
|
|
85
|
+
- A custom SVG badge that is displayed in the README
|
|
86
|
+
|
|
87
|
+
### Using the Generated Types
|
|
88
|
+
|
|
89
|
+
Once you've installed this package in your project, you can use the generated types:
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
import { OhMyPosh } from 'omp-ts-typegen';
|
|
93
|
+
|
|
94
|
+
// Use the types to validate or work with Oh My Posh config files
|
|
95
|
+
const myConfig: OhMyPosh = {
|
|
96
|
+
// Your config here
|
|
97
|
+
};
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Project Structure
|
|
101
|
+
|
|
102
|
+
- `/scripts` - Contains the TypeScript scripts for generating and testing types
|
|
103
|
+
- `generate-types.ts` - Fetches the schema and generates types
|
|
104
|
+
- `test-types.ts` - Tests the generated types against sample configs
|
|
105
|
+
- `validator.ts` - Provides validation functionality
|
|
106
|
+
- `update-changelog.ts` - Updates the changelog when the types change
|
|
107
|
+
- `/src` - Contains the generated TypeScript types
|
|
108
|
+
- `types/omp.ts` - The generated TypeScript types
|
|
109
|
+
- `index.ts` - Exports the types for use in other projects
|
|
110
|
+
- `/cache` - Stores the cached schema for comparison
|
|
111
|
+
- `/cache/oh-my-posh` - Cached clone of the Oh My Posh repository for validation
|
|
112
|
+
- `/temp` - Temporary directory used during testing
|
|
113
|
+
- `theme-validation.md` - Report of theme validation results
|
|
114
|
+
- `theme-validation-badge.svg` - Visual badge showing theme validation status
|
|
115
|
+
- `/.github/workflows` - CI/CD workflows, including the nightly type generation
|
|
116
|
+
|
|
117
|
+
## Requirements
|
|
118
|
+
|
|
119
|
+
- Node.js 18+
|
|
120
|
+
- ESM-compatible environment (for chalk v5+ and other ESM dependencies)
|
|
121
|
+
|
|
122
|
+
## Contributing
|
|
123
|
+
|
|
124
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
125
|
+
|
|
126
|
+
1. Fork the repository
|
|
127
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
128
|
+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
129
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
130
|
+
5. Open a Pull Request
|