@papillonarts/components 0.40.0 → 0.42.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlexGrid.d.ts","sourceRoot":"","sources":["../../../../src/Legacy/Grid/FlexGrid/FlexGrid.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAqD,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE9F,wBAAgB,QAAQ,CAAC,EACvB,SAAqC,EACrC,KAAK,EACL,OAAiC,EACjC,eAAiD,EACjD,SAAqC,EACrC,IAAI,EACJ,QAAmC,EACnC,OAAiC,EACjC,aAA6C,EAC7C,SAAqC,EACrC,KAA6B,GAC9B,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"FlexGrid.d.ts","sourceRoot":"","sources":["../../../../src/Legacy/Grid/FlexGrid/FlexGrid.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAqD,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE9F,wBAAgB,QAAQ,CAAC,EACvB,SAAqC,EACrC,KAAK,EACL,OAAiC,EACjC,eAAiD,EACjD,SAAqC,EACrC,IAAI,EACJ,QAAmC,EACnC,OAAiC,EACjC,aAA6C,EAC7C,SAAqC,EACrC,KAA6B,GAC9B,EAAE,SAAS,2CAgPX"}
|
|
@@ -17,6 +17,7 @@ var _padding = _interopRequireDefault(require("@papillonarts/css/utilities/paddi
|
|
|
17
17
|
var _typography = _interopRequireDefault(require("@papillonarts/css/utilities/typography.scss"));
|
|
18
18
|
var _visibilityDisplay = _interopRequireDefault(require("@papillonarts/css/utilities/visibility-display.scss"));
|
|
19
19
|
var _sort = require("@papillonarts/library/sort");
|
|
20
|
+
var _string = require("@papillonarts/library/string");
|
|
20
21
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
21
22
|
var _react = require("react");
|
|
22
23
|
var _uuid = require("uuid");
|
|
@@ -27,8 +28,6 @@ var _grid = _interopRequireDefault(require("../../Layout/grid.scss"));
|
|
|
27
28
|
var _FlexGrid = _interopRequireDefault(require("./FlexGrid.scss"));
|
|
28
29
|
var _FlexGrid2 = require("./FlexGrid.type");
|
|
29
30
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
30
|
-
// import { getCapitalizedString } from '@papillonarts/library/string'
|
|
31
|
-
|
|
32
31
|
function FlexGrid(_ref) {
|
|
33
32
|
var _items$;
|
|
34
33
|
var _ref$className = _ref.className,
|
|
@@ -119,7 +118,11 @@ function FlexGrid(_ref) {
|
|
|
119
118
|
children: isSelectedColumn ? isSelectedComponent : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
120
119
|
className: (0, _classnames["default"])(_visibilityDisplay["default"]['d-flex'], _flexbox["default"]['flex-justify-between'], _layout["default"]['width-full']),
|
|
121
120
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
122
|
-
className: (0, _classnames["default"])(_index["default"]['css-truncate'], _index["default"]['css-truncate-overflow'])
|
|
121
|
+
className: (0, _classnames["default"])(_index["default"]['css-truncate'], _index["default"]['css-truncate-overflow']),
|
|
122
|
+
children: (0, _string.getCapitalizedString)({
|
|
123
|
+
input: name.toString(),
|
|
124
|
+
separator: '-'
|
|
125
|
+
})
|
|
123
126
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
124
127
|
className: (0, _classnames["default"])(_visibilityDisplay["default"]['d-flex'], _flexbox["default"]['flex-items-start'], _margin["default"]['ml-1']),
|
|
125
128
|
children: [sortComponent, nameIndex < (items === null || items === void 0 || (_items$2 = items[0]) === null || _items$2 === void 0 ? void 0 : _items$2.names.length) - 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@papillonarts/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.0",
|
|
4
4
|
"description": "Papillon Arts Components",
|
|
5
5
|
"homepage": "https://github.com/papillonarts/papillonarts/tree/master/packages/components",
|
|
6
6
|
"repository": {
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"build-release": "npm run build"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@papillonarts/css": "^0.
|
|
30
|
-
"@papillonarts/library": "^0.
|
|
29
|
+
"@papillonarts/css": "^0.42.0",
|
|
30
|
+
"@papillonarts/library": "^0.42.0"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "4b8cd00e12214132f87b702855aa37dc506dbadd"
|
|
33
33
|
}
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
# Test Environment
|
|
2
|
-
|
|
3
|
-
## Date Handling
|
|
4
|
-
|
|
5
|
-
All tests use UTC timezone with ISO-like formatting to prevent snapshot drift across different environments and timezones.
|
|
6
|
-
|
|
7
|
-
Date.prototype methods are patched in [jest.setup.js](../../../../jest.setup.js) to ensure deterministic output:
|
|
8
|
-
- `toLocaleString()` → "yyyy-MM-ddTHH:mm:ssZ" (ISO-like, explicit UTC)
|
|
9
|
-
- `toLocaleDateString()` → "yyyy-MM-dd"
|
|
10
|
-
- `toLocaleTimeString()` → "HH:mm:ssZ"
|
|
11
|
-
|
|
12
|
-
**Example:**
|
|
13
|
-
```javascript
|
|
14
|
-
new Date('2020-07-05T19:04:15Z').toLocaleString() // "2020-07-05T19:04:15Z"
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Test Scripts
|
|
18
|
-
|
|
19
|
-
- **`npm test`** - Fast parallel execution (no coverage, no snapshot updates)
|
|
20
|
-
- Best for: Local development, quick feedback
|
|
21
|
-
- Workers: 50% of CPU cores
|
|
22
|
-
- Duration: ~49s
|
|
23
|
-
|
|
24
|
-
- **`npm run test:ci`** - Full CI run (serial, coverage, updates snapshots)
|
|
25
|
-
- Best for: CI/CD, pre-commit validation, snapshot updates
|
|
26
|
-
- Workers: 1 (--runInBand for determinism)
|
|
27
|
-
- Duration: ~97s
|
|
28
|
-
|
|
29
|
-
- **`npm run test:coverage`** - Parallel with coverage
|
|
30
|
-
- Best for: Coverage reports without snapshot updates
|
|
31
|
-
- Workers: 50% of CPU cores
|
|
32
|
-
- Duration: ~49s
|
|
33
|
-
|
|
34
|
-
- **`npm run test:tdd`** - Watch mode for local development
|
|
35
|
-
- Best for: Test-driven development
|
|
36
|
-
- Features: Watch mode, verbose output, only changed files
|
|
37
|
-
|
|
38
|
-
- **`npm run test:update-snapshots`** - Update snapshots only
|
|
39
|
-
- Best for: Intentional snapshot updates without full CI run
|
|
40
|
-
|
|
41
|
-
- **`npm run test:generate-output`** - Generate JSON output for Storybook
|
|
42
|
-
- Best for: Storybook integration
|
|
43
|
-
|
|
44
|
-
## Test Structure
|
|
45
|
-
|
|
46
|
-
```
|
|
47
|
-
packages/components/src/
|
|
48
|
-
├── Legacy/
|
|
49
|
-
│ ├── Button/
|
|
50
|
-
│ │ ├── __tests__/
|
|
51
|
-
│ │ │ ├── Button.test.ts # Test file
|
|
52
|
-
│ │ │ └── __snapshots__/ # Snapshot files
|
|
53
|
-
│ │ └── Button.tsx
|
|
54
|
-
│ └── ...
|
|
55
|
-
├── Modern/
|
|
56
|
-
│ └── ...
|
|
57
|
-
└── __tests__/
|
|
58
|
-
├── README.md # This file
|
|
59
|
-
└── test-utils.ts # Shared test utilities
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## Test Conventions
|
|
63
|
-
|
|
64
|
-
- **Test files**: `*.test.ts` or `*.test.tsx`
|
|
65
|
-
- **Snapshot files**: Stored in `__snapshots__/` directories
|
|
66
|
-
- **Test utilities**: Shared helpers in `__tests__/test-utils.ts`
|
|
67
|
-
|
|
68
|
-
## Coverage Thresholds
|
|
69
|
-
|
|
70
|
-
Thresholds reflect the broader instrumentation baseline and are enforced only in CI or when explicitly enabled.
|
|
71
|
-
|
|
72
|
-
| Metric | Threshold | Rationale |
|
|
73
|
-
|-------------|-----------|----------------------------------------------|
|
|
74
|
-
| Statements | 63% | Broader scope including library/lodash |
|
|
75
|
-
| Branches | 60% | Accounts for untested conditional paths |
|
|
76
|
-
| Functions | 52% | Library barrels and type-only exports |
|
|
77
|
-
| Lines | 64% | Matches statements threshold |
|
|
78
|
-
|
|
79
|
-
Enforcement:
|
|
80
|
-
- Local fast dev (`npm test`): thresholds not enforced.
|
|
81
|
-
- Local CI-style (`COVERAGE=true npm run test:ci`): thresholds enforced.
|
|
82
|
-
- CI (`CI=true npm run test:ci`): thresholds enforced.
|
|
83
|
-
|
|
84
|
-
## Running Tests
|
|
85
|
-
|
|
86
|
-
### Quick Development Cycle
|
|
87
|
-
```bash
|
|
88
|
-
npm test # Fast feedback
|
|
89
|
-
npm run test:tdd # Watch mode
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### Before Committing
|
|
93
|
-
```bash
|
|
94
|
-
npm run test:ci # Full validation with coverage
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### Updating Snapshots
|
|
98
|
-
```bash
|
|
99
|
-
npm run test:update-snapshots # Update snapshots only
|
|
100
|
-
npm run test:ci # Update + coverage
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## Shared Test Utilities
|
|
104
|
-
|
|
105
|
-
Use helpers from `test-utils.ts` to reduce boilerplate:
|
|
106
|
-
|
|
107
|
-
```typescript
|
|
108
|
-
import { renderSnapshot, renderSnapshotAsync } from '../__tests__/test-utils'
|
|
109
|
-
|
|
110
|
-
// Synchronous snapshot
|
|
111
|
-
test('must match defaults()', () => {
|
|
112
|
-
renderSnapshot(defaults())
|
|
113
|
-
})
|
|
114
|
-
|
|
115
|
-
// Async snapshot
|
|
116
|
-
test('must match async()', async () => {
|
|
117
|
-
await renderSnapshotAsync(async())
|
|
118
|
-
})
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
## Troubleshooting
|
|
122
|
-
|
|
123
|
-
### Snapshot Drift
|
|
124
|
-
If snapshots keep changing:
|
|
125
|
-
1. Verify UTC timezone is set (`process.env.TZ = 'UTC'` in jest.setup.js)
|
|
126
|
-
2. Check date formatting functions are using UTC methods (`getUTCDate()`, not `getDate()`)
|
|
127
|
-
3. Run `npm run test:ci` to update snapshots with deterministic settings
|
|
128
|
-
|
|
129
|
-
### Coverage Threshold Failures
|
|
130
|
-
- Local `npm test` does not enforce thresholds; use it for fast development.
|
|
131
|
-
- Use `COVERAGE=true npm run test:ci` to enforce thresholds locally before CI.
|
|
132
|
-
- Coverage thresholds are enforced in CI to maintain code quality.
|
|
133
|
-
|
|
134
|
-
### Slow Test Execution
|
|
135
|
-
- Use `npm test` instead of `npm run test:ci` for development (2x faster)
|
|
136
|
-
- Use `npm run test:tdd` to run only changed tests
|
|
137
|
-
- Check for heavy setup/teardown in `beforeEach`/`afterEach` hooks
|
|
138
|
-
|
|
139
|
-
## CI/CD Integration
|
|
140
|
-
|
|
141
|
-
For CI pipelines, always use:
|
|
142
|
-
```bash
|
|
143
|
-
CI=true npm run test:ci
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
This ensures:
|
|
147
|
-
- Serial execution for deterministic results
|
|
148
|
-
- Coverage reports for Codecov
|
|
149
|
-
- Snapshot updates are captured
|
|
150
|
-
- Coverage thresholds are enforced
|
|
151
|
-
- Consistent timing measurements
|
|
152
|
-
|
|
153
|
-
## Shared Utilities
|
|
154
|
-
|
|
155
|
-
Import helpers from this folder to reduce boilerplate:
|
|
156
|
-
|
|
157
|
-
```ts
|
|
158
|
-
import { renderSnapshot, renderSnapshotAsync, waitFor } from './test-utils'
|
|
159
|
-
```
|