Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/shaggy-peas-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'transloadit': patch
---

Publish the generated `transloadit` package with the home-credentials CLI support that already shipped in `@transloadit/node`.
11 changes: 11 additions & 0 deletions packages/node/test/unit/cli/auth-token.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { mkdtempSync, writeFileSync } from 'node:fs'
import { tmpdir } from 'node:os'
import path from 'node:path'
import { afterEach, describe, expect, it, vi } from 'vitest'
import { main } from '../../../src/cli.ts'

Expand Down Expand Up @@ -258,10 +261,18 @@ describe('cli auth token', () => {
})

it('fails when credentials are missing', async () => {
const emptyCredentialsFile = path.join(
mkdtempSync(path.join(tmpdir(), 'transloadit-auth-token-')),
'credentials',
)
writeFileSync(emptyCredentialsFile, '')

vi.stubEnv('TRANSLOADIT_KEY', '')
vi.stubEnv('TRANSLOADIT_SECRET', '')
vi.stubEnv('TRANSLOADIT_AUTH_KEY', '')
vi.stubEnv('TRANSLOADIT_AUTH_SECRET', '')
vi.stubEnv('TRANSLOADIT_AUTH_TOKEN', '')
vi.stubEnv('TRANSLOADIT_CREDENTIALS_FILE', emptyCredentialsFile)

const stderrSpy = vi.spyOn(console, 'error').mockImplementation(() => {})

Expand Down
22 changes: 20 additions & 2 deletions scripts/guard-changesets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type ParsedChangeset = {
const CHANGESET_DIR = path.join(process.cwd(), '.changeset')
const NODE_PKG = '@transloadit/node'
const MCP_SERVER_PKG = '@transloadit/mcp-server'
const TRANSLOADIT_PKG = 'transloadit'

async function listChangesetFiles(): Promise<string[]> {
let entries: string[]
Expand Down Expand Up @@ -74,11 +75,12 @@ async function main(): Promise<void> {
for (const pkg of cs.packages) touched.add(pkg)
}

// One-way coupling policy:
// Coupling policy:
// If @transloadit/node is being released, also release @transloadit/mcp-server
// so the published mcp-server versions stay "in sync" with node evolution.
// and the published transloadit clone so all three stay in sync.
const touchesNode = touched.has(NODE_PKG)
const touchesMcpServer = touched.has(MCP_SERVER_PKG)
const touchesTransloadit = touched.has(TRANSLOADIT_PKG)

if (touchesNode && !touchesMcpServer) {
fail(
Expand All @@ -95,6 +97,22 @@ async function main(): Promise<void> {
].join('\n'),
)
}

if (touchesNode && !touchesTransloadit) {
fail(
[
`Changeset policy violation: ${NODE_PKG} is being released, but ${TRANSLOADIT_PKG} is not.`,
'',
`Add a patch changeset for ${TRANSLOADIT_PKG} so npx users get the same CLI behavior as`,
`${NODE_PKG} users, including the generated transloadit package clone.`,
'',
'Example:',
' corepack yarn changeset',
` (select ${TRANSLOADIT_PKG} -> patch)`,
` Summary: "chore: release transloadit alongside @transloadit/node"`,
].join('\n'),
)
}
}

await main()
Loading