Skip to content

media-proxy-pass refactor#568

Merged
willnjl merged 19 commits into
feature/media-proxy-passfrom
feature/media-proxy-pass-pull-db
Jun 2, 2026
Merged

media-proxy-pass refactor#568
willnjl merged 19 commits into
feature/media-proxy-passfrom
feature/media-proxy-pass-pull-db

Conversation

@willnjl

@willnjl willnjl commented May 27, 2026

Copy link
Copy Markdown

#531 Refactor

  • add a getter util function to fetch values from the smash config
  • add a getter util function for handling the staging url handle variations such as // https://
  • ts lint error fixes
  • tidy up index.js
  • removes --skip-columns=guid as not needed with proxy pass

Diff with less annoying whitespace changes

@changeset-bot

changeset-bot Bot commented May 27, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 55ccec3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@daviddarke daviddarke requested a review from mikeybinns May 27, 2026 15:26
@willnjl willnjl marked this pull request as draft May 27, 2026 15:27
@willnjl willnjl changed the title create config getter and refactor db pull and toggle media to use it media-proxy-pass refactor May 28, 2026
@willnjl willnjl marked this pull request as ready for review May 28, 2026 13:17

@mikeybinns mikeybinns left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a couple minor points I missed previously, everything else looks good.

import { getSmashConfig, getStagingUrl } from "@atomicsmash/smash-config";

const PROXY_MARKER = "location @uploadsproxy";
const isWindows = type() === "Darwin";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isWindows here is actually isMacOS because Darwin is MacOS. I know this isn't something you wrote but we may as well fix it while we're here.

});

export async function getSmashConfig(): Promise<Required<SmashConfig> | null> {
export default async function getSmashConfig(): Promise<Required<SmashConfig> | null> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer named import/exports for better interoperability with tooling. Usually (e.g. within projects) it wouldn't matter, but because this is a npm library it does.

@@ -0,0 +1,8 @@
import type { SmashConfig } from "../index.js";

export default function getStagingUrl(config: SmashConfig): string {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer named import/exports, see above

Comment thread packages/smash-config/src/index.ts Outdated
Comment on lines +3 to +4
export { default as getStagingUrl } from "./utils/getStagingUrl.js";
export { default as getSmashConfig } from "./utils/getSmashConfig.js";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer named import/exports, see above

@willnjl willnjl merged commit 2e968a8 into feature/media-proxy-pass Jun 2, 2026
3 checks passed
@willnjl willnjl deleted the feature/media-proxy-pass-pull-db branch June 2, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants