concurrently 9.1.0 → 9.1.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.
|
@@ -2,8 +2,8 @@ import { CommandInfo } from '../command';
|
|
|
2
2
|
import { CommandParser } from './command-parser';
|
|
3
3
|
/**
|
|
4
4
|
* Finds wildcards in 'npm/yarn/pnpm/bun run', 'node --run' and 'deno task'
|
|
5
|
-
* commands and replaces them with all matching scripts in the
|
|
6
|
-
*
|
|
5
|
+
* commands and replaces them with all matching scripts in the NodeJS and Deno
|
|
6
|
+
* configuration files of the current directory.
|
|
7
7
|
*/
|
|
8
8
|
export declare class ExpandWildcard implements CommandParser {
|
|
9
9
|
private readonly readDeno;
|
|
@@ -6,20 +6,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.ExpandWildcard = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
const jsonc_1 = __importDefault(require("../jsonc"));
|
|
9
10
|
// Matches a negative filter surrounded by '(!' and ')'.
|
|
10
11
|
const OMISSION = /\(!([^)]+)\)/;
|
|
11
12
|
/**
|
|
12
13
|
* Finds wildcards in 'npm/yarn/pnpm/bun run', 'node --run' and 'deno task'
|
|
13
|
-
* commands and replaces them with all matching scripts in the
|
|
14
|
-
*
|
|
14
|
+
* commands and replaces them with all matching scripts in the NodeJS and Deno
|
|
15
|
+
* configuration files of the current directory.
|
|
15
16
|
*/
|
|
16
17
|
class ExpandWildcard {
|
|
17
18
|
readDeno;
|
|
18
19
|
readPackage;
|
|
19
20
|
static readDeno() {
|
|
20
21
|
try {
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
let json = '{}';
|
|
23
|
+
if (fs_1.default.existsSync('deno.json')) {
|
|
24
|
+
json = fs_1.default.readFileSync('deno.json', { encoding: 'utf-8' });
|
|
25
|
+
}
|
|
26
|
+
else if (fs_1.default.existsSync('deno.jsonc')) {
|
|
27
|
+
json = fs_1.default.readFileSync('deno.jsonc', { encoding: 'utf-8' });
|
|
28
|
+
}
|
|
29
|
+
return jsonc_1.default.parse(json);
|
|
23
30
|
}
|
|
24
31
|
catch (e) {
|
|
25
32
|
return {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const JSONC: {
|
|
2
|
+
parse: (text: string) => any;
|
|
3
|
+
stringify: {
|
|
4
|
+
(value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): string;
|
|
5
|
+
(value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export default JSONC;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
ORIGINAL https://www.npmjs.com/package/tiny-jsonc
|
|
4
|
+
BY Fabio Spampinato
|
|
5
|
+
MIT license
|
|
6
|
+
|
|
7
|
+
Copied due to the dependency not being compatible with CommonJS
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
/* HELPERS */
|
|
11
|
+
const stringOrCommentRe = /("(?:\\?[^])*?")|(\/\/.*)|(\/\*[^]*?\*\/)/g;
|
|
12
|
+
const stringOrTrailingCommaRe = /("(?:\\?[^])*?")|(,\s*)(?=]|})/g;
|
|
13
|
+
/* MAIN */
|
|
14
|
+
const JSONC = {
|
|
15
|
+
parse: (text) => {
|
|
16
|
+
text = String(text); // To be extra safe
|
|
17
|
+
try {
|
|
18
|
+
// Fast path for valid JSON
|
|
19
|
+
return JSON.parse(text);
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
// Slow path for JSONC and invalid inputs
|
|
23
|
+
return JSON.parse(text.replace(stringOrCommentRe, '$1').replace(stringOrTrailingCommaRe, '$1'));
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
stringify: JSON.stringify,
|
|
27
|
+
};
|
|
28
|
+
/* EXPORT */
|
|
29
|
+
exports.default = JSONC;
|
|
@@ -17,9 +17,9 @@ For example, imagine you have in your `package.json` file scripts like this:
|
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
If you wanted to run only either `build:server` or `build:client` with an additional `--noEmit` flag,
|
|
20
|
-
you can do so with `npm run build:server -- --
|
|
21
|
-
However, if you want to do that while using concurrently, as `npm run
|
|
22
|
-
you might find that concurrently actually parses `--
|
|
20
|
+
you can do so with `npm run build:server -- --noEmit`, for example.<br/>
|
|
21
|
+
However, if you want to do that while using concurrently, as `npm run build -- --noEmit` for example,
|
|
22
|
+
you might find that concurrently actually parses `--noEmit` as its own flag, which does nothing,
|
|
23
23
|
because it doesn't exist.
|
|
24
24
|
|
|
25
25
|
To solve this, you can set the `--passthrough-arguments`/`-P` flag, which instructs concurrently to
|
package/docs/cli/shortcuts.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Command Shortcuts
|
|
2
2
|
|
|
3
|
-
Package managers that execute scripts from a `package.json` or `deno.json` file can be shortened when in concurrently.<br/>
|
|
3
|
+
Package managers that execute scripts from a `package.json` or `deno.(json|jsonc)` file can be shortened when in concurrently.<br/>
|
|
4
4
|
The following are supported:
|
|
5
5
|
|
|
6
6
|
| Syntax | Expands to |
|
package/package.json
CHANGED