{"id":15686389,"url":"https://github.com/wellwind/vscode-schematics-snippets","last_synced_at":"2025-05-07T18:46:37.810Z","repository":{"id":44975250,"uuid":"210792071","full_name":"wellwind/vscode-schematics-snippets","owner":"wellwind","description":"Code snippets collection for writing @angular-devkit/schematics","archived":false,"fork":false,"pushed_at":"2022-01-15T05:26:34.000Z","size":3148,"stargazers_count":9,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-26T03:41:22.433Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://marketplace.visualstudio.com/items?itemName=MikeHuang.vscode-schematics-snippets","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wellwind.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-25T08:17:46.000Z","updated_at":"2023-06-27T02:53:07.000Z","dependencies_parsed_at":"2022-09-14T05:42:04.853Z","dependency_job_id":null,"html_url":"https://github.com/wellwind/vscode-schematics-snippets","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wellwind%2Fvscode-schematics-snippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wellwind%2Fvscode-schematics-snippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wellwind%2Fvscode-schematics-snippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wellwind%2Fvscode-schematics-snippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wellwind","download_url":"https://codeload.github.com/wellwind/vscode-schematics-snippets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243007189,"owners_count":20220782,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T17:39:18.098Z","updated_at":"2025-03-11T09:31:44.116Z","avatar_url":"https://github.com/wellwind.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Schematics Snippets\n\nCode snippets collection for writing [@angular-devkit/schematics](https://www.npmjs.com/package/@angular-devkit/schematics)\n\n## Features\n\n- Generate schematic file: `F1` -\u003e `Schematics: Generate A Schematic`.\n- Snippets: Use `sch-*` snippets to generate schematics related codes.\n- Sometimes we might use TypeScript Compiler API, there are `ts-*` snippets to generate some useful AST (Abstract Syntax Tree) manipulation code.\n- For the full generated code of snippet, see it [here](docs/).\n\n### Generate schematic file\n\n![featire: generate schematic file](docs/images/feat-generate-schematic.gif)\n\n### Snippets\n\n#### In \\*.ts\n\n\u003c!-- Schematics Begin --\u003e\n\n| Snippet Name                       | Generated Code                                              | Description                                          |\n| ---------------------------------- | ----------------------------------------------------------- | ---------------------------------------------------- |\n| `sch-default-function`             | [code](docs/schematics/sch-default-function.md)             | Generate an export function with schematics template |\n| `sch-rule`                         | [code](docs/schematics/sch-rule.md)                         | Generate a basic rule of schematics                  |\n| `sch-tree-create`                  | [code](docs/schematics/sch-tree-create.md)                  | Create a file to the tree                            |\n| `sch-tree-overwrite`               | [code](docs/schematics/sch-tree-overwrite.md)               | Overwrite a file content from the tree               |\n| `sch-tree-delete`                  | [code](docs/schematics/sch-tree-delete.md)                  | Delete a file from the tree                          |\n| `sch-tree-delete-directory`        | [code](docs/schematics/sch-tree-delete-directory.md)        | Delete a directory from the tree                     |\n| `sch-tree-rename`                  | [code](docs/schematics/sch-tree-rename.md)                  | Rename a file from the tree                          |\n| `sch-tree-read`                    | [code](docs/schematics/sch-tree-read.md)                    | Read a file from the tree                            |\n| `sch-tree-exist`                   | [code](docs/schematics/sch-tree-exist.md)                   | Check a file exist in the tree                       |\n| `sch-import-external-schematic`    | [code](docs/schematics/sch-import-external-schematic.md)    | Import externalSchematic                             |\n| `sch-external-schematics`          | [code](docs/schematics/sch-external-schematics.md)          | Run external schematics                              |\n| `sch-import-chain`                 | [code](docs/schematics/sch-import-chain.md)                 | Import chain rule                                    |\n| `sch-chain-rules`                  | [code](docs/schematics/sch-chain-rules.md)                  | Chain schematic rules                                |\n| `sch-import-apply-merge-templates` | [code](docs/schematics/sch-import-apply-merge-templates.md) | Import rules to apply and merge templates            |\n| `sch-apply-merge-templates`        | [code](docs/schematics/sch-apply-merge-templates.md)        | Apply and merge templates                            |\n| `sch-read-json-file`               | [code](docs/schematics/sch-read-json-file.md)               | Read json file                                       |\n| `sch-write-json-file`              | [code](docs/schematics/sch-write-json-file.md)              | Write json file                                      |\n| `sch-create-json-file`             | [code](docs/schematics/sch-create-json-file.md)             | Create json file                                     |\n| `sch-import-install-package-task`  | [code](docs/schematics/sch-import-install-package-task.md)  | Import install package task                          |\n| `sch-install-package`              | [code](docs/schematics/sch-install-package.md)              | Run install package task                             |\n| `sch-set-package-dependencies`     | [code](docs/schematics/sch-set-package-dependencies.md)     | Set dependencies to package.json                     |\n| `sch-set-package-dev-dependencies` | [code](docs/schematics/sch-set-package-dev-dependencies.md) | Set devDependencies to package.json                  |\n| `sch-set-package-scripts`          | [code](docs/schematics/sch-set-package-scripts.md)          | Set script to package.json                           |\n\n\u003c!-- Schematics End --\u003e\n\n#### In schema.json\n\n\u003c!-- Schema Begin --\u003e\n\n| Snippet Name                    | Generated Code                                       | Description                                             |\n| ------------------------------- | ---------------------------------------------------- | ------------------------------------------------------- |\n| `sch-default-json`              | [code](docs/schema/sch-default-json.md)              | schema.json template                                    |\n| `sch-property`                  | [code](docs/schema/sch-property.md)                  | Add a property to schema.json                           |\n| `sch-property-prompt-input`     | [code](docs/schema/sch-property-prompt-input.md)     | Add a property to schema.json contains prompt input     |\n| `sch-property-prompt-yes-no`    | [code](docs/schema/sch-property-prompt-yes-no.md)    | Add a property to schema.json contains prompt Y/N       |\n| `sch-property-prompt-selection` | [code](docs/schema/sch-property-prompt-selection.md) | Add a property to schema.json contains prompt selection |\n| `sch-property-dollar-default`   | [code](docs/schema/sch-property-dollar-default.md)   | Property $default                                       |\n\n\u003c!-- Schema End --\u003e\n\n#### In collection.json\n\n\u003c!-- Collection Begin --\u003e\n\n| Snippet Name                      | Generated Code                                             | Description                                            |\n| --------------------------------- | ---------------------------------------------------------- | ------------------------------------------------------ |\n| `sch-new-schematic-default`       | [code](docs/collection/sch-new-schematic-default.md)       | Add a schematic to collection.json by deafult function |\n| `sch-new-schematic-function-name` | [code](docs/collection/sch-new-schematic-function-name.md) | Add a schematic to collection.json by function name    |\n| `sch-ng-add`                      | [code](docs/collection/sch-ng-add.md)                      | Add a schematic of \"ng-add\" to collection.json         |\n\n\u003c!-- Collection End --\u003e\n\n### TypeScript Compiler API Snippets\n\n\u003c!-- TypeScript Begin --\u003e\n\n| Snippet Name       | Generated Code                              | Description                    |\n| ------------------ | ------------------------------------------- | ------------------------------ |\n| `ts-import`        | [code](docs/typescript/ts-import.md)        | Import TypeScript Compiler API |\n| `ts-string-to-ast` | [code](docs/typescript/ts-string-to-ast.md) | Convert string to AST node     |\n| `ts-ast-to-code`   | [code](docs/typescript/ts-ast-to-code.md)   | Convert AST node to code       |\n\n\u003c!-- TypeScript End --\u003e\n\n## Release Notes\n\n### 5.0.0\n\n- Generate a schematic set by `F1` -\u003e `Schematics: Generate A Schematic`.\n- Add semicolon to single line snippet.\n\n### 4.0.1\n\n- Because of some technical problem, now we are in 4.0.1 😜.\n\n### 2.0.0\n\n- Now we support snippet in `schema.json` and `collection.json` separately.\n- 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.\n- Because it's a breaking change, so let's upgrade to `2.0.0`\n\n### 1.0.0\n\n- Initially add snippets\n\n## LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwellwind%2Fvscode-schematics-snippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwellwind%2Fvscode-schematics-snippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwellwind%2Fvscode-schematics-snippets/lists"}