GeezerVison is showing github.com — src: mark node --run as stable · nodejs/node@12dd4c7
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: doc/api/cli.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2097,7 +2097,7 @@ changes: | 2097 | 2097 | `PATH` environment variable accordingly. | 2098 | 2098 | --> | 2099 | 2099 |
| 2100 | | -> Stability: 1.2 - Release candidate | | 2100 | +> Stability: 2 - Stable | 2101 | 2101 |
| 2102 | 2102 | This runs a specified command from a package.json's `"scripts"` object. | 2103 | 2103 | If a missing `"command"` is provided, it will list the available scripts. | |
Collapse file Copy file name to clipboardExpand all lines: src/node.cc -8Lines changed: 0 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1018,14 +1018,6 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args, | 1018 | 1018 | } | 1019 | 1019 |
| 1020 | 1020 | if (!per_process::cli_options->run.empty()) { | 1021 | | - // TODO(@anonrig): Handle NODE_NO_WARNINGS, NODE_REDIRECT_WARNINGS, | 1022 | | - // --disable-warning and --redirect-warnings. | 1023 | | - if (per_process::cli_options->per_isolate->per_env->warnings) { | 1024 | | - fprintf(stderr, | 1025 | | - "ExperimentalWarning: Task runner is an experimental feature and " | 1026 | | - "might change at any time\n\n"); | 1027 | | - } | 1028 | | - | 1029 | 1021 | auto positional_args = task_runner::GetPositionalArgs(args); | 1030 | 1022 | result->early_return_ = true; | 1031 | 1023 | task_runner::RunTask( | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-node-run.js +17-28Lines changed: 17 additions & 28 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -10,21 +10,10 @@ const fixtures = require('../common/fixtures'); | 10 | 10 | const envSuffix = common.isWindows ? '-windows' : ''; | 11 | 11 |
| 12 | 12 | 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 | | - | 24 | 13 | it('returns error on non-existent file', async () => { | 25 | 14 | const child = await common.spawnPromisified( | 26 | 15 | process.execPath, | 27 | | - [ '--no-warnings', '--run', 'test'], | | 16 | + [ '--run', 'test'], | 28 | 17 | { cwd: __dirname }, | 29 | 18 | ); | 30 | 19 | assert.match(child.stderr, /Can't find package\.json[\s\S]*/); | @@ -48,7 +37,7 @@ describe('node --run [command]', () => { | 48 | 37 | it('adds node_modules/.bin to path', async () => { | 49 | 38 | const child = await common.spawnPromisified( | 50 | 39 | process.execPath, | 51 | | - [ '--no-warnings', '--run', `ada${envSuffix}`], | | 40 | + [ '--run', `ada${envSuffix}`], | 52 | 41 | { cwd: fixtures.path('run-script') }, | 53 | 42 | ); | 54 | 43 | assert.match(child.stdout, /06062023/); | @@ -59,7 +48,7 @@ describe('node --run [command]', () => { | 59 | 48 | it('chdirs into package directory', async () => { | 60 | 49 | const child = await common.spawnPromisified( | 61 | 50 | process.execPath, | 62 | | - [ '--no-warnings', '--run', `pwd${envSuffix}`], | | 51 | + [ '--run', `pwd${envSuffix}`], | 63 | 52 | { cwd: fixtures.path('run-script/sub-directory') }, | 64 | 53 | ); | 65 | 54 | assert.strictEqual(child.stdout.trim(), fixtures.path('run-script')); | @@ -71,7 +60,7 @@ describe('node --run [command]', () => { | 71 | 60 | { | 72 | 61 | const child = await common.spawnPromisified( | 73 | 62 | process.execPath, | 74 | | - [ '--no-warnings', '--run', 'missing'], | | 63 | + [ '--run', 'missing'], | 75 | 64 | { cwd: fixtures.path('run-script') }, | 76 | 65 | ); | 77 | 66 | assert.strictEqual(child.stdout, ''); | @@ -82,7 +71,7 @@ describe('node --run [command]', () => { | 82 | 71 | { | 83 | 72 | const child = await common.spawnPromisified( | 84 | 73 | process.execPath, | 85 | | - [ '--no-warnings', '--run', 'test'], | | 74 | + [ '--run', 'test'], | 86 | 75 | { cwd: fixtures.path('run-script/missing-scripts') }, | 87 | 76 | ); | 88 | 77 | assert.strictEqual(child.stdout, ''); | @@ -92,7 +81,7 @@ describe('node --run [command]', () => { | 92 | 81 | { | 93 | 82 | const child = await common.spawnPromisified( | 94 | 83 | process.execPath, | 95 | | - [ '--no-warnings', '--run', 'test'], | | 84 | + [ '--run', 'test'], | 96 | 85 | { cwd: fixtures.path('run-script/invalid-json') }, | 97 | 86 | ); | 98 | 87 | assert.strictEqual(child.stdout, ''); | @@ -102,7 +91,7 @@ describe('node --run [command]', () => { | 102 | 91 | { | 103 | 92 | const child = await common.spawnPromisified( | 104 | 93 | process.execPath, | 105 | | - [ '--no-warnings', '--run', 'array'], | | 94 | + [ '--run', 'array'], | 106 | 95 | { cwd: fixtures.path('run-script/invalid-schema') }, | 107 | 96 | ); | 108 | 97 | assert.strictEqual(child.stdout, ''); | @@ -112,7 +101,7 @@ describe('node --run [command]', () => { | 112 | 101 | { | 113 | 102 | const child = await common.spawnPromisified( | 114 | 103 | process.execPath, | 115 | | - [ '--no-warnings', '--run', 'boolean'], | | 104 | + [ '--run', 'boolean'], | 116 | 105 | { cwd: fixtures.path('run-script/invalid-schema') }, | 117 | 106 | ); | 118 | 107 | assert.strictEqual(child.stdout, ''); | @@ -122,7 +111,7 @@ describe('node --run [command]', () => { | 122 | 111 | { | 123 | 112 | const child = await common.spawnPromisified( | 124 | 113 | process.execPath, | 125 | | - [ '--no-warnings', '--run', 'null'], | | 114 | + [ '--run', 'null'], | 126 | 115 | { cwd: fixtures.path('run-script/invalid-schema') }, | 127 | 116 | ); | 128 | 117 | assert.strictEqual(child.stdout, ''); | @@ -132,7 +121,7 @@ describe('node --run [command]', () => { | 132 | 121 | { | 133 | 122 | const child = await common.spawnPromisified( | 134 | 123 | process.execPath, | 135 | | - [ '--no-warnings', '--run', 'number'], | | 124 | + [ '--run', 'number'], | 136 | 125 | { cwd: fixtures.path('run-script/invalid-schema') }, | 137 | 126 | ); | 138 | 127 | assert.strictEqual(child.stdout, ''); | @@ -142,7 +131,7 @@ describe('node --run [command]', () => { | 142 | 131 | { | 143 | 132 | const child = await common.spawnPromisified( | 144 | 133 | process.execPath, | 145 | | - [ '--no-warnings', '--run', 'object'], | | 134 | + [ '--run', 'object'], | 146 | 135 | { cwd: fixtures.path('run-script/invalid-schema') }, | 147 | 136 | ); | 148 | 137 | assert.strictEqual(child.stdout, ''); | @@ -154,7 +143,7 @@ describe('node --run [command]', () => { | 154 | 143 | it('appends positional arguments', async () => { | 155 | 144 | const child = await common.spawnPromisified( | 156 | 145 | 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'], | 158 | 147 | { cwd: fixtures.path('run-script') }, | 159 | 148 | ); | 160 | 149 | if (common.isWindows) { | @@ -170,7 +159,7 @@ describe('node --run [command]', () => { | 170 | 159 | it('should set PATH environment variable with paths appended with node_modules/.bin', async () => { | 171 | 160 | const child = await common.spawnPromisified( | 172 | 161 | process.execPath, | 173 | | - [ '--no-warnings', '--run', `path-env${envSuffix}`], | | 162 | + [ '--run', `path-env${envSuffix}`], | 174 | 163 | { cwd: fixtures.path('run-script/sub-directory') }, | 175 | 164 | ); | 176 | 165 | assert.ok(child.stdout.includes(fixtures.path('run-script/node_modules/.bin'))); | @@ -191,7 +180,7 @@ describe('node --run [command]', () => { | 191 | 180 | const packageJsonPath = fixtures.path('run-script/package.json'); | 192 | 181 | const child = await common.spawnPromisified( | 193 | 182 | process.execPath, | 194 | | - [ '--no-warnings', '--run', scriptName], | | 183 | + [ '--run', scriptName], | 195 | 184 | { cwd: fixtures.path('run-script') }, | 196 | 185 | ); | 197 | 186 | assert.ok(child.stdout.includes(scriptName)); | @@ -204,7 +193,7 @@ describe('node --run [command]', () => { | 204 | 193 | const packageJsonPath = fixtures.path('run-script/package.json'); | 205 | 194 | const child = await common.spawnPromisified( | 206 | 195 | process.execPath, | 207 | | - [ '--no-warnings', '--run', `special-env-variables${envSuffix}`], | | 196 | + [ '--run', `special-env-variables${envSuffix}`], | 208 | 197 | { cwd: fixtures.path('run-script/sub-directory') }, | 209 | 198 | ); | 210 | 199 | assert.ok(child.stdout.includes(packageJsonPath)); | @@ -215,7 +204,7 @@ describe('node --run [command]', () => { | 215 | 204 | it('returns error on unparsable file', async () => { | 216 | 205 | const child = await common.spawnPromisified( | 217 | 206 | process.execPath, | 218 | | - [ '--no-warnings', '--run', 'test'], | | 207 | + [ '--run', 'test'], | 219 | 208 | { cwd: fixtures.path('run-script/cannot-parse') }, | 220 | 209 | ); | 221 | 210 | assert.match(child.stderr, /Can't parse/); | @@ -226,7 +215,7 @@ describe('node --run [command]', () => { | 226 | 215 | it('returns error when there is no "scripts" field file', async () => { | 227 | 216 | const child = await common.spawnPromisified( | 228 | 217 | process.execPath, | 229 | | - [ '--no-warnings', '--run', 'test'], | | 218 | + [ '--run', 'test'], | 230 | 219 | { cwd: fixtures.path('run-script/cannot-find-script') }, | 231 | 220 | ); | 232 | 221 | assert.match(child.stderr, /Can't find "scripts" field in/); | |
|