snapexcel 1.2.6 → 1.2.8
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/WALMART_NPM_PUBLISHING_GUIDE.md +125 -0
- package/package.json +1 -1
- package/publish.sh +5 -0
- package/src/index.html +2 -2
- package/src/main.js +16 -12
- package/src/renderer.js +7 -0
- package/src/styles.css +10 -4
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Walmart Internal NPM Publishing Guide
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Walmart uses **Proximity** (also called Backpack) as its internal npm registry for publishing Node.js packages.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Registry URL
|
|
9
|
+
```
|
|
10
|
+
https://npme.walmart.com
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Step 1: Configure .npmrc
|
|
16
|
+
|
|
17
|
+
Create or update your `.npmrc` file (in project root or `$HOME/.npmrc`):
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
registry=https://npme.walmart.com
|
|
21
|
+
email=your.email@walmartlabs.com
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**Important:** Do NOT include `authToken` in your `.npmrc` for the internal registry.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Step 2: Update package.json with Scope
|
|
29
|
+
|
|
30
|
+
Walmart requires scoped packages. Use `@walmart` or `@walmartlabs`:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"name": "@walmart/snapexcel",
|
|
35
|
+
"version": "1.2.5",
|
|
36
|
+
"description": "Desktop Screenshot Logger for UI Testing",
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"registry": "https://npme.walmart.com"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Step 3: Publishing via Looper (Required)
|
|
46
|
+
|
|
47
|
+
⚠️ **Manual publishing from local machines is NOT allowed.**
|
|
48
|
+
|
|
49
|
+
Publishing must be done through **Looper** (Walmart's CI/CD platform):
|
|
50
|
+
|
|
51
|
+
1. Push your code to gecgithub01.walmart.com
|
|
52
|
+
2. Configure Looper pipeline for npm publish
|
|
53
|
+
3. Looper handles authentication automatically
|
|
54
|
+
|
|
55
|
+
### Looper Configuration Example (looper.yml):
|
|
56
|
+
```yaml
|
|
57
|
+
pipelines:
|
|
58
|
+
publish:
|
|
59
|
+
steps:
|
|
60
|
+
- npm:
|
|
61
|
+
command: publish
|
|
62
|
+
registry: https://npme.walmart.com
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Step 4: Best Practices
|
|
68
|
+
|
|
69
|
+
1. **Always use `package-lock.json`** - Ensures deterministic builds
|
|
70
|
+
2. **Use scoped packages** - `@walmart/` or `@walmartlabs/`
|
|
71
|
+
3. **No manual publishing** - Always use Looper
|
|
72
|
+
4. **Remove authToken lines** - Don't comment them, remove completely
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Troubleshooting
|
|
77
|
+
|
|
78
|
+
### Error: `npm ERR! need auth`
|
|
79
|
+
- You're trying to publish from local machine (not allowed)
|
|
80
|
+
- Your `.npmrc` has an `authToken` line - remove it completely
|
|
81
|
+
|
|
82
|
+
### Error: Authentication failed
|
|
83
|
+
- Ensure you're using Looper, not local publish
|
|
84
|
+
- Check `.npmrc` configuration
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## References
|
|
89
|
+
|
|
90
|
+
- [Using NPM at Walmart](https://dx.walmart.com/proximity/documentation/dx/Using-NPM-D7drllinbbb)
|
|
91
|
+
- [NPM Best Practices](https://dx.walmart.com/artifactory/documentation/confluence/NPM-Best-Practices-2555353509)
|
|
92
|
+
- [Proximity FAQs](https://dx.walmart.com/proximity/documentation/dx/Proximity-FAQs-Dg9qp321adg)
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Quick Summary
|
|
97
|
+
|
|
98
|
+
| Item | Value |
|
|
99
|
+
|------|-------|
|
|
100
|
+
| Registry URL | `https://npme.walmart.com` |
|
|
101
|
+
| Scope | `@walmart` or `@walmartlabs` |
|
|
102
|
+
| Publishing | Via Looper only (not local) |
|
|
103
|
+
| Auth | Handled by Looper automatically |
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## For SnapExcel
|
|
108
|
+
|
|
109
|
+
To publish SnapExcel to Walmart's internal registry:
|
|
110
|
+
|
|
111
|
+
1. Update `package.json`:
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"name": "@walmart/snapexcel",
|
|
115
|
+
"publishConfig": {
|
|
116
|
+
"registry": "https://npme.walmart.com"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
2. Push to gecgithub01.walmart.com
|
|
122
|
+
3. Set up Looper pipeline for publishing
|
|
123
|
+
4. Looper will handle the rest
|
|
124
|
+
|
|
125
|
+
**Note:** You cannot publish from your local machine to Walmart's registry.
|
package/package.json
CHANGED
package/publish.sh
ADDED
package/src/index.html
CHANGED
|
@@ -103,11 +103,11 @@
|
|
|
103
103
|
<!-- Keyboard Shortcuts -->
|
|
104
104
|
<div class="shortcut-hint">
|
|
105
105
|
<div class="shortcut-item">
|
|
106
|
-
<span class="shortcut-key">⌘⇧
|
|
106
|
+
<span class="shortcut-key">⌘⇧A</span>
|
|
107
107
|
<span class="shortcut-label">Fullscreen</span>
|
|
108
108
|
</div>
|
|
109
109
|
<div class="shortcut-item">
|
|
110
|
-
<span class="shortcut-key">⌘⇧
|
|
110
|
+
<span class="shortcut-key">⌘⇧S</span>
|
|
111
111
|
<span class="shortcut-label">Region</span>
|
|
112
112
|
</div>
|
|
113
113
|
</div>
|
package/src/main.js
CHANGED
|
@@ -29,13 +29,13 @@ function createWindow() {
|
|
|
29
29
|
|
|
30
30
|
mainWindow.loadFile(path.join(__dirname, 'index.html'));
|
|
31
31
|
|
|
32
|
-
// Register global shortcut for capture (Cmd/Ctrl + Shift +
|
|
33
|
-
globalShortcut.register('CommandOrControl+Shift+
|
|
32
|
+
// Register global shortcut for fullscreen capture (Cmd/Ctrl + Shift + A for All)
|
|
33
|
+
globalShortcut.register('CommandOrControl+Shift+A', () => {
|
|
34
34
|
mainWindow.webContents.send('trigger-capture');
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
// Register global shortcut for region capture (Cmd/Ctrl + Shift +
|
|
38
|
-
globalShortcut.register('CommandOrControl+Shift+
|
|
37
|
+
// Register global shortcut for region capture (Cmd/Ctrl + Shift + S for Select)
|
|
38
|
+
globalShortcut.register('CommandOrControl+Shift+S', () => {
|
|
39
39
|
mainWindow.webContents.send('trigger-region-capture');
|
|
40
40
|
});
|
|
41
41
|
|
|
@@ -195,16 +195,20 @@ ipcMain.handle('start-region-capture', async () => {
|
|
|
195
195
|
regionWindow.webContents.send('set-background', fullScreenshot, display.size);
|
|
196
196
|
});
|
|
197
197
|
|
|
198
|
-
// Function to restore main window
|
|
198
|
+
// Function to restore main window without stealing focus
|
|
199
199
|
const restoreMainWindow = () => {
|
|
200
|
-
if (mainWindow
|
|
201
|
-
//
|
|
200
|
+
if (mainWindow) {
|
|
201
|
+
// Just restore the window state without bringing it to foreground
|
|
202
|
+
// This prevents pulling user to SnapExcel window when they're on different screen
|
|
202
203
|
setTimeout(() => {
|
|
203
|
-
mainWindow.
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
204
|
+
if (mainWindow.isMinimized()) {
|
|
205
|
+
// Use showInactive to restore without stealing focus
|
|
206
|
+
mainWindow.showInactive();
|
|
207
|
+
}
|
|
208
|
+
// Don't change size/position - keep window where it was
|
|
209
|
+
if (isAlwaysOnTop) {
|
|
210
|
+
mainWindow.setAlwaysOnTop(true);
|
|
211
|
+
}
|
|
208
212
|
}, 100);
|
|
209
213
|
}
|
|
210
214
|
};
|
package/src/renderer.js
CHANGED
|
@@ -733,6 +733,9 @@ async function captureScreenshot() {
|
|
|
733
733
|
|
|
734
734
|
state.sheets[state.currentSheetIndex].screenshots.push(screenshot);
|
|
735
735
|
saveState();
|
|
736
|
+
|
|
737
|
+
// Small delay to let window fully restore before updating UI
|
|
738
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
736
739
|
updateUI();
|
|
737
740
|
lastCaptureTime = Date.now();
|
|
738
741
|
|
|
@@ -798,6 +801,10 @@ async function captureRegion() {
|
|
|
798
801
|
|
|
799
802
|
state.sheets[state.currentSheetIndex].screenshots.push(screenshot);
|
|
800
803
|
saveState();
|
|
804
|
+
|
|
805
|
+
// Small delay to let window fully restore before updating UI
|
|
806
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
807
|
+
|
|
801
808
|
// Don't call updateUI() which might resize the window - just update the grid
|
|
802
809
|
updateScreenshotsGrid(state.sheets[state.currentSheetIndex].screenshots);
|
|
803
810
|
elements.screenshotCount.textContent = state.sheets[state.currentSheetIndex].screenshots.length;
|
package/src/styles.css
CHANGED
|
@@ -47,8 +47,7 @@ body {
|
|
|
47
47
|
.app-container {
|
|
48
48
|
display: flex;
|
|
49
49
|
flex-direction: column;
|
|
50
|
-
|
|
51
|
-
max-height: 100vh;
|
|
50
|
+
height: 100vh;
|
|
52
51
|
overflow: hidden;
|
|
53
52
|
}
|
|
54
53
|
|
|
@@ -159,7 +158,9 @@ body {
|
|
|
159
158
|
display: flex;
|
|
160
159
|
flex-direction: column;
|
|
161
160
|
overflow-y: auto;
|
|
161
|
+
overflow-x: hidden;
|
|
162
162
|
padding: 16px;
|
|
163
|
+
flex: 1;
|
|
163
164
|
}
|
|
164
165
|
|
|
165
166
|
.view.hidden {
|
|
@@ -534,6 +535,9 @@ body {
|
|
|
534
535
|
border-radius: 5px;
|
|
535
536
|
border: 0.5px solid rgba(4, 30, 66, 0.04);
|
|
536
537
|
padding: 5px;
|
|
538
|
+
flex: 1;
|
|
539
|
+
min-height: 100px;
|
|
540
|
+
overflow: hidden;
|
|
537
541
|
}
|
|
538
542
|
|
|
539
543
|
.section-header {
|
|
@@ -559,14 +563,16 @@ body {
|
|
|
559
563
|
|
|
560
564
|
.screenshots-grid {
|
|
561
565
|
display: grid;
|
|
562
|
-
grid-template-columns: repeat(
|
|
566
|
+
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
|
|
567
|
+
grid-auto-rows: min-content;
|
|
568
|
+
align-content: start;
|
|
563
569
|
gap: 8px;
|
|
564
570
|
overflow-y: auto;
|
|
565
571
|
padding: 5px;
|
|
566
572
|
background: rgba(255, 255, 255, 0.5);
|
|
567
573
|
border-radius: 3px;
|
|
574
|
+
flex: 1;
|
|
568
575
|
min-height: 70px;
|
|
569
|
-
max-height: 200px;
|
|
570
576
|
}
|
|
571
577
|
|
|
572
578
|
/* Ultra thin scrollbar - both vertical and horizontal */
|