Remove glob-promise and upgrade to glob 9

The `glob` package now uses promises in version 9, so we don't need the
separate `glob-promise` package anymore.

This also updates one call site to use `cwd` instead of `join` to
avoid possible issues due to a breaking change in version 8 which treats
Windows path separators differently. By changing the `cwd`, we should
not run into these issues.

Removing the `resolutions` of `glob-parent` did not change the
`package-lock.json`, so this does not have any effect on the package
version we are using.
This commit is contained in:
Koen Vlaswinkel
2023-03-24 10:45:17 +01:00
parent a7b3e3d31e
commit 1c8eb33a0e
4 changed files with 9 additions and 58 deletions

View File

@@ -21,7 +21,6 @@
"d3": "^7.6.1",
"d3-graphviz": "^5.0.2",
"fs-extra": "^11.1.1",
"glob-promise": "^6.0.2",
"immutable": "^4.0.0",
"js-yaml": "^4.1.0",
"minimist": "~1.2.6",
@@ -72,7 +71,6 @@
"@types/d3-graphviz": "^2.6.6",
"@types/del": "^4.0.0",
"@types/fs-extra": "^11.0.1",
"@types/glob": "^7.1.1",
"@types/google-protobuf": "^3.2.7",
"@types/gulp": "^4.0.9",
"@types/gulp-replace": "^1.1.0",
@@ -13539,7 +13537,8 @@
"node_modules/@types/minimatch": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz",
"integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA=="
"integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==",
"dev": true
},
"node_modules/@types/ms": {
"version": "0.7.31",
@@ -24376,33 +24375,6 @@
"node": ">= 6"
}
},
"node_modules/glob-promise": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/glob-promise/-/glob-promise-6.0.2.tgz",
"integrity": "sha512-Ni2aDyD1ekD6x8/+K4hDriRDbzzfuK4yKpqSymJ4P7IxbtARiOOuU+k40kbHM0sLIlbf1Qh0qdMkAHMZYE6XJQ==",
"dependencies": {
"@types/glob": "^8.0.0"
},
"engines": {
"node": ">=16"
},
"funding": {
"type": "individual",
"url": "https://github.com/sponsors/ahmadnassri"
},
"peerDependencies": {
"glob": "^8.0.3"
}
},
"node_modules/glob-promise/node_modules/@types/glob": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/@types/glob/-/glob-8.1.0.tgz",
"integrity": "sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==",
"dependencies": {
"@types/minimatch": "^5.1.2",
"@types/node": "*"
}
},
"node_modules/glob-stream": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz",
@@ -51841,7 +51813,8 @@
"@types/minimatch": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz",
"integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA=="
"integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==",
"dev": true
},
"@types/ms": {
"version": "0.7.31",
@@ -60202,25 +60175,6 @@
"is-glob": "^4.0.1"
}
},
"glob-promise": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/glob-promise/-/glob-promise-6.0.2.tgz",
"integrity": "sha512-Ni2aDyD1ekD6x8/+K4hDriRDbzzfuK4yKpqSymJ4P7IxbtARiOOuU+k40kbHM0sLIlbf1Qh0qdMkAHMZYE6XJQ==",
"requires": {
"@types/glob": "^8.0.0"
},
"dependencies": {
"@types/glob": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/@types/glob/-/glob-8.1.0.tgz",
"integrity": "sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==",
"requires": {
"@types/minimatch": "^5.1.2",
"@types/node": "*"
}
}
}
},
"glob-stream": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz",

View File

@@ -1442,7 +1442,6 @@
"d3": "^7.6.1",
"d3-graphviz": "^5.0.2",
"fs-extra": "^11.1.1",
"glob-promise": "^6.0.2",
"immutable": "^4.0.0",
"js-yaml": "^4.1.0",
"minimist": "~1.2.6",
@@ -1493,7 +1492,6 @@
"@types/d3-graphviz": "^2.6.6",
"@types/del": "^4.0.0",
"@types/fs-extra": "^11.0.1",
"@types/glob": "^7.1.1",
"@types/google-protobuf": "^3.2.7",
"@types/gulp": "^4.0.9",
"@types/gulp-replace": "^1.1.0",
@@ -1573,8 +1571,5 @@
"prettier --write",
"eslint --fix"
]
},
"resolutions": {
"glob-parent": "6.0.0"
}
}

View File

@@ -6,7 +6,7 @@ import {
writeFile,
opendir,
} from "fs-extra";
import { promise as glob } from "glob-promise";
import { glob } from "glob";
import { load } from "js-yaml";
import { join, basename } from "path";
import { dirSync } from "tmp-promise";
@@ -515,7 +515,9 @@ export async function getQlPackForDbscheme(
export async function getPrimaryDbscheme(
datasetFolder: string,
): Promise<string> {
const dbschemes = await glob(join(datasetFolder, "*.dbscheme"));
const dbschemes = await glob("*.dbscheme", {
cwd: datasetFolder,
});
if (dbschemes.length < 1) {
throw new Error(

View File

@@ -1,5 +1,5 @@
import { pathExists, stat, remove } from "fs-extra";
import { promise as glob } from "glob-promise";
import { glob } from "glob";
import { join, basename, resolve, relative, dirname, extname } from "path";
import * as vscode from "vscode";
import * as cli from "./cli";