File tree Expand file tree Collapse file tree 10 files changed +53
-22
lines changed
node-runtime-worker-thread Expand file tree Collapse file tree 10 files changed +53
-22
lines changed Original file line number Diff line number Diff line change 4141 "@mongodb-js/eslint-config-mongosh" : " ^1.0.0" ,
4242 "@mongodb-js/prettier-config-devtools" : " ^1.0.1" ,
4343 "@mongodb-js/tsconfig-mongosh" : " ^1.0.0" ,
44- "@mongosh/types" : " 2.3.7 " ,
44+ "@mongosh/types" : " 2.3.8 " ,
4545 "bson" : " ^6.10.1" ,
4646 "depcheck" : " ^1.4.7" ,
4747 "eslint" : " ^7.25.0" ,
Original file line number Diff line number Diff line change @@ -55,6 +55,36 @@ export async function bumpMongoshReleasePackages(): Promise<void> {
5555 JSON . stringify ( packageJson , null , 2 ) + '\n'
5656 ) ;
5757 }
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+ ) ;
5888}
5989
6090/** Bumps auxiliary packages without setting a new version of mongosh. */
Original file line number Diff line number Diff line change 1818 },
1919 "dependencies" : {
2020 "@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 " ,
2424 "mongodb-log-writer" : " ^1.4.2" ,
2525 "mongodb-redact" : " ^1.1.2"
2626 },
Original file line number Diff line number Diff line change 3737 "@mongodb-js/eslint-config-mongosh" : " ^1.0.0" ,
3838 "@mongodb-js/prettier-config-devtools" : " ^1.0.1" ,
3939 "@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 " ,
4545 "bson" : " ^6.10.1" ,
4646 "depcheck" : " ^1.4.7" ,
4747 "eslint" : " ^7.25.0" ,
Original file line number Diff line number Diff line change 4444 },
4545 "dependencies" : {
4646 "@aws-sdk/credential-providers" : " ^3.525.0" ,
47- "@mongosh/errors" : " 2.3.7 " ,
47+ "@mongosh/errors" : " 2.3.8 " ,
4848 "bson" : " ^6.10.1" ,
4949 "mongodb" : " ^6.12.0" ,
5050 "mongodb-build-info" : " ^1.7.2" ,
Original file line number Diff line number Diff line change 5151 "@mongodb-js/eslint-config-mongosh" : " ^1.0.0" ,
5252 "@mongodb-js/prettier-config-devtools" : " ^1.0.1" ,
5353 "@mongodb-js/tsconfig-mongosh" : " ^1.0.0" ,
54- "@mongosh/types" : " 2.3.7 " ,
54+ "@mongosh/types" : " 2.3.8 " ,
5555 "bson" : " ^6.10.1" ,
5656 "depcheck" : " ^1.4.7" ,
5757 "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
3535import { dirname } from 'path' ;
3636import { ShellUserConfig } from '@mongosh/types' ;
3737import i18n from '@mongosh/i18n' ;
38+ import { MONGOSH_VERSION } from './mongosh-version' ;
3839
3940const instanceStateSymbol = Symbol . for ( '@@mongosh.instanceState' ) ;
4041const loadCallNestingLevelSymbol = Symbol . for ( '@@mongosh.loadCallNestingLevel' ) ;
@@ -289,11 +290,7 @@ export default class ShellApi extends ShellApiClass {
289290 }
290291
291292 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 ;
297294 }
298295
299296 @returnsPromise
Original file line number Diff line number Diff line change @@ -116,9 +116,6 @@ export interface EvaluationListener
116116 * options used to access it.
117117 */
118118 getCryptLibraryOptions ?: ( ) => Promise < AutoEncryptionOptions [ 'extraOptions' ] > ;
119-
120- /** References the mongosh version used by the EvaluationListener */
121- version ?: string ;
122119}
123120
124121/**
Original file line number Diff line number Diff line change 3636 },
3737 "dependencies" : {
3838 "@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 " ,
4242 "bson" : " ^6.10.1" ,
4343 "cross-spawn" : " ^7.0.5" ,
4444 "escape-string-regexp" : " ^4.0.0" ,
You can’t perform that action at this time.
0 commit comments