Git Product home page Git Product logo

typewritercli's Introduction

Typewriter Cli

NetCore port of Typewriter with command line interface and single file processing.

Typewriter Cli options:

  • t|template= - full path to template (*.tst) file.
  • s|source= - full path to source (*.cs) file.

Use Typewriter Cli with Rider

Use Rider File Watchers settings.

file watcher settings

Restrictions

  • Single file processing
    Code model (classes, properties, methods etc) returns only objects of processing file.
  • Type.IsDefined is not supported (stub)
    Type.IsDefined always returns Type.!IsPrimitive.
  • Settings.IncludeCurrentProject() and Settings.IncludeProject("Project.Name") is not supported (stub). Use Rider File Watchers settings to select projects and files in projects.

typewritercli'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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

typewritercli's Issues

Wrong Main method is set

After last PR you forgot to comment out the Main method you are using for testing and development which has static path to "C:\Development\Firefly.Backbone"

Missing csproj file for Demo

Hey,

when I check out the repo and open the solution in VS2017, I see that one project cannot be loaded. Did you perhaps forget to commit *.csproj for Typewriter.Demo project?

Error when try to import and use external classes "using" in template .tst file

Hi @barestan

I'm really impressed by your work and that you try to give the community the possibility to use Typewriter with JetBrains Rider. This is amazing and very appreciated ๐Ÿ˜„

${
	using Typewriter.Extensions.Types;
	using System.Text.RegularExpressions;
	using System.Diagnostics;

	string ToKebabCase(string typeName){
		return  Regex.Replace(typeName, "(?<!^)([A-Z][a-z]|(?<=[a-z])[A-Z])","-$1", RegexOptions.Compiled)
					 .Trim().ToLower();
	}

	string Imports(Class c){
	  string inheritImports = (c.BaseClass!=null) ? ( "import { " + CleanupName(c.BaseClass).ToString() +" } from './" +ToKebabCase(CleanupName(c.BaseClass)) +"';") + Environment.NewLine :"";
	  string emptyEnumeImports =  (!String.IsNullOrEmpty(inheritImports)) ? Environment.NewLine : "";
	  string emptyClassImports =  (!String.IsNullOrEmpty(inheritImports)) ? Environment.NewLine : "";
	  string enumeImports = (!String.IsNullOrEmpty(EnumeImports(c))) ? EnumeImports(c) + Environment.NewLine : emptyEnumeImports;
	  string classImports = (!String.IsNullOrEmpty(ClassImports(c))) ? ClassImports(c) + Environment.NewLine : emptyClassImports;
	  return inheritImports + classImports + enumeImports;
	}
...

Could you help me with my *.tst file, I have some using in my template file *.tst when I run TypewriterCLI I received errors as below:

Template error: CS0103 The name "Regex" does not exist in the current context
Error: The name "Regex" does not exist in the current context
Template error: CS0103 The name "RegexOptions" does not exist in the current context
Error: The name "RegexOptions" does not exist in the current context
Template error: CS0122 'The "Environment" element is unavailable due to its protection level.
Error: 'The "Environment" element is unavailable due to its level of protection.
Template error: CS0122 'The "Environment" element is unavailable due to its protection level.
Error: 'The "Environment" element is unavailable due to its level of protection.
Template error: CS0122 'The "Environment" element is unavailable due to its protection level.
Error: 'The "Environment" element is unavailable due to its level of protection.
Template error: CS0122 'The "Environment" element is unavailable due to its protection level.
Error: 'The "Environment" element is unavailable due to its level of protection.
Template error: CS0122 'The "Environment" element is unavailable due to its protection level.
Error: 'The "Environment" element is unavailable due to its level of protection.
Error: Template compilation errors. Template:. \ .. \ TypeScriptTemplate.tst

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.