Skip to content

Commit df764e4

Browse files
committed
fix: stabilize e2e tooling paths
1 parent 69963f9 commit df764e4

4 files changed

Lines changed: 25 additions & 15 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
TRANSLOADIT_KEY: ${{ secrets.TRANSLOADIT_KEY }}
112112
TRANSLOADIT_SECRET: ${{ secrets.TRANSLOADIT_SECRET }}
113113
NODE_OPTIONS: --trace-deprecation --trace-warnings
114-
CLOUDFLARED_PATH: ../cloudflared-linux-amd64
114+
CLOUDFLARED_PATH: ${{ github.workspace }}/cloudflared-linux-amd64
115115
DEBUG: 'transloadit:*'
116116

117117
- name: Generate the badge from the json-summary

packages/node/test/e2e/cli/test-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export function runCli(
6060
args: string,
6161
env: Record<string, string> = {},
6262
): Promise<{ stdout: string; stderr: string }> {
63-
return execAsync(`npx tsx ${cliPath} ${args}`, {
63+
return execAsync(`${process.execPath} --experimental-strip-types ${cliPath} ${args}`, {
6464
env: { ...process.env, ...env },
6565
})
6666
}

packages/transloadit/package.json

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,7 @@
33
"version": "4.1.3",
44
"description": "Node.js SDK for Transloadit",
55
"type": "module",
6-
"keywords": [
7-
"transloadit",
8-
"encoding",
9-
"transcoding",
10-
"video",
11-
"audio",
12-
"mp3"
13-
],
6+
"keywords": ["transloadit", "encoding", "transcoding", "video", "audio", "mp3"],
147
"author": "Tim Koschuetzki <tim@transloadit.com>",
158
"packageManager": "yarn@4.12.0",
169
"engines": {
@@ -87,9 +80,6 @@
8780
".": "./dist/Transloadit.js",
8881
"./package.json": "./package.json"
8982
},
90-
"files": [
91-
"dist",
92-
"src"
93-
],
83+
"files": ["dist", "src"],
9484
"bin": "./dist/cli.js"
9585
}

scripts/prepare-transloadit.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,25 @@ const writeJson = async (filePath, data) => {
2727
await writeFile(filePath, json)
2828
}
2929

30+
const formatPackageJson = (data) => {
31+
let json = JSON.stringify(data, null, 2)
32+
const inlineArray = (key) => {
33+
const pattern = new RegExp(`"${key}": \\[\\n([\\s\\S]*?)\\n\\s*\\]`, 'm')
34+
return json.replace(pattern, (_match, inner) => {
35+
const values = inner
36+
.split('\n')
37+
.map((line) => line.trim())
38+
.filter(Boolean)
39+
.map((line) => line.replace(/,$/, ''))
40+
return `"${key}": [${values.join(', ')}]`
41+
})
42+
}
43+
44+
json = inlineArray('keywords')
45+
json = inlineArray('files')
46+
return `${json}\n`
47+
}
48+
3049
const writeLegacyPackageJson = async () => {
3150
const nodePackageJson = await readJson(resolve(nodePackage, 'package.json'))
3251
const scripts = { ...(nodePackageJson.scripts ?? {}) }
@@ -37,7 +56,8 @@ const writeLegacyPackageJson = async () => {
3756
scripts,
3857
}
3958

40-
await writeJson(resolve(legacyPackage, 'package.json'), legacyPackageJson)
59+
const formatted = formatPackageJson(legacyPackageJson)
60+
await writeFile(resolve(legacyPackage, 'package.json'), formatted)
4161
}
4262

4363
const writeLegacyChangelog = async () => {

0 commit comments

Comments
 (0)