From 6a2524f7017f1d1f33dae6408df30566fa51a1bb Mon Sep 17 00:00:00 2001 From: Cosmin Nicolaescu Date: Sun, 22 Sep 2024 20:01:05 -0700 Subject: [PATCH] fix: add remix snippets (#489) --- package.json | 56 +++++++++++++++++-------------- snippets/frameworks/remix-ts.json | 53 +++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 26 deletions(-) create mode 100644 snippets/frameworks/remix-ts.json diff --git a/package.json b/package.json index 39c8605c..e0eab117 100644 --- a/package.json +++ b/package.json @@ -233,7 +233,7 @@ "javascriptreact", "htmldjango", "astro", - "blade" + "blade" ], "path": "./snippets/html.json" }, @@ -257,14 +257,6 @@ "language": ["typescript", "typescriptreact"], "path": "./snippets/javascript/typescript.json" }, - { - "language": "javascriptreact", - "path": "./snippets/javascript/react.json" - }, - { - "language": "javascriptreact", - "path": "./snippets/javascript/react-native.json" - }, { "language": "javascriptreact", "path": "./snippets/javascript/next.json" @@ -277,6 +269,14 @@ "language": "typescriptreact", "path": "./snippets/javascript/next-ts.json" }, + { + "language": "javascriptreact", + "path": "./snippets/javascript/react.json" + }, + { + "language": "javascriptreact", + "path": "./snippets/javascript/react-native.json" + }, { "language": "typescriptreact", "path": "./snippets/javascript/react-native-ts.json" @@ -285,6 +285,10 @@ "language": ["javascriptreact", "typescriptreact"], "path": "./snippets/javascript/react-es7.json" }, + { + "language": "remix", + "path": "./snippets/frameworks/remix-ts.json" + }, { "language": "terraform", "path": "./snippets/terraform.json" @@ -430,25 +434,25 @@ "path": "./snippets/latex/bibtex.json" }, { - "language": "twig", + "language": "twig", "path": "./snippets/frameworks/twig.json" }, - { - "language": "blade", - "path": "./snippets/frameworks/blade/blade.json" - }, - { - "language": "blade", - "path": "./snippets/frameworks/blade/helpers.json" - }, - { - "language": "blade", - "path": "./snippets/frameworks/blade/livewire.json" - }, - { - "language": "blade", - "path": "./snippets/frameworks/blade/snippets.json" - }, + { + "language": "blade", + "path": "./snippets/frameworks/blade/blade.json" + }, + { + "language": "blade", + "path": "./snippets/frameworks/blade/helpers.json" + }, + { + "language": "blade", + "path": "./snippets/frameworks/blade/livewire.json" + }, + { + "language": "blade", + "path": "./snippets/frameworks/blade/snippets.json" + }, { "language": ["r", "rmd"], "path": "./snippets/r.json" diff --git a/snippets/frameworks/remix-ts.json b/snippets/frameworks/remix-ts.json new file mode 100644 index 00000000..8002ef17 --- /dev/null +++ b/snippets/frameworks/remix-ts.json @@ -0,0 +1,53 @@ +{ + "Remix loader function": { + "prefix": "rxl", + "body": [ + "import { type LoaderFunction, json } from '@remix-run/node'", + "import { useLoaderData } from '@remix-run/react'", + "", + "export const loader: LoaderFunction = async () => {", + "\treturn json({ ok: true })", + "}" + ], + "description": "Remix loader function" + }, + "Remix action function": { + "prefix": "rxa", + "body": [ + "import { type ActionFunction, json } from '@remix-run/node'", + "", + "export const action: ActionFunction = async ({ request }) => {", + "\treturn json({ ok: true })", + "}" + ], + "description": "Remix action function" + }, + "Remix meta function": { + "prefix": "rxm", + "body": [ + "import { type MetaFunction } from '@remix-run/node'", + "", + "export const meta: MetaFunction = () => {", + "\treturn [", + "\t\t{ title: ''},", + "\t\t{ name: 'description', content: ''}", + "\t]", + "}" + ], + "description": "Remix meta function" + }, + "Remix links function": { + "prefix": "rxi", + "body": [ + "import { type LinksFunction } from '@remix-run/node'", + "", + "export const links: LinksFunction = () => {", + "\treturn [", + "\t\t{", + "\t\t}", + "\t]", + "}" + ], + "description": "Remix links function" + } +} \ No newline at end of file