1
1
#! /usr/bin/env ts-node
2
2
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' ;
7
9
8
- const { promisify } = require ( 'util' ) ;
9
10
const writeFile = promisify ( fs . writeFile ) ;
10
- const { STAGE_OPERATORS } = require ( 'mongodb-ace-autocompleter' ) ;
11
11
const SNIPPETS_DIR = path . join ( __dirname , '..' , 'snippets' ) ;
12
12
13
13
/**
14
- * Transforms `mongodb-ace-autocompleter` snippets
15
- * into the vscode snippets.
14
+ * Transforms stage operator metadata into the vscode snippets.
16
15
*
17
16
* @param {String } prefix - The stage operator.
18
17
* @param {String } description - The stage description.
@@ -31,10 +30,9 @@ const snippetTemplate = (
31
30
const re = new RegExp ( find , 'g' ) ;
32
31
let body = snippet . split ( '\n' ) ;
33
32
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.
38
36
body [ 0 ] = `\\${ prefix } : ${ body [ 0 ] } ` ;
39
37
40
38
// The stage comments are also stored separately
0 commit comments