Skip to content

Commit

Permalink
Fix schema gen
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic committed Nov 15, 2024
1 parent c7a2b30 commit ccf40b9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
10 changes: 0 additions & 10 deletions packages/astro/src/content/types-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,20 +526,10 @@ async function writeContentFiles({
dataTypesStr += `};\n`;
}

if (collectionConfig?.schema) {
await generateJSONSchema(
fs,
collectionConfig,
collectionKey,
collectionSchemasDir,
logger,
);
}
break;
}

if (
settings.config.experimental.contentIntellisense &&
collectionConfig &&
(collectionConfig.schema || (await getContentLayerSchema(collectionConfig, collectionKey)))
) {
Expand Down
9 changes: 2 additions & 7 deletions packages/astro/test/astro-sync.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,12 @@ describe('astro sync', () => {
);
});


it('does not write individual types for entries when emulating legacy collections', async () => {
await fixture.load('./fixtures/content-collections/');
fixture.clean();
await fixture.whenSyncing();
fixture.thenFileContentShouldNotInclude(
'.astro/content.d.ts',
'id: "one.md"'
);
})

fixture.thenFileContentShouldNotInclude('.astro/content.d.ts', 'id: "one.md"');
});
});

describe('astro:env', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ const image = defineCollection({
}),
});

const authors = defineCollection({});
const authors = defineCollection({
type: 'data',
});

export const collections = { docs, func, image, i18n, authors };

0 comments on commit ccf40b9

Please sign in to comment.