Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call svelte-kit sync only if installed #353

Merged
merged 2 commits into from
Nov 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# changelog

## 0.63.2

- call `svelte-kit sync` only if it's installed
([#353](https://github.com/feltcoop/gro/pull/353))

## 0.63.1

- pass `--skipLibCheck` to `tsc` on `gro build` so it can be disabled in dependents' tsconfigs
Expand Down
2 changes: 1 addition & 1 deletion src/build/buildSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const buildSource = async (
): Promise<void> => {
log.info('building source', gray(dev ? 'development' : 'production'));

await sveltekitSync();
await sveltekitSync(fs);

const totalTiming = createStopwatch();
const timings = new Timings();
Expand Down
2 changes: 1 addition & 1 deletion src/typecheck.task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const task: Task<Args> = {
run: async ({fs, args, log}): Promise<void> => {
const {tsconfig} = args;

await sveltekitSync();
await sveltekitSync(fs);

if (await fs.exists('node_modules/.bin/svelte-check')) {
// svelte-check
Expand Down
7 changes: 6 additions & 1 deletion src/utils/sveltekit.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import {unwrap} from '@feltcoop/felt';
import {spawn} from '@feltcoop/felt/util/process.js';

export const sveltekitSync = async (): Promise<void> => {
import type {Filesystem} from '../fs/filesystem.js';

export const sveltekitSync = async (fs: Filesystem): Promise<void> => {
if (!(await fs.exists('node_modules/.bin/svelte-kit'))) {
return;
}
unwrap(await spawn('npx', ['svelte-kit', 'sync']), 'failed svelte-kit sync');
};