The attack needs to be mandatory & immediate.
"As part of the same action, you can make a melee or ranged attack..."
So if I choose not to make that attack, the transformed "ally" remains a weapon? New plan: cast charm person on my enemy, convince them to help me fight someone, cast this spell on them, store the transformed weapon in a box, bury the box in the woods, and move on with my life.
- Change "you can make a melee or ranged attack" to "you then make a melee or ranged attack". As mentioned above, the attack needs to happen immediately.
- Change "against a creature within 30 ft. of you" to "against a valid target". Let the existing rules for making weapon attacks handle determining range, etc. This means you then need to specify a range for the thrown property, though!
- Change "The damage is appropriate to the form of the weapon" to "You choose whether the damage is piercing, slashing, or bludgeoning when you cast this spell". It's better to specify this directly rather than try to inherit it from the shaped weapon, since you risk people trying to pull in additional weapon properties if those ever get added (whips in particular tend to end up with funky special rules in most editions of D&D).
- Change "within 5 ft of the target of the attack" into "in an unoccupied space as close as possible to the target of the transformed creature's choice". This resolves issues with the target already being surrounded by creatures, and gives your friend a little extra incentive to let you throw them around, since they'll get to choose where they end up.
It feels a little weak if used normally.
This spell has 2 core effects: it lets you make an attack for 1d8 damage with a stat that probably isn't your best one, and it teleports an adjacent ally to the target of your attack.
The teleport effect is potentially nice, but has enough limitations (ally has to be adjacent to you, range limit, not actually a teleport) that it doesn't pull its weight on its own as a level 1 spell.
The damage, in turn, is almost the bare minimum possible. Sure, it's not a d4 or a d6, but the use of Str or Dex rather than your casting stat means you're less likely to hit and get less static damage.
For comparison, consider the 1st level spell catapult from Xanathar's Guide to Everything. It launches an object of your choice (with weight limits) within 60 ft of you up to 90 ft at a target, who must make a Dex save or take 3d8 damage. Compared to that spell, the only thing friend blade has going for it is saving your ally a round of walking.
Remember, any round you cast this spell is a round you didn't cast fire bolt for 1d10 (or more, at higher levels) damage with a 120 ft range.
I would recommend either looking to make this spell more reliable, or make it more of a high-risk/high-reward option (with the ally-teleport as a consolation prize if you miss). You have three dials you can turn to adjust these: whether the attack is a spell attack (using the caster's spellcasting attribute) or a weapon attack (using the better of Str/Dex), how much damage it deals, and what the thrown range is.
For example, you could leave it as a weapon attack, up the damage, to 2d12 or so, and give the thrown modifier a range of (15/60). That means the caster can potentially move their ally a good distance, with the added bonus of a low-but-not-zero chance of doing some good damage.
Alternately, you might change it to a spell attack, bump the damage to 1d10 or 2d6, and give the thrown modifier a range of (45/45). That gets you fire bolt damage, trading a bit of range (which isn't needed in most encounters) for a useful effect of moving your ally farther than they could likely go in one round without Dashing.