Coder Social home page Coder Social logo

snipsnapdev / snipsnap Goto Github PK

View Code? Open in Web Editor NEW
1.1K 18.0 32.0 6.64 MB

Speed up your development with a powerful set of tools

Home Page: https://templates.snipsnap.dev/

License: GNU Affero General Public License v3.0

Shell 0.43% JavaScript 74.40% SCSS 18.25% CSS 2.22% PLpgSQL 4.70%
snipsnap extension vscode snippets javascript

snipsnap's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

snipsnap's Issues

Multiple projects in one workspace problem

I have multiple projects (Project1, Project2, Project3 etc.) under one workspace. Snipsnap automatically creates file in: Project1/.vscode/snipsnap.code-snippets and fetches information based on package-json. located in Project1.

So available snippets are based only on package.json from Project1. What if I need snippets based on packages from Project2, Project3, which are not included in Project1 package.json?

  • Creating parent folder for all project, with its own .vscode file will not solve the problem. No direct package.json in the parent folder.
  • Creating separate workspace for every project, so it can have its own .vscode file seems a bit redundant.

Add Intelliji support

Hello,

I was wondering if you had any plan to add support for Intelliji IDE ?

Keep up the great work !

Add default values to prompts

Add an option to set default values to the prompts.
Just add an extra field below the variable name input
image

Default values for prompts will be used two ways:

  • When we execute the template from VS Code Extension we need to add to the message also information about default value and in case user just press enter we will use it.
    image
  • For marketplace public templates animations. Example. Instead of variable-one, variable-two we will be able to use default values, which will make that animation more real.

Creating a new template within a shared Group fails

When trying to create a new template within a group I've already shared, I get the following error:

Failed to create template:
the key 'query' was not present: {"response":{"errors":[{"extensions":{"path":"$","code":"parse-failed"},"message":"the key 'query' was not present"}],"status":200},"request":{"variables":{"templateId":"01821073-6592-4ed3-9da1-3b3298b44326","shareToUserEmail":"","shareByUserId":"b51e17dc-cd0b-4b78-9e29-f09b63090b4a"}}}

Note: I've hidden the email with

Native javascript snippets

Hi, firstly thanks for this awesome project!

I would like to ask, are you also planning to support some native javascript snippets? For example console.log, destructuring const { variable } = obj, loops and so on. Snippets that are not part of any library just vanilla JS.

I could even create a pull request, I 'm just not sure if that's something that you would like to support as well.

Thanks.

Typescript compatibility

Currently the snippets only work in .js files. It would be nice to have them work in {.ts|.tsx} files as well. It would be great if the snippets would be typed as well

A couple of small bugs I've found

Hey guys, love the extension. I wrote a simpler version because I had the same need as this kylewetton.boxed-components

Just testing out the cloud ui now, and I've run across two small bugs

Say I have two templates: Template A and Template B.

  • Open Template A and start making changes. Realise that you don't need Template B any more, delete Template B in the left sidebar. All the changes you've done to Template A will disappear.
  • I can't find any way of renaming a file? Name a file {{componentName}}. Realise it needs to be {{componentName}}.tsx. I can't rename a file, I have to create a new one and copy/paste all the code over.

Keep up the great work.

add support for Go

May I start on the golang? I would love to collab with anyone via live share

Add create group link from group selector

When we create a new template there is a dropdown select for groups. It would be great if we add there a button/link that will open modal window for group creation.
image

Can I create my own snippets ?

I have a bunch of my own snippets from some internal libraries that we use on a project. Can I create them with this tool ?

πŸ“š Libraries list for snippets development

Let's keep this issue for gathering requests for snippets for certain libraries and our plans. The issue is the great candidate for good first issue initiative and could be very good for people who are interested in open source contributions. If you know the library that you would like to create snippets for, don't hesitate and leave a comment below.

  • axios
  • graphql-request
  • storybook
  • preact
  • date-fns
  • emotion
  • react-router
  • express
  • winston
  • react-select
  • react-use
  • react-sring
  • apollo-client
  • react-helmet

Proposal to change react import snippet

Hello great idea. Like this library already.

What do you think of exchanging the import React from react to import * as React.

This removed a additional wrapper added by the bundler and since it's a snippet it does not come with additional cost for this repo.

Add Clone button to templates available to you

It could be useful to have "Clone" button not only for templates available over Marketplace but as well for every template you have access to.

We can add it as a part of the context menu in the sidebar templates navigation
image

The code that we use for "Clone" in the marketplace should work for this action too, probably with just minor adjustments.

πŸ”₯Snipsnap – v1.2.0

That issue contains plans for the upcoming v1.2.0. Feel free to comment and suggest features that should be included for the release.

The command for getting the list of available snippets
It should be useful to know what snippets are available for the specific project you are in now. The more libraries we will have the more complicated will it be to know what snippets are there to use. To solve this issue I guess we will have to add extra endpoint on the backend that will provide a list of libraries that available for the project. We could solve it on the client-side too by reading snipsnap.code-snippets file, so have to discuss what will be the better way.

Create snippets generator
We aim to build a page that will help users and ourselves to create snippets. Snippets will have a form with all required/optional fields, validation rules that we use, prettier, list of most popular scopes for snippets.


Other things that I have in mind but not sure about their priority:

  • rewrite VS Code extension to have a better architecture that will have pipelines of "detectors", will allow easier to extend the functionality and support of new languages.
  • create 'md' file generator to generate pages with all available snippets for each library we have.
  • add support of yarn workspaces

Customizing Location of .snipsnapignore.json

Hey, awesome work! I love the idea of this and am considering adding it to my boilerplates and even using it as an entry point for boilerplates. Is it possible to customize the location of .snipsnapignore.json? I already have way too many files in my project's roots as it is so it would be nice to be able to customize the location.

Allow to clone shared to you template

At this moment there are no options to clone shared to your template. Should be a pretty simple task since all functionality already is ready for this.
image

Support for monorepo projects

I tried Snipsnap with my hobby projects and found that Snipsnap didn't work as expected with monorepo projects.

Do you have any plan to support monorepo projects ?

Add syntax highlight for Go lang

We have syntax highlight for different languages but Go is not one of them. It should be a very simple task, since it will require just importing an extra highlight theme for ACE editor.

How to prevent creation of snipsnap.code-snippets file in project's folder

Describe the problem

I've installed snipsnap from vscode marketplace and the extension is enabled globally. However up on opening any new project this folder called .vscode gets automatically created with a file name snipsnap.code-snippets. Is this a feature? I have been using other snippets extensions in the past which are enabled globally but doesn't create this type of folders or anything. Why is this file needed?

Screenshots

This is what says upon opening up any new project in vs code:
image

Fix wanted?

Is there a way to stop this from hapenning? Or shall we always need to add this to .gitignore which will be very repetitive to do?

Add template validation before save changes

In case of any mistakes in the template body between {{}}, I don't get any errors in the editor but Snipsnap VS code extension won't generate any files. I suggest adding validation to editor UI to prevent such occasions.

Snippets that are supposed to work within jsx need a jsx scope

For example, gatsby-link doesn't work inside jsx because it doesn't have that scope. I think jsx should be the only scope for such snippets, i.e.:

 "gatsby-link": {
    "scope": "jsx",
    "prefix": ["gatsby link"],
    "body": ["<Link to=\"${1:/blog}\">${2:Text}</Link>"]
  },

A couple of small bugs I've found

Hey guys, love the extension. I wrote a simpler version because I had the same need as this kylewetton.boxed-components

Just testing out the cloud ui now, and I've run across two small bugs

Say I have two templates: Template A and Template B.

  • Open Template A and start making changes. Realise that you don't need Template B any more, delete Template B in the left sidebar. All the changes you've done to Template A will disappear.
  • I can't find any way of renaming a file? Name a file {{componentName}}. Realise it needs to be {{componentName}}.tsx. I can't rename a file, I have to create a new one and copy/paste all the code over.

Keep up the great work.

How to uninstall

How to COMPLETELY clean my snippets after using this extension?
Disabling doesn't help
Uninstall doesn't help

This is an un-useful extension for me personally: installed a ton of snippets that I'll never need and now I need to somehow remove them

Handle case when files already exist

Let say, in snipsnap template we got hello.js file and the same file locally. Then we try to "Create from Template".
Currently, snipsnap will replace the file. I believe it should be asked from the user to either replace or keep existing files.

Jest snippets only works in `.ts` files, not `.tsx`

Working in .ts files:
image

Not working in .tsx files:
image

I'm guessing this is due to the snippet definition missing the typescriptreact scope.

Is there any way to override this for a single project?
Or is the typescriptreact (incl. javascriptreact) scope planned to be added for jest?

πŸ”₯ Snipsnap v1.1.0

I will summarize here tasks and their priorities that will be included into the v1.1.0 release. All tasks placed in the order of their priority.

  • Support dependencies that use submodules, like Angular. Example: @angular/common. #28
  • Add the ability to define some base/default snippets that could be used for language in general. Like ES6 snippets.
  • Write custom yarn.lock parser.

Support dependencies that use submodules
There is a proposal to just cut off everything after the / and remove special symbols from names. So in that case @angular/common could be converted as angular and we will be able easily to fetch the snippets for it.

Add the ability to define some base/default snippets
For any language, there will be some generic construction that probably won't be cover by IDE. Since we aim to be the only one installed snippets extension, having such snippets is crucial. We can define names such as "base" or "default" and those snippets to every search query. It could be done even on the server-side
https://github.com/snipsnapdev/snipsnap-api/blob/master/src/routes/snippets/list.js#L45

Write custom yarn.lock parser
Yarn developers for some reason decide to create their own format instead of using just a JSON as NPM does. Their existing official package for parsing does not work in production builds, so probably it will be faster just to write our own parser for this to extract library's names, that's all that we need at this moment.

Add write permissions option for shared templates

When do you share group or specific template, we need to be able define permissions "read" or "write". In case user have write permissions, he can also modify that template, otherwise there should not be an option to edit it.

Let's add here dropdown with permissions options, I will provide design later on.
image
Also we should indicate it here with the name
image
In order to do this task, we should add an extra field to shared_templates/shared_groups tables that will define permissions for shared object. Also, we will need to modify permissions in Hasura the way that user who has write permissions can actually modify the template.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.