Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
@architect/hydrate
Advanced tools
@architect/hydrate
@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:
npm
using package.json
(and optionally package-lock.json
), or via yarn
using package.json
and yarn.lock
pip3
using a requirements.txt
filebundle
using Gemfile
and Gemfile.lock
filesnpm install @architect/hydrate
All methods accept an options
object can include the following properties:
autoinstall
- Boolean - Enables or disables automated Lambda dependency treeshaking via static code analysis
false
install
basepath
- String - Filesystem path in which Hydrate should search for functions
install
+ update
copyShared
- Boolean - Enables or disables copying of shared code folders (e.g. src/shared
) into Lambdas
true
install
+ update
cwd
- String - Root filesystem path of the project Hydrate is working in
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/**
install
+ update
+ shared
hydrateShared
- Boolean - Enables or disables dependency hydration in shared code folders (e.g. src/shared
)
true
install
+ update
inventory
- Object - Architect Inventory object; generally used internallyonly
- String - Specify a subset of possible shared files for shared
to copy into Lambdas
shared
, views
, or staticJson
shared
quiet
- Boolean - Disables (most) loggingsymlink
- Boolean - Enables or disables symlinking instead of full directory copying, useful for local development
false
install
+ update
+ shared
timeout
- Number - Amount of time in milliseconds to give each package manager process to execute
install
+ update
verbose
- Boolean - Enables verbose loggingNote on
cwd
vsbasepath
:cwd
is necessary for Hydrate to find your project's manifest and key files and folders, whilebasepath
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, usecwd
.
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:
npm ci
if package-lock.json
is present and npm i
if not; or yarn
pip3 install
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:
npm update
or yarn upgrade
pip3 install -U --upgrade-strategy eager
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.
FAQs
Architect dependency hydrator and shared file manager
The npm package @architect/hydrate receives a total of 463 weekly downloads. As such, @architect/hydrate popularity was classified as not popular.
We found that @architect/hydrate demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.