diff --git a/README.md b/README.md index 249fb7c..9398912 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,27 @@ These snippets were made to speed up Vue 3 development. With it you can write bo > Snippets with ⚠️ symbol are unreleased. +### Histoire + +| Snippet | Purpose | +| ------------------------- | ------------------------------------ | +| ⚠️ `hconfig` | Histoire config for Vue 3 | +| ⚠️ `hconfig-nuxt` | Histoire config for Nuxt 3 | +| ⚠️ `hbase` | Base code for story | +| ⚠️ `hbase-variant` | Base code for story with variant | +| ⚠️ `hbase-grid` | Base code for story with grid layout | +| ⚠️ `hvariant` | Story variant | +| ⚠️ `hgrid` | Histoire grid layout | +| ⚠️ `hcontrols-base` | Histoire controls base | +| ⚠️ `hcontrols-button` | Histoire controls - Button | +| ⚠️ `hcontrols-buttongroup` | Histoire controls - Button Group | +| ⚠️ `hcontrols-checkbox` | Histoire controls - Checkbox | +| ⚠️ `hcontrols-number` | Histoire controls - Number | +| ⚠️ `hcontrols-text` | Histoire controls - Text | +| ⚠️ `hcontrols-textarea` | Histoire controls - Textarea | + +> Snippets with ⚠️ symbol are unreleased. + ## Contributing This is an open source project open to anyone. Contributors are welcome on [GitHub](https://github.com/exer7um/vue3-vscode-snippets). diff --git a/package.json b/package.json index 5a75aac..56bb066 100644 --- a/package.json +++ b/package.json @@ -49,47 +49,63 @@ "snippets": [ { "language": "vue", - "path": "./snippets/vue.code-snippets" + "path": "./snippets/vue/vue.code-snippets" }, { "language": "html", - "path": "./snippets/vue-template.code-snippets" + "path": "./snippets/vue/vue-template.code-snippets" }, { "language": "javascript", - "path": "./snippets/vue-script.code-snippets" + "path": "./snippets/vue/vue-script.code-snippets" }, { "language": "typescript", - "path": "./snippets/vue-script.code-snippets" + "path": "./snippets/vue/vue-script.code-snippets" }, { "language": "javascript", - "path": "./snippets/pinia.code-snippets" + "path": "./snippets/pinia/pinia.code-snippets" }, { "language": "typescript", - "path": "./snippets/pinia.code-snippets" + "path": "./snippets/pinia/pinia.code-snippets" }, { "language": "javascript", - "path": "./snippets/vue-router.code-snippets" + "path": "./snippets/vue/vue-router.code-snippets" }, { "language": "typescript", - "path": "./snippets/vue-router.code-snippets" + "path": "./snippets/vue/vue-router.code-snippets" }, { "language": "html", - "path": "./snippets/nuxt-template.code-snippets" + "path": "./snippets/nuxt/nuxt-template.code-snippets" }, { "language": "javascript", - "path": "./snippets/nuxt-script.code-snippets" + "path": "./snippets/nuxt/nuxt-script.code-snippets" }, { "language": "typescript", - "path": "./snippets/nuxt-script.code-snippets" + "path": "./snippets/nuxt/nuxt-script.code-snippets" + }, + { + "language": "vue", + "path": "./snippets/histoire/histoire.code-snippets" + }, + { + "language": "html", + "path": "./snippets/histoire/histoire-template.code-snippets" + }, + { + "language": "javascript", + "path": "./snippets/histoire/histoire-script.code-snippets" + }, + { + "language": "typescript", + "path": "./snippets/histoire/histoire-script.code-snippets" } ] } diff --git a/snippets/histoire/histoire-script.code-snippets b/snippets/histoire/histoire-script.code-snippets new file mode 100644 index 0000000..676d11c --- /dev/null +++ b/snippets/histoire/histoire-script.code-snippets @@ -0,0 +1,32 @@ +{ + "Histoire config": { + "prefix": "hconfig", + "body": [ + "import { defineConfig } from 'histoire'", + "import { HstVue } from '@histoire/plugin-vue'", + "", + "export default defineConfig({", + "\tplugins: [", + "\t\tHstVue(),", + "\t],", + "})" + ], + "description": "Histoire config for Vue 3" + }, + "Histoire config - Nuxt": { + "prefix": "hconfig-nuxt", + "body": [ + "import { defineConfig } from 'histoire'", + "import { HstVue } from '@histoire/plugin-vue'", + "import { HstNuxt } from '@histoire/plugin-nuxt'", + "", + "export default defineConfig({", + "\tplugins: [", + "\t\tHstVue(),", + "\t\tHstNuxt(),", + "\t],", + "})" + ], + "description": "Histoire config for Nuxt 3" + }, +} diff --git a/snippets/histoire/histoire-template.code-snippets b/snippets/histoire/histoire-template.code-snippets new file mode 100644 index 0000000..722496a --- /dev/null +++ b/snippets/histoire/histoire-template.code-snippets @@ -0,0 +1,93 @@ +{ + "Histoire story variant": { + "prefix": "hvariant", + "body": [ + "", + "\t$0", + "", + ], + "description": "Story variant" + }, + "Histoire grid layout": { + "prefix": "hgrid", + "body": [ + ":layout='{ type: 'grid', width: ${1:gridWidth} }'", + ], + "description": "Histoire grid layout" + }, + "Histoire controls": { + "prefix": "hcontrols-base", + "body": [ + "", + "\t$0", + "" + ], + "description": "Histoire controls base" + }, + "Histoire controls - Button": { + "prefix": "hcontrols-button", + "body": [ + "", + "\t$0", + "" + ], + "description": "Histoire controls - Button" + }, + "Histoire controls - Button Group": { + "prefix": "hcontrols-buttongroup", + "body": [ + "", + ], + "description": "Histoire controls - Button Group" + }, + "Histoire controls - Checkbox": { + "prefix": "hcontrols-checkbox", + "body": [ + "" + ], + "description": "Histoire controls - Checkbox" + }, + "Histoire controls - Number": { + "prefix": "hcontrols-number", + "body": [ + "" + ], + "description": "Histoire controls - Number" + }, + "Histoire controls - Text": { + "prefix": "hcontrols-text", + "body": [ + "" + ], + "description": "Histoire controls - Text" + }, + "Histoire controls - Textarea": { + "prefix": "hcontrols-textarea", + "body": [ + "" + ], + "description": "Histoire controls - Textarea" + }, +} diff --git a/snippets/histoire/histoire.code-snippets b/snippets/histoire/histoire.code-snippets new file mode 100644 index 0000000..8be2135 --- /dev/null +++ b/snippets/histoire/histoire.code-snippets @@ -0,0 +1,54 @@ +{ + "Histoire story base": { + "prefix": "hbase", + "body": [ + "", + "", + "", + "\t", + "\t\t$0", + "\t", + "", + ], + "description": "Base code for story" + }, + "Histoire story base with variant": { + "prefix": "hbase-variant", + "body": [ + "", + "", + "", + "\t", + "\t\t", + "\t\t\t$0", + "\t\t", + "\t", + "", + ], + "description": "Base code for story with variant" + }, + "Histoire story base with grid layout": { + "prefix": "hbase-grid", + "body": [ + "", + "", + "", + "\t", + "\t\t", + "\t\t\t$0", + "\t\t", + "\t", + "", + ], + "description": "Base code for story with grid layout" + }, +} diff --git a/snippets/nuxt-script.code-snippets b/snippets/nuxt/nuxt-script.code-snippets similarity index 100% rename from snippets/nuxt-script.code-snippets rename to snippets/nuxt/nuxt-script.code-snippets diff --git a/snippets/nuxt-template.code-snippets b/snippets/nuxt/nuxt-template.code-snippets similarity index 100% rename from snippets/nuxt-template.code-snippets rename to snippets/nuxt/nuxt-template.code-snippets diff --git a/snippets/pinia.code-snippets b/snippets/pinia/pinia.code-snippets similarity index 100% rename from snippets/pinia.code-snippets rename to snippets/pinia/pinia.code-snippets diff --git a/snippets/vue-router.code-snippets b/snippets/vue/vue-router.code-snippets similarity index 100% rename from snippets/vue-router.code-snippets rename to snippets/vue/vue-router.code-snippets diff --git a/snippets/vue-script.code-snippets b/snippets/vue/vue-script.code-snippets similarity index 100% rename from snippets/vue-script.code-snippets rename to snippets/vue/vue-script.code-snippets diff --git a/snippets/vue-template.code-snippets b/snippets/vue/vue-template.code-snippets similarity index 100% rename from snippets/vue-template.code-snippets rename to snippets/vue/vue-template.code-snippets diff --git a/snippets/vue.code-snippets b/snippets/vue/vue.code-snippets similarity index 93% rename from snippets/vue.code-snippets rename to snippets/vue/vue.code-snippets index 7a80abf..dae7bd4 100644 --- a/snippets/vue.code-snippets +++ b/snippets/vue/vue.code-snippets @@ -4,8 +4,7 @@ "body": [ "" - , + "", "", "", "\t", @@ -24,8 +23,7 @@ "body": [ "" - , + "", "", "", "\t", @@ -44,8 +42,7 @@ "body": [ "" - , + "", "", "", "\t", @@ -64,8 +61,7 @@ "body": [ "" - , + "", "", "", "\t", @@ -84,8 +80,7 @@ "body": [ "" - , + "", "", "", "\t", @@ -104,8 +99,7 @@ "body": [ "" - , + "", "", "", "\t", @@ -124,8 +118,7 @@ "body": [ "" - , + "", "", "", "\t",