Skip to content

Commit f8e8362

Browse files
authored
[engsys] upgrade dependency glob version to ^9.0.0 (Azure#25170)
- react to api changes - `@types/glob` is no longer needed - remove unused dependencies for widget-tools
1 parent 66ea1d8 commit f8e8362

File tree

7 files changed

+50
-36
lines changed

7 files changed

+50
-36
lines changed

common/config/rush/pnpm-lock.yaml

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

common/tools/eslint-plugin-azure-sdk/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,13 @@
7272
"@types/eslint": "~8.4.0",
7373
"@types/estree": "~1.0.0",
7474
"eslint-config-prettier": "^8.0.0",
75-
"glob": "^8.0.0",
75+
"glob": "^9.0.0",
7676
"json-schema": "^0.4.0",
7777
"typescript": "~4.8.0",
7878
"tslib": "^2.2.0"
7979
},
8080
"devDependencies": {
8181
"@types/chai": "^4.1.6",
82-
"@types/glob": "^8.0.0",
8382
"@types/json-schema": "^7.0.6",
8483
"@types/mocha": "^7.0.2",
8584
"@types/node": "^14.0.0",

common/tools/eslint-plugin-azure-sdk/src/rules/ts-doc-internal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { Node } from "estree";
1212
import { ParserWeakMapESTreeToTSNode } from "@typescript-eslint/typescript-estree/dist/parser-options";
1313
import { Rule } from "eslint";
1414
import { TypeChecker } from "typescript";
15-
import { sync as globSync } from "glob";
15+
import { globSync } from "glob";
1616
import { readFileSync } from "fs";
1717
import { relative } from "path";
1818

sdk/apimanagement/api-management-custom-widgets-scaffolder/bin/execute.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
1717
var inquirer__default = /*#__PURE__*/_interopDefaultLegacy(inquirer);
1818
var Parser__default = /*#__PURE__*/_interopDefaultLegacy(Parser);
1919
var chalk__default = /*#__PURE__*/_interopDefaultLegacy(chalk);
20-
var glob__default = /*#__PURE__*/_interopDefaultLegacy(glob);
2120
var mustache__default = /*#__PURE__*/_interopDefaultLegacy(mustache);
2221

2322
// Copyright (c) Microsoft Corporation.
@@ -835,14 +834,11 @@ async function getTemplates(template) {
835834
return [...sharedFiles, ...templateFiles];
836835
}
837836
async function getFiles(path) {
838-
return new Promise((resolve, reject) => {
839-
glob__default["default"](path, { dot: true }, (error, matches) => {
840-
if (error) {
841-
reject(error);
842-
}
843-
resolve(matches);
844-
});
845-
});
837+
// Starting from glob v8 `\` is only used as an escape character, and never as a path separator in glob patterns.
838+
// Glob pattern paths must use forward-slashes as path separators.
839+
// See https://github.com/isaacs/node-glob/blob/af57da21c7722bb6edb687ccd4ad3b99d3e7a333/changelog.md#80
840+
const normalizedPath = path.replace(/\\/g, "/");
841+
return glob.glob(normalizedPath, { dot: true });
846842
}
847843

848844
// Copyright (c) Microsoft Corporation.

sdk/apimanagement/api-management-custom-widgets-scaffolder/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
"@types/chai": "^4.1.6",
6868
"@types/mocha": "^7.0.2",
6969
"@types/node": "^14.0.0",
70-
"@types/glob": "^8.0.0",
7170
"@types/inquirer": "^8.2.1",
7271
"@types/yargs": "^17.0.10",
7372
"@types/yargs-parser": "^21.0.0",
@@ -92,7 +91,7 @@
9291
"dependencies": {
9392
"mustache": "^4.2.0",
9493
"prettier": "^2.5.1",
95-
"glob": "^8.0.0",
94+
"glob": "^9.0.0",
9695
"tslib": "^2.2.0",
9796
"typescript": "~4.8.0",
9897
"chalk": "^4.1.2",

sdk/apimanagement/api-management-custom-widgets-scaffolder/src/getTemplates.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the MIT license.
33

44
import { ScaffoldTech } from "./scaffolding";
5-
import glob from "glob";
5+
import { glob } from "glob";
66
import { join as pathJoin } from "path";
77

88
export async function getTemplates(template: ScaffoldTech): Promise<string[]> {
@@ -20,12 +20,5 @@ async function getFiles(path: string): Promise<string[]> {
2020
// Glob pattern paths must use forward-slashes as path separators.
2121
// See https://github.com/isaacs/node-glob/blob/af57da21c7722bb6edb687ccd4ad3b99d3e7a333/changelog.md#80
2222
const normalizedPath = path.replace(/\\/g, "/");
23-
return new Promise((resolve, reject) => {
24-
glob(normalizedPath, { dot: true }, (error, matches) => {
25-
if (error) {
26-
reject(error);
27-
}
28-
resolve(matches);
29-
});
30-
});
23+
return glob(normalizedPath, { dot: true });
3124
}

sdk/apimanagement/api-management-custom-widgets-tools/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
"@types/mocha": "^7.0.2",
6565
"@types/mime": "^3.0.1",
6666
"@types/node": "^14.0.0",
67-
"@types/glob": "^8.0.0",
6867
"@types/yargs": "^17.0.10",
6968
"@types/yargs-parser": "^21.0.0",
7069
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
@@ -101,7 +100,6 @@
101100
"mime": "^3.0.0",
102101
"mustache": "^4.2.0",
103102
"prettier": "^2.5.1",
104-
"glob": "^8.0.0",
105103
"tslib": "^2.2.0",
106104
"rollup": "^2.66.1",
107105
"@rollup/plugin-node-resolve": "^13.1.3"

0 commit comments

Comments
 (0)