@rbleattler/omp-ts-typegen 0.2025.1 → 0.2025.70

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 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.1",
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
- "scripts": {
15
- "build": "tsc",
16
- "generate-types": "ts-node --project tsconfig.scripts.json scripts/generate-types.ts",
17
- "test-types": "ts-node --project tsconfig.scripts.json scripts/test-types.ts"
18
- },
19
- "repository": {
20
- "type": "git",
21
- "url": "git+https://github.com/rbleattler/omp-typescript.git"
22
- },
23
- "keywords": [
24
- "oh-my-posh",
25
- "typescript",
26
- "types"
27
- ],
28
- "license": "MIT",
29
- "dependencies": {
30
- "quicktype-core": "23.0.171"
31
- },
32
- "devDependencies": {
33
- "@types/node": "22.13.9",
34
- "axios": "1.8.2",
35
- "chalk": "5.4.1",
36
- "ts-node": "10.9.2",
37
- "typescript": "5.8.2"
38
- },
39
- "bugs": {
40
- "url": "https://github.com/rbleattler/omp-ts-typegen/issues"
41
- },
42
- "homepage": "https://github.com/rbleattler/omp-ts-typegen#readme"
43
- }
1
+ {
2
+ "name": "@rbleattler/omp-ts-typegen",
3
+ "version": "0.2025.70",
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
- ![Theme Validation](./theme-validation-badge.svg)
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
+ ![Theme Validation](./theme-validation-badge.svg)
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