pd-convert-actions's People
pd-convert-actions's Issues
Strip leading / trailing whitespace in component/prop descriptions
SyntaxError: Named export 'foo' not found. The requested module 'bar' is a CommonJS module
, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'bar';
const { foo } = pkg;
Suggestion: Import CommonJS modules that don't support named exports via the default export.
Convert "@pipedreamhq/platform" to "@pipedream/platform"
- Convert
require("@pipedreamhq/platform")
torequire("@pipedream/platform")
- Pass
$
as the first argument of@pipedream/platform
axios
For example:
Before
return await require("@pipedreamhq/platform").axios(this, {
After
async run({ $ }) {
return await require("@pipedream/platform").axios($, {
Convert Pipedream primitives to $ functions
$send
->$.send
$respond
->$.respond
$end
->$.flow.exit
Component action docs: https://pipedream.com/docs/components/api/#actions
Support conversion of non-app actions
Currently, legacy actions must include a namespace, title, description, version, code_config, code_raw, and hashId to be converted to a component action.
Support converting legacy actions from only the code_raw so that code steps in workflows can be converted using only the code. Allow the other parameters to be optional.
Convert param enum to prop options
E.g.
"enum":["html"","markdown"]
-> options: ["html", "markdown"]
Convert this.$checkpoint to this.db
When a legacy code contains this.$checkpoint
:
- Convert
this.$checkpoint
tothis.db
- Add a
db
prop to the components props
Props are missing labels
For example:
pd-convert-actions/examples/track.after.js
Lines 12 to 16 in 2c02d52
In the legacy workflow builder, this prop's label is "AnonymousId`:
pd-convert-actions/examples/add_or_update_subscriber.after.js
Lines 25 to 28 in 2c02d52
In the legacy workflow builder, this prop's label is "Email address"
:
Add unit/integration tests
Remove the "const axios = require('axios')" in cases where platform axios is used?
(eg. mailchimp-add_or_update_subscriber)
Remove the quotation marks around the action ID
E.g.
- // legacy_hash_id: "a_poikPY"
+ // legacy_hash_id: a_poikPY
Add comment with hash_id of legacy action to component code
Something like:
// Action converted from <hash_id>
or// old_action_id:a_abc123
Fix ESLint camel-case and unused-vars errors in generated code
Add option to convert code to ESM
This is low priority since components can be CommonJS, and ESM-only packages would have also broken legacy actions.
Convert legacy code cell variables
$attachments
->steps.trigger.context.attachments
steps
->steps
πevent
->steps.trigger.event
- $checkpoint (no replacement yet)
this.$checkpoint
[Bug] Reference error when a named export is reused in an action
In converted actions, references to named exports after $.export
are left unconverted (i.e., referencing a variable that was removed). For example:
In legacy action:
this.projects = [];
this.projects.push("project1");
return this.projects;
In converted action (error β):
$.export("projects", []);
this.projects.push("project1");
return this.projects;
Desired β :
let projects = [];
projects.push("project1");
$.export("projects", projects);
return projects;
Add option to remove defineComponent from generated code
Add shared props and code to app or common files from generated actions
Should the app slug be removed from the namespace?
In actions.csv, the DEFAULT_NAMESPACE
for the Cloudinary app's Upload Media Asset action is cloudinary_upload_media_asset
. The app slug (cloudinary
) is included in the namespace.
Which should the generated component key for this action be?
key: "cloudinary-cloudinary_upload_media_asset"
orkey: "cloudinary-upload_media_asset"
The latter follows Pipedream's component key pattern guidelines.
Don't include the description key in generated actions when it's an empty string
ESLint errors in converted actions - pipedream/props-label & pipedream/props-description
Errors:
-
Component prop cells must have a label. See https://pipedream.com/docs/components/guidelines/#props
eslint(pipedream/props-label)
Reason: Component props are generated without labels -
Component prop cells must have a description. See https://pipedream.com/docs/components/guidelines/#props
eslint (pipedream/props-description)
Reason: Some action params are missing descriptions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.