@cqa-lib/cqa-ui 1.0.84 → 1.0.87

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.
@@ -0,0 +1,152 @@
1
+ # CI/CD Pipeline Setup
2
+
3
+ This repository uses GitHub Actions for continuous integration and deployment.
4
+
5
+ ## Workflows
6
+
7
+ ### 1. CI Workflow (`ci.yml`)
8
+ - Runs on pull requests and pushes to main/master
9
+ - Builds the package to ensure it compiles correctly
10
+ - Does not publish to npm
11
+
12
+ ### 2. Publish Workflow (`publish.yml`)
13
+ - Runs on pushes to main/master branch
14
+ - Runs on version tags (e.g., `v1.0.0`)
15
+ - Can be manually triggered from GitHub Actions UI
16
+ - Builds and publishes the package to npm
17
+
18
+ ## Setup Instructions
19
+
20
+ ### 1. Verify npm Organization/Scope Access
21
+
22
+ **Important**: For scoped packages like `@cqa-lib/cqa-ui`, you need to ensure:
23
+
24
+ 1. **If `@cqa-lib` is an npm organization:**
25
+ - You must be a member of the `@cqa-lib` organization
26
+ - You must have publish permissions for the organization
27
+ - Go to [npmjs.com/org/cqa-lib](https://www.npmjs.com/org/cqa-lib) to verify membership
28
+
29
+ 2. **If `@cqa-lib` is your personal scope:**
30
+ - Make sure you're logged into the correct npm account
31
+ - The package name matches your npm username/scope
32
+
33
+ 3. **First-time publish:**
34
+ - If the package doesn't exist yet, npm will create it
35
+ - Make sure you have permission to create packages in the scope
36
+
37
+ ### 2. Create NPM Granular Token
38
+
39
+ 1. Go to [npmjs.com/settings/~/tokens](https://www.npmjs.com/settings/~/tokens)
40
+ 2. Click "Generate New Token" → "Granular Access Token"
41
+ 3. Configure the token:
42
+ - **Token name**: `cqa-ui-lib-ci` (or any descriptive name)
43
+ - **Expiration**: 90 days (maximum for write tokens)
44
+ - **Type**: Automation
45
+ - **Packages**:
46
+ - If `@cqa-lib` is an org: Select `@cqa-lib/cqa-ui` specifically
47
+ - If personal scope: Select "All packages" or your scope
48
+ - **Permissions**: Read and write
49
+ - **Bypass 2FA**: Enable this for non-interactive CI/CD workflows
50
+
51
+ 4. Copy the token (you won't be able to see it again!)
52
+
53
+ ### 2. Add Secret to GitHub Repository
54
+
55
+ 1. Go to your GitHub repository
56
+ 2. Navigate to **Settings** → **Secrets and variables** → **Actions**
57
+ 3. Click **New repository secret**
58
+ 4. **Name: `NODE_AUTH_TOKEN`** (Important: Must be exactly `NODE_AUTH_TOKEN` for `setup-node` action)
59
+ 5. Value: Paste your granular token
60
+ 6. Click **Add secret**
61
+
62
+ **Note**: The secret must be named `NODE_AUTH_TOKEN` (not `NPM_TOKEN`) because the `actions/setup-node` action automatically uses this secret name when `registry-url` is provided.
63
+
64
+ ### 3. Publishing Options
65
+
66
+ #### Option A: Auto-publish on commits to main/master
67
+ - Every push to main/master will trigger a publish
68
+ - Make sure to bump the version in `package.json` before committing
69
+
70
+ #### Option B: Publish on version tags (Recommended)
71
+ 1. Update version in `package.json`
72
+ 2. Commit and push:
73
+ ```bash
74
+ git add package.json
75
+ git commit -m "chore: bump version to 1.0.85"
76
+ git push
77
+ ```
78
+ 3. Create and push a version tag:
79
+ ```bash
80
+ git tag v1.0.85
81
+ git push origin v1.0.85
82
+ ```
83
+ 4. The workflow will automatically publish and create a GitHub release
84
+
85
+ #### Option C: Manual publish
86
+ - Go to **Actions** tab in GitHub
87
+ - Select **Publish to npm** workflow
88
+ - Click **Run workflow**
89
+ - Select branch and click **Run workflow**
90
+
91
+ ## Important Notes
92
+
93
+ - **Token Expiration**: Granular tokens expire after 90 days. You'll need to regenerate and update the secret.
94
+ - **2FA**: If you have 2FA enabled on your npm account, make sure to enable "Bypass 2FA" when creating the token for CI/CD.
95
+ - **Version Management**: Always update the version in `package.json` before publishing.
96
+ - **OIDC Alternative**: For more secure publishing, consider setting up [OIDC trusted publishing](https://docs.npmjs.com/about-oidc-trusted-publishing) which eliminates the need for tokens.
97
+
98
+ ## Troubleshooting
99
+
100
+ ### "401 Unauthorized" or "Authentication failed"
101
+ - **Check secret name**: The secret must be named `NODE_AUTH_TOKEN` (not `NPM_TOKEN`)
102
+ - Verify the secret exists in GitHub: **Settings** → **Secrets and variables** → **Actions**
103
+ - Your NODE_AUTH_TOKEN secret may have expired (90-day limit)
104
+ - Regenerate the token and update the secret
105
+ - Verify the token hasn't been revoked in npm settings
106
+
107
+ ### "404 Not Found" when publishing
108
+ This error typically means one of the following:
109
+
110
+ 1. **Package doesn't exist yet (first publish):**
111
+ - This is normal for the first publish
112
+ - Make sure you have permission to create packages in the `@cqa-lib` scope
113
+ - Verify you're a member of the `@cqa-lib` organization (if it's an org)
114
+
115
+ 2. **No access to the scope:**
116
+ - Check if `@cqa-lib` is an organization you're a member of
117
+ - Verify your npm account has publish permissions
118
+ - Try running `npm whoami` locally to verify your npm identity
119
+
120
+ 3. **Token permissions:**
121
+ - Ensure the granular token has "Read and write" permissions
122
+ - Make sure the token is scoped to `@cqa-lib/cqa-ui` or "All packages"
123
+ - Verify "Bypass 2FA" is enabled for automation tokens
124
+
125
+ 4. **Package name mismatch:**
126
+ - Ensure the package name in `package.json` matches exactly: `@cqa-lib/cqa-ui`
127
+ - Check that `publishConfig.access` is set to `public` in `package.json`
128
+
129
+ ### "You do not have permission to publish"
130
+ - Verify you're a member of the `@cqa-lib` organization
131
+ - Check organization settings for publish permissions
132
+ - Ensure your npm account has the correct role (admin/maintainer)
133
+
134
+ ### Test locally first
135
+ Before relying on CI/CD, test publishing locally:
136
+ ```bash
137
+ # Set your token
138
+ export NPM_TOKEN="your-token-here"
139
+ echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
140
+
141
+ # Build and publish
142
+ npm run build:cqa-ui
143
+ cd dist/cqa-ui
144
+ npm publish --access public --dry-run # Test without publishing
145
+ npm publish --access public # Actual publish
146
+ ```
147
+
148
+ ### Build fails
149
+ - Check Node.js version matches (16.20.2)
150
+ - Verify all dependencies are installed correctly
151
+ - Review build logs in GitHub Actions
152
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cqa-lib/cqa-ui",
3
- "version": "1.0.84",
3
+ "version": "1.0.87",
4
4
  "description": "UI Kit library for Angular 13.4",
5
5
  "keywords": [
6
6
  "angular",
@@ -1,66 +0,0 @@
1
- # Image Assets
2
-
3
- This folder contains all image assets used by the UI library components.
4
-
5
- ## Structure
6
-
7
- - Place all image files (PNG, SVG, JPG, etc.) in this directory
8
- - Use descriptive file names (e.g., `test-case-icon.svg`, `empty-state-default.png`)
9
- - For component-specific images, consider creating subdirectories if needed
10
-
11
- ## Available Images
12
-
13
- The following images are configured for use in empty state components:
14
-
15
- - `TestCaseIcon.png` - Test case/document with gear icon
16
- - `SearchIcon.png` - Magnifying glass with question mark
17
- - `FilesIcon.png` - Folder/upload icon
18
- - `DashboardIcon.png` - Dashboard overview cards
19
- - `StepsIcon.png` - Checklist / tasks icon
20
- - `document-gear-icon.svg` - Document with gear overlay
21
- - `ReportsIcon.png` - Analytics/Reports chart icon
22
- - `SearchIcon.png` - Default fallback icon
23
-
24
- ## Usage
25
-
26
- ### Using Image Constants
27
-
28
- Import the image constants for type-safe access:
29
-
30
- ```typescript
31
- import { EMPTY_STATE_IMAGES } from '../assets/images/image-assets.constants';
32
-
33
- // In component
34
- imageUrl: EMPTY_STATE_IMAGES.TEST_CASE
35
- ```
36
-
37
- ### Direct Path Reference
38
-
39
- You can also reference images directly:
40
-
41
- ```typescript
42
- // Example in component
43
- imageUrl: 'assets/images/test-case-icon.svg'
44
- ```
45
-
46
- ### In Storybook
47
-
48
- Images are automatically available in Storybook stories:
49
-
50
- ```typescript
51
- import { EMPTY_STATE_IMAGES } from '../assets/images/image-assets.constants';
52
-
53
- export const MyStory = Template.bind({});
54
- MyStory.args = {
55
- imageUrl: EMPTY_STATE_IMAGES.TEST_CASE,
56
- // ...
57
- };
58
- ```
59
-
60
- ## Notes
61
-
62
- - Keep image file sizes optimized for web
63
- - Use SVG format when possible for scalability
64
- - Ensure all images are properly licensed for use in the library
65
- - Images will be included in the built library and available to consuming applications
66
-