@itwin/build-tools 3.5.0-dev.8 → 3.6.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,67 @@
1
1
  # Change Log - @itwin/build-tools
2
2
 
3
- This log was last generated on Thu, 01 Sep 2022 14:37:22 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 30 Nov 2022 14:28:19 GMT and should not be manually modified.
4
+
5
+ ## 3.4.7
6
+ Wed, 30 Nov 2022 14:28:19 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 3.4.6
11
+ Tue, 22 Nov 2022 14:24:19 GMT
12
+
13
+ _Version update only_
14
+
15
+ ## 3.4.5
16
+ Thu, 17 Nov 2022 21:32:50 GMT
17
+
18
+ _Version update only_
19
+
20
+ ## 3.4.4
21
+ Thu, 10 Nov 2022 19:32:17 GMT
22
+
23
+ _Version update only_
24
+
25
+ ## 3.4.3
26
+ Fri, 28 Oct 2022 13:34:57 GMT
27
+
28
+ ### Updates
29
+
30
+ - Replace use of recursive-readdir package with local implementation
31
+
32
+ ## 3.4.2
33
+ Mon, 24 Oct 2022 13:23:45 GMT
34
+
35
+ _Version update only_
36
+
37
+ ## 3.4.1
38
+ Mon, 17 Oct 2022 20:06:51 GMT
39
+
40
+ _Version update only_
41
+
42
+ ## 3.4.0
43
+ Thu, 13 Oct 2022 20:24:47 GMT
44
+
45
+ ### Updates
46
+
47
+ - Use Rush env variable to find root monorepo path
48
+ - Updated Node types declaration to support latest v16
49
+ - Update mocha-junit-reporter to v2.0.2
50
+
51
+ ## 3.3.5
52
+ Tue, 27 Sep 2022 11:50:59 GMT
53
+
54
+ _Version update only_
55
+
56
+ ## 3.3.4
57
+ Thu, 08 Sep 2022 19:00:04 GMT
58
+
59
+ _Version update only_
60
+
61
+ ## 3.3.3
62
+ Tue, 06 Sep 2022 20:54:19 GMT
63
+
64
+ _Version update only_
4
65
 
5
66
  ## 3.3.2
6
67
  Thu, 01 Sep 2022 14:37:22 GMT
@@ -13,3 +13,27 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
13
13
  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14
14
 
15
15
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16
+
17
+ ## [recursive-readdir](https://github.com/jergason/recursive-readdir)
18
+
19
+ The MIT License (MIT)
20
+
21
+ Copyright (c) \<year> \<copyright holders>
22
+
23
+ Permission is hereby granted, free of charge, to any person obtaining a copy
24
+ of this software and associated documentation files (the "Software"), to deal
25
+ in the Software without restriction, including without limitation the rights
26
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
27
+ copies of the Software, and to permit persons to whom the Software is
28
+ furnished to do so, subject to the following conditions:
29
+
30
+ The above copyright notice and this permission notice shall be included in
31
+ all copies or substantial portions of the Software.
32
+
33
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
38
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
39
+ THE SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/build-tools",
3
- "version": "3.5.0-dev.8",
3
+ "version": "3.6.0-dev.1",
4
4
  "description": "Bentley build tools",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,7 +28,6 @@
28
28
  "glob": "^7.1.2",
29
29
  "mocha": "^10.0.0",
30
30
  "mocha-junit-reporter": "^2.0.2",
31
- "recursive-readdir": "^2.2.2",
32
31
  "rimraf": "^3.0.2",
33
32
  "tree-kill": "^1.2.0",
34
33
  "typedoc": "^0.22.11",
@@ -38,8 +37,8 @@
38
37
  "yargs": "^17.4.0"
39
38
  },
40
39
  "devDependencies": {
41
- "@itwin/eslint-plugin": "3.5.0-dev.8",
42
- "@types/node": "16.11.59",
40
+ "@itwin/eslint-plugin": "3.6.0-dev.1",
41
+ "@types/node": "18.11.5",
43
42
  "eslint": "^7.11.0"
44
43
  },
45
44
  "eslintConfig": {
@@ -8,7 +8,7 @@ const argv = require("yargs").argv;
8
8
  const path = require("path");
9
9
  const paths = require("./config/paths");
10
10
  const fs = require("fs-extra");
11
- const readDirectory = require("recursive-readdir");
11
+ const { readDirectory } = require("./utils/recursiveReaddir");
12
12
 
13
13
  const __PUBLISH_EXTRACT_START__ = "__PUBLISH_EXTRACT_START__";
14
14
  const __PUBLISH_EXTRACT_END__ = "__PUBLISH_EXTRACT_END__";
@@ -0,0 +1,96 @@
1
+ const fs = require("fs");
2
+ const p = require("path");
3
+
4
+ function matchesFile(ignorePath) {
5
+ return function (path, stats) {
6
+ return stats.isFile() && ignorePath === path;
7
+ };
8
+ }
9
+
10
+ function toMatcherFunction(ignoreEntry) {
11
+ if (typeof ignoreEntry == "function") {
12
+ return ignoreEntry;
13
+ } else {
14
+ return matchesFile(ignoreEntry);
15
+ }
16
+ }
17
+
18
+ function readdir(path, ignores, callback) {
19
+ if (typeof ignores == "function") {
20
+ callback = ignores;
21
+ ignores = [];
22
+ }
23
+
24
+ if (!callback) {
25
+ return new Promise(function (resolve, reject) {
26
+ readdir(path, ignores || [], function (err, data) {
27
+ if (err) {
28
+ reject(err);
29
+ } else {
30
+ resolve(data);
31
+ }
32
+ });
33
+ });
34
+ }
35
+
36
+ ignores = ignores.map(toMatcherFunction);
37
+
38
+ let list = [];
39
+
40
+ fs.readdir(path, function (err, files) {
41
+ if (err) {
42
+ return callback(err);
43
+ }
44
+
45
+ let pending = files.length;
46
+ if (!pending) {
47
+ // we are done
48
+ return callback(null, list);
49
+ }
50
+
51
+ files.forEach(function (file) {
52
+ const filePath = p.join(path, file);
53
+ fs.stat(filePath, function (_err, stats) {
54
+ if (_err) {
55
+ return callback(_err);
56
+ }
57
+
58
+ if (
59
+ ignores.some(function (matcher) {
60
+ return matcher(filePath, stats);
61
+ })
62
+ ) {
63
+ pending -= 1;
64
+ if (!pending) {
65
+ return callback(null, list);
66
+ }
67
+ return null;
68
+ }
69
+
70
+ if (stats.isDirectory()) {
71
+ readdir(filePath, ignores, function (__err, res) {
72
+ if (__err) {
73
+ return callback(__err);
74
+ }
75
+
76
+ list = list.concat(res);
77
+ pending -= 1;
78
+ if (!pending) {
79
+ return callback(null, list);
80
+ }
81
+ });
82
+ } else {
83
+ list.push(filePath);
84
+ pending -= 1;
85
+ if (!pending) {
86
+ return callback(null, list);
87
+ }
88
+ }
89
+ });
90
+ });
91
+ });
92
+ }
93
+
94
+ module.exports = {
95
+ readDirectory: readdir
96
+ };