Skip to content

Commit

Permalink
Allow suspicious coalescing (#62)
Browse files Browse the repository at this point in the history
- explain why: this is what Svelte does for templates
- bump Svelte to v5.90
- bump version to v0.8.6
  • Loading branch information
mxdvl authored Dec 9, 2024
1 parent 7336bca commit b8d3c7d
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 8 deletions.
34 changes: 34 additions & 0 deletions .zed/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
{
"languages": {
"JSONC": {
"prettier": {
"allowed": false
},
"formatter": {
"external": {
"command": "deno",
"arguments": ["fmt", "-"]
}
},
"format_on_save": {
"external": {
"command": "deno",
"arguments": ["fmt", "-"]
}
}
},
"JSON": {
"prettier": {
"allowed": false
},
"formatter": {
"external": {
"command": "deno",
"arguments": ["fmt", ""]
}
},
"format_on_save": {
"external": {
"command": "deno",
"arguments": ["fmt", "-"]
}
}
},
"JavaScript": {
"language_servers": [
"deno",
Expand Down
8 changes: 4 additions & 4 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@mxdvl/mononykus",
"version": "0.8.5",
"version": "0.8.6",
"license": "MIT",
"exports": "./src/build.ts",
"tasks": {
"build": "deno run -A src/build.ts --site_dir src/_site",
"dev": "deno run -A src/build.ts --site_dir src/_site --watch --base=mononykus"
"build": "NODE_ENV=production deno run -A src/build.ts --site_dir src/_site",
"dev": "NODE_ENV=development deno run -A src/build.ts --site_dir src/_site --watch --base=mononykus"
},
"compilerOptions": {
"strict": true,
Expand All @@ -29,6 +29,6 @@
"@std/path": "jsr:@std/path@^1.0.6",
"esbuild": "npm:esbuild@~0.24.0",
"prettier": "npm:prettier@^3.0.2",
"svelte": "npm:svelte@5.7.1"
"svelte": "npm:svelte@5.9.0"
}
}
8 changes: 4 additions & 4 deletions deno.lock

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

8 changes: 8 additions & 0 deletions src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { svelte_components } from "./esbuild_plugins/svelte_components.ts";
import { create_handler } from "./server.ts";
import { write_islands } from "./esbuild_plugins/write_islands.ts";
import { svelte_modules } from "./esbuild_plugins/svelte_modules.ts";
import { VERSION } from "svelte/compiler";

function slashify(path: string): string {
return normalize(path + "/");
Expand Down Expand Up @@ -89,6 +90,11 @@ export const rebuild = async ({
minify,
bundle: true,
conditions: [flags.watch ? "development" : "production"],
logOverride: {
// Svelte does this a lot for its templates
// e.g. `$.get(value) ?? ""`
"suspicious-nullish-coalescing": "verbose",
},
} as const satisfies Partial<esbuild.BuildOptions>;

const routesESBuildConfig: esbuild.BuildOptions = {
Expand Down Expand Up @@ -139,6 +145,8 @@ export const build = async (
const out_dir = slashify(_out_dir);
const site_dir = slashify(_site_dir);

console.info(`\nMononykus: building with Svelte v${VERSION}\n\n`);

await clean(out_dir);

await rebuild({ base, out_dir, site_dir, minify });
Expand Down

0 comments on commit b8d3c7d

Please sign in to comment.