Giter Club home page Giter Club logo

vscode-schematics-snippets's Introduction

Schematics Snippets

Code snippets collection for writing @angular-devkit/schematics

Features

  • Generate schematic file: F1 -> Schematics: Generate A Schematic.
  • Snippets: Use sch-* snippets to generate schematics related codes.
  • Sometimes we might use TypeScript Compiler API, there are ts-* snippets to generate some useful AST (Abstract Syntax Tree) manipulation code.
  • For the full generated code of snippet, see it here.

Generate schematic file

featire: generate schematic file

Snippets

In *.ts

Snippet Name Generated Code Description
sch-default-function code Generate an export function with schematics template
sch-rule code Generate a basic rule of schematics
sch-tree-create code Create a file to the tree
sch-tree-overwrite code Overwrite a file content from the tree
sch-tree-delete code Delete a file from the tree
sch-tree-delete-directory code Delete a directory from the tree
sch-tree-rename code Rename a file from the tree
sch-tree-read code Read a file from the tree
sch-tree-exist code Check a file exist in the tree
sch-import-external-schematic code Import externalSchematic
sch-external-schematics code Run external schematics
sch-import-chain code Import chain rule
sch-chain-rules code Chain schematic rules
sch-import-apply-merge-templates code Import rules to apply and merge templates
sch-apply-merge-templates code Apply and merge templates
sch-read-json-file code Read json file
sch-write-json-file code Write json file
sch-create-json-file code Create json file
sch-import-install-package-task code Import install package task
sch-install-package code Run install package task
sch-set-package-dependencies code Set dependencies to package.json
sch-set-package-dev-dependencies code Set devDependencies to package.json
sch-set-package-scripts code Set script to package.json

In schema.json

Snippet Name Generated Code Description
sch-default-json code schema.json template
sch-property code Add a property to schema.json
sch-property-prompt-input code Add a property to schema.json contains prompt input
sch-property-prompt-yes-no code Add a property to schema.json contains prompt Y/N
sch-property-prompt-selection code Add a property to schema.json contains prompt selection
sch-property-dollar-default code Property $default

In collection.json

Snippet Name Generated Code Description
sch-new-schematic-default code Add a schematic to collection.json by deafult function
sch-new-schematic-function-name code Add a schematic to collection.json by function name
sch-ng-add code Add a schematic of "ng-add" to collection.json

TypeScript Compiler API Snippets

Snippet Name Generated Code Description
ts-import code Import TypeScript Compiler API
ts-string-to-ast code Convert string to AST node
ts-ast-to-code code Convert AST node to code

Release Notes

5.0.0

  • Generate a schematic set by F1 -> Schematics: Generate A Schematic.
  • Add semicolon to single line snippet.

4.0.1

  • Because of some technical problem, now we are in 4.0.1 ๐Ÿ˜œ.

2.0.0

  • Now we support snippet in schema.json and collection.json separately.
  • In ver1, we use sch-schema-* and sch-coll-* to identify the snippet type in json file, but now we don't have to, so we remove schema- and coll- prefix.
  • Because it's a breaking change, so let's upgrade to 2.0.0

1.0.0

  • Initially add snippets

LICENSE

MIT

vscode-schematics-snippets's People

Contributors

leochen0818 avatar wellwind avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.