just-task 1.4.2 → 1.6.0

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.json CHANGED
@@ -2,7 +2,164 @@
2
2
  "name": "just-task",
3
3
  "entries": [
4
4
  {
5
- "date": "Fri, 10 Sep 2021 23:58:37 GMT",
5
+ "date": "Sat, 10 Sep 2022 08:02:37 GMT",
6
+ "tag": "just-task_v1.6.0",
7
+ "version": "1.6.0",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "email not defined",
12
+ "package": "just-task",
13
+ "commit": "0760a3c3afe3b93c501fb2cf9f0ffdf6ff995f2d",
14
+ "comment": "Update dependency fs-extra to v10"
15
+ },
16
+ {
17
+ "author": "email not defined",
18
+ "package": "just-task",
19
+ "commit": "c30a5f8ac1ec28b5906cd62201914c85cca3527b",
20
+ "comment": "Update dependency undertaker-registry to v2"
21
+ }
22
+ ],
23
+ "none": [
24
+ {
25
+ "author": "renovate@whitesourcesoftware.com",
26
+ "package": "just-task",
27
+ "commit": "a0b21703c4b4330b1c885261c11486cb786eac0e",
28
+ "comment": "Update devDependency @types/fs-extra to v9"
29
+ }
30
+ ],
31
+ "minor": [
32
+ {
33
+ "author": "elcraig@microsoft.com",
34
+ "package": "just-task",
35
+ "commit": "287b87696860cd0e2ae119e4ee6b270956c7c001",
36
+ "comment": "Fix type of OptionConfig.default"
37
+ }
38
+ ]
39
+ }
40
+ },
41
+ {
42
+ "date": "Sat, 10 Sep 2022 00:19:03 GMT",
43
+ "tag": "just-task_v1.5.1",
44
+ "version": "1.5.1",
45
+ "comments": {
46
+ "patch": [
47
+ {
48
+ "author": "elcraig@microsoft.com",
49
+ "package": "just-task",
50
+ "commit": "9fd466eb0c24ae5f5fed3381acfe229e74cc1bde",
51
+ "comment": "Specify Node 12+ engines requirement"
52
+ },
53
+ {
54
+ "author": "beachball",
55
+ "package": "just-task",
56
+ "comment": "Bump just-task-logger to v1.1.2",
57
+ "commit": "9fd466eb0c24ae5f5fed3381acfe229e74cc1bde"
58
+ }
59
+ ]
60
+ }
61
+ },
62
+ {
63
+ "date": "Fri, 09 Sep 2022 08:02:06 GMT",
64
+ "tag": "just-task_v1.5.0",
65
+ "version": "1.5.0",
66
+ "comments": {
67
+ "none": [
68
+ {
69
+ "author": "email not defined",
70
+ "package": "just-task",
71
+ "commit": "c08c46745a95efabab5dbfc0f216d2e3b94ae03f",
72
+ "comment": "Update devDependency mock-fs to v4.14.0"
73
+ },
74
+ {
75
+ "author": "renovate@whitesourcesoftware.com",
76
+ "package": "just-task",
77
+ "commit": "32b2d44a637fcfca27c0a2c1fbc80d25bb60d7ce",
78
+ "comment": "Update devDependency ts-jest to v26.5.6"
79
+ },
80
+ {
81
+ "author": "elcraig@microsoft.com",
82
+ "package": "just-task",
83
+ "commit": "9e1d1962e81b119d818514b3e8dd03be8d5e051e",
84
+ "comment": "Run prettier on all files"
85
+ }
86
+ ]
87
+ }
88
+ },
89
+ {
90
+ "date": "Fri, 09 Sep 2022 01:49:38 GMT",
91
+ "tag": "just-task_v1.5.0",
92
+ "version": "1.5.0",
93
+ "comments": {
94
+ "none": [
95
+ {
96
+ "author": "email not defined",
97
+ "package": "just-task",
98
+ "commit": "a88704b4f1f046e1440c0944145a8045273904c3",
99
+ "comment": "Update devDependency @types/node to v12"
100
+ },
101
+ {
102
+ "author": "email not defined",
103
+ "package": "just-task",
104
+ "commit": "f080946c01915c3cff7445928b2697729fc2e93d",
105
+ "comment": "Update @types packages"
106
+ }
107
+ ]
108
+ }
109
+ },
110
+ {
111
+ "date": "Fri, 09 Sep 2022 00:10:23 GMT",
112
+ "tag": "just-task_v1.5.0",
113
+ "version": "1.5.0",
114
+ "comments": {
115
+ "none": [
116
+ {
117
+ "author": "email not defined",
118
+ "package": "just-task",
119
+ "comment": "Update devDependency @types/fs-extra to v8.1.2",
120
+ "commit": "ac702fe1b1b115a243f418fea2821729e38eb3ec"
121
+ }
122
+ ]
123
+ }
124
+ },
125
+ {
126
+ "date": "Fri, 09 Sep 2022 00:04:18 GMT",
127
+ "tag": "just-task_v1.5.0",
128
+ "version": "1.5.0",
129
+ "comments": {
130
+ "none": [
131
+ {
132
+ "author": "email not defined",
133
+ "package": "just-task",
134
+ "comment": "Pin devDependencies",
135
+ "commit": "0dca4fef66c833623c3b923f426ee44d6887c5fe"
136
+ },
137
+ {
138
+ "author": "email not defined",
139
+ "package": "just-task",
140
+ "commit": "0dca4fef66c833623c3b923f426ee44d6887c5fe",
141
+ "comment": "Bump just-task to v1.5.0"
142
+ }
143
+ ]
144
+ }
145
+ },
146
+ {
147
+ "date": "Thu, 31 Mar 2022 17:04:30 GMT",
148
+ "tag": "just-task_v1.5.0",
149
+ "version": "1.5.0",
150
+ "comments": {
151
+ "minor": [
152
+ {
153
+ "author": "dzearing@microsoft.com",
154
+ "package": "just-task",
155
+ "comment": "Upgrading package-deps-hash to latest major to remove transitive security vulnerability in validator package.",
156
+ "commit": "0c2e911432d9c09a7b3396d40c811260d84749ac"
157
+ }
158
+ ]
159
+ }
160
+ },
161
+ {
162
+ "date": "Fri, 10 Sep 2021 23:58:46 GMT",
6
163
  "tag": "just-task_v1.4.2",
7
164
  "version": "1.4.2",
8
165
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,42 @@
1
1
  # Change Log - just-task
2
2
 
3
- This log was last generated on Fri, 10 Sep 2021 23:58:37 GMT and should not be manually modified.
3
+ This log was last generated on Sat, 10 Sep 2022 08:02:37 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.6.0
8
+
9
+ Sat, 10 Sep 2022 08:02:37 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - Fix type of OptionConfig.default (elcraig@microsoft.com)
14
+
15
+ ### Patches
16
+
17
+ - Update dependency fs-extra to v10 (email not defined)
18
+ - Update dependency undertaker-registry to v2 (email not defined)
19
+
20
+ ## 1.5.1
21
+
22
+ Sat, 10 Sep 2022 00:19:03 GMT
23
+
24
+ ### Patches
25
+
26
+ - Specify Node 12+ engines requirement (elcraig@microsoft.com)
27
+ - Bump just-task-logger to v1.1.2
28
+
29
+ ## 1.5.0
30
+
31
+ Thu, 31 Mar 2022 17:04:30 GMT
32
+
33
+ ### Minor changes
34
+
35
+ - Upgrading package-deps-hash to latest major to remove transitive security vulnerability in validator package. (dzearing@microsoft.com)
36
+
7
37
  ## 1.4.2
8
38
 
9
- Fri, 10 Sep 2021 23:58:37 GMT
39
+ Fri, 10 Sep 2021 23:58:46 GMT
10
40
 
11
41
  ### Patches
12
42
 
package/README.md CHANGED
@@ -5,9 +5,8 @@
5
5
 
6
6
  `Just` is a library that organizes build tasks for your JS projects. It consists of
7
7
 
8
- - a build task build definition library
8
+ - a build task definition library
9
9
  - sane preset build flows for node and browser projects featuring TypeScript, Webpack and jest
10
- - project scaffold tool that generates no-ejection needed repos that tracks template changes
11
10
 
12
11
  # Documentation
13
12
 
@@ -41,11 +40,9 @@ yarn test
41
40
 
42
41
  | Package | Description |
43
42
  | ------------------ | --------------------------------------------------------------------------------------- |
44
- | create-just | Invoked by `npm init just`, a tool that scaffolds project repos |
45
43
  | just-task | The task definition library that wraps `undertaker` and `yargs` libraries |
46
44
  | just-scripts | A reusable preset of frequently used tasks in node and browser projects |
47
- | just-stack-\* | A set of templates to be used by the scaffold tool `create-just` |
48
- | just-scripts-utils | A set of utilities that are shared between `just-scripts` and `create-just` |
45
+ | just-scripts-utils | A set of utilities for `just-scripts` |
49
46
  | just-task-logger | A shared pretty logger used to display timestamps along with a message |
50
47
  | documentation | The Docusaurus site content and styles which generates the Github page for this library |
51
48
 
package/lib/cache.js CHANGED
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
2
  Object.defineProperty(exports, "__esModule", { value: true });
14
3
  exports.saveCache = exports.isCached = exports.clearCache = exports.registerCachedTask = void 0;
15
4
  const package_deps_hash_1 = require("@rushstack/package-deps-hash");
@@ -107,11 +96,12 @@ function getLockFileHashes() {
107
96
  }
108
97
  function getHash(taskName) {
109
98
  just_task_logger_1.mark('cache:getHash');
110
- const args = __rest(option_1.argv(), []);
99
+ const { ...args } = option_1.argv();
111
100
  const packageRootPath = getPackageRootPath();
112
- const packageDeps = package_deps_hash_1.getPackageDeps(packageRootPath);
113
- const lockFileHashes = getLockFileHashes();
114
- packageDeps.files = Object.assign(Object.assign({}, packageDeps.files), lockFileHashes);
101
+ const packageDeps = {
102
+ ...Object.fromEntries(package_deps_hash_1.getPackageDeps(packageRootPath)),
103
+ ...getLockFileHashes(),
104
+ };
115
105
  const hash = {
116
106
  args,
117
107
  taskName,
@@ -1 +1 @@
1
- {"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../src/chain.ts"],"names":[],"mappings":"AAKA,wBAAgB,KAAK,CAAC,eAAe,EAAE,MAAM;uBAEJ,MAAM;sBAQR,MAAM;EAQ5C"}
1
+ {"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../src/chain.ts"],"names":[],"mappings":"AAOA,wBAAgB,KAAK,CAAC,eAAe,EAAE,MAAM;uBAEJ,MAAM;sBAQR,MAAM;EAQ5C"}
package/lib/chain.js CHANGED
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.chain = void 0;
4
5
  const undertaker_1 = require("./undertaker");
package/lib/cli.js CHANGED
@@ -6,8 +6,9 @@ const just_task_logger_1 = require("just-task-logger");
6
6
  const config_1 = require("./config");
7
7
  const task_1 = require("./task");
8
8
  const originalEmitWarning = process.emitWarning;
9
+ process.emitWarning = function emitWarning(_warning, _type, code,
9
10
  // eslint-disable-next-line @typescript-eslint/ban-types
10
- process.emitWarning = function emitWarning(_warning, _type, code, _ctor) {
11
+ _ctor) {
11
12
  if (code === 'DEP0097') {
12
13
  // Undertaker uses a deprecated approach that causes NodeJS 10 to print
13
14
  // this warning to stderr:
@@ -29,7 +30,9 @@ function showHelp() {
29
30
  }
30
31
  }
31
32
  // Define a built-in option of "config" so users can specify which path to choose for configurations
32
- option_1.option('config', { describe: 'path to a just configuration file (includes the file name, e.g. /path/to/just.config.ts)' });
33
+ option_1.option('config', {
34
+ describe: 'path to a just configuration file (includes the file name, e.g. /path/to/just.config.ts)',
35
+ });
33
36
  option_1.option('defaultConfig', {
34
37
  describe: 'path to a default just configuration file that will be used when the current project does not have a just configuration file. (includes the file name, e.g. /path/to/just.config.ts)',
35
38
  });
package/lib/option.d.ts CHANGED
@@ -13,10 +13,8 @@ export interface OptionConfig {
13
13
  coerce?: (arg: any) => any;
14
14
  /** Indicate a key that should be used as a counter, e.g., `-vvv = {v: 3}`. */
15
15
  count?: boolean;
16
- /** Provide default values for keys: `{ default: { x: 33, y: 'hello world!' } }`. */
17
- default?: {
18
- [key: string]: any;
19
- };
16
+ /** Provide default value: `{ default: 'hello world!' }`. */
17
+ default?: any;
20
18
  /** Specify that a key requires n arguments: `{ narg: {x: 2} }`. */
21
19
  narg?: number;
22
20
  /** `path.normalize()` will be applied to values set to this key. */
@@ -1 +1 @@
1
- {"version":3,"file":"option.d.ts","sourceRoot":"","sources":["../src/option.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,SAAS,EAAE,MAAM,cAAc,CAAC;AAGlD,MAAM,WAAW,YAAY;IAC3B,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE1B,kCAAkC;IAClC,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,wEAAwE;IACxE,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC;IAE3B,8EAA8E;IAC9E,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,oFAAoF;IACpF,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAEjC,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,oEAAoE;IACpE,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,kFAAkF;IAClF,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,yCAAyC;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAMD,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,IAAI,CAuBpE;AAED,wBAAgB,IAAI,IAAI,SAAS,CAEhC;AAED,wBAAgB,YAAY,IAAI,MAAM,GAAG,IAAI,CAQ5C"}
1
+ {"version":3,"file":"option.d.ts","sourceRoot":"","sources":["../src/option.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,SAAS,EAAE,MAAM,cAAc,CAAC;AAGlD,MAAM,WAAW,YAAY;IAC3B,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE1B,kCAAkC;IAClC,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,wEAAwE;IACxE,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC;IAE3B,8EAA8E;IAC9E,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,GAAG,CAAC;IAEd,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,oEAAoE;IACpE,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,kFAAkF;IAClF,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,yCAAyC;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAMD,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,IAAI,CAuBpE;AAED,wBAAgB,IAAI,IAAI,SAAS,CAEhC;AAED,wBAAgB,YAAY,IAAI,MAAM,GAAG,IAAI,CAQ5C"}
package/lib/resolve.js CHANGED
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
2
  Object.defineProperty(exports, "__esModule", { value: true });
14
3
  exports.resolveCwd = exports.resolve = exports._getResolvePaths = exports._tryResolve = exports._isFileNameLike = exports.resetResolvePaths = exports.addResolvePath = void 0;
15
4
  const resolve_1 = require("resolve");
@@ -45,9 +34,9 @@ exports._isFileNameLike = _isFileNameLike;
45
34
  */
46
35
  function _tryResolve(moduleName, options) {
47
36
  try {
48
- const { cwd } = options, rest = __rest(options, ["cwd"]);
37
+ const { cwd, ...rest } = options;
49
38
  const nameToResolve = _isFileNameLike(moduleName) ? `./${moduleName}` : moduleName;
50
- return resolve_1.sync(nameToResolve, Object.assign(Object.assign({ basedir: cwd }, rest), { preserveSymlinks: true }));
39
+ return resolve_1.sync(nameToResolve, { basedir: cwd, ...rest, preserveSymlinks: true });
51
40
  }
52
41
  catch (e) {
53
42
  return null;
@@ -78,7 +67,7 @@ function resolve(moduleName, cwdOrOptions) {
78
67
  const allResolvePaths = _getResolvePaths(options.cwd);
79
68
  let resolved = null;
80
69
  for (const tryPath of allResolvePaths) {
81
- resolved = _tryResolve(moduleName, Object.assign(Object.assign({}, options), { cwd: tryPath }));
70
+ resolved = _tryResolve(moduleName, { ...options, cwd: tryPath });
82
71
  if (resolved) {
83
72
  return resolved;
84
73
  }
package/lib/task.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../src/task.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,wBAAgB,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,YAAY,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,YAAY,EAAE,UAAU,CAAC,EAAE,YAAY,GAAG,YAAY,CA0CpI"}
1
+ {"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../src/task.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,wBAAgB,IAAI,CAClB,UAAU,EAAE,MAAM,GAAG,YAAY,EACjC,WAAW,CAAC,EAAE,MAAM,GAAG,YAAY,EACnC,UAAU,CAAC,EAAE,YAAY,GACxB,YAAY,CA0Cd"}
@@ -1 +1 @@
1
- {"version":3,"file":"undertaker.d.ts","sourceRoot":"","sources":["../src/undertaker.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,UAAU,GAAG,QAAQ,YAAY,CAAC,CAAC;AAE1C,QAAA,MAAM,UAAU,YAAmB,CAAC;AA4GpC,wBAAgB,QAAQ,CAAC,GAAG,KAAK,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC,YAAY,CAUlE;AAED,wBAAgB,MAAM,CAAC,GAAG,KAAK,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC,YAAY,CAUhE;AAID,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"undertaker.d.ts","sourceRoot":"","sources":["../src/undertaker.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,UAAU,GAAG,QAAQ,YAAY,CAAC,CAAC;AAE1C,QAAA,MAAM,UAAU,YAAmB,CAAC;AAgHpC,wBAAgB,QAAQ,CAAC,GAAG,KAAK,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC,YAAY,CAUlE;AAED,wBAAgB,MAAM,CAAC,GAAG,KAAK,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC,YAAY,CAUhE;AAID,OAAO,EAAE,UAAU,EAAE,CAAC"}
package/lib/watch.js CHANGED
@@ -11,9 +11,9 @@ function watch(globs, optionsOrListener, listener) {
11
11
  else {
12
12
  options = optionsOrListener;
13
13
  }
14
- options = Object.assign(Object.assign({}, options), { ignoreInitial: true });
14
+ options = { ...options, ignoreInitial: true };
15
15
  // Wrapping this function teaches the glob-watcher about how to deal with sync taskFunction
16
- const innerListener = listener;
16
+ const innerListener = listener; // eslint-disable-line
17
17
  const watcher = chokidar.watch(globs, options);
18
18
  for (const evt of ['add', 'change', 'unlink']) {
19
19
  watcher.on(evt, innerListener);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "just-task",
3
- "version": "1.4.2",
3
+ "version": "1.6.0",
4
4
  "description": "Build task definition library",
5
5
  "keywords": [],
6
6
  "repository": {
@@ -19,32 +19,35 @@
19
19
  "start-test": "jest --watch",
20
20
  "test": "jest"
21
21
  },
22
+ "engines": {
23
+ "node": ">=12"
24
+ },
22
25
  "dependencies": {
23
- "@rushstack/package-deps-hash": "^2.4.109",
26
+ "@rushstack/package-deps-hash": "^3.2.5",
24
27
  "bach": "^1.2.0",
25
28
  "chalk": "^4.0.0",
26
- "fs-extra": "^8.0.0",
27
- "just-task-logger": ">=1.1.1 <2.0.0",
29
+ "fs-extra": "^10.0.0",
30
+ "just-task-logger": ">=1.1.2 <2.0.0",
28
31
  "resolve": "^1.19.0",
29
32
  "undertaker": "^1.3.0",
30
- "undertaker-registry": "^1.0.1",
33
+ "undertaker-registry": "^2.0.0",
31
34
  "yargs-parser": "^20.2.3",
32
35
  "chokidar": "^3.5.2"
33
36
  },
34
37
  "devDependencies": {
35
- "@types/chokidar": "^2.1.3",
36
- "@types/fs-extra": "^8.0.0",
37
- "@types/jest": "^26.0.20",
38
- "@types/mock-fs": "^4.13.0",
39
- "@types/node": "^10.12.18",
40
- "@types/resolve": "^1.17.1",
41
- "@types/undertaker": "^1.2.6",
42
- "@types/undertaker-registry": "^1.0.1",
43
- "@types/yargs-parser": "^20.2.0",
44
- "jest": "^26.6.3",
45
- "mock-fs": "^4.13.0",
46
- "ts-jest": "^26.4.4",
47
- "typescript": "~4.1.3"
38
+ "@types/chokidar": "2.1.3",
39
+ "@types/fs-extra": "9.0.13",
40
+ "@types/jest": "26.0.24",
41
+ "@types/mock-fs": "4.13.1",
42
+ "@types/node": "12.20.55",
43
+ "@types/resolve": "1.20.2",
44
+ "@types/undertaker": "1.2.8",
45
+ "@types/undertaker-registry": "1.0.1",
46
+ "@types/yargs-parser": "20.2.2",
47
+ "jest": "26.6.3",
48
+ "mock-fs": "4.14.0",
49
+ "ts-jest": "26.5.6",
50
+ "typescript": "4.1.3"
48
51
  },
49
52
  "typing": "lib/index.d.ts"
50
53
  }
@@ -1,5 +1,13 @@
1
1
  import * as path from 'path';
2
- import { _isFileNameLike, _tryResolve, resetResolvePaths, resolveCwd, addResolvePath, resolve, _getResolvePaths } from '../resolve';
2
+ import {
3
+ _isFileNameLike,
4
+ _tryResolve,
5
+ resetResolvePaths,
6
+ resolveCwd,
7
+ addResolvePath,
8
+ resolve,
9
+ _getResolvePaths,
10
+ } from '../resolve';
3
11
  import * as option from '../option';
4
12
  import * as config from '../config';
5
13
  import mockfs = require('mock-fs');
@@ -202,7 +210,7 @@ describe('resolveConfigFile', () => {
202
210
  },
203
211
  'just.config.ts': 'localConfig',
204
212
  });
205
- const resolvedConfig = config.resolveConfigFile({ config: undefined, defaultConfig: undefined } as any)
213
+ const resolvedConfig = config.resolveConfigFile({ config: undefined, defaultConfig: undefined } as any);
206
214
  expect(resolvedConfig).toContain('just.config.ts');
207
215
  });
208
216
 
@@ -214,7 +222,10 @@ describe('resolveConfigFile', () => {
214
222
  },
215
223
  'just.config.ts': 'localConfig',
216
224
  });
217
- const resolvedConfig = config.resolveConfigFile({ config: './config/configArgument.ts', defaultConfig: './config/defaultConfigArgument.ts' } as any)
225
+ const resolvedConfig = config.resolveConfigFile({
226
+ config: './config/configArgument.ts',
227
+ defaultConfig: './config/defaultConfigArgument.ts',
228
+ } as any);
218
229
  expect(resolvedConfig).toContain('configArgument.ts');
219
230
  });
220
231
 
@@ -226,7 +237,10 @@ describe('resolveConfigFile', () => {
226
237
  },
227
238
  'just.config.ts': 'localConfig',
228
239
  });
229
- const resolvedConfig = config.resolveConfigFile({ config: undefined, defaultConfig: './config/defaultConfigArgument.ts' } as any)
240
+ const resolvedConfig = config.resolveConfigFile({
241
+ config: undefined,
242
+ defaultConfig: './config/defaultConfigArgument.ts',
243
+ } as any);
230
244
  expect(resolvedConfig).toContain('just.config.ts');
231
245
  });
232
246
 
@@ -237,8 +251,10 @@ describe('resolveConfigFile', () => {
237
251
  'defaultConfigArgument.ts': 'formDefaultConfig',
238
252
  },
239
253
  });
240
- const resolvedConfig = config.resolveConfigFile({ config: undefined, defaultConfig: './config/defaultConfigArgument.ts' } as any)
254
+ const resolvedConfig = config.resolveConfigFile({
255
+ config: undefined,
256
+ defaultConfig: './config/defaultConfigArgument.ts',
257
+ } as any);
241
258
  expect(resolvedConfig).toContain('defaultConfigArgument.ts');
242
259
  });
243
-
244
260
  });
@@ -7,7 +7,9 @@ import UndertakerRegistry = require('undertaker-registry');
7
7
 
8
8
  describe('task', () => {
9
9
  beforeAll(() => {
10
- jest.spyOn(option, 'argv').mockImplementation(() => ({ config: path.resolve(__dirname, '__mocks__/just-task.js') } as any));
10
+ jest
11
+ .spyOn(option, 'argv')
12
+ .mockImplementation(() => ({ config: path.resolve(__dirname, '__mocks__/just-task.js') } as any));
11
13
  jest.spyOn(logger, 'info').mockImplementation(() => undefined);
12
14
  });
13
15
 
package/src/cache.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { getPackageDeps, IPackageDeps } from '@rushstack/package-deps-hash';
1
+ import { getPackageDeps } from '@rushstack/package-deps-hash';
2
2
  import { argv } from './option';
3
3
  import { resolveCwd } from './resolve';
4
4
  import * as fs from 'fs-extra';
@@ -83,7 +83,7 @@ function getCachePath() {
83
83
  interface CacheHash {
84
84
  args: { [arg: string]: string };
85
85
  taskName: string;
86
- hash: IPackageDeps;
86
+ hash: Record<string, string>;
87
87
  dependentHashTimestamps: { [pkgName: string]: number };
88
88
  }
89
89
 
@@ -127,11 +127,10 @@ function getHash(taskName: string): CacheHash | null {
127
127
 
128
128
  const packageRootPath = getPackageRootPath();
129
129
 
130
- const packageDeps = getPackageDeps(packageRootPath);
131
-
132
- const lockFileHashes = getLockFileHashes();
133
-
134
- packageDeps.files = { ...packageDeps.files, ...lockFileHashes };
130
+ const packageDeps = {
131
+ ...Object.fromEntries(getPackageDeps(packageRootPath)),
132
+ ...getLockFileHashes(),
133
+ };
135
134
 
136
135
  const hash = {
137
136
  args,
package/src/chain.ts CHANGED
@@ -1,3 +1,5 @@
1
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
2
+
1
3
  import { undertaker, series } from './undertaker';
2
4
 
3
5
  let counter = 0;
@@ -9,16 +11,16 @@ export function chain(subjectTaskName: string) {
9
11
  const id = `${taskName}_before_${counter++}?`;
10
12
  const subject = undertaker.task(subjectTaskName);
11
13
 
12
- undertaker.task(id, undertaker.task(taskName));
13
- undertaker.task(taskName, series(subject, id));
14
+ undertaker.task(id, undertaker.task(taskName)!);
15
+ undertaker.task(taskName, series(subject!, id));
14
16
  },
15
17
 
16
18
  after: function runAfter(taskName: string) {
17
19
  const id = `${taskName}_after_${counter++}?`;
18
20
  const subject = undertaker.task(subjectTaskName);
19
21
 
20
- undertaker.task(id, undertaker.task(taskName));
21
- undertaker.task(taskName, series(id, subject));
22
+ undertaker.task(id, undertaker.task(taskName)!);
23
+ undertaker.task(taskName, series(id, subject!));
22
24
  },
23
25
  };
24
26
  }
package/src/cli.ts CHANGED
@@ -7,8 +7,14 @@ import { task } from './task';
7
7
 
8
8
  const originalEmitWarning = process.emitWarning;
9
9
 
10
- // eslint-disable-next-line @typescript-eslint/ban-types
11
- (process.emitWarning as any) = function emitWarning(this: any, _warning: string, _type: string, code: string, _ctor?: Function) {
10
+ (process.emitWarning as any) = function emitWarning(
11
+ this: any,
12
+ _warning: string,
13
+ _type: string,
14
+ code: string,
15
+ // eslint-disable-next-line @typescript-eslint/ban-types
16
+ _ctor?: Function,
17
+ ) {
12
18
  if (code === 'DEP0097') {
13
19
  // Undertaker uses a deprecated approach that causes NodeJS 10 to print
14
20
  // this warning to stderr:
@@ -34,7 +40,9 @@ function showHelp() {
34
40
  }
35
41
 
36
42
  // Define a built-in option of "config" so users can specify which path to choose for configurations
37
- option('config', { describe: 'path to a just configuration file (includes the file name, e.g. /path/to/just.config.ts)' });
43
+ option('config', {
44
+ describe: 'path to a just configuration file (includes the file name, e.g. /path/to/just.config.ts)',
45
+ });
38
46
  option('defaultConfig', {
39
47
  describe:
40
48
  'path to a default just configuration file that will be used when the current project does not have a just configuration file. (includes the file name, e.g. /path/to/just.config.ts)',
package/src/option.ts CHANGED
@@ -20,8 +20,8 @@ export interface OptionConfig {
20
20
  /** Indicate a key that should be used as a counter, e.g., `-vvv = {v: 3}`. */
21
21
  count?: boolean;
22
22
 
23
- /** Provide default values for keys: `{ default: { x: 33, y: 'hello world!' } }`. */
24
- default?: { [key: string]: any };
23
+ /** Provide default value: `{ default: 'hello world!' }`. */
24
+ default?: any;
25
25
 
26
26
  /** Specify that a key requires n arguments: `{ narg: {x: 2} }`. */
27
27
  narg?: number;
package/src/task.ts CHANGED
@@ -3,7 +3,11 @@ import { wrapTask } from './wrapTask';
3
3
  import { TaskFunction } from './interfaces';
4
4
  import { registerCachedTask } from './cache';
5
5
 
6
- export function task(firstParam: string | TaskFunction, secondParam?: string | TaskFunction, thirdParam?: TaskFunction): TaskFunction {
6
+ export function task(
7
+ firstParam: string | TaskFunction,
8
+ secondParam?: string | TaskFunction,
9
+ thirdParam?: TaskFunction,
10
+ ): TaskFunction {
7
11
  const argCount = arguments.length;
8
12
 
9
13
  if (argCount === 1 && typeof firstParam === 'string') {
package/src/undertaker.ts CHANGED
@@ -90,7 +90,11 @@ undertaker.on('error', function (args: any) {
90
90
  } else if (shouldLog(args)) {
91
91
  const duration = args.duration;
92
92
  const durationInSecs = Math.round(((duration[0] * NS_PER_SEC + duration[1]) / NS_PER_SEC) * 100) / 100;
93
- logger.error(`finished '${colorizeTaskName(args.name)}' in ${chalk.yellow(String(durationInSecs) + 's')} with ${chalk.red('errors')}`);
93
+ logger.error(
94
+ `finished '${colorizeTaskName(args.name)}' in ${chalk.yellow(String(durationInSecs) + 's')} with ${chalk.red(
95
+ 'errors',
96
+ )}`,
97
+ );
94
98
  process.exitCode = 1;
95
99
  }
96
100
 
package/src/watch.ts CHANGED
@@ -21,7 +21,7 @@ export function watch(
21
21
  options = { ...options, ignoreInitial: true };
22
22
 
23
23
  // Wrapping this function teaches the glob-watcher about how to deal with sync taskFunction
24
- const innerListener = listener!;
24
+ const innerListener = listener!; // eslint-disable-line
25
25
  const watcher = chokidar.watch(globs, options) as FSWatcher;
26
26
  for (const evt of ['add', 'change', 'unlink']) {
27
27
  watcher.on(evt, innerListener);