Skip to content

Commit c25b40e

Browse files
authored
Merge pull request #273 from marklogic/develop
Finish up 3.9.0
2 parents 2166ab8 + 9f406bf commit c25b40e

File tree

73 files changed

+2772
-1197
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2772
-1197
lines changed

.eslintrc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@
118118
]
119119
}
120120
],
121-
"eqeqeq": "error"
121+
"eqeqeq": "error",
122+
"@typescript-eslint/no-explicit-any": "warn",
123+
"@typescript-eslint/no-unused-vars": "warn"
122124
}
123125
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ dist
1010
.gradle
1111
gradle-local.properties
1212
results/
13+
coverage/
1314
test-app/.gradle
1415
test-app/build
16+
test-app/docker
1517

1618
test-app/src/main/ml-modules/root/MarkLogic

CHANGELOG.md

Lines changed: 63 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,53 @@
1+
## [3.9.0](https://github.com/marklogic/mlxprs/releases/tag/v3.9.0)
2+
3+
- New MarkLogic icon in the Activity Bar that can be used to open an explorer view with high-level information about the currently connected MarkLogic server.
4+
- Can use new configuration options to connect to MarkLogic behind a proxy server or in MarkLogic Cloud.
5+
* -restBasePath
6+
* -manageBasePath
7+
* -testBasePath
8+
* -adminBasePath
9+
* -apiKey
10+
* -authType (now accepts "CLOUD")
11+
- [Improved user guide.](https://marklogic.github.io/mlxprs/)
12+
13+
114
## [3.8.0](https://github.com/marklogic/mlxprs/releases/tag/v3.8.0)
215

3-
- Run marklogic-unit-test modules in a MarkLogic server
4-
- Validate TDE Templates
5-
- Extract Nodes from data documents using a TDE Template
6-
- Submit a GraphQL Query to /v1/rows/graphql
7-
- Various updates to the README
16+
- Run marklogic-unit-test modules in a MarkLogic server.
17+
- Validate TDE Templates.
18+
- Extract Nodes from data documents using a TDE Template.
19+
- Submit a GraphQL Query to /v1/rows/graphql.
20+
- Various updates to the README.
821

922

1023
## [3.7.0](https://github.com/marklogic/mlxprs/releases/tag/v3.7.0)
1124

12-
- Submit an Optic DSL Query to /v1/rows and get back JSON
13-
- Submit Optic Query and get back XML or CSV
14-
- View "Connected" status information in bottom status line
15-
- Made the UX for attaching to a JS server match attaching to an XQY server, and sorted based on server name
16-
- Run Highlighted Code in editor windows (rather than the entire window)
17-
- Display "eval" results in a new tab in the bottom panel (use a setting to revert back to an editor tab)
18-
- Permit attaching to a remote request even if the current editor tab is not source code
25+
- Submit an Optic DSL Query to /v1/rows and get back JSON.
26+
- Submit Optic Query and get back XML or CSV.
27+
- View "Connected" status information in bottom status line.
28+
- Made the UX for attaching to a JS server match attaching to an XQY server, and sorted based on server name.
29+
- Run Highlighted Code in editor windows (rather than the entire window).
30+
- Display "eval" results in a new tab in the bottom panel (use a setting to revert back to an editor tab).
31+
- Permit attaching to a remote request even if the current editor tab is not source code.
1932

2033

2134
## [3.6.2](https://github.com/marklogic/mlxprs/releases/tag/v3.6.2)
2235

23-
- Fixed the icon used in the Visual Studio Marketplace
36+
- Fixed the icon used in the Visual Studio Marketplace .
2437

2538
## [3.6.0](https://github.com/marklogic/mlxprs/releases/tag/v3.6.0)
2639

27-
- [#116](https://github.com/marklogic/mlxprs/issues/116) Updated dependencies and fixed all known security vulnerabilities
28-
- [#119](https://github.com/marklogic/mlxprs/issues/119) Added SJS binding to JavaScript language
29-
- [#97](https://github.com/marklogic/mlxprs/issues/97) Added a configuration option for the MarkLogic Manage app server port (used for the SJS debug server port)
30-
- [#117](https://github.com/marklogic/mlxprs/issues/117) Fixed a bug with the first attempt to eval a JavaScript tab
31-
- [#109](https://github.com/marklogic/mlxprs/issues/109) Prevent the database param from being used in REST calls when the database setting is empty
40+
- [#116](https://github.com/marklogic/mlxprs/issues/116) Updated dependencies and fixed all known security vulnerabilities.
41+
- [#119](https://github.com/marklogic/mlxprs/issues/119) Added SJS binding to JavaScript language.
42+
- [#97](https://github.com/marklogic/mlxprs/issues/97) Added a configuration option for the MarkLogic Manage app server port (used for the SJS debug server port).
43+
- [#117](https://github.com/marklogic/mlxprs/issues/117) Fixed a bug with the first attempt to eval a JavaScript tab.
44+
- [#109](https://github.com/marklogic/mlxprs/issues/109) Prevent the database param from being used in REST calls when the database setting is empty.
3245

3346

3447
## [3.5.1](https://github.com/mikrovvelle/mlxprs/tree/v3.5.1)
3548

36-
- Fix [#92](https://github.com/mikrovvelle/mlxprs/issues/92), better error handling with XQuery debug launch failures
37-
- Added VS Code badges to Readme
49+
- Fix [#92](https://github.com/mikrovvelle/mlxprs/issues/92), better error handling with XQuery debug launch failures.
50+
- Added VS Code badges to Readme.
3851

3952
## [3.5.0](https://github.com/mikrovvelle/mlxprs/tree/v3.5.0)
4053

@@ -56,116 +69,116 @@ Addressed off-by-one error in changelog.
5669

5770
## [3.1.0](https://github.com/mikrovvelle/mlxprs/tree/v3.1.0)
5871

59-
- fixes: #70. SJS debugging now streams modules if they're not available locally
60-
- other SJS debugging improvements
72+
- fixes: #70. SJS debugging now streams modules if they're not available locally.
73+
- other SJS debugging improvements.
6174

6275
## [3.0.4](https://github.com/mikrovvelle/mlxprs/tree/v3.0.4)
6376

64-
- bugfix: #69
77+
- bugfix: #69.
6578

6679
## [3.0.3](https://github.com/mikrovvelle/mlxprs/tree/v3.0.3)
6780

68-
- add "MarkLogic: Show module" command
69-
- fixes: #68. XQuery debugging now streams modules if they're not available locally
81+
- add "MarkLogic: Show module" command.
82+
- fixes: #68. XQuery debugging now streams modules if they're not available locally.
7083

7184
## [3.0.2](https://github.com/mikrovvelle/mlxprs/tree/v3.0.2)
7285

73-
- bugfix: #67
86+
- bugfix: #67.
7487

7588
## [3.0.1](https://github.com/mikrovvelle/mlxprs/tree/v3.0.1)
7689

77-
- fix: #10 - make best effort to format XML and JSON query results
90+
- fix: #10 - make best effort to format XML and JSON query results.
7891

7992
## [3.0.0](https://github.com/mikrovvelle/mlxprs/tree/v3.0.0)
8093

81-
- add XQuery debugging
94+
- add XQuery debugging.
8295

8396
## [2.0.0](https://github.com/mikrovvelle/mlxprs/tree/v2.0.0)
8497

85-
- add JavaScript debugging
98+
- add JavaScript debugging.
8699

87100
## [1.2.2](https://github.com/mikrovvelle/mlxprs/tree/v1.2.2)
88101

89-
- dependency upgrades under the hood
102+
- dependency upgrades under the hood.
90103

91104
## [1.2.1](https://github.com/mikrovvelle/mlxprs/tree/v1.2.1)
92105

93106
- fix: #17
94-
- bugfix: empty results aren't 'pending'
107+
- bugfix: empty results aren't 'pending'.
95108

96109
## [1.2.0](https://github.com/mikrovvelle/mlxprs/tree/v1.2.0)
97110

98-
- Added per-query client parameter override capability to XQuery (see README)
111+
- Added per-query client parameter override capability to XQuery (see README).
99112

100113
## [1.1.1](https://github.com/mikrovvelle/mlxprs/tree/v1.1.1)
101114

102-
- Security fixes for npm dependencies
115+
- Security fixes for npm dependencies.
103116

104117
## [1.1.0](https://github.com/mikrovvelle/mlxprs/tree/v1.1.0)
105118

106-
- Added per-query client parameter override capability SJS (see README)
119+
- Added per-query client parameter override capability SJS (see README).
107120

108121
## [1.0.0](https://github.com/mikrovvelle/mlxprs/tree/v1.0.0)
109122

110-
- Working release
123+
- Working release.
111124

112125
## [0.7.7](https://github.com/mikrovvelle/mlxprs/tree/v0.7.5)
113126

114-
- Security fixes for npm dependencies
127+
- Security fixes for npm dependencies.
115128

116129
## [0.7.5](https://github.com/mikrovvelle/mlxprs/tree/v0.7.5)
117130

118-
- Cosmetic: branding in preparation for 1.0 release
131+
- Cosmetic: branding in preparation for 1.0 release.
119132

120133
## [0.7.2](https://github.com/mikrovvelle/mlxprs/tree/v0.7.2)
121134

122-
- Security: update `js-yaml` dependency to fix vulnerability
135+
- Security: update `js-yaml` dependency to fix vulnerability.
123136

124137
## [0.7.1](https://github.com/mikrovvelle/mlxprs/tree/v0.7.1)
125138

126139
- Bugfix: Javascript language mode wasn't activating the extension.
127140

128141
## [0.7.0](https://github.com/mikrovvelle/mlxprs/tree/v0.7.0)
129142

130-
- Added SJS autocompletion based on MarkLogic SJS API
143+
- Added SJS autocompletion based on MarkLogic SJS API.
131144

132145
## [0.6.2](https://github.com/mikrovvelle/mlxprs/tree/v0.6.2)
133146

134-
- Successfully built with webpack
147+
- Successfully built with webpack.
135148

136149
## 0.6.0 to 0.6.1 (broken)
137150

138-
- Built with webpack
151+
- Built with webpack.
139152

140153
## [0.5.0](https://github.com/mikrovvelle/mlxprs/tree/0.5.0)
141154

142-
- Added SSL capabilities to MarkLogic client: `ssl` and `pathToCa` settings
143-
- Exposed `authType` to marklogic settings (can pretty much leave set to DIGEST)
155+
- Added SSL capabilities to MarkLogic client: `ssl` and `pathToCa` settings.
156+
- Exposed `authType` to marklogic settings (can pretty much leave set to DIGEST).
144157

145158
## [0.4.0](https://github.com/mikrovvelle/mlxprs/tree/0.4.0)
146159

147-
- Added code completion for MarkLogic XQuery API functions
160+
- Added code completion for MarkLogic XQuery API functions.
148161

149162
## [0.3.3](https://github.com/mikrovvelle/mlxprs/tree/0.3.3)
150163

151-
- Bugfix: properly handle and display text responses to MarkLogic queries
164+
- Bugfix: properly handle and display text responses to MarkLogic queries.
152165

153166
## [0.3.2](https://github.com/mikrovvelle/mlxprs/tree/0.3.2)
154167

155-
- License and copyright
168+
- License and copyright.
156169

157170
## [0.3.1](https://github.com/mikrovvelle/mlxprs/tree/0.3.1)
158171

159-
- Handle and display text responses to MarkLogic queries
172+
- Handle and display text responses to MarkLogic queries.
160173

161174
## [0.3.0](https://github.com/mikrovvelle/mlxprs/tree/0.3.0)
162175

163-
- Show error details as query results
176+
- Show error details as query results.
164177

165178
## [0.2.0](https://github.com/mikrovvelle/mlxprs/tree/0.2.0)
166179

167-
- Give user feedback when empty results are returned from a query
180+
- Give user feedback when empty results are returned from a query.
168181

169182
## [0.1.0](https://github.com/mikrovvelle/mlxprs/tree/0.1.0)
170183

171-
- Added XML formatting
184+
- Added XML formatting.

CONTRIBUTING.md

Lines changed: 86 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,17 @@ cd server
5252
npm install
5353
cd ..
5454
```
55+
5556
A shorthand script that does all of that for you is
5657
```
5758
npm run installAll
5859
```
5960

61+
If you want to ensure a clean build, this command clears all transitory files
62+
```
63+
npm run cleanAll
64+
```
65+
6066
## Using the Extension from the Project (except the debugger)
6167
It is recommended to use VSCode as the editor for this package, as it can self-load a debug instance.
6268

@@ -119,12 +125,40 @@ The project contains three test applications.
119125

120126
### Integration Testing Setup
121127

122-
JavaScript debugger integration testing requires a running MarkLogic server where you have full admin rights. Ideally, you should use a dedicated MarkLogic instance for this purpose. The tests assume the existence of a "mlxprs-test" application server running on port 8055 using the "mlxprs-test-content" and "mlxprs-test-modules" databases. Those values are set in test-app/gradle.properties and the admin password should be set in test-app/gradle-local.properties. Then you can use the following commands to build and configure the databases and application servers.
128+
JavaScript debugger integration testing requires a running MarkLogic server where you have full admin rights. Ideally, you should use a dedicated MarkLogic instance for this purpose. The tests assume the existence of a "mlxprs-test" application server running on port 8055 using the "mlxprs-test-content" and "mlxprs-test-modules" databases. Those values are set in test-app/gradle.properties. Assuming you want the test application deployed locally, then in that gradle.properties file, ensure the "Local config" properties are uncommented and that the "Cloud config" properties are commented out.
129+
```
130+
# Local config
131+
mlRestAuthentication=basic
132+
mlHost=localhost
133+
mlUsername=admin
134+
mlPassword=changeme-in-gradle-local.properties
135+
```
136+
Additionally, the admin password should be set in test-app/gradle-local.properties. Then you can use the following commands to build and configure the databases and application servers.
123137
```
124138
cd test-app
125139
./gradlew mlDeploy
126140
```
127141

142+
Note that in order to facilitate testing the application with a proxy, the app-servers associated with the
143+
test-app are set to use basic authentication. That includes a version of the Manage app-server on port 8059.
144+
145+
Once the app is deployed, ensure the workspace VSCode settings in test-app/.vscode/settings.json are set to
146+
use the non-proxy settings as below, and not the reverse-proxy or cloud settings.
147+
```
148+
// Use these for non-proxy testing
149+
"marklogic.host": "localhost",
150+
"marklogic.ssl": false,
151+
"marklogic.authType": "BASIC",
152+
"marklogic.port": 8055,
153+
"marklogic.restBasePath": "",
154+
"marklogic.managePort": 8059,
155+
"marklogic.manageBasePath": "",
156+
"marklogic.testPort": 8054,
157+
"marklogic.testBasePath": "",
158+
"marklogic.adminPort": 8001,
159+
"marklogic.adminBasePath": "",
160+
```
161+
128162
### Manual Integration Testing
129163
* Use the "Launch Extension (debug)" launch configuration in the "RUN AND DEBUG" window to open a new VS Code session.
130164
* Once the new window is open, use "File -> Open Folder ..." menu to open the "test-app" folder as a separate project.
@@ -166,18 +200,55 @@ Note that the order of priority for setting the property values in the test code
166200

167201

168202
### Testing from the command line
169-
Run these two npm scripts from the command line in the root directory of the project to execute the tests. Note that VSCode must not be running while you run the tests.
203+
Run these three npm scripts from the command line in the root directory of the project to execute the tests. Note that VSCode must not be running while you run the tests.
204+
170205
```
171-
npm run installAll
172206
npm run test
173207
npm run testServer
174-
code --extensionDevelopmentPath=<mlxprs-project-dir>/client --extensionTestsPath=<mlxprs-project-dir>/dist/test/integration/index
208+
npm run testIntegration
175209
```
176-
<mark>The final test (the integration tests), should not be run while VSCode is open.</mark>
177210

178-
To ensure a clean build, you may also run this npm script before running the `installAll` script.
211+
Alternatively all tests may be run via the single command:
179212
```
180-
npm run cleanAll
213+
npm run testAll
214+
```
215+
216+
Additionally, test coverage reports may be generated with this command:
217+
```
218+
npm run coverageAll
219+
```
220+
221+
### Proxy testing
222+
223+
For testing the extension with a proxy server, it is recommended that you use the reverse
224+
proxy server included in the Java Client project for proxy testing. To start that server,
225+
simply run the following command in the root directory of the Java Client project. That
226+
command will start the reverse proxy server in blocking mode listening on port 8020. It
227+
will then forward requests to port 8020 based on the custom mappings.
228+
229+
```
230+
./gradlew runBlockingReverseProxyServer
231+
```
232+
233+
Node Client Test-App Reverse Proxy Mappings
234+
```
235+
"/mlxprs/manage" => port 8059
236+
"/mlxprs/rest" => port 8055
237+
"/mlxprs/test" => port 8054
238+
```
239+
240+
Once the reverse proxy server is running, change the MLXPRS settings for your workspace
241+
to the following (in .vscode/settings.json):
242+
```
243+
"marklogic.authType": "BASIC",
244+
"marklogic.port": 8020,
245+
"marklogic.restBasePath": "/mlxprs/rest",
246+
"marklogic.managePort": 8020,
247+
"marklogic.manageBasePath": "/mlxprs/manage",
248+
"marklogic.adminPort": 8001,
249+
"marklogic.adminBasePath": "",
250+
"marklogic.testPort": 8020,
251+
"marklogic.testBasePath": "/mlxprs/test",
181252
```
182253

183254
## Building the artifact
@@ -227,4 +298,11 @@ Please try to develop, build, and test with the most recent stable releases of t
227298
- MarkLogic 9, 10, or 11
228299

229300
## Publishing the artifact
230-
See [Publishing Extensions](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) for more information
301+
See [Publishing Extensions](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) for more information
302+
303+
## Documentation
304+
User documents designed to be published with GitHub Pages and are maintained in the /docs directory of the
305+
project. You must have Ruby installed. Additionally, there seems to be a bug with runing jekyll with Ruby 3.3.
306+
I have found that I need to run `chruby ruby-3.2.3` before I start the jekyll server. To start the jekyll
307+
server, cd into the /docs directory and run the command `bundle exec jekyll server`. This will start the
308+
server and the user documents will be available at http://127.0.0.1:4000/.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ _Develop, run, and debug code for MarkLogic in the popular VS Code IDE_
1616
* View modules (read-only) in the editor
1717
* Run [marklogic-unit-test module](https://github.com/marklogic-community/marklogic-unit-test)
1818
* Validate TDE templates and test the templates with node extraction
19+
* View high-level information about the currently connected MarkLogic server
1920

2021
_JavaScript debugging requires version 2.0.0+ of the MarkLogic extension and [MarkLogic 10.0-4+](https://developer.marklogic.com/products/marklogic-server/10.0)._
2122

0 commit comments

Comments
 (0)