You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This directory contains the CI/CD workflows for automatically releasing `@patternfly/context-for-ai` to NPM.
4
+
5
+
## Workflows
6
+
7
+
### build-lint-test.yml
8
+
Runs on pull requests and pushes to main. This workflow:
9
+
- Type checks the code
10
+
- Runs ESLint
11
+
- Runs Jest tests
12
+
- Builds the distribution files
13
+
14
+
### release.yml
15
+
Runs on pushes to the `main` branch. This workflow:
16
+
- Calls the build-lint-test workflow first
17
+
- Uses semantic-release to automatically version and publish to NPM
18
+
- Creates GitHub releases with changelogs
19
+
20
+
## Required Secrets
21
+
22
+
You need to set up the following secrets in your GitHub repository:
23
+
24
+
### NPM_TOKEN
25
+
1. Log in to npm and go to https://www.npmjs.com/settings/YOUR_USERNAME/tokens
26
+
2. Click "Generate New Token" → "Classic Token"
27
+
3. Select "Automation" type
28
+
4. Copy the token
29
+
5. In your GitHub repo, go to Settings → Secrets and variables → Actions
30
+
6. Click "New repository secret"
31
+
7. Name: `NPM_TOKEN`
32
+
8. Value: Your npm token
33
+
9. Click "Add secret"
34
+
35
+
### GITHUB_TOKEN
36
+
This is automatically provided by GitHub Actions, no setup needed.
37
+
38
+
## Semantic Release
39
+
40
+
The release process uses [semantic-release](https://semantic-release.gitbook.io/) which automates version management and package publishing based on commit messages.
41
+
42
+
### Commit Message Format
43
+
44
+
Use conventional commits to trigger releases:
45
+
46
+
-`fix: ...` → Patch release (1.0.0 → 1.0.1)
47
+
-`feat: ...` → Minor release (1.0.0 → 1.1.0)
48
+
-`feat!: ...` or `BREAKING CHANGE:` in body → Major release (1.0.0 → 2.0.0)
49
+
50
+
Examples:
51
+
```
52
+
fix: resolve button styling issue
53
+
feat: add new Card component
54
+
feat!: rename all component props (breaking change)
55
+
```
56
+
57
+
### First Release
58
+
59
+
For your first release, you may want to run:
60
+
```bash
61
+
npm version 1.0.0
62
+
git add package.json
63
+
git commit -m "chore: initial release setup"
64
+
git push
65
+
```
66
+
67
+
Or let semantic-release handle it automatically based on commits.
68
+
69
+
## Testing Locally
70
+
71
+
Before pushing to main, you can test the workflow:
72
+
73
+
```bash
74
+
# Run all checks locally
75
+
npm run type-check
76
+
npm run lint
77
+
npm test
78
+
npm run build
79
+
```
80
+
81
+
## Troubleshooting
82
+
83
+
### Release not triggering
84
+
- Ensure your commit messages follow the conventional commit format
85
+
- Check the Actions tab in GitHub for error messages
86
+
- Verify NPM_TOKEN is set correctly
87
+
88
+
### NPM publish fails
89
+
- Verify the package name `@patternfly/context-for-ai` is available/you have access
90
+
- Ensure NPM_TOKEN has publish permissions
91
+
- Check if you need to be added to the @patternfly organization on npm
Copy file name to clipboardExpand all lines: README.md
+27-28Lines changed: 27 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,8 @@
2
2
3
3
> **⚠️ Important**: This is a **codemod tool only**. You do NOT need to import or use any library components. Simply install the package and run the codemod to transform your existing PatternFly components. The library code in this repository is for reference/development purposes only.
4
4
5
-
**📦 Install from npm**: `npm install -D @kelseamann/semantic-ui-layer`
6
-
**🔗 Package**: [@kelseamann/semantic-ui-layer on npm](https://www.npmjs.com/package/@kelseamann/semantic-ui-layer)
5
+
**📦 Install from npm**: `npm install -D @patternfly/context-for-ai`
6
+
**🔗 Package**: [@patternfly/context-for-ai on npm](https://www.npmjs.com/package/@patternfly/context-for-ai)
7
7
8
8
A codemod tool that automatically adds standardized semantic `data-*` attributes to **all PatternFly components** in your codebase, making them AI-friendly and easier for AI tools to understand.
9
9
@@ -38,10 +38,10 @@ This tool transforms your existing PatternFly components by adding semantic meta
38
38
Install from npm as a dev dependency (recommended):
39
39
40
40
```bash
41
-
npm install -D @kelseamann/semantic-ui-layer
41
+
npm install -D @patternfly/context-for-ai
42
42
```
43
43
44
-
**📦 Package**: [@kelseamann/semantic-ui-layer on npm](https://www.npmjs.com/package/@kelseamann/semantic-ui-layer)
44
+
**📦 Package**: [@patternfly/context-for-ai on npm](https://www.npmjs.com/package/@patternfly/context-for-ai)
45
45
46
46
> **Note**:
47
47
> - Installed as a dev dependency (`-D`) since it's only needed during development
@@ -55,23 +55,21 @@ You have two options:
55
55
56
56
**Option A: Using npx with jscodeshift (recommended)**
> **Note**: Option A uses `npx` which automatically downloads and runs jscodeshift without requiring a global install!
67
-
68
66
### Setup on a New Computer
69
67
70
68
If you're setting up the codemod on a new computer:
71
69
72
70
1.**Install Node.js** (if not already installed)
73
-
2.**Install @kelseamann/semantic-ui-layer** in your project: `npm install -D @kelseamann/semantic-ui-layer`
74
-
3.**Run the codemod** using `npx jscodeshift` (see options above)
71
+
2.**Install @patternfly/context-for-ai** in your project: `npm install -D @patternfly/context-for-ai`
72
+
3.**Run the codemod** using npx (recommended) or the bash script above
75
73
76
74
The codemod is a standalone tool - you don't need to import or use any library components. It simply transforms your existing PatternFly components by adding semantic attributes.
77
75
@@ -97,22 +95,23 @@ Into:
97
95
data-role="card"
98
96
data-purpose="clickable"
99
97
data-variant="default"
100
-
data-context="default"
98
+
data-context="page"
101
99
data-state="active"
102
100
>
103
101
<CardBody
104
102
data-role="card-body"
105
103
data-purpose="display"
106
104
data-variant="default"
107
-
data-context="default"
108
-
data-state="default"
105
+
data-context="page"
106
+
data-state="active"
109
107
>
110
108
<Button
111
109
variant="danger"
112
110
data-role="button"
113
111
data-purpose="action"
114
112
data-variant="danger"
115
-
data-context="default"
113
+
data-context="page"
114
+
data-action-type="destructive"
116
115
data-state="active"
117
116
>
118
117
Cancel
@@ -163,10 +162,10 @@ Every PatternFly component gets the same 7 attributes that appear on rendered DO
163
162
Install the package from npm as a dev dependency:
164
163
165
164
```bash
166
-
npm install -D @kelseamann/semantic-ui-layer
165
+
npm install -D @patternfly/context-for-ai
167
166
```
168
167
169
-
**📦 Package**: [@kelseamann/semantic-ui-layer on npm](https://www.npmjs.com/package/@kelseamann/semantic-ui-layer)
168
+
**📦 Package**: [@patternfly/context-for-ai on npm](https://www.npmjs.com/package/@patternfly/context-for-ai)
170
169
171
170
**Note**:
172
171
- This installs the codemod tool as a dev dependency since it's only needed during development
0 commit comments