Giter Club home page Giter Club logo

civetman's Introduction

Civetman

Use Civet in any project.

Civet not working? Bad integration with pure TypeScript files? No problem!

Table of Content

Usage

First install npm package civetman (e.g. pnpm add civetman). Then, add civetman dev to your dev or start script in package.json, add civetman build to your build script. Now you can use .civet files. All the imports don't need the suffix .civet anymore, meaning that .civet files are treated the same as TypeScript files.

How it works

When you run pnpm civetman build (the same as npx civetman build), Civetman will collect all the .civet files and build them into TypeScript with the Civet compiler. Then, Civetman will create a <name>.ts file beside each .civet file. That is why you can import Civet files just like TypeScript files, since they ARE literally just TypeScript files.

What? You can't see the .ts files generated? That's because Civetman automatically put all the generated .ts files into the files.exclude in the .vscode/settings.json file. Then VSCode will hide all the bundled files in the file explorer. Those files are also added to .gitignore so that they won't be included by Git.

civetman dev is basically just building your files when they are changed.

It's recommended to add civetman build to the postinstall script in your package.json.

Examples

Several examples are available in the examples directory.

Documentation

CLI documentation:

Usage: civetman [options] [command]

Use Civet in any projects!

Options:
    -V, --version     output the version number
    -x, --tsx, --jsx  Generate `.tsx` files instead of `.ts` files
    --noGit           Civetman without writing `.gitignore` file
    --noVscode        Civetman without writing `.vscode/settings.json` file
    -h, --help        display help for command

Commands:
    build             Start building Civet files
    dev               Start building Civet files in watch mode
    help [command]    display help for command

civetman's People

Contributors

arstnei0 avatar krist7599555 avatar

Stargazers

Daniel Bayley avatar Lewin Kelly avatar  avatar Oren Elbaum avatar Mateo Lafalce avatar 0918nobita avatar Ray avatar coderaiser avatar Patrick G avatar Joshua Byrd avatar Tom Byrer avatar  avatar

Watchers

 avatar  avatar

Forkers

krist7599555

civetman's Issues

The need to convert both `.tsx` and `.ts` files in one project

Hi,

Thanks for a nice tool that makes civet easy to use.

I'm trying to use civet with civetman in nuxt project. Everything was great until I ran into the need for JSX components. Civetman only lets you compile *.civet files to either *.tsx or *.ts, but what if we need both in one project? How can we add this feature?

A couple of ways that come to my mind.

  1. Add an option specifying the pattern of directories in which to track to compile files to tsx, e.g.
    civetman -tsx components/**,pages/**.
  2. Change file naming with an option --no-ext that causes the .civet suffix to simply be dropped. And give files in the project names like component.tsx.civet or lib.ts.civet.

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.