diff --git a/.changeset/pretty-walls-camp.md b/.changeset/pretty-walls-camp.md new file mode 100644 index 0000000000..8c9636457d --- /dev/null +++ b/.changeset/pretty-walls-camp.md @@ -0,0 +1,5 @@ +--- +'@astrojs/svelte': patch +--- + +New release to include changes from 5.7.3 diff --git a/packages/astro/components/index.ts b/packages/astro/components/index.ts index fb553b489f..31a9bd5977 100644 --- a/packages/astro/components/index.ts +++ b/packages/astro/components/index.ts @@ -1,8 +1,8 @@ // The `ts-ignore` comments here are necessary because we're importing this file inside the `astro:components` // virtual module's types, which means that `tsc` will try to resolve these imports. // @ts-ignore -export { default as Code } from "./Code.astro"; +export { default as Code } from './Code.astro'; // @ts-ignore -export { default as Debug } from "./Debug.astro"; +export { default as Debug } from './Debug.astro'; // @ts-ignore -export { default as Welcome } from "./Welcome.astro"; +export { default as Welcome } from './Welcome.astro'; diff --git a/packages/astro/src/core/sync/index.ts b/packages/astro/src/core/sync/index.ts index 6d16cf541a..5fba6196a8 100644 --- a/packages/astro/src/core/sync/index.ts +++ b/packages/astro/src/core/sync/index.ts @@ -118,41 +118,41 @@ export async function syncInternal({ const timerStart = performance.now(); - if (!skip?.content) { - await syncContentCollections(settings, { mode, fs, logger, manifest }); - settings.timer.start('Sync content layer'); - let store: MutableDataStore | undefined; - try { - const dataStoreFile = getDataStoreFile(settings); - if (existsSync(dataStoreFile)) { - store = await MutableDataStore.fromFile(dataStoreFile); - } - } catch (err: any) { - logger.error('content', err.message); + if (!skip?.content) { + await syncContentCollections(settings, { mode, fs, logger, manifest }); + settings.timer.start('Sync content layer'); + let store: MutableDataStore | undefined; + try { + const dataStoreFile = getDataStoreFile(settings); + if (existsSync(dataStoreFile)) { + store = await MutableDataStore.fromFile(dataStoreFile); } - if (!store) { - store = new MutableDataStore(); - } - const contentLayer = globalContentLayer.init({ - settings, - logger, - store, - }); - await contentLayer.sync(); - settings.timer.end('Sync content layer'); - } else if (fs.existsSync(fileURLToPath(getContentPaths(settings.config, fs).contentDir))) { - // Content is synced after writeFiles. That means references are not created - // To work around it, we create a stub so the reference is created and content - // sync will override the empty file - settings.injectedTypes.push({ - filename: CONTENT_TYPES_FILE, - content: '', - }); + } catch (err: any) { + logger.error('content', err.message); } - syncAstroEnv(settings); + if (!store) { + store = new MutableDataStore(); + } + const contentLayer = globalContentLayer.init({ + settings, + logger, + store, + }); + await contentLayer.sync(); + settings.timer.end('Sync content layer'); + } else if (fs.existsSync(fileURLToPath(getContentPaths(settings.config, fs).contentDir))) { + // Content is synced after writeFiles. That means references are not created + // To work around it, we create a stub so the reference is created and content + // sync will override the empty file + settings.injectedTypes.push({ + filename: CONTENT_TYPES_FILE, + content: '', + }); + } + syncAstroEnv(settings); - writeInjectedTypes(settings, fs); - logger.info('types', `Generated ${dim(getTimeStat(timerStart, performance.now()))}`); + writeInjectedTypes(settings, fs); + logger.info('types', `Generated ${dim(getTimeStat(timerStart, performance.now()))}`); } function getTsReference(type: 'path' | 'types', value: string) { diff --git a/packages/create-astro/src/actions/dependencies.ts b/packages/create-astro/src/actions/dependencies.ts index 72dc9f3536..d4990a8fb8 100644 --- a/packages/create-astro/src/actions/dependencies.ts +++ b/packages/create-astro/src/actions/dependencies.ts @@ -27,7 +27,10 @@ export async function dependencies( ctx.add = ctx.add?.reduce((acc, item) => acc.concat(item.split(',')), []); if (ctx.dryRun) { - await info('--dry-run', `Skipping dependency installation${ ctx.add ? ` and adding ${ctx.add.join(', ')}` : '' }`); + await info( + '--dry-run', + `Skipping dependency installation${ctx.add ? ` and adding ${ctx.add.join(', ')}` : ''}`, + ); } else if (deps) { ctx.tasks.push({ pending: 'Dependencies', diff --git a/packages/create-astro/test/integrations.test.js b/packages/create-astro/test/integrations.test.js index 8e27a3cfa9..412285223c 100644 --- a/packages/create-astro/test/integrations.test.js +++ b/packages/create-astro/test/integrations.test.js @@ -30,7 +30,9 @@ describe('integrations', () => { await dependencies(context); - assert.ok(fixture.hasMessage('--dry-run Skipping dependency installation and adding node, react')); + assert.ok( + fixture.hasMessage('--dry-run Skipping dependency installation and adding node, react'), + ); }); it('--add node,react', async () => { @@ -39,12 +41,14 @@ describe('integrations', () => { yes: true, packageManager: 'npm', dryRun: true, - add: ['node,react'] + add: ['node,react'], }; await dependencies(context); - assert.ok(fixture.hasMessage('--dry-run Skipping dependency installation and adding node, react')); + assert.ok( + fixture.hasMessage('--dry-run Skipping dependency installation and adding node, react'), + ); }); it('-y', async () => {