Skip to content

Commit eec91cd

Browse files
authored
chore: replace ace-autocomlpeter with mongodb-constants (#442)
1 parent 97972ed commit eec91cd

File tree

3 files changed

+22
-32
lines changed

3 files changed

+22
-32
lines changed

package-lock.json

Lines changed: 11 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,7 @@
927927
"@leafygreen-ui/logo": "^6.1.3",
928928
"@leafygreen-ui/palette": "^3.4.2",
929929
"@leafygreen-ui/toggle": "^7.0.5",
930+
"@mongodb-js/mongodb-constants": "^0.1.1",
930931
"@mongosh/browser-runtime-electron": "^1.6.0",
931932
"@mongosh/i18n": "^1.6.0",
932933
"@mongosh/service-provider-server": "^1.6.0",
@@ -1007,7 +1008,6 @@
10071008
"mocha": "^8.4.0",
10081009
"mocha-junit-reporter": "^2.0.2",
10091010
"mocha-multi": "^1.1.6",
1010-
"mongodb-ace-autocompleter": "^1.1.1",
10111011
"mongodb-build-info": "^1.4.0",
10121012
"mongodb-client-encryption": "^2.2.1",
10131013
"mongodb-runner": "^4.9.0",

scripts/update-snippets.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
#! /usr/bin/env ts-node
22

3-
import path = require('path');
4-
import mkdirp = require('mkdirp');
5-
import ora = require('ora');
6-
import fs = require('fs');
3+
import path from 'path';
4+
import mkdirp from 'mkdirp';
5+
import ora from 'ora';
6+
import fs from 'fs';
7+
import { promisify } from 'util';
8+
import { STAGE_OPERATORS } from '@mongodb-js/mongodb-constants';
79

8-
const { promisify } = require('util');
910
const writeFile = promisify(fs.writeFile);
10-
const { STAGE_OPERATORS } = require('mongodb-ace-autocompleter');
1111
const SNIPPETS_DIR = path.join(__dirname, '..', 'snippets');
1212

1313
/**
14-
* Transforms `mongodb-ace-autocompleter` snippets
15-
* into the vscode snippets.
14+
* Transforms stage operator metadata into the vscode snippets.
1615
*
1716
* @param {String} prefix - The stage operator.
1817
* @param {String} description - The stage description.
@@ -31,10 +30,9 @@ const snippetTemplate = (
3130
const re = new RegExp(find, 'g');
3231
let body = snippet.split('\n');
3332

34-
// The `mongodb-ace-autocompleter` stores the stage prefix separately
35-
// from the stage body. In vscode extension we want to autopopulate
36-
// the body together with the prefix.
37-
// We also need to escape the `$` symbol in prefix.
33+
// Stage operators store stage name separate from the stage body. In vscode
34+
// extension we want to autopopulate the body together with the prefix. We
35+
// also need to escape the `$` symbol in prefix.
3836
body[0] = `\\${prefix}: ${body[0]}`;
3937

4038
// The stage comments are also stored separately

0 commit comments

Comments
 (0)