Skip to content

Commit e349553

Browse files
committed
fix: change exec to execute avoid npm publish security policy issue
1 parent 9c7dce1 commit e349553

7 files changed

Lines changed: 39 additions & 34 deletions

File tree

.changeset/fluffy-goats-add.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hyperse/exec-program": patch
3+
---
4+
5+
change `exec` to `execute` avoid npm publish ` security policy` issue

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ dist
121121

122122
# Stores VSCode versions used for testing VSCode extensions
123123
.vscode-test
124-
124+
.DS_Store
125125
# yarn v2
126126
.yarn/cache
127127
.yarn/unplugged

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</a>
1616
</p>
1717

18-
Execa runs commands in your script, application or library. Unlike shells, it is optimized for programmatic usage.
18+
Runs commands in your script, application or library. Unlike shells, it is optimized for programmatic usage.
1919

2020
## README
2121

@@ -47,12 +47,12 @@ const { stderr, stdout } = await runTsScript(cliPath);
4747
console.log(stderr, stdout);
4848
```
4949

50-
### exec
51-
52-
import { exec } from '@hyperse/exec-program';
50+
### execute command
5351

5452
```ts
55-
const { stdout, stderr } = await exec(
53+
import { execute } from '@hyperse/exec-program';
54+
55+
const { stdout, stderr } = await execute(
5656
'npm',
5757
['i', '--no-save', '--no-package-lock', ...toInstall],
5858
{
@@ -64,15 +64,15 @@ const { stdout, stderr } = await exec(
6464
```
6565

6666
```ts
67-
await exec('npm', ['pack', directory], {
67+
await execute('npm', ['pack', directory], {
6868
cwd: this.uniqueDir,
6969
maxBuffer: TEN_MEGA_BYTE,
7070
});
7171
```
7272

73-
#### unit test
73+
#### run ts file for unit testing
7474

75-
1. config `tsconfig.json`
75+
config `tsconfig.json`
7676

7777
```json
7878
{
@@ -98,7 +98,7 @@ await exec('npm', ['pack', directory], {
9898
]
9999
```
100100

101-
2. create `cli-test.ts`
101+
create `cli-test.ts`
102102

103103
```ts
104104
// cause of `tsconfig.json` we can directly import source .ts file from '@hyperse/exec-program';
@@ -107,7 +107,7 @@ console.log(typeof runTsScript);
107107
console.log('cli...');
108108
```
109109

110-
3. create exec file `exec.spec.ts`
110+
create test file `main.spec.ts`
111111

112112
```ts
113113
import { dirname, join } from 'node:path';

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
"@types/node": "^20.14.12",
7575
"commitizen": "4.3.0",
7676
"cz-conventional-changelog": "3.3.0",
77-
"eslint": "^9.7.0",
78-
"husky": "9.1.1",
77+
"eslint": "^9.8.0",
78+
"husky": "9.1.3",
7979
"lint-staged": "15.2.7",
8080
"npm-run-all": "^4.1.5",
8181
"tsup": "^8.2.3",

src/exec.ts renamed to src/execute.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { ExecOptions, ExecResultPromise } from './types.js';
55
* Execute a file with arguments and options
66
* @example
77
* ```ts
8-
* const { stdout, stderr } = await exec(
8+
* const { stdout, stderr } = await execute(
99
* 'npm',
1010
* ['i', '--no-save', '--no-package-lock', ...toInstall],
1111
* {
@@ -17,7 +17,7 @@ import { ExecOptions, ExecResultPromise } from './types.js';
1717
* ```
1818
* @example
1919
* ```ts
20-
* await exec('npm', ['pack', directory], {
20+
* await execute('npm', ['pack', directory], {
2121
* cwd: this.uniqueDir,
2222
* maxBuffer: TEN_MEGA_BYTE,
2323
* });
@@ -27,7 +27,7 @@ import { ExecOptions, ExecResultPromise } from './types.js';
2727
* @param options - Options to pass to `execa`
2828
* @returns A `ResultPromise` that is both:
2929
*/
30-
export function exec<T extends ExecOptions>(
30+
export function execute<T extends ExecOptions>(
3131
file: string,
3232
args?: readonly string[],
3333
options?: T

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export * from './exec.js';
1+
export * from './execute.js';
22
export * from './runTsScript.js';
33
export * from './types.js';

yarn.lock

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ __metadata:
884884
languageName: node
885885
linkType: hard
886886

887-
"@eslint/config-array@npm:^0.17.0":
887+
"@eslint/config-array@npm:^0.17.1":
888888
version: 0.17.1
889889
resolution: "@eslint/config-array@npm:0.17.1"
890890
dependencies:
@@ -912,10 +912,10 @@ __metadata:
912912
languageName: node
913913
linkType: hard
914914

915-
"@eslint/js@npm:9.7.0, @eslint/js@npm:^9.5.0":
916-
version: 9.7.0
917-
resolution: "@eslint/js@npm:9.7.0"
918-
checksum: 10/b56b9fdec705f2cefae3a6d9d4227c4c28c5cbdbd8849c7997c357cabd4a729cee4445ddb43bb1423fbeb2280a119ced4d0819be8749d107c511e9d81dfe863a
915+
"@eslint/js@npm:9.8.0, @eslint/js@npm:^9.5.0":
916+
version: 9.8.0
917+
resolution: "@eslint/js@npm:9.8.0"
918+
checksum: 10/1c6ddbcc9f45f0165d9e218c085543536c03b4b650449a6f38f4e2b65b1d6bcd5f24f7feae72fca14d3697073cbdb413f270baef0f744cb0fb9e11ce9c84dbcc
919919
languageName: node
920920
linkType: hard
921921

@@ -984,9 +984,9 @@ __metadata:
984984
"@types/node": "npm:^20.14.12"
985985
commitizen: "npm:4.3.0"
986986
cz-conventional-changelog: "npm:3.3.0"
987-
eslint: "npm:^9.7.0"
987+
eslint: "npm:^9.8.0"
988988
execa: "npm:^9.3.0"
989-
husky: "npm:9.1.1"
989+
husky: "npm:9.1.3"
990990
lint-staged: "npm:15.2.7"
991991
npm-run-all: "npm:^4.1.5"
992992
tsup: "npm:^8.2.3"
@@ -3548,15 +3548,15 @@ __metadata:
35483548
languageName: node
35493549
linkType: hard
35503550

3551-
"eslint@npm:^9.7.0":
3552-
version: 9.7.0
3553-
resolution: "eslint@npm:9.7.0"
3551+
"eslint@npm:^9.8.0":
3552+
version: 9.8.0
3553+
resolution: "eslint@npm:9.8.0"
35543554
dependencies:
35553555
"@eslint-community/eslint-utils": "npm:^4.2.0"
35563556
"@eslint-community/regexpp": "npm:^4.11.0"
3557-
"@eslint/config-array": "npm:^0.17.0"
3557+
"@eslint/config-array": "npm:^0.17.1"
35583558
"@eslint/eslintrc": "npm:^3.1.0"
3559-
"@eslint/js": "npm:9.7.0"
3559+
"@eslint/js": "npm:9.8.0"
35603560
"@humanwhocodes/module-importer": "npm:^1.0.1"
35613561
"@humanwhocodes/retry": "npm:^0.3.0"
35623562
"@nodelib/fs.walk": "npm:^1.2.8"
@@ -3588,7 +3588,7 @@ __metadata:
35883588
text-table: "npm:^0.2.0"
35893589
bin:
35903590
eslint: bin/eslint.js
3591-
checksum: 10/f9b3c99a63f1e94feadb2005d854c907d2a9322d14a0ad8a47a127562475bfdcc43fbffcae184e3de94d832218891bb4b7a21a914f7ef9e22b1d2ee19941368d
3591+
checksum: 10/b1dd864170ca359249c92d1d8e09a628497efcf8a4293b571308460125fb0367a15612b2b0f135ff21b92453bf324ce75843fcaac3e01734f4bee2ff79919cc3
35923592
languageName: node
35933593
linkType: hard
35943594

@@ -4466,12 +4466,12 @@ __metadata:
44664466
languageName: node
44674467
linkType: hard
44684468

4469-
"husky@npm:9.1.1":
4470-
version: 9.1.1
4471-
resolution: "husky@npm:9.1.1"
4469+
"husky@npm:9.1.3":
4470+
version: 9.1.3
4471+
resolution: "husky@npm:9.1.3"
44724472
bin:
44734473
husky: bin.js
4474-
checksum: 10/c3be0392071b78c680fc6b9fd7978f52c26e18238a2840c6eabfc0db395e19fcd798da8eff0e31a9e76c479d6019a567d83a8de80f360d28552bc83bd1839b7c
4474+
checksum: 10/35d7ad85a247fb130659ae60b05bca9461820d261d6ff181b55c3dc6f2ae5da5ae3f3807367b90cc85d3bb915a2de8295aa9950e3cba3309994b7763dfd70cb1
44754475
languageName: node
44764476
linkType: hard
44774477

0 commit comments

Comments
 (0)