@pipedream/types
package and other TypeScript configuration in the pipedream
repo is subject to change.PipedreamHQ/pipedream
registrypnpm install
to install dependencies.
tsconfig.json
configuration and TypeScript components. If the app you’re working with doesn’t yet have a tsconfig.json
file, copy the file from the RSS component directory and modify accordingly.
defineApp
, defineAction
, and defineSource
methods from the @pipedream/types
package. This lets us strictly-type this
in apps and components. See the TypeScript docs on ThisType
for more detail on this pattern.
/dist
directory.
For example, if you compile a TypeScript file at pipedream/components/rss/sources/new-item-in-feed/new-item-in-feed.ts
, the corresponding JS file will be produced at pipedream/components/rss/dist/sources/new-item-in-feed/new-item-in-feed.js
.
pd publish
or pd dev
the JavaScript components emitted by step 5 by the full path to the file./dist
directory as described in step 5..gitignore
file that ignores the following files. Commit only ts
files to Git, not compiled *js
files.@pipedream/types
package:
tsconfig.json
in the root of the repo contains references to component app directories. For example, the root config provides a reference to the components/rss
directory, which contains its own tsconfig.json
file.npm run build
compiles the TypeScript in all directories in references
.tsconfig.json
in each component app directory contains the app-specific TypeScript configuration..github/workflows
compile and publish our components.PipedreamHQ/pipedream
repo, where we store all sources and actions, the @pipedream/types
package, these docs, and other Pipedream code. Here are a few known issues durin the beta:
this
is strictly-typed within methods
, run
, hooks
, and everywhere you have access to this
in the component API. But this typing can be improved. For example, we don’t yet map props to their appropriate TypeScript type (everything is typed with any
).pipedream
repo. Currently, you have to run npm run build
from the repo root, then use the pd
CLI to publish components after compilation. It would be nice to run tsc-watch
and have that compile and publish the new version of the component using the --onSuccess
flag, publishing any sources or actions accordingly.dtslint
) to all TypeScript components). Currently, dtslint
is configured only for the @pipedream/types
package.@pipedream/types
types
directory of the PipedreamHQ/pipedream
repo for Pipedream types. We welcome PRs!