Skip to content

Commit

Permalink
Support for the Svelte 5 env (main codebase).
Browse files Browse the repository at this point in the history
  • Loading branch information
shimkiv committed Oct 23, 2024
1 parent 8cdcac3 commit c13588f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zkapp-cli",
"version": "0.21.7",
"version": "0.21.8",
"description": "CLI to create zkApps (zero-knowledge apps) for Mina Protocol",
"homepage": "https://github.com/o1-labs/zkapp-cli/",
"repository": {
Expand Down
5 changes: 2 additions & 3 deletions src/lib/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import url from 'node:url';
import util from 'node:util';
import ora from 'ora';
import shell from 'shelljs';
import customNextPage from '../lib/ui/next/customNextPage.js';
import customNextLayout from '../lib/ui/next/customNextLayout.js';
import customNextPage from '../lib/ui/next/customNextPage.js';
import customNuxtIndex from '../lib/ui/nuxt/customNuxtIndex.js';
import nuxtGradientBackground from '../lib/ui/nuxt/nuxtGradientBackground.js';
import customLayoutSvelte from '../lib/ui/svelte/customLayoutSvelte.js';
Expand Down Expand Up @@ -175,8 +175,7 @@ async function project({ name, ui }) {
}

function scaffoldSvelte() {
// `-y` installs the latest version of create-svelte without prompting.
spawnSync('npm', ['create', 'svelte@latest', '-y', 'ui'], {
spawnSync('npx', ['sv', 'create', 'ui'], {
stdio: 'inherit',
shell: true,
});
Expand Down
9 changes: 8 additions & 1 deletion src/lib/ui/svelte/customLayoutSvelte.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
export default `
<script>
import '../styles/globals.css'
/**
* @typedef {Object} Props
* @property {import('svelte').Snippet} [children]
*/
/** @type {Props} */
let { children } = $props();
</script>
<slot/>
{@render children?.()}
`;
11 changes: 9 additions & 2 deletions src/lib/ui/svelte/gradientBackground.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
export default `
<script>
import { onMount } from 'svelte'
/**
* @typedef {Object} Props
* @property {import('svelte').Snippet} [children]
*/
/** @type {Props} */
let { children } = $props();
let ctx
let pixels = []
let canvas
Expand Down Expand Up @@ -131,9 +138,9 @@ export default `
</style>
<div class="background">
<canvas class="background-gradients" width="6" height="6" />
<canvas class="background-gradients" width="6" height="6"></canvas>
</div>
<div class="container">
<slot />
{@render children?.()}
</div>
`;

0 comments on commit c13588f

Please sign in to comment.