File tree Expand file tree Collapse file tree 11 files changed +53
-23
lines changed
node-runtime-worker-thread Expand file tree Collapse file tree 11 files changed +53
-23
lines changed Original file line number Diff line number Diff line change 41
41
"@mongodb-js/eslint-config-mongosh" : " ^1.0.0" ,
42
42
"@mongodb-js/prettier-config-devtools" : " ^1.0.1" ,
43
43
"@mongodb-js/tsconfig-mongosh" : " ^1.0.0" ,
44
- "@mongosh/types" : " 2.3.7 " ,
44
+ "@mongosh/types" : " 2.3.8 " ,
45
45
"bson" : " ^6.10.1" ,
46
46
"depcheck" : " ^1.4.7" ,
47
47
"eslint" : " ^7.25.0" ,
Original file line number Diff line number Diff line change @@ -55,6 +55,36 @@ export async function bumpMongoshReleasePackages(): Promise<void> {
55
55
JSON . stringify ( packageJson , null , 2 ) + '\n'
56
56
) ;
57
57
}
58
+
59
+ await bumpShellApiMongoshVersion ( version ) ;
60
+ }
61
+
62
+ /** Sets the shell-api constant to match the mongosh version. */
63
+ export async function bumpShellApiMongoshVersion ( version : string ) {
64
+ const shellApiVersionFilePath = path . join (
65
+ __dirname ,
66
+ PROJECT_ROOT ,
67
+ 'packages' ,
68
+ 'shell-api' ,
69
+ 'src' ,
70
+ 'mongosh-version.ts'
71
+ ) ;
72
+
73
+ const versionFileContent = await fs . readFile (
74
+ shellApiVersionFilePath ,
75
+ 'utf-8'
76
+ ) ;
77
+
78
+ // Write the updated content back to the mongosh-version file
79
+ await fs . writeFile (
80
+ shellApiVersionFilePath ,
81
+ // Replace the version inside MONGOSH_VERSION = '...'
82
+ versionFileContent . replace (
83
+ / M O N G O S H _ V E R S I O N = ' .* ' / ,
84
+ `MONGOSH_VERSION = '${ version } '`
85
+ ) ,
86
+ 'utf-8'
87
+ ) ;
58
88
}
59
89
60
90
/** Bumps auxiliary packages without setting a new version of mongosh. */
Original file line number Diff line number Diff line change 18
18
},
19
19
"dependencies" : {
20
20
"@mongodb-js/devtools-connect" : " ^3.3.4" ,
21
- "@mongosh/errors" : " 2.3.7 " ,
22
- "@mongosh/history" : " 2.3.7 " ,
23
- "@mongosh/types" : " 2.3.7 " ,
21
+ "@mongosh/errors" : " 2.3.8 " ,
22
+ "@mongosh/history" : " 2.3.8 " ,
23
+ "@mongosh/types" : " 2.3.8 " ,
24
24
"mongodb-log-writer" : " ^1.4.2" ,
25
25
"mongodb-redact" : " ^1.1.2"
26
26
},
Original file line number Diff line number Diff line change 37
37
"@mongodb-js/eslint-config-mongosh" : " ^1.0.0" ,
38
38
"@mongodb-js/prettier-config-devtools" : " ^1.0.1" ,
39
39
"@mongodb-js/tsconfig-mongosh" : " ^1.0.0" ,
40
- "@mongosh/browser-runtime-core" : " 2.3.7 " ,
41
- "@mongosh/browser-runtime-electron" : " 2.3.7 " ,
42
- "@mongosh/service-provider-core" : " 2.3.7 " ,
43
- "@mongosh/service-provider-node-driver" : " 2.3.7 " ,
44
- "@mongosh/types" : " 2.3.7 " ,
40
+ "@mongosh/browser-runtime-core" : " 2.3.8 " ,
41
+ "@mongosh/browser-runtime-electron" : " 2.3.8 " ,
42
+ "@mongosh/service-provider-core" : " 2.3.8 " ,
43
+ "@mongosh/service-provider-node-driver" : " 2.3.8 " ,
44
+ "@mongosh/types" : " 2.3.8 " ,
45
45
"bson" : " ^6.10.1" ,
46
46
"depcheck" : " ^1.4.7" ,
47
47
"eslint" : " ^7.25.0" ,
Original file line number Diff line number Diff line change @@ -59,7 +59,6 @@ export class WorkerThreadEvaluationListener {
59
59
( Promise . resolve ( ) as Promise < never > )
60
60
) ;
61
61
} ,
62
- version : workerRuntime . evaluationListener ?. version ,
63
62
} ,
64
63
worker
65
64
) ;
Original file line number Diff line number Diff line change 44
44
},
45
45
"dependencies" : {
46
46
"@aws-sdk/credential-providers" : " ^3.525.0" ,
47
- "@mongosh/errors" : " 2.3.7 " ,
47
+ "@mongosh/errors" : " 2.3.8 " ,
48
48
"bson" : " ^6.10.1" ,
49
49
"mongodb" : " ^6.12.0" ,
50
50
"mongodb-build-info" : " ^1.7.2" ,
Original file line number Diff line number Diff line change 51
51
"@mongodb-js/eslint-config-mongosh" : " ^1.0.0" ,
52
52
"@mongodb-js/prettier-config-devtools" : " ^1.0.1" ,
53
53
"@mongodb-js/tsconfig-mongosh" : " ^1.0.0" ,
54
- "@mongosh/types" : " 2.3.7 " ,
54
+ "@mongosh/types" : " 2.3.8 " ,
55
55
"bson" : " ^6.10.1" ,
56
56
"depcheck" : " ^1.4.7" ,
57
57
"eslint" : " ^7.25.0" ,
Original file line number Diff line number Diff line change
1
+ /**
2
+ * NOTE: Do not manually modify this file.
3
+ * The MONGOSH_VERSION gets re-generated automatically with scripts/set-mongosh-version.ts
4
+ **/
5
+
6
+ /** Current mongosh cli-repl version. */
7
+ export const MONGOSH_VERSION = '2.3.8' ;
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ import type { ClientSideFieldLevelEncryptionOptions } from './field-level-encryp
35
35
import { dirname } from 'path' ;
36
36
import { ShellUserConfig } from '@mongosh/types' ;
37
37
import i18n from '@mongosh/i18n' ;
38
+ import { MONGOSH_VERSION } from './mongosh-version' ;
38
39
39
40
const instanceStateSymbol = Symbol . for ( '@@mongosh.instanceState' ) ;
40
41
const loadCallNestingLevelSymbol = Symbol . for ( '@@mongosh.loadCallNestingLevel' ) ;
@@ -289,11 +290,7 @@ export default class ShellApi extends ShellApiClass {
289
290
}
290
291
291
292
version ( ) : string {
292
- const version = this . _instanceState . evaluationListener . version ;
293
- if ( ! version ) {
294
- throw new MongoshInternalError ( 'mongosh version not known' ) ;
295
- }
296
- return version ;
293
+ return MONGOSH_VERSION ;
297
294
}
298
295
299
296
@returnsPromise
Original file line number Diff line number Diff line change @@ -116,9 +116,6 @@ export interface EvaluationListener
116
116
* options used to access it.
117
117
*/
118
118
getCryptLibraryOptions ?: ( ) => Promise < AutoEncryptionOptions [ 'extraOptions' ] > ;
119
-
120
- /** References the mongosh version used by the EvaluationListener */
121
- version ?: string ;
122
119
}
123
120
124
121
/**
Original file line number Diff line number Diff line change 36
36
},
37
37
"dependencies" : {
38
38
"@mongodb-js/devtools-proxy-support" : " ^0.4.2" ,
39
- "@mongosh/errors" : " 2.3.7 " ,
40
- "@mongosh/shell-api" : " 2.3.7 " ,
41
- "@mongosh/types" : " 2.3.7 " ,
39
+ "@mongosh/errors" : " 2.3.8 " ,
40
+ "@mongosh/shell-api" : " 2.3.8 " ,
41
+ "@mongosh/types" : " 2.3.8 " ,
42
42
"bson" : " ^6.10.1" ,
43
43
"cross-spawn" : " ^7.0.5" ,
44
44
"escape-string-regexp" : " ^4.0.0" ,
You can’t perform that action at this time.
0 commit comments