Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for path normalization issues on macOS #153

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/vite/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export type EditorConfig = {
export const DEFAULT_EDITOR_CONFIG: EditorConfig = {
name: "VSCode",
open: (path, lineNumber) => {
exec(`code -g "${normalizePath(path)}${lineNumber ? `:${lineNumber}` : ""}"`)
exec(`code -g "${normalizePath(path).replaceAll("$", "\\$")}${lineNumber ? `:${lineNumber}` : ""}"`)
},
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
import type { ActionFunctionArgs } from "@remix-run/node";
import { json, type LoaderFunctionArgs } from "@remix-run/node";
import type { MetaFunction } from "@remix-run/node";
import { Link, useFetcher, useLoaderData, useSubmit } from "@remix-run/react";

export const meta: MetaFunction = () => {
return [
{ title: "New Remix App" },
{ name: "description", content: "Welcome to Remix!" },
];
};

export const loader = async ({ request }: LoaderFunctionArgs) => {
await new Promise((resolve) => setTimeout(resolve, 2000));
return json({
should: "work",
with: {
nested: {
objects: {
really: {
deep: "inside",
array: [
"this",
"is",
"a",
"really",
"long",
"array",
"that",
"should",
"be",
"truncated",
],
},
},
},
},
}, { headers: { "Set-Cookie": "test=1; Path=/; HttpOnly; Secure", "Cache-Control": "max-age=20"}});
};

export const action = async ({ request }: ActionFunctionArgs) => {
return new Response(JSON.stringify({ test: "died" }));
};

export default function IndexRoute() {
const string = useLoaderData<typeof loader>();
const lFetcher = useFetcher();
const lFetcher2 = useFetcher();
const pFetcher = useFetcher();
const submit = useSubmit();
const data = new FormData();
data.append("test", "test");
return (
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.8" }}>
<h1>Welcome to Remix 5</h1>
<button
onClick={() =>
lFetcher.submit(null, { method: "GET", action: "/tests/3/edit/new" })
}
>
FETCHER Loader
</button>{" "}
<button
onClick={() =>
lFetcher2.submit(null, { method: "GET", action: "/tests/3/edit/new" })
}
>
FETCHER 2 Loader
</button>
<button
onClick={() =>
pFetcher.submit(null, { method: "POST", action: "/tests/3/edit/new" })
}
>
FETCHER Action
</button>
<button
onClick={() => {
submit(data, { method: "POST", action: "/tests/3/edit/new/5/5" });
}}
>
SUBMIT Action test
</button>
<button
onClick={() =>
submit(data, { method: "PATCH", action: "/tests/3/edit/new" })
}
>
SUBMIT Action PATCH
</button>
<button
onClick={() =>
submit(null, { method: "DELETE", action: "/tests/3/edit/new" })
}
>
SUBMIT Action DELETE
</button>
<button
onClick={() =>
submit(null, { method: "PUT", action: "/tests/3/edit/new" })
}
>
SUBMIT Action PUT
</button>
<Link to="/login">Login</Link>
<ul>
<li>
<a
target="_blank"
href="https://remix.run/tutorials/blog"
rel="noreferrer"
>
15m Quickstart Blog Tutorial
</a>
</li>
<li>
<a
target="_blank"
href="https://remix.run/tutorials/jokes"
rel="noreferrer"
>
Deep Dive Jokes App Tutorial
</a>
</li>
<li>
<a target="_blank" href="https://remix.run/docs" rel="noreferrer">
Remix Docs
</a>
</li>
</ul>
</div>
);
}
Loading