4.0.5 • Published 10 days ago

@architect/hydrate v4.0.5

Weekly downloads
1,838
License
Apache-2.0
Repository
github
Last release
10 days ago

@architect/hydrate GitHub CI status

@architect/hydrate ensures that all functions managed by Architect have their dependencies installed. Functions containing all required dependencies are considered to be 'hydrated' - thus the name!

@architect/hydrate supports dependencies managed in the following languages using the following package managers:

  • Node.js via npm using package.json (and optionally package-lock.json), or via yarn using package.json and yarn.lock
  • Python via pip3 using a requirements.txt file
  • Ruby via bundle using Gemfile and Gemfile.lock files

Installation

npm install @architect/hydrate

API

All methods accept an options object can include the following properties:

  • autoinstall - Boolean - Enables or disables automated Lambda dependency treeshaking via static code analysis
    • Defaults to false
    • Used by install
  • basepath - String - Filesystem path in which Hydrate should search for functions
    • Defaults the current working directory
    • Useful if you want to hydrate one function or a subset of functions
    • Used by install + update
  • copyShared - Boolean - Enables or disables copying of shared code folders (e.g. src/shared) into Lambdas
    • Useful to disable if you want to just hydrate external dependencies
    • Defaults to true
    • Used by install + update
  • cwd - String - Root filesystem path of the project Hydrate is working in
    • Defaults to current working directory
    • May be the same or different from basepath; if using in conjunction with basepath, specify a subset of the project with basepath, for example:
      • { cwd: '/your/project/', basepath: '/your/project/src/http/' } runs Hydrate against /your/project/ (without having to use process.chdir) and only hydrates functions within /your/project/src/http/**
    • Used by install + update + shared
  • hydrateShared - Boolean - Enables or disables dependency hydration in shared code folders (e.g. src/shared)
    • Useful to disable if you want to just hydrate external dependencies
    • Defaults to true
    • Used by install + update
  • inventory - Object - Architect Inventory object; generally used internally
  • local - Boolean - Favor the local platform during installation of dependencies that may be distributed as platform-specific binaries
  • only - String - Specify a subset of possible shared files for shared to copy into Lambdas
    • Falsy by default
    • Accepts: shared, views, or staticJson
    • Used by shared
  • quiet - Boolean - Disables (most) logging
  • symlink - Boolean - Enables or disables symlinking instead of full directory copying, useful for local development
    • Defaults to false
    • Used by install + update + shared
  • timeout - Number - Amount of time in milliseconds to give each package manager process to execute
    • Used by install + update
  • verbose - Boolean - Enables verbose logging

Note on cwd vs basepath: cwd is necessary for Hydrate to find your project's manifest and key files and folders, while basepath scopes hydration to a specific path. When in doubt, include neither parameter, Hydrate will default to process working directory; if you know you need to aim Hydrate at a specific place but aren't sure which parameter to use, use cwd.

hydrate.install(options[, callback]) → [Promise]

Installs function dependencies, then invokes hydrate.shared().

To ensure local development behavior is as close to staging and production as possible, hydrate.install() (and other hydrate functions) uses:

  • Node.js: npm ci if package-lock.json is present and npm i if not; or yarn
  • Python: pip3 install
  • Ruby: bundle install

Note: by default update also installs dependencies in shared folders like src/shared and src/views.

hydrate.update(options[, callback]) → [Promise]

Updates function dependencies, then invokes hydrate.shared().

update is functionally almost identical to install, except it will update dependencies to newer versions if they exist. This is done via:

  • Node.js: npm update or yarn upgrade
  • Python: pip3 install -U --upgrade-strategy eager
  • Ruby: bundle update

Note: by default update also updates dependencies in shared folders like src/shared and src/views.

hydrate.shared(options[, callback]) → [Promise]

Copies shared code (from src/shared and src/views, or your custom @shared + @views paths, if any) into all functions.

4.0.5

10 days ago

4.0.4

18 days ago

4.0.3

1 month ago

4.0.2

3 months ago

4.0.1

3 months ago

4.0.0

3 months ago

4.0.0-RC.2

3 months ago

4.0.0-RC.1

3 months ago

4.0.0-RC.0

4 months ago

3.5.1

5 months ago

3.5.0

6 months ago

3.2.3

9 months ago

3.4.0

6 months ago

3.4.1

6 months ago

3.3.1

8 months ago

3.3.0

8 months ago

3.3.0-RC.2

8 months ago

3.3.0-RC.0

9 months ago

3.3.0-RC.1

9 months ago

3.2.2

10 months ago

3.2.1

1 year ago

3.2.0

1 year ago

3.1.12

1 year ago

3.1.11

1 year ago

3.1.11-RC.0

1 year ago

3.2.0-RC.0

1 year ago

3.1.10

1 year ago

3.1.10-RC.0

1 year ago

3.1.7

1 year ago

3.1.6

1 year ago

3.1.5

1 year ago

3.1.6-RC.0

1 year ago

3.1.9

1 year ago

3.1.8

1 year ago

3.1.4

2 years ago

3.1.3

2 years ago

3.1.2

2 years ago

3.1.1

2 years ago

3.1.0

2 years ago

3.0.6

2 years ago

3.0.4-RC.0

2 years ago

3.0.4

2 years ago

3.0.5

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.2.3

2 years ago

2.2.2

2 years ago

3.0.1-RC.0

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.2.0-RC.0

2 years ago

3.0.0-RC.1

2 years ago

3.0.0-RC.2

2 years ago

3.0.0-RC.0

2 years ago

3.0.0-RC.5

2 years ago

3.0.0-RC.6

2 years ago

3.0.0-RC.3

2 years ago

3.0.0-RC.4

2 years ago

2.1.0

2 years ago

2.0.4

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.10.2

3 years ago

1.10.1

3 years ago

1.10.0

3 years ago

1.10.0-RC.0

3 years ago

1.10.0-RC.1

3 years ago

1.9.9-RC.0

3 years ago

1.9.11

3 years ago

1.9.10

3 years ago

1.9.9

3 years ago

1.9.10-RC.0

3 years ago

1.9.8

3 years ago

1.9.7

3 years ago

1.9.6

3 years ago

1.9.6-RC.1

3 years ago

1.9.6-RC.0

3 years ago

1.9.5

3 years ago

1.9.4

3 years ago

1.9.3

3 years ago

1.9.3-RC.1

3 years ago

1.9.3-RC.0

3 years ago

1.9.2

3 years ago

1.9.1

3 years ago

1.9.0

3 years ago

1.9.0-RC.4

3 years ago

1.9.0-RC.3

3 years ago

1.9.0-RC.1

3 years ago

1.9.0-RC.2

3 years ago

1.8.0

3 years ago

1.8.0-RC.2

3 years ago

1.8.0-RC.0

3 years ago

1.8.0-RC.1

3 years ago

1.7.0

3 years ago

1.7.0-RC.7

3 years ago

1.7.0-RC.6

3 years ago

1.7.0-RC.5

3 years ago

1.6.2

3 years ago

1.7.0-RC.3

4 years ago

1.7.0-RC.2

4 years ago

1.7.0-RC.1

4 years ago

1.7.0-RC.0

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.6.0-RC.1

4 years ago

1.6.0-RC.0

4 years ago

1.5.1

4 years ago

1.5.1-RC.0

4 years ago

1.5.0

4 years ago

1.4.20

4 years ago

1.4.19

4 years ago

1.4.18

4 years ago

1.4.18-RC.1

4 years ago

1.4.17

4 years ago

1.4.16

4 years ago

1.4.15

4 years ago

1.4.14

4 years ago

1.4.13

4 years ago

1.4.13-RC.0

4 years ago

1.4.12-RC.0

4 years ago

1.4.12

4 years ago

1.4.11

4 years ago

1.4.11-RC.0

4 years ago

1.4.10

4 years ago

1.4.10-RC.0

4 years ago

1.4.9

5 years ago

1.4.8

5 years ago

1.4.7

5 years ago

1.4.6

5 years ago

1.4.5

5 years ago

1.4.4

5 years ago

1.4.4-RC.2

5 years ago

1.4.4-RC.1

5 years ago

1.4.3

5 years ago

1.4.2

5 years ago

1.4.2-RC.2

5 years ago

1.4.2-RC.1

5 years ago

1.4.1

5 years ago

1.4.1-RC.1

5 years ago

1.4.0

5 years ago

1.3.3-RC.3

5 years ago

1.3.3-RC.2

5 years ago

1.3.3-RC.1

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.3.0-RC.3

5 years ago

1.3.0-RC.2

5 years ago

1.3.0-RC.1

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago