From 71edece0db9e686849520f6f186ee8b52fecf698 Mon Sep 17 00:00:00 2001 From: Manu MA Date: Thu, 29 Jun 2023 16:54:35 +0200 Subject: [PATCH] fix: tailwind integration (#4640) --- .prettierignore | 2 - .vscode/extenstions.json | 13 +- .vscode/launch.json | 14 +- .vscode/qwik.code-snippets | 230 ++++++++---------- package.json | 2 +- packages/create-qwik/package.json | 2 +- packages/eslint-plugin-qwik/package.json | 2 +- packages/insights/.vscode/launch.json | 4 +- .../insights/.vscode/qwik-city.code-snippets | 24 +- packages/insights/.vscode/qwik.code-snippets | 161 +++++------- packages/qwik-city/package.json | 2 +- packages/qwik/package.json | 2 +- packages/qwik/src/cli/add/run-add-command.ts | 1 - packages/qwik/src/cli/add/update-files.ts | 8 +- starters/apps/base/.vscode/launch.json | 4 +- .../apps/base/.vscode/qwik-city.code-snippets | 18 +- starters/apps/base/.vscode/qwik.code-snippets | 172 ++++++------- starters/apps/base/.vscode/settings.json | 2 +- .../features/postcss/.vscode/settings.json | 2 +- .../features/tailwind/.vscode/settings.json | 2 +- 20 files changed, 284 insertions(+), 383 deletions(-) diff --git a/.prettierignore b/.prettierignore index debd56b56d4..2c1545e8052 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,7 +2,6 @@ **/*.log **/.DS_Store *. -.vscode/settings.json .history .yarn .yarnrc.yml @@ -20,7 +19,6 @@ output rollup.config.js build .cache -.vscode .rollup.cache tsconfig.tsbuildinfo packages/docs/api/**/* diff --git a/.vscode/extenstions.json b/.vscode/extenstions.json index 2223f432fa6..4758b9d6bd7 100644 --- a/.vscode/extenstions.json +++ b/.vscode/extenstions.json @@ -1,4 +1,13 @@ { - "recommendations": ["dbaeumer.vscode-eslint", "unifiedjs.vscode-mdx", "esbenp.prettier-vscode", "ms-playwright.playwright", "rust-lang.rust-analyzer", "ms-azuretools.vscode-docker", "manucorporat.vermoji", "vadimcn.vscode-lldb"], - "unwantedRecommendations": [] + "recommendations": [ + "dbaeumer.vscode-eslint", + "unifiedjs.vscode-mdx", + "esbenp.prettier-vscode", + "ms-playwright.playwright", + "rust-lang.rust-analyzer", + "ms-azuretools.vscode-docker", + "manucorporat.vermoji", + "vadimcn.vscode-lldb" + ], + "unwantedRecommendations": [] } diff --git a/.vscode/launch.json b/.vscode/launch.json index 4db041967e8..32a01d786ec 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,18 +11,18 @@ "skipFiles": ["/**"], "cwd": "${workspaceFolder}/packages/docs", "program": "${workspaceFolder}/packages/docs/node_modules/vite/bin/vite.js", - "args": ["--mode", "ssr", "--force"], + "args": ["--mode", "ssr", "--force"] }, { "type": "node", "name": "vscode-jest-tests", "request": "launch", "console": "integratedTerminal", - "internalConsoleOptions": "neverOpen", + "internalConsoleOptions": "neverOpen", "program": "${workspaceFolder}/node_modules/jest/bin/jest.js", "cwd": "${workspaceFolder}", "args": ["--runInBand", "--watchAll=false"] - }, + }, { "name": "uvu Current File", "type": "node", @@ -30,10 +30,10 @@ "skipFiles": ["/**"], "program": "${workspaceFolder}/node_modules/tsm/bin.js", "args": [ - "${workspaceFolder}/node_modules/uvu/bin.js", - "${fileDirname}", - "${fileBasename}", - "--tsmconfig", + "${workspaceFolder}/node_modules/uvu/bin.js", + "${fileDirname}", + "${fileBasename}", + "--tsmconfig", "${workspaceFolder}/tsm.cjs" ], "console": "integratedTerminal" diff --git a/.vscode/qwik.code-snippets b/.vscode/qwik.code-snippets index 20eee571ea0..380a2624d33 100644 --- a/.vscode/qwik.code-snippets +++ b/.vscode/qwik.code-snippets @@ -1,134 +1,98 @@ { - "Qwik component": { - "scope": "typescriptreact", - "prefix": "q:component w/props", - "description": "Qwik component w/ props", - "body": [ - "export interface ${1:${TM_FILENAME_BASE/(.*)/${1:/capitalize}/}}Props {", - " $2", - "}", - "", - "export const $1 = component$((props: $1Props) => {", - " const state = useStore({", - " $3", - " });", - " ", - " return <${4:button} on${5:Click}$={(${6:e}) => {$7}}>$8", - "});" - ] - }, - "Qwik component (simple)": { - "scope": "javascriptreact,typescriptreact", - "prefix": "q:component simple", - "description": "Simple Qwik component", - "body": [ - "export const ${1:${TM_FILENAME_BASE/(.*)/${1:/capitalize}/}} = component$(() => {", - " return <${2:button}>$4", - "});" - ] - }, - "Qwik state": { - "scope": "javascriptreact,typescriptreact", - "prefix": "q:useStore$", - "description": "useStore() declaration", - "body": [ - "const ${1:state} = useStore({", - " $2", - "});", - "$0" - ] - }, - "Qwik signal": { - "scope": "javascriptreact,typescriptreact", - "prefix": "q:useSignal", - "description": "useSignal() declaration", - "body": [ - "const ${1:signal} = useSignal($2);", - "$0" - ] - }, - "$ hook": { - "scope": "javascriptreact,typescriptreact", - "prefix": "q:$", - "description": "$() function hook", - "body": [ - "$(() => {", - " $0", - "});", - "" - ] - }, - "useVisibleTask": { - "scope": "javascriptreact,typescriptreact", - "prefix": "q:useVisibleTask", - "description": "useVisibleTask$() function hook", - "body": [ - "useVisibleTask$(({ track }) => {", - " $0", - "});", - "" - ] - }, - "useTask": { - "scope": "javascriptreact,typescriptreact", - "prefix": "q:useTask", - "description": "useTask$() function hook", - "body": [ - "useTask$(({ track }) => {", - " track(() => $1);", - " $0", - "});", - "" - ] - }, - "useResource": { - "scope": "javascriptreact,typescriptreact", - "prefix": "q:useResource$", - "description": "useResource$() declaration", - "body": [ - "const $1 = useResource$(({ track, previous, cleanup }) => {", - " $0", - "});", - "" - ] - }, - "useOn": { - "scope": "javascriptreact,typescriptreact", - "prefix": "q:useOn", - "description": "useOn declaration", - "body": [ - "useOn(", - "'$1',", - "$((event) => {", - " const { $3 } = event as $2;", - " })", - ");" - ] - }, - "useOnDocument": { - "scope": "javascriptreact,typescriptreact", - "prefix": "q:useOnDocument", - "description": "useOnDocument declaration", - "body": [ - "useOnDocument(", - "'$1',", - "$((event) => {", - " const { $3 } = event as $2;", - " })", - ");" - ] - }, - "useOnWindow": { - "scope": "javascriptreact,typescriptreact", - "prefix": "q:useOnWindow", - "description": "useOnWindow declaration", - "body": [ - "useOnWindow(", - "'$1',", - "$((event) => {", - " const { $3 } = event as $2;", - " })", - ");" - ] - } -} \ No newline at end of file + "Qwik component": { + "scope": "typescriptreact", + "prefix": "q:component w/props", + "description": "Qwik component w/ props", + "body": [ + "export interface ${1:${TM_FILENAME_BASE/(.*)/${1:/capitalize}/}}Props {", + " $2", + "}", + "", + "export const $1 = component$((props: $1Props) => {", + " const state = useStore({", + " $3", + " });", + " ", + " return <${4:button} on${5:Click}$={(${6:e}) => {$7}}>$8", + "});" + ] + }, + "Qwik component (simple)": { + "scope": "javascriptreact,typescriptreact", + "prefix": "q:component simple", + "description": "Simple Qwik component", + "body": [ + "export const ${1:${TM_FILENAME_BASE/(.*)/${1:/capitalize}/}} = component$(() => {", + " return <${2:button}>$4", + "});" + ] + }, + "Qwik state": { + "scope": "javascriptreact,typescriptreact", + "prefix": "q:useStore$", + "description": "useStore() declaration", + "body": ["const ${1:state} = useStore({", " $2", "});", "$0"] + }, + "Qwik signal": { + "scope": "javascriptreact,typescriptreact", + "prefix": "q:useSignal", + "description": "useSignal() declaration", + "body": ["const ${1:signal} = useSignal($2);", "$0"] + }, + "$ hook": { + "scope": "javascriptreact,typescriptreact", + "prefix": "q:$", + "description": "$() function hook", + "body": ["$(() => {", " $0", "});", ""] + }, + "useVisibleTask": { + "scope": "javascriptreact,typescriptreact", + "prefix": "q:useVisibleTask", + "description": "useVisibleTask$() function hook", + "body": ["useVisibleTask$(({ track }) => {", " $0", "});", ""] + }, + "useTask": { + "scope": "javascriptreact,typescriptreact", + "prefix": "q:useTask", + "description": "useTask$() function hook", + "body": ["useTask$(({ track }) => {", " track(() => $1);", " $0", "});", ""] + }, + "useResource": { + "scope": "javascriptreact,typescriptreact", + "prefix": "q:useResource$", + "description": "useResource$() declaration", + "body": ["const $1 = useResource$(({ track, previous, cleanup }) => {", " $0", "});", ""] + }, + "useOn": { + "scope": "javascriptreact,typescriptreact", + "prefix": "q:useOn", + "description": "useOn declaration", + "body": ["useOn(", "'$1',", "$((event) => {", " const { $3 } = event as $2;", " })", ");"] + }, + "useOnDocument": { + "scope": "javascriptreact,typescriptreact", + "prefix": "q:useOnDocument", + "description": "useOnDocument declaration", + "body": [ + "useOnDocument(", + "'$1',", + "$((event) => {", + " const { $3 } = event as $2;", + " })", + ");" + ] + }, + "useOnWindow": { + "scope": "javascriptreact,typescriptreact", + "prefix": "q:useOnWindow", + "description": "useOnWindow declaration", + "body": [ + "useOnWindow(", + "'$1',", + "$((event) => {", + " const { $3 } = event as $2;", + " })", + ");" + ] + } +} diff --git a/package.json b/package.json index c46ab1c28c8..e39f645a12c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "qwik-monorepo", - "version": "1.2.0", + "version": "1.2.1", "scripts": { "build": "tsm scripts/index.ts --tsc --build --qwikcity --qwiklabs --api --platform-binding-wasm-copy", "build.vite": "tsm scripts/index.ts --tsc --build --qwikcity --qwiklabs --platform-binding-wasm-copy", diff --git a/packages/create-qwik/package.json b/packages/create-qwik/package.json index cd91f1d898c..a3688532a83 100644 --- a/packages/create-qwik/package.json +++ b/packages/create-qwik/package.json @@ -1,6 +1,6 @@ { "name": "create-qwik", - "version": "1.2.0", + "version": "1.2.1", "description": "Interactive CLI for create Qwik projects and adding features.", "bin": "./create-qwik.cjs", "main": "./index.cjs", diff --git a/packages/eslint-plugin-qwik/package.json b/packages/eslint-plugin-qwik/package.json index e0604371375..86f3d9331d4 100644 --- a/packages/eslint-plugin-qwik/package.json +++ b/packages/eslint-plugin-qwik/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-qwik", - "version": "1.2.0", + "version": "1.2.1", "description": "An Open-Source sub-framework designed with a focus on server-side-rendering, lazy-loading, and styling/animation.", "main": "index.js", "author": "Builder Team", diff --git a/packages/insights/.vscode/launch.json b/packages/insights/.vscode/launch.json index eaa7e1dfee8..c3d1ba85945 100644 --- a/packages/insights/.vscode/launch.json +++ b/packages/insights/.vscode/launch.json @@ -11,7 +11,7 @@ "skipFiles": ["/**"], "cwd": "${workspaceFolder}", "program": "${workspaceFolder}/node_modules/vite/bin/vite.js", - "args": ["--mode", "ssr", "--force"], - }, + "args": ["--mode", "ssr", "--force"] + } ] } diff --git a/packages/insights/.vscode/qwik-city.code-snippets b/packages/insights/.vscode/qwik-city.code-snippets index 13b6c8bc062..b3e44d9fdb7 100644 --- a/packages/insights/.vscode/qwik-city.code-snippets +++ b/packages/insights/.vscode/qwik-city.code-snippets @@ -3,31 +3,19 @@ "scope": "javascriptreact,typescriptreact", "prefix": "qonRequest", "description": "onRequest function for a route index", - "body": [ - "export const onRequest: RequestHandler = (request) => {", - " $0", - "};" - ] + "body": ["export const onRequest: RequestHandler = (request) => {", " $0", "};"] }, "loader$": { "scope": "javascriptreact,typescriptreact", "prefix": "qloader$", "description": "loader$()", - "body": [ - "export const $1 = routeLoader$(() => {", - " $0", - "});" - ] + "body": ["export const $1 = routeLoader$(() => {", " $0", "});"] }, "action$": { "scope": "javascriptreact,typescriptreact", "prefix": "qaction$", "description": "action$()", - "body": [ - "export const $1 = routeAction$((data) => {", - " $0", - "});" - ] + "body": ["export const $1 = routeAction$((data) => {", " $0", "});"] }, "Full Page": { "scope": "javascriptreact,typescriptreact", @@ -36,9 +24,9 @@ "body": [ "import { component$ } from '@builder.io/qwik';", "", - "export default component$(() => {", - " $0", - "});" + "export default component$(() => {", + " $0", + "});" ] } } diff --git a/packages/insights/.vscode/qwik.code-snippets b/packages/insights/.vscode/qwik.code-snippets index 4a1572f8221..8857f79ad59 100644 --- a/packages/insights/.vscode/qwik.code-snippets +++ b/packages/insights/.vscode/qwik.code-snippets @@ -1,96 +1,67 @@ { - "Qwik component (simple)": { - "scope": "javascriptreact,typescriptreact", - "prefix": "qcomponent$", - "description": "Simple Qwik component", - "body": [ - "export const ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/}} = component$(() => {", - " return <${2:div}>$4", - "});" - ] - }, - "Qwik component (props)": { - "scope": "typescriptreact", - "prefix": "qcomponent$ + props", - "description": "Qwik component w/ props", - "body": [ - "export interface ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/}}Props {", - " $2", - "}", - "", - "export const $1 = component$<$1Props>((props) => {", - " const ${2:count} = useSignal(0);", - " return (", - " <${3:div} on${4:Click}$={(ev) => {$5}}>", - " $6", - " ", - " );", - "});" - ] - }, - "Qwik signal": { - "scope": "javascriptreact,typescriptreact", - "prefix": "quseSignal", - "description": "useSignal() declaration", - "body": [ - "const ${1:foo} = useSignal($2);", - "$0" - ] - }, - "Qwik store": { - "scope": "javascriptreact,typescriptreact", - "prefix": "quseStore", - "description": "useStore() declaration", - "body": [ - "const ${1:state} = useStore({", - " $2", - "});", - "$0" - ] - }, - "$ hook": { - "scope": "javascriptreact,typescriptreact", - "prefix": "q$", - "description": "$() function hook", - "body": [ - "$(() => {", - " $0", - "});", - "" - ] - }, - "useVisibleTask": { - "scope": "javascriptreact,typescriptreact", - "prefix": "quseVisibleTask", - "description": "useVisibleTask$() function hook", - "body": [ - "useVisibleTask$(({ track }) => {", - " $0", - "});", - "" - ] - }, - "useTask": { - "scope": "javascriptreact,typescriptreact", - "prefix": "quseTask$", - "description": "useTask$() function hook", - "body": [ - "useTask$(({ track }) => {", - " track(() => $1);", - " $0", - "});", - "" - ] - }, - "useResource": { - "scope": "javascriptreact,typescriptreact", - "prefix": "quseResource$", - "description": "useResource$() declaration", - "body": [ - "const $1 = useResource$(({ track, cleanup }) => {", - " $0", - "});", - "" - ] - } -} \ No newline at end of file + "Qwik component (simple)": { + "scope": "javascriptreact,typescriptreact", + "prefix": "qcomponent$", + "description": "Simple Qwik component", + "body": [ + "export const ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/}} = component$(() => {", + " return <${2:div}>$4", + "});" + ] + }, + "Qwik component (props)": { + "scope": "typescriptreact", + "prefix": "qcomponent$ + props", + "description": "Qwik component w/ props", + "body": [ + "export interface ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/}}Props {", + " $2", + "}", + "", + "export const $1 = component$<$1Props>((props) => {", + " const ${2:count} = useSignal(0);", + " return (", + " <${3:div} on${4:Click}$={(ev) => {$5}}>", + " $6", + " ", + " );", + "});" + ] + }, + "Qwik signal": { + "scope": "javascriptreact,typescriptreact", + "prefix": "quseSignal", + "description": "useSignal() declaration", + "body": ["const ${1:foo} = useSignal($2);", "$0"] + }, + "Qwik store": { + "scope": "javascriptreact,typescriptreact", + "prefix": "quseStore", + "description": "useStore() declaration", + "body": ["const ${1:state} = useStore({", " $2", "});", "$0"] + }, + "$ hook": { + "scope": "javascriptreact,typescriptreact", + "prefix": "q$", + "description": "$() function hook", + "body": ["$(() => {", " $0", "});", ""] + }, + "useVisibleTask": { + "scope": "javascriptreact,typescriptreact", + "prefix": "quseVisibleTask", + "description": "useVisibleTask$() function hook", + "body": ["useVisibleTask$(({ track }) => {", " $0", "});", ""] + }, + "useTask": { + "scope": "javascriptreact,typescriptreact", + "prefix": "quseTask$", + "description": "useTask$() function hook", + "body": ["useTask$(({ track }) => {", " track(() => $1);", " $0", "});", ""] + }, + "useResource": { + "scope": "javascriptreact,typescriptreact", + "prefix": "quseResource$", + "description": "useResource$() declaration", + "body": ["const $1 = useResource$(({ track, cleanup }) => {", " $0", "});", ""] + } +} diff --git a/packages/qwik-city/package.json b/packages/qwik-city/package.json index 2f3ac9bd90a..ae713863e0a 100644 --- a/packages/qwik-city/package.json +++ b/packages/qwik-city/package.json @@ -1,6 +1,6 @@ { "name": "@builder.io/qwik-city", - "version": "1.2.0", + "version": "1.2.1", "description": "The meta-framework for Qwik.", "main": "./lib/index.qwik.mjs", "qwik": "./lib/index.qwik.mjs", diff --git a/packages/qwik/package.json b/packages/qwik/package.json index c4c33ae7fce..5ca10ed2046 100644 --- a/packages/qwik/package.json +++ b/packages/qwik/package.json @@ -1,6 +1,6 @@ { "name": "@builder.io/qwik", - "version": "1.2.0", + "version": "1.2.1", "description": "An Open-Source sub-framework designed with a focus on server-side-rendering, lazy-loading, and styling/animation.", "main": "./dist/core.mjs", "types": "./dist/core.d.ts", diff --git a/packages/qwik/src/cli/add/run-add-command.ts b/packages/qwik/src/cli/add/run-add-command.ts index 03c8fde8a63..57532ecb7e4 100644 --- a/packages/qwik/src/cli/add/run-add-command.ts +++ b/packages/qwik/src/cli/add/run-add-command.ts @@ -13,7 +13,6 @@ export async function runAddCommand(app: AppCommand) { } } catch (e) { console.error(`❌ ${red(String(e))}\n`); - await printAddHelp(app); process.exit(1); } } diff --git a/packages/qwik/src/cli/add/update-files.ts b/packages/qwik/src/cli/add/update-files.ts index d85284e47ea..dca613f4870 100644 --- a/packages/qwik/src/cli/add/update-files.ts +++ b/packages/qwik/src/cli/add/update-files.ts @@ -58,10 +58,9 @@ export async function mergeIntegrationDir( async function mergePackageJsons(fileUpdates: FsUpdates, srcPath: string, destPath: string) { const srcContent = await fs.promises.readFile(srcPath, 'utf-8'); - const srcPkgJson = JSON.parse(srcContent); - - const props = ['scripts', 'dependencies', 'devDependencies']; try { + const srcPkgJson = JSON.parse(srcContent); + const props = ['scripts', 'dependencies', 'devDependencies']; const destPkgJson = JSON.parse(await fs.promises.readFile(destPath, 'utf-8')); props.forEach((prop) => { mergePackageJsonSort(srcPkgJson, destPkgJson, prop); @@ -87,9 +86,8 @@ async function mergePackageJsons(fileUpdates: FsUpdates, srcPath: string, destPa async function mergeJsons(fileUpdates: FsUpdates, srcPath: string, destPath: string) { const srcContent = await fs.promises.readFile(srcPath, 'utf-8'); - const srcPkgJson = JSON.parse(srcContent); - try { + const srcPkgJson = JSON.parse(srcContent); const destPkgJson = JSON.parse(await fs.promises.readFile(destPath, 'utf-8')); Object.assign(srcPkgJson, destPkgJson); diff --git a/starters/apps/base/.vscode/launch.json b/starters/apps/base/.vscode/launch.json index eaa7e1dfee8..c3d1ba85945 100644 --- a/starters/apps/base/.vscode/launch.json +++ b/starters/apps/base/.vscode/launch.json @@ -11,7 +11,7 @@ "skipFiles": ["/**"], "cwd": "${workspaceFolder}", "program": "${workspaceFolder}/node_modules/vite/bin/vite.js", - "args": ["--mode", "ssr", "--force"], - }, + "args": ["--mode", "ssr", "--force"] + } ] } diff --git a/starters/apps/base/.vscode/qwik-city.code-snippets b/starters/apps/base/.vscode/qwik-city.code-snippets index 13b6c8bc062..a6cc6ce981f 100644 --- a/starters/apps/base/.vscode/qwik-city.code-snippets +++ b/starters/apps/base/.vscode/qwik-city.code-snippets @@ -13,21 +13,13 @@ "scope": "javascriptreact,typescriptreact", "prefix": "qloader$", "description": "loader$()", - "body": [ - "export const $1 = routeLoader$(() => {", - " $0", - "});" - ] + "body": ["export const $1 = routeLoader$(() => {", " $0", "});"] }, "action$": { "scope": "javascriptreact,typescriptreact", "prefix": "qaction$", "description": "action$()", - "body": [ - "export const $1 = routeAction$((data) => {", - " $0", - "});" - ] + "body": ["export const $1 = routeAction$((data) => {", " $0", "});"] }, "Full Page": { "scope": "javascriptreact,typescriptreact", @@ -36,9 +28,9 @@ "body": [ "import { component$ } from '@builder.io/qwik';", "", - "export default component$(() => {", - " $0", - "});" + "export default component$(() => {", + " $0", + "});" ] } } diff --git a/starters/apps/base/.vscode/qwik.code-snippets b/starters/apps/base/.vscode/qwik.code-snippets index 4a1572f8221..d4efe6b01e6 100644 --- a/starters/apps/base/.vscode/qwik.code-snippets +++ b/starters/apps/base/.vscode/qwik.code-snippets @@ -1,96 +1,78 @@ { - "Qwik component (simple)": { - "scope": "javascriptreact,typescriptreact", - "prefix": "qcomponent$", - "description": "Simple Qwik component", - "body": [ - "export const ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/}} = component$(() => {", - " return <${2:div}>$4", - "});" - ] - }, - "Qwik component (props)": { - "scope": "typescriptreact", - "prefix": "qcomponent$ + props", - "description": "Qwik component w/ props", - "body": [ - "export interface ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/}}Props {", - " $2", - "}", - "", - "export const $1 = component$<$1Props>((props) => {", - " const ${2:count} = useSignal(0);", - " return (", - " <${3:div} on${4:Click}$={(ev) => {$5}}>", - " $6", - " ", - " );", - "});" - ] - }, - "Qwik signal": { - "scope": "javascriptreact,typescriptreact", - "prefix": "quseSignal", - "description": "useSignal() declaration", - "body": [ - "const ${1:foo} = useSignal($2);", - "$0" - ] - }, - "Qwik store": { - "scope": "javascriptreact,typescriptreact", - "prefix": "quseStore", - "description": "useStore() declaration", - "body": [ - "const ${1:state} = useStore({", - " $2", - "});", - "$0" - ] - }, - "$ hook": { - "scope": "javascriptreact,typescriptreact", - "prefix": "q$", - "description": "$() function hook", - "body": [ - "$(() => {", - " $0", - "});", - "" - ] - }, - "useVisibleTask": { - "scope": "javascriptreact,typescriptreact", - "prefix": "quseVisibleTask", - "description": "useVisibleTask$() function hook", - "body": [ - "useVisibleTask$(({ track }) => {", - " $0", - "});", - "" - ] - }, - "useTask": { - "scope": "javascriptreact,typescriptreact", - "prefix": "quseTask$", - "description": "useTask$() function hook", - "body": [ - "useTask$(({ track }) => {", - " track(() => $1);", - " $0", - "});", - "" - ] - }, - "useResource": { - "scope": "javascriptreact,typescriptreact", - "prefix": "quseResource$", - "description": "useResource$() declaration", - "body": [ - "const $1 = useResource$(({ track, cleanup }) => {", - " $0", - "});", - "" - ] - } -} \ No newline at end of file + "Qwik component (simple)": { + "scope": "javascriptreact,typescriptreact", + "prefix": "qcomponent$", + "description": "Simple Qwik component", + "body": [ + "export const ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/}} = component$(() => {", + " return <${2:div}>$4", + "});" + ] + }, + "Qwik component (props)": { + "scope": "typescriptreact", + "prefix": "qcomponent$ + props", + "description": "Qwik component w/ props", + "body": [ + "export interface ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/}}Props {", + " $2", + "}", + "", + "export const $1 = component$<$1Props>((props) => {", + " const ${2:count} = useSignal(0);", + " return (", + " <${3:div} on${4:Click}$={(ev) => {$5}}>", + " $6", + " ", + " );", + "});" + ] + }, + "Qwik signal": { + "scope": "javascriptreact,typescriptreact", + "prefix": "quseSignal", + "description": "useSignal() declaration", + "body": ["const ${1:foo} = useSignal($2);", "$0"] + }, + "Qwik store": { + "scope": "javascriptreact,typescriptreact", + "prefix": "quseStore", + "description": "useStore() declaration", + "body": ["const ${1:state} = useStore({", " $2", "});", "$0"] + }, + "$ hook": { + "scope": "javascriptreact,typescriptreact", + "prefix": "q$", + "description": "$() function hook", + "body": ["$(() => {", " $0", "});", ""] + }, + "useVisibleTask": { + "scope": "javascriptreact,typescriptreact", + "prefix": "quseVisibleTask", + "description": "useVisibleTask$() function hook", + "body": ["useVisibleTask$(({ track }) => {", " $0", "});", ""] + }, + "useTask": { + "scope": "javascriptreact,typescriptreact", + "prefix": "quseTask$", + "description": "useTask$() function hook", + "body": [ + "useTask$(({ track }) => {", + " track(() => $1);", + " $0", + "});", + "" + ] + }, + "useResource": { + "scope": "javascriptreact,typescriptreact", + "prefix": "quseResource$", + "description": "useResource$() declaration", + "body": [ + "const $1 = useResource$(({ track, cleanup }) => {", + " $0", + "});", + "" + ] + } +} diff --git a/starters/apps/base/.vscode/settings.json b/starters/apps/base/.vscode/settings.json index 9bc2105ca20..04070ec8a9d 100644 --- a/starters/apps/base/.vscode/settings.json +++ b/starters/apps/base/.vscode/settings.json @@ -1,3 +1,3 @@ { "material-icon-theme.activeIconPack": "qwik" -} \ No newline at end of file +} diff --git a/starters/features/postcss/.vscode/settings.json b/starters/features/postcss/.vscode/settings.json index b69823204f7..5a586b3d1ef 100644 --- a/starters/features/postcss/.vscode/settings.json +++ b/starters/features/postcss/.vscode/settings.json @@ -1,3 +1,3 @@ { - "css.lint.unknownAtRules": "ignore", + "css.lint.unknownAtRules": "ignore" } diff --git a/starters/features/tailwind/.vscode/settings.json b/starters/features/tailwind/.vscode/settings.json index b69823204f7..5a586b3d1ef 100644 --- a/starters/features/tailwind/.vscode/settings.json +++ b/starters/features/tailwind/.vscode/settings.json @@ -1,3 +1,3 @@ { - "css.lint.unknownAtRules": "ignore", + "css.lint.unknownAtRules": "ignore" }