Skip to content

Commit 79f2693

Browse files
committed
chore: Remove bluebird
bluebird is a polyfill of Promise API. It's unnecessary since Promise API is already supported in Node.js. A small package p-map is added as replacement of Bluebird.map that isn't a part of Promise API.
1 parent e350377 commit 79f2693

File tree

4 files changed

+59
-43
lines changed

4 files changed

+59
-43
lines changed

package-lock.json

Lines changed: 54 additions & 37 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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@
107107
"test": "node ./out/test/runTest.js"
108108
},
109109
"devDependencies": {
110-
"@types/bluebird": "^3.5.36",
111110
"@types/css": "0.0.33",
112111
"@types/lodash": "^4.14.184",
113112
"@types/mocha": "^10.0.7",
@@ -129,10 +128,10 @@
129128
"webpack-cli": "^5.1.4"
130129
},
131130
"dependencies": {
132-
"bluebird": "^3.7.2",
133131
"css": "^3.0.0",
134132
"htmlparser2": "^9.1.0",
135133
"lodash": "^4.17.21",
134+
"p-map": "^7.0.2",
136135
"request": "^2.88.2",
137136
"request-promise": "^4.2.6",
138137
"source-map-support": "^0.5.21",

src/extension.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as Bluebird from "bluebird";
21
import * as _ from "lodash";
2+
import pMap from "p-map";
33
import "source-map-support/register";
44
import * as VError from "verror";
55
import {
@@ -61,7 +61,7 @@ async function performCache(): Promise<void> {
6161
console.log("Parsing documents and looking for CSS class definitions...");
6262

6363
try {
64-
await Bluebird.map(uris, async (uri) => {
64+
await pMap(uris, async (uri) => {
6565
try {
6666
Array.prototype.push.apply(definitions, await ParseEngineGateway.callParser(uri));
6767
} catch (error) {

src/parse-engines/types/html-parse-engine.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as Bluebird from "bluebird";
21
import * as css from "css";
32
import * as html from "htmlparser2";
3+
import pMap from "p-map";
44
import * as request from "request-promise";
55
import * as vscode from "vscode";
66
import CssClassDefinition from "../../common/css-class-definition";
@@ -50,7 +50,7 @@ class HtmlParseEngine implements IParseEngine {
5050
parser.write(textDocument.getText());
5151
parser.end();
5252

53-
await Bluebird.map(urls, async (url) => {
53+
await pMap(urls, async (url) => {
5454
const content = await request.get(url);
5555
let uri: vscode.Uri | undefined;
5656
try {

0 commit comments

Comments
 (0)