Skip to content

Commit

Permalink
Add svelte changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Nov 6, 2024
1 parent 7db86cf commit b21a075
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 39 deletions.
5 changes: 5 additions & 0 deletions .changeset/pretty-walls-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/svelte': patch
---

New release to include changes from 5.7.3
6 changes: 3 additions & 3 deletions packages/astro/components/index.ts
Original file line number Diff line number Diff line change
@@ -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';
64 changes: 32 additions & 32 deletions packages/astro/src/core/sync/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
if (!store) {
store = new MutableDataStore();
}
syncAstroEnv(settings);
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) {
Expand Down
5 changes: 4 additions & 1 deletion packages/create-astro/src/actions/dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ export async function dependencies(
ctx.add = ctx.add?.reduce<string[]>((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',
Expand Down
10 changes: 7 additions & 3 deletions packages/create-astro/test/integrations.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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 () => {
Expand Down

0 comments on commit b21a075

Please sign in to comment.