Skip to content

Commit

Permalink
Remove old global declarations (#1508)
Browse files Browse the repository at this point in the history
* Remove old global declarations

* Remove old code
  • Loading branch information
ericpgreen2 authored Dec 26, 2022
1 parent 163d03f commit 9ba0841
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
4 changes: 0 additions & 4 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@ module.exports = {
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"@typescript-eslint/ban-ts-comment": "warn",
},
globals: {
RILL_VERSION: true,
RILL_COMMIT: true,
},
};
5 changes: 0 additions & 5 deletions web-local/global.d.ts

This file was deleted.

18 changes: 0 additions & 18 deletions web-local/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,10 @@
import { sveltekit } from "@sveltejs/kit/vite";
import { execSync } from "child_process";
import dns from "dns";
import { readFileSync } from "fs";
import { fileURLToPath } from "url";
import { defineConfig } from "vite";

// print dev server as `localhost` not `127.0.0.1`
dns.setDefaultResultOrder("verbatim");

// get current version
const file = fileURLToPath(new URL("package.json", import.meta.url));
const json = readFileSync(file, "utf8");
const pkg = JSON.parse(json);

// attempt to get current commit hash
let commitHash = "";
try {
commitHash = execSync("git rev-parse --short HEAD").toString().trim();
} catch (e) {
console.log("Could not get commit hash - most likely not in a git repo");
}

let runtimeUrl = "";
try {
runtimeUrl = process.env.RILL_DEV ? "http://localhost:9009" : "";
Expand All @@ -44,8 +28,6 @@ const config = defineConfig({
},
},
define: {
RILL_VERSION: `"${pkg.version}"`,
RILL_COMMIT: `"${commitHash}"`,
RILL_RUNTIME_URL: `"${runtimeUrl}"`,
},
plugins: [sveltekit()],
Expand Down

0 comments on commit 9ba0841

Please sign in to comment.