{"id":15594287,"url":"https://github.com/orta/snake-in-typescript","last_synced_at":"2025-05-07T11:40:44.740Z","repository":{"id":47851000,"uuid":"266085562","full_name":"orta/snake-in-typescript","owner":"orta","description":null,"archived":false,"fork":false,"pushed_at":"2021-08-12T11:48:29.000Z","size":405,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T09:37:55.839Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-22T10:41:19.000Z","updated_at":"2022-04-08T13:10:50.000Z","dependencies_parsed_at":"2022-08-29T13:01:14.798Z","dependency_job_id":null,"html_url":"https://github.com/orta/snake-in-typescript","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orta%2Fsnake-in-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orta%2Fsnake-in-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orta%2Fsnake-in-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orta%2Fsnake-in-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orta","download_url":"https://codeload.github.com/orta/snake-in-typescript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252872991,"owners_count":21817699,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T00:36:56.161Z","updated_at":"2025-05-07T11:40:44.712Z","avatar_url":"https://github.com/orta.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Snake in TypeScript\n\n\u003cimg src =\"./screenshots/snek.jpg\"\u003e\n\nAn example of using the Playdate API with TypeScript to build a Snake game\n\n### Getting set up\n\n```sh\ngit clone ...\ncd ...\nyarn install\n```\n\nThen open the editor:\n\n```sh\ncode .\n```\n\nYou realistically need copy of [vscode-playdate](https://devforum.play.date/t/vs-code-extension/356/4) set up in your editor to get working efficiently. From there, you can hit the run button in the debugging panel to start everything up.\n\n### How it works\n\nPressing start will:\n\n - Run the Playdate compiler over `Source`\n - Start the TypeScript to Lua watcher\n\nThis repo uses [`TypeScriptToLua`](https://typescripttolua.github.io) to convert `*.ts` files in `Src` to `Source`.\n\n### Files of interest\n\n- `TS2Lua/requireToImport.js` - a plugin for TypeScriptToLua which makes the emitted Lua files use `import` and not `require`\n- `playdate.d.ts` - an ambient declaration file (e.g. one that affects global scope) which adds the playdate SDK globals\n\n### Keybindings\n\nIf you come from a Mac background, these are keybindings which I think makes your life easier for Xcode-like running of your app.\n\n```json\n[\n      {\n        \"key\": \"cmd+r\",\n        \"command\": \"workbench.action.debug.start\",\n        \"when\": \"!inDebugMode\"\n    },\n    {\n        \"key\": \"cmd+r\",\n        \"command\": \"workbench.action.debug.restart\",\n        \"when\": \"inDebugMode\"\n    },\n    {\n        \"key\": \"cmd+shift+r\",\n        \"command\": \"workbench.action.debug.restart\"\n    },\n    {\n        \"key\": \"cmd+shift+.\",\n        \"command\": \"workbench.action.debug.stop\"\n    }\n]\n```\n\nHere's my full keybindings for reference also\n\n```json\n[\n    {\n        \"key\": \"ctrl+cmd+left\",\n        \"command\": \"workbench.action.navigateBack\"\n    },\n    {\n        \"key\": \"ctrl+cmd+right\",\n        \"command\": \"workbench.action.navigateForward\"\n    },\n    {\n        \"key\": \"cmd+e\",\n        \"command\": \"editor.action.addSelectionToNextFindMatch\"\n    },\n    {\n        \"key\": \"cmd+t\",\n        \"command\": \"workbench.action.quickOpen\"\n    },\n    {\n        \"key\": \"cmd+r\",\n        \"command\": \"workbench.action.debug.start\",\n        \"when\": \"!inDebugMode\"\n    },\n    {\n        \"key\": \"cmd+r\",\n        \"command\": \"workbench.action.debug.restart\",\n        \"when\": \"inDebugMode\"\n    },\n    {\n        \"key\": \"cmd+shift+r\",\n        \"command\": \"workbench.action.debug.restart\"\n    },\n    {\n        \"key\": \"cmd+shift+.\",\n        \"command\": \"workbench.action.debug.stop\"\n    },\n    {\n        \"key\": \"cmd+shift+[\",\n        \"command\": \"workbench.action.previousEditor\"\n    },\n    {\n        \"key\": \"cmd+shift+]\",\n        \"command\": \"workbench.action.nextEditor\"\n    },\n    {\n        \"key\": \"ctrl+cmd+e\",\n        \"command\": \"editor.action.changeAll\"\n    },\n    {\n        \"key\": \"cmd+1\",\n        \"command\": \"workbench.view.explorer\"\n    },\n    {\n        \"key\": \"cmd+2\",\n        \"command\": \"workbench.view.search\"\n    },\n    {\n        \"key\": \"cmd+3\",\n        \"command\": \"workbench.view.git\"\n    },\n    {\n        \"key\": \"cmd+4\",\n        \"command\": \"workbench.view.debug\"\n    },\n    {\n        \"key\": \"cmd+5\",\n        \"command\": \"workbench.view.extensions\"\n    },\n    {\n        \"key\": \"cmd+enter\",\n        \"command\": \"editor.action.goToDeclaration\",\n        \"when\": \"editorTextFocus\"\n    },\n    {\n        \"key\": \"cmd+.\",\n        \"command\": \"editor.action.triggerSuggest\",\n        \"when\": \"editorHasCompletionItemProvider \u0026\u0026 editorTextFocus \u0026\u0026 !editorReadonly\"\n    },\n    {\n        \"key\": \"cmd+k p\",\n        \"command\": \"editor.action.previewDeclaration\",\n        \"when\": \"editorHasDefinitionProvider \u0026\u0026 editorTextFocus \u0026\u0026 !inReferenceSearchEditor \u0026\u0026 !isInEmbeddedEditor\"\n    },\n    {\n        \"key\": \"cmd+k f\",\n        \"command\": \"editor.action.referenceSearch.trigger\",\n        \"when\": \"editorHasReferenceProvider \u0026\u0026 editorTextFocus \u0026\u0026 !inReferenceSearchEditor \u0026\u0026 !isInEmbeddedEditor\"\n    },\n    {\n        \"key\": \"cmd+k e\",\n        \"command\": \"editor.action.rename\",\n        \"when\": \"editorHasRenameProvider \u0026\u0026 editorTextFocus \u0026\u0026 !editorReadonly\"\n    },\n    {\n        \"key\": \"cmd+shift n\",\n        \"command\": \"workbench.action.files.newUntitledFile\",\n        \"when\": \"editorTextFocus\"\n    },\n    {\n        \"key\": \"shift+cmd+t\",\n        \"command\": \"workbench.action.terminal.toggleTerminal\"\n    },\n    {\n        \"key\": \"ctrl+`\",\n        \"command\": \"-workbench.action.terminal.toggleTerminal\"\n    },\n    {\n        \"key\": \"ctrl+.\",\n        \"command\": \"toggleSuggestionDetails\",\n        \"when\": \"editorTextFocus \u0026\u0026 suggestWidgetVisible\"\n    },\n    {\n        \"key\": \"ctrl+space\",\n        \"command\": \"-toggleSuggestionDetails\",\n        \"when\": \"editorTextFocus \u0026\u0026 suggestWidgetVisible\"\n    },\n    {\n        \"key\": \"shift+cmd+.\",\n        \"command\": \"editor.action.quickFix\",\n        \"when\": \"editorHasCodeActionsProvider \u0026\u0026 editorTextFocus \u0026\u0026 !editorReadonly\"\n    },\n    {\n        \"key\": \"cmd+.\",\n        \"command\": \"-editor.action.quickFix\",\n        \"when\": \"editorHasCodeActionsProvider \u0026\u0026 editorTextFocus \u0026\u0026 !editorReadonly\"\n    },\n    {\n        \"key\": \"ctrl+1\",\n        \"command\": \"workbench.action.focusFirstEditorGroup\"\n    },\n    {\n        \"key\": \"cmd+1\",\n        \"command\": \"-workbench.action.focusFirstEditorGroup\"\n    },\n    {\n        \"key\": \"ctrl+2\",\n        \"command\": \"workbench.action.focusSecondEditorGroup\"\n    },\n    {\n        \"key\": \"cmd+2\",\n        \"command\": \"-workbench.action.focusSecondEditorGroup\"\n    },\n    {\n        \"key\": \"ctrl+3\",\n        \"command\": \"workbench.action.focusThirdEditorGroup\"\n    },\n    {\n        \"key\": \"cmd+3\",\n        \"command\": \"-workbench.action.focusThirdEditorGroup\"\n    },\n    {\n        \"key\": \"ctrl+alt+left\",\n        \"command\": \"workbench.action.navigateEditorGroups\"\n    },\n    {\n        \"key\": \"ctrl+alt+right\",\n        \"command\": \"workbench.action.navigateEditorGroups\"\n    },\n    {\n        \"key\": \"cmd+l\",\n        \"command\": \"workbench.action.gotoLine\"\n    },\n    {\n        \"key\": \"ctrl+g\",\n        \"command\": \"-workbench.action.gotoLine\"\n    }\n]\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forta%2Fsnake-in-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forta%2Fsnake-in-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forta%2Fsnake-in-typescript/lists"}