Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
chore: docs
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Jun 12, 2023
1 parent e5753be commit ad37101
Showing 1 changed file with 31 additions and 11 deletions.
42 changes: 31 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,16 @@ The following properties are accepted:
- _Type_: `string`
- _Default value_: undefined

A name to use when displaying the function in the Netlify UI. Populates the `displayName` property in the functions manifest for the specified function.
A name to use when displaying the function in the Netlify UI. Populates the `displayName` property in the functions
manifest for the specified function.

- `generator`

- _Type_: `string`
- _Default value_: undefined

A field to use if the function has been autogenerated by a plugin or integration. A recommended format is `@netlify/fake-plugin@1.0.0`, where adding the version is highly appreciated.
A field to use if the function has been autogenerated by a plugin or integration. A recommended format is
`@netlify/fake-plugin@1.0.0`, where adding the version is highly appreciated.

#### `featureFlags`

Expand All @@ -172,8 +174,9 @@ See [feature flags](#feature-flags).
- _Type_: `string`
- _Default value_: `undefined`

Defines the full path, including the file name, to use for the manifest file that will be created with the functions bundling results. For example, `path/to/manifest.json`. This file is a
JSON-formatted string with the following properties:
Defines the full path, including the file name, to use for the manifest file that will be created with the functions
bundling results. For example, `path/to/manifest.json`. This file is a JSON-formatted string with the following
properties:

- `functions`: An array with the functions created, in the same format as returned by `zipFunctions`
- `system.arch`: The operating system CPU architecture, as returned by
Expand All @@ -195,7 +198,9 @@ Maximum number of functions to bundle at the same time.
- _Type_: `string`
- _Default value_: `undefined`

Defines the path to the folder with internal functions. Used to populate a function's `generator` property if `generator` is not configured in the function's config itself, if its path is within this specified internal functions folder.
Defines the path to the folder with internal functions. Used to populate a function's `generator` property if
`generator` is not configured in the function's config itself, if its path is within this specified internal functions
folder.

### Return value

Expand Down Expand Up @@ -224,11 +229,14 @@ properties.

- `displayName`: `string`

If there was a user-defined configuration object applied to the function, and it had a `name` defined. This will be returned here.
If there was a user-defined configuration object applied to the function, and it had a `name` defined. This will be
returned here.

- `generator`: `string`

If there was a user-defined configuration object applied to the function, and it had `generator` defined. This will be returned here. If there was nothing defined, but an `internalSrcFolder` was passed and the function was defined in there, it will return a string to specify it was an internal function.
If there was a user-defined configuration object applied to the function, and it had `generator` defined. This will be
returned here. If there was nothing defined, but an `internalSrcFolder` was passed and the function was defined in
there, it will return a string to specify it was an internal function.

Additionally, the following properties also exist for Node.js functions:

Expand Down Expand Up @@ -275,6 +283,16 @@ Additionally, the following properties also exist for Node.js functions:
A list of Node modules that reference other files with a dynamic expression (e.g. `require(someFunction())` as opposed
to `require('./some-file')`). This is an array containing the module names.

- `runtimeAPIVersion` `number | undefined`

When a function with the new API will be detected this is set to `2`. Otherwise it is set to `1`. `undefined` is only
returned in case of an error.

- `runtimeVersion` `string | undefined`

Which exact runtime this function should be using. (e.g. `nodejs18.x`). This value is detected based on the input
`nodeVersion`.

## zipFunction(srcPath, destFolder, options?)

- `srcPath`: `string`
Expand Down Expand Up @@ -326,7 +344,8 @@ Each object has the following properties:

- `displayName`: `string`

If there was a user-defined configuration object applied to the function, and it had a `name` defined. This will be returned here.
If there was a user-defined configuration object applied to the function, and it had a `name` defined. This will be
returned here.

- `mainFile`: `string`

Expand All @@ -343,12 +362,13 @@ Each object has the following properties:

- `generator`: `string`

If there was a user-defined configuration object applied to the function, and it had `generator` defined. This will be returned here.
If there was a user-defined configuration object applied to the function, and it had `generator` defined. This will be
returned here.

## listFunctionsFiles(srcFolders)

Like [`listFunctions()`](#listfunctionssrcfolders-options), except it returns not only the Functions main files, but also all
their required files. This is much slower.
Like [`listFunctions()`](#listfunctionssrcfolders-options), except it returns not only the Functions main files, but
also all their required files. This is much slower.

```js
import { listFunctionsFiles } from '@netlify/zip-it-and-ship-it'
Expand Down

0 comments on commit ad37101

Please sign in to comment.