From e2eebcca8332a3ec8ea4a77e48d3461f90e82253 Mon Sep 17 00:00:00 2001 From: Murderlon Date: Tue, 7 May 2024 11:25:44 +0200 Subject: [PATCH 1/3] @transloadit/enrich-tweet: use dynamic import to fix build --- packages/enrich-tweet/src/enrichTweet.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/enrich-tweet/src/enrichTweet.ts b/packages/enrich-tweet/src/enrichTweet.ts index cbb747b..3e64c2d 100644 --- a/packages/enrich-tweet/src/enrichTweet.ts +++ b/packages/enrich-tweet/src/enrichTweet.ts @@ -1,8 +1,6 @@ import twttr = require('twitter-text') import tall = require('tall') -import getUrls = require('get-urls') - async function tryUnshorten(url: string, unshorten: boolean): Promise { if (!unshorten) return url try { @@ -64,6 +62,7 @@ export = async function enrichTweet(tweet: Tweet, unshorten = true): Promise Date: Tue, 7 May 2024 12:51:04 +0200 Subject: [PATCH 2/3] Use ts-fly --- package.json | 6 +++--- yarn.lock | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 656b615..98d3ba9 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,8 @@ "lint:ts": "lerna run tsc", "new": "sucrase-node new.ts", "pub": "npm-run-all test lernaPublish", - "test": "node -r sucrase/register --test packages/**/*.test.ts", - "test:watch": "node -r sucrase/register --test --watch packages/**/*.test.ts" + "test": "node -r @transloadit/ts-fly --test packages/**/*.test.ts", + "test:watch": "node -r @transloadit/ts-fly --test --watch packages/**/*.test.ts" }, "dependencies": { "execa": "5.1.1", @@ -27,6 +27,7 @@ "replace": "1.2.2" }, "devDependencies": { + "@transloadit/ts-fly": "^0.1.5", "@types/node": "^20.12.6", "@typescript-eslint/eslint-plugin": "^7.6.0", "@typescript-eslint/parser": "^7.6.0", @@ -48,7 +49,6 @@ "npm-run-all": "^4.1.5", "prettier": "^3.2.5", "prettier-plugin-packagejson": "^2.4.14", - "sucrase": "^3.35.0", "typescript": "^5.4.4" }, "packageManager": "yarn@4.0.1+sha224.ca5d6f5a8aecd0801adc32f775675b01961bdc2383867d36f4732a0a", diff --git a/yarn.lock b/yarn.lock index c31f999..cc57b71 100644 --- a/yarn.lock +++ b/yarn.lock @@ -910,6 +910,18 @@ __metadata: languageName: unknown linkType: soft +"@transloadit/ts-fly@npm:^0.1.5": + version: 0.1.5 + resolution: "@transloadit/ts-fly@npm:0.1.5" + dependencies: + pirates: "npm:^4.0.5" + sucrase: "npm:^3.32.0" + bin: + ts-fly: ./bin/ts-fly + checksum: 480bf053c46b0d3f94ecd54a8140ab7c6f5e6241967cfe208792b0bf1aff9675c604859692c7022ed5df89fa0ea1e6782a7f12df78e9098d7adc48a7f291c252 + languageName: node + linkType: hard + "@tufjs/canonical-json@npm:1.0.0": version: 1.0.0 resolution: "@tufjs/canonical-json@npm:1.0.0" @@ -5570,6 +5582,7 @@ __metadata: version: 0.0.0-use.local resolution: "monolib@workspace:." dependencies: + "@transloadit/ts-fly": "npm:^0.1.5" "@types/node": "npm:^20.12.6" "@typescript-eslint/eslint-plugin": "npm:^7.6.0" "@typescript-eslint/parser": "npm:^7.6.0" @@ -5595,7 +5608,6 @@ __metadata: prettier: "npm:^3.2.5" prettier-plugin-packagejson: "npm:^2.4.14" replace: "npm:1.2.2" - sucrase: "npm:^3.35.0" typescript: "npm:^5.4.4" languageName: unknown linkType: soft @@ -6626,7 +6638,7 @@ __metadata: languageName: node linkType: hard -"pirates@npm:^4.0.1": +"pirates@npm:^4.0.1, pirates@npm:^4.0.5": version: 4.0.6 resolution: "pirates@npm:4.0.6" checksum: 00d5fa51f8dded94d7429700fb91a0c1ead00ae2c7fd27089f0c5b63e6eca36197fe46384631872690a66f390c5e27198e99006ab77ae472692ab9c2ca903f36 @@ -7752,7 +7764,7 @@ __metadata: languageName: node linkType: hard -"sucrase@npm:^3.35.0": +"sucrase@npm:^3.32.0": version: 3.35.0 resolution: "sucrase@npm:3.35.0" dependencies: From 21bb40a02d668503b1c9b4060ad8dd27cdb88b83 Mon Sep 17 00:00:00 2001 From: Murderlon Date: Tue, 7 May 2024 12:55:47 +0200 Subject: [PATCH 3/3] Also change new command --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 98d3ba9..16a2152 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,8 @@ "lint:formatting": "prettier --check .", "lint:js": "eslint . --ext .js,.jsx,.ts,.tsx", "lint:ts": "lerna run tsc", - "new": "sucrase-node new.ts", - "pub": "npm-run-all test lernaPublish", + "new": "ts-fly new.ts", + "pub": "npm-run-all build test lernaPublish", "test": "node -r @transloadit/ts-fly --test packages/**/*.test.ts", "test:watch": "node -r @transloadit/ts-fly --test --watch packages/**/*.test.ts" },