Skip to content

Commit 465d050

Browse files
anonrigtargos
authored andcommitted
src: mark node --run as stable
PR-URL: #53763 Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Ruy Adorno <ruy@vlt.sh> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 22e601a commit 465d050

File tree

3 files changed

+18
-37
lines changed

3 files changed

+18
-37
lines changed

doc/api/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2097,7 +2097,7 @@ changes:
20972097
`PATH` environment variable accordingly.
20982098
-->
20992099

2100-
> Stability: 1.2 - Release candidate
2100+
> Stability: 2 - Stable
21012101
21022102
This runs a specified command from a package.json's `"scripts"` object.
21032103
If a missing `"command"` is provided, it will list the available scripts.

src/node.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,14 +1070,6 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args,
10701070
}
10711071

10721072
if (!per_process::cli_options->run.empty()) {
1073-
// TODO(@anonrig): Handle NODE_NO_WARNINGS, NODE_REDIRECT_WARNINGS,
1074-
// --disable-warning and --redirect-warnings.
1075-
if (per_process::cli_options->per_isolate->per_env->warnings) {
1076-
fprintf(stderr,
1077-
"ExperimentalWarning: Task runner is an experimental feature and "
1078-
"might change at any time\n\n");
1079-
}
1080-
10811073
auto positional_args = task_runner::GetPositionalArgs(args);
10821074
result->early_return_ = true;
10831075
task_runner::RunTask(

test/parallel/test-node-run.js

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,10 @@ const fixtures = require('../common/fixtures');
1010
const envSuffix = common.isWindows ? '-windows' : '';
1111

1212
describe('node --run [command]', () => {
13-
it('should emit experimental warning', async () => {
14-
const child = await common.spawnPromisified(
15-
process.execPath,
16-
[ '--run', 'test'],
17-
{ cwd: __dirname },
18-
);
19-
assert.match(child.stderr, /ExperimentalWarning: Task runner is an experimental feature and might change at any time/);
20-
assert.strictEqual(child.stdout, '');
21-
assert.strictEqual(child.code, 1);
22-
});
23-
2413
it('returns error on non-existent file', async () => {
2514
const child = await common.spawnPromisified(
2615
process.execPath,
27-
[ '--no-warnings', '--run', 'test'],
16+
[ '--run', 'test'],
2817
{ cwd: __dirname },
2918
);
3019
assert.match(child.stderr, /Can't find package\.json[\s\S]*/);
@@ -48,7 +37,7 @@ describe('node --run [command]', () => {
4837
it('adds node_modules/.bin to path', async () => {
4938
const child = await common.spawnPromisified(
5039
process.execPath,
51-
[ '--no-warnings', '--run', `ada${envSuffix}`],
40+
[ '--run', `ada${envSuffix}`],
5241
{ cwd: fixtures.path('run-script') },
5342
);
5443
assert.match(child.stdout, /06062023/);
@@ -59,7 +48,7 @@ describe('node --run [command]', () => {
5948
it('chdirs into package directory', async () => {
6049
const child = await common.spawnPromisified(
6150
process.execPath,
62-
[ '--no-warnings', '--run', `pwd${envSuffix}`],
51+
[ '--run', `pwd${envSuffix}`],
6352
{ cwd: fixtures.path('run-script/sub-directory') },
6453
);
6554
assert.strictEqual(child.stdout.trim(), fixtures.path('run-script'));
@@ -71,7 +60,7 @@ describe('node --run [command]', () => {
7160
{
7261
const child = await common.spawnPromisified(
7362
process.execPath,
74-
[ '--no-warnings', '--run', 'missing'],
63+
[ '--run', 'missing'],
7564
{ cwd: fixtures.path('run-script') },
7665
);
7766
assert.strictEqual(child.stdout, '');
@@ -82,7 +71,7 @@ describe('node --run [command]', () => {
8271
{
8372
const child = await common.spawnPromisified(
8473
process.execPath,
85-
[ '--no-warnings', '--run', 'test'],
74+
[ '--run', 'test'],
8675
{ cwd: fixtures.path('run-script/missing-scripts') },
8776
);
8877
assert.strictEqual(child.stdout, '');
@@ -92,7 +81,7 @@ describe('node --run [command]', () => {
9281
{
9382
const child = await common.spawnPromisified(
9483
process.execPath,
95-
[ '--no-warnings', '--run', 'test'],
84+
[ '--run', 'test'],
9685
{ cwd: fixtures.path('run-script/invalid-json') },
9786
);
9887
assert.strictEqual(child.stdout, '');
@@ -102,7 +91,7 @@ describe('node --run [command]', () => {
10291
{
10392
const child = await common.spawnPromisified(
10493
process.execPath,
105-
[ '--no-warnings', '--run', 'array'],
94+
[ '--run', 'array'],
10695
{ cwd: fixtures.path('run-script/invalid-schema') },
10796
);
10897
assert.strictEqual(child.stdout, '');
@@ -112,7 +101,7 @@ describe('node --run [command]', () => {
112101
{
113102
const child = await common.spawnPromisified(
114103
process.execPath,
115-
[ '--no-warnings', '--run', 'boolean'],
104+
[ '--run', 'boolean'],
116105
{ cwd: fixtures.path('run-script/invalid-schema') },
117106
);
118107
assert.strictEqual(child.stdout, '');
@@ -122,7 +111,7 @@ describe('node --run [command]', () => {
122111
{
123112
const child = await common.spawnPromisified(
124113
process.execPath,
125-
[ '--no-warnings', '--run', 'null'],
114+
[ '--run', 'null'],
126115
{ cwd: fixtures.path('run-script/invalid-schema') },
127116
);
128117
assert.strictEqual(child.stdout, '');
@@ -132,7 +121,7 @@ describe('node --run [command]', () => {
132121
{
133122
const child = await common.spawnPromisified(
134123
process.execPath,
135-
[ '--no-warnings', '--run', 'number'],
124+
[ '--run', 'number'],
136125
{ cwd: fixtures.path('run-script/invalid-schema') },
137126
);
138127
assert.strictEqual(child.stdout, '');
@@ -142,7 +131,7 @@ describe('node --run [command]', () => {
142131
{
143132
const child = await common.spawnPromisified(
144133
process.execPath,
145-
[ '--no-warnings', '--run', 'object'],
134+
[ '--run', 'object'],
146135
{ cwd: fixtures.path('run-script/invalid-schema') },
147136
);
148137
assert.strictEqual(child.stdout, '');
@@ -154,7 +143,7 @@ describe('node --run [command]', () => {
154143
it('appends positional arguments', async () => {
155144
const child = await common.spawnPromisified(
156145
process.execPath,
157-
[ '--no-warnings', '--run', `positional-args${envSuffix}`, '--', '--help "hello world test"', 'A', 'B', 'C'],
146+
[ '--run', `positional-args${envSuffix}`, '--', '--help "hello world test"', 'A', 'B', 'C'],
158147
{ cwd: fixtures.path('run-script') },
159148
);
160149
if (common.isWindows) {
@@ -170,7 +159,7 @@ describe('node --run [command]', () => {
170159
it('should set PATH environment variable with paths appended with node_modules/.bin', async () => {
171160
const child = await common.spawnPromisified(
172161
process.execPath,
173-
[ '--no-warnings', '--run', `path-env${envSuffix}`],
162+
[ '--run', `path-env${envSuffix}`],
174163
{ cwd: fixtures.path('run-script/sub-directory') },
175164
);
176165
assert.ok(child.stdout.includes(fixtures.path('run-script/node_modules/.bin')));
@@ -191,7 +180,7 @@ describe('node --run [command]', () => {
191180
const packageJsonPath = fixtures.path('run-script/package.json');
192181
const child = await common.spawnPromisified(
193182
process.execPath,
194-
[ '--no-warnings', '--run', scriptName],
183+
[ '--run', scriptName],
195184
{ cwd: fixtures.path('run-script') },
196185
);
197186
assert.ok(child.stdout.includes(scriptName));
@@ -204,7 +193,7 @@ describe('node --run [command]', () => {
204193
const packageJsonPath = fixtures.path('run-script/package.json');
205194
const child = await common.spawnPromisified(
206195
process.execPath,
207-
[ '--no-warnings', '--run', `special-env-variables${envSuffix}`],
196+
[ '--run', `special-env-variables${envSuffix}`],
208197
{ cwd: fixtures.path('run-script/sub-directory') },
209198
);
210199
assert.ok(child.stdout.includes(packageJsonPath));
@@ -215,7 +204,7 @@ describe('node --run [command]', () => {
215204
it('returns error on unparsable file', async () => {
216205
const child = await common.spawnPromisified(
217206
process.execPath,
218-
[ '--no-warnings', '--run', 'test'],
207+
[ '--run', 'test'],
219208
{ cwd: fixtures.path('run-script/cannot-parse') },
220209
);
221210
assert.match(child.stderr, /Can't parse/);
@@ -226,7 +215,7 @@ describe('node --run [command]', () => {
226215
it('returns error when there is no "scripts" field file', async () => {
227216
const child = await common.spawnPromisified(
228217
process.execPath,
229-
[ '--no-warnings', '--run', 'test'],
218+
[ '--run', 'test'],
230219
{ cwd: fixtures.path('run-script/cannot-find-script') },
231220
);
232221
assert.match(child.stderr, /Can't find "scripts" field in/);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy