Skip to content

Commit

Permalink
update download button; add dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mhkeller committed Dec 27, 2022
1 parent 2251634 commit 791107d
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 75 deletions.
44 changes: 22 additions & 22 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@typescript-eslint/eslint-plugin": "^5.8.0",
"@typescript-eslint/parser": "^5.8.0",
"cookie": "^0.4.1",
"d3-array": "^3.1.1",
"d3-array": "^3.2.1",
"d3-collection": "^1.0.7",
"d3-delaunay": "^6.0.2",
"d3-force": "^3.0.0",
Expand All @@ -35,7 +35,7 @@
"d3-hierarchy": "^3.1.1",
"d3-quadtree": "^3.0.1",
"d3-sankey": "^0.12.3",
"d3-shape": "^3.0.1",
"d3-shape": "^3.2.0",
"d3-time": "^3.0.0",
"d3-time-format": "^4.1.0",
"degit": "^2.8.4",
Expand Down
6 changes: 4 additions & 2 deletions src/routes/_site-components/DownloadBtn.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
async function download () {
downloading = true;
console.log('downloading');
const cacheBust = new Date().getTime();
const files = await (await window.fetch(`/svelte-app.json?${cacheBust}`)).json();
const depsLookup = await (await window.fetch(`/deps.json?${cacheBust}`)).json();
Expand Down Expand Up @@ -60,10 +62,10 @@
files.push(...data.csvs.map(mod => ({ path: `src/routes/${mod.title.replace('../', '')}`, data: mod.contents })));
files.push(...data.jsons.map(mod => ({ path: `src/routes/${mod.title.replace('../', '')}`, data: mod.contents })));
files.push({
path: `src/routes/index.svelte`,
path: `src/routes/+page.svelte`,
data: data.main.contents
});
console.log('here');
console.log('here', files);
const filteredFiles = uniques(files.filter(Boolean), 'path', false);
downloadBlob(toAuto(filteredFiles), `layercake-${ssr ? 'ssr-' : ''}${slug}.zip`);
downloading = false;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/example-ssr/[slug].json.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export async function get({ params }) {
const fromMain = cleanMain(example);

const main = {
title: 'index.svelte',
title: '+page.svelte',
contents: fromMain
};

Expand Down
4 changes: 2 additions & 2 deletions src/routes/example-ssr/[slug].svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
props: {
slug: page.params.slug,
data,
active: 'index'
active: '+page'
}
};
} else {
Expand Down Expand Up @@ -43,7 +43,7 @@
export let slug;
export let data;
export let active = 'index';
export let active = '+page';
function markdownToHtml (text) {
return md.render(text);
Expand Down
2 changes: 1 addition & 1 deletion src/routes/example/[slug].json.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export async function get({ params }) {
const fromMain = cleanMain(example);

const main = {
title: 'index.svelte',
title: '+page.svelte',
contents: fromMain
};

Expand Down
4 changes: 2 additions & 2 deletions src/routes/example/[slug].svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
props: {
slug: page.params.slug,
data,
active: 'index'
active: '+page'
}
};
} else {
Expand Down Expand Up @@ -44,7 +44,7 @@
export let data;
export let active = 'index';
export let active = '+page';
function markdownToHtml (text) {
return md.render(text);
Expand Down
41 changes: 0 additions & 41 deletions src/scripts/svelte-app/src/routes/+page.svelte

This file was deleted.

2 changes: 1 addition & 1 deletion src/scripts/update_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ rm -rf src/scripts/svelte-app
node_modules/.bin/degit mhkeller/layercake-template#main src/scripts/svelte-app

# remove App.svelte (will be recreated client-side) and node_modules
rm -rf src/scripts/svelte-app/src/routes/index.svelte
rm -rf src/scripts/svelte-app/src/routes/+page.svelte
rm -rf src/scripts/svelte-app/node_modules
rm -rf src/scripts/svelte-app/src/routes/_data
# mkdir src/scripts/svelte-app/src/routes/data
Expand Down
2 changes: 1 addition & 1 deletion static/svelte-app.json

Large diffs are not rendered by default.

0 comments on commit 791107d

Please sign in to comment.