Skip to content

Commit

Permalink
upgrade to vite
Browse files Browse the repository at this point in the history
  • Loading branch information
nornagon committed Jun 23, 2022
1 parent 0734700 commit 1ca793a
Show file tree
Hide file tree
Showing 24 changed files with 2,954 additions and 2,540 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/node_modules/
/public/build/
dist
dev-dist

.DS_Store
_test/
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/_test/
/public/build/
/dist/
/dev-dist/
/generate-color-css.js
/public/global.css
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"svelteBracketNewLine": false,
"bracketSameLine": true,
"svelteIndentScriptAndStyle": false
}
12 changes: 8 additions & 4 deletions fetch-fixtures.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
const fs = require("fs/promises");
const { createWriteStream, createReadStream } = require("fs");
const crypto = require("crypto");
const { buildNum, sha } = require("./_test/all.meta.json");
import * as fs from "fs/promises";
import { createWriteStream, createReadStream, readFileSync } from "fs";
import * as crypto from "crypto";
import * as url from "url";
const { buildNum, sha } = JSON.parse(
readFileSync("./_test/all.meta.json", "utf8")
);
const update = process.argv[2] === "latest";
const dataUrl = `https://raw.githubusercontent.com/nornagon/cdda-data/main/data/${
update ? "latest" : buildNum
}/all.json`;
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));

function computeSha(file) {
return new Promise((resolve) => {
Expand Down
11 changes: 4 additions & 7 deletions public/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta
property="og:title"
content="The Hitchhiker's Guide to the Cataclysm"
/>
content="The Hitchhiker's Guide to the Cataclysm" />

<title>The Hitchhiker's Guide to the Cataclysm</title>

<link rel="icon" type="image/png" href="favicon.png" />
<link rel="stylesheet" href="global.css" />
<link rel="stylesheet" href="build/bundle.css" />
<link rel="manifest" href="manifest.json" />
<link rel="icon" type="image/png" href="/favicon.png" />
<link rel="stylesheet" href="/global.css" />
<link rel="apple-touch-icon" href="icon-192.png" />

<script defer src="build/bundle.js"></script>
<script type="module" defer src="/src/main.ts"></script>
</head>

<body></body>
Expand Down
51 changes: 21 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "svelte-app",
"version": "1.0.0",
"private": true,
"type": "module",
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
"start": "sirv public",
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"validate": "svelte-check",
"test": "node fetch-fixtures.js && npm run lint && npm run validate && jest src",
"test:latest": "node fetch-fixtures.js latest && npm run validate && jest src",
Expand All @@ -14,50 +16,39 @@
"lint": "prettier -c .",
"lint:fix": "prettier -w .",
"precommit": "lint-staged",
"prepare": "husky install"
"prepare": "husky install",
"check": "svelte-check --tsconfig ./tsconfig.json"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-node-resolve": "^11.0.0",
"@rollup/plugin-typescript": "^8.0.0",
"@sentry/browser": "^6.2.1",
"@sentry/tracing": "^6.2.1",
"@fontsource/unifont": "^4.5.5",
"@sentry/browser": "^7.2.0",
"@sentry/tracing": "^7.2.0",
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.30",
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/svelte": "^3.0.3",
"@tsconfig/svelte": "^1.0.0",
"@tsconfig/svelte": "^2.0.1",
"@types/jest": "^26.0.20",
"@types/node": "^14.14.31",
"@types/node-fetch": "^2.5.8",
"ajv": "^8",
"babel-jest": "^26.6.3",
"fuzzysort": "^1.1.4",
"fuzzysort": "^2.0.1",
"gh-pages": "^3.1.0",
"husky": "^7.0.4",
"jest": "^26.6.3",
"lint-staged": "^12.3.2",
"node-fetch": "^2.6.1",
"postcss": "^8.3.6",
"postcss-url": "^10.1.3",
"prettier": "^2.3.2",
"prettier-plugin-svelte": "^2.4.0",
"rollup": "^2.3.4",
"rollup-plugin-css-only": "^3.1.0",
"rollup-plugin-livereload": "^2.0.0",
"rollup-plugin-postcss": "^4.0.1",
"rollup-plugin-svelte": "^7.0.0",
"rollup-plugin-terser": "^7.0.0",
"svelte": "^3.0.0",
"svelte-check": "^1.0.0",
"svelte": "^3.44.0",
"svelte-check": "^2.2.7",
"svelte-jester": "^1.3.0",
"svelte-preprocess": "^4.6.9",
"ts-jest": "^26.5.3",
"tslib": "^2.0.0",
"typescript": "^4.0.0",
"typescript-json-schema": "^0.50.0"
},
"dependencies": {
"@fontsource/unifont": "^4.5.1",
"sirv-cli": "^1.0.0"
"svelte-preprocess": "^4.9.8",
"tslib": "^2.3.1",
"typescript": "^4.5.4",
"typescript-json-schema": "^0.50.0",
"vite": "^2.9.9",
"vite-plugin-pwa": "^0.12.0"
},
"jest": {
"transform": {
Expand Down
20 changes: 0 additions & 20 deletions public/manifest.json

This file was deleted.

117 changes: 0 additions & 117 deletions public/service-worker.js

This file was deleted.

105 changes: 0 additions & 105 deletions rollup.config.js

This file was deleted.

Loading

0 comments on commit 1ca793a

Please sign in to comment.