just-task 1.4.2 → 1.5.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,22 @@
2
2
  "name": "just-task",
3
3
  "entries": [
4
4
  {
5
- "date": "Fri, 10 Sep 2021 23:58:37 GMT",
5
+ "date": "Thu, 31 Mar 2022 17:04:25 GMT",
6
+ "tag": "just-task_v1.5.0",
7
+ "version": "1.5.0",
8
+ "comments": {
9
+ "minor": [
10
+ {
11
+ "author": "dzearing@microsoft.com",
12
+ "package": "just-task",
13
+ "comment": "Upgrading package-deps-hash to latest major to remove transitive security vulnerability in validator package.",
14
+ "commit": "0c2e911432d9c09a7b3396d40c811260d84749ac"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Fri, 10 Sep 2021 23:58:46 GMT",
6
21
  "tag": "just-task_v1.4.2",
7
22
  "version": "1.4.2",
8
23
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,20 @@
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 Thu, 31 Mar 2022 17:04:25 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.5.0
8
+
9
+ Thu, 31 Mar 2022 17:04:25 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - Upgrading package-deps-hash to latest major to remove transitive security vulnerability in validator package. (dzearing@microsoft.com)
14
+
7
15
  ## 1.4.2
8
16
 
9
- Fri, 10 Sep 2021 23:58:37 GMT
17
+ Fri, 10 Sep 2021 23:58:46 GMT
10
18
 
11
19
  ### Patches
12
20
 
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,
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/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.5.0",
4
4
  "description": "Build task definition library",
5
5
  "keywords": [],
6
6
  "repository": {
@@ -20,7 +20,7 @@
20
20
  "test": "jest"
21
21
  },
22
22
  "dependencies": {
23
- "@rushstack/package-deps-hash": "^2.4.109",
23
+ "@rushstack/package-deps-hash": "^3.2.5",
24
24
  "bach": "^1.2.0",
25
25
  "chalk": "^4.0.0",
26
26
  "fs-extra": "^8.0.0",
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/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);