@@ -116,7 +116,8 @@ scoped components are easier for users to understand and use.
116116Registry [ components] ( /components/contributing/api/#component-structure ) require a unique
117117` key ` and ` version ` , and a friendly ` name ` and ` description ` . Action components
118118require a ` type ` field to be set to ` action ` (sources will require a type to be
119- set in the future).
119+ set in the future). Action components require the description to include a link to the
120+ relevant documentation in the following format: \[ See the documentation\] (https://public-api.com )
120121
121122``` javascript
122123export default {
@@ -160,6 +161,9 @@ to the registry, the version should be `0.0.1`. If the action was at version
160161` 0.1.0 ` and you've fixed a bug, change it to ` 0.1.1 ` when committing your final
161162code.
162163
164+ If you update a file, you must increment the versions of all components that
165+ import or are affected by the updated file .
166+
163167### Folder Structure
164168
165169Registry components are organized by app in the ` components ` directory of the
@@ -168,26 +172,28 @@ Registry components are organized by app in the `components` directory of the
168172` ` ` text
169173/components
170174 /[app-name-slug]
171- /[app-name-slug].app.js
175+ /[app-name-slug].app.mjs
172176 /actions
173177 /[action-name-slug]
174- /[action-name-slug].js
178+ /[action-name-slug].mjs
175179 /sources
176180 /[source-name-slug]
177- /[source-name-slug].js
181+ /[source-name-slug].mjs
178182` ` `
179183
180184- The name of each app folder corresponds with the name slug for each app
181185- The app file should be in the root of the app folder (e .g .,
182- ` /components/[app_slug]/[app_slug].app.js ` )
186+ ` /components/[app_slug]/[app_slug].app.mjs ` )
183187- Components for each app are organized into ` /sources ` and ` /actions `
184188 subfolders
185189- Each component should be placed in its own subfolder (with the name of the
186190 folder and the name of the ` js ` file equivalent to the slugified component
187191 name ). For example , the path for the " Search Mentions" source for Twitter is
188- ` /components/twitter/sources/search-mentions/search-mentions.js ` .
192+ ` /components/twitter/sources/search-mentions/search-mentions.mjs ` .
189193- Aside from ` app_slug ` , words in folder and file names are separated by dashes
190194 (-) (i.e., in kebab case)
195+ - Common files (e.g., ` common.mjs ` , ` utils.mjs ` ) must be placed within a common
196+ folder: ` /common/common.mjs ` .
191197
192198You can explore examples in the [ components
193199directory] ( https://github.com/PipedreamHQ/pipedream/tree/master/components ) .
@@ -329,7 +335,7 @@ If users are required to enter sensitive data, always use
329335
330336App files contain components that declare the app and include prop definitions
331337and methods that may be reused across components. App files should adhere to the
332- following naming convention: ` [app_name_slug].app.js ` . If an app file does not
338+ following naming convention: ` [app_name_slug].app.mjs ` . If an app file does not
333339exist for your app, please [ reach
334340out] ( https://pipedream.com/community/c/dev/11 ) .
335341
@@ -402,18 +408,20 @@ with this approach is that it increases complexity for end-users who have the
402408option of customizing the code for components within Pipedream. When using this
403409approach, the general pattern is:
404410
405- - The ` .app.js ` module contains the logic related to making the actual API calls
411+ - The ` .app.mjs ` module contains the logic related to making the actual API calls
406412 (e.g. calling ` axios.get ` , encapsulate the API URL and token, etc).
407- - The ` common.js ` module contains logic and structure that is not specific to
413+ - The ` common.mjs ` module contains logic and structure that is not specific to
408414 any single component. Its structure is equivalent to a component, except that
409415 it doesn't define attributes such as ` version ` , ` dedupe ` , ` key ` , ` name ` , etc
410416 (those are specific to each component). It defines the main logic/flow and
411417 relies on calling its methods (which might not be implemented by this
412418 component) to get any necessary data that it needs. In OOP terms, it would be
413419 the equivalent of a base abstract class.
414- - The component module of each action would inherit/extend the ` common.js `
420+ - The component module of each action would inherit/extend the ` common.mjs `
415421 component by setting additional attributes (e.g. ` name ` , ` description ` , ` key ` ,
416422 etc) and potentially redefining any inherited methods.
423+ - Common files (e.g., ` common.mjs ` , ` utils.mjs ` ) must be placed within a common
424+ folder: ` /common/common.mjs ` .
417425
418426See [ Google
419427Drive] ( https://github.com/PipedreamHQ/pipedream/tree/master/components/google_drive )
@@ -424,15 +432,13 @@ Please note that the name `common` is just a convention and depending on each
424432case it might make sense to name any common module differently. For example, the
425433[ AWS
426434sources] ( https://github.com/PipedreamHQ/pipedream/tree/master/components/aws )
427- contains a ` common ` directory instead of a ` common.js ` file, and the directory
435+ contains a ` common ` directory instead of a ` common.mjs ` file, and the directory
428436contains several modules that are shared between different event sources.
429437
430438## Props
431439
432- As a general rule of thumb, we should strive to only incorporate the 3-4 most
433- relevant options from a given API as props. This is not a hard limit, but the
434- goal is to optimize for usability. We should aim to solve specific use cases as
435- simply as possible.
440+ As a general rule of thumb, we should strive to incorporate all
441+ relevant options from a given API as props.
436442
437443### Labels
438444
@@ -445,7 +451,7 @@ but its label is set to “Search Term”.
445451
446452### Descriptions
447453
448- Include a description for [ props] ( /components/contributing/api/#user-input-props ) if it helps
454+ Include a description for [ props] ( /components/contributing/api/#user-input-props ) to help
449455the user understand what they need to do. Use Markdown as appropriate to improve
450456the clarity of the description or instructions. When using Markdown:
451457
@@ -781,6 +787,10 @@ know the content being returned is likely to be large – e.g. files — don't
781787export the full content . Consider writing the data to the ` /tmp ` directory and
782788exporting a reference to the file.
783789
790+ ## Miscellaneous
791+
792+ - Use camelCase for all props, method names, and variables.
793+
784794## Database Components
785795
786796Pipedream supports a special category of apps called [ "databases"] ( /workflows/data-management/databases/ ) ,
0 commit comments