Skip to content
Open
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/beige-chicken-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'hive': patch
---

handle escaped single-quoted strings in schema changes
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class Inspector {
async diff(existing: GraphQLSchema, incoming: GraphQLSchema) {
this.logger.debug('Comparing Schemas');

const changes = await diff(existing, incoming);
const changes = await diff(existing, incoming, undefined, { escapeSingleQuotes: true });

return changes
.filter(dropTrimmedDescriptionChangedChange)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ import { CheckCircledIcon, InfoCircledIcon } from '@radix-ui/react-icons';
import { Link } from '@tanstack/react-router';

export function labelize(message: string) {
// Turn " into '
// Replace '...' with <Label>...</Label>
return reactStringReplace(message.replace(/"/g, "'"), /'([^']+)'/gim, (match, i) => {
return <Label key={i}>{match}</Label>;
});
// Replace '...' and "..." with <Label>...</Label>
return reactStringReplace(message.replace(/"/g, "'"), /'((?:[^'\\]|\\.)+?)'/g, (match, i) => (
<Label key={i}>{match.replace(/\\'/g, "'")}</Label>
));
}

const severityLevelMapping = {
Expand Down
Loading