Skip to content

Commit c9006e8

Browse files
committed
[BUG] Fix packages with Import failure
1 parent a5a1152 commit c9006e8

File tree

16 files changed

+126
-248
lines changed

16 files changed

+126
-248
lines changed

components/google_tag_manager/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "@pipedream/google_tag_manager",
33
"version": "0.1.0",
44
"description": "Pipedream Google Tag Manager Components",
5+
"main": "google_tag_manager.app.mjs",
56
"keywords": [
67
"pipedream",
78
"google_tag_manager"
@@ -12,6 +13,6 @@
1213
"access": "public"
1314
},
1415
"dependencies": {
15-
"@pipedream/platform": "^1.5.1"
16+
"@pipedream/platform": "^3.1.0"
1617
}
1718
}

components/netlify/netlify.app.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import {
44
createHash,
55
} from "crypto";
66
import jwt from "jwt-simple";
7-
import { NetlifyAPI } from "netlify";
7+
import pkg from "netlify";
8+
const { NetlifyAPI } = pkg;
89
import parseLinkHeader from "parse-link-header";
910

1011
export default {

components/netlify/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"homepage": "https://pipedream.com/apps/netlify",
1111
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
1212
"dependencies": {
13-
"@pipedream/platform": "^1.4.0",
13+
"@pipedream/platform": "^3.1.0",
1414
"jwt-simple": "^0.5.6",
1515
"netlify": "^6.0.9",
1616
"parse-link-header": "^2.0.0"

components/pdfless/pdfless.app.mjs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
import {
2-
PdfService,
3-
TemplateService,
4-
} from "@pdfless/pdfless-js";
1+
// Using dynamic import to avoid ES module compatibility issues
2+
let PdfService, TemplateService;
3+
4+
const initializeServices = async () => {
5+
if (!PdfService || !TemplateService) {
6+
const pdflessModule = await import("@pdfless/pdfless-js");
7+
PdfService = pdflessModule.PdfService;
8+
TemplateService = pdflessModule.TemplateService;
9+
}
10+
};
511

612
export default {
713
type: "app",
@@ -24,17 +30,19 @@ export default {
2430
},
2531
methods: {
2632
async listTemplatesOpts(page) {
33+
await initializeServices();
2734
const templateService = new TemplateService(this.$auth.api_key);
2835
const templates = await templateService.list(page);
2936
return templates.map((template) => ({
3037
label: template.name,
3138
value: template.id,
3239
}));
3340
},
34-
generate({
41+
async generate({
3542
templateId,
3643
payload,
3744
}) {
45+
await initializeServices();
3846
const pdfService = new PdfService(this.$auth.api_key);
3947
const generatePDFCommand = {
4048
template_id: templateId,

components/playwright/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"access": "public"
1414
},
1515
"dependencies": {
16+
"@pipedream/types": "^0.3.2",
1617
"@sparticuz/chromium": "121.0.0",
1718
"playwright-core": "1.41.2"
1819
}

components/playwright/playwright.app.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { defineApp } from "@pipedream/types";
33
// can be found here: https://www.browserstack.com/docs/automate/playwright/browsers-and-os
44
// The reason why playwright is locked to an old version is because
55
// the latest Puppeeter Chromium version that works in a code step is chromium@112
6-
import { chromium as playwright } from "playwright-core@1.41.2";
7-
import chromium from "@sparticuz/chromium@121.0.0";
6+
import { chromium as playwright } from "playwright-core";
7+
import chromium from "@sparticuz/chromium";
88

99
export default defineApp({
1010
type: "app",

components/puppeteer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"access": "public"
1414
},
1515
"dependencies": {
16-
"@pipedream/platform": "^1.5.1",
16+
"@pipedream/platform": "^3.1.0",
1717
"@sparticuz/chromium": "121.0.0",
1818
"puppeteer-core": "21.11.0"
1919
}

components/puppeteer/puppeteer.app.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Table for Chromium <> Puppeteer version support here: https://pptr.dev/chromium-support
22
// @note: this is locked to an old chromium version
33
// because there's an unfulfilled promise bug in later version of puppeteer-core
4-
import puppeteer from "puppeteer-core@21.11.0";
5-
import chromium from "@sparticuz/chromium@121.0.0";
4+
import puppeteer from "puppeteer-core";
5+
import chromium from "@sparticuz/chromium";
66

77
export default {
88
type: "app",

components/shortcut/actions/create-story/create-story.js renamed to components/shortcut/actions/create-story/create-story.mjs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
const shortcut = require("../../shortcut.app");
2-
const get = require("lodash/get");
3-
const validate = require("validate.js");
4-
const utils = require("../../utils");
5-
const constants = require("../../constants");
1+
import shortcut from "../../shortcut.app.mjs";
2+
import lodash from "lodash";
3+
import validate from "validate.js";
4+
import utils from "../../common/utils.mjs";
5+
import constants from "../../common/constants.mjs";
66

7-
module.exports = {
7+
export default {
88
key: "shortcut-create-story",
99
name: "Create Story",
1010
description: "Creates a new story in your Shortcut account. See [Create Story](https://shortcut.com/api/rest/v3#Create-Story) in Shortcut Rest API, V3 reference for endpoint documentation.",
11-
version: "0.0.1",
11+
version: "1.0.0",
1212
type: "action",
1313
props: {
1414
shortcut,
@@ -58,7 +58,7 @@ module.exports = {
5858
async options() {
5959
let options = [];
6060
const epics = await this.shortcut.callWithRetry("listEpics");
61-
const isEpicDataAvailable = get(epics, [
61+
const isEpicDataAvailable = lodash.get(epics, [
6262
"data",
6363
"length",
6464
]);
@@ -100,7 +100,7 @@ module.exports = {
100100
async options() {
101101
let options = [];
102102
const files = await this.shortcut.callWithRetry("listFiles");
103-
const isFileDataAvailable = get(files, [
103+
const isFileDataAvailable = lodash.get(files, [
104104
"data",
105105
"length",
106106
]);
@@ -131,7 +131,7 @@ module.exports = {
131131
async options() {
132132
let options = [];
133133
const iterations = await this.shortcut.callWithRetry("listIterations");
134-
const isIterationDataAvailable = get(iterations, [
134+
const isIterationDataAvailable = lodash.get(iterations, [
135135
"data",
136136
"length",
137137
]);
@@ -161,7 +161,7 @@ module.exports = {
161161
async options() {
162162
let options = [];
163163
const linkedFiles = await this.shortcut.callWithRetry("listLinkedFiles");
164-
const isLinkedFilesDataAvailable = get(linkedFiles, [
164+
const isLinkedFilesDataAvailable = lodash.get(linkedFiles, [
165165
"data",
166166
"length",
167167
]);
@@ -197,7 +197,7 @@ module.exports = {
197197
async options() {
198198
let options = [];
199199
const projects = await this.shortcut.callWithRetry("listProjects");
200-
const isProjectDataAvailable = get(projects, [
200+
const isProjectDataAvailable = lodash.get(projects, [
201201
"data",
202202
"length",
203203
]);
@@ -261,15 +261,15 @@ module.exports = {
261261
async options() {
262262
let options = [];
263263
const workflows = await this.shortcut.callWithRetry("listWorkflows");
264-
const isWorkflowDataAvailable = get(workflows, [
264+
const isWorkflowDataAvailable = lodash.get(workflows, [
265265
"data",
266266
"length",
267267
]);
268268
if (!isWorkflowDataAvailable) {
269269
return options;
270270
}
271271
return workflows.data.reduce(function (options, workflow) {
272-
const hasState = get(workflow, [
272+
const hasState = lodash.get(workflow, [
273273
"states",
274274
"length",
275275
]);

components/shortcut/actions/search-stories/search-stories.js renamed to components/shortcut/actions/search-stories/search-stories.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
const shortcut = require("../../shortcut.app");
1+
import shortcut from "../../shortcut.app.mjs";
22

3-
module.exports = {
3+
export default {
44
key: "shortcut-search-stories",
55
name: "Search Stories",
66
description: "Searches for stories in your Shortcut account.",
7-
version: "0.0.1",
7+
version: "1.0.0",
88
type: "action",
99
props: {
1010
shortcut,

0 commit comments

Comments
 (0)