From c9eb223d7a826db860e4a85be4316b6b2b2b44dd Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Tue, 11 Jun 2024 16:57:40 +0100 Subject: [PATCH] fix(astro): handle symlinked content collection directories --- .changeset/fifty-clouds-clean.md | 5 +++ packages/astro/src/content/utils.ts | 40 ++++++++++++++++++ .../content/vite-plugin-content-imports.ts | 18 ++++++-- .../astro/test/content-collections.test.js | 22 ++++++++++ .../src/assets/the-future.jpg | Bin 0 -> 22792 bytes .../content-collections/src/content/config.ts | 23 +++++++++- .../src/content/with-symlinked-content | 1 + .../src/content/with-symlinked-data | 1 + .../src/pages/collections.json.js | 4 +- .../content-collection/first.md | 6 +++ .../content-collection/second.md | 6 +++ .../content-collection/third.md | 6 +++ .../data-collection/welcome.json | 4 ++ pnpm-lock.yaml | 1 - 14 files changed, 130 insertions(+), 7 deletions(-) create mode 100644 .changeset/fifty-clouds-clean.md create mode 100644 packages/astro/test/fixtures/content-collections/src/assets/the-future.jpg create mode 120000 packages/astro/test/fixtures/content-collections/src/content/with-symlinked-content create mode 120000 packages/astro/test/fixtures/content-collections/src/content/with-symlinked-data create mode 100644 packages/astro/test/fixtures/content-collections/symlinked-collections/content-collection/first.md create mode 100644 packages/astro/test/fixtures/content-collections/symlinked-collections/content-collection/second.md create mode 100644 packages/astro/test/fixtures/content-collections/symlinked-collections/content-collection/third.md create mode 100644 packages/astro/test/fixtures/content-collections/symlinked-collections/data-collection/welcome.json diff --git a/.changeset/fifty-clouds-clean.md b/.changeset/fifty-clouds-clean.md new file mode 100644 index 0000000000000..cb1c57811c595 --- /dev/null +++ b/.changeset/fifty-clouds-clean.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Supports symlinked content collection directories diff --git a/packages/astro/src/content/utils.ts b/packages/astro/src/content/utils.ts index b7a1175c0a318..3a71f2e1d0da4 100644 --- a/packages/astro/src/content/utils.ts +++ b/packages/astro/src/content/utils.ts @@ -167,6 +167,46 @@ export function getEntryConfigByExtMap> { + const contentPaths = new Map(); + const contentDirPath = fileURLToPath(contentDir); + + const contentDirEntries = await fsMod.promises.readdir(contentDir, { withFileTypes: true }); + for (const entry of contentDirEntries) { + if (entry.isSymbolicLink()) { + const entryPath = path.join(contentDirPath, entry.name); + const realPath = await fsMod.promises.realpath(entryPath); + contentPaths.set(realPath, entry.name); + } + } + return contentPaths; +} + +export function reverseSymlinks({ + entry, + symlinks, + contentDir, +}: { + entry: string | URL; + contentDir: string | URL; + symlinks?: Map; +}): string { + const entryPath = typeof entry === 'string' ? entry : fileURLToPath(entry); + const contentDirPath = typeof contentDir === 'string' ? contentDir : fileURLToPath(contentDir); + if (!symlinks) { + return entryPath; + } + + for (const [realPath, symlinkName] of symlinks) { + if (entryPath.startsWith(realPath)) { + return path.join(contentDirPath, symlinkName, entryPath.replace(realPath, '')); + } + } + return entryPath; +} + export function getEntryCollectionName({ contentDir, entry, diff --git a/packages/astro/src/content/vite-plugin-content-imports.ts b/packages/astro/src/content/vite-plugin-content-imports.ts index 2589a96294440..ffc3aa68feb8f 100644 --- a/packages/astro/src/content/vite-plugin-content-imports.ts +++ b/packages/astro/src/content/vite-plugin-content-imports.ts @@ -28,10 +28,12 @@ import { getEntryConfigByExtMap, getEntryData, getEntryType, + getSymlinkedContentCollections, globalContentConfigObserver, hasContentFlag, parseEntrySlug, reloadContentConfigObserver, + reverseSymlinks, } from './utils.js'; function getContentRendererByViteId( @@ -75,16 +77,26 @@ export function astroContentImportPlugin({ const dataEntryConfigByExt = getEntryConfigByExtMap(settings.dataEntryTypes); const { contentDir } = contentPaths; let shouldEmitFile = false; - + let symlinks: Map; const plugins: Plugin[] = [ { name: 'astro:content-imports', config(_config, env) { shouldEmitFile = env.command === 'build'; }, + async buildStart() { + // Get symlinks once at build start + symlinks = await getSymlinkedContentCollections(contentDir); + }, async transform(_, viteId) { if (hasContentFlag(viteId, DATA_FLAG)) { - const fileId = viteId.split('?')[0] ?? viteId; + // By default, Vite will resolve symlinks to their targets. We need to reverse this for + // content entries, so we can get the path relative to the content directory. + const fileId = reverseSymlinks({ + entry: viteId.split('?')[0] ?? viteId, + contentDir, + symlinks, + }); // Data collections don't need to rely on the module cache. // This cache only exists for the `render()` function specific to content. const { id, data, collection, _internal } = await getDataEntryModule({ @@ -109,7 +121,7 @@ export const _internal = { `; return code; } else if (hasContentFlag(viteId, CONTENT_FLAG)) { - const fileId = viteId.split('?')[0]; + const fileId = reverseSymlinks({ entry: viteId.split('?')[0], contentDir, symlinks }); const { id, slug, collection, body, data, _internal } = await getContentEntryModule({ fileId, entryConfigByExt: contentEntryConfigByExt, diff --git a/packages/astro/test/content-collections.test.js b/packages/astro/test/content-collections.test.js index 828e10940f381..fb518b261479e 100644 --- a/packages/astro/test/content-collections.test.js +++ b/packages/astro/test/content-collections.test.js @@ -98,6 +98,28 @@ describe('Content Collections', () => { subject: 'My Newsletter', }); }); + + it('Handles symlinked content', async () => { + assert.ok(json.hasOwnProperty('withSymlinkedContent')); + assert.equal(Array.isArray(json.withSymlinkedContent), true); + + const ids = json.withSymlinkedContent.map((item) => item.id); + assert.deepEqual(ids, ['first.md', 'second.md', 'third.md']); + assert.equal(json.withSymlinkedContent[0].data.title, 'First Blog'); + }); + + it('Handles symlinked data', async () => { + assert.ok(json.hasOwnProperty('withSymlinkedData')); + assert.equal(Array.isArray(json.withSymlinkedData), true); + + const ids = json.withSymlinkedData.map((item) => item.id); + assert.deepEqual(ids, ['welcome']); + assert.equal( + json.withSymlinkedData[0].data.alt, + 'Futuristic landscape with chrome buildings and blue skies' + ); + assert.notEqual(json.withSymlinkedData[0].data.src.src, undefined); + }); }); describe('Propagation', () => { diff --git a/packages/astro/test/fixtures/content-collections/src/assets/the-future.jpg b/packages/astro/test/fixtures/content-collections/src/assets/the-future.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e9caf02ab6ee318cdbfbcc70ac050e6d2cd36575 GIT binary patch literal 22792 zcmafZb95!ayX}c>+qRvFlZka=+cqY)CboToiESGb+qNd2x%u69?|Xl~-D`ENu3o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BqUKqtD_!kq4Gy0h0d*OwfP%mulW}`C4(g?aekj7UUYbofnuD5GjEYT3Gt?LWKVPBP>E#*!A+ zT38g<2G!1Z;k#zX7PT2))Nv`9PUZ>pnv-y6;*0@c3 z;N1NW5mtRkW%-ITeoNenQRUk=8;j8{nj+5YVPn=p-(eKmI77hD@RH$H6Y&1zF)@baZ!Q`Mjm&?mwyGJd46h zoSZBw(aj-cuW}i?^AU7zLy|*xrsRoD@+SL|coql4_9Md6YIq{3iu;b_mI;yV?nCxG zMfWdanHtTKm5f{>J<4QovRO={gnds!QcWHjT(VMb>hM_(<<@!fBOY9`#>X)@rES?M z#!1$m7^xeEShQSOpCU=M!L^PorZ~2kqUhTE&f|03(niLzByw#{qH#-%5yM2X)A&1& zfyPXXJkO`(ZEDfA`3?=68JeRb92**I_#p5%w%DHLL8pJojV1SCe;?SA_xA7oNv*Mp z^T`8a^Abq!lW}%!M;c#E^jlH$cq3{}*ZKJyUPlFKEQxv>Q#Qofidy=QM%kJ-G02O% zCBaP+@}b>T9v^>=5Yl{=FFW@df9?MOld!X8-V9r`Se|TptuIRGv82$F{CB5u=|^T$ z8f=a(%Cd?m*lhJStQ%0$DHB3Q#7;ED5~<+NeKX`_Ry*<&Xvvd0XY#H;CG;^5NoJOu z5_h5-u{2r`^v$y(l^f9)QAXwG*Ih}X*Wj}HY3brss`5Ted7bRBWsW6jV`x&+?V*;7 zMXxa=$EBjtWtLfNwp%Tk(!VVfIzwqjE4$D3Eh=y1mek8k`95^ES;>{`VTj5TM6x7N z6@(&5bXWRntz?~zt@wSv;SzW+%*Kg{k4vJ{L{+*J2O81cU|vH_b}E)de#2JE=&$q$ zqO{|oq|J>xzxYx2=ubWvJST??YUb!g+ItL$wWVnRZ_9t(e&bl#Vzp;e_6QA1yX giq|Gbr4^$y_?D}o2z=*>mGZ-~a#s literal 0 HcmV?d00001 diff --git a/packages/astro/test/fixtures/content-collections/src/content/config.ts b/packages/astro/test/fixtures/content-collections/src/content/config.ts index efe38f0d73855..de770acede7a2 100644 --- a/packages/astro/test/fixtures/content-collections/src/content/config.ts +++ b/packages/astro/test/fixtures/content-collections/src/content/config.ts @@ -11,7 +11,7 @@ const withSchemaConfig = defineCollection({ isDraft: z.boolean().default(false), lang: z.enum(['en', 'fr', 'es']).default('en'), publishedAt: z.date().transform((val) => new Date(val)), - }) + }), }); const withUnionSchema = defineCollection({ @@ -28,8 +28,27 @@ const withUnionSchema = defineCollection({ ]), }); +const withSymlinkedData = defineCollection({ + type: 'data', + schema: ({ image }) => + z.object({ + alt: z.string(), + src: image(), + }), +}); + +const withSymlinkedContent = defineCollection({ + type: 'content', + schema: z.object({ + title: z.string(), + date: z.date(), + }), +}); + export const collections = { 'with-custom-slugs': withCustomSlugs, 'with-schema-config': withSchemaConfig, 'with-union-schema': withUnionSchema, -} + 'with-symlinked-data': withSymlinkedData, + 'with-symlinked-content': withSymlinkedContent, +}; diff --git a/packages/astro/test/fixtures/content-collections/src/content/with-symlinked-content b/packages/astro/test/fixtures/content-collections/src/content/with-symlinked-content new file mode 120000 index 0000000000000..79e9936195146 --- /dev/null +++ b/packages/astro/test/fixtures/content-collections/src/content/with-symlinked-content @@ -0,0 +1 @@ +/Users/matt/Repos/astro/packages/astro/test/fixtures/content-collections/symlinked-collections/content-collection \ No newline at end of file diff --git a/packages/astro/test/fixtures/content-collections/src/content/with-symlinked-data b/packages/astro/test/fixtures/content-collections/src/content/with-symlinked-data new file mode 120000 index 0000000000000..2380b9df116e8 --- /dev/null +++ b/packages/astro/test/fixtures/content-collections/src/content/with-symlinked-data @@ -0,0 +1 @@ +/Users/matt/Repos/astro/packages/astro/test/fixtures/content-collections/symlinked-collections/data-collection \ No newline at end of file diff --git a/packages/astro/test/fixtures/content-collections/src/pages/collections.json.js b/packages/astro/test/fixtures/content-collections/src/pages/collections.json.js index b7b7d847253e3..67bafdb93e1d7 100644 --- a/packages/astro/test/fixtures/content-collections/src/pages/collections.json.js +++ b/packages/astro/test/fixtures/content-collections/src/pages/collections.json.js @@ -7,8 +7,10 @@ export async function GET() { const withSchemaConfig = stripAllRenderFn(await getCollection('with-schema-config')); const withSlugConfig = stripAllRenderFn(await getCollection('with-custom-slugs')); const withUnionSchema = stripAllRenderFn(await getCollection('with-union-schema')); + const withSymlinkedContent = stripAllRenderFn(await getCollection('with-symlinked-content')); + const withSymlinkedData = stripAllRenderFn(await getCollection('with-symlinked-data')); return new Response( - devalue.stringify({ withoutConfig, withSchemaConfig, withSlugConfig, withUnionSchema }) + devalue.stringify({ withoutConfig, withSchemaConfig, withSlugConfig, withUnionSchema, withSymlinkedContent, withSymlinkedData }), ); } diff --git a/packages/astro/test/fixtures/content-collections/symlinked-collections/content-collection/first.md b/packages/astro/test/fixtures/content-collections/symlinked-collections/content-collection/first.md new file mode 100644 index 0000000000000..0ecb2d8587b0b --- /dev/null +++ b/packages/astro/test/fixtures/content-collections/symlinked-collections/content-collection/first.md @@ -0,0 +1,6 @@ +--- +title: "First Blog" +date: 2024-04-05 +--- + +First blog content. diff --git a/packages/astro/test/fixtures/content-collections/symlinked-collections/content-collection/second.md b/packages/astro/test/fixtures/content-collections/symlinked-collections/content-collection/second.md new file mode 100644 index 0000000000000..dcded99ccf63c --- /dev/null +++ b/packages/astro/test/fixtures/content-collections/symlinked-collections/content-collection/second.md @@ -0,0 +1,6 @@ +--- +title: "Second Blog" +date: 2024-04-06 +--- + +Second blog content. diff --git a/packages/astro/test/fixtures/content-collections/symlinked-collections/content-collection/third.md b/packages/astro/test/fixtures/content-collections/symlinked-collections/content-collection/third.md new file mode 100644 index 0000000000000..1adee317378bc --- /dev/null +++ b/packages/astro/test/fixtures/content-collections/symlinked-collections/content-collection/third.md @@ -0,0 +1,6 @@ +--- +title: "Third Blog" +date: 2024-04-07 +--- + +Third blog content. diff --git a/packages/astro/test/fixtures/content-collections/symlinked-collections/data-collection/welcome.json b/packages/astro/test/fixtures/content-collections/symlinked-collections/data-collection/welcome.json new file mode 100644 index 0000000000000..8ab06ff1f24f0 --- /dev/null +++ b/packages/astro/test/fixtures/content-collections/symlinked-collections/data-collection/welcome.json @@ -0,0 +1,4 @@ +{ + "alt": "Futuristic landscape with chrome buildings and blue skies", + "src": "../../assets/the-future.jpg" +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b8a8f84717588..439dfd84216d9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9575,7 +9575,6 @@ packages: libsql@0.3.12: resolution: {integrity: sha512-to30hj8O3DjS97wpbKN6ERZ8k66MN1IaOfFLR6oHqd25GMiPJ/ZX0VaZ7w+TsPmxcFS3p71qArj/hiedCyvXCg==} - cpu: [x64, arm64, wasm32] os: [darwin, linux, win32] lilconfig@2.1.0: