Skip to content

Commit

Permalink
fixup 4bcb4a3
Browse files Browse the repository at this point in the history
  • Loading branch information
geelen committed Jan 27, 2022
1 parent 39fa33b commit fbc9a0a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 39 deletions.
74 changes: 37 additions & 37 deletions packages/wrangler/src/dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -731,43 +731,43 @@ type useHotkeysInitialState = {
function useHotkeys(initial: useHotkeysInitialState, port: number) {
// UGH, we should put port in context instead
const [toggles, setToggles] = useState(initial);
useInput(
async (
input,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
key
) => {
switch (input) {
case "b": // open browser
await open(`http://localhost:${port}/`);
break;
case "d": // toggle inspector
await open(
`https://built-devtools.pages.dev/js_app?experiments=true&v8only=true&ws=localhost:9229/ws`
);
break;
case "s": // toggle tunnel
setToggles((previousToggles) => ({
...previousToggles,
tunnel: !previousToggles.tunnel,
}));
break;
case "l": // toggle local
setToggles((previousToggles) => ({
...previousToggles,
local: !previousToggles.local,
}));
break;
case "q": // shut down
case "x": // shut down
process.exit(0);
break;
default:
// nothing?
break;
}
}
);
// useInput(
// async (
// input,
// // eslint-disable-next-line @typescript-eslint/no-unused-vars
// key
// ) => {
// switch (input) {
// case "b": // open browser
// await open(`http://localhost:${port}/`);
// break;
// case "d": // toggle inspector
// await open(
// `https://built-devtools.pages.dev/js_app?experiments=true&v8only=true&ws=localhost:9229/ws`
// );
// break;
// case "s": // toggle tunnel
// setToggles((previousToggles) => ({
// ...previousToggles,
// tunnel: !previousToggles.tunnel,
// }));
// break;
// case "l": // toggle local
// setToggles((previousToggles) => ({
// ...previousToggles,
// local: !previousToggles.local,
// }));
// break;
// case "q": // shut down
// case "x": // shut down
// process.exit(0);
// break;
// default:
// // nothing?
// break;
// }
// }
// );
return toggles;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/wrangler/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ export async function main(argv: string[]): Promise<void> {
describe: "The function that is called for each JSX fragment",
type: "string",
})
.option("enable-persistence", {
.option("experimental-enable-local-persistence", {
describe: "Enable persistence for this session (only for local mode)",
type: "boolean",
});
Expand Down Expand Up @@ -612,7 +612,7 @@ export async function main(argv: string[]): Promise<void> {
initialMode={args.local ? "local" : "remote"}
jsxFactory={args["jsx-factory"] || envRootObj?.jsx_factory}
jsxFragment={args["jsx-fragment"] || envRootObj?.jsx_fragment}
enablePersistence={args["enable-persistence"] || false}
enablePersistence={args["experimental-enable-local-persistence"] || false}
accountId={config.account_id}
assetPaths={getAssetPaths(
config,
Expand Down

0 comments on commit fbc9a0a

Please sign in to comment.