Skip to content

Commit c20a21f

Browse files
authored
Merge pull request #1398 from OneSignal/fg/size-reduction
chore: more size reduction for bundled files
2 parents b2638aa + 172098b commit c20a21f

26 files changed

+778
-782
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ ngrok.log
1313
.vscode/**
1414
!.vscode/launch.json
1515
!.vscode/settings.json
16+
!.vscode/keybindings.json
1617
.cursor/
1718

1819
coverage

.vscode/keybindings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[
2+
{
3+
"key": "shift+cmd+y",
4+
"command": "macros.rename_"
5+
}
6+
]

.vscode/settings.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,33 @@
22
"editor.codeActionsOnSave": {
33
"source.fixAll.eslint": "explicit",
44
"source.organizeImports": "always"
5+
},
6+
// a macro to rename a variable to _variable
7+
"macros": {
8+
"rename_": [
9+
{
10+
"javascript": [
11+
"const ed = vscode.window.activeTextEditor;",
12+
"if (!ed) return;",
13+
"const pos = ed.selection.active;",
14+
"const rng = ed.document.getWordRangeAtPosition(pos);",
15+
"if (!rng) return;",
16+
"const oldName = ed.document.getText(rng);",
17+
"// if it already starts with '_', do nothing (remove this guard if you always want to re-run)",
18+
"if (oldName.startsWith('_')) return;",
19+
"const newName = '_' + oldName;",
20+
"// Ask VS Code for a rename edit at this position",
21+
"const edit = await vscode.commands.executeCommand(",
22+
" 'vscode.executeDocumentRenameProvider',",
23+
" ed.document.uri,",
24+
" pos,",
25+
" newName",
26+
");",
27+
"if (edit) {",
28+
" await vscode.workspace.applyEdit(edit);",
29+
"}"
30+
]
31+
}
32+
]
533
}
634
}

__test__/support/environment/TestContext.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export default class TestContext {
9595
slidedown: {
9696
prompts: [
9797
{
98-
type: DelayedPromptType.Push,
98+
type: DelayedPromptType._Push,
9999
autoPrompt: false,
100100
text: {
101101
acceptButton: 'Allow',
@@ -238,7 +238,7 @@ export default class TestContext {
238238
slidedown: {
239239
prompts: [
240240
{
241-
type: DelayedPromptType.Push,
241+
type: DelayedPromptType._Push,
242242
autoPrompt: false,
243243
text: {
244244
acceptButton: 'Allow',
@@ -364,7 +364,7 @@ export default class TestContext {
364364
slidedown: {
365365
prompts: [
366366
{
367-
type: DelayedPromptType.Push,
367+
type: DelayedPromptType._Push,
368368
autoPrompt: false,
369369
text: {
370370
acceptButton: 'Allow',

0 commit comments

Comments
 (0)