reesemclean / blueprint Goto Github PK
View Code? Open in Web Editor NEWCreate files and folders of files from templates in Visual Studio Code
License: MIT License
Create files and folders of files from templates in Visual Studio Code
License: MIT License
Hi. Is it possible to use target name without transformation?
The UpperCase and LowerCase transforms will keep spaces unlike the other transforms so far. The example in the readme could show that this is the case.
I'm currently using this extension and even have a dedicated project for use with it - https://github.com/Tram-One/tram-blueprints. What I would like to do, as part of a pipeline in this project, is generate a template, run linting and run tests - just to make sure everything passes.
Is there a way in a CI environment I can create a blueprint template so that I can run these tests and linting?
Hi. Is it possible to realize feature wich will change the current workdir to destination (after project's dircetory created from template)? (Analog of feature "Create Project's Directory" or "Create Subdirectory" in the most of IDEs)
For example, I have a template like a:
* __pascalCase_name__ <--Root project's folder
** ... <--Project's files.
** ...
** ...
At that time users should to make root project directory and open it manually in the file explorer.
Thanks.
If the user presses escape (or other ways of canceling out) we don't want to show an error message.
Hi. Is it possible to show some alias/title of template (or name of template's folder) instead of full path in templates list?
Almost done - needs last few subheads finished
Is there any possibility which user can have custom functions to be invoked during template creation?
Or is there any feature which user can avoid typing some ruled string which can be generated? Rather than using $variable_name 😃
This is already saving me a ton of time, but it's still a 2-step process:
I thought MAYBE I could get away with the setup below, but when I use New File from Template
, nothing happens now, so I assume it's not supported:
If that worked, I could just do step #2 above and it'd create the sub-folder for me.
PS: This thing is amazing, thanks to everyone involved.
hi, is there an API so that other extensions can register new templates in your extension? (at least for a window session of vscode) Preferably something allowing callbacks when the user wants to create them, so extensions can provide dynamic data such as latest versions of dependencies in a package descriptor.
See https://code.visualstudio.com/api/references/vscode-api#extensions
It would be nice if there is some option to just put in the author name. Or maybe more general if some values can be predefined in some configuration file and used by the templates.
Date and time would be also nice (ideally with some formating options for example similar to the date command line executable)
Hi. Is it possible to copy subfolder? For example my template contains folder .vscode with some settings, is it possible to copy it?
Fantastic extension! I wanted something like this so bad!
I would like to suggest using the double underscore escape method even inside of templates. Handlebars are not compatible with a vast majority of file types. For example, they will completely break the Javascript/Typescript syntax.
In this example, VS Code will freak out with cryptic errors, the file is marked as containing errors, and will appear red in the sidebar recursively to the project folder. It's not possible to switch off VS Code's internal validation for particular folders without workarounds such as remapping file associations to something like text file for particular folders.
Blueprint files should be able to be valid language-linted files, but that's impossible with the current template literals.
Double underscore based literals (with no spaces!) would be highly compatible (and unique!) for HTML, Javascript, CSS, C++, Java as underscores are generally accepted in variable names. A simple config option could choose between "{{" and "__", and handlebars could be replaced with simple regex substitution (why not? handlebars wasn't designed to handle every file format anyway).
It would help solve issues with escaping, language-specific constraints and linting, conflicts with other handlebars: #58, #69, #56, #39
Examples for in-template substitution would be: __name__
, __camelCaseName__
, __snakeCaseName__
, ... Or even better, prefix with bp
: __bpName__
.
Hi. I did noted file manifest.json at some samples. What is it? Is there description of these file?
I would love to use this extension with VSCodium. For that to work, the extension would need to be published to the open-source registry at openvsx. A guide on how to do that can be found here: https://github.com/eclipse/openvsx/wiki/Publishing-Extensions
Alternatively, the extension could be added to the publish-extensions repo as a workaround, but that would not be a good long-term solution for reasons described here.
I know it’s a few steps to follow, but please consider this! I’d be very grateful. <3
Repro steps:
Resulting error:
ENOENT: no such file or directory
Create a Vue template component:
<template>
<div class="{{snakeCase name}}">
{{msg}}
</div>
</template>
As a result, the line {{msg}}
disappears, although it does not refer to the name of the component.
<template>
<div class="component_name">
</div>
</template>
In the manifest add an option like so:
{
customInputs: [{
type: "string",
key: "prefix"
value: "PQ"
}]
}
We could start with just a string type which may not have much value by itself. Later we could extend the syntax to other types such as a list or text input:
{
customInputs: [{
type: "list",
key: "styleType",
choices: ["scss", "css"]
},
{
type: "textInput",
key: "parentClass",
defaultValue: ""
}]
}
one of my templates is doing this:
return <Widget style={{
x,
y
}} staticStyle={staticStyles} />;
How do i escape the {{? aka, don't let it get picked up by blue print? I tried prefixing with {{ but it actually renders that out in the response.
Hi,
For many of us with "muscle memory", the first item in the context menu is "New File". This extension puts "New File from Template" at the top of the list.
Please can this be optional / or a setting a user can change? Personally, I'd move it under "New File" or even under "New Folder".
Thanks for making a great extension.
G'day mate! Thanks for the insanely useful plugin, its awesome!
However I can't get the pascalHelper to add my filename as my CSS class name (CSS Modules), have pictured below. Any suggestions, did I miss something obvious? Appears to be an issue with nesting the helper moustache within another set of curly braces?
Cheers,
Mick
I don't like this rule. Seems like it makes inconsistent code for what I think is a slim benefit of consisness.
Make sure all metadata is in place for it to look good on the marketplace.
Your extension uses the foward slash for the linux/unix based OS's, but for Windows it can't ever find the path to the blueprint-templates folder:
No Templates found in C:\users\Nate\Documents\Work\Powershell/blueprint-templates
Hello,
I reallly like your Extension!
I use snippets a lot to insert timestamps and have even created some snippets that allow me to choose from multiple choices.
Question:
Example of a snippet using date timestamp:
{
"New_Meeting": {
"prefix": "New_M",
"scope": "markdown",
"body": [
"# Meeting: ${1:Enter Meeting Title}",
" ",
"${CURRENT_DAY_NAME}, ${CURRENT_MONTH_NAME}, ${CURRENT_DATE}, ${CURRENT_YEAR}, ${CURRENT_HOUR}:${CURRENT_MINUTE}",
" ",
"## Called By",
" ",
"- ${2:Enter Name}",
" ",
"### Attendees",
" ",
"- ${3:Enter Name}",
"- ${4:Enter Name}",
"- ${5:Enter Name}",
" ",
"### Next Steps",
" ",
"---",
" ",
"### Agenda",
" ",
"### Notes",
" ",
"- $0"
],
"description": "New Meeting"
}
}
Example of snippet using multiple choice:
{
"Front_Matter": {
"prefix": "Front_M",
"scope": "markdown",
"body": [
"---"
"Author: This Guy",
"Title: ${1:Enter Title}",
"Created: ${CURRENT_DAY_NAME}, ${CURRENT_MONTH_NAME}, ${CURRENT_DATE}, ${CURRENT_YEAR}, ${CURRENT_HOUR}:${CURRENT_MINUTE}",
"Last Updated: ",
"Category: ${2:Enter Category}",
"Classification: ${3| CONFIDENTIAL, OPERATIONALLY SENSITIVE, FOR INTERNAL USE ONLY, COVERED BY NDA, DO NOT COPY NOR DISTRIBUTE WITHOUT PERMISSION, PUBLIC|}",
"Tags: ${4: Enter Tags}",
"---",
" ",
"# $0"
],
"description": "New Front Matter"
}
Thank you!
There is now the ability to add extensions to the activity bar (left bar with files, search, etc.). We could make a view that shows the current templates available and allow you to create/edit them.
Add an simple icon to represent the project
Is that possible to treat the name as the path once it contains slashes?
´src/component/TestPage´ can create files under src/component/ folder for name TestPage.
Right now it will use slash as a whitespace to transform the name.
Any plans to create cli?
Thank you
For c header files i use include guards like
#ifndef HEADER_H
#define HEADER_H
...
#endif
HEADER_H is typically the corresponding header filename in uppercase.
Sometimes I have some software module with numbers. In that case the upperCase implementation does not work, because i get blanks then:
e.g. for header1.h i would get:
#ifndef HEADER 1_H
which will not work. I'd like to have an option to just get the characters uppercase without separation of words.
Currently as a workaround i use upperSnakeCase, but then i get HEADER_1_H (However I'd prefer HEADER1_H)
Hi
How could I get the template appended to an existing file?
Thank you
Stefano
First up this is awesome. Exactly what I was looking for.
One niggling thing - is there any away to define blueprint dir outside of the workspace scope? So could I define 1 folder of blueprints & have all my spaces use them?
The format used by blueprint for dynamic variables placeholders "${{ my_var }}" is the same used by GitHub Actions workflows.
It would nice to have a way to use a different placeholder, otherwise blueprint wont work fine for generaing GitHub Actions workflows files.
I propose we change the template syntax from this:
{{nameKebabCase}}
to this
{{kebabCase name}}
For the content of of the template this can be done through helpers in handlebars.
We would need to write helpers for each of the casing methods and change the context being passed into the handlebars template from
{
nameKebabCase: string;
nameSnakeCase: string;
namePascalCase: string;
nameCamelCase: string;
}
to this:
{
name: string
}
For the file name I think we could change it from __namekebabcase__
to __kebabCase_name__
. Better ideas?
This would enable adding casing support for custom fields if that was ever supported. This change should be made before the initial release so templates don't have to be changed.
With the new support for multiple folders the template selection menu is now a little sloppy:
We should investigate tidying this up so that the template name is the first thing that is shown and the thing most emphasized.
If a user has only one template folder path we may want to hide the path?
Or maybe, only show the path on the first item for each template folder path?
When selecting folder with arrow keys and creating template from "shift+command+p" menu template will be generated in root folder. I think it should create template inside selected folder instead.
This is a great library, thanks for your work!
Is it possible to support the constant naming style like THIS_IS_CONSTANT?
Steps:
Error:
Lexical error on line 1. Unrecognized text.
������JFIF�������������C
----^
svg is ok,but jpg & png will error
maybe an option to ignore file/foler analyze
We should make sure no files/folders will be created with a name that already exists.
Currently the content of the template will be appended to the file.
I've got "Parse error on line 1:" and no files were generated for template:
import {Base{{pascalCase name}}} from 'test';
Blueprint always shows the input box "Enter a value to be used within your template" even when the template doesn't contain any placeholder variable.
Convert the Dangerfile and CI to use danger.systems/js
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.