├── .gitignore ├── .vscode ├── launch.json ├── settings.json └── tasks.json ├── .vscodeignore ├── CHANGELOG.md ├── LICENCE.md ├── README.md ├── angular-gui.png ├── files ├── cli-1-5-4 │ ├── .angular-cli.json │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── e2e │ │ ├── app.e2e-spec.ts │ │ ├── app.po.ts │ │ └── tsconfig.e2e.json │ ├── karma.conf.js │ ├── package.json │ ├── protractor.conf.js │ ├── src │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ └── app.module.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.css │ │ ├── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.spec.json │ │ └── typings.d.ts │ ├── tsconfig.json │ └── tslint.json └── sch-0-1-7 │ └── @schematics │ └── angular │ ├── LICENSE │ ├── app-shell │ ├── index.d.ts │ ├── index.js │ ├── schema.d.ts │ └── schema.json │ ├── application │ ├── files │ │ ├── README.md │ │ ├── __dot__angular-cli.json │ │ ├── __dot__editorconfig │ │ ├── __dot__gitignore │ │ ├── __path__ │ │ │ ├── assets │ │ │ │ └── __dot__gitkeep │ │ │ ├── environments │ │ │ │ ├── environment.prod.ts │ │ │ │ └── environment.ts │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ ├── main.ts │ │ │ ├── ngsw-config.json │ │ │ ├── polyfills.ts │ │ │ ├── styles.__style__ │ │ │ ├── test.ts │ │ │ ├── tsconfig.app.json │ │ │ ├── tsconfig.spec.json │ │ │ └── typings.d.ts │ │ ├── e2e │ │ │ ├── app.e2e-spec.ts │ │ │ ├── app.po.ts │ │ │ └── tsconfig.e2e.json │ │ ├── karma.conf.js │ │ ├── package.json │ │ ├── protractor.conf.js │ │ ├── tsconfig.json │ │ └── tslint.json │ ├── index.d.ts │ ├── index.js │ ├── other-files │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ └── app.module.ts │ ├── schema.d.ts │ └── schema.json │ ├── class │ ├── files │ │ └── __path__ │ │ │ ├── __name@dasherize____type__.spec.ts │ │ │ └── __name@dasherize____type__.ts │ ├── index.d.ts │ ├── index.js │ ├── schema.d.ts │ └── schema.json │ ├── collection.json │ ├── component │ ├── files │ │ └── __path__ │ │ │ └── __name@dasherize@if-flat__ │ │ │ ├── __name@dasherize__.component.__styleext__ │ │ │ ├── __name@dasherize__.component.html │ │ │ ├── __name@dasherize__.component.spec.ts │ │ │ └── __name@dasherize__.component.ts │ ├── index.d.ts │ ├── index.js │ ├── schema.d.ts │ └── schema.json │ ├── directive │ ├── files │ │ └── __path__ │ │ │ └── __name@dasherize@if-flat__ │ │ │ ├── __name@dasherize__.directive.spec.ts │ │ │ └── __name@dasherize__.directive.ts │ ├── index.d.ts │ ├── index.js │ ├── schema.d.ts │ └── schema.json │ ├── enum │ ├── files │ │ └── __path__ │ │ │ └── __name@dasherize__.enum.ts │ ├── index.d.ts │ ├── index.js │ ├── schema.d.ts │ └── schema.json │ ├── guard │ ├── files │ │ └── __path__ │ │ │ ├── __name@dasherize__.guard.spec.ts │ │ │ └── __name@dasherize__.guard.ts │ ├── index.d.ts │ ├── index.js │ ├── schema.d.ts │ └── schema.json │ ├── interface │ ├── files │ │ └── __path__ │ │ │ └── __name@dasherize____type__.ts │ ├── index.d.ts │ ├── index.js │ ├── schema.d.ts │ └── schema.json │ ├── module │ ├── files │ │ └── __path__ │ │ │ └── __name@dasherize@if-flat__ │ │ │ ├── __name@dasherize__-routing.module.ts │ │ │ ├── __name@dasherize__.module.spec.ts │ │ │ └── __name@dasherize__.module.ts │ ├── index.d.ts │ ├── index.js │ ├── schema.d.ts │ └── schema.json │ ├── package.json │ ├── pipe │ ├── files │ │ └── __path__ │ │ │ └── __name@dasherize@if-flat__ │ │ │ ├── __name@dasherize__.pipe.spec.ts │ │ │ └── __name@dasherize__.pipe.ts │ ├── index.d.ts │ ├── index.js │ ├── schema.d.ts │ └── schema.json │ ├── service │ ├── files │ │ └── __path__ │ │ │ └── __name@dasherize@if-flat__ │ │ │ ├── __name@dasherize__.service.spec.ts │ │ │ └── __name@dasherize__.service.ts │ ├── index.d.ts │ ├── index.js │ ├── schema.d.ts │ └── schema.json │ ├── strings.d.ts │ ├── strings.js │ ├── universal │ ├── files │ │ └── __sourceDir__ │ │ │ ├── __appDir__ │ │ │ └── __rootModuleFileName__ │ │ │ ├── __main@stripTsExtension__.ts │ │ │ └── __tsconfigFileName__.json │ ├── index.d.ts │ ├── index.js │ ├── schema.d.ts │ └── schema.json │ └── utility │ ├── ast-utils.d.ts │ ├── ast-utils.js │ ├── change.d.ts │ ├── change.js │ ├── config.d.ts │ ├── config.js │ ├── find-module.d.ts │ ├── find-module.js │ ├── ng-ast-utils.d.ts │ ├── ng-ast-utils.js │ ├── route-utils.d.ts │ ├── route-utils.js │ └── test │ ├── create-app-module.d.ts │ ├── create-app-module.js │ ├── get-file-content.d.ts │ ├── get-file-content.js │ ├── index.d.ts │ └── index.js ├── package-lock.json ├── package.json ├── scripts ├── dev.sh ├── prod.sh └── schematics.sh ├── src ├── commands │ ├── build.ts │ ├── completion.ts │ ├── doc.ts │ ├── e2e.ts │ ├── eject.ts │ ├── generate.ts │ ├── index.ts │ ├── lint.ts │ ├── new.ts │ ├── serve.ts │ ├── shell.ts │ ├── test.ts │ ├── version.ts │ └── xi18n.ts ├── core │ ├── app.interface.ts │ ├── app.spec.ts │ ├── app.ts │ ├── command.interface.ts │ ├── config.ts │ ├── files.spec.ts │ ├── files.ts │ ├── helpers.spec.ts │ ├── helpers.ts │ ├── messages.ts │ ├── options.ts │ ├── runner.spec.ts │ ├── runner.ts │ ├── schematics.spec.ts │ ├── schematics.ts │ ├── utils.spec.ts │ └── utils.ts ├── extension.ts ├── images │ ├── angular-gui-alpha-0.0.1.gif │ ├── angular-gui-alpha-0.0.8.gif │ ├── angular-gui-alpha-0.1.2.gif │ ├── angular-gui-beta-0.4.2.gif │ ├── angular-gui-beta-0.4.5-mobile.gif │ ├── angular-gui.png │ ├── angular-gui.svg │ └── octicon-shield.png ├── local.ts ├── schematics │ ├── collection.json │ ├── express │ │ ├── index.ts │ │ └── schema.json │ └── package.json └── test.ts ├── tsconfig.json ├── tsconfig.schematics.json ├── vsc-extension-quickstart.md ├── wallaby.config.js ├── webpack.config.js └── webpack.local.js /.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | node_modules 3 | .vscode-test/ 4 | .vsix 5 | .angular-gui.json 6 | .angular-gui 7 | *.vsix 8 | schematics -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that compiles the extension and then opens it inside a new window 2 | { 3 | "version": "0.1.0", 4 | "configurations": [ 5 | { 6 | "type": "node", 7 | "request": "launch", 8 | "name": "Launch Local", 9 | "runtimeExecutable": "node", 10 | "program": "${workspaceFolder}/out/local.js", 11 | "restart": true, 12 | "console": "integratedTerminal", 13 | "internalConsoleOptions": "neverOpen", 14 | "preLaunchTask": "npm: build:schematics" 15 | }, 16 | { 17 | "name": "Launch Extension", 18 | "type": "extensionHost", 19 | "request": "launch", 20 | "runtimeExecutable": "${execPath}", 21 | "args": ["--extensionDevelopmentPath=${workspaceRoot}" ], 22 | "stopOnEntry": false, 23 | "sourceMaps": true, 24 | "outFiles": [ "${workspaceRoot}/out/**/*.js" ], 25 | "preLaunchTask": "npm: debug" 26 | }, 27 | { 28 | "name": "Launch Tests", 29 | "type": "extensionHost", 30 | "request": "launch", 31 | "runtimeExecutable": "${execPath}", 32 | "args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test" ], 33 | "stopOnEntry": false, 34 | "sourceMaps": true, 35 | "outFiles": [ "${workspaceRoot}/out/test/**/*.js" ], 36 | "preLaunchTask": "npm: watch" 37 | } 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "files.exclude": { 4 | "out": false // set this to true to hide the "out" folder with the compiled JS files 5 | }, 6 | "search.exclude": { 7 | "out": true // set this to false to include "out" folder in search results 8 | }, 9 | "typescript.tsdk": "node_modules\\typescript\\lib" 10 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // See https://go.microsoft.com/fwlink/?LinkId=733558 2 | // for the documentation about the tasks.json format 3 | { 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "npm", 8 | "script": "watch", 9 | "problemMatcher": "$tsc-watch", 10 | "isBackground": true, 11 | "presentation": { 12 | "reveal": "never" 13 | }, 14 | "group": { 15 | "kind": "build", 16 | "isDefault": true 17 | } 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | out/test/** 4 | out/**/*.map 5 | out/**/local.* 6 | src/** 7 | .gitignore 8 | tsconfig.json 9 | vsc-extension-quickstart.md 10 | webpack** 11 | scripts/** 12 | .angular-gui.json 13 | .angular-gui/** 14 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to the "angular-gui" extension will be documented in this file. 3 | 4 | # Version 0.4.3: 5 | * Fix: Inlcude `@angular-devkit` dependencies in the package 6 | 7 | # Version 0.4.2: Minor fixes 8 | * Fix: Race condition when rebuilding client configuration 9 | * Fix: Check if file exists before opening it 10 | * Fix: Don't include blueprints in configuration change check 11 | * Fix: Use `forEach` instead of `subscribe` for action subject (fixes vscode's `TypeError: Converting circular structure to JSON`) 12 | 13 | # Version 0.4.1: Minor fixes 14 | * Fix: Update workspace and extension paths 15 | * Fix: Improved module resolution for generate command 16 | * Fix: Improved handling of modified schematics 17 | * Feature: Notify client about configuration changes 18 | 19 | # Version 0.4.0: Beta release 20 | ## VSCode Extension 21 | * Schematics: 22 | * Run `express` schematic to set up serving from dist folder. Comes with support for gzip compression, and url rewrites. 23 | * Modify schematics templates and use them with generate command. 24 | * Configuration: 25 | * Configure which commands appear in client app with `angular-gui.commands` VSCode setting 26 | * Improved notifications and messages 27 | 28 | ## Web Client 29 | * Feature: Ability to run multiple commands in parallel 30 | * Feature: Progress indicator for commands that emit progress 31 | * Feature: Copy schematic files to your workspace and modify schematics templates 32 | 33 | # Version 0.3.3: 34 | * Fix: Open files from client with partial path 35 | 36 | # Version 0.3.2: 37 | * Fix: Module resolution for generate command 38 | * Feature: Add `angular-gui` schematics (*experimental*: there's no way to execute these schematics yet) 39 | * Add MIT licence 40 | 41 | # Version 0.3.0: Alpha release 42 | ## VSCode Extension 43 | * Feature: Add ability to open files from client 44 | * Fix: `commandOptions.environment` defaults are set to `['dev', 'prod']` 45 | * Refactor: generate command options 46 | 47 | ## Web Client 48 | * Feature: Open files from output panel in VSCode 49 | * Design: Highlight important command options 50 | * Design: Hide progress messages in output 51 | * Fix: Generated command scripts can be correctly executed 52 | 53 | # Version 0.2.0: Alpha release 54 | * Emit notifications and error messages for commands 55 | * Add ability to configure options and set defaults in VSCode settings 56 | * Add npm script to run saved commands 57 | 58 | You can now run saved commands by name, with: 59 | 60 | npm run . build.test 61 | 62 | # Version 0.1.4: Minor fixes 63 | * Workaround for `ng generate` issue with `engineHost.registerOptionsTransform()` [#266](https://github.com/angular/devkit/issues/266) 64 | * Add support for multiple VSCode workspaces 65 | 66 | # Version 0.1.3: Minor fixes 67 | * Add `completion`, `e2e` and `eject` commands 68 | * Remove `doc` and `version` commands 69 | * Change default extension folder to `.angular-gui` 70 | 71 | # Version 0.1.2: Alpha release 72 | ## Features: 73 | **Reusable commands** 74 | 75 | You can save commands as shell scripts and reuse them. Commands are saved in workspace folder `.angular-gui/commands` and can be executed from shell, for example: 76 | 77 | sh .angular-gui/commands/build.test.sh 78 | 79 | **Overview of all available command options** 80 | 81 | Command options are taken from Angular CLI source code; `ng generate` command options are loaded directly from project schematics. Any option can be configured with custom defaults. 82 | 83 | **Support for multiple schematics** 84 | 85 | Schematics options are normalized and extended schematics are resolved. 86 | 87 | > @nrwl/schematics are supported 88 | -------------------------------------------------------------------------------- /LICENCE.md: -------------------------------------------------------------------------------- 1 | GUI for Angular extension for Visual Studio Code 2 | 3 | Copyright (c) 2017 Aleksandar Milošević, [sasxa.net](https://www.sasxa.net) 4 | 5 | The MIT License 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GUI for Angular extension for Visual Studio Code 2 | 3 | ## Take charge of your Angular CLI projects! 4 | 5 | GUI for Angular helps you manage your Angular CLI projects with ease! `angular-gui` extension connects your Angular CLI project with https://angular-gui.firebaseapp.com allowing you to excute CLI commands from browser. 6 | 7 | ## How it works? 8 | 9 | `angular-gui` extension listens for commands from GUI for Angular client over socket connection and executes them in your workspace via node's `child_process` or via `@angular-devkit/schematics` for `ng generate` commands. 10 | 11 | ## Features 12 | 13 | * Overview of all available command options with configurable defaults 14 | * Reusable scripts with easy access to common options 15 | * Multiple schematics with ability to modify templates 16 | * Custom commands with shared options interface and access to project defaults 17 | 18 | ![Beta release](https://raw.githubusercontent.com/angular-gui/vscode-angular-gui/master/src/images/angular-gui-beta-0.4.2.gif) 19 | 20 | ## Activation 21 | 22 | Extension will be activated for Angular CLI projects (if there is a `.angular-cli.json` in project root). `.angular-cli.json` **is required** and it is used to generate configuration file for the client. 23 | 24 | 1. Start local server (listening on localhost:4300, by default) from: 25 | * status bar icon: ![shield icon](https://raw.githubusercontent.com/angular-gui/vscode-angular-gui/master/src/images/octicon-shield.png) 26 | * command palette: `GUI for Angular: Start in Online mode` 27 | 2. Open https://angular-gui.firebaseapp.com 28 | 3. Enjoy! 29 | 30 | ## Extension Settings 31 | 32 | This extension contributes the following settings: 33 | 34 | * `angular-gui.port`: Port for socket connection 35 | * `angular-gui.rootDir`: Workspace folder for GUI for Angular commands and settings 36 | * `angular-gui.npmRunner`: Name for the runner script that can be used to excute commands from terminal by name 37 | * `angular-gui.commandOptions`: Command options' values and defaults 38 | * `environment`: list of available environments 39 | * `target`: list of available targets 40 | * `collection`: list of available schematic collections 41 | * `styleext`: list of available style extensions 42 | * `angular-gui.commands`: List of commands that will be displayed in client app. 43 | 44 | Default value will be set to the first item from the list. 45 | 46 | You can add any other CLI command option to `angular-gui.commandOptions`, for example: 47 | 48 | "angular-gui.commandOptions.prefix": [ 49 | "app", 50 | "abc" 51 | ] 52 | 53 | will replace `prefix` option input from **text input** to **select box** for all commands that have prefix option. 54 | 55 | --- 56 | 57 | ## Known Issues 58 | 59 | * Generate `@nrwl/schematics:app` is creating a wrong paths. Move files manually and update `.angular-cli.json`. 60 | 61 | ## TODO: 62 | 63 | * Tests! 64 | 65 | ## Release notes and Change log 66 | 67 | * [GUI for Angular VSCode Extension](https://github.com/angular-gui/vscode-angular-gui/blob/master/CHANGELOG.md) 68 | * [GUI for Angular Client](https://github.com/angular-gui/client-angular-gui/blob/master/CHANGELOG.md) 69 | 70 | ## Feedback 71 | 72 | Please use following repositories to report bugs, ask questions and give feedback: 73 | 74 | * [GUI for Angular VSCode Extension](https://github.com/angular-gui/vscode-angular-gui/issues) 75 | * [GUI for Angular Client](https://github.com/angular-gui/client-angular-gui/issues) -------------------------------------------------------------------------------- /angular-gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angular-gui/vscode-angular-gui/60f2f310b0cd7145fc52e67f1601242cd5090a50/angular-gui.png -------------------------------------------------------------------------------- /files/cli-1-5-4/.angular-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "project": { 4 | "name": "test-project" 5 | }, 6 | "apps": [ 7 | { 8 | "root": "src", 9 | "outDir": "dist", 10 | "assets": [ 11 | "assets", 12 | "favicon.ico" 13 | ], 14 | "index": "index.html", 15 | "main": "main.ts", 16 | "polyfills": "polyfills.ts", 17 | "test": "test.ts", 18 | "tsconfig": "tsconfig.app.json", 19 | "testTsconfig": "tsconfig.spec.json", 20 | "prefix": "app", 21 | "styles": [ 22 | "styles.css" 23 | ], 24 | "scripts": [], 25 | "environmentSource": "environments/environment.ts", 26 | "environments": { 27 | "dev": "environments/environment.ts", 28 | "prod": "environments/environment.prod.ts" 29 | } 30 | } 31 | ], 32 | "e2e": { 33 | "protractor": { 34 | "config": "./protractor.conf.js" 35 | } 36 | }, 37 | "lint": [ 38 | { 39 | "project": "src/tsconfig.app.json", 40 | "exclude": "**/node_modules/**" 41 | }, 42 | { 43 | "project": "src/tsconfig.spec.json", 44 | "exclude": "**/node_modules/**" 45 | }, 46 | { 47 | "project": "e2e/tsconfig.e2e.json", 48 | "exclude": "**/node_modules/**" 49 | } 50 | ], 51 | "test": { 52 | "karma": { 53 | "config": "./karma.conf.js" 54 | } 55 | }, 56 | "defaults": { 57 | "styleExt": "css", 58 | "component": {} 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /files/cli-1-5-4/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /files/cli-1-5-4/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | testem.log 34 | /typings 35 | 36 | # e2e 37 | /e2e/*.js 38 | /e2e/*.map 39 | 40 | # System Files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /files/cli-1-5-4/README.md: -------------------------------------------------------------------------------- 1 | # TestProject 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.5.4. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /files/cli-1-5-4/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('test-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /files/cli-1-5-4/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /files/cli-1-5-4/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "jasminewd2", 11 | "node" 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /files/cli-1-5-4/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular/cli'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular/cli/plugins/karma') 14 | ], 15 | client:{ 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | reports: [ 'html', 'lcovonly' ], 20 | fixWebpackSourcePaths: true 21 | }, 22 | angularCli: { 23 | environment: 'dev' 24 | }, 25 | reporters: ['progress', 'kjhtml'], 26 | port: 9876, 27 | colors: true, 28 | logLevel: config.LOG_INFO, 29 | autoWatch: true, 30 | browsers: ['Chrome'], 31 | singleRun: false 32 | }); 33 | }; 34 | -------------------------------------------------------------------------------- /files/cli-1-5-4/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cli-1-5-4", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "scripts": { 6 | "ng": "ng", 7 | "start": "ng serve", 8 | "build": "ng build", 9 | "test": "ng test", 10 | "lint": "ng lint", 11 | "e2e": "ng e2e" 12 | }, 13 | "private": true, 14 | "dependencies": { 15 | "@angular/animations": "^5.0.0", 16 | "@angular/common": "^5.0.0", 17 | "@angular/compiler": "^5.0.0", 18 | "@angular/core": "^5.0.0", 19 | "@angular/forms": "^5.0.0", 20 | "@angular/http": "^5.0.0", 21 | "@angular/platform-browser": "^5.0.0", 22 | "@angular/platform-browser-dynamic": "^5.0.0", 23 | "@angular/router": "^5.0.0", 24 | "core-js": "^2.4.1", 25 | "rxjs": "^5.5.2", 26 | "zone.js": "^0.8.14" 27 | }, 28 | "devDependencies": { 29 | "@angular/cli": "1.5.4", 30 | "@angular/compiler-cli": "^5.0.0", 31 | "@angular/language-service": "^5.0.0", 32 | "@types/jasmine": "~2.5.53", 33 | "@types/jasminewd2": "~2.0.2", 34 | "@types/node": "~6.0.60", 35 | "codelyzer": "^4.0.1", 36 | "jasmine-core": "~2.6.2", 37 | "jasmine-spec-reporter": "~4.1.0", 38 | "karma": "~1.7.0", 39 | "karma-chrome-launcher": "~2.1.1", 40 | "karma-cli": "~1.0.1", 41 | "karma-coverage-istanbul-reporter": "^1.2.1", 42 | "karma-jasmine": "~1.1.0", 43 | "karma-jasmine-html-reporter": "^0.2.2", 44 | "protractor": "~5.1.2", 45 | "ts-node": "~3.2.0", 46 | "tslint": "~5.7.0", 47 | "typescript": "~2.4.2" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /files/cli-1-5-4/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './e2e/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: 'e2e/tsconfig.e2e.json' 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /files/cli-1-5-4/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angular-gui/vscode-angular-gui/60f2f310b0cd7145fc52e67f1601242cd5090a50/files/cli-1-5-4/src/app/app.component.css -------------------------------------------------------------------------------- /files/cli-1-5-4/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

4 | Welcome to {{ title }}! 5 |

6 | Angular Logo 7 |
8 |

Here are some links to help you start:

9 | 20 | 21 | -------------------------------------------------------------------------------- /files/cli-1-5-4/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | describe('AppComponent', () => { 4 | beforeEach(async(() => { 5 | TestBed.configureTestingModule({ 6 | declarations: [ 7 | AppComponent 8 | ], 9 | }).compileComponents(); 10 | })); 11 | it('should create the app', async(() => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.debugElement.componentInstance; 14 | expect(app).toBeTruthy(); 15 | })); 16 | it(`should have as title 'app'`, async(() => { 17 | const fixture = TestBed.createComponent(AppComponent); 18 | const app = fixture.debugElement.componentInstance; 19 | expect(app.title).toEqual('app'); 20 | })); 21 | it('should render title in a h1 tag', async(() => { 22 | const fixture = TestBed.createComponent(AppComponent); 23 | fixture.detectChanges(); 24 | const compiled = fixture.debugElement.nativeElement; 25 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!'); 26 | })); 27 | }); 28 | -------------------------------------------------------------------------------- /files/cli-1-5-4/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'app'; 10 | } 11 | -------------------------------------------------------------------------------- /files/cli-1-5-4/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | 5 | import { AppComponent } from './app.component'; 6 | 7 | 8 | @NgModule({ 9 | declarations: [ 10 | AppComponent 11 | ], 12 | imports: [ 13 | BrowserModule 14 | ], 15 | providers: [], 16 | bootstrap: [AppComponent] 17 | }) 18 | export class AppModule { } 19 | -------------------------------------------------------------------------------- /files/cli-1-5-4/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angular-gui/vscode-angular-gui/60f2f310b0cd7145fc52e67f1601242cd5090a50/files/cli-1-5-4/src/assets/.gitkeep -------------------------------------------------------------------------------- /files/cli-1-5-4/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /files/cli-1-5-4/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /files/cli-1-5-4/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angular-gui/vscode-angular-gui/60f2f310b0cd7145fc52e67f1601242cd5090a50/files/cli-1-5-4/src/favicon.ico -------------------------------------------------------------------------------- /files/cli-1-5-4/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | TestProject 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /files/cli-1-5-4/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /files/cli-1-5-4/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | // import 'core-js/es6/symbol'; 23 | // import 'core-js/es6/object'; 24 | // import 'core-js/es6/function'; 25 | // import 'core-js/es6/parse-int'; 26 | // import 'core-js/es6/parse-float'; 27 | // import 'core-js/es6/number'; 28 | // import 'core-js/es6/math'; 29 | // import 'core-js/es6/string'; 30 | // import 'core-js/es6/date'; 31 | // import 'core-js/es6/array'; 32 | // import 'core-js/es6/regexp'; 33 | // import 'core-js/es6/map'; 34 | // import 'core-js/es6/weak-map'; 35 | // import 'core-js/es6/set'; 36 | 37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 38 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 39 | 40 | /** IE10 and IE11 requires the following for the Reflect API. */ 41 | // import 'core-js/es6/reflect'; 42 | 43 | 44 | /** Evergreen browsers require these. **/ 45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. 46 | import 'core-js/es7/reflect'; 47 | 48 | 49 | /** 50 | * Required to support Web Animations `@angular/platform-browser/animations`. 51 | * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation 52 | **/ 53 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 54 | 55 | 56 | 57 | /*************************************************************************************************** 58 | * Zone JS is required by Angular itself. 59 | */ 60 | import 'zone.js/dist/zone'; // Included with Angular CLI. 61 | 62 | 63 | 64 | /*************************************************************************************************** 65 | * APPLICATION IMPORTS 66 | */ 67 | 68 | /** 69 | * Date, currency, decimal and percent pipes. 70 | * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 71 | */ 72 | // import 'intl'; // Run `npm install --save intl`. 73 | /** 74 | * Need to import at least one locale-data with intl. 75 | */ 76 | // import 'intl/locale-data/jsonp/en'; 77 | -------------------------------------------------------------------------------- /files/cli-1-5-4/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /files/cli-1-5-4/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/long-stack-trace-zone'; 4 | import 'zone.js/dist/proxy.js'; 5 | import 'zone.js/dist/sync-test'; 6 | import 'zone.js/dist/jasmine-patch'; 7 | import 'zone.js/dist/async-test'; 8 | import 'zone.js/dist/fake-async-test'; 9 | import { getTestBed } from '@angular/core/testing'; 10 | import { 11 | BrowserDynamicTestingModule, 12 | platformBrowserDynamicTesting 13 | } from '@angular/platform-browser-dynamic/testing'; 14 | 15 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. 16 | declare const __karma__: any; 17 | declare const require: any; 18 | 19 | // Prevent Karma from running prematurely. 20 | __karma__.loaded = function () {}; 21 | 22 | // First, initialize the Angular testing environment. 23 | getTestBed().initTestEnvironment( 24 | BrowserDynamicTestingModule, 25 | platformBrowserDynamicTesting() 26 | ); 27 | // Then we find all the tests. 28 | const context = require.context('./', true, /\.spec\.ts$/); 29 | // And load the modules. 30 | context.keys().map(context); 31 | // Finally, start Karma to run the tests. 32 | __karma__.start(); 33 | -------------------------------------------------------------------------------- /files/cli-1-5-4/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "baseUrl": "./", 6 | "module": "es2015", 7 | "types": [] 8 | }, 9 | "exclude": [ 10 | "test.ts", 11 | "**/*.spec.ts" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /files/cli-1-5-4/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | }, 13 | "files": [ 14 | "test.ts" 15 | ], 16 | "include": [ 17 | "**/*.spec.ts", 18 | "**/*.d.ts" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /files/cli-1-5-4/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /files/cli-1-5-4/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "outDir": "./dist/out-tsc", 5 | "sourceMap": true, 6 | "declaration": false, 7 | "moduleResolution": "node", 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "target": "es5", 11 | "typeRoots": [ 12 | "node_modules/@types" 13 | ], 14 | "lib": [ 15 | "es2017", 16 | "dom" 17 | ] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /files/cli-1-5-4/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "eofline": true, 15 | "forin": true, 16 | "import-blacklist": [ 17 | true, 18 | "rxjs", 19 | "rxjs/Rx" 20 | ], 21 | "import-spacing": true, 22 | "indent": [ 23 | true, 24 | "spaces" 25 | ], 26 | "interface-over-type-literal": true, 27 | "label-position": true, 28 | "max-line-length": [ 29 | true, 30 | 140 31 | ], 32 | "member-access": false, 33 | "member-ordering": [ 34 | true, 35 | { 36 | "order": [ 37 | "static-field", 38 | "instance-field", 39 | "static-method", 40 | "instance-method" 41 | ] 42 | } 43 | ], 44 | "no-arg": true, 45 | "no-bitwise": true, 46 | "no-console": [ 47 | true, 48 | "debug", 49 | "info", 50 | "time", 51 | "timeEnd", 52 | "trace" 53 | ], 54 | "no-construct": true, 55 | "no-debugger": true, 56 | "no-duplicate-super": true, 57 | "no-empty": false, 58 | "no-empty-interface": true, 59 | "no-eval": true, 60 | "no-inferrable-types": [ 61 | true, 62 | "ignore-params" 63 | ], 64 | "no-misused-new": true, 65 | "no-non-null-assertion": true, 66 | "no-shadowed-variable": true, 67 | "no-string-literal": false, 68 | "no-string-throw": true, 69 | "no-switch-case-fall-through": true, 70 | "no-trailing-whitespace": true, 71 | "no-unnecessary-initializer": true, 72 | "no-unused-expression": true, 73 | "no-use-before-declare": true, 74 | "no-var-keyword": true, 75 | "object-literal-sort-keys": false, 76 | "one-line": [ 77 | true, 78 | "check-open-brace", 79 | "check-catch", 80 | "check-else", 81 | "check-whitespace" 82 | ], 83 | "prefer-const": true, 84 | "quotemark": [ 85 | true, 86 | "single" 87 | ], 88 | "radix": true, 89 | "semicolon": [ 90 | true, 91 | "always" 92 | ], 93 | "triple-equals": [ 94 | true, 95 | "allow-null-check" 96 | ], 97 | "typedef-whitespace": [ 98 | true, 99 | { 100 | "call-signature": "nospace", 101 | "index-signature": "nospace", 102 | "parameter": "nospace", 103 | "property-declaration": "nospace", 104 | "variable-declaration": "nospace" 105 | } 106 | ], 107 | "typeof-compare": true, 108 | "unified-signatures": true, 109 | "variable-name": false, 110 | "whitespace": [ 111 | true, 112 | "check-branch", 113 | "check-decl", 114 | "check-operator", 115 | "check-separator", 116 | "check-type" 117 | ], 118 | "directive-selector": [ 119 | true, 120 | "attribute", 121 | "app", 122 | "camelCase" 123 | ], 124 | "component-selector": [ 125 | true, 126 | "element", 127 | "app", 128 | "kebab-case" 129 | ], 130 | "angular-whitespace": [true, "check-interpolation"], 131 | "no-output-on-prefix": true, 132 | "use-input-property-decorator": true, 133 | "use-output-property-decorator": true, 134 | "use-host-property-decorator": true, 135 | "no-input-rename": true, 136 | "no-output-rename": true, 137 | "use-life-cycle-interface": true, 138 | "use-pipe-transform-interface": true, 139 | "component-class-suffix": true, 140 | "directive-class-suffix": true 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2017 Google, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/app-shell/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Rule } from '@angular-devkit/schematics'; 2 | import 'rxjs/add/operator/merge'; 3 | import { Schema as AppShellOptions } from './schema'; 4 | export default function (options: AppShellOptions): Rule; 5 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/app-shell/schema.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google Inc. All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.io/license 7 | */ 8 | 9 | export interface Schema { 10 | /** 11 | * Name or index of related client app. 12 | */ 13 | clientApp?: string; 14 | /** 15 | * Name or index of related universal app. 16 | */ 17 | universalApp: string; 18 | /** 19 | * Route path used to produce the app shell. 20 | */ 21 | route?: string; 22 | /** 23 | * Name of the universal app 24 | */ 25 | name?: string; 26 | /** 27 | * The appId to use withServerTransition. 28 | */ 29 | appId?: string; 30 | /** 31 | * The output directory for build results. 32 | */ 33 | outDir?: string; 34 | /** 35 | * The root directory of the app. 36 | */ 37 | root?: string; 38 | /** 39 | * Name of the index file 40 | */ 41 | index?: string; 42 | /** 43 | * The name of the main entry-point file. 44 | */ 45 | main?: string; 46 | /** 47 | * The name of the test entry-point file. 48 | */ 49 | test?: string; 50 | /** 51 | * The name of the TypeScript configuration file. 52 | */ 53 | tsconfigFileName?: string; 54 | /** 55 | * The name of the TypeScript configuration file for tests. 56 | */ 57 | testTsconfigFileName?: string; 58 | /** 59 | * The name of the applicatino directory. 60 | */ 61 | appDir?: string; 62 | /** 63 | * The name of the root module file 64 | */ 65 | rootModuleFileName?: string; 66 | /** 67 | * The name of the root module class. 68 | */ 69 | rootModuleClassName?: string; 70 | sourceDir?: string; 71 | } 72 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/app-shell/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "id": "SchematicsAngularAppShell", 4 | "title": "Angular AppShell Options Schema", 5 | "type": "object", 6 | "properties": { 7 | "clientApp": { 8 | "type": "string", 9 | "description": "Name or index of related client app." 10 | }, 11 | "universalApp": { 12 | "type": "string", 13 | "description": "Name or index of related universal app." 14 | }, 15 | "route": { 16 | "type": "string", 17 | "description": "Route path used to produce the app shell.", 18 | "default": "shell" 19 | }, 20 | 21 | 22 | 23 | "name": { 24 | "type": "string", 25 | "description": "Name of the universal app" 26 | }, 27 | "appId": { 28 | "type": "string", 29 | "description": "The appId to use withServerTransition.", 30 | "default": "serverApp" 31 | }, 32 | "outDir": { 33 | "type": "string", 34 | "description": "The output directory for build results.", 35 | "default": "dist-server/" 36 | }, 37 | "root": { 38 | "type": "string", 39 | "description": "The root directory of the app.", 40 | "default": "src" 41 | }, 42 | "index": { 43 | "type": "string", 44 | "description": "Name of the index file", 45 | "default": "index.html" 46 | }, 47 | "main": { 48 | "type": "string", 49 | "description": "The name of the main entry-point file.", 50 | "default": "main.server.ts" 51 | }, 52 | "test": { 53 | "type": "string", 54 | "description": "The name of the test entry-point file." 55 | }, 56 | "tsconfigFileName": { 57 | "type": "string", 58 | "default": "tsconfig.server", 59 | "description": "The name of the TypeScript configuration file." 60 | }, 61 | "testTsconfigFileName": { 62 | "type": "string", 63 | "description": "The name of the TypeScript configuration file for tests.", 64 | "default": "tsconfig.spec" 65 | }, 66 | "appDir": { 67 | "type": "string", 68 | "description": "The name of the applicatino directory.", 69 | "default": "app" 70 | }, 71 | "rootModuleFileName": { 72 | "type": "string", 73 | "description": "The name of the root module file", 74 | "default": "app.server.module.ts" 75 | }, 76 | "rootModuleClassName": { 77 | "type": "string", 78 | "description": "The name of the root module class.", 79 | "default": "AppServerModule" 80 | }, 81 | "sourceDir": { 82 | "type": "string", 83 | "default": "src", 84 | "alias": "sd" 85 | } 86 | }, 87 | "required": [ 88 | "universalApp" 89 | ] 90 | } 91 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/README.md: -------------------------------------------------------------------------------- 1 | # <%= utils.classify(name) %> 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version <%= version %>. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/__dot__angular-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "project": { 4 | "name": "<%= utils.dasherize(name) %>" 5 | }, 6 | "apps": [ 7 | { 8 | "root": "<%= sourceDir %>", 9 | "outDir": "dist", 10 | "assets": [ 11 | "assets", 12 | "favicon.ico" 13 | ], 14 | "index": "index.html", 15 | "main": "main.ts", 16 | "polyfills": "polyfills.ts", 17 | "test": "test.ts", 18 | "tsconfig": "tsconfig.app.json", 19 | "testTsconfig": "tsconfig.spec.json", 20 | "prefix": "<%= prefix %>", 21 | "styles": [ 22 | "styles.<%= style %>" 23 | ], 24 | "scripts": [], 25 | "environmentSource": "environments/environment.ts", 26 | "environments": { 27 | "dev": "environments/environment.ts", 28 | "prod": "environments/environment.prod.ts" 29 | }<% if (serviceWorker) { %>, 30 | "serviceWorker": true<% } %> 31 | } 32 | ], 33 | "e2e": { 34 | "protractor": { 35 | "config": "./protractor.conf.js" 36 | } 37 | }, 38 | "lint": [ 39 | { 40 | "project": "<%= sourceDir %>/tsconfig.app.json", 41 | "exclude": "**/node_modules/**" 42 | }, 43 | { 44 | "project": "<%= sourceDir %>/tsconfig.spec.json", 45 | "exclude": "**/node_modules/**" 46 | }, 47 | { 48 | "project": "e2e/tsconfig.e2e.json", 49 | "exclude": "**/node_modules/**" 50 | } 51 | ], 52 | "test": { 53 | "karma": { 54 | "config": "./karma.conf.js" 55 | } 56 | }, 57 | "defaults": { 58 | "styleExt": "<%= style %>",<% if (minimal || skipTests) { %> 59 | "class": { 60 | "spec": false 61 | },<% } %> 62 | "component": {<% if (minimal || inlineStyle) { %> 63 | "inlineStyle": true<% } %><% if (minimal || (inlineTemplate && inlineStyle)) { %>,<% } %><% if (minimal || inlineTemplate) { %> 64 | "inlineTemplate": true<% } %><% if (minimal || (skipTests && (inlineStyle || inlineTemplate))) { %>,<% } %><% if (minimal || skipTests) { %> 65 | "spec": false 66 | <% } %>}<% if (minimal || skipTests) { %>, 67 | "directive": { 68 | "spec": false 69 | }, 70 | "guard": { 71 | "spec": false 72 | }, 73 | "module": { 74 | "spec": false 75 | }, 76 | "pipe": { 77 | "spec": false 78 | }, 79 | "service": { 80 | "spec": false 81 | }<% } %> 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/__dot__editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/__dot__gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | testem.log 34 | /typings 35 | 36 | # e2e 37 | /e2e/*.js 38 | /e2e/*.map 39 | 40 | # System Files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/__path__/assets/__dot__gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angular-gui/vscode-angular-gui/60f2f310b0cd7145fc52e67f1601242cd5090a50/files/sch-0-1-7/@schematics/angular/application/files/__path__/assets/__dot__gitkeep -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/__path__/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/__path__/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/__path__/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angular-gui/vscode-angular-gui/60f2f310b0cd7145fc52e67f1601242cd5090a50/files/sch-0-1-7/@schematics/angular/application/files/__path__/favicon.ico -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/__path__/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <%= utils.classify(name) %> 6 | 7 | 8 | 9 | 10 | 11 | 12 | <<%= prefix %>-root>-root> 13 | 14 | 15 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/__path__/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/__path__/ngsw-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "index": "/index.html", 3 | "assetGroups": [{ 4 | "name": "app", 5 | "installMode": "prefetch", 6 | "resources": { 7 | "files": [ 8 | "/favicon.ico", 9 | "/index.html" 10 | ], 11 | "versionedFiles": [ 12 | "/*.bundle.css", 13 | "/*.bundle.js", 14 | "/*.chunk.js" 15 | ] 16 | } 17 | }, { 18 | "name": "assets", 19 | "installMode": "lazy", 20 | "updateMode": "prefetch", 21 | "resources": { 22 | "files": [ 23 | "/assets/**" 24 | ] 25 | } 26 | }] 27 | } -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/__path__/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | // import 'core-js/es6/symbol'; 23 | // import 'core-js/es6/object'; 24 | // import 'core-js/es6/function'; 25 | // import 'core-js/es6/parse-int'; 26 | // import 'core-js/es6/parse-float'; 27 | // import 'core-js/es6/number'; 28 | // import 'core-js/es6/math'; 29 | // import 'core-js/es6/string'; 30 | // import 'core-js/es6/date'; 31 | // import 'core-js/es6/array'; 32 | // import 'core-js/es6/regexp'; 33 | // import 'core-js/es6/map'; 34 | // import 'core-js/es6/weak-map'; 35 | // import 'core-js/es6/set'; 36 | 37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 38 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 39 | 40 | /** IE10 and IE11 requires the following for the Reflect API. */ 41 | // import 'core-js/es6/reflect'; 42 | 43 | 44 | /** Evergreen browsers require these. **/ 45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. 46 | import 'core-js/es7/reflect'; 47 | 48 | 49 | /** 50 | * Required to support Web Animations `@angular/platform-browser/animations`. 51 | * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation 52 | **/ 53 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 54 | 55 | 56 | 57 | /*************************************************************************************************** 58 | * Zone JS is required by Angular itself. 59 | */ 60 | import 'zone.js/dist/zone'; // Included with Angular CLI. 61 | 62 | 63 | 64 | /*************************************************************************************************** 65 | * APPLICATION IMPORTS 66 | */ 67 | 68 | /** 69 | * Date, currency, decimal and percent pipes. 70 | * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 71 | */ 72 | // import 'intl'; // Run `npm install --save intl`. 73 | /** 74 | * Need to import at least one locale-data with intl. 75 | */ 76 | // import 'intl/locale-data/jsonp/en'; 77 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/__path__/styles.__style__: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/__path__/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/long-stack-trace-zone'; 4 | import 'zone.js/dist/proxy.js'; 5 | import 'zone.js/dist/sync-test'; 6 | import 'zone.js/dist/jasmine-patch'; 7 | import 'zone.js/dist/async-test'; 8 | import 'zone.js/dist/fake-async-test'; 9 | import { getTestBed } from '@angular/core/testing'; 10 | import { 11 | BrowserDynamicTestingModule, 12 | platformBrowserDynamicTesting 13 | } from '@angular/platform-browser-dynamic/testing'; 14 | 15 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. 16 | declare const __karma__: any; 17 | declare const require: any; 18 | 19 | // Prevent Karma from running prematurely. 20 | __karma__.loaded = function () {}; 21 | 22 | // First, initialize the Angular testing environment. 23 | getTestBed().initTestEnvironment( 24 | BrowserDynamicTestingModule, 25 | platformBrowserDynamicTesting() 26 | ); 27 | // Then we find all the tests. 28 | const context = require.context('./', true, /\.spec\.ts$/); 29 | // And load the modules. 30 | context.keys().map(context); 31 | // Finally, start Karma to run the tests. 32 | __karma__.start(); 33 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/__path__/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "<%= path.split('/').map(x => '..').join('/') %>/tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "<%= path.split('/').map(x => '..').join('/') %>/out-tsc/app", 5 | "baseUrl": "./", 6 | "module": "es2015", 7 | "types": [] 8 | }, 9 | "exclude": [ 10 | "test.ts", 11 | "**/*.spec.ts" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/__path__/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "<%= path.split('/').map(x => '..').join('/') %>/tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "<%= path.split('/').map(x => '..').join('/') %>/out-tsc/spec", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | }, 13 | "files": [ 14 | "test.ts" 15 | ], 16 | "include": [ 17 | "**/*.spec.ts", 18 | "**/*.d.ts" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/__path__/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('<%= utils.dasherize(name) %> App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to <%= prefix %>!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('<%= prefix %>-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "jasminewd2", 11 | "node" 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular/cli'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular/cli/plugins/karma') 14 | ], 15 | client:{ 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | reports: [ 'html', 'lcovonly' ], 20 | fixWebpackSourcePaths: true 21 | }, 22 | angularCli: { 23 | environment: 'dev' 24 | }, 25 | reporters: ['progress', 'kjhtml'], 26 | port: 9876, 27 | colors: true, 28 | logLevel: config.LOG_INFO, 29 | autoWatch: true, 30 | browsers: ['Chrome'], 31 | singleRun: false 32 | }); 33 | }; 34 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "<%= utils.dasherize(name) %>", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "scripts": { 6 | "ng": "ng", 7 | "start": "ng serve", 8 | "build": "ng build", 9 | "test": "ng test", 10 | "lint": "ng lint", 11 | "e2e": "ng e2e" 12 | }, 13 | "private": true, 14 | "dependencies": { 15 | "@angular/animations": "^5.0.0", 16 | "@angular/common": "^5.0.0", 17 | "@angular/compiler": "^5.0.0", 18 | "@angular/core": "^5.0.0", 19 | "@angular/forms": "^5.0.0", 20 | "@angular/http": "^5.0.0", 21 | "@angular/platform-browser": "^5.0.0", 22 | "@angular/platform-browser-dynamic": "^5.0.0", 23 | "@angular/router": "^5.0.0",<% if (serviceWorker) { %> 24 | "@angular/service-worker": "^5.0.0",<% } %> 25 | "core-js": "^2.4.1", 26 | "rxjs": "^5.5.2", 27 | "zone.js": "^0.8.14" 28 | }, 29 | "devDependencies": { 30 | "@angular/cli": "<%= version %>", 31 | "@angular/compiler-cli": "^5.0.0", 32 | "@angular/language-service": "^5.0.0",<% if (!minimal) { %> 33 | "@types/jasmine": "~2.5.53", 34 | "@types/jasminewd2": "~2.0.2", 35 | "@types/node": "~6.0.60", 36 | "codelyzer": "^4.0.1", 37 | "jasmine-core": "~2.6.2", 38 | "jasmine-spec-reporter": "~4.1.0", 39 | "karma": "~1.7.0", 40 | "karma-chrome-launcher": "~2.1.1", 41 | "karma-cli": "~1.0.1", 42 | "karma-coverage-istanbul-reporter": "^1.2.1", 43 | "karma-jasmine": "~1.1.0", 44 | "karma-jasmine-html-reporter": "^0.2.2", 45 | "protractor": "~5.1.2", 46 | "ts-node": "~3.2.0", 47 | "tslint": "~5.7.0",<% } %> 48 | "typescript": "~2.4.2" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './e2e/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: 'e2e/tsconfig.e2e.json' 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "outDir": "./dist/out-tsc", 5 | "sourceMap": true, 6 | "declaration": false, 7 | "moduleResolution": "node", 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "target": "es5", 11 | "typeRoots": [ 12 | "node_modules/@types" 13 | ], 14 | "lib": [ 15 | "es2017", 16 | "dom" 17 | ] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/files/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "eofline": true, 15 | "forin": true, 16 | "import-blacklist": [ 17 | true, 18 | "rxjs", 19 | "rxjs/Rx" 20 | ], 21 | "import-spacing": true, 22 | "indent": [ 23 | true, 24 | "spaces" 25 | ], 26 | "interface-over-type-literal": true, 27 | "label-position": true, 28 | "max-line-length": [ 29 | true, 30 | 140 31 | ], 32 | "member-access": false, 33 | "member-ordering": [ 34 | true, 35 | { 36 | "order": [ 37 | "static-field", 38 | "instance-field", 39 | "static-method", 40 | "instance-method" 41 | ] 42 | } 43 | ], 44 | "no-arg": true, 45 | "no-bitwise": true, 46 | "no-console": [ 47 | true, 48 | "debug", 49 | "info", 50 | "time", 51 | "timeEnd", 52 | "trace" 53 | ], 54 | "no-construct": true, 55 | "no-debugger": true, 56 | "no-duplicate-super": true, 57 | "no-empty": false, 58 | "no-empty-interface": true, 59 | "no-eval": true, 60 | "no-inferrable-types": [ 61 | true, 62 | "ignore-params" 63 | ], 64 | "no-misused-new": true, 65 | "no-non-null-assertion": true, 66 | "no-shadowed-variable": true, 67 | "no-string-literal": false, 68 | "no-string-throw": true, 69 | "no-switch-case-fall-through": true, 70 | "no-trailing-whitespace": true, 71 | "no-unnecessary-initializer": true, 72 | "no-unused-expression": true, 73 | "no-use-before-declare": true, 74 | "no-var-keyword": true, 75 | "object-literal-sort-keys": false, 76 | "one-line": [ 77 | true, 78 | "check-open-brace", 79 | "check-catch", 80 | "check-else", 81 | "check-whitespace" 82 | ], 83 | "prefer-const": true, 84 | "quotemark": [ 85 | true, 86 | "single" 87 | ], 88 | "radix": true, 89 | "semicolon": [ 90 | true, 91 | "always" 92 | ], 93 | "triple-equals": [ 94 | true, 95 | "allow-null-check" 96 | ], 97 | "typedef-whitespace": [ 98 | true, 99 | { 100 | "call-signature": "nospace", 101 | "index-signature": "nospace", 102 | "parameter": "nospace", 103 | "property-declaration": "nospace", 104 | "variable-declaration": "nospace" 105 | } 106 | ], 107 | "typeof-compare": true, 108 | "unified-signatures": true, 109 | "variable-name": false, 110 | "whitespace": [ 111 | true, 112 | "check-branch", 113 | "check-decl", 114 | "check-operator", 115 | "check-separator", 116 | "check-type" 117 | ], 118 | "directive-selector": [ 119 | true, 120 | "attribute", 121 | "<%= prefix %>", 122 | "camelCase" 123 | ], 124 | "component-selector": [ 125 | true, 126 | "element", 127 | "<%= prefix %>", 128 | "kebab-case" 129 | ], 130 | "angular-whitespace": [true, "check-interpolation"], 131 | "no-output-on-prefix": true, 132 | "use-input-property-decorator": true, 133 | "use-output-property-decorator": true, 134 | "use-host-property-decorator": true, 135 | "no-input-rename": true, 136 | "no-output-rename": true, 137 | "use-life-cycle-interface": true, 138 | "use-pipe-transform-interface": true, 139 | "component-class-suffix": true, 140 | "directive-class-suffix": true 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google Inc. All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.io/license 7 | */ 8 | import { Rule } from '@angular-devkit/schematics'; 9 | import { Schema as ApplicationOptions } from './schema'; 10 | export default function (options: ApplicationOptions): Rule; 11 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/other-files/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

4 | Welcome to {{ title }}! 5 |

6 | Angular Logo 7 |
8 |

Here are some links to help you start:

9 | 20 | <% if (routing) { %> 21 | <% } %> 22 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/other-files/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing';<% if (routing) { %> 2 | import { RouterTestingModule } from '@angular/router/testing';<% } %> 3 | import { AppComponent } from './app.component'; 4 | describe('AppComponent', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({<% if (routing) { %> 7 | imports: [ 8 | RouterTestingModule 9 | ],<% } %> 10 | declarations: [ 11 | AppComponent 12 | ], 13 | }).compileComponents(); 14 | })); 15 | it('should create the app', async(() => { 16 | const fixture = TestBed.createComponent(AppComponent); 17 | const app = fixture.debugElement.componentInstance; 18 | expect(app).toBeTruthy(); 19 | })); 20 | it(`should have as title '<%= prefix %>'`, async(() => { 21 | const fixture = TestBed.createComponent(AppComponent); 22 | const app = fixture.debugElement.componentInstance; 23 | expect(app.title).toEqual('<%= prefix %>'); 24 | })); 25 | it('should render title in a h1 tag', async(() => { 26 | const fixture = TestBed.createComponent(AppComponent); 27 | fixture.detectChanges(); 28 | const compiled = fixture.debugElement.nativeElement; 29 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to <%= prefix %>!'); 30 | })); 31 | }); 32 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/other-files/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: '<%= selector %>',<% if(inlineTemplate) { %> 5 | template: ` 6 | 7 |
8 |

9 | Welcome to {{title}}! 10 |

11 | 12 |
13 |

Here are some links to help you start:

14 | 25 | <% if (routing) { 26 | %><% 27 | } %> 28 | `,<% } else { %> 29 | templateUrl: './app.component.html',<% } if(inlineStyle) { %> 30 | styles: []<% } else { %> 31 | styleUrls: ['./app.component.<%= styleext %>']<% } %> 32 | }) 33 | export class AppComponent { 34 | title = '<%= prefix %>'; 35 | } 36 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/other-files/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | <% if (routing) { %> 4 | import { AppRoutingModule } from './app-routing.module';<% } %> 5 | <% if (serviceWorker) { %> 6 | import { ServiceWorkerModule } from '@angular/service-worker';<% } %> 7 | import { AppComponent } from './app.component'; 8 | <% if (serviceWorker) { %> 9 | import { environment } from '../environments/environment';<% } %> 10 | 11 | @NgModule({ 12 | declarations: [ 13 | AppComponent 14 | ], 15 | imports: [ 16 | BrowserModule<% if (routing) { %>, 17 | AppRoutingModule<% } %><% if (serviceWorker) { %>, 18 | environment.production ? ServiceWorkerModule.register('/ngsw-worker.js') : []<% } %> 19 | ], 20 | providers: [], 21 | bootstrap: [AppComponent] 22 | }) 23 | export class AppModule { } 24 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/schema.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google Inc. All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.io/license 7 | */ 8 | 9 | export interface Schema { 10 | /** 11 | * The directory name to create the app in. 12 | */ 13 | directory: string; 14 | path?: string; 15 | sourceDir?: string; 16 | name: string; 17 | /** 18 | * Specifies if the style will be in the ts file. 19 | */ 20 | inlineStyle?: boolean; 21 | /** 22 | * Specifies if the template will be in the ts file. 23 | */ 24 | inlineTemplate?: boolean; 25 | /** 26 | * Specifies the view encapsulation strategy. 27 | */ 28 | viewEncapsulation?: ('Emulated' | 'Native' | 'None'); 29 | /** 30 | * Specifies the change detection strategy. 31 | */ 32 | changeDetection?: ('Default' | 'OnPush'); 33 | version?: string; 34 | routing?: boolean; 35 | /** 36 | * The prefix to apply to generated selectors. 37 | */ 38 | prefix?: string; 39 | /** 40 | * The file extension to be used for style files. 41 | */ 42 | style?: string; 43 | /** 44 | * Skip creating spec files. 45 | */ 46 | skipTests?: boolean; 47 | /** 48 | * Skip initializing a git repository. 49 | */ 50 | skipGit?: boolean; 51 | /** 52 | * Should create a minimal app. 53 | */ 54 | minimal?: boolean; 55 | /** 56 | * Should install the @angular/service-worker. 57 | */ 58 | serviceWorker?: boolean; 59 | } 60 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/application/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "id": "SchematicsAngularApp", 4 | "title": "Angular Application Options Schema", 5 | "type": "object", 6 | "properties": { 7 | "directory": { 8 | "type": "string", 9 | "description": "The directory name to create the app in.", 10 | "alias": "dir" 11 | }, 12 | "path": { 13 | "type": "string", 14 | "default": "src" 15 | }, 16 | "sourceDir": { 17 | "type": "string", 18 | "default": "src", 19 | "alias": "sd" 20 | }, 21 | "name": { 22 | "type": "string" 23 | }, 24 | "inlineStyle": { 25 | "description": "Specifies if the style will be in the ts file.", 26 | "type": "boolean", 27 | "default": false, 28 | "alias": "is" 29 | }, 30 | "inlineTemplate": { 31 | "description": "Specifies if the template will be in the ts file.", 32 | "type": "boolean", 33 | "default": false, 34 | "alias": "it" 35 | }, 36 | "viewEncapsulation": { 37 | "description": "Specifies the view encapsulation strategy.", 38 | "enum": ["Emulated", "Native", "None"], 39 | "type": "string" 40 | }, 41 | "changeDetection": { 42 | "description": "Specifies the change detection strategy.", 43 | "enum": ["Default", "OnPush"], 44 | "type": "string", 45 | "default": "Default" 46 | }, 47 | "version": { 48 | "type": "string" 49 | }, 50 | "routing": { 51 | "type": "boolean", 52 | "default": false 53 | }, 54 | "prefix": { 55 | "type": "string", 56 | "description": "The prefix to apply to generated selectors.", 57 | "default": "app", 58 | "alias": "p" 59 | }, 60 | "style": { 61 | "description": "The file extension to be used for style files.", 62 | "type": "string", 63 | "default": "css" 64 | }, 65 | "skipTests": { 66 | "description": "Skip creating spec files.", 67 | "type": "boolean", 68 | "default": false, 69 | "alias": "st" 70 | }, 71 | "skipGit": { 72 | "description": "Skip initializing a git repository.", 73 | "type": "boolean", 74 | "default": false, 75 | "alias": "sg" 76 | }, 77 | "minimal": { 78 | "description": "Should create a minimal app.", 79 | "type": "boolean", 80 | "default": false 81 | }, 82 | "serviceWorker": { 83 | "description": "Should install the @angular/service-worker.", 84 | "type": "boolean", 85 | "default": false 86 | } 87 | }, 88 | "required": [ 89 | "name", 90 | "directory" 91 | ] 92 | } 93 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/class/files/__path__/__name@dasherize____type__.spec.ts: -------------------------------------------------------------------------------- 1 | import { <%= classify(name) %> } from './<%= dasherize(name) %><%= type %>'; 2 | 3 | describe('<%= classify(name) %>', () => { 4 | it('should create an instance', () => { 5 | expect(new <%= classify(name) %>()).toBeTruthy(); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/class/files/__path__/__name@dasherize____type__.ts: -------------------------------------------------------------------------------- 1 | export class <%= classify(name) %> { 2 | } 3 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/class/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Rule } from '@angular-devkit/schematics'; 2 | import { Schema as ClassOptions } from './schema'; 3 | export default function (options: ClassOptions): Rule; 4 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/class/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | /** 4 | * @license 5 | * Copyright Google Inc. All Rights Reserved. 6 | * 7 | * Use of this source code is governed by an MIT-style license that can be 8 | * found in the LICENSE file at https://angular.io/license 9 | */ 10 | const core_1 = require("@angular-devkit/core"); 11 | const schematics_1 = require("@angular-devkit/schematics"); 12 | const stringUtils = require("../strings"); 13 | function default_1(options) { 14 | options.type = !!options.type ? `.${options.type}` : ''; 15 | options.path = options.path ? core_1.normalize(options.path) : options.path; 16 | const sourceDir = options.sourceDir; 17 | if (!sourceDir) { 18 | throw new schematics_1.SchematicsException(`sourceDir option is required.`); 19 | } 20 | const templateSource = schematics_1.apply(schematics_1.url('./files'), [ 21 | options.spec ? schematics_1.noop() : schematics_1.filter(path => !path.endsWith('.spec.ts')), 22 | schematics_1.template(Object.assign({}, stringUtils, options)), 23 | schematics_1.move(sourceDir), 24 | ]); 25 | return schematics_1.chain([ 26 | schematics_1.branchAndMerge(schematics_1.chain([ 27 | schematics_1.mergeWith(templateSource), 28 | ])), 29 | ]); 30 | } 31 | exports.default = default_1; 32 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiL1VzZXJzL2hhbnNsL1NvdXJjZXMvaGFuc2wvZGV2a2l0LyIsInNvdXJjZXMiOlsicGFja2FnZXMvc2NoZW1hdGljcy9hbmd1bGFyL2NsYXNzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUE7Ozs7OztFQU1FO0FBQ0YsK0NBQWlEO0FBQ2pELDJEQVlvQztBQUNwQywwQ0FBMEM7QUFJMUMsbUJBQXlCLE9BQXFCO0lBQzVDLE9BQU8sQ0FBQyxJQUFJLEdBQUcsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxJQUFJLEdBQUcsSUFBSSxPQUFPLENBQUMsSUFBSSxFQUFFLEdBQUcsRUFBRSxDQUFDO0lBQ3hELE9BQU8sQ0FBQyxJQUFJLEdBQUcsT0FBTyxDQUFDLElBQUksR0FBRyxnQkFBUyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDO0lBQ3JFLE1BQU0sU0FBUyxHQUFHLE9BQU8sQ0FBQyxTQUFTLENBQUM7SUFDcEMsRUFBRSxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDO1FBQ2YsTUFBTSxJQUFJLGdDQUFtQixDQUFDLCtCQUErQixDQUFDLENBQUM7SUFDakUsQ0FBQztJQUVELE1BQU0sY0FBYyxHQUFHLGtCQUFLLENBQUMsZ0JBQUcsQ0FBQyxTQUFTLENBQUMsRUFBRTtRQUMzQyxPQUFPLENBQUMsSUFBSSxHQUFHLGlCQUFJLEVBQUUsR0FBRyxtQkFBTSxDQUFDLElBQUksSUFBSSxDQUFDLElBQUksQ0FBQyxRQUFRLENBQUMsVUFBVSxDQUFDLENBQUM7UUFDbEUscUJBQVEsbUJBQ0gsV0FBVyxFQUNYLE9BQWlCLEVBQ3BCO1FBQ0YsaUJBQUksQ0FBQyxTQUFTLENBQUM7S0FDaEIsQ0FBQyxDQUFDO0lBRUgsTUFBTSxDQUFDLGtCQUFLLENBQUM7UUFDWCwyQkFBYyxDQUFDLGtCQUFLLENBQUM7WUFDbkIsc0JBQVMsQ0FBQyxjQUFjLENBQUM7U0FDMUIsQ0FBQyxDQUFDO0tBQ0osQ0FBQyxDQUFDO0FBQ0wsQ0FBQztBQXRCRCw0QkFzQkMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQGxpY2Vuc2VcbiogQ29weXJpZ2h0IEdvb2dsZSBJbmMuIEFsbCBSaWdodHMgUmVzZXJ2ZWQuXG4qXG4qIFVzZSBvZiB0aGlzIHNvdXJjZSBjb2RlIGlzIGdvdmVybmVkIGJ5IGFuIE1JVC1zdHlsZSBsaWNlbnNlIHRoYXQgY2FuIGJlXG4qIGZvdW5kIGluIHRoZSBMSUNFTlNFIGZpbGUgYXQgaHR0cHM6Ly9hbmd1bGFyLmlvL2xpY2Vuc2VcbiovXG5pbXBvcnQgeyBub3JtYWxpemUgfSBmcm9tICdAYW5ndWxhci1kZXZraXQvY29yZSc7XG5pbXBvcnQge1xuICBSdWxlLFxuICBTY2hlbWF0aWNzRXhjZXB0aW9uLFxuICBhcHBseSxcbiAgYnJhbmNoQW5kTWVyZ2UsXG4gIGNoYWluLFxuICBmaWx0ZXIsXG4gIG1lcmdlV2l0aCxcbiAgbW92ZSxcbiAgbm9vcCxcbiAgdGVtcGxhdGUsXG4gIHVybCxcbn0gZnJvbSAnQGFuZ3VsYXItZGV2a2l0L3NjaGVtYXRpY3MnO1xuaW1wb3J0ICogYXMgc3RyaW5nVXRpbHMgZnJvbSAnLi4vc3RyaW5ncyc7XG5pbXBvcnQgeyBTY2hlbWEgYXMgQ2xhc3NPcHRpb25zIH0gZnJvbSAnLi9zY2hlbWEnO1xuXG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIChvcHRpb25zOiBDbGFzc09wdGlvbnMpOiBSdWxlIHtcbiAgb3B0aW9ucy50eXBlID0gISFvcHRpb25zLnR5cGUgPyBgLiR7b3B0aW9ucy50eXBlfWAgOiAnJztcbiAgb3B0aW9ucy5wYXRoID0gb3B0aW9ucy5wYXRoID8gbm9ybWFsaXplKG9wdGlvbnMucGF0aCkgOiBvcHRpb25zLnBhdGg7XG4gIGNvbnN0IHNvdXJjZURpciA9IG9wdGlvbnMuc291cmNlRGlyO1xuICBpZiAoIXNvdXJjZURpcikge1xuICAgIHRocm93IG5ldyBTY2hlbWF0aWNzRXhjZXB0aW9uKGBzb3VyY2VEaXIgb3B0aW9uIGlzIHJlcXVpcmVkLmApO1xuICB9XG5cbiAgY29uc3QgdGVtcGxhdGVTb3VyY2UgPSBhcHBseSh1cmwoJy4vZmlsZXMnKSwgW1xuICAgIG9wdGlvbnMuc3BlYyA/IG5vb3AoKSA6IGZpbHRlcihwYXRoID0+ICFwYXRoLmVuZHNXaXRoKCcuc3BlYy50cycpKSxcbiAgICB0ZW1wbGF0ZSh7XG4gICAgICAuLi5zdHJpbmdVdGlscyxcbiAgICAgIC4uLm9wdGlvbnMgYXMgb2JqZWN0LFxuICAgIH0pLFxuICAgIG1vdmUoc291cmNlRGlyKSxcbiAgXSk7XG5cbiAgcmV0dXJuIGNoYWluKFtcbiAgICBicmFuY2hBbmRNZXJnZShjaGFpbihbXG4gICAgICBtZXJnZVdpdGgodGVtcGxhdGVTb3VyY2UpLFxuICAgIF0pKSxcbiAgXSk7XG59XG4iXX0= -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/class/schema.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google Inc. All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.io/license 7 | */ 8 | 9 | export interface Schema { 10 | name: string; 11 | appRoot?: string; 12 | path?: string; 13 | sourceDir?: string; 14 | /** 15 | * Specifies if a spec file is generated. 16 | */ 17 | spec?: boolean; 18 | /** 19 | * Specifies the type of class. 20 | */ 21 | type?: string; 22 | } 23 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/class/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "id": "SchematicsAngularClass", 4 | "title": "Angular Class Options Schema", 5 | "type": "object", 6 | "properties": { 7 | "name": { 8 | "type": "string" 9 | }, 10 | "appRoot": { 11 | "type": "string" 12 | }, 13 | "path": { 14 | "type": "string", 15 | "default": "app" 16 | }, 17 | "sourceDir": { 18 | "type": "string", 19 | "default": "src" 20 | }, 21 | "spec": { 22 | "type": "boolean", 23 | "description": "Specifies if a spec file is generated.", 24 | "default": false 25 | }, 26 | "type": { 27 | "type": "string", 28 | "description": "Specifies the type of class.", 29 | "default": "" 30 | } 31 | }, 32 | "required": [ 33 | "name" 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/collection.json: -------------------------------------------------------------------------------- 1 | { 2 | "schematics": { 3 | "application": { 4 | "factory": "./application", 5 | "schema": "./application/schema.json", 6 | "description": "Create an Angular application." 7 | }, 8 | "class": { 9 | "aliases": [ "cl" ], 10 | "factory": "./class", 11 | "description": "Create a class.", 12 | "schema": "./class/schema.json" 13 | }, 14 | "component": { 15 | "aliases": [ "c" ], 16 | "factory": "./component", 17 | "description": "Create an Angular component.", 18 | "schema": "./component/schema.json" 19 | }, 20 | "directive": { 21 | "aliases": [ "d" ], 22 | "factory": "./directive", 23 | "description": "Create an Angular directive.", 24 | "schema": "./directive/schema.json" 25 | }, 26 | "enum": { 27 | "aliases": [ "e" ], 28 | "factory": "./enum", 29 | "description": "Create an enumeration.", 30 | "schema": "./enum/schema.json" 31 | }, 32 | "guard": { 33 | "aliases": [ "g" ], 34 | "factory": "./guard", 35 | "description": "Create a guard.", 36 | "schema": "./guard/schema.json" 37 | }, 38 | "interface": { 39 | "aliases": [ "i" ], 40 | "factory": "./interface", 41 | "description": "Create an interface.", 42 | "schema": "./interface/schema.json" 43 | }, 44 | "module": { 45 | "aliases": [ "m" ], 46 | "factory": "./module", 47 | "description": "Create an Angular module.", 48 | "schema": "./module/schema.json" 49 | }, 50 | "pipe": { 51 | "aliases": [ "p" ], 52 | "factory": "./pipe", 53 | "description": "Create an Angular pipe.", 54 | "schema": "./pipe/schema.json" 55 | }, 56 | "service": { 57 | "aliases": [ "s" ], 58 | "factory": "./service", 59 | "description": "Create an Angular service.", 60 | "schema": "./service/schema.json" 61 | }, 62 | "universal": { 63 | "factory": "./universal", 64 | "description": "Create an Angular universal app.", 65 | "schema": "./universal/schema.json" 66 | }, 67 | "appShell": { 68 | "aliases": [ "app-shell" ], 69 | "factory": "./app-shell", 70 | "description": "Create an app shell.", 71 | "schema": "./app-shell/schema.json" 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/component/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__styleext__: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angular-gui/vscode-angular-gui/60f2f310b0cd7145fc52e67f1601242cd5090a50/files/sch-0-1-7/@schematics/angular/component/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__styleext__ -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/component/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html: -------------------------------------------------------------------------------- 1 | <% if (htmlTemplate) { %><%= htmlTemplate %><% } else { %>

2 | <%= dasherize(name) %> works! 3 |

<% } %> 4 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/component/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component'; 4 | 5 | describe('<%= classify(name) %>Component', () => { 6 | let component: <%= classify(name) %>Component; 7 | let fixture: ComponentFixture<<%= classify(name) %>Component>; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ <%= classify(name) %>Component ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(<%= classify(name) %>Component); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/component/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit<% if(!!viewEncapsulation) { %>, ViewEncapsulation<% }%><% if(changeDetection !== 'Default') { %>, ChangeDetectionStrategy<% }%> } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: '<%= selector %>',<% if(inlineTemplate) { %> 5 | template: ` 6 |

7 | <%= dasherize(name) %> works! 8 |

9 | `,<% } else { %> 10 | templateUrl: './<%= dasherize(name) %>.component.html',<% } if(inlineStyle) { %> 11 | styles: []<% } else { %> 12 | styleUrls: ['./<%= dasherize(name) %>.component.<%= styleext %>']<% } %><% if(!!viewEncapsulation) { %>, 13 | encapsulation: ViewEncapsulation.<%= viewEncapsulation %><% } if (changeDetection !== 'Default') { %>, 14 | changeDetection: ChangeDetectionStrategy.<%= changeDetection %><% } %> 15 | }) 16 | export class <%= classify(name) %>Component implements OnInit { 17 | 18 | constructor() { } 19 | 20 | ngOnInit() { 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/component/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Rule } from '@angular-devkit/schematics'; 2 | import 'rxjs/add/operator/merge'; 3 | import { Schema as ComponentOptions } from './schema'; 4 | export default function (options: ComponentOptions): Rule; 5 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/component/schema.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google Inc. All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.io/license 7 | */ 8 | 9 | export interface Schema { 10 | path?: string; 11 | appRoot?: string; 12 | sourceDir?: string; 13 | name: string; 14 | /** 15 | * Specifies if the style will be in the ts file. 16 | */ 17 | inlineStyle?: boolean; 18 | /** 19 | * Specifies if the template will be in the ts file. 20 | */ 21 | inlineTemplate?: boolean; 22 | /** 23 | * Specifies the view encapsulation strategy. 24 | */ 25 | viewEncapsulation?: ('Emulated' | 'Native' | 'None'); 26 | /** 27 | * Specifies the change detection strategy. 28 | */ 29 | changeDetection?: ('Default' | 'OnPush'); 30 | routing?: boolean; 31 | /** 32 | * The prefix to apply to generated selectors. 33 | */ 34 | prefix?: string; 35 | /** 36 | * The file extension to be used for style files. 37 | */ 38 | styleext?: string; 39 | spec?: boolean; 40 | /** 41 | * Flag to indicate if a dir is created. 42 | */ 43 | flat?: boolean; 44 | htmlTemplate?: string; 45 | skipImport?: boolean; 46 | selector?: string; 47 | /** 48 | * Allows specification of the declaring module. 49 | */ 50 | module?: string; 51 | /** 52 | * Specifies if declaring module exports the component. 53 | */ 54 | export?: boolean; 55 | } 56 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/component/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "id": "SchematicsAngularComponent", 4 | "title": "Angular Application Options Schema", 5 | "type": "object", 6 | "properties": { 7 | "path": { 8 | "type": "string", 9 | "default": "app" 10 | }, 11 | "appRoot": { 12 | "type": "string" 13 | }, 14 | "sourceDir": { 15 | "type": "string", 16 | "default": "src", 17 | "alias": "sd" 18 | }, 19 | "name": { 20 | "type": "string" 21 | }, 22 | "inlineStyle": { 23 | "description": "Specifies if the style will be in the ts file.", 24 | "type": "boolean", 25 | "default": false, 26 | "alias": "is" 27 | }, 28 | "inlineTemplate": { 29 | "description": "Specifies if the template will be in the ts file.", 30 | "type": "boolean", 31 | "default": false, 32 | "alias": "it" 33 | }, 34 | "viewEncapsulation": { 35 | "description": "Specifies the view encapsulation strategy.", 36 | "enum": ["Emulated", "Native", "None"], 37 | "type": "string", 38 | "alias": "ve" 39 | }, 40 | "changeDetection": { 41 | "description": "Specifies the change detection strategy.", 42 | "enum": ["Default", "OnPush"], 43 | "type": "string", 44 | "default": "Default", 45 | "alias": "cd" 46 | }, 47 | "routing": { 48 | "type": "boolean", 49 | "default": false 50 | }, 51 | "prefix": { 52 | "type": "string", 53 | "description": "The prefix to apply to generated selectors.", 54 | "default": "app", 55 | "alias": "p" 56 | }, 57 | "styleext": { 58 | "description": "The file extension to be used for style files.", 59 | "type": "string", 60 | "default": "css" 61 | }, 62 | "spec": { 63 | "type": "boolean", 64 | "default": true 65 | }, 66 | "flat": { 67 | "type": "boolean", 68 | "description": "Flag to indicate if a dir is created.", 69 | "default": false 70 | }, 71 | "htmlTemplate": { 72 | "type": "string" 73 | }, 74 | "skipImport": { 75 | "type": "boolean", 76 | "default": false 77 | }, 78 | "selector": { 79 | "type": "string" 80 | }, 81 | "module": { 82 | "type": "string", 83 | "description": "Allows specification of the declaring module.", 84 | "alias": "m" 85 | }, 86 | "export": { 87 | "type": "boolean", 88 | "default": false, 89 | "description": "Specifies if declaring module exports the component." 90 | } 91 | }, 92 | "required": [ 93 | "name" 94 | ] 95 | } 96 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/directive/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.directive.spec.ts: -------------------------------------------------------------------------------- 1 | import { <%= classify(name) %>Directive } from './<%= dasherize(name) %>.directive'; 2 | 3 | describe('<%= classify(name) %>Directive', () => { 4 | it('should create an instance', () => { 5 | const directive = new <%= classify(name) %>Directive(); 6 | expect(directive).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/directive/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.directive.ts: -------------------------------------------------------------------------------- 1 | import { Directive } from '@angular/core'; 2 | 3 | @Directive({ 4 | selector: '[<%= selector %>]' 5 | }) 6 | export class <%= classify(name) %>Directive { 7 | 8 | constructor() { } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/directive/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Rule } from '@angular-devkit/schematics'; 2 | import 'rxjs/add/operator/merge'; 3 | import { Schema as DirectiveOptions } from './schema'; 4 | export default function (options: DirectiveOptions): Rule; 5 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/directive/schema.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google Inc. All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.io/license 7 | */ 8 | 9 | export interface Schema { 10 | name: string; 11 | path?: string; 12 | appRoot?: string; 13 | /** 14 | * The prefix to apply to generated selectors. 15 | */ 16 | prefix?: string; 17 | sourceDir?: string; 18 | /** 19 | * Specifies if a spec file is generated. 20 | */ 21 | spec?: boolean; 22 | skipImport?: boolean; 23 | selector?: string; 24 | /** 25 | * Flag to indicate if a dir is created. 26 | */ 27 | flat?: boolean; 28 | /** 29 | * Allows specification of the declaring module. 30 | */ 31 | module?: string; 32 | /** 33 | * Specifies if declaring module exports the directive. 34 | */ 35 | export?: boolean; 36 | } 37 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/directive/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "id": "SchematicsAngularClass", 4 | "title": "Angular Class Options Schema", 5 | "type": "object", 6 | "properties": { 7 | "name": { 8 | "type": "string" 9 | }, 10 | "path": { 11 | "type": "string", 12 | "default": "app" 13 | }, 14 | "appRoot": { 15 | "type": "string" 16 | }, 17 | "prefix": { 18 | "type": "string", 19 | "description": "The prefix to apply to generated selectors.", 20 | "default": "app", 21 | "alias": "p" 22 | }, 23 | "sourceDir": { 24 | "type": "string", 25 | "default": "src" 26 | }, 27 | "spec": { 28 | "type": "boolean", 29 | "description": "Specifies if a spec file is generated.", 30 | "default": true 31 | }, 32 | "skipImport": { 33 | "type": "boolean", 34 | "default": false 35 | }, 36 | "selector": { 37 | "type": "string" 38 | }, 39 | "flat": { 40 | "type": "boolean", 41 | "description": "Flag to indicate if a dir is created.", 42 | "default": true 43 | }, 44 | "module": { 45 | "type": "string", 46 | "description": "Allows specification of the declaring module.", 47 | "alias": "m" 48 | }, 49 | "export": { 50 | "type": "boolean", 51 | "default": false, 52 | "description": "Specifies if declaring module exports the directive." 53 | } 54 | }, 55 | "required": [ 56 | "name" 57 | ] 58 | } 59 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/enum/files/__path__/__name@dasherize__.enum.ts: -------------------------------------------------------------------------------- 1 | export enum <%= classify(name) %> { 2 | } 3 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/enum/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Rule } from '@angular-devkit/schematics'; 2 | import { Schema as EnumOptions } from './schema'; 3 | export default function (options: EnumOptions): Rule; 4 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/enum/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | /** 4 | * @license 5 | * Copyright Google Inc. All Rights Reserved. 6 | * 7 | * Use of this source code is governed by an MIT-style license that can be 8 | * found in the LICENSE file at https://angular.io/license 9 | */ 10 | const core_1 = require("@angular-devkit/core"); 11 | const schematics_1 = require("@angular-devkit/schematics"); 12 | const stringUtils = require("../strings"); 13 | function default_1(options) { 14 | options.path = options.path ? core_1.normalize(options.path) : options.path; 15 | const sourceDir = options.sourceDir; 16 | if (!sourceDir) { 17 | throw new schematics_1.SchematicsException(`sourceDir option is required.`); 18 | } 19 | const templateSource = schematics_1.apply(schematics_1.url('./files'), [ 20 | schematics_1.template(Object.assign({}, stringUtils, options)), 21 | schematics_1.move(sourceDir), 22 | ]); 23 | return schematics_1.chain([ 24 | schematics_1.branchAndMerge(schematics_1.chain([ 25 | schematics_1.mergeWith(templateSource), 26 | ])), 27 | ]); 28 | } 29 | exports.default = default_1; 30 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiL1VzZXJzL2hhbnNsL1NvdXJjZXMvaGFuc2wvZGV2a2l0LyIsInNvdXJjZXMiOlsicGFja2FnZXMvc2NoZW1hdGljcy9hbmd1bGFyL2VudW0vaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQTs7Ozs7O0VBTUU7QUFDRiwrQ0FBaUQ7QUFDakQsMkRBVW9DO0FBQ3BDLDBDQUEwQztBQUkxQyxtQkFBeUIsT0FBb0I7SUFDM0MsT0FBTyxDQUFDLElBQUksR0FBRyxPQUFPLENBQUMsSUFBSSxHQUFHLGdCQUFTLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUM7SUFDckUsTUFBTSxTQUFTLEdBQUcsT0FBTyxDQUFDLFNBQVMsQ0FBQztJQUNwQyxFQUFFLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUM7UUFDZixNQUFNLElBQUksZ0NBQW1CLENBQUMsK0JBQStCLENBQUMsQ0FBQztJQUNqRSxDQUFDO0lBRUQsTUFBTSxjQUFjLEdBQUcsa0JBQUssQ0FBQyxnQkFBRyxDQUFDLFNBQVMsQ0FBQyxFQUFFO1FBQzNDLHFCQUFRLG1CQUNILFdBQVcsRUFDWCxPQUFpQixFQUNwQjtRQUNGLGlCQUFJLENBQUMsU0FBUyxDQUFDO0tBQ2hCLENBQUMsQ0FBQztJQUVILE1BQU0sQ0FBQyxrQkFBSyxDQUFDO1FBQ1gsMkJBQWMsQ0FBQyxrQkFBSyxDQUFDO1lBQ25CLHNCQUFTLENBQUMsY0FBYyxDQUFDO1NBQzFCLENBQUMsQ0FBQztLQUNKLENBQUMsQ0FBQztBQUNMLENBQUM7QUFwQkQsNEJBb0JDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4qIEBsaWNlbnNlXG4qIENvcHlyaWdodCBHb29nbGUgSW5jLiBBbGwgUmlnaHRzIFJlc2VydmVkLlxuKlxuKiBVc2Ugb2YgdGhpcyBzb3VyY2UgY29kZSBpcyBnb3Zlcm5lZCBieSBhbiBNSVQtc3R5bGUgbGljZW5zZSB0aGF0IGNhbiBiZVxuKiBmb3VuZCBpbiB0aGUgTElDRU5TRSBmaWxlIGF0IGh0dHBzOi8vYW5ndWxhci5pby9saWNlbnNlXG4qL1xuaW1wb3J0IHsgbm9ybWFsaXplIH0gZnJvbSAnQGFuZ3VsYXItZGV2a2l0L2NvcmUnO1xuaW1wb3J0IHtcbiAgUnVsZSxcbiAgU2NoZW1hdGljc0V4Y2VwdGlvbixcbiAgYXBwbHksXG4gIGJyYW5jaEFuZE1lcmdlLFxuICBjaGFpbixcbiAgbWVyZ2VXaXRoLFxuICBtb3ZlLFxuICB0ZW1wbGF0ZSxcbiAgdXJsLFxufSBmcm9tICdAYW5ndWxhci1kZXZraXQvc2NoZW1hdGljcyc7XG5pbXBvcnQgKiBhcyBzdHJpbmdVdGlscyBmcm9tICcuLi9zdHJpbmdzJztcbmltcG9ydCB7IFNjaGVtYSBhcyBFbnVtT3B0aW9ucyB9IGZyb20gJy4vc2NoZW1hJztcblxuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiAob3B0aW9uczogRW51bU9wdGlvbnMpOiBSdWxlIHtcbiAgb3B0aW9ucy5wYXRoID0gb3B0aW9ucy5wYXRoID8gbm9ybWFsaXplKG9wdGlvbnMucGF0aCkgOiBvcHRpb25zLnBhdGg7XG4gIGNvbnN0IHNvdXJjZURpciA9IG9wdGlvbnMuc291cmNlRGlyO1xuICBpZiAoIXNvdXJjZURpcikge1xuICAgIHRocm93IG5ldyBTY2hlbWF0aWNzRXhjZXB0aW9uKGBzb3VyY2VEaXIgb3B0aW9uIGlzIHJlcXVpcmVkLmApO1xuICB9XG5cbiAgY29uc3QgdGVtcGxhdGVTb3VyY2UgPSBhcHBseSh1cmwoJy4vZmlsZXMnKSwgW1xuICAgIHRlbXBsYXRlKHtcbiAgICAgIC4uLnN0cmluZ1V0aWxzLFxuICAgICAgLi4ub3B0aW9ucyBhcyBvYmplY3QsXG4gICAgfSksXG4gICAgbW92ZShzb3VyY2VEaXIpLFxuICBdKTtcblxuICByZXR1cm4gY2hhaW4oW1xuICAgIGJyYW5jaEFuZE1lcmdlKGNoYWluKFtcbiAgICAgIG1lcmdlV2l0aCh0ZW1wbGF0ZVNvdXJjZSksXG4gICAgXSkpLFxuICBdKTtcbn1cbiJdfQ== -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/enum/schema.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google Inc. All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.io/license 7 | */ 8 | 9 | export interface Schema { 10 | name: string; 11 | path?: string; 12 | appRoot?: string; 13 | sourceDir?: string; 14 | } 15 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/enum/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "id": "SchematicsAngularEnum", 4 | "title": "Angular Enum Options Schema", 5 | "type": "object", 6 | "properties": { 7 | "name": { 8 | "type": "string" 9 | }, 10 | "path": { 11 | "type": "string", 12 | "default": "app" 13 | }, 14 | "appRoot": { 15 | "type": "string" 16 | }, 17 | "sourceDir": { 18 | "type": "string", 19 | "default": "src" 20 | } 21 | }, 22 | "required": [ 23 | "name" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/guard/files/__path__/__name@dasherize__.guard.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async, inject } from '@angular/core/testing'; 2 | 3 | import { <%= classify(name) %>Guard } from './<%= dasherize(name) %>.guard'; 4 | 5 | describe('<%= classify(name) %>Guard', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [<%= classify(name) %>Guard] 9 | }); 10 | }); 11 | 12 | it('should ...', inject([<%= classify(name) %>Guard], (guard: <%= classify(name) %>Guard) => { 13 | expect(guard).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/guard/files/__path__/__name@dasherize__.guard.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; 3 | import { Observable } from 'rxjs/Observable'; 4 | 5 | @Injectable() 6 | export class <%= classify(name) %>Guard implements CanActivate { 7 | canActivate( 8 | next: ActivatedRouteSnapshot, 9 | state: RouterStateSnapshot): Observable | Promise | boolean { 10 | return true; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/guard/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Rule } from '@angular-devkit/schematics'; 2 | import 'rxjs/add/operator/merge'; 3 | import { Schema as GuardOptions } from './schema'; 4 | export default function (options: GuardOptions): Rule; 5 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/guard/schema.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google Inc. All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.io/license 7 | */ 8 | 9 | export interface Schema { 10 | name: string; 11 | spec?: boolean; 12 | flat?: boolean; 13 | /** 14 | * Allows specification of the declaring module. 15 | */ 16 | module?: string; 17 | path?: string; 18 | appRoot?: string; 19 | sourceDir?: string; 20 | } 21 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/guard/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "id": "SchematicsAngularGuard", 4 | "title": "Angular Guard Options Schema", 5 | "type": "object", 6 | "properties": { 7 | "name": { 8 | "type": "string" 9 | }, 10 | "spec": { 11 | "type": "boolean", 12 | "default": true 13 | }, 14 | "flat": { 15 | "type": "boolean", 16 | "default": true 17 | }, 18 | "module": { 19 | "type": "string", 20 | "description": "Allows specification of the declaring module.", 21 | "alias": "m", 22 | "subtype": "filepath" 23 | }, 24 | "path": { 25 | "type": "string", 26 | "default": "app" 27 | }, 28 | "appRoot": { 29 | "type": "string" 30 | }, 31 | "sourceDir": { 32 | "type": "string", 33 | "default": "src" 34 | } 35 | }, 36 | "required": [ 37 | "name" 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/interface/files/__path__/__name@dasherize____type__.ts: -------------------------------------------------------------------------------- 1 | export interface <%= prefix %><%= classify(name) %> { 2 | } 3 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/interface/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Rule } from '@angular-devkit/schematics'; 2 | import { Schema as InterfaceOptions } from './schema'; 3 | export default function (options: InterfaceOptions): Rule; 4 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/interface/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | /** 4 | * @license 5 | * Copyright Google Inc. All Rights Reserved. 6 | * 7 | * Use of this source code is governed by an MIT-style license that can be 8 | * found in the LICENSE file at https://angular.io/license 9 | */ 10 | const core_1 = require("@angular-devkit/core"); 11 | const schematics_1 = require("@angular-devkit/schematics"); 12 | const stringUtils = require("../strings"); 13 | function default_1(options) { 14 | options.prefix = options.prefix ? options.prefix : ''; 15 | options.type = !!options.type ? `.${options.type}` : ''; 16 | options.path = options.path ? core_1.normalize(options.path) : options.path; 17 | const sourceDir = options.sourceDir; 18 | if (!sourceDir) { 19 | throw new schematics_1.SchematicsException(`sourceDir option is required.`); 20 | } 21 | const templateSource = schematics_1.apply(schematics_1.url('./files'), [ 22 | schematics_1.template(Object.assign({}, stringUtils, options)), 23 | schematics_1.move(sourceDir), 24 | ]); 25 | return schematics_1.chain([ 26 | schematics_1.branchAndMerge(schematics_1.chain([ 27 | schematics_1.mergeWith(templateSource), 28 | ])), 29 | ]); 30 | } 31 | exports.default = default_1; 32 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiL1VzZXJzL2hhbnNsL1NvdXJjZXMvaGFuc2wvZGV2a2l0LyIsInNvdXJjZXMiOlsicGFja2FnZXMvc2NoZW1hdGljcy9hbmd1bGFyL2ludGVyZmFjZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBOzs7Ozs7R0FNRztBQUNILCtDQUFpRDtBQUNqRCwyREFVb0M7QUFDcEMsMENBQTBDO0FBSTFDLG1CQUF5QixPQUF5QjtJQUNoRCxPQUFPLENBQUMsTUFBTSxHQUFHLE9BQU8sQ0FBQyxNQUFNLEdBQUcsT0FBTyxDQUFDLE1BQU0sR0FBRyxFQUFFLENBQUM7SUFDdEQsT0FBTyxDQUFDLElBQUksR0FBRyxDQUFDLENBQUMsT0FBTyxDQUFDLElBQUksR0FBRyxJQUFJLE9BQU8sQ0FBQyxJQUFJLEVBQUUsR0FBRyxFQUFFLENBQUM7SUFDeEQsT0FBTyxDQUFDLElBQUksR0FBRyxPQUFPLENBQUMsSUFBSSxHQUFHLGdCQUFTLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUM7SUFDckUsTUFBTSxTQUFTLEdBQUcsT0FBTyxDQUFDLFNBQVMsQ0FBQztJQUNwQyxFQUFFLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUM7UUFDZixNQUFNLElBQUksZ0NBQW1CLENBQUMsK0JBQStCLENBQUMsQ0FBQztJQUNqRSxDQUFDO0lBRUQsTUFBTSxjQUFjLEdBQUcsa0JBQUssQ0FBQyxnQkFBRyxDQUFDLFNBQVMsQ0FBQyxFQUFFO1FBQzNDLHFCQUFRLG1CQUNILFdBQVcsRUFDWCxPQUFpQixFQUNwQjtRQUNGLGlCQUFJLENBQUMsU0FBUyxDQUFDO0tBQ2hCLENBQUMsQ0FBQztJQUVILE1BQU0sQ0FBQyxrQkFBSyxDQUFDO1FBQ1gsMkJBQWMsQ0FBQyxrQkFBSyxDQUFDO1lBQ25CLHNCQUFTLENBQUMsY0FBYyxDQUFDO1NBQzFCLENBQUMsQ0FBQztLQUNKLENBQUMsQ0FBQztBQUNMLENBQUM7QUF0QkQsNEJBc0JDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IEdvb2dsZSBJbmMuIEFsbCBSaWdodHMgUmVzZXJ2ZWQuXG4gKlxuICogVXNlIG9mIHRoaXMgc291cmNlIGNvZGUgaXMgZ292ZXJuZWQgYnkgYW4gTUlULXN0eWxlIGxpY2Vuc2UgdGhhdCBjYW4gYmVcbiAqIGZvdW5kIGluIHRoZSBMSUNFTlNFIGZpbGUgYXQgaHR0cHM6Ly9hbmd1bGFyLmlvL2xpY2Vuc2VcbiAqL1xuaW1wb3J0IHsgbm9ybWFsaXplIH0gZnJvbSAnQGFuZ3VsYXItZGV2a2l0L2NvcmUnO1xuaW1wb3J0IHtcbiAgUnVsZSxcbiAgU2NoZW1hdGljc0V4Y2VwdGlvbixcbiAgYXBwbHksXG4gIGJyYW5jaEFuZE1lcmdlLFxuICBjaGFpbixcbiAgbWVyZ2VXaXRoLFxuICBtb3ZlLFxuICB0ZW1wbGF0ZSxcbiAgdXJsLFxufSBmcm9tICdAYW5ndWxhci1kZXZraXQvc2NoZW1hdGljcyc7XG5pbXBvcnQgKiBhcyBzdHJpbmdVdGlscyBmcm9tICcuLi9zdHJpbmdzJztcbmltcG9ydCB7IFNjaGVtYSBhcyBJbnRlcmZhY2VPcHRpb25zIH0gZnJvbSAnLi9zY2hlbWEnO1xuXG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIChvcHRpb25zOiBJbnRlcmZhY2VPcHRpb25zKTogUnVsZSB7XG4gIG9wdGlvbnMucHJlZml4ID0gb3B0aW9ucy5wcmVmaXggPyBvcHRpb25zLnByZWZpeCA6ICcnO1xuICBvcHRpb25zLnR5cGUgPSAhIW9wdGlvbnMudHlwZSA/IGAuJHtvcHRpb25zLnR5cGV9YCA6ICcnO1xuICBvcHRpb25zLnBhdGggPSBvcHRpb25zLnBhdGggPyBub3JtYWxpemUob3B0aW9ucy5wYXRoKSA6IG9wdGlvbnMucGF0aDtcbiAgY29uc3Qgc291cmNlRGlyID0gb3B0aW9ucy5zb3VyY2VEaXI7XG4gIGlmICghc291cmNlRGlyKSB7XG4gICAgdGhyb3cgbmV3IFNjaGVtYXRpY3NFeGNlcHRpb24oYHNvdXJjZURpciBvcHRpb24gaXMgcmVxdWlyZWQuYCk7XG4gIH1cblxuICBjb25zdCB0ZW1wbGF0ZVNvdXJjZSA9IGFwcGx5KHVybCgnLi9maWxlcycpLCBbXG4gICAgdGVtcGxhdGUoe1xuICAgICAgLi4uc3RyaW5nVXRpbHMsXG4gICAgICAuLi5vcHRpb25zIGFzIG9iamVjdCxcbiAgICB9KSxcbiAgICBtb3ZlKHNvdXJjZURpciksXG4gIF0pO1xuXG4gIHJldHVybiBjaGFpbihbXG4gICAgYnJhbmNoQW5kTWVyZ2UoY2hhaW4oW1xuICAgICAgbWVyZ2VXaXRoKHRlbXBsYXRlU291cmNlKSxcbiAgICBdKSksXG4gIF0pO1xufVxuIl19 -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/interface/schema.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google Inc. All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.io/license 7 | */ 8 | 9 | export interface Schema { 10 | name: string; 11 | path?: string; 12 | appRoot?: string; 13 | sourceDir?: string; 14 | /** 15 | * Specifies the prefix to use. 16 | */ 17 | prefix?: string; 18 | /** 19 | * Specifies the type of interface. 20 | */ 21 | type?: string; 22 | } 23 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/interface/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "id": "SchematicsAngularInterface", 4 | "title": "Angular Interface Options Schema", 5 | "type": "object", 6 | "properties": { 7 | "name": { 8 | "type": "string" 9 | }, 10 | "path": { 11 | "type": "string", 12 | "default": "app" 13 | }, 14 | "appRoot": { 15 | "type": "string" 16 | }, 17 | "sourceDir": { 18 | "type": "string", 19 | "default": "src" 20 | }, 21 | "prefix": { 22 | "type": "string", 23 | "default": "", 24 | "description": "Specifies the prefix to use." 25 | }, 26 | "type": { 27 | "type": "string", 28 | "description": "Specifies the type of interface.", 29 | "default": "" 30 | } 31 | }, 32 | "required": [ 33 | "name" 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/module/files/__path__/__name@dasherize@if-flat__/__name@dasherize__-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | const routes: Routes = []; 5 | 6 | @NgModule({ 7 | imports: [RouterModule.for<%= routingScope %>(routes)], 8 | exports: [RouterModule] 9 | }) 10 | export class <%= classify(name) %>RoutingModule { } 11 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/module/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { <%= classify(name) %>Module } from './<%= dasherize(name) %>.module'; 2 | 3 | describe('<%= classify(name) %>Module', () => { 4 | let <%= camelize(name) %>Module: <%= classify(name) %>Module; 5 | 6 | beforeEach(() => { 7 | <%= camelize(name) %>Module = new <%= classify(name) %>Module(); 8 | }); 9 | 10 | it('should create an instance', () => { 11 | expect(<%= camelize(name) %>Module).toBeTruthy(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/module/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core';<% if (commonModule) { %> 2 | import { CommonModule } from '@angular/common';<% } %><% if (routing) { %> 3 | 4 | import { <%= classify(name) %>RoutingModule } from './<%= dasherize(name) %>-routing.module';<% } %> 5 | 6 | @NgModule({ 7 | imports: [<% if (commonModule) { %> 8 | CommonModule<%= routing ? ',' : '' %><% } %><% if (routing) { %> 9 | <%= classify(name) %>RoutingModule<% } %> 10 | ], 11 | declarations: [] 12 | }) 13 | export class <%= classify(name) %>Module { } 14 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/module/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Rule } from '@angular-devkit/schematics'; 2 | import { Schema as ModuleOptions } from './schema'; 3 | export default function (options: ModuleOptions): Rule; 4 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/module/schema.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google Inc. All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.io/license 7 | */ 8 | 9 | export interface Schema { 10 | name: string; 11 | path?: string; 12 | appRoot?: string; 13 | sourceDir?: string; 14 | routing?: boolean; 15 | routingScope?: ('Child' | 'Root'); 16 | spec?: boolean; 17 | flat?: boolean; 18 | commonModule?: boolean; 19 | /** 20 | * Allows specification of the declaring module. 21 | */ 22 | module?: string; 23 | } 24 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/module/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "id": "SchematicsAngularModule", 4 | "title": "Angular Module Options Schema", 5 | "type": "object", 6 | "properties": { 7 | "name": { 8 | "type": "string" 9 | }, 10 | "path": { 11 | "type": "string", 12 | "default": "app" 13 | }, 14 | "appRoot": { 15 | "type": "string" 16 | }, 17 | "sourceDir": { 18 | "type": "string", 19 | "default": "src" 20 | }, 21 | "routing": { 22 | "type": "boolean", 23 | "default": false 24 | }, 25 | "routingScope": { 26 | "enum": ["Child", "Root"], 27 | "type": "string", 28 | "default": "Child" 29 | }, 30 | "spec": { 31 | "type": "boolean", 32 | "default": true 33 | }, 34 | "flat": { 35 | "type": "boolean", 36 | "default": false 37 | }, 38 | "commonModule": { 39 | "type": "boolean", 40 | "default": true 41 | }, 42 | "module": { 43 | "type": "string", 44 | "description": "Allows specification of the declaring module.", 45 | "alias": "m" 46 | } 47 | }, 48 | "required": [ 49 | "name" 50 | ] 51 | } 52 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "@schematics/angular@~0.1.0", 3 | "_id": "@schematics/angular@0.1.7", 4 | "_inBundle": false, 5 | "_integrity": "sha512-3dZbRkM7akVCazr9T7gX+BOKri1Mn/N36o36Nojf8LSRxMo7QSJ9s651RPc5snYqpbKrTXZXUO4xKknAf4x+Ng==", 6 | "_location": "/@schematics/angular", 7 | "_phantomChildren": { 8 | "source-map": "0.5.7" 9 | }, 10 | "_requested": { 11 | "type": "range", 12 | "registry": true, 13 | "raw": "@schematics/angular@~0.1.0", 14 | "name": "@schematics/angular", 15 | "escapedName": "@schematics%2fangular", 16 | "scope": "@schematics", 17 | "rawSpec": "~0.1.0", 18 | "saveSpec": null, 19 | "fetchSpec": "~0.1.0" 20 | }, 21 | "_requiredBy": [ 22 | "/@angular/cli" 23 | ], 24 | "_resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-0.1.7.tgz", 25 | "_shasum": "2306aeec118ca185e180882eff54f5116de4ef05", 26 | "_spec": "@schematics/angular@~0.1.0", 27 | "_where": "C:\\dev\\projects\\webapps\\node_modules\\@angular\\cli", 28 | "author": { 29 | "name": "Angular Authors" 30 | }, 31 | "bugs": { 32 | "url": "https://github.com/angular/devkit/issues" 33 | }, 34 | "bundleDependencies": false, 35 | "dependencies": { 36 | "@angular-devkit/core": "0.0.21" 37 | }, 38 | "deprecated": false, 39 | "description": "Schematics specific to Angular", 40 | "engines": { 41 | "node": ">= 6.9.0", 42 | "npm": ">= 3.0.0" 43 | }, 44 | "homepage": "https://github.com/angular/devkit", 45 | "keywords": [ 46 | "angular", 47 | "devkit", 48 | "sdk", 49 | "Angular DevKit", 50 | "blueprints", 51 | "code generation", 52 | "schematics" 53 | ], 54 | "license": "MIT", 55 | "name": "@schematics/angular", 56 | "peerDependencies": { 57 | "@angular-devkit/schematics": "0.0.37" 58 | }, 59 | "repository": { 60 | "type": "git", 61 | "url": "git+https://github.com/angular/devkit.git" 62 | }, 63 | "schematics": "./collection.json", 64 | "version": "0.1.7" 65 | } 66 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/pipe/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.pipe.spec.ts: -------------------------------------------------------------------------------- 1 | import { <%= classify(name) %>Pipe } from './<%= dasherize(name) %>.pipe'; 2 | 3 | describe('<%= classify(name) %>Pipe', () => { 4 | it('create an instance', () => { 5 | const pipe = new <%= classify(name) %>Pipe(); 6 | expect(pipe).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/pipe/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.pipe.ts: -------------------------------------------------------------------------------- 1 | import { Pipe, PipeTransform } from '@angular/core'; 2 | 3 | @Pipe({ 4 | name: '<%= camelize(name) %>' 5 | }) 6 | export class <%= classify(name) %>Pipe implements PipeTransform { 7 | 8 | transform(value: any, args?: any): any { 9 | return null; 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/pipe/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Rule } from '@angular-devkit/schematics'; 2 | import 'rxjs/add/operator/merge'; 3 | import { Schema as PipeOptions } from './schema'; 4 | export default function (options: PipeOptions): Rule; 5 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/pipe/schema.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google Inc. All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.io/license 7 | */ 8 | 9 | export interface Schema { 10 | name: string; 11 | path?: string; 12 | appRoot?: string; 13 | sourceDir?: string; 14 | /** 15 | * Flag to indicate if a dir is created. 16 | */ 17 | flat?: boolean; 18 | /** 19 | * Specifies if a spec file is generated. 20 | */ 21 | spec?: boolean; 22 | /** 23 | * Allows for skipping the module import. 24 | */ 25 | skipImport?: boolean; 26 | /** 27 | * Allows specification of the declaring module. 28 | */ 29 | module?: string; 30 | /** 31 | * Specifies if declaring module exports the pipe. 32 | */ 33 | export?: boolean; 34 | } 35 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/pipe/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "id": "SchematicsAngularPipe", 4 | "title": "Angular Pipe Options Schema", 5 | "type": "object", 6 | "properties": { 7 | "name": { 8 | "type": "string" 9 | }, 10 | "path": { 11 | "type": "string", 12 | "default": "app" 13 | }, 14 | "appRoot": { 15 | "type": "string" 16 | }, 17 | "sourceDir": { 18 | "type": "string", 19 | "default": "src" 20 | }, 21 | "flat": { 22 | "type": "boolean", 23 | "default": true, 24 | "description": "Flag to indicate if a dir is created." 25 | }, 26 | "spec": { 27 | "type": "boolean", 28 | "default": true, 29 | "description": "Specifies if a spec file is generated." 30 | }, 31 | "skipImport": { 32 | "type": "boolean", 33 | "default": false, 34 | "description": "Allows for skipping the module import." 35 | }, 36 | "module": { 37 | "type": "string", 38 | "default": "", 39 | "description": "Allows specification of the declaring module.", 40 | "alias": "m", 41 | "subtype": "filepath" 42 | }, 43 | "export": { 44 | "type": "boolean", 45 | "default": false, 46 | "description": "Specifies if declaring module exports the pipe." 47 | } 48 | }, 49 | "required": [ 50 | "name" 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/service/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, inject } from '@angular/core/testing'; 2 | 3 | import { <%= classify(name) %>Service } from './<%= dasherize(name) %>.service'; 4 | 5 | describe('<%= classify(name) %>Service', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [<%= classify(name) %>Service] 9 | }); 10 | }); 11 | 12 | it('should be created', inject([<%= classify(name) %>Service], (service: <%= classify(name) %>Service) => { 13 | expect(service).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/service/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable() 4 | export class <%= classify(name) %>Service { 5 | 6 | constructor() { } 7 | 8 | } 9 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/service/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Rule } from '@angular-devkit/schematics'; 2 | import 'rxjs/add/operator/merge'; 3 | import { Schema as ServiceOptions } from './schema'; 4 | export default function (options: ServiceOptions): Rule; 5 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/service/schema.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google Inc. All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.io/license 7 | */ 8 | 9 | export interface Schema { 10 | name: string; 11 | path?: string; 12 | appRoot?: string; 13 | sourceDir?: string; 14 | /** 15 | * Flag to indicate if a dir is created. 16 | */ 17 | flat?: boolean; 18 | /** 19 | * Specifies if a spec file is generated. 20 | */ 21 | spec?: boolean; 22 | /** 23 | * Allows specification of the declaring module. 24 | */ 25 | module?: string; 26 | } 27 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/service/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "id": "SchematicsAngularService", 4 | "title": "Angular Service Options Schema", 5 | "type": "object", 6 | "properties": { 7 | "name": { 8 | "type": "string" 9 | }, 10 | "path": { 11 | "type": "string", 12 | "default": "app" 13 | }, 14 | "appRoot": { 15 | "type": "string" 16 | }, 17 | "sourceDir": { 18 | "type": "string", 19 | "default": "src" 20 | }, 21 | "flat": { 22 | "type": "boolean", 23 | "default": true, 24 | "description": "Flag to indicate if a dir is created." 25 | }, 26 | "spec": { 27 | "type": "boolean", 28 | "default": true, 29 | "description": "Specifies if a spec file is generated." 30 | }, 31 | "module": { 32 | "type": "string", 33 | "default": "", 34 | "description": "Allows specification of the declaring module.", 35 | "alias": "m", 36 | "subtype": "filepath" 37 | } 38 | }, 39 | "required": [ 40 | "name" 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/strings.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Converts a camelized string into all lower case separated by underscores. 3 | * 4 | ```javascript 5 | decamelize('innerHTML'); // 'inner_html' 6 | decamelize('action_name'); // 'action_name' 7 | decamelize('css-class-name'); // 'css-class-name' 8 | decamelize('my favorite items'); // 'my favorite items' 9 | ``` 10 | 11 | @method decamelize 12 | @param {String} str The string to decamelize. 13 | @return {String} the decamelized string. 14 | */ 15 | export declare function decamelize(str: string): string; 16 | /** 17 | Replaces underscores, spaces, or camelCase with dashes. 18 | 19 | ```javascript 20 | dasherize('innerHTML'); // 'inner-html' 21 | dasherize('action_name'); // 'action-name' 22 | dasherize('css-class-name'); // 'css-class-name' 23 | dasherize('my favorite items'); // 'my-favorite-items' 24 | ``` 25 | 26 | @method dasherize 27 | @param {String} str The string to dasherize. 28 | @return {String} the dasherized string. 29 | */ 30 | export declare function dasherize(str: string): string; 31 | /** 32 | Returns the lowerCamelCase form of a string. 33 | 34 | ```javascript 35 | camelize('innerHTML'); // 'innerHTML' 36 | camelize('action_name'); // 'actionName' 37 | camelize('css-class-name'); // 'cssClassName' 38 | camelize('my favorite items'); // 'myFavoriteItems' 39 | camelize('My Favorite Items'); // 'myFavoriteItems' 40 | ``` 41 | 42 | @method camelize 43 | @param {String} str The string to camelize. 44 | @return {String} the camelized string. 45 | */ 46 | export declare function camelize(str: string): string; 47 | /** 48 | Returns the UpperCamelCase form of a string. 49 | 50 | ```javascript 51 | 'innerHTML'.classify(); // 'InnerHTML' 52 | 'action_name'.classify(); // 'ActionName' 53 | 'css-class-name'.classify(); // 'CssClassName' 54 | 'my favorite items'.classify(); // 'MyFavoriteItems' 55 | ``` 56 | 57 | @method classify 58 | @param {String} str the string to classify 59 | @return {String} the classified string 60 | */ 61 | export declare function classify(str: string): string; 62 | /** 63 | More general than decamelize. Returns the lower\_case\_and\_underscored 64 | form of a string. 65 | 66 | ```javascript 67 | 'innerHTML'.underscore(); // 'inner_html' 68 | 'action_name'.underscore(); // 'action_name' 69 | 'css-class-name'.underscore(); // 'css_class_name' 70 | 'my favorite items'.underscore(); // 'my_favorite_items' 71 | ``` 72 | 73 | @method underscore 74 | @param {String} str The string to underscore. 75 | @return {String} the underscored string. 76 | */ 77 | export declare function underscore(str: string): string; 78 | /** 79 | Returns the Capitalized form of a string 80 | 81 | ```javascript 82 | 'innerHTML'.capitalize() // 'InnerHTML' 83 | 'action_name'.capitalize() // 'Action_name' 84 | 'css-class-name'.capitalize() // 'Css-class-name' 85 | 'my favorite items'.capitalize() // 'My favorite items' 86 | ``` 87 | 88 | @method capitalize 89 | @param {String} str The string to capitalize. 90 | @return {String} The capitalized string. 91 | */ 92 | export declare function capitalize(str: string): string; 93 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/universal/files/__sourceDir__/__appDir__/__rootModuleFileName__: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { ServerModule } from '@angular/platform-server'; 3 | 4 | import { AppModule } from './app.module'; 5 | import { AppComponent } from './app.component'; 6 | 7 | @NgModule({ 8 | imports: [ 9 | AppModule, 10 | ServerModule, 11 | ], 12 | bootstrap: [AppComponent], 13 | }) 14 | export class <%= rootModuleClassName %> {} 15 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/universal/files/__sourceDir__/__main@stripTsExtension__.ts: -------------------------------------------------------------------------------- 1 | export { <%= rootModuleClassName %> } from './<%= appDir %>/<%= stripTsExtension(rootModuleFileName) %>'; 2 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/universal/files/__sourceDir__/__tsconfigFileName__.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../<%= outDir %>", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "types": [] 8 | }, 9 | "exclude": [ 10 | "test.ts", 11 | "**/*.spec.ts" 12 | ], 13 | "angularCompilerOptions": { 14 | "entryModule": "<%= appDir %>/<%= stripTsExtension(rootModuleFileName) %>#<%= rootModuleClassName %>" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/universal/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Rule } from '@angular-devkit/schematics'; 2 | import 'rxjs/add/operator/merge'; 3 | import { Schema as UniversalOptions } from './schema'; 4 | export default function (options: UniversalOptions): Rule; 5 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/universal/schema.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google Inc. All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.io/license 7 | */ 8 | 9 | export interface Schema { 10 | /** 11 | * Name of the universal app 12 | */ 13 | name?: string; 14 | /** 15 | * Name or index of related client app. 16 | */ 17 | clientApp?: string; 18 | /** 19 | * The appId to use withServerTransition. 20 | */ 21 | appId?: string; 22 | /** 23 | * The output directory for build results. 24 | */ 25 | outDir?: string; 26 | /** 27 | * The root directory of the app. 28 | */ 29 | root?: string; 30 | /** 31 | * Name of the index file 32 | */ 33 | index?: string; 34 | /** 35 | * The name of the main entry-point file. 36 | */ 37 | main?: string; 38 | /** 39 | * The name of the test entry-point file. 40 | */ 41 | test?: string; 42 | /** 43 | * The name of the TypeScript configuration file. 44 | */ 45 | tsconfigFileName?: string; 46 | /** 47 | * The name of the TypeScript configuration file for tests. 48 | */ 49 | testTsconfigFileName?: string; 50 | /** 51 | * The name of the applicatino directory. 52 | */ 53 | appDir?: string; 54 | /** 55 | * The name of the root module file 56 | */ 57 | rootModuleFileName?: string; 58 | /** 59 | * The name of the root module class. 60 | */ 61 | rootModuleClassName?: string; 62 | sourceDir?: string; 63 | } 64 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/universal/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "id": "SchematicsAngularUniversalApp", 4 | "title": "Angular Universal App Options Schema", 5 | "type": "object", 6 | "properties": { 7 | "name": { 8 | "type": "string", 9 | "description": "Name of the universal app" 10 | }, 11 | "clientApp": { 12 | "type": "string", 13 | "description": "Name or index of related client app.", 14 | "default": "0" 15 | }, 16 | "appId": { 17 | "type": "string", 18 | "description": "The appId to use withServerTransition.", 19 | "default": "serverApp" 20 | }, 21 | "outDir": { 22 | "type": "string", 23 | "description": "The output directory for build results.", 24 | "default": "dist-server/" 25 | }, 26 | "root": { 27 | "type": "string", 28 | "description": "The root directory of the app.", 29 | "default": "src" 30 | }, 31 | "index": { 32 | "type": "string", 33 | "description": "Name of the index file", 34 | "default": "index.html" 35 | }, 36 | "main": { 37 | "type": "string", 38 | "description": "The name of the main entry-point file.", 39 | "default": "main.server.ts" 40 | }, 41 | "test": { 42 | "type": "string", 43 | "description": "The name of the test entry-point file." 44 | }, 45 | "tsconfigFileName": { 46 | "type": "string", 47 | "default": "tsconfig.server", 48 | "description": "The name of the TypeScript configuration file." 49 | }, 50 | "testTsconfigFileName": { 51 | "type": "string", 52 | "description": "The name of the TypeScript configuration file for tests.", 53 | "default": "tsconfig.spec" 54 | }, 55 | "appDir": { 56 | "type": "string", 57 | "description": "The name of the applicatino directory.", 58 | "default": "app" 59 | }, 60 | "rootModuleFileName": { 61 | "type": "string", 62 | "description": "The name of the root module file", 63 | "default": "app.server.module.ts" 64 | }, 65 | "rootModuleClassName": { 66 | "type": "string", 67 | "description": "The name of the root module class.", 68 | "default": "AppServerModule" 69 | }, 70 | "sourceDir": { 71 | "type": "string", 72 | "default": "src", 73 | "alias": "sd" 74 | } 75 | }, 76 | "required": [ 77 | ] 78 | } 79 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/utility/ast-utils.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google Inc. All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.io/license 7 | */ 8 | import * as ts from 'typescript'; 9 | import { Change } from './change'; 10 | /** 11 | * Find all nodes from the AST in the subtree of node of SyntaxKind kind. 12 | * @param node 13 | * @param kind 14 | * @param max The maximum number of items to return. 15 | * @return all nodes of kind, or [] if none is found 16 | */ 17 | export declare function findNodes(node: ts.Node, kind: ts.SyntaxKind, max?: number): ts.Node[]; 18 | /** 19 | * Get all the nodes from a source. 20 | * @param sourceFile The source file object. 21 | * @returns {Observable} An observable of all the nodes in the source. 22 | */ 23 | export declare function getSourceNodes(sourceFile: ts.SourceFile): ts.Node[]; 24 | export declare function findNode(node: ts.Node, kind: ts.SyntaxKind, text: string): ts.Node | null; 25 | /** 26 | * Insert `toInsert` after the last occurence of `ts.SyntaxKind[nodes[i].kind]` 27 | * or after the last of occurence of `syntaxKind` if the last occurence is a sub child 28 | * of ts.SyntaxKind[nodes[i].kind] and save the changes in file. 29 | * 30 | * @param nodes insert after the last occurence of nodes 31 | * @param toInsert string to insert 32 | * @param file file to insert changes into 33 | * @param fallbackPos position to insert if toInsert happens to be the first occurence 34 | * @param syntaxKind the ts.SyntaxKind of the subchildren to insert after 35 | * @return Change instance 36 | * @throw Error if toInsert is first occurence but fall back is not set 37 | */ 38 | export declare function insertAfterLastOccurrence(nodes: ts.Node[], toInsert: string, file: string, fallbackPos: number, syntaxKind?: ts.SyntaxKind): Change; 39 | export declare function getContentOfKeyLiteral(_source: ts.SourceFile, node: ts.Node): string | null; 40 | export declare function getDecoratorMetadata(source: ts.SourceFile, identifier: string, module: string): ts.Node[]; 41 | export declare function addSymbolToNgModuleMetadata(source: ts.SourceFile, ngModulePath: string, metadataField: string, symbolName: string, importPath?: string | null): Change[]; 42 | /** 43 | * Custom function to insert a declaration (component, pipe, directive) 44 | * into NgModule declarations. It also imports the component. 45 | */ 46 | export declare function addDeclarationToModule(source: ts.SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[]; 47 | /** 48 | * Custom function to insert an NgModule into NgModule imports. It also imports the module. 49 | */ 50 | export declare function addImportToModule(source: ts.SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[]; 51 | /** 52 | * Custom function to insert a provider into NgModule. It also imports it. 53 | */ 54 | export declare function addProviderToModule(source: ts.SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[]; 55 | /** 56 | * Custom function to insert an export into NgModule. It also imports it. 57 | */ 58 | export declare function addExportToModule(source: ts.SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[]; 59 | /** 60 | * Custom function to insert an export into NgModule. It also imports it. 61 | */ 62 | export declare function addBootstrapToModule(source: ts.SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[]; 63 | /** 64 | * Determine if an import already exists. 65 | */ 66 | export declare function isImported(source: ts.SourceFile, classifiedName: string, importPath: string): boolean; 67 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/utility/change.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google Inc. All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.io/license 7 | */ 8 | export interface Host { 9 | write(path: string, content: string): Promise; 10 | read(path: string): Promise; 11 | } 12 | export interface Change { 13 | apply(host: Host): Promise; 14 | readonly path: string | null; 15 | readonly order: number; 16 | readonly description: string; 17 | } 18 | /** 19 | * An operation that does nothing. 20 | */ 21 | export declare class NoopChange implements Change { 22 | description: string; 23 | order: number; 24 | path: null; 25 | apply(): Promise; 26 | } 27 | /** 28 | * Will add text to the source code. 29 | */ 30 | export declare class InsertChange implements Change { 31 | path: string; 32 | pos: number; 33 | toAdd: string; 34 | order: number; 35 | description: string; 36 | constructor(path: string, pos: number, toAdd: string); 37 | /** 38 | * This method does not insert spaces if there is none in the original string. 39 | */ 40 | apply(host: Host): Promise; 41 | } 42 | /** 43 | * Will remove text from the source code. 44 | */ 45 | export declare class RemoveChange implements Change { 46 | path: string; 47 | private pos; 48 | private toRemove; 49 | order: number; 50 | description: string; 51 | constructor(path: string, pos: number, toRemove: string); 52 | apply(host: Host): Promise; 53 | } 54 | /** 55 | * Will replace text from the source code. 56 | */ 57 | export declare class ReplaceChange implements Change { 58 | path: string; 59 | private pos; 60 | private oldText; 61 | private newText; 62 | order: number; 63 | description: string; 64 | constructor(path: string, pos: number, oldText: string, newText: string); 65 | apply(host: Host): Promise; 66 | } 67 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/utility/find-module.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google Inc. All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.io/license 7 | */ 8 | import { Path } from '@angular-devkit/core'; 9 | import { Tree } from '@angular-devkit/schematics'; 10 | export interface ModuleOptions { 11 | module?: string; 12 | name: string; 13 | flat?: boolean; 14 | sourceDir?: string; 15 | path?: string; 16 | skipImport?: boolean; 17 | appRoot?: string; 18 | } 19 | /** 20 | * Find the module referred by a set of options passed to the schematics. 21 | */ 22 | export declare function findModuleFromOptions(host: Tree, options: ModuleOptions): Path | undefined; 23 | /** 24 | * Function to find the "closest" module to a generated file's path. 25 | */ 26 | export declare function findModule(host: Tree, generateDir: string): Path; 27 | /** 28 | * Build a relative path from one file path to another file path. 29 | */ 30 | export declare function buildRelativePath(from: string, to: string): string; 31 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/utility/ng-ast-utils.d.ts: -------------------------------------------------------------------------------- 1 | import { Tree } from '@angular-devkit/schematics'; 2 | import * as ts from 'typescript'; 3 | import { AppConfig } from '../utility/config'; 4 | export declare function findBootstrapModuleCall(host: Tree, mainPath: string): ts.CallExpression | null; 5 | export declare function findBootstrapModulePath(host: Tree, mainPath: string): string; 6 | export declare function getAppModulePath(host: Tree, app: AppConfig): string & { 7 | __PRIVATE_DEVKIT_PATH: void; 8 | }; 9 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/utility/route-utils.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google Inc. All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.io/license 7 | */ 8 | import * as ts from 'typescript'; 9 | import { Change } from './change'; 10 | /** 11 | * Add Import `import { symbolName } from fileName` if the import doesn't exit 12 | * already. Assumes fileToEdit can be resolved and accessed. 13 | * @param fileToEdit (file we want to add import to) 14 | * @param symbolName (item to import) 15 | * @param fileName (path to the file) 16 | * @param isDefault (if true, import follows style for importing default exports) 17 | * @return Change 18 | */ 19 | export declare function insertImport(source: ts.SourceFile, fileToEdit: string, symbolName: string, fileName: string, isDefault?: boolean): Change; 20 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/utility/test/create-app-module.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google Inc. All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.io/license 7 | */ 8 | import { Tree } from '@angular-devkit/schematics'; 9 | export declare function createAppModule(tree: Tree, path?: string): Tree; 10 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/utility/test/create-app-module.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | function createAppModule(tree, path) { 4 | tree.create(path || '/src/app/app.module.ts', ` 5 | import { BrowserModule } from '@angular/platform-browser'; 6 | import { NgModule } from '@angular/core'; 7 | import { AppComponent } from './app.component'; 8 | 9 | @NgModule({ 10 | declarations: [ 11 | AppComponent 12 | ], 13 | imports: [ 14 | BrowserModule 15 | ], 16 | providers: [], 17 | bootstrap: [AppComponent] 18 | }) 19 | export class AppModule { } 20 | `); 21 | return tree; 22 | } 23 | exports.createAppModule = createAppModule; 24 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JlYXRlLWFwcC1tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiL1VzZXJzL2hhbnNsL1NvdXJjZXMvaGFuc2wvZGV2a2l0LyIsInNvdXJjZXMiOlsicGFja2FnZXMvc2NoZW1hdGljcy9hbmd1bGFyL3V0aWxpdHkvdGVzdC9jcmVhdGUtYXBwLW1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQVVBLHlCQUFnQyxJQUFVLEVBQUUsSUFBYTtJQUN2RCxJQUFJLENBQUMsTUFBTSxDQUFDLElBQUksSUFBSSx3QkFBd0IsRUFBRTs7Ozs7Ozs7Ozs7Ozs7OztHQWdCN0MsQ0FBQyxDQUFDO0lBRUgsTUFBTSxDQUFDLElBQUksQ0FBQztBQUNkLENBQUM7QUFwQkQsMENBb0JDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IEdvb2dsZSBJbmMuIEFsbCBSaWdodHMgUmVzZXJ2ZWQuXG4gKlxuICogVXNlIG9mIHRoaXMgc291cmNlIGNvZGUgaXMgZ292ZXJuZWQgYnkgYW4gTUlULXN0eWxlIGxpY2Vuc2UgdGhhdCBjYW4gYmVcbiAqIGZvdW5kIGluIHRoZSBMSUNFTlNFIGZpbGUgYXQgaHR0cHM6Ly9hbmd1bGFyLmlvL2xpY2Vuc2VcbiAqL1xuaW1wb3J0IHsgVHJlZSB9IGZyb20gJ0Bhbmd1bGFyLWRldmtpdC9zY2hlbWF0aWNzJztcblxuXG5leHBvcnQgZnVuY3Rpb24gY3JlYXRlQXBwTW9kdWxlKHRyZWU6IFRyZWUsIHBhdGg/OiBzdHJpbmcpOiBUcmVlIHtcbiAgdHJlZS5jcmVhdGUocGF0aCB8fCAnL3NyYy9hcHAvYXBwLm1vZHVsZS50cycsIGBcbiAgICBpbXBvcnQgeyBCcm93c2VyTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvcGxhdGZvcm0tYnJvd3Nlcic7XG4gICAgaW1wb3J0IHsgTmdNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbiAgICBpbXBvcnQgeyBBcHBDb21wb25lbnQgfSBmcm9tICcuL2FwcC5jb21wb25lbnQnO1xuXG4gICAgQE5nTW9kdWxlKHtcbiAgICBkZWNsYXJhdGlvbnM6IFtcbiAgICAgIEFwcENvbXBvbmVudFxuICAgIF0sXG4gICAgaW1wb3J0czogW1xuICAgICAgQnJvd3Nlck1vZHVsZVxuICAgIF0sXG4gICAgcHJvdmlkZXJzOiBbXSxcbiAgICBib290c3RyYXA6IFtBcHBDb21wb25lbnRdXG4gICAgfSlcbiAgICBleHBvcnQgY2xhc3MgQXBwTW9kdWxlIHsgfVxuICBgKTtcblxuICByZXR1cm4gdHJlZTtcbn1cbiJdfQ== -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/utility/test/get-file-content.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google Inc. All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.io/license 7 | */ 8 | import { Tree } from '@angular-devkit/schematics'; 9 | export declare function getFileContent(tree: Tree, path: string): string; 10 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/utility/test/get-file-content.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | function getFileContent(tree, path) { 4 | const fileEntry = tree.get(path); 5 | if (!fileEntry) { 6 | throw new Error(`The file (${path}) does not exist.`); 7 | } 8 | return fileEntry.content.toString(); 9 | } 10 | exports.getFileContent = getFileContent; 11 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0LWZpbGUtY29udGVudC5qcyIsInNvdXJjZVJvb3QiOiIvVXNlcnMvaGFuc2wvU291cmNlcy9oYW5zbC9kZXZraXQvIiwic291cmNlcyI6WyJwYWNrYWdlcy9zY2hlbWF0aWNzL2FuZ3VsYXIvdXRpbGl0eS90ZXN0L2dldC1maWxlLWNvbnRlbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFVQSx3QkFBK0IsSUFBVSxFQUFFLElBQVk7SUFDckQsTUFBTSxTQUFTLEdBQUcsSUFBSSxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUVqQyxFQUFFLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUM7UUFDZixNQUFNLElBQUksS0FBSyxDQUFDLGFBQWEsSUFBSSxtQkFBbUIsQ0FBQyxDQUFDO0lBQ3hELENBQUM7SUFFRCxNQUFNLENBQUMsU0FBUyxDQUFDLE9BQU8sQ0FBQyxRQUFRLEVBQUUsQ0FBQztBQUN0QyxDQUFDO0FBUkQsd0NBUUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBsaWNlbnNlXG4gKiBDb3B5cmlnaHQgR29vZ2xlIEluYy4gQWxsIFJpZ2h0cyBSZXNlcnZlZC5cbiAqXG4gKiBVc2Ugb2YgdGhpcyBzb3VyY2UgY29kZSBpcyBnb3Zlcm5lZCBieSBhbiBNSVQtc3R5bGUgbGljZW5zZSB0aGF0IGNhbiBiZVxuICogZm91bmQgaW4gdGhlIExJQ0VOU0UgZmlsZSBhdCBodHRwczovL2FuZ3VsYXIuaW8vbGljZW5zZVxuICovXG5pbXBvcnQgeyBUcmVlIH0gZnJvbSAnQGFuZ3VsYXItZGV2a2l0L3NjaGVtYXRpY3MnO1xuXG5cbmV4cG9ydCBmdW5jdGlvbiBnZXRGaWxlQ29udGVudCh0cmVlOiBUcmVlLCBwYXRoOiBzdHJpbmcpOiBzdHJpbmcge1xuICBjb25zdCBmaWxlRW50cnkgPSB0cmVlLmdldChwYXRoKTtcblxuICBpZiAoIWZpbGVFbnRyeSkge1xuICAgIHRocm93IG5ldyBFcnJvcihgVGhlIGZpbGUgKCR7cGF0aH0pIGRvZXMgbm90IGV4aXN0LmApO1xuICB9XG5cbiAgcmV0dXJuIGZpbGVFbnRyeS5jb250ZW50LnRvU3RyaW5nKCk7XG59XG4iXX0= -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/utility/test/index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google Inc. All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.io/license 7 | */ 8 | export * from './create-app-module'; 9 | export * from './get-file-content'; 10 | -------------------------------------------------------------------------------- /files/sch-0-1-7/@schematics/angular/utility/test/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | /** 7 | * @license 8 | * Copyright Google Inc. All Rights Reserved. 9 | * 10 | * Use of this source code is governed by an MIT-style license that can be 11 | * found in the LICENSE file at https://angular.io/license 12 | */ 13 | __export(require("./create-app-module")); 14 | __export(require("./get-file-content")); 15 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiL1VzZXJzL2hhbnNsL1NvdXJjZXMvaGFuc2wvZGV2a2l0LyIsInNvdXJjZXMiOlsicGFja2FnZXMvc2NoZW1hdGljcy9hbmd1bGFyL3V0aWxpdHkvdGVzdC9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBOzs7Ozs7R0FNRztBQUNILHlDQUFvQztBQUNwQyx3Q0FBbUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBsaWNlbnNlXG4gKiBDb3B5cmlnaHQgR29vZ2xlIEluYy4gQWxsIFJpZ2h0cyBSZXNlcnZlZC5cbiAqXG4gKiBVc2Ugb2YgdGhpcyBzb3VyY2UgY29kZSBpcyBnb3Zlcm5lZCBieSBhbiBNSVQtc3R5bGUgbGljZW5zZSB0aGF0IGNhbiBiZVxuICogZm91bmQgaW4gdGhlIExJQ0VOU0UgZmlsZSBhdCBodHRwczovL2FuZ3VsYXIuaW8vbGljZW5zZVxuICovXG5leHBvcnQgKiBmcm9tICcuL2NyZWF0ZS1hcHAtbW9kdWxlJztcbmV4cG9ydCAqIGZyb20gJy4vZ2V0LWZpbGUtY29udGVudCc7XG4iXX0= -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-gui", 3 | "displayName": "GUI for Angular", 4 | "description": "Take charge of your Angular CLI projects!", 5 | "version": "0.4.3", 6 | "publisher": "sasxa-net", 7 | "license": "MIT", 8 | "repository": { 9 | "type": "git", 10 | "url": "https://github.com/angular-gui/vscode-angular-gui.git" 11 | }, 12 | "icon": "angular-gui.png", 13 | "galleryBanner": { 14 | "color": "#FFC107", 15 | "theme": "light" 16 | }, 17 | "engines": { 18 | "vscode": "^1.18.0" 19 | }, 20 | "categories": [ 21 | "Other" 22 | ], 23 | "keywords": [ 24 | "Angular", 25 | "Angular CLI" 26 | ], 27 | "activationEvents": [ 28 | "workspaceContains:**/.angular-cli.json" 29 | ], 30 | "main": "./out/extension", 31 | "contributes": { 32 | "commands": [ 33 | { 34 | "command": "extension.connectOffline", 35 | "title": "GUI for Angular: Start in Offline mode" 36 | }, 37 | { 38 | "command": "extension.connectOnline", 39 | "title": "GUI for Angular: Start in Online mode" 40 | }, 41 | { 42 | "command": "extension.rebuildConfiguration", 43 | "title": "GUI for Angular: Rebuild client configuration" 44 | }, 45 | { 46 | "command": "extension.disconnect", 47 | "title": "GUI for Angular: Stop" 48 | } 49 | ], 50 | "configuration": { 51 | "title": "GUI for Angular", 52 | "properties": { 53 | "angular-gui.port": { 54 | "type": "number", 55 | "default": 4300, 56 | "description": "Port for socket connection" 57 | }, 58 | "angular-gui.rootDir": { 59 | "type": "string", 60 | "default": ".angular-gui", 61 | "description": "Workspace folder for GUI for Angular commands and settings" 62 | }, 63 | "angular-gui.npmRunner": { 64 | "type": "string", 65 | "default": ".", 66 | "description": "Name for the runner script that can be used to excute commands from terminal by name: \"npm run . \"" 67 | }, 68 | "angular-gui.commands": { 69 | "type": "array", 70 | "uniqueItems": true, 71 | "items": { 72 | "enum": [ 73 | "build", 74 | "completion", 75 | "doc", 76 | "e2e", 77 | "eject", 78 | "generate", 79 | "lint", 80 | "new", 81 | "serve", 82 | "shell", 83 | "test", 84 | "version", 85 | "xi18n" 86 | ] 87 | }, 88 | "description": "List of commands that will be displayed in client app.", 89 | "default": [ 90 | "build", 91 | "e2e", 92 | "generate", 93 | "lint", 94 | "serve", 95 | "shell", 96 | "test", 97 | "xi18n" 98 | ] 99 | }, 100 | "angular-gui.commandOptions": { 101 | "type": "object", 102 | "description": "Command options' values and defaults", 103 | "default": { 104 | "environment": [ 105 | "dev", 106 | "prod" 107 | ], 108 | "target": [ 109 | "development", 110 | "production" 111 | ], 112 | "collection": [ 113 | "@schematics/angular" 114 | ], 115 | "styleext": [ 116 | "scss", 117 | "styl", 118 | "css" 119 | ] 120 | } 121 | } 122 | } 123 | } 124 | }, 125 | "scripts": { 126 | "build": "sh scripts/prod.sh", 127 | "build:schematics": "sh scripts/schematics.sh", 128 | "compile": "tsc -p ./", 129 | "dev": "sh scripts/dev.sh", 130 | "debug": "webpack", 131 | "package": "vsce package", 132 | "postinstall": "node ./node_modules/vscode/bin/install", 133 | "serve:local": "node out/local.js", 134 | "test": "npm run compile && node ./node_modules/vscode/bin/test", 135 | "vscode:prepublish": "npm run build", 136 | "watch": "webpack --config webpack.local.js --display minimal --watch", 137 | "watch:debug": "webpack --watch" 138 | }, 139 | "devDependencies": { 140 | "@types/express": "^4.0.39", 141 | "@types/jasmine": "^2.8.2", 142 | "@types/mocha": "^2.2.44", 143 | "@types/node": "^8.0.53", 144 | "@types/shelljs": "^0.7.6", 145 | "@types/socket.io": "^1.4.31", 146 | "awesome-typescript-loader": "^3.4.0", 147 | "concurrently": "^3.5.1", 148 | "jasmine": "^2.8.0", 149 | "nodemon": "^1.12.1", 150 | "source-map-loader": "^0.2.3", 151 | "vscode": "^1.1.9", 152 | "webpack": "^3.8.1", 153 | "webpack-node-externals": "^1.6.0" 154 | }, 155 | "dependencies": { 156 | "@angular-devkit/core": "0.0.22", 157 | "@angular-devkit/schematics": "0.0.38", 158 | "@ngtools/json-schema": "1.1.0", 159 | "ansi-to-html": "0.6.3", 160 | "express": "4.16.2", 161 | "minimist": "1.2.0", 162 | "ps-tree": "1.1.0", 163 | "rxjs": "5.5.2", 164 | "shelljs": "0.7.8", 165 | "socket.io": "2.0.4", 166 | "source-map": "^0.6.1", 167 | "stoppable": "1.0.4", 168 | "typescript": "^2.6.2" 169 | } 170 | } 171 | -------------------------------------------------------------------------------- /scripts/dev.sh: -------------------------------------------------------------------------------- 1 | echo "Building extension \"angular-gui\" in watch mode" 2 | 3 | sh scripts/schematics.sh 4 | 5 | concurrently --kill-others \ 6 | "webpack --config webpack.local.js --display minimal -w" \ 7 | "tsc -p ./tsconfig.schematics.json --watch" \ 8 | "nodemon out/local.js" 9 | -------------------------------------------------------------------------------- /scripts/prod.sh: -------------------------------------------------------------------------------- 1 | sh scripts/schematics.sh 2 | 3 | echo "Bundling code for \"angular-gui\" extension" 4 | rm -rf out 5 | webpack --display minimal 6 | -------------------------------------------------------------------------------- /scripts/schematics.sh: -------------------------------------------------------------------------------- 1 | echo "Building schematics for \"angular-gui\" extension" 2 | 3 | rm -rf schematics 4 | tsc -p ./tsconfig.schematics.json 5 | 6 | cp -r src/schematics/* schematics 7 | rm -rf schematics/**/*.ts schematics/*.ts 8 | -------------------------------------------------------------------------------- /src/commands/completion.ts: -------------------------------------------------------------------------------- 1 | import { sort, type } from '../core/utils'; 2 | 3 | export const completion = { 4 | name: 'completion', 5 | description: 'Adds autocomplete functionality to `ng` commands and subcommands.', 6 | works: 'everywhere', 7 | 8 | availableOptions: [ 9 | { 10 | name: 'all', 11 | type: Boolean, 12 | default: true, 13 | aliases: [ 'a' ], 14 | description: 'Generate a completion script compatible with both bash and zsh.' 15 | }, 16 | { 17 | name: 'bash', 18 | type: Boolean, 19 | default: false, 20 | aliases: [ 'b' ], 21 | description: 'Generate a completion script for bash.' 22 | }, 23 | { 24 | name: 'zsh', 25 | type: Boolean, 26 | default: false, 27 | aliases: [ 'z' ], 28 | description: 'Generate a completion script for zsh.' 29 | } 30 | ] 31 | .sort(sort('asc', o => o.name)) 32 | .map(type) 33 | }; 34 | -------------------------------------------------------------------------------- /src/commands/doc.ts: -------------------------------------------------------------------------------- 1 | import { sort, type } from '../core/utils'; 2 | 3 | export const doc = { 4 | name: 'doc', 5 | description: 'Opens the official Angular API documentation for a given keyword.', 6 | works: 'everywhere', 7 | 8 | availableOptions: [ 9 | { 10 | name: 'search', 11 | aliases: [ 's' ], 12 | type: Boolean, 13 | default: false, 14 | description: 'Search whole angular.io instead of just api.' 15 | } 16 | ] 17 | .sort(sort('asc', o => o.name)) 18 | .map(type) 19 | }; 20 | -------------------------------------------------------------------------------- /src/commands/e2e.ts: -------------------------------------------------------------------------------- 1 | import { sort, type } from '../core/utils'; 2 | 3 | import { serve } from './serve'; 4 | 5 | export const e2e = { 6 | name: 'e2e', 7 | aliases: [ 'e' ], 8 | description: 'Run e2e tests in existing project.', 9 | works: 'insideProject', 10 | 11 | availableOptions: [ 12 | { 13 | name: 'config', 14 | type: String, 15 | aliases: [ 'c' ], 16 | description: `Use a specific config file.` 17 | + `Defaults to the protractor config file in angular-cli.json.` 18 | }, 19 | { 20 | name: 'specs', 21 | type: Array, 22 | default: [], 23 | aliases: [ 'sp' ], 24 | description: `Override specs in the protractor config.` 25 | + `Can send in multiple specs by repeating flag (ng e2e --specs=spec1.ts --specs=spec2.ts).` 26 | }, 27 | { 28 | name: 'element-explorer', 29 | type: Boolean, 30 | default: false, 31 | aliases: [ 'ee' ], 32 | description: 'Start Protractor\'s Element Explorer for debugging.' 33 | }, 34 | { 35 | name: 'webdriver-update', 36 | type: Boolean, 37 | default: true, 38 | aliases: [ 'wu' ], 39 | description: 'Try to update webdriver.' 40 | }, 41 | { 42 | name: 'serve', 43 | type: Boolean, 44 | default: true, 45 | aliases: [ 's' ], 46 | description: `Compile and Serve the app.` 47 | + `All non-reload related serve options are also available (e.g. --port=4400).` 48 | }, 49 | ...serve.availableOptions 50 | ] 51 | .sort(sort('asc', o => o.name)) 52 | .map(type) 53 | }; 54 | -------------------------------------------------------------------------------- /src/commands/eject.ts: -------------------------------------------------------------------------------- 1 | import { sort, type } from '../core/utils'; 2 | 3 | import { build } from './build'; 4 | 5 | export const eject = { 6 | name: 'eject', 7 | description: 'Ejects your app and output the proper webpack configuration and scripts.', 8 | 9 | availableOptions: [ 10 | { 11 | name: 'force', 12 | type: Boolean, 13 | description: 'Overwrite any webpack.config.js and npm scripts already existing.' 14 | }, 15 | { 16 | name: 'app', 17 | type: String, 18 | aliases: ['a'], 19 | description: 'Specifies app name to use.' 20 | }, 21 | ...build.availableOptions 22 | ] 23 | .sort(sort('asc', o => o.name)) 24 | .map(type) 25 | }; 26 | -------------------------------------------------------------------------------- /src/commands/generate.ts: -------------------------------------------------------------------------------- 1 | import { sort, type } from '../core/utils'; 2 | 3 | const blueprint = { 4 | name: 'blueprint', 5 | type: String, 6 | description: 'Generates the specified blueprint.' 7 | }; 8 | 9 | export const generate = { 10 | name: 'generate', 11 | description: 'Generates and/or modifies files based on a schematic.', 12 | aliases: [ 'g' ], 13 | 14 | availableOptions: [ 15 | blueprint, 16 | { 17 | name: 'dry-run', 18 | type: Boolean, 19 | default: false, 20 | aliases: [ 'd' ], 21 | description: 'Run through without making any changes.' 22 | }, 23 | { 24 | name: 'force', 25 | type: Boolean, 26 | default: false, 27 | aliases: [ 'f' ], 28 | description: 'Forces overwriting of files.' 29 | }, 30 | { 31 | name: 'app', 32 | type: String, 33 | aliases: [ 'a' ], 34 | description: 'Specifies app name to use.' 35 | }, 36 | { 37 | name: 'collection', 38 | type: String, 39 | aliases: [ 'c' ], 40 | description: 'Schematics collection to use.' 41 | }, 42 | { 43 | name: 'lint-fix', 44 | type: Boolean, 45 | aliases: [ 'lf' ], 46 | description: 'Use lint to fix files after generation.' 47 | } 48 | ] 49 | .sort(sort('asc', o => o.name)) 50 | .map(type) 51 | }; 52 | -------------------------------------------------------------------------------- /src/commands/index.ts: -------------------------------------------------------------------------------- 1 | export * from './build'; 2 | export * from './completion'; 3 | export * from './doc'; 4 | export * from './e2e'; 5 | export * from './eject'; 6 | export * from './generate'; 7 | export * from './lint'; 8 | export * from './new'; 9 | export * from './serve'; 10 | export * from './shell'; 11 | export * from './test'; 12 | export * from './version'; 13 | export * from './xi18n'; 14 | -------------------------------------------------------------------------------- /src/commands/lint.ts: -------------------------------------------------------------------------------- 1 | import { sort, type } from '../core/utils'; 2 | 3 | export const lint = { 4 | name: 'lint', 5 | aliases: [ 'l' ], 6 | description: 'Lints code in existing project.', 7 | works: 'insideProject', 8 | 9 | availableOptions: [ 10 | { 11 | name: 'fix', 12 | type: Boolean, 13 | default: false, 14 | description: 'Fixes linting errors (may overwrite linted files).' 15 | }, 16 | { 17 | name: 'type-check', 18 | type: Boolean, 19 | default: false, 20 | description: 'Controls the type check for linting.' 21 | }, 22 | { 23 | name: 'force', 24 | type: Boolean, 25 | default: false, 26 | description: 'Succeeds even if there was linting errors.' 27 | }, 28 | { 29 | name: 'format', 30 | aliases: [ 't' ], 31 | type: String, 32 | default: 'prose', 33 | values: [ 'prose', 'json', 'stylish', 'verbose', 'pmd', 'msbuild', 'checkstyle', 'vso', 'fileslist' ], 34 | description: `Output format (prose, json, stylish, verbose, pmd, msbuild, checkstyle, vso, fileslist).` 35 | } 36 | ] 37 | .sort(sort('asc', o => o.name)) 38 | .map(type) 39 | }; 40 | -------------------------------------------------------------------------------- /src/commands/new.ts: -------------------------------------------------------------------------------- 1 | import { sort, type } from '../core/utils'; 2 | 3 | export const app = { 4 | name: 'new', 5 | aliases: [ 'n' ], 6 | description: `Creates a new directory and a new Angular app eg. "ng new [name]".`, 7 | works: 'outsideProject', 8 | 9 | availableOptions: [ 10 | { 11 | name: 'dry-run', 12 | type: Boolean, 13 | default: false, 14 | aliases: [ 'd' ], 15 | description: `Run through without making any changes. Will list all files that would have been created when running "ng new".` 16 | }, 17 | { 18 | name: 'verbose', 19 | type: Boolean, 20 | default: false, 21 | aliases: [ 'v' ], 22 | description: 'Adds more details to output logging.' 23 | }, 24 | { 25 | name: 'link-cli', 26 | type: Boolean, 27 | default: false, 28 | aliases: [ 'lc' ], 29 | description: 'Automatically link the `@angular/cli` package.', 30 | hidden: true 31 | }, 32 | { 33 | name: 'skip-install', 34 | type: Boolean, 35 | default: false, 36 | aliases: [ 'si' ], 37 | description: 'Skip installing packages.' 38 | }, 39 | { 40 | name: 'skip-commit', 41 | type: Boolean, 42 | default: false, 43 | aliases: [ 'sc' ], 44 | description: 'Skip committing the first commit to git.' 45 | }, 46 | { 47 | name: 'collection', 48 | type: String, 49 | aliases: [ 'c' ], 50 | description: 'Schematics collection to use.' 51 | } 52 | ] 53 | .sort(sort('asc', o => o.name)) 54 | .map(type) 55 | }; 56 | -------------------------------------------------------------------------------- /src/commands/serve.ts: -------------------------------------------------------------------------------- 1 | import { sort, type } from '../core/utils'; 2 | 3 | import { build } from './build'; 4 | 5 | export const serve = { 6 | name: 'serve', 7 | description: 'Builds and serves your app, rebuilding on file changes.', 8 | aliases: [ 'server', 's' ], 9 | 10 | availableOptions: [ 11 | { 12 | name: 'port', 13 | type: Number, 14 | default: 4200, 15 | aliases: [ 'p' ], 16 | description: 'Port to listen to for serving.' 17 | }, 18 | { 19 | name: 'host', 20 | type: String, 21 | default: 'localhost', 22 | aliases: [ 'H' ], 23 | description: `Listens only on localhost by default.` 24 | }, 25 | { 26 | name: 'proxy-config', 27 | type: 'Path', 28 | // default: serveConfigDefaults[ 'proxyConfig' ], 29 | aliases: [ 'pc' ], 30 | description: 'Proxy configuration file.' 31 | }, 32 | { 33 | name: 'ssl', 34 | type: Boolean, 35 | // default: serveConfigDefaults[ 'ssl' ], 36 | description: 'Serve using HTTPS.' 37 | }, 38 | { 39 | name: 'ssl-key', 40 | type: 'Path', 41 | // default: serveConfigDefaults[ 'sslKey' ], 42 | description: 'SSL key to use for serving HTTPS.' 43 | }, 44 | { 45 | name: 'ssl-cert', 46 | type: 'Path', 47 | // default: serveConfigDefaults[ 'sslCert' ], 48 | description: 'SSL certificate to use for serving HTTPS.' 49 | }, 50 | { 51 | name: 'open', 52 | type: Boolean, 53 | default: false, 54 | aliases: [ 'o' ], 55 | description: 'Opens the url in default browser.', 56 | }, 57 | { 58 | name: 'live-reload', 59 | type: Boolean, 60 | default: true, 61 | aliases: [ 'lr' ], 62 | description: 'Whether to reload the page on change, using live-reload.' 63 | }, 64 | { 65 | name: 'public-host', 66 | type: String, 67 | aliases: [ 'live-reload-client' ], 68 | description: 'Specify the URL that the browser client will use.' 69 | }, 70 | { 71 | name: 'disable-host-check', 72 | type: Boolean, 73 | default: false, 74 | description: 'Don\'t verify connected clients are part of allowed hosts.', 75 | }, 76 | { 77 | name: 'serve-path', 78 | type: String, 79 | description: 'The pathname where the app will be served.' 80 | }, 81 | { 82 | name: 'hmr', 83 | type: Boolean, 84 | default: false, 85 | description: 'Enable hot module replacement.', 86 | }, 87 | ...build.availableOptions 88 | ] 89 | .sort(sort('asc', o => o.name)) 90 | .map(type) 91 | }; 92 | -------------------------------------------------------------------------------- /src/commands/shell.ts: -------------------------------------------------------------------------------- 1 | import { sort, type } from '../core/utils'; 2 | 3 | export const shell = { 4 | name: 'shell', 5 | description: 'Create custom shell commands.', 6 | 7 | availableOptions: [] 8 | .sort(sort('asc', o => o.name)) 9 | .map(type) 10 | }; 11 | -------------------------------------------------------------------------------- /src/commands/test.ts: -------------------------------------------------------------------------------- 1 | import { sort, type } from '../core/utils'; 2 | 3 | export const test = { 4 | name: 'test', 5 | aliases: [ 't' ], 6 | description: 'Run unit tests in existing project.', 7 | works: 'insideProject', 8 | 9 | availableOptions: [ 10 | { 11 | name: 'watch', 12 | type: Boolean, 13 | aliases: [ 'w' ], 14 | description: 'Run build when files change.' 15 | }, 16 | { 17 | name: 'code-coverage', 18 | type: Boolean, 19 | default: false, 20 | aliases: [ 'cc' ], 21 | description: 'Coverage report will be in the coverage/ directory.' 22 | }, 23 | { 24 | name: 'config', 25 | type: 'Path', 26 | aliases: [ 'c' ], 27 | description: `Use a specific config file. Defaults to the karma config file in .angular-cli.json.` 28 | }, 29 | { 30 | name: 'single-run', 31 | type: Boolean, 32 | aliases: [ 'sr' ], 33 | description: 'Run tests a single time.' 34 | }, 35 | { 36 | name: 'progress', 37 | type: Boolean, 38 | // default: testConfigDefaults['progress'], 39 | description: 'Log progress to the console while in progress.' 40 | }, 41 | { 42 | name: 'browsers', 43 | type: String, 44 | description: 'Override which browsers tests are run against.' 45 | }, 46 | { 47 | name: 'colors', 48 | type: Boolean, 49 | description: 'Enable or disable colors in the output (reporters and logs).' 50 | }, 51 | { 52 | name: 'log-level', 53 | type: String, 54 | description: 'Level of logging.' 55 | }, 56 | { 57 | name: 'port', 58 | type: Number, 59 | description: 'Port where the web server will be listening.' 60 | }, 61 | { 62 | name: 'reporters', 63 | type: String, 64 | description: 'List of reporters to use.' 65 | }, 66 | { 67 | name: 'sourcemaps', 68 | type: Boolean, 69 | default: true, 70 | aliases: [ 'sm', 'sourcemap' ], 71 | description: 'Output sourcemaps.' 72 | }, 73 | { 74 | name: 'poll', 75 | type: Number, 76 | // default: testConfigDefaults['poll'], 77 | description: 'Enable and define the file watching poll time period (milliseconds).' 78 | }, 79 | { 80 | name: 'environment', 81 | type: String, 82 | aliases: [ 'e' ], 83 | description: 'Defines the build environment.', 84 | }, 85 | { 86 | name: 'preserve-symlinks', 87 | type: Boolean, 88 | description: 'Do not use the real path when resolving modules.', 89 | // default: testConfigDefaults['preserveSymlinks'] 90 | }, 91 | { 92 | name: 'app', 93 | type: String, 94 | aliases: [ 'a' ], 95 | description: 'Specifies app name to use.' 96 | } 97 | ] 98 | .sort(sort('asc', o => o.name)) 99 | .map(type) 100 | }; 101 | -------------------------------------------------------------------------------- /src/commands/version.ts: -------------------------------------------------------------------------------- 1 | import { sort, type } from '../core/utils'; 2 | 3 | export const version = { 4 | name: 'version', 5 | description: 'Outputs Angular CLI version.', 6 | aliases: [ 'v', '--version', '-v' ], 7 | works: 'everywhere', 8 | 9 | availableOptions: [ 10 | ] 11 | .sort(sort('asc', o => o.name)) 12 | .map(type) 13 | }; 14 | -------------------------------------------------------------------------------- /src/commands/xi18n.ts: -------------------------------------------------------------------------------- 1 | import { sort, type } from '../core/utils'; 2 | 3 | export const xi18n = { 4 | name: 'xi18n', 5 | description: 'Extracts i18n messages from source code.', 6 | works: 'insideProject', 7 | 8 | availableOptions: [ 9 | { 10 | name: 'i18n-format', 11 | type: String, 12 | default: 'xlf', 13 | aliases: [ 'f', { 'xmb': 'xmb' }, { 'xlf': 'xlf' }, { 'xliff': 'xlf' }], 14 | values: [ 'xmb', 'xlf' ], 15 | description: 'Output format for the generated file.' 16 | }, 17 | { 18 | name: 'output-path', 19 | type: String, 20 | default: null, 21 | aliases: [ 'op' ], 22 | description: 'Path where output will be placed.' 23 | }, 24 | { 25 | name: 'verbose', 26 | type: Boolean, 27 | default: false, 28 | description: 'Adds more details to output logging.' 29 | }, 30 | { 31 | name: 'progress', 32 | type: Boolean, 33 | default: true, 34 | description: 'Log progress to the console while running.' 35 | }, 36 | { 37 | name: 'app', 38 | type: String, 39 | aliases: [ 'a' ], 40 | description: 'Specifies app name to use.' 41 | }, 42 | { 43 | name: 'locale', 44 | type: String, 45 | aliases: [ 'l' ], 46 | description: 'Specifies the source language of the application.' 47 | }, 48 | { 49 | name: 'out-file', 50 | type: String, 51 | aliases: [ 'of' ], 52 | description: 'Name of the file to output.' 53 | }, 54 | ] 55 | .sort(sort('asc', o => o.name)) 56 | .map(type) 57 | }; 58 | -------------------------------------------------------------------------------- /src/core/app.interface.ts: -------------------------------------------------------------------------------- 1 | import { FilesManager } from './files'; 2 | import { SchematicsManager } from './schematics'; 3 | import { Subject } from 'rxjs/Subject'; 4 | import defaultConfiguration from './config'; 5 | 6 | export interface AngularGUIApp { 7 | action: Subject; 8 | config: typeof defaultConfiguration; 9 | files: FilesManager; 10 | logger; 11 | runner; 12 | schematics: SchematicsManager; 13 | initialize: (config: typeof defaultConfiguration) => Promise; 14 | rebuild: () => Promise; 15 | } 16 | -------------------------------------------------------------------------------- /src/core/app.spec.ts: -------------------------------------------------------------------------------- 1 | import * as http from 'http'; 2 | 3 | import { setupWithoutSchematics, versions } from '../test'; 4 | 5 | import { AngularGUI } from './app'; 6 | import { AngularGUIApp } from './app.interface'; 7 | 8 | describe('AngularGUI', () => { 9 | let gui: AngularGUIApp; 10 | 11 | beforeEach(() => { 12 | gui = setupWithoutSchematics(); 13 | }); 14 | 15 | it('should be created', () => { 16 | expect(gui).toBeDefined(); 17 | }); 18 | 19 | it('should initialize files manager', async () => { 20 | expect(gui.files).not.toBeDefined(); 21 | await gui.initialize(gui.config); 22 | 23 | expect(gui.files).toBeDefined(); 24 | }); 25 | 26 | it('should initialize schematics manager', async () => { 27 | expect(gui.schematics).not.toBeDefined(); 28 | await gui.initialize(gui.config); 29 | 30 | expect(gui.schematics).toBeDefined(); 31 | }); 32 | }); 33 | 34 | -------------------------------------------------------------------------------- /src/core/command.interface.ts: -------------------------------------------------------------------------------- 1 | export interface Command { 2 | description: string; 3 | guid: string; 4 | name: string; 5 | options?: Array<{ name: string; value: any; }>; 6 | payload: any; 7 | pid: number; 8 | script: string; 9 | type: string; 10 | value: string; 11 | } 12 | -------------------------------------------------------------------------------- /src/core/config.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | port: 4300, 3 | rootDir: '.angular-gui', 4 | npmRunner: '.', 5 | commands: [ 6 | 'build', 7 | 'e2e', 8 | 'generate', 9 | 'lint', 10 | 'serve', 11 | 'shell', 12 | 'test', 13 | 'xi18n', 14 | ], 15 | commandOptions: { 16 | environment: [ 17 | 'dev', 18 | 'prod', 19 | ], 20 | target: [ 21 | 'development', 22 | 'production', 23 | ], 24 | collection: [ 25 | '@schematics/angular', 26 | ], 27 | styleext: [ 28 | 'scss', 29 | 'styl', 30 | 'css', 31 | ] 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /src/core/files.ts: -------------------------------------------------------------------------------- 1 | import { 2 | basename, 3 | copyFolder, 4 | dirname, 5 | existsSync, 6 | globSync, 7 | join, 8 | readFile, 9 | readFiles, 10 | rmdirp, 11 | unlinkp, 12 | updateJson, 13 | writeFile 14 | } from './helpers'; 15 | 16 | import { uniqueFn } from './utils'; 17 | 18 | const EXTENSION_UNIQUE_IDENTIFIER = 'sasxa-net.angular-gui'; 19 | 20 | /** 21 | * Exposes file system commands for specific files 22 | */ 23 | export class FilesManager { 24 | extensionRoot; 25 | extensionRootDir = '.angular-gui'; // For development only 26 | extensionProjectFolder; 27 | 28 | workspaceRoot; 29 | workspaceRootDir; 30 | workspaceCommandsFolder; 31 | workspaceSchematicsFolder; 32 | 33 | constructor(private config) { 34 | this.extensionRoot = this.config.extensionRoot; 35 | this.workspaceRoot = this.config.workspaceRoot; 36 | 37 | if (this.extensionRoot.includes(EXTENSION_UNIQUE_IDENTIFIER)) { 38 | this.extensionRootDir = ''; 39 | } 40 | 41 | this.extensionProjectFolder = join(this.extensionRoot, this.extensionRootDir, basename(this.workspaceRoot)); 42 | this.workspaceRootDir = join(this.workspaceRoot, this.config.rootDir); 43 | this.workspaceCommandsFolder = join(this.workspaceRootDir, 'commands'); 44 | this.workspaceSchematicsFolder = join(this.workspaceRootDir, 'schematics'); 45 | } 46 | 47 | /** 48 | * Copy installed project schematics 49 | * from workspace "node_modules" to extension "node_modules" 50 | */ 51 | copyProjectSchematics(collections: string[]) { 52 | const promises 53 | = collections 54 | .filter(uniqueFn) 55 | .map(collectionName => { 56 | const pattern1 = join(this.workspaceRoot, 'node_modules', collectionName); 57 | const pattern2 = join(this.extensionRoot, 'schematics'); 58 | 59 | const schematicsFolder 60 | = existsSync(pattern1) 61 | ? pattern1 62 | : existsSync(pattern2) 63 | ? pattern2 64 | : null; 65 | 66 | return schematicsFolder 67 | ? { 68 | source: join(schematicsFolder, '*'), 69 | target: join(this.extensionRoot, 'node_modules', collectionName) 70 | } 71 | : null; 72 | }) 73 | .filter(o => !!o) 74 | .map(o => copyFolder(o.source, o.target)); 75 | 76 | return Promise.all(promises); 77 | } 78 | 79 | /** 80 | * Copy schematics modified by user 81 | * from gui schematics folder to extension folder 82 | * to be able to use them in client app 83 | */ 84 | async copyUserSchematics() { 85 | const promises 86 | = globSync('**/.changes.json', { cwd: this.workspaceSchematicsFolder }) 87 | .map(pathinfo => join(this.workspaceSchematicsFolder, pathinfo)) 88 | .map(pathinfo => { 89 | return readFile(pathinfo) 90 | .then(changes => ({ 91 | ...changes, 92 | source: join(dirname(pathinfo), '*'), 93 | target: join(this.extensionRoot, 'node_modules', changes.path), 94 | })) 95 | .then(o => copyFolder(o.source, o.target)) 96 | }) 97 | return Promise.all(promises); 98 | } 99 | 100 | private updateRunnerScript(data) { 101 | if (!data) { return data; } 102 | const alias = this.config.npmRunner; 103 | const shouldUpdatePackageJson 104 | = !data.scripts 105 | || !(alias in data.scripts) 106 | || data.scripts[ alias ].includes('.runner.sh'); 107 | 108 | if (shouldUpdatePackageJson) { 109 | const command = `sh ${ this.config.rootDir }/.runner.sh`; 110 | const scripts = { [ alias ]: command, ...data.scripts }; 111 | return { ...data, scripts }; 112 | } else { 113 | return data; 114 | } 115 | }; 116 | 117 | createRunnerScript() { 118 | const script = `script=$1\nshift\nsh ${ this.config.rootDir }/commands/$script.sh $@`; 119 | const filename = join(this.workspaceRootDir, '.runner.sh'); 120 | const packagePath = join(this.workspaceRoot, 'package.json'); 121 | return writeFile(filename, script) 122 | .then(() => 123 | updateJson(packagePath, data => 124 | this.updateRunnerScript(data))); 125 | } 126 | 127 | saveClientConfig(data) { 128 | const filename = join(this.extensionProjectFolder, '.angular-gui.json'); 129 | return writeFile(filename, data); 130 | } 131 | 132 | deleteClientConfig() { 133 | return rmdirp(this.extensionProjectFolder); 134 | } 135 | 136 | saveCommand(name, data) { 137 | const filename = join(this.workspaceCommandsFolder, `${ name }.sh`); 138 | return writeFile(filename, data); 139 | } 140 | 141 | deleteCommand(name) { 142 | const filename = join(this.workspaceCommandsFolder, `${ name }.sh`); 143 | return unlinkp(filename); 144 | } 145 | 146 | get hasRunnerScript() { 147 | const filename = join(this.workspaceRootDir, '.runner.sh'); 148 | return existsSync(filename); 149 | } 150 | 151 | get cliConfig() { 152 | const filename = join(this.workspaceRoot, '.angular-cli.json'); 153 | return readFile(filename); 154 | } 155 | 156 | get clientConfig() { 157 | const filename = join(this.extensionProjectFolder, '.angular-gui.json'); 158 | return readFile(filename); 159 | } 160 | 161 | get guiCommands() { 162 | return readFiles(this.workspaceCommandsFolder, '*'); 163 | } 164 | 165 | get packageJSON() { 166 | const filename 167 | = join(this.extensionRoot, 'package.json'); 168 | return readFile(filename); 169 | } 170 | } 171 | -------------------------------------------------------------------------------- /src/core/helpers.ts: -------------------------------------------------------------------------------- 1 | import * as fs from 'fs'; 2 | import * as glob from 'glob'; 3 | import * as path from 'path'; 4 | import * as shell from 'shelljs'; 5 | 6 | export { normalize } from '@angular-devkit/core'; 7 | 8 | export const basename = path.basename; 9 | export const dirname = path.dirname; 10 | export const join = path.join; 11 | export const resolve = path.resolve; 12 | export const existsSync = fs.existsSync; 13 | export const globSync = glob.sync; 14 | 15 | ////////////////////////////////////////////////////////////// 16 | //#region fs helpers 17 | 18 | export async function mkdirp(o) { 19 | return existsSync(o) 20 | ? true 21 | : await mkdirp(dirname(o)) 22 | .then(() => new Promise(res => 23 | fs.mkdir(resolve(o), (error) => res(error || true)))); 24 | } 25 | 26 | export async function readFilep(o) { 27 | return new Promise(res => 28 | fs.readFile(resolve(o), 'utf-8', (error, data) => 29 | res(null || data))); 30 | } 31 | 32 | export async function rmdirp(o) { 33 | const folder = resolve(o); 34 | if (existsSync(folder)) { 35 | shell.mv(folder, folder + '_'); 36 | shell.rm('-rf', folder + '_'); 37 | } 38 | } 39 | 40 | export async function unlinkp(o) { 41 | return existsSync(o) 42 | ? new Promise(res => 43 | fs.unlink(resolve(o), (error) => res(error || true))) 44 | : true; 45 | } 46 | 47 | //#endregion 48 | ////////////////////////////////////////////////////////////// 49 | 50 | export async function copyFile(filapath, folder) { 51 | const target = join(folder, basename(filapath)); 52 | return writeFile(target, await readFilep(filapath)); 53 | } 54 | 55 | export async function copyFolder(folderFrom, folderTo) { 56 | const target = resolve(folderTo); 57 | const folder = await mkdirp(target); 58 | if (folder !== true) { return folder; } 59 | 60 | const shouldCopy 61 | = typeof folderFrom === 'string' 62 | ? globSync(folderFrom).length 63 | : folderFrom.length; 64 | 65 | if (shouldCopy) { 66 | shell.cp('-Ru', folderFrom, target); 67 | } 68 | } 69 | 70 | export async function readFile(filepath) { 71 | const data = await readFilep(filepath) as string; 72 | return /^[\{|\[]/.test(data) 73 | ? JSON.parse(data) 74 | : data; 75 | } 76 | 77 | export async function readFiles(folder, pattern) { 78 | const files 79 | = globSync(pattern, { cwd: folder }) 80 | .map(file => join(folder, file)); 81 | 82 | return Promise.all(files.map(o => readFile(o).then(data => { 83 | return { [ basename(o) ]: data }; 84 | }))); 85 | } 86 | 87 | export async function writeFile(filepath, data, backup = false): Promise { 88 | const folder = await mkdirp(dirname(filepath)); 89 | if (folder !== true) { return folder; } 90 | 91 | data = typeof data === 'object' 92 | ? JSON.stringify(data, null, 2) 93 | : data; 94 | 95 | return new Promise(res => 96 | fs.writeFile(resolve(filepath), data, (error) => res(error || true))); 97 | } 98 | 99 | export async function updateJson(filepath, transform: (o: T) => T, backup = false) { 100 | const data = await readFile(filepath); 101 | const updated = transform(data); 102 | return updated 103 | ? writeFile(filepath, updated, backup) 104 | : true; 105 | } 106 | -------------------------------------------------------------------------------- /src/core/messages.ts: -------------------------------------------------------------------------------- 1 | export const MESSAGE = { 2 | CLIENT_CONNECTED: origin => `Client connected from ${ origin }.`, 3 | CLIENT_DISCONNECTED: `Client disconnected.`, 4 | CLIENT_SHOULD_UPDATE: 'Client not connected. Please update settings manually.', 5 | 6 | CONFIG_CHANGE: 'GUI for Angular configuration changed. You should rebuild client configuration.', 7 | CONFIG_UNAVAILABLE: '".angular-cli.json" not found in workspace.', 8 | 9 | DELETE_START: name => `Deleting script: ${ name }.sh`, 10 | DELETE_SUCCESS: name => `Deleted script: ${ name }.sh`, 11 | DELETE_FAILURE: 'Delete failed', 12 | 13 | DOCUMENT_DOESNT_EXIST: 'Document does not exist.', 14 | 15 | DRY_RUN: 'NOTE: Run with "dry run" no changes were made.', 16 | 17 | EXEC_START: name => `Executing script: ${ name }`, 18 | EXEC_SUCCESS: name => `Executed script: ${ name }`, 19 | 20 | FEATURE_UNAVAILABLE: 'This feature is not available.', 21 | 22 | INVALID_COMMAND: 'Invalid command', 23 | 24 | KILL_START: name => `Terminating script: ${ name }`, 25 | KILL_SUCCESS: name => `Terminated script: ${ name }`, 26 | 27 | REBUILD_START: 'Rebuilding client configuration...', 28 | REBUILD_FINISH: 'Building complete.', 29 | 30 | SAVE_START: name => `Saving script: ${ name }.sh`, 31 | SAVE_SUCCESS: name => `Saved script: ${ name }.sh`, 32 | SAVE_FAILURE: 'Save failed', 33 | 34 | SCHEMATIC_CLONE: name => 35 | `Blueprint "${ name }" is copied to the workspace.\n` 36 | + 'Modify files and rebuild configuration in order to use them.', 37 | SCHEMATIC_CLONE_SUCCESS: 'Copied schematic to workspace.', 38 | 39 | SERVER_CONNECTED: port => `Listening on localhost:${ port }...`, 40 | SERVER_DISCONNECTED: 'Server terminated', 41 | 42 | STATUS_CONNECTED: 'Client connected', 43 | STATUS_INACTIVE: 'Inactive', 44 | STATUS_LISTENING: 'Waiting for client connection', 45 | STATUS_START: '(click to Start GUI for Angular)', 46 | STATUS_STOP: '(click to Stop GUI for Angular)', 47 | STATUS_TEXT: '$(shield)', 48 | 49 | WORKSPACE_UNAVAILABLE: 'FATAL ERROR: Cannot access workspace.', 50 | }; 51 | -------------------------------------------------------------------------------- /src/core/options.ts: -------------------------------------------------------------------------------- 1 | import { classify, omitBy } from './utils'; 2 | import { globSync, join, normalize } from './helpers'; 3 | 4 | import { FileSystemSchematicDesc } from "@angular-devkit/schematics/tools"; 5 | 6 | function transform(schematic: FileSystemSchematicDesc, options, cliConfig) { 7 | const blueprint: any 8 | = schematic.schemaJson.properties; 9 | 10 | const defaults: any 11 | = Object.entries(blueprint) 12 | .filter(([ name, option ]) => 13 | 'default' in option 14 | && option.default !== '') 15 | .reduce((dict, [ name, option ]) => ({ 16 | ...dict, 17 | [ name ]: option.default 18 | }), {}); 19 | 20 | const app 21 | = cliConfig.apps.find(a => a.name === options.app) 22 | || cliConfig.apps[ 0 ]; 23 | 24 | return { app, blueprint, defaults }; 25 | } 26 | 27 | function getModule(filename, root, source = '') { 28 | if (!filename) { return; } 29 | return globSync(`**/${ filename }`, { 30 | cwd: join(root, source) 31 | })[ 0 ]; 32 | } 33 | 34 | export function generateCommandPaths(schematic: FileSystemSchematicDesc, options, cliConfig, rootDir) { 35 | const { app, blueprint, defaults } 36 | = transform(schematic, options, cliConfig); 37 | 38 | const sourceDir 39 | = !('sourceDir' in blueprint) 40 | ? null 41 | : ('appRoot' in blueprint) 42 | ? app.root 43 | : options.sourceDir || defaults.sourceDir; 44 | 45 | const path 46 | = !('path' in blueprint) 47 | ? null 48 | : options.path || defaults.path; 49 | 50 | const module 51 | = !('module' in blueprint) 52 | ? null 53 | : ('sourceDir' in blueprint) 54 | ? getModule(options.module, rootDir, sourceDir) 55 | : join(app.root, getModule(options.module, rootDir, app.root)) 56 | 57 | const appRoot 58 | = module && sourceDir 59 | ? '.' 60 | : null; 61 | 62 | const skipImport 63 | = !('skipImport' in blueprint) 64 | ? null 65 | : options.module 66 | ? options.skipImport || defaults.skipImport 67 | : true; 68 | 69 | return omitBy({ 70 | appRoot, 71 | module, 72 | path, 73 | skipImport, 74 | sourceDir, 75 | }, o => o === null); 76 | } 77 | 78 | export function generateCommandDefaults(schematic: FileSystemSchematicDesc, options, cliConfig) { 79 | const { app, blueprint, defaults } 80 | = transform(schematic, options, cliConfig); 81 | 82 | const htmlTemplate 83 | = !('htmlTemplate' in blueprint) 84 | ? null 85 | : `\n` 86 | + `

\n ${ classify(options.name + '-' + schematic.name) } Works!\n

`; 87 | 88 | const viewEncapsulation 89 | = !('viewEncapsulation' in blueprint) 90 | ? null 91 | : options.viewEncapsulation || defaults.viewEncapsulation; 92 | 93 | const styleext 94 | = !('styleext' in blueprint) 95 | ? null 96 | : options.styleext 97 | ? options.styleext 98 | : cliConfig.defaults 99 | && cliConfig.defaults.styleExt 100 | ? cliConfig.defaults.styleExt 101 | : null; 102 | 103 | return omitBy({ 104 | ...defaults, 105 | htmlTemplate, 106 | styleext, 107 | viewEncapsulation, 108 | }, o => o === null); 109 | } 110 | 111 | export function generateCommandValues(schematic: FileSystemSchematicDesc, options) { 112 | const blueprint: any 113 | = schematic.schemaJson.properties; 114 | 115 | return omitBy(options, (_, key) => !(key in blueprint)); 116 | } 117 | -------------------------------------------------------------------------------- /src/core/schematics.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestEngineHost, setupWithSchematics, versions } from '../test'; 2 | 3 | import { AngularGUIApp } from './app.interface'; 4 | import { SchematicsManager } from './schematics'; 5 | 6 | versions.forEach(version => { 7 | const { cli, sch } = version; 8 | const suiteTitle 9 | = `SchematicsManager: ` 10 | + `cli: ${ cli }, ` 11 | + `schematics: ${ sch }`; 12 | 13 | describe(suiteTitle, () => { 14 | let gui: AngularGUIApp; 15 | let schematics: SchematicsManager; 16 | 17 | beforeEach(async () => { 18 | gui = setupWithSchematics(cli, sch); 19 | schematics = gui.schematics; 20 | }); 21 | 22 | it('should work', () => { 23 | throw null; 24 | 25 | }); 26 | }); 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /src/core/utils.spec.ts: -------------------------------------------------------------------------------- 1 | import * as utils from './utils'; 2 | 3 | describe(`sort(direction: 'asc' | 'desc', transform = o => o)`, () => { 4 | it('should sort an array of strings in ascending order', () => { 5 | const array = [ 'a', 'c', 'b' ]; 6 | expect(array.sort(utils.sort('asc'))).toEqual([ 'a', 'b', 'c' ]); 7 | }); 8 | it('should sort an array of strings in descending order', () => { 9 | const array = [ 'a', 'c', 'b' ]; 10 | expect(array.sort(utils.sort('desc'))).toEqual([ 'c', 'b', 'a' ]); 11 | }); 12 | it('should sort an array of numbers in ascending order', () => { 13 | const array = [ 1, 3, 2 ]; 14 | expect(array.sort(utils.sort('asc'))).toEqual([ 1, 2, 3 ]); 15 | }); 16 | it('should sort an array of numbers in descending order', () => { 17 | const array = [ 1, 3, 2 ]; 18 | expect(array.sort(utils.sort('desc'))).toEqual([ 3, 2, 1 ]); 19 | }); 20 | it('should sort an array of objects by "$key" in ascending order', () => { 21 | const array = [ { $key: 1 }, { $key: 3 }, { $key: 2 }]; 22 | expect(array.sort(utils.sort('asc', o => o.$key))).toEqual([ 23 | { $key: 1 }, 24 | { $key: 2 }, 25 | { $key: 3 } 26 | ]); 27 | }); 28 | it('should not sort an array of objects, when property is falsy', () => { 29 | const array = [ { $key: 1 }, { $key: 3 }, { $key: 2 }]; 30 | expect(array.sort(utils.sort('desc', o => o.a))).toEqual(array); 31 | }); 32 | it('should sort an array of objects by property in descending order', () => { 33 | const array = [ { $key: 1, a: 2 }, { $key: 3, a: 1 }, { $key: 2, a: 3 }]; 34 | expect(array.sort(utils.sort('desc', o => o.a))).toEqual([ 35 | { $key: 2, a: 3 }, 36 | { $key: 1, a: 2 }, 37 | { $key: 3, a: 1 } 38 | ]); 39 | }); 40 | }); 41 | 42 | describe('type', () => { 43 | it('should transform type property to string', () => { 44 | expect(utils.type({ type: String })).toEqual({ type: 'string' }); 45 | expect(utils.type({ type: Number })).toEqual({ type: 'number' }); 46 | expect(utils.type({ type: 'Path' })).toEqual({ type: 'path' }); 47 | expect(utils.type({ type: Boolean })).toEqual({ type: 'boolean' }); 48 | }); 49 | }); 50 | 51 | describe('omitBy(source: T, filter: (value: any, key: string) => boolean)', () => { 52 | const obj = { a: 1, b: 2 }; 53 | it('should return input if it is null or not an object', () => { 54 | expect(utils.omitBy(null, null)).toBe(null); 55 | expect(utils.omitBy(123, null)).toBe(123); 56 | expect(utils.omitBy('abc', null)).toBe('abc'); 57 | }); 58 | it('should return new object without matched keys for value filter', () => { 59 | expect(utils.omitBy(obj, (value, key) => value === 1)).toEqual({ b: 2 }); 60 | }); 61 | it('should return new object without matched keys for key filter', () => { 62 | expect(utils.omitBy(obj, (value, key) => key === 'b')).toEqual({ a: 1 }); 63 | }); 64 | }); 65 | 66 | describe('uniqueFn(value: T, index: number, array: T[])', () => { 67 | it('should filter duplicates in array', () => { 68 | const array = [ 1, 2, 3, 2, 1 ]; 69 | expect(array.filter(utils.uniqueFn)).toEqual([ 1, 2, 3 ]); 70 | }); 71 | }); -------------------------------------------------------------------------------- /src/core/utils.ts: -------------------------------------------------------------------------------- 1 | export { camelize, classify, dasherize, terminal } from '@angular-devkit/core'; 2 | 3 | export function sort(direction: 'asc' | 'desc', transform = o => o) { 4 | return (a, b) => { 5 | a = transform(a); 6 | b = transform(b); 7 | 8 | const A = isNaN(+a) 9 | ? a 10 | : +a; 11 | const B = isNaN(+b) 12 | ? b 13 | : +b; 14 | const r = (A < B ? -1 : 1) * (direction.toLowerCase() === 'asc' ? 1 : -1); 15 | return r; 16 | }; 17 | } 18 | 19 | export function type(o) { 20 | return { 21 | ...o, 22 | type: 23 | typeof o.type === 'function' 24 | ? o.type.name.toLowerCase() 25 | : o.type.toLowerCase() 26 | }; 27 | } 28 | 29 | export function omitBy(source: T, filter: (value: any, key: string) => boolean): Partial { 30 | return typeof source !== 'object' || source === null 31 | ? source 32 | : Object.entries(source) 33 | .filter(([ key, value ]) => !filter(value, key)) 34 | .reduce((dict, [ key, value ]) => ({ ...dict, [ key ]: value }), {} as any); 35 | } 36 | 37 | export function uniqueFn(value: T, index: number, array: T[]) { 38 | return value && array.indexOf(value) === index; 39 | } 40 | -------------------------------------------------------------------------------- /src/extension.ts: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // The module 'vscode' contains the VS Code extensibility API 4 | // Import the module and reference it with the alias vscode in your code below 5 | 6 | import * as vscode from 'vscode'; 7 | 8 | import { existsSync, join, normalize, resolve } from './core/helpers'; 9 | 10 | import { AngularGUI } from './core/app'; 11 | import { MESSAGE } from './core/messages'; 12 | import defaultConfiguration from './core/config'; 13 | 14 | // this method is called when your extension is activated 15 | // your extension is activated the very first time the command is executed 16 | export function activate(context: vscode.ExtensionContext) { 17 | const config 18 | = vscode.workspace.getConfiguration() 19 | .get('angular-gui', defaultConfiguration); 20 | 21 | try { 22 | const rootUri = vscode.workspace.workspaceFolders[ 0 ]; 23 | config[ 'workspaceRoot' ] = rootUri.uri.fsPath; 24 | config[ 'extensionRoot' ] = resolve(__dirname, '..'); 25 | } catch { 26 | return vscode.window.showErrorMessage(MESSAGE.WORKSPACE_UNAVAILABLE); 27 | } 28 | 29 | const output 30 | = vscode.window.createOutputChannel('GUI for Angular'); 31 | const gui 32 | = new AngularGUI(config, message => output.appendLine(message.toString())); 33 | const status 34 | = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, 0); 35 | status.text = MESSAGE.STATUS_TEXT; 36 | 37 | function statusUpdate(value: 'listening' | 'connected' | 'disconnected') { 38 | if (value === 'connected') { 39 | status.command = 'extension.disconnect'; 40 | status.tooltip = `${ MESSAGE.STATUS_CONNECTED } ${ MESSAGE.STATUS_STOP }`; 41 | status.color = '#5f7c8a'; 42 | 43 | } else if (value === 'listening') { 44 | status.command = 'extension.disconnect'; 45 | status.tooltip = `${ MESSAGE.STATUS_LISTENING } ${ MESSAGE.STATUS_STOP }`; 46 | status.color = '#ffc107'; 47 | 48 | } else if (value === 'disconnected') { 49 | status.command = 'extension.connectOnline'; 50 | status.tooltip = `${ MESSAGE.STATUS_INACTIVE } ${ MESSAGE.STATUS_START }`; 51 | status.color = null; 52 | } 53 | } 54 | 55 | function openDocumnent(path) { 56 | const fullPath 57 | = normalize(path).startsWith(normalize(config[ 'workspaceRoot' ])) 58 | ? path 59 | : normalize(join(config[ 'workspaceRoot' ], path)); 60 | 61 | if (!existsSync(fullPath)) { 62 | return vscode.window.showWarningMessage(MESSAGE.DOCUMENT_DOESNT_EXIST); 63 | } 64 | 65 | vscode.workspace 66 | .openTextDocument(fullPath) 67 | .then(doc => vscode.window.showTextDocument(doc)) 68 | } 69 | 70 | function processAction(action) { 71 | switch (action.type) { 72 | case 'open': 73 | return openDocumnent(action.payload); 74 | } 75 | } 76 | 77 | function configurationChanges(): { [ key: string ]: boolean } { 78 | const change = vscode.workspace.getConfiguration('angular-gui'); 79 | return Object.keys(change) 80 | .filter(key => key in config) 81 | .reduce((dict, key) => { 82 | let a = change[ key ]; 83 | let b = config[ key ]; 84 | if (key === 'commandOptions') { 85 | // collection and blueprint options are generated at runtime 86 | a = { ...change[ key ], blueprint: null, collection: null }; 87 | b = { ...config[ key ], blueprint: null, collection: null }; 88 | } 89 | return { ...dict, [ key ]: JSON.stringify(a) !== JSON.stringify(b) } 90 | }, {} as any); 91 | } 92 | 93 | statusUpdate('disconnected'); 94 | status.show(); 95 | 96 | vscode.workspace.onDidChangeConfiguration((e) => { 97 | const changes = configurationChanges(); 98 | 99 | if (Object.values(changes).some(o => !!o)) { 100 | const change = vscode.workspace.getConfiguration('angular-gui'); 101 | // console.log(changes, config, change); 102 | gui.initialize({ ...config, ...change }); 103 | 104 | if (changes.commandOptions || changes.commands) { 105 | vscode.window.showInformationMessage(MESSAGE.CONFIG_CHANGE, 'Rebuild') 106 | .then(rebuild => 107 | rebuild 108 | ? vscode.commands 109 | .executeCommand('extension.rebuildConfiguration') 110 | : null); 111 | } 112 | 113 | if (changes.port) { 114 | if (gui.runner.socket) { 115 | gui.runner.socket.emit('settings', { port: change.port }); 116 | } else { 117 | vscode.window.showWarningMessage(MESSAGE.CLIENT_SHOULD_UPDATE); 118 | } 119 | } 120 | 121 | } 122 | }); 123 | 124 | // The command has been defined in the package.json file 125 | // Now provide the implementation of the command with registerCommand 126 | // The commandId parameter must match the command field in package.json 127 | const offline = vscode.commands 128 | .registerCommand('extension.connectOffline', () => 129 | vscode.window.showWarningMessage(MESSAGE.FEATURE_UNAVAILABLE)); 130 | 131 | const online = vscode.commands 132 | .registerCommand('extension.connectOnline', () => 133 | existsSync(join(config[ 'workspaceRoot' ], '.angular-cli.json')) 134 | ? gui.start(statusUpdate).forEach(processAction) 135 | : vscode.window.showWarningMessage(MESSAGE.CONFIG_UNAVAILABLE)); 136 | 137 | const disconnect = vscode.commands 138 | .registerCommand('extension.disconnect', () => 139 | gui.runner.socket 140 | ? gui.stop(statusUpdate) 141 | : null); 142 | 143 | const rebuild = vscode.commands 144 | .registerCommand('extension.rebuildConfiguration', () => { 145 | vscode.window.showInformationMessage(MESSAGE.REBUILD_START); 146 | gui.rebuild().then(() => 147 | vscode.window.showInformationMessage(MESSAGE.REBUILD_FINISH)); 148 | }); 149 | 150 | context.subscriptions.push(offline, online, rebuild, status); 151 | } 152 | 153 | // this method is called when your extension is deactivated 154 | export function deactivate() { 155 | } -------------------------------------------------------------------------------- /src/images/angular-gui-alpha-0.0.1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angular-gui/vscode-angular-gui/60f2f310b0cd7145fc52e67f1601242cd5090a50/src/images/angular-gui-alpha-0.0.1.gif -------------------------------------------------------------------------------- /src/images/angular-gui-alpha-0.0.8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angular-gui/vscode-angular-gui/60f2f310b0cd7145fc52e67f1601242cd5090a50/src/images/angular-gui-alpha-0.0.8.gif -------------------------------------------------------------------------------- /src/images/angular-gui-alpha-0.1.2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angular-gui/vscode-angular-gui/60f2f310b0cd7145fc52e67f1601242cd5090a50/src/images/angular-gui-alpha-0.1.2.gif -------------------------------------------------------------------------------- /src/images/angular-gui-beta-0.4.2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angular-gui/vscode-angular-gui/60f2f310b0cd7145fc52e67f1601242cd5090a50/src/images/angular-gui-beta-0.4.2.gif -------------------------------------------------------------------------------- /src/images/angular-gui-beta-0.4.5-mobile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angular-gui/vscode-angular-gui/60f2f310b0cd7145fc52e67f1601242cd5090a50/src/images/angular-gui-beta-0.4.5-mobile.gif -------------------------------------------------------------------------------- /src/images/angular-gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angular-gui/vscode-angular-gui/60f2f310b0cd7145fc52e67f1601242cd5090a50/src/images/angular-gui.png -------------------------------------------------------------------------------- /src/images/angular-gui.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/images/octicon-shield.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angular-gui/vscode-angular-gui/60f2f310b0cd7145fc52e67f1601242cd5090a50/src/images/octicon-shield.png -------------------------------------------------------------------------------- /src/local.ts: -------------------------------------------------------------------------------- 1 | import { AngularGUI } from './core/app'; 2 | import config from './core/config'; 3 | import { resolve } from 'path'; 4 | 5 | /** 6 | * If you are working on extension code and want to run local.ts 7 | * workspaceRoot should point to a AngularCLI project folder 8 | * for me it's "webapps", change this to match your setup 9 | */ 10 | config[ 'workspaceRoot' ] = resolve(__dirname, '..', '..', 'webapps'); 11 | config[ 'extensionRoot' ] = resolve(__dirname, '..'); 12 | config[ 'local' ] = true; 13 | 14 | const gui = new AngularGUI(config, console.log); 15 | gui.start(o => o).subscribe(console.log); 16 | -------------------------------------------------------------------------------- /src/schematics/collection.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@schematics/angular-gui", 3 | "version": "0.4.0", 4 | "schematics": { 5 | "express": { 6 | "factory": "./express", 7 | "schema": "./express/schema.json", 8 | "description": "Configure express to serve from dist folder" 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /src/schematics/express/index.ts: -------------------------------------------------------------------------------- 1 | import { Rule, SchematicContext, Tree, apply, branchAndMerge, chain, filter, mergeWith, move, template, url } from '@angular-devkit/schematics'; 2 | 3 | import { exec } from 'child_process'; 4 | import { sortKeys } from '../utils'; 5 | 6 | const packages = [ 7 | 'compression', 8 | 'connect-history-api-fallback', 9 | 'express', 10 | 'yargs' 11 | ]; 12 | 13 | function addDependencies() { 14 | return (host: Tree, context: SchematicContext) => { 15 | if (!host.exists('package.json')) { return host; } 16 | 17 | const json = JSON.parse(host.read('package.json').toString('utf-8')); 18 | 19 | if (!json[ 'devDependencies' ]) { 20 | json[ 'devDependencies' ] = {}; 21 | } 22 | 23 | packages.forEach(name => { 24 | if (!json[ 'devDependencies' ][ name ]) { 25 | json[ 'devDependencies' ][ name ] = '*'; 26 | } 27 | }); 28 | 29 | json[ 'devDependencies' ] 30 | = sortKeys(json[ 'devDependencies' ]); 31 | 32 | host.overwrite('package.json', JSON.stringify(json, null, 2)); 33 | return host; 34 | } 35 | } 36 | 37 | function installDependencies(options: ExpressOptions) { 38 | return (host: Tree, context: SchematicContext) => { 39 | if (options.npmInstall) { 40 | const installed 41 | = packages.every(name => 42 | host.exists(`node_modules/${ name }/package.json`)); 43 | 44 | if (!installed) { 45 | exec('npm install', { cwd: host[ '_host' ][ '_root' ] }); 46 | } 47 | } 48 | return host; 49 | } 50 | } 51 | 52 | interface ExpressOptions { 53 | name: string; 54 | npmInstall: boolean; 55 | port: number; 56 | rootDir: string; 57 | } 58 | 59 | export default function (options: ExpressOptions): Rule { 60 | const scriptSource = apply(url('./files'), [ 61 | filter(path => path.endsWith('.js')), 62 | template({ ...options }), 63 | move(options.rootDir) 64 | ]); 65 | 66 | const commandSource = apply(url('./files'), [ 67 | filter(path => path.endsWith('.sh')), 68 | template({ ...options }), 69 | move(`${ options.rootDir }/commands`) 70 | ]); 71 | 72 | return chain([ 73 | addDependencies(), 74 | branchAndMerge(chain([ 75 | mergeWith(scriptSource), 76 | mergeWith(commandSource), 77 | ])), 78 | installDependencies(options) 79 | ]); 80 | } -------------------------------------------------------------------------------- /src/schematics/express/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "id": "AngularGuiExpress", 4 | "title": "AngularGUI Express Options Schema", 5 | "type": "object", 6 | "properties": { 7 | "name": { 8 | "type": "string", 9 | "description": "Specifies the name for the command script.", 10 | "default": "serve.dist" 11 | }, 12 | "npmInstall": { 13 | "type": "boolean", 14 | "description": "Install npm dependencies", 15 | "default": true 16 | }, 17 | "port": { 18 | "type": "number", 19 | "description": "Specifies the port for express server.", 20 | "default": "4200" 21 | }, 22 | "rootDir": { 23 | "type": "string", 24 | "description": "Specifies the folder for the script.", 25 | "default": ".angular-gui" 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/schematics/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@schematics/angular-gui", 3 | "version": "0.0.2", 4 | "description": "GUI for Angular Schematics", 5 | "schematics": "./collection.json" 6 | } -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | import { 2 | CollectionCannotBeResolvedException, 3 | CollectionMissingSchematicsMapException, 4 | FileSystemCollectionDesc, 5 | FileSystemEngineHost 6 | } from "@angular-devkit/schematics/tools"; 7 | import { copyFolder, existsSync, globSync, join } from './core/helpers'; 8 | 9 | import { AngularGUI } from './core/app'; 10 | import config from './core/config'; 11 | import { resolve } from 'path'; 12 | 13 | export function setupWithoutSchematics(workspaceRoot: string = '', extensionRoot: string = '') { 14 | config[ 'workspaceRoot' ] = resolve(__dirname, workspaceRoot); 15 | config[ 'extensionRoot' ] = resolve(__dirname, extensionRoot); 16 | return new AngularGUI(config, () => { }); 17 | } 18 | 19 | export function setupWithSchematics(cli: string = '', sch: string = '') { 20 | config[ 'workspaceRoot' ] = resolve(__dirname, '..', 'files', `cli-${ cli }`); 21 | config[ 'extensionRoot' ] = resolve(__dirname, '..', 'files', '__extension__'); 22 | 23 | const schematicsSource = resolve(__dirname, '..', 'files', `sch-${ sch }`, '*'); 24 | const schematicsTarget = join(config[ 'workspaceRoot' ], 'node_modules'); 25 | console.log(schematicsSource, schematicsTarget, config[ 'extensionRoot' ], config[ 'workspaceRoot' ]); 26 | copyFolder(schematicsSource, schematicsTarget); 27 | return new AngularGUI(config, () => { }); 28 | } 29 | 30 | export const versions = [ 31 | { cli: '1-5-4', sch: '0-1-7' }, 32 | ]; 33 | 34 | export class TestEngineHost extends FileSystemEngineHost { 35 | constructor(protected _root: string) { super(_root); } 36 | 37 | protected _resolveCollectionPath(name: string): string { 38 | // Allow `${_root}/${name}.json` as a collection. 39 | if (existsSync(join(this._root, name + '.json'))) { 40 | return join(this._root, name + '.json'); 41 | } 42 | 43 | // Allow `${_root}/${name}/collection.json. 44 | if (existsSync(join(this._root, name, 'collection.json'))) { 45 | return join(this._root, name, 'collection.json'); 46 | } 47 | 48 | // Allow `${_root}/ ** /${name}/collection.json. 49 | const collectionJsonPath = globSync(`${ name }/**/collection.json`, { 50 | cwd: this._root 51 | })[ 0 ]; 52 | if (collectionJsonPath) { 53 | return join(this._root, collectionJsonPath); 54 | } 55 | 56 | throw new CollectionCannotBeResolvedException(name); 57 | } 58 | 59 | protected _transformCollectionDescription( 60 | name: string, 61 | desc: Partial, 62 | ): FileSystemCollectionDesc { 63 | if (!desc.schematics || typeof desc.schematics != 'object') { 64 | throw new CollectionMissingSchematicsMapException(name); 65 | } 66 | 67 | return { ...desc, name } as FileSystemCollectionDesc; 68 | } 69 | } -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "outDir": "out", 6 | "lib": [ 7 | "es2017" 8 | ], 9 | "sourceMap": true, 10 | "rootDir": "src" 11 | }, 12 | "exclude": [ 13 | "node_modules", 14 | ".vscode-test", 15 | "schematics", 16 | "files" 17 | ] 18 | } -------------------------------------------------------------------------------- /tsconfig.schematics.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "outDir": ".", 6 | "inlineSourceMap": true, 7 | "lib": [ 8 | "es2017" 9 | ], 10 | "rootDir": "src" 11 | }, 12 | "include": [ 13 | "src/schematics" 14 | ], 15 | "exclude": [ 16 | "node_modules", 17 | ".vscode-test", 18 | "files" 19 | ] 20 | } -------------------------------------------------------------------------------- /vsc-extension-quickstart.md: -------------------------------------------------------------------------------- 1 | # Welcome to your VS Code Extension 2 | 3 | ## What's in the folder 4 | * This folder contains all of the files necessary for your extension. 5 | * `package.json` - this is the manifest file in which you declare your extension and command. 6 | The sample plugin registers a command and defines its title and command name. With this information 7 | VS Code can show the command in the command palette. It doesn’t yet need to load the plugin. 8 | * `src/extension.ts` - this is the main file where you will provide the implementation of your command. 9 | The file exports one function, `activate`, which is called the very first time your extension is 10 | activated (in this case by executing the command). Inside the `activate` function we call `registerCommand`. 11 | We pass the function containing the implementation of the command as the second parameter to 12 | `registerCommand`. 13 | 14 | ## Get up and running straight away 15 | * Press `F5` to open a new window with your extension loaded. 16 | * Run your command from the command palette by pressing (`Ctrl+Shift+P` or `Cmd+Shift+P` on Mac) and typing `Hello World`. 17 | * Set breakpoints in your code inside `src/extension.ts` to debug your extension. 18 | * Find output from your extension in the debug console. 19 | 20 | ## Make changes 21 | * You can relaunch the extension from the debug toolbar after changing code in `src/extension.ts`. 22 | * You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes. 23 | 24 | ## Explore the API 25 | * You can open the full set of our API when you open the file `node_modules/vscode/vscode.d.ts`. 26 | 27 | ## Run tests 28 | * Open the debug viewlet (`Ctrl+Shift+D` or `Cmd+Shift+D` on Mac) and from the launch configuration dropdown pick `Launch Tests`. 29 | * Press `F5` to run the tests in a new window with your extension loaded. 30 | * See the output of the test result in the debug console. 31 | * Make changes to `test/extension.test.ts` or create new test files inside the `test` folder. 32 | * By convention, the test runner will only consider files matching the name pattern `**.test.ts`. 33 | * You can create folders inside the `test` folder to structure your tests any way you want. 34 | -------------------------------------------------------------------------------- /wallaby.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function (wallaby) { 2 | return { 3 | files: [ 4 | 'src/**/*.ts*', 5 | { pattern: 'files/**', instrument: false }, 6 | { pattern: 'src/**/*.spec.ts*', ignore: true }, 7 | { pattern: 'src/schematics/**', ignore: true }, 8 | ], 9 | env: { 10 | type: 'node' 11 | }, 12 | filesWithNoCoverageCalculated: [ 13 | 'files/**', 14 | 'src/test.ts' 15 | ], 16 | tests: [ 17 | 'src/**/*.spec.ts*', 18 | { pattern: 'files/**', ignore: true }, 19 | ], 20 | testFramework: 'jasmine' 21 | } 22 | } -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const nodeExternals = require('webpack-node-externals'); 3 | 4 | module.exports = { 5 | entry: "./src/extension.ts", 6 | output: { 7 | // Set libraryTarget to load extension 8 | libraryTarget: 'commonjs', 9 | filename: "extension.js", 10 | path: __dirname + "/out", 11 | // Bundle absolute resource paths in the source-map, 12 | // so VSCode can match the source file. 13 | // devtoolModuleFilenameTemplate: '[absolute-resource-path]' 14 | }, 15 | target: 'node', 16 | externals: [ nodeExternals() ], 17 | node: { 18 | __dirname: false, 19 | }, 20 | // Enable sourcemaps for debugging webpack's output. 21 | devtool: "source-map", 22 | 23 | resolve: { 24 | extensions: [ ".ts", ".js" ], 25 | modules: [ 26 | // path.resolve('src'), 27 | path.join(__dirname, 'js'), 28 | 'node_modules', 29 | ] 30 | }, 31 | 32 | module: { 33 | rules: [ 34 | // All files with a '.ts' extension will be handled by 'awesome-typescript-loader'. 35 | { test: /\.ts$/, loader: "awesome-typescript-loader" }, 36 | 37 | // All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'. 38 | { enforce: "pre", test: /\.js$/, loader: "source-map-loader" } 39 | ] 40 | }, 41 | }; 42 | -------------------------------------------------------------------------------- /webpack.local.js: -------------------------------------------------------------------------------- 1 | const base = require('./webpack.config'); 2 | 3 | module.exports = { 4 | ...base, 5 | entry: "./src/local.ts", 6 | output: { 7 | ...base.output, 8 | filename: "local.js", 9 | }, 10 | }; 11 | --------------------------------------------------------------------------------