Skip to content

Commit

Permalink
Merge commit '3d27175c42a4bf5827e325025da820c1277cc6bc' into v18
Browse files Browse the repository at this point in the history
  • Loading branch information
asana-kristoferbuno committed Feb 23, 2024
2 parents bc56465 + 3d27175 commit 43c2a08
Show file tree
Hide file tree
Showing 721 changed files with 15,882 additions and 4,673 deletions.
1 change: 1 addition & 0 deletions deps/llhttp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libllhttp.pc
2 changes: 1 addition & 1 deletion deps/llhttp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.5.1)
cmake_policy(SET CMP0069 NEW)

project(llhttp VERSION 6.0.11)
project(llhttp VERSION 6.1.0)
include(GNUInstallDirs)

set(CMAKE_C_STANDARD 99)
Expand Down
7 changes: 5 additions & 2 deletions deps/llhttp/include/llhttp.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#define INCLUDE_LLHTTP_H_

#define LLHTTP_VERSION_MAJOR 6
#define LLHTTP_VERSION_MINOR 0
#define LLHTTP_VERSION_PATCH 11
#define LLHTTP_VERSION_MINOR 1
#define LLHTTP_VERSION_PATCH 0

#ifndef LLHTTP_STRICT_MODE
# define LLHTTP_STRICT_MODE 0
Expand Down Expand Up @@ -348,6 +348,9 @@ struct llhttp_settings_s {
*/
llhttp_cb on_headers_complete;

/* Possible return values 0, -1, HPE_USER */
llhttp_data_cb on_chunk_parameters;

/* Possible return values 0, -1, HPE_USER */
llhttp_data_cb on_body;

Expand Down
7 changes: 7 additions & 0 deletions deps/llhttp/src/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,13 @@ int llhttp__on_chunk_header(llhttp_t* s, const char* p, const char* endp) {
}


int llhttp__on_chunk_parameters(llhttp_t* s, const char* p, const char* endp) {
int err;
SPAN_CALLBACK_MAYBE(s, on_chunk_parameters, p, endp - p);
return err;
}


int llhttp__on_chunk_complete(llhttp_t* s, const char* p, const char* endp) {
int err;
CALLBACK_MAYBE(s, on_chunk_complete);
Expand Down
122 changes: 108 additions & 14 deletions deps/llhttp/src/llhttp.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ enum llparse_state_e {
s_n_llhttp__internal__n_invoke_is_equal_content_length,
s_n_llhttp__internal__n_chunk_size_almost_done,
s_n_llhttp__internal__n_chunk_parameters,
s_n_llhttp__internal__n_span_start_llhttp__on_chunk_parameters,
s_n_llhttp__internal__n_chunk_parameters_ows,
s_n_llhttp__internal__n_chunk_size_otherwise,
s_n_llhttp__internal__n_chunk_size,
s_n_llhttp__internal__n_chunk_size_digit,
Expand Down Expand Up @@ -539,6 +541,10 @@ int llhttp__on_body(
llhttp__internal_t* s, const unsigned char* p,
const unsigned char* endp);

int llhttp__on_chunk_parameters(
llhttp__internal_t* s, const unsigned char* p,
const unsigned char* endp);

int llhttp__on_status(
llhttp__internal_t* s, const unsigned char* p,
const unsigned char* endp);
Expand Down Expand Up @@ -1226,8 +1232,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_chunk_parameters;
}
case 2: {
p++;
goto s_n_llhttp__internal__n_chunk_size_almost_done;
goto s_n_llhttp__internal__n_span_end_llhttp__on_chunk_parameters;
}
default: {
goto s_n_llhttp__internal__n_error_10;
Expand All @@ -1236,6 +1241,34 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
case s_n_llhttp__internal__n_span_start_llhttp__on_chunk_parameters:
s_n_llhttp__internal__n_span_start_llhttp__on_chunk_parameters: {
if (p == endp) {
return s_n_llhttp__internal__n_span_start_llhttp__on_chunk_parameters;
}
state->_span_pos0 = (void*) p;
state->_span_cb0 = llhttp__on_chunk_parameters;
goto s_n_llhttp__internal__n_chunk_parameters;
/* UNREACHABLE */;
abort();
}
case s_n_llhttp__internal__n_chunk_parameters_ows:
s_n_llhttp__internal__n_chunk_parameters_ows: {
if (p == endp) {
return s_n_llhttp__internal__n_chunk_parameters_ows;
}
switch (*p) {
case ' ': {
p++;
goto s_n_llhttp__internal__n_chunk_parameters_ows;
}
default: {
goto s_n_llhttp__internal__n_span_start_llhttp__on_chunk_parameters;
}
}
/* UNREACHABLE */;
abort();
}
case s_n_llhttp__internal__n_chunk_size_otherwise:
s_n_llhttp__internal__n_chunk_size_otherwise: {
if (p == endp) {
Expand All @@ -1246,13 +1279,9 @@ static llparse_state_t llhttp__internal__run(
p++;
goto s_n_llhttp__internal__n_chunk_size_almost_done;
}
case ' ': {
p++;
goto s_n_llhttp__internal__n_chunk_parameters;
}
case ';': {
p++;
goto s_n_llhttp__internal__n_chunk_parameters;
goto s_n_llhttp__internal__n_chunk_parameters_ows;
}
default: {
goto s_n_llhttp__internal__n_error_11;
Expand Down Expand Up @@ -6074,6 +6103,24 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
s_n_llhttp__internal__n_span_end_llhttp__on_chunk_parameters: {
const unsigned char* start;
int err;

start = state->_span_pos0;
state->_span_pos0 = NULL;
err = llhttp__on_chunk_parameters(state, start, p);
if (err != 0) {
state->error = err;
state->error_pos = (const char*) (p + 1);
state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_chunk_size_almost_done;
return s_error;
}
p++;
goto s_n_llhttp__internal__n_chunk_size_almost_done;
/* UNREACHABLE */;
abort();
}
s_n_llhttp__internal__n_error_10: {
state->error = 0x2;
state->reason = "Invalid character in chunk parameters";
Expand Down Expand Up @@ -8441,6 +8488,8 @@ enum llparse_state_e {
s_n_llhttp__internal__n_invoke_is_equal_content_length,
s_n_llhttp__internal__n_chunk_size_almost_done,
s_n_llhttp__internal__n_chunk_parameters,
s_n_llhttp__internal__n_span_start_llhttp__on_chunk_parameters,
s_n_llhttp__internal__n_chunk_parameters_ows,
s_n_llhttp__internal__n_chunk_size_otherwise,
s_n_llhttp__internal__n_chunk_size,
s_n_llhttp__internal__n_chunk_size_digit,
Expand Down Expand Up @@ -8635,6 +8684,10 @@ int llhttp__on_body(
llhttp__internal_t* s, const unsigned char* p,
const unsigned char* endp);

int llhttp__on_chunk_parameters(
llhttp__internal_t* s, const unsigned char* p,
const unsigned char* endp);

int llhttp__on_status(
llhttp__internal_t* s, const unsigned char* p,
const unsigned char* endp);
Expand Down Expand Up @@ -9299,8 +9352,7 @@ static llparse_state_t llhttp__internal__run(
goto s_n_llhttp__internal__n_chunk_parameters;
}
case 2: {
p++;
goto s_n_llhttp__internal__n_chunk_size_almost_done;
goto s_n_llhttp__internal__n_span_end_llhttp__on_chunk_parameters;
}
default: {
goto s_n_llhttp__internal__n_error_6;
Expand All @@ -9309,6 +9361,34 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
case s_n_llhttp__internal__n_span_start_llhttp__on_chunk_parameters:
s_n_llhttp__internal__n_span_start_llhttp__on_chunk_parameters: {
if (p == endp) {
return s_n_llhttp__internal__n_span_start_llhttp__on_chunk_parameters;
}
state->_span_pos0 = (void*) p;
state->_span_cb0 = llhttp__on_chunk_parameters;
goto s_n_llhttp__internal__n_chunk_parameters;
/* UNREACHABLE */;
abort();
}
case s_n_llhttp__internal__n_chunk_parameters_ows:
s_n_llhttp__internal__n_chunk_parameters_ows: {
if (p == endp) {
return s_n_llhttp__internal__n_chunk_parameters_ows;
}
switch (*p) {
case ' ': {
p++;
goto s_n_llhttp__internal__n_chunk_parameters_ows;
}
default: {
goto s_n_llhttp__internal__n_span_start_llhttp__on_chunk_parameters;
}
}
/* UNREACHABLE */;
abort();
}
case s_n_llhttp__internal__n_chunk_size_otherwise:
s_n_llhttp__internal__n_chunk_size_otherwise: {
if (p == endp) {
Expand All @@ -9319,13 +9399,9 @@ static llparse_state_t llhttp__internal__run(
p++;
goto s_n_llhttp__internal__n_chunk_size_almost_done;
}
case ' ': {
p++;
goto s_n_llhttp__internal__n_chunk_parameters;
}
case ';': {
p++;
goto s_n_llhttp__internal__n_chunk_parameters;
goto s_n_llhttp__internal__n_chunk_parameters_ows;
}
default: {
goto s_n_llhttp__internal__n_error_7;
Expand Down Expand Up @@ -13951,6 +14027,24 @@ static llparse_state_t llhttp__internal__run(
/* UNREACHABLE */;
abort();
}
s_n_llhttp__internal__n_span_end_llhttp__on_chunk_parameters: {
const unsigned char* start;
int err;

start = state->_span_pos0;
state->_span_pos0 = NULL;
err = llhttp__on_chunk_parameters(state, start, p);
if (err != 0) {
state->error = err;
state->error_pos = (const char*) (p + 1);
state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_chunk_size_almost_done;
return s_error;
}
p++;
goto s_n_llhttp__internal__n_chunk_size_almost_done;
/* UNREACHABLE */;
abort();
}
s_n_llhttp__internal__n_error_6: {
state->error = 0x2;
state->reason = "Invalid character in chunk parameters";
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/content/commands/npm-ls.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ packages will *also* show the paths to the specified packages. For
example, running `npm ls promzard` in npm's source tree will show:

```bash
[email protected].3 /path/to/npm
[email protected].4 /path/to/npm
└─┬ [email protected]
└── [email protected]
```
Expand Down
5 changes: 2 additions & 3 deletions deps/npm/docs/content/commands/npm-prune.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ then only packages matching one of the supplied names are removed.
Extraneous packages are those present in the `node_modules` folder that are
not listed as any package's dependency list.

If the `--production` flag is specified or the `NODE_ENV` environment
If the `--omit=dev` flag is specified or the `NODE_ENV` environment
variable is set to `production`, this command will remove the packages
specified in your `devDependencies`. Setting `--no-production` will negate
`NODE_ENV` being set to `production`.
specified in your `devDependencies`.

If the `--dry-run` flag is used then no changes will actually be made.

Expand Down
7 changes: 7 additions & 0 deletions deps/npm/docs/content/commands/npm-view.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ For example, to show the dependencies of the `ronn` package at version
npm view [email protected] dependencies
```

By default, `npm view` shows data about the current project context (by looking for a `package.json`).
To show field data for the current project use a file path (i.e. `.`):

```bash
npm view . dependencies
```

You can view child fields by separating them with a period.
To view the git repository URL for the latest version of `npm`, you would run the following command:

Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/content/commands/npm.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Note: This command is unaware of workspaces.

### Version

10.2.3
10.2.4

### Description

Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ <h3 id="description">Description</h3>
the results to only the paths to the packages named. Note that nested
packages will <em>also</em> show the paths to the specified packages. For
example, running <code>npm ls promzard</code> in npm's source tree will show:</p>
<pre><code class="language-bash">[email protected].3 /path/to/npm
<pre><code class="language-bash">[email protected].4 /path/to/npm
└─┬ [email protected]
└── [email protected]
</code></pre>
Expand Down
5 changes: 2 additions & 3 deletions deps/npm/docs/output/commands/npm-prune.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,9 @@ <h3 id="description">Description</h3>
then only packages matching one of the supplied names are removed.</p>
<p>Extraneous packages are those present in the <code>node_modules</code> folder that are
not listed as any package's dependency list.</p>
<p>If the <code>--production</code> flag is specified or the <code>NODE_ENV</code> environment
<p>If the <code>--omit=dev</code> flag is specified or the <code>NODE_ENV</code> environment
variable is set to <code>production</code>, this command will remove the packages
specified in your <code>devDependencies</code>. Setting <code>--no-production</code> will negate
<code>NODE_ENV</code> being set to <code>production</code>.</p>
specified in your <code>devDependencies</code>.</p>
<p>If the <code>--dry-run</code> flag is used then no changes will actually be made.</p>
<p>If the <code>--json</code> flag is used, then the changes <code>npm prune</code> made (or would
have made with <code>--dry-run</code>) are printed as a JSON object.</p>
Expand Down
4 changes: 4 additions & 0 deletions deps/npm/docs/output/commands/npm-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ <h3 id="description">Description</h3>
<code>0.3.5</code>, you could do the following:</p>
<pre><code class="language-bash">npm view [email protected] dependencies
</code></pre>
<p>By default, <code>npm view</code> shows data about the current project context (by looking for a <code>package.json</code>).
To show field data for the current project use a file path (i.e. <code>.</code>):</p>
<pre><code class="language-bash">npm view . dependencies
</code></pre>
<p>You can view child fields by separating them with a period.
To view the git repository URL for the latest version of <code>npm</code>, you would run the following command:</p>
<pre><code class="language-bash">npm view npm repository.url
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ <h2 id="table-of-contents">Table of contents</h2>
</code></pre>
<p>Note: This command is unaware of workspaces.</p>
<h3 id="version">Version</h3>
<p>10.2.3</p>
<p>10.2.4</p>
<h3 id="description">Description</h3>
<p>npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
Expand Down
25 changes: 17 additions & 8 deletions deps/npm/lib/commands/exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,33 @@ class Exec extends BaseCommand {
for (const [name, path] of this.workspaces) {
const locationMsg =
`in workspace ${this.npm.chalk.green(name)} at location:\n${this.npm.chalk.dim(path)}`
await this.callExec(args, { locationMsg, runPath: path })
await this.callExec(args, { name, locationMsg, runPath: path })
}
}

async callExec (args, { locationMsg, runPath } = {}) {
// This is where libnpmexec will look for locally installed packages
async callExec (args, { name, locationMsg, runPath } = {}) {
// This is where libnpmexec will look for locally installed packages at the project level
const localPrefix = this.npm.localPrefix
// This is where libnpmexec will look for locally installed packages at the workspace level
let localBin = this.npm.localBin
let path = localPrefix

// This is where libnpmexec will actually run the scripts from
if (!runPath) {
runPath = process.cwd()
} else {
// We have to consider if the workspace has its own separate versions
// libnpmexec will walk up to localDir after looking here
localBin = resolve(this.npm.localDir, name, 'node_modules', '.bin')
// We also need to look for `bin` entries in the workspace package.json
// libnpmexec will NOT look in the project root for the bin entry
path = runPath
}

const call = this.npm.config.get('call')
let globalPath
const {
flatOptions,
localBin,
globalBin,
globalDir,
chalk,
Expand Down Expand Up @@ -79,14 +88,14 @@ class Exec extends BaseCommand {
// copy args so they dont get mutated
args: [...args],
call,
localBin,
locationMsg,
chalk,
globalBin,
globalPath,
localBin,
locationMsg,
output,
chalk,
packages,
path: localPrefix,
path,
runPath,
scriptShell,
yes,
Expand Down
Loading

0 comments on commit 43c2a08

Please sign in to comment.