Run npm install && npm run build && pd publish dist/main.js to try it out.
This example also uses @planet-a/parcel-optimizer-versioned-imports to version imports when possible.
| node_modules | |
| .parcel-cache | |
| dist |
| { | |
| "ignoreSubmoduleImports": true | |
| } |
| { | |
| "extends": "@parcel/config-default", | |
| "optimizers": { | |
| "*.{js,mjs}": [ | |
| "...", | |
| "@planet-a/parcel-optimizer-versioned-imports" | |
| ] | |
| } | |
| } |
Run npm install && npm run build && pd publish dist/main.js to try it out.
This example also uses @planet-a/parcel-optimizer-versioned-imports to version imports when possible.
| import { defineAction } from "@pipedream/types"; | |
| import assert from "node:assert"; | |
| export default defineAction({ | |
| name: "My Action", | |
| version: "0.0.1", | |
| key: "my-key", | |
| description: "Example", | |
| props: {}, | |
| type: "action", | |
| methods: {}, | |
| async run(options) { | |
| assert(options); | |
| const { $ } = options; | |
| $.export("$summary", ":tada:"); | |
| $.export("hello", "world"); | |
| }, | |
| }); |
| { | |
| "name": "@your/package", | |
| "version": "1.0.0", | |
| "source": "index.ts", | |
| "main": "dist/main.js", | |
| "types": "dist/main.d.ts", | |
| "private": true, | |
| "type": "module", | |
| "scripts": { | |
| "watch": "parcel watch", | |
| "prebuild": "rimraf dist .parcel-cache", | |
| "build": "parcel build --log-level=verbose" | |
| }, | |
| "dependencies": { | |
| "@pipedream/types": "^0.3.0" | |
| }, | |
| "devDependencies": { | |
| "@parcel/packager-ts": "2.12.0", | |
| "@parcel/transformer-typescript-types": "2.12.0", | |
| "@planet-a/parcel-optimizer-versioned-imports": "^0.0.3", | |
| "@types/node": "^22.9.0", | |
| "parcel": "^2.12.0", | |
| "rimraf": "^6.0.1", | |
| "typescript": "^5.4.5" | |
| } | |
| } |
| { | |
| "compilerOptions": { | |
| "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ | |
| "target": "ES2020", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ | |
| "lib": ["ES2020"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ | |
| "module": "ES2020", /* Specify what module code is generated. */ | |
| "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ | |
| "outDir": "dist", /* Specify an output folder for all emitted files. */ | |
| "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ | |
| "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ | |
| "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ | |
| "strict": true, /* Enable all strict type-checking options. */ | |
| "skipLibCheck": true /* Skip type checking all .d.ts files. */ | |
| } | |
| } |