Comments (8)
For anyone looking to get Typescript support - you can get it by compiling your TS into a commonjs module, then uploading that to pipedream via cli. Something like this:
// myAction.ts
export default {
name: "GBucket - Upload File",
description: "Uploads a file to a GBucket route",
key: "myGBucketUploader",
version: "1.0.0",
type: "action",
props: {
googleCloud: { // passed in app object https://pipedream.com/docs/apps/all-apps/#apps
type: "app",
app: "google_cloud",
},
webhookTrigger: { // passed in param https://pipedream.com/docs/workflows/steps/params/#entering-expressions
type: "object",
},
},
async run() {
// access your passed in variables, which can come from a previous code step
const { myData } = (this as any).webhookTrigger.object;
// access your auth passed in from apps
const { Storage } = require("@google-cloud/storage");
const key = JSON.parse((this as any).googleCloud.$auth.key_json);
const storage = new Storage({
projectId: key.project_id,
credentials: {
client_email: key.client_email,
private_key: key.private_key,
},
});
await storage.upload(myData)
}
}
// rollup.config.js (or webpack.config.js)
const configAction = {
input: "src/actions/myAction.ts",
output: {
file: "lib/actions/myAction.js",
format: "cjs",
sourcemap: true,
exports: "default",
},
plugins: [
commonjs(), // enable CommonJS modules
nodePolyfills(), // enable NodeJS polyfills
resolve({ preferBuiltins: true, browser: true }), // enable importing from node_modules
typescript(), // enable TypeScript
json(), // enable JSON
globals(), // allows globals to be imported (process.env)
builtins(), // allows builtins to be imported via require/import
],
};
echo "Deploying Pipedream..."
yarn build
NODE_ENV=production pd publish ./lib/actions/myAction.js
Which will end up looking like re-useable action this in the Pipedream UI.
from pipedream.
@hhimanshu this isn't on the immediate roadmap, but we hear you and plan to add support for other languages like TypeScript in the future!
from pipedream.
Likewise
from pipedream.
Bumping 😃
from pipedream.
Hello @todsac, any plans for getting this prioritized?
from pipedream.
Typescript. Yes please.
Powered by Deno and able to define the type that the code block will receive would be 🎉
from pipedream.
Is there any news on this? It's been almost a year and the only other resource I can find is https://pipedream.com/docs/components/typescript which is a start but there's not a lot of movement: https://github.com/PipedreamHQ/pipedream/commits/master/types/src/index.ts ?
from pipedream.
For anyone interested in using Parcel for their build, here is a sample configuration: https://gist.github.com/joscha/bd630f90adaa0cb1ce2f9c4714ba3d7a
from pipedream.
Related Issues (20)
- [Components] summit
- [Components] leadiq
- [APP] Epson Connect HOT 1
- [APP] Responder HOT 1
- [FEATURE] HTTP triggers - add Match path requests prop to filter requests HOT 1
- tgmy HOT 1
- tgmy HOT 2
- tgmy HOT 1
- [ACTION] Unsplash - Search Photos, Get Photo
- [Components] pitchlane HOT 1
- [Components] appwrite
- [FEATURE] Helm Chart for k8s deployment HOT 1
- Brevo HOT 1
- [BUG] False positive for promisification with Cloudflare Images API
- [APP] Sailthru
- [Components] pidj
- [Components] keycloak
- [Components] insighto_ai
- [Components] kodagpt
- https://pipedream.com/apps/google-calendar HOT 1
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.
from pipedream.