Skip to content

Commit eaf8683

Browse files
amitjoshi438Amit Joshi
andauthored
Add localization for server logic debugging commands and update RUNTIME_LOADER filename (#1407)
* Add localization for server logic debugging commands and update editor buttons * Update RUNTIME_LOADER filename for CommonJS compatibility in Server Logic debugger --------- Co-authored-by: Amit Joshi <[email protected]>
1 parent e6c3000 commit eaf8683

File tree

4 files changed

+26
-9
lines changed

4 files changed

+26
-9
lines changed

loc/translations-export/vscode-powerplatform.xlf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,6 +1472,9 @@ The fifth line should be '[TRANSLATION HERE](command:powerplatform-walkthrough.s
14721472
<trans-unit id="pacCLI.envAndSolutionsPanel.copyVersionNumber.title">
14731473
<source xml:lang="en">Copy Version Number</source>
14741474
</trans-unit>
1475+
<trans-unit id="microsoft.powerplatform.pages.debugServerLogic.title">
1476+
<source xml:lang="en">Debug Current Server Logic File</source>
1477+
</trans-unit>
14751478
<trans-unit id="pacCLI.authPanel.deleteAuthProfile.title">
14761479
<source xml:lang="en">Delete Auth Profile</source>
14771480
</trans-unit>
@@ -1638,6 +1641,9 @@ The second line should be '[TRANSLATION HERE](command:powerplatform-walkthrough.
16381641
<trans-unit id="microsoft.powerplatform.pages.actionsHub.currentActiveSite.runCodeQLScreening.title">
16391642
<source xml:lang="en">Run CodeQL Screening</source>
16401643
</trans-unit>
1644+
<trans-unit id="microsoft.powerplatform.pages.runServerLogic.title">
1645+
<source xml:lang="en">Run Current Server Logic File</source>
1646+
</trans-unit>
16411647
<trans-unit id="microsoft-powerapps-portals.walkthrough.saveConflict.title">
16421648
<source xml:lang="en">Save conflict</source>
16431649
</trans-unit>

package.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -407,14 +407,14 @@
407407
{
408408
"command": "microsoft.powerplatform.pages.debugServerLogic",
409409
"category": "Power Pages",
410-
"title": "Debug Current Server Logic File",
410+
"title": "%microsoft.powerplatform.pages.debugServerLogic.title%",
411411
"icon": "$(debug-alt)",
412412
"enablement": "resourcePath =~ /server-logics?[/\\\\]/ && resourceExtname == .js"
413413
},
414414
{
415415
"command": "microsoft.powerplatform.pages.runServerLogic",
416416
"category": "Power Pages",
417-
"title": "Run Server Logic File",
417+
"title": "%microsoft.powerplatform.pages.runServerLogic.title%",
418418
"icon": "$(run)",
419419
"enablement": "resourcePath =~ /server-logics?[/\\\\]/ && resourceExtname == .js"
420420
},
@@ -914,6 +914,18 @@
914914
"group": "0_powerpages-copilot@1"
915915
}
916916
],
917+
"editor/title/run": [
918+
{
919+
"command": "microsoft.powerplatform.pages.runServerLogic",
920+
"group": "serverLogic@1",
921+
"when": "microsoft.powerplatform.pages.serverLogicDebuggingEnabled && resourcePath =~ /server-logics?[/\\\\]/ && resourceExtname == .js"
922+
},
923+
{
924+
"command": "microsoft.powerplatform.pages.debugServerLogic",
925+
"group": "serverLogic@2",
926+
"when": "microsoft.powerplatform.pages.serverLogicDebuggingEnabled && resourcePath =~ /server-logics?[/\\\\]/ && resourceExtname == .js"
927+
}
928+
],
917929
"explorer/context": [
918930
{
919931
"submenu": "microsoft-powerapps-portals.powerpages",
@@ -958,11 +970,6 @@
958970
"command": "powerPlatform.previewCurrentActiveUsers",
959971
"group": "navigation",
960972
"when": "isWeb && virtualWorkspace"
961-
},
962-
{
963-
"command": "microsoft.powerplatform.pages.debugServerLogic",
964-
"group": "navigation",
965-
"when": "microsoft.powerplatform.pages.serverLogicDebuggingEnabled && resourcePath =~ /server-logics?[/\\\\]/ && resourceExtname == .js"
966973
}
967974
],
968975
"commandPalette": [

package.nls.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,5 +134,7 @@
134134
"microsoft.powerplatform.pages.actionsHub.metadataDiff.export.title": "Export Comparison",
135135
"microsoft.powerplatform.pages.actionsHub.metadataDiff.import.title": "Import Comparison",
136136
"microsoft.powerplatform.pages.actionsHub.metadataDiff.resync.title": "Refresh Comparison",
137-
"microsoft-powerapps-portals.compareWithEnvironment.title": "Compare with Environment"
137+
"microsoft-powerapps-portals.compareWithEnvironment.title": "Compare with Environment",
138+
"microsoft.powerplatform.pages.debugServerLogic.title": "Debug Current Server Logic File",
139+
"microsoft.powerplatform.pages.runServerLogic.title": "Run Current Server Logic File"
138140
}

src/debugger/server-logic/Constants.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ export const SERVER_LOGIC_CONFIG_KEYS = {
2222

2323
/**
2424
* File and folder names used by Server Logic debugger
25+
* Note: RUNTIME_LOADER uses .cjs extension to ensure CommonJS compatibility
26+
* even when parent package.json has "type": "module"
2527
*/
2628
export const SERVER_LOGIC_FILES = {
27-
RUNTIME_LOADER: 'server-logic-debug-runtime.js',
29+
RUNTIME_LOADER: 'server-logic-debug-runtime.cjs',
2830
SERVER_LOGICS_FOLDER: 'server-logics',
2931
VSCODE_FOLDER: '.vscode',
3032
GITIGNORE: '.gitignore'

0 commit comments

Comments
 (0)