@heroku/ember-hk-components 0.21.2 → 1.21.4

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,12 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "npm" # Note: Dependabot doesn't have native pnpm support yet, but works with pnpm projects
9
+ directory: "/"
10
+ open-pull-requests-limit: 5
11
+ schedule:
12
+ interval: "weekly"
@@ -0,0 +1,18 @@
1
+ name: Send data to Security Alerts
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ schedule:
6
+ - cron: '0 10 * * *'
7
+
8
+ jobs:
9
+ send-alerts:
10
+ runs-on: sfdc-hk-ubuntu-latest
11
+ steps:
12
+ - name: Send data to Security Alerts
13
+ uses: heroku/security-alerts-action@stable
14
+ with:
15
+ gh-app-id: ${{ secrets.SECURITY_ALERTS_GH_APP_ID }}
16
+ gh-app-privkey: ${{ secrets.SECURITY_ALERTS_GH_APP_PRIVKEY }}
17
+ webhook-url: ${{ secrets.SECURITY_ALERTS_WEBHOOK_URL }}
18
+ sa-token: ${{ secrets.SECURITY_ALERTS_TOKEN }}
@@ -0,0 +1,25 @@
1
+ name: "Send data to Components Inventory"
2
+ on:
3
+ workflow_dispatch:
4
+ push:
5
+ branches:
6
+ - "main"
7
+ paths:
8
+ - ".heroku/components-inventory/*.json"
9
+ pull_request:
10
+ types:
11
+ - opened
12
+ - synchronize
13
+ paths:
14
+ - ".heroku/components-inventory/*.json"
15
+ jobs:
16
+ action:
17
+ runs-on: sfdc-hk-ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - name: Send data to Components Inventory
21
+ uses: heroku/components-action@main
22
+ with:
23
+ COMPONENTS_GHA_APP_ID: ${{ secrets.COMPONENTS_GHA_APP_ID}}
24
+ COMPONENTS_GHA_APP_PRIVATE_KEY: ${{ secrets.COMPONENTS_GHA_APP_PRIVATE_KEY}}
25
+ COMPONENTS_GHA_JSON_TOKEN: ${{ secrets.COMPONENTS_GHA_JSON_TOKEN}}
@@ -0,0 +1,33 @@
1
+
2
+ {
3
+ "slug": "ember-hk-component",
4
+ "name": "ember-hk-component",
5
+ "description": "This is an ember addon for reusable components using the Purple3 CSS framework and Malibu",
6
+ "language": "Ember",
7
+ "lifecycle_status": "Production",
8
+ "pipeline_uuid": "dd836945-b702-4c1b-980f-55977011c176",
9
+ "repository_url": "https://github.com/heroku/ember-hk-components",
10
+ "stack": "Platform",
11
+ "stack_type": "Package",
12
+ "documentation_url": null,
13
+ "metrics_url": null,
14
+ "sox": false,
15
+ "soc2": false,
16
+ "customer_facing": true,
17
+ "pager_duty_service_code": "PEB4QAI",
18
+ "component_tier": "Not a Service",
19
+ "github_actions": false,
20
+ "github_release": true,
21
+ "github_actions_ci_workflow": null,
22
+ "authentication": null,
23
+ "platform": null,
24
+ "team_name": "Front-End",
25
+ "planned_maintenance_severity": null,
26
+ "gus_team": "https://gus.lightning.force.com/lightning/r/ADM_Scrum_Team__c/a00B0000000qQ8HIAU/view",
27
+ "pci_tier": "TBD",
28
+ "consumer_type": "N/A",
29
+ "content_cacheable": "N/A",
30
+ "blast_radius": "No impact",
31
+ "audit_findings_url": null,
32
+ "last_audit": null
33
+ }
@@ -0,0 +1,245 @@
1
+ # Resolving Babel-Traverse Critical Vulnerability in Ember Projects
2
+
3
+ ## Overview
4
+
5
+ This guide documents how to resolve the critical `babel-traverse` vulnerability (GHSA-67hx-6x53-jw92) in Ember.js projects without breaking compatibility or requiring major version upgrades.
6
+
7
+ **Vulnerability Details:**
8
+ - **Package**: `babel-traverse` (versions < 7.23.2)
9
+ - **Severity**: Critical
10
+ - **Issue**: Arbitrary code execution when compiling malicious code
11
+ - **CVE**: Related to babel-traverse 6.x series used in legacy toolchains
12
+
13
+ ## The Problem
14
+
15
+ The `babel-traverse` vulnerability appears in Ember projects through multiple dependency chains:
16
+
17
+ ### Common Vulnerability Paths
18
+
19
+ 1. **Via Consolidate (Most Common)**:
20
+ ```
21
+ ember-cli → testem → consolidate → babel-core → babel-traverse (6.26.0)
22
+ ```
23
+
24
+ 2. **Via ember-cli-chai**:
25
+ ```
26
+ ember-cli-chai → babel-preset-env → babel-plugin-transform-async-to-generator →
27
+ babel-helper-remap-async-to-generator → babel-traverse (6.26.0)
28
+ ```
29
+
30
+ 3. **Via ember-a11y-testing** (older versions):
31
+ ```
32
+ ember-a11y-testing → ember-auto-import → babel-core → babel-traverse (6.26.0)
33
+ ```
34
+
35
+ ### Why Standard Solutions Don't Work
36
+
37
+ - **Ember CLI versions**: Even the latest Ember CLI (6.7.0) still uses vulnerable dependencies
38
+ - **Resolution conflicts**: Forcing `babel-traverse` to `@babel/traverse` breaks API compatibility
39
+ - **Build-time errors**: Old babel plugins expect 6.x API methods like `path.inShadow()`
40
+
41
+ ## The Solution: Package Resolutions
42
+
43
+ ### 1. Fix Consolidate Vulnerability (Primary Solution)
44
+
45
+ The most effective fix is to replace the vulnerable `consolidate` package with `@ladjs/consolidate`, which has **zero dependencies** and eliminates the entire babel-traverse chain.
46
+
47
+ **Add to package.json resolutions:**
48
+
49
+ ```json
50
+ {
51
+ "resolutions": {
52
+ "consolidate": "npm:@ladjs/consolidate@^1.0.4"
53
+ }
54
+ }
55
+ ```
56
+
57
+ **Why this works:**
58
+ - `consolidate@0.16.0` → has `babel-core` dependency → vulnerable
59
+ - `@ladjs/consolidate@1.0.4` → **zero dependencies** → secure
60
+
61
+ ### 2. Handle ember-cli-chai Vulnerability
62
+
63
+ If you're still seeing vulnerabilities after the consolidate fix, it's likely coming from `ember-cli-chai`.
64
+
65
+ #### Option A: Remove ember-cli-chai (Recommended)
66
+
67
+ ```bash
68
+ # Remove ember-cli-chai
69
+ pnpm remove ember-cli-chai
70
+
71
+ # Use chai directly with ember-qunit
72
+ pnpm add --save-dev chai
73
+ ```
74
+
75
+ Update your tests to import chai directly:
76
+ ```javascript
77
+ import { expect } from 'chai';
78
+ // Instead of using this.expect from ember-cli-chai
79
+ ```
80
+
81
+ #### Option B: Add Additional Resolution (If keeping ember-cli-chai)
82
+
83
+ ```json
84
+ {
85
+ "resolutions": {
86
+ "consolidate": "npm:@ladjs/consolidate@^1.0.4",
87
+ "babel-traverse": "npm:@babel/traverse@^7.23.2"
88
+ }
89
+ }
90
+ ```
91
+
92
+ **⚠️ Warning**: This may cause build-time compatibility issues requiring additional patches.
93
+
94
+ ### 3. Update ember-a11y-testing
95
+
96
+ Ensure you're using a compatible version:
97
+
98
+ ```json
99
+ {
100
+ "devDependencies": {
101
+ "ember-a11y-testing": "^5.2.1"
102
+ }
103
+ }
104
+ ```
105
+
106
+ ## Complete Resolution Example
107
+
108
+ Here's a complete `package.json` resolutions section that addresses all common vulnerability paths:
109
+
110
+ ```json
111
+ {
112
+ "resolutions": {
113
+ "lodash.template": "npm:lodash@^4.17.21",
114
+ "braces": "npm:braces@^3.0.3",
115
+ "rollup": "^4.50.1",
116
+ "json5": "^2.2.3",
117
+ "ansi-html": "^0.0.8",
118
+ "consolidate": "npm:@ladjs/consolidate@^1.0.4"
119
+ }
120
+ }
121
+ ```
122
+
123
+ ## Implementation Steps
124
+
125
+ ### Step 1: Audit Current Vulnerabilities
126
+ ```bash
127
+ pnpm audit --audit-level critical
128
+ ```
129
+
130
+ ### Step 2: Add Consolidate Resolution
131
+ ```json
132
+ {
133
+ "resolutions": {
134
+ "consolidate": "npm:@ladjs/consolidate@^1.0.4"
135
+ }
136
+ }
137
+ ```
138
+
139
+ ### Step 3: Install Dependencies
140
+ ```bash
141
+ pnpm install
142
+ ```
143
+
144
+ ### Step 4: Verify Fix
145
+ ```bash
146
+ pnpm audit --audit-level critical
147
+ ```
148
+
149
+ ### Step 5: Test Application
150
+ ```bash
151
+ pnpm test
152
+ ```
153
+
154
+ ## Troubleshooting
155
+
156
+ ### Build Errors After Adding babel-traverse Resolution
157
+
158
+ If you see errors like `path.inShadow is not a function`, you have API compatibility issues:
159
+
160
+ 1. **Remove the babel-traverse resolution**:
161
+ ```json
162
+ {
163
+ "resolutions": {
164
+ // Remove this line if it causes issues
165
+ // "babel-traverse": "npm:@babel/traverse@^7.23.2"
166
+ }
167
+ }
168
+ ```
169
+
170
+ 2. **Focus on the consolidate resolution only** (this resolves most cases)
171
+
172
+ 3. **Consider removing ember-cli-chai** if it's the remaining vulnerability source
173
+
174
+ ### Peer Dependency Warnings
175
+
176
+ You may see warnings about peer dependencies when updating packages. These are usually safe to ignore if tests pass.
177
+
178
+ ### Alternative: Ember CLI Upgrade Path
179
+
180
+ For long-term security, consider upgrading to newer Ember CLI versions, but note:
181
+ - Requires significant compatibility testing
182
+ - May need dependency updates across the board
183
+ - ember-cli-eyeglass compatibility issues with newer versions
184
+
185
+ ## Verification
186
+
187
+ After implementing the fix, verify success:
188
+
189
+ ### 1. Check Audit Results
190
+ ```bash
191
+ pnpm audit --audit-level critical
192
+ # Should show: "0 vulnerabilities found" or no critical ones
193
+ ```
194
+
195
+ ### 2. Verify Dependency Resolution
196
+ ```bash
197
+ find node_modules -name "*consolidate*" -type d
198
+ # Should show @ladjs/consolidate instead of old consolidate
199
+ ```
200
+
201
+ ### 3. Test Application
202
+ ```bash
203
+ pnpm test
204
+ # All tests should pass without babel-traverse errors
205
+ ```
206
+
207
+ ## Why This Approach Works
208
+
209
+ 1. **Non-breaking**: Doesn't require major version upgrades
210
+ 2. **Targeted**: Addresses the root cause without changing API surface
211
+ 3. **Maintainable**: Uses actively maintained packages
212
+ 4. **Compatible**: Works with existing Ember CLI 3.x and 4.x projects
213
+
214
+ ## Additional Security Improvements
215
+
216
+ While fixing babel-traverse, consider addressing these related vulnerabilities:
217
+
218
+ ```json
219
+ {
220
+ "resolutions": {
221
+ "consolidate": "npm:@ladjs/consolidate@^1.0.4",
222
+ "rollup": "^4.50.1",
223
+ "json5": "^2.2.3",
224
+ "ansi-html": "^0.0.8",
225
+ "braces": "npm:braces@^3.0.3",
226
+ "lodash.template": "npm:lodash@^4.17.21"
227
+ }
228
+ }
229
+ ```
230
+
231
+ ## Key Takeaways
232
+
233
+ 1. **@ladjs/consolidate is the key**: This single resolution eliminates the most common babel-traverse vulnerability path
234
+ 2. **Avoid forcing babel-traverse resolutions**: They often cause API compatibility issues
235
+ 3. **Test thoroughly**: Always run your test suite after applying security fixes
236
+ 4. **Consider removing ember-cli-chai**: Direct chai usage is often cleaner and more secure
237
+ 5. **Package resolutions are powerful**: They allow surgical fixes without major upgrades
238
+
239
+ ## Resources
240
+
241
+ - [babel-traverse vulnerability details](https://github.com/advisories/GHSA-67hx-6x53-jw92)
242
+ - [@ladjs/consolidate package](https://www.npmjs.com/package/@ladjs/consolidate)
243
+ - [PNPM resolutions documentation](https://pnpm.io/package_json#resolutions)
244
+ - [Ember CLI upgrade guide](https://cli.emberjs.com/release/)
245
+
package/CLAUDE.md ADDED
@@ -0,0 +1,122 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Development Commands
6
+
7
+ ### Prerequisites
8
+ - Node.js (version specified in `.tool-versions`)
9
+ - pnpm (package manager - enforced via `preinstall` script)
10
+
11
+ ### Installation and Setup
12
+ ```bash
13
+ # Clone the repository
14
+ git clone https://github.com/heroku/ember-hk-components
15
+ cd ember-hk-components
16
+
17
+ # Install dependencies (must use pnpm)
18
+ pnpm install
19
+ ```
20
+
21
+ ### Development Server
22
+ ```bash
23
+ # Start development server
24
+ ember serve
25
+ # or
26
+ pnpm start
27
+
28
+ # Visit app at http://localhost:4200
29
+ ```
30
+
31
+ ### Testing
32
+ ```bash
33
+ # Run all tests
34
+ pnpm test # Runs ember test
35
+ ember test # Direct ember test command
36
+ ember test --server # Run tests in watch mode
37
+
38
+ # Run compatibility tests across Ember versions
39
+ pnpm run test:ember-compatibility
40
+ # or
41
+ ember try:each
42
+ ```
43
+
44
+ ### Linting
45
+ ```bash
46
+ # Run all linting
47
+ pnpm run lint # Runs both JS and HBS linting
48
+
49
+ # Individual linting commands
50
+ pnpm run lint:js # ESLint for JavaScript
51
+ pnpm run lint:hbs # ember-template-lint for Handlebars templates
52
+ pnpm run lint:hbs:fix # Auto-fix template lint issues
53
+ ```
54
+
55
+ ### Building
56
+ ```bash
57
+ # Build the addon
58
+ pnpm run build
59
+ # or
60
+ ember build
61
+ ```
62
+
63
+ ### Local Development with Another App
64
+ ```bash
65
+ # In ember-hk-components directory
66
+ pnpm link
67
+
68
+ # In consuming app directory
69
+ pnpm link @heroku/ember-hk-components
70
+
71
+ # To unlink
72
+ pnpm unlink @heroku/ember-hk-components
73
+ ```
74
+
75
+ ## Architecture Overview
76
+
77
+ ### Project Type
78
+ This is an **Ember addon** that provides reusable UI components for Heroku applications. It's built on Ember 3.28 (Octane edition) and assumes usage of the Purple3 CSS framework and Malibu icon system.
79
+
80
+ ### Key Dependencies
81
+ - **Purple3 CSS Framework**: Required CSS framework for styling
82
+ - **@heroku/ember-malibu-icon**: Icon system integration
83
+ - **ember-freestyle**: Component showcase and documentation system
84
+ - **ember-changeset**: Form state management
85
+ - **ember-power-select**: Advanced select component
86
+
87
+ ### Directory Structure
88
+ - `addon/`: Core addon code (components, services, etc.)
89
+ - `addon/components/`: Reusable UI components (hk-button, hk-select, etc.)
90
+ - `app/`: App-specific re-exports and styles
91
+ - `app/styles/ember-hk-components/`: SCSS stylesheets for components
92
+ - `tests/dummy/`: Demo application showcasing components
93
+ - `tests/`: Test files
94
+
95
+ ### Component Architecture
96
+ Components follow Ember Octane patterns with some legacy Classic components still present (migration in progress). Key component families:
97
+
98
+ - **Form Components**: `hk-input`, `hk-select`, `hk-textarea`, `hk-form-group`
99
+ - **UI Components**: `hk-button`, `hk-slide-panel`, `hk-well`
100
+ - **Utility Components**: `async-button`, `hk-autofocus-input`, `hk-validation-errors-list`
101
+
102
+ ### CSS Integration
103
+ Styles are organized per-component in `app/styles/ember-hk-components/`. Components can be imported individually or all at once:
104
+
105
+ ```scss
106
+ // Import all components
107
+ @import "ember-hk-components/ember-hk-components";
108
+
109
+ // Import specific component
110
+ @import "ember-hk-components/hk-slide-panel";
111
+ ```
112
+
113
+ ### Demo Application
114
+ The `tests/dummy/` directory contains a demo application using ember-freestyle to showcase all components. This serves as both documentation and development environment.
115
+
116
+ ### Special Features
117
+ - **Slide Panel**: Uses a special DOM insertion point (`#hk-slide-panels`) added via addon's `index.js`
118
+ - **Accessibility**: Includes ember-a11y-testing for accessibility validation
119
+ - **Validation**: Integrated with ember-changeset for form validation patterns
120
+
121
+ ### Legacy Considerations
122
+ The codebase is transitioning from Ember Classic to Octane patterns. ESLint is configured to warn about classic patterns in `app/` and `addon/` directories while maintaining compatibility.
package/CODEOWNERS ADDED
@@ -0,0 +1,5 @@
1
+ # Lines starting with '#' are comments.
2
+ # Each line is a file pattern followed by one or more owners.
3
+
4
+ # These owners will be the default owners for everything in the repo.
5
+ * @heroku/front-end