From 4fd0d3a335b39dc0c44e78a0416bb7dfe900c2ea Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 12:32:45 +0300 Subject: [PATCH] chore(deps): update dependency content-tag to v3 (#6667) * chore(deps): update dependency content-tag to v3 * Let's go --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Arda TANRIKULU --- .changeset/mean-deers-divide.md | 5 +++++ packages/graphql-tag-pluck/package.json | 2 +- packages/graphql-tag-pluck/src/index.ts | 7 ++++++- yarn.lock | 8 ++++---- 4 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 .changeset/mean-deers-divide.md diff --git a/.changeset/mean-deers-divide.md b/.changeset/mean-deers-divide.md new file mode 100644 index 00000000000..4ccdd9a40c6 --- /dev/null +++ b/.changeset/mean-deers-divide.md @@ -0,0 +1,5 @@ +--- +'@graphql-tools/graphql-tag-pluck': patch +--- + +Support content-tag v3 and support older versions diff --git a/packages/graphql-tag-pluck/package.json b/packages/graphql-tag-pluck/package.json index c251e957c96..d5b175aee49 100644 --- a/packages/graphql-tag-pluck/package.json +++ b/packages/graphql-tag-pluck/package.json @@ -66,7 +66,7 @@ "@types/babel__traverse": "7.20.6", "@vue/compiler-sfc": "3.5.13", "astrojs-compiler-sync": "^1.0.0", - "content-tag": "^2.0.1", + "content-tag": "^3.0.0", "svelte": "5.5.3", "svelte2tsx": "0.7.30" }, diff --git a/packages/graphql-tag-pluck/src/index.ts b/packages/graphql-tag-pluck/src/index.ts index 90405b0cab6..5affe6b95b3 100644 --- a/packages/graphql-tag-pluck/src/index.ts +++ b/packages/graphql-tag-pluck/src/index.ts @@ -201,7 +201,12 @@ function parseWithAstroSync( function transformGlimmerFile(glimmerSyntax: typeof import('content-tag'), fileData: string) { const processor = new glimmerSyntax.Preprocessor(); - return processor.process(fileData); + // backwards compatibility with older versions of content-tag + const result = processor.process(fileData); + if (typeof result === 'string') { + return result; + } + return result.code; } /** diff --git a/yarn.lock b/yarn.lock index f8c37c3edf8..c5188617740 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4864,10 +4864,10 @@ content-disposition@0.5.4: dependencies: safe-buffer "5.2.1" -content-tag@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/content-tag/-/content-tag-2.0.3.tgz#52b72285256ae0aa49e86b1b5923764df472d61c" - integrity sha512-htLIdtfhhKW2fHlFLnZH7GFzHSdSpHhDLrWVswkNiiPMZ5uXq5JfrGboQKFhNQuAAFF8VNB2EYUj3MsdJrKKpg== +content-tag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/content-tag/-/content-tag-3.0.0.tgz#b25382edf6c46abf79e6bffb83c2118713af546e" + integrity sha512-HxWPmF9hzehv5PV7TSK7QSzlVBhmwQA8NgBrXmL+fqXfM3L1r3ResAPzeiGbxra3Zw6U3gdhw3cIDJADQnuCVQ== content-type@~1.0.4, content-type@~1.0.5: version "1.0.5"