just-task 1.7.2 → 1.9.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 +53 -1
- package/CHANGELOG.md +23 -2
- package/api-extractor.json +4 -0
- package/etc/just-task.api.md +126 -0
- package/lib/cli.js +3 -0
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +3 -2
- package/lib/enableTypeScript.d.ts +2 -1
- package/lib/enableTypeScript.d.ts.map +1 -1
- package/lib/enableTypeScript.js +3 -3
- package/package.json +12 -9
- package/src/cli.ts +4 -0
- package/src/config.ts +3 -2
- package/src/enableTypeScript.ts +3 -3
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,59 @@
|
|
|
2
2
|
"name": "just-task",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Sat, 02 Mar 2024 02:16:28 GMT",
|
|
6
|
+
"version": "1.9.0",
|
|
7
|
+
"tag": "just-task_v1.9.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"author": "elcraig@microsoft.com",
|
|
12
|
+
"package": "just-task",
|
|
13
|
+
"commit": "f5c5378f4b41dbb07bc5b6889e284277a0bfe5ce",
|
|
14
|
+
"comment": "Add an option --esm to support imports of ESM packages"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Tue, 12 Sep 2023 08:02:05 GMT",
|
|
21
|
+
"version": "1.8.0",
|
|
22
|
+
"tag": "just-task_v1.8.0",
|
|
23
|
+
"comments": {
|
|
24
|
+
"minor": [
|
|
25
|
+
{
|
|
26
|
+
"author": "elcraig@microsoft.com",
|
|
27
|
+
"package": "just-task",
|
|
28
|
+
"commit": "5b4e7073ffd1f06a7383deccee6883aa7e63342c",
|
|
29
|
+
"comment": "Add `@types` referenced by exports as dependencies"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"patch": [
|
|
33
|
+
{
|
|
34
|
+
"author": "email not defined",
|
|
35
|
+
"package": "just-task",
|
|
36
|
+
"commit": "2bc7eaec9203ef96bf1e48823f2f38a3527d24d5",
|
|
37
|
+
"comment": "Update dependency @rushstack/package-deps-hash to v4"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"author": "renovate@whitesourcesoftware.com",
|
|
41
|
+
"package": "just-task",
|
|
42
|
+
"commit": "e849046a3d1e5c1b4c1a81e12c400391a108323e",
|
|
43
|
+
"comment": "Update dependency fs-extra to v11"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"none": [
|
|
47
|
+
{
|
|
48
|
+
"author": "elcraig@microsoft.com",
|
|
49
|
+
"package": "just-task",
|
|
50
|
+
"commit": "06eaab127501104e008ace0c34bd8dfb6d0d2a51",
|
|
51
|
+
"comment": "Unpin dev deps"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"date": "Fri, 10 Mar 2023 08:01:53 GMT",
|
|
6
58
|
"tag": "just-task_v1.7.2",
|
|
7
59
|
"version": "1.7.2",
|
|
8
60
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,33 @@
|
|
|
1
1
|
# Change Log - just-task
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Sat, 02 Mar 2024 02:16:28 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.9.0
|
|
8
|
+
|
|
9
|
+
Sat, 02 Mar 2024 02:16:28 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- Add an option --esm to support imports of ESM packages (elcraig@microsoft.com)
|
|
14
|
+
|
|
15
|
+
## 1.8.0
|
|
16
|
+
|
|
17
|
+
Tue, 12 Sep 2023 08:02:05 GMT
|
|
18
|
+
|
|
19
|
+
### Minor changes
|
|
20
|
+
|
|
21
|
+
- Add `@types` referenced by exports as dependencies (elcraig@microsoft.com)
|
|
22
|
+
|
|
23
|
+
### Patches
|
|
24
|
+
|
|
25
|
+
- Update dependency @rushstack/package-deps-hash to v4 (email not defined)
|
|
26
|
+
- Update dependency fs-extra to v11 (renovate@whitesourcesoftware.com)
|
|
27
|
+
|
|
7
28
|
## 1.7.2
|
|
8
29
|
|
|
9
|
-
Fri, 10 Mar 2023 08:01:
|
|
30
|
+
Fri, 10 Mar 2023 08:01:53 GMT
|
|
10
31
|
|
|
11
32
|
### Patches
|
|
12
33
|
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
## API Report File for "just-task"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
/// <reference types="node" />
|
|
8
|
+
|
|
9
|
+
import { Arguments } from 'yargs-parser';
|
|
10
|
+
import { Duplex } from 'stream';
|
|
11
|
+
import type { FSWatcher } from 'chokidar';
|
|
12
|
+
import { Logger } from 'just-task-logger';
|
|
13
|
+
import type { Stats } from 'fs';
|
|
14
|
+
import { TaskFunction as TaskFunction_2 } from 'undertaker';
|
|
15
|
+
import { TaskFunctionParams } from 'undertaker';
|
|
16
|
+
import Undertaker = require('undertaker');
|
|
17
|
+
import type { WatchOptions } from 'chokidar';
|
|
18
|
+
|
|
19
|
+
// @public
|
|
20
|
+
export function addResolvePath(pathName: string): void;
|
|
21
|
+
|
|
22
|
+
// @public (undocumented)
|
|
23
|
+
export function argv(): Arguments;
|
|
24
|
+
|
|
25
|
+
// @public (undocumented)
|
|
26
|
+
export function chain(subjectTaskName: string): {
|
|
27
|
+
before: (taskName: string) => void;
|
|
28
|
+
after: (taskName: string) => void;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// @public (undocumented)
|
|
32
|
+
export function clearCache(): void;
|
|
33
|
+
|
|
34
|
+
// @public (undocumented)
|
|
35
|
+
export function condition(taskName: string, conditional: () => boolean): TaskFunction_2;
|
|
36
|
+
|
|
37
|
+
// Warning: (ae-forgotten-export) The symbol "OptionConfig" needs to be exported by the entry point index.d.ts
|
|
38
|
+
//
|
|
39
|
+
// @public (undocumented)
|
|
40
|
+
export function option(key: string, options?: OptionConfig): void;
|
|
41
|
+
|
|
42
|
+
// @public (undocumented)
|
|
43
|
+
interface OptionConfig {
|
|
44
|
+
alias?: string | string[];
|
|
45
|
+
array?: boolean;
|
|
46
|
+
boolean?: boolean;
|
|
47
|
+
coerce?: (arg: any) => any;
|
|
48
|
+
count?: boolean;
|
|
49
|
+
default?: any;
|
|
50
|
+
describe?: string;
|
|
51
|
+
narg?: number;
|
|
52
|
+
normalize?: boolean;
|
|
53
|
+
number?: boolean;
|
|
54
|
+
string?: boolean;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// @public (undocumented)
|
|
58
|
+
export function parallel(...tasks: Task[]): Undertaker.TaskFunction;
|
|
59
|
+
|
|
60
|
+
// @public
|
|
61
|
+
export function resetResolvePaths(): void;
|
|
62
|
+
|
|
63
|
+
// Warning: (ae-forgotten-export) The symbol "ResolveOptions" needs to be exported by the entry point index.d.ts
|
|
64
|
+
//
|
|
65
|
+
// @public
|
|
66
|
+
export function resolve(moduleName: string, options?: ResolveOptions): string | null;
|
|
67
|
+
|
|
68
|
+
// @public @deprecated
|
|
69
|
+
export function resolve(moduleName: string, cwd?: string): string | null;
|
|
70
|
+
|
|
71
|
+
// @public
|
|
72
|
+
export function resolveCwd(moduleName: string, options?: ResolveOptions): string | null;
|
|
73
|
+
|
|
74
|
+
// @public @deprecated
|
|
75
|
+
export function resolveCwd(moduleName: string, cwd?: string): string | null;
|
|
76
|
+
|
|
77
|
+
// @public (undocumented)
|
|
78
|
+
interface ResolveOptions {
|
|
79
|
+
cwd?: string;
|
|
80
|
+
extensions?: string[];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// @public (undocumented)
|
|
84
|
+
export function series(...tasks: Task[]): Undertaker.TaskFunction;
|
|
85
|
+
|
|
86
|
+
// @public (undocumented)
|
|
87
|
+
export type Task = string | TaskFunction;
|
|
88
|
+
|
|
89
|
+
// @public (undocumented)
|
|
90
|
+
export function task(firstParam: string | TaskFunction, secondParam?: string | TaskFunction, thirdParam?: TaskFunction): TaskFunction;
|
|
91
|
+
|
|
92
|
+
// @public (undocumented)
|
|
93
|
+
export interface TaskContext {
|
|
94
|
+
// (undocumented)
|
|
95
|
+
argv: Arguments;
|
|
96
|
+
// (undocumented)
|
|
97
|
+
logger: Logger;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// @public (undocumented)
|
|
101
|
+
export interface TaskFunction extends TaskFunctionParams {
|
|
102
|
+
// (undocumented)
|
|
103
|
+
(this: TaskContext, done: (error?: any) => void): void | Duplex | NodeJS.Process | Promise<never> | any;
|
|
104
|
+
// (undocumented)
|
|
105
|
+
cached?: () => void;
|
|
106
|
+
// (undocumented)
|
|
107
|
+
description?: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// @public (undocumented)
|
|
111
|
+
export const undertaker: Undertaker;
|
|
112
|
+
|
|
113
|
+
// Warning: (ae-forgotten-export) The symbol "WatchListener" needs to be exported by the entry point index.d.ts
|
|
114
|
+
//
|
|
115
|
+
// @public (undocumented)
|
|
116
|
+
export function watch(globs: string | string[], optionsOrListener?: WatchListener | WatchOptions | undefined, listener?: WatchListener | undefined): FSWatcher;
|
|
117
|
+
|
|
118
|
+
// @public (undocumented)
|
|
119
|
+
type WatchListener = (path: string, stats?: Stats) => void;
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
export * from "just-task-logger";
|
|
123
|
+
|
|
124
|
+
// (No @packageDocumentation comment for this package)
|
|
125
|
+
|
|
126
|
+
```
|
package/lib/cli.js
CHANGED
|
@@ -36,6 +36,9 @@ option_1.option('config', {
|
|
|
36
36
|
option_1.option('defaultConfig', {
|
|
37
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)',
|
|
38
38
|
});
|
|
39
|
+
option_1.option('esm', {
|
|
40
|
+
describe: 'Configure ts-node to support imports of ESM package (changes TS module/moduleResolution settings to Node16)',
|
|
41
|
+
});
|
|
39
42
|
const registry = undertaker_1.undertaker.registry();
|
|
40
43
|
const configModule = config_1.readConfig();
|
|
41
44
|
// Support named task function as exports of a config module
|
package/lib/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAOA,OAAO,WAAW,GAAG,QAAQ,cAAc,CAAC,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC,SAAS,GAAG,MAAM,GAAG,IAAI,CAS5E;AAED,wBAAgB,UAAU,IAAI;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAA;CAAE,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAOA,OAAO,WAAW,GAAG,QAAQ,cAAc,CAAC,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC,SAAS,GAAG,MAAM,GAAG,IAAI,CAS5E;AAED,wBAAgB,UAAU,IAAI;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAA;CAAE,GAAG,IAAI,CAmCnE"}
|
package/lib/config.js
CHANGED
|
@@ -19,12 +19,13 @@ function resolveConfigFile(args) {
|
|
|
19
19
|
exports.resolveConfigFile = resolveConfigFile;
|
|
20
20
|
function readConfig() {
|
|
21
21
|
// uses a separate instance of yargs to first parse the config (without the --help in the way) so we can parse the configFile first regardless
|
|
22
|
-
const
|
|
22
|
+
const args = option_1.argv();
|
|
23
|
+
const configFile = resolveConfigFile(args);
|
|
23
24
|
if (configFile && fs.existsSync(configFile)) {
|
|
24
25
|
const ext = path.extname(configFile);
|
|
25
26
|
if (ext === '.ts' || ext === '.tsx') {
|
|
26
27
|
// TODO: add option to do typechecking as well
|
|
27
|
-
enableTypeScript_1.enableTypeScript({ transpileOnly: true });
|
|
28
|
+
enableTypeScript_1.enableTypeScript({ transpileOnly: true, esm: args.esm });
|
|
28
29
|
}
|
|
29
30
|
try {
|
|
30
31
|
const configModule = require(configFile);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enableTypeScript.d.ts","sourceRoot":"","sources":["../src/enableTypeScript.ts"],"names":[],"mappings":"AAIA,wBAAgB,gBAAgB,CAAC,EAAE,aAAoB,EAAE
|
|
1
|
+
{"version":3,"file":"enableTypeScript.d.ts","sourceRoot":"","sources":["../src/enableTypeScript.ts"],"names":[],"mappings":"AAIA,wBAAgB,gBAAgB,CAAC,EAAE,aAAoB,EAAE,GAAW,EAAE;;;CAAA,GAAG,IAAI,CA8B5E"}
|
package/lib/enableTypeScript.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.enableTypeScript = void 0;
|
|
|
4
4
|
const resolve_1 = require("./resolve");
|
|
5
5
|
const just_task_logger_1 = require("just-task-logger");
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
7
|
-
function enableTypeScript({ transpileOnly = true }) {
|
|
7
|
+
function enableTypeScript({ transpileOnly = true, esm = false }) {
|
|
8
8
|
const tsNodeModule = resolve_1.resolve('ts-node');
|
|
9
9
|
if (tsNodeModule) {
|
|
10
10
|
const tsNode = require(tsNodeModule);
|
|
@@ -13,11 +13,11 @@ function enableTypeScript({ transpileOnly = true }) {
|
|
|
13
13
|
skipProject: true,
|
|
14
14
|
compilerOptions: {
|
|
15
15
|
target: 'es2017',
|
|
16
|
-
module: 'commonjs',
|
|
16
|
+
module: esm ? 'node16' : 'commonjs',
|
|
17
17
|
strict: false,
|
|
18
18
|
skipLibCheck: true,
|
|
19
19
|
skipDefaultLibCheck: true,
|
|
20
|
-
moduleResolution: 'node',
|
|
20
|
+
moduleResolution: esm ? 'node16' : 'node',
|
|
21
21
|
allowJs: true,
|
|
22
22
|
esModuleInterop: true,
|
|
23
23
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "just-task",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "Build task definition library",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"repository": {
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
"just": "bin/just.js"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
|
+
"api": "api-extractor run",
|
|
19
|
+
"api:update": "api-extractor run --local",
|
|
18
20
|
"build": "tsc",
|
|
19
21
|
"start": "tsc -w --preserveWatchOutput",
|
|
20
22
|
"start-test": "jest --watch",
|
|
@@ -24,22 +26,23 @@
|
|
|
24
26
|
"node": ">=14"
|
|
25
27
|
},
|
|
26
28
|
"dependencies": {
|
|
27
|
-
"@rushstack/package-deps-hash": "^
|
|
29
|
+
"@rushstack/package-deps-hash": "^4.0.0",
|
|
30
|
+
"@types/chokidar": "^2.1.3",
|
|
31
|
+
"@types/undertaker": "^1.2.8",
|
|
32
|
+
"@types/yargs-parser": "^20.2.2",
|
|
28
33
|
"bach": "^2.0.0",
|
|
29
34
|
"chalk": "^4.0.0",
|
|
30
|
-
"
|
|
35
|
+
"chokidar": "^3.5.2",
|
|
36
|
+
"fs-extra": "^11.0.0",
|
|
31
37
|
"just-task-logger": ">=1.2.1 <2.0.0",
|
|
32
38
|
"resolve": "^1.19.0",
|
|
33
39
|
"undertaker": "^1.3.0",
|
|
34
40
|
"undertaker-registry": "^2.0.0",
|
|
35
|
-
"yargs-parser": "^20.2.3"
|
|
36
|
-
"chokidar": "^3.5.2"
|
|
41
|
+
"yargs-parser": "^20.2.3"
|
|
37
42
|
},
|
|
38
43
|
"devDependencies": {
|
|
39
|
-
"@types/
|
|
40
|
-
"@types/
|
|
41
|
-
"@types/undertaker": "1.2.8",
|
|
42
|
-
"@types/undertaker-registry": "1.0.1"
|
|
44
|
+
"@types/resolve": "^1.20.2",
|
|
45
|
+
"@types/undertaker-registry": "^1.0.1"
|
|
43
46
|
},
|
|
44
47
|
"typing": "lib/index.d.ts"
|
|
45
48
|
}
|
package/src/cli.ts
CHANGED
|
@@ -47,6 +47,10 @@ option('defaultConfig', {
|
|
|
47
47
|
describe:
|
|
48
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)',
|
|
49
49
|
});
|
|
50
|
+
option('esm', {
|
|
51
|
+
describe:
|
|
52
|
+
'Configure ts-node to support imports of ESM package (changes TS module/moduleResolution settings to Node16)',
|
|
53
|
+
});
|
|
50
54
|
|
|
51
55
|
const registry = undertaker.registry();
|
|
52
56
|
|
package/src/config.ts
CHANGED
|
@@ -21,13 +21,14 @@ export function resolveConfigFile(args: yargsParser.Arguments): string | null {
|
|
|
21
21
|
|
|
22
22
|
export function readConfig(): { [key: string]: TaskFunction } | void {
|
|
23
23
|
// uses a separate instance of yargs to first parse the config (without the --help in the way) so we can parse the configFile first regardless
|
|
24
|
-
const
|
|
24
|
+
const args = argv();
|
|
25
|
+
const configFile = resolveConfigFile(args);
|
|
25
26
|
|
|
26
27
|
if (configFile && fs.existsSync(configFile)) {
|
|
27
28
|
const ext = path.extname(configFile);
|
|
28
29
|
if (ext === '.ts' || ext === '.tsx') {
|
|
29
30
|
// TODO: add option to do typechecking as well
|
|
30
|
-
enableTypeScript({ transpileOnly: true });
|
|
31
|
+
enableTypeScript({ transpileOnly: true, esm: args.esm });
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
try {
|
package/src/enableTypeScript.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { resolve } from './resolve';
|
|
|
2
2
|
import { logger } from 'just-task-logger';
|
|
3
3
|
|
|
4
4
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
5
|
-
export function enableTypeScript({ transpileOnly = true }): void {
|
|
5
|
+
export function enableTypeScript({ transpileOnly = true, esm = false }): void {
|
|
6
6
|
const tsNodeModule = resolve('ts-node');
|
|
7
7
|
if (tsNodeModule) {
|
|
8
8
|
const tsNode = require(tsNodeModule);
|
|
@@ -11,11 +11,11 @@ export function enableTypeScript({ transpileOnly = true }): void {
|
|
|
11
11
|
skipProject: true,
|
|
12
12
|
compilerOptions: {
|
|
13
13
|
target: 'es2017',
|
|
14
|
-
module: 'commonjs',
|
|
14
|
+
module: esm ? 'node16' : 'commonjs',
|
|
15
15
|
strict: false,
|
|
16
16
|
skipLibCheck: true,
|
|
17
17
|
skipDefaultLibCheck: true,
|
|
18
|
-
moduleResolution: 'node',
|
|
18
|
+
moduleResolution: esm ? 'node16' : 'node',
|
|
19
19
|
allowJs: true,
|
|
20
20
|
esModuleInterop: true,
|
|
21
21
|
},
|