just-task 1.5.0 → 1.5.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.json CHANGED
@@ -2,7 +2,112 @@
2
2
  "name": "just-task",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 31 Mar 2022 17:04:25 GMT",
5
+ "date": "Sat, 10 Sep 2022 00:18:54 GMT",
6
+ "tag": "just-task_v1.5.1",
7
+ "version": "1.5.1",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "elcraig@microsoft.com",
12
+ "package": "just-task",
13
+ "commit": "9fd466eb0c24ae5f5fed3381acfe229e74cc1bde",
14
+ "comment": "Specify Node 12+ engines requirement"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "just-task",
19
+ "comment": "Bump just-task-logger to v1.1.2",
20
+ "commit": "9fd466eb0c24ae5f5fed3381acfe229e74cc1bde"
21
+ }
22
+ ]
23
+ }
24
+ },
25
+ {
26
+ "date": "Fri, 09 Sep 2022 08:02:06 GMT",
27
+ "tag": "just-task_v1.5.0",
28
+ "version": "1.5.0",
29
+ "comments": {
30
+ "none": [
31
+ {
32
+ "author": "email not defined",
33
+ "package": "just-task",
34
+ "commit": "c08c46745a95efabab5dbfc0f216d2e3b94ae03f",
35
+ "comment": "Update devDependency mock-fs to v4.14.0"
36
+ },
37
+ {
38
+ "author": "renovate@whitesourcesoftware.com",
39
+ "package": "just-task",
40
+ "commit": "32b2d44a637fcfca27c0a2c1fbc80d25bb60d7ce",
41
+ "comment": "Update devDependency ts-jest to v26.5.6"
42
+ },
43
+ {
44
+ "author": "elcraig@microsoft.com",
45
+ "package": "just-task",
46
+ "commit": "9e1d1962e81b119d818514b3e8dd03be8d5e051e",
47
+ "comment": "Run prettier on all files"
48
+ }
49
+ ]
50
+ }
51
+ },
52
+ {
53
+ "date": "Fri, 09 Sep 2022 01:49:38 GMT",
54
+ "tag": "just-task_v1.5.0",
55
+ "version": "1.5.0",
56
+ "comments": {
57
+ "none": [
58
+ {
59
+ "author": "email not defined",
60
+ "package": "just-task",
61
+ "commit": "a88704b4f1f046e1440c0944145a8045273904c3",
62
+ "comment": "Update devDependency @types/node to v12"
63
+ },
64
+ {
65
+ "author": "email not defined",
66
+ "package": "just-task",
67
+ "commit": "f080946c01915c3cff7445928b2697729fc2e93d",
68
+ "comment": "Update @types packages"
69
+ }
70
+ ]
71
+ }
72
+ },
73
+ {
74
+ "date": "Fri, 09 Sep 2022 00:10:23 GMT",
75
+ "tag": "just-task_v1.5.0",
76
+ "version": "1.5.0",
77
+ "comments": {
78
+ "none": [
79
+ {
80
+ "author": "email not defined",
81
+ "package": "just-task",
82
+ "comment": "Update devDependency @types/fs-extra to v8.1.2",
83
+ "commit": "ac702fe1b1b115a243f418fea2821729e38eb3ec"
84
+ }
85
+ ]
86
+ }
87
+ },
88
+ {
89
+ "date": "Fri, 09 Sep 2022 00:04:18 GMT",
90
+ "tag": "just-task_v1.5.0",
91
+ "version": "1.5.0",
92
+ "comments": {
93
+ "none": [
94
+ {
95
+ "author": "email not defined",
96
+ "package": "just-task",
97
+ "comment": "Pin devDependencies",
98
+ "commit": "0dca4fef66c833623c3b923f426ee44d6887c5fe"
99
+ },
100
+ {
101
+ "author": "email not defined",
102
+ "package": "just-task",
103
+ "commit": "0dca4fef66c833623c3b923f426ee44d6887c5fe",
104
+ "comment": "Bump just-task to v1.5.0"
105
+ }
106
+ ]
107
+ }
108
+ },
109
+ {
110
+ "date": "Thu, 31 Mar 2022 17:04:30 GMT",
6
111
  "tag": "just-task_v1.5.0",
7
112
  "version": "1.5.0",
8
113
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,21 @@
1
1
  # Change Log - just-task
2
2
 
3
- This log was last generated on Thu, 31 Mar 2022 17:04:25 GMT and should not be manually modified.
3
+ This log was last generated on Sat, 10 Sep 2022 00:18:54 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.5.1
8
+
9
+ Sat, 10 Sep 2022 00:18:54 GMT
10
+
11
+ ### Patches
12
+
13
+ - Specify Node 12+ engines requirement (elcraig@microsoft.com)
14
+ - Bump just-task-logger to v1.1.2
15
+
7
16
  ## 1.5.0
8
17
 
9
- Thu, 31 Mar 2022 17:04:25 GMT
18
+ Thu, 31 Mar 2022 17:04:30 GMT
10
19
 
11
20
  ### Minor changes
12
21
 
package/lib/cache.js CHANGED
@@ -100,7 +100,7 @@ function getHash(taskName) {
100
100
  const packageRootPath = getPackageRootPath();
101
101
  const packageDeps = {
102
102
  ...Object.fromEntries(package_deps_hash_1.getPackageDeps(packageRootPath)),
103
- ...getLockFileHashes()
103
+ ...getLockFileHashes(),
104
104
  };
105
105
  const hash = {
106
106
  args,
@@ -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/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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "just-task",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Build task definition library",
5
5
  "keywords": [],
6
6
  "repository": {
@@ -19,12 +19,15 @@
19
19
  "start-test": "jest --watch",
20
20
  "test": "jest"
21
21
  },
22
+ "engines": {
23
+ "node": ">=12"
24
+ },
22
25
  "dependencies": {
23
26
  "@rushstack/package-deps-hash": "^3.2.5",
24
27
  "bach": "^1.2.0",
25
28
  "chalk": "^4.0.0",
26
29
  "fs-extra": "^8.0.0",
27
- "just-task-logger": ">=1.1.1 <2.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
33
  "undertaker-registry": "^1.0.1",
@@ -32,19 +35,19 @@
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": "8.1.2",
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
@@ -129,7 +129,7 @@ function getHash(taskName: string): CacheHash | null {
129
129
 
130
130
  const packageDeps = {
131
131
  ...Object.fromEntries(getPackageDeps(packageRootPath)),
132
- ...getLockFileHashes()
132
+ ...getLockFileHashes(),
133
133
  };
134
134
 
135
135
  const hash = {
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/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