├── .editorconfig ├── .gitignore ├── .prettierrc ├── README.md ├── angular.json ├── apps ├── .gitkeep ├── api │ ├── jest.config.js │ ├── src │ │ ├── app │ │ │ └── .gitkeep │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ └── main.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── tslint.json ├── tuskdesk-admin-e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json ├── tuskdesk-admin │ ├── browserslist │ ├── karma.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 │ └── tslint.json ├── tuskdesk-e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json └── tuskdesk │ ├── browserslist │ ├── karma.conf.js │ ├── src │ ├── app │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── shell.component.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 │ └── tslint.json ├── jest.config.js ├── karma.conf.js ├── libs ├── .gitkeep ├── data │ ├── karma.conf.js │ ├── src │ │ ├── index.ts │ │ ├── lib │ │ │ └── .gitkeep │ │ └── test.ts │ ├── tsconfig.lib.json │ ├── tsconfig.spec.json │ └── tslint.json └── ui-shell │ ├── karma.conf.js │ ├── src │ ├── index.ts │ ├── lib │ │ ├── shell.component.ts │ │ ├── ui-shell.module.spec.ts │ │ └── ui-shell.module.ts │ └── test.ts │ ├── tsconfig.lib.json │ ├── tsconfig.spec.json │ └── tslint.json ├── nx.json ├── package-lock.json ├── package.json ├── proxy.conf.json ├── tools ├── schematics │ └── .gitkeep └── tsconfig.tools.json ├── tsconfig.json └── tslint.json /.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 | -------------------------------------------------------------------------------- /.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 | yarn-error.log 34 | testem.log 35 | /typings 36 | 37 | # System Files 38 | .DS_Store 39 | Thumbs.db 40 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Building Full-Stack Applications Using Angular CLI and Nx 2 | 3 | This is an example showing how to use Nx to build multiple Angular applications, in combination with their api services, out of reusable libraries. Read more in [this blog post](https://blog.nrwl.io). 4 | -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "", 5 | "projects": { 6 | "tuskdesk": { 7 | "root": "apps/tuskdesk/", 8 | "sourceRoot": "apps/tuskdesk/src", 9 | "projectType": "application", 10 | "prefix": "myorg", 11 | "schematics": {}, 12 | "architect": { 13 | "build": { 14 | "builder": "@angular-devkit/build-angular:browser", 15 | "options": { 16 | "outputPath": "dist/apps/tuskdesk", 17 | "index": "apps/tuskdesk/src/index.html", 18 | "main": "apps/tuskdesk/src/main.ts", 19 | "polyfills": "apps/tuskdesk/src/polyfills.ts", 20 | "tsConfig": "apps/tuskdesk/tsconfig.app.json", 21 | "assets": [ 22 | "apps/tuskdesk/src/favicon.ico", 23 | "apps/tuskdesk/src/assets" 24 | ], 25 | "styles": [ 26 | "apps/tuskdesk/src/styles.css" 27 | ], 28 | "scripts": [] 29 | }, 30 | "configurations": { 31 | "production": { 32 | "fileReplacements": [ 33 | { 34 | "replace": "apps/tuskdesk/src/environments/environment.ts", 35 | "with": "apps/tuskdesk/src/environments/environment.prod.ts" 36 | } 37 | ], 38 | "optimization": true, 39 | "outputHashing": "all", 40 | "sourceMap": false, 41 | "extractCss": true, 42 | "namedChunks": false, 43 | "aot": true, 44 | "extractLicenses": true, 45 | "vendorChunk": false, 46 | "buildOptimizer": true 47 | } 48 | } 49 | }, 50 | "serve": { 51 | "builder": "@angular-devkit/build-angular:dev-server", 52 | "options": { 53 | "browserTarget": "tuskdesk:build", 54 | "proxyConfig": "proxy.conf.json" 55 | }, 56 | "configurations": { 57 | "production": { 58 | "browserTarget": "tuskdesk:build:production" 59 | } 60 | } 61 | }, 62 | "extract-i18n": { 63 | "builder": "@angular-devkit/build-angular:extract-i18n", 64 | "options": { 65 | "browserTarget": "tuskdesk:build" 66 | } 67 | }, 68 | "test": { 69 | "builder": "@angular-devkit/build-angular:karma", 70 | "options": { 71 | "main": "apps/tuskdesk/src/test.ts", 72 | "polyfills": "apps/tuskdesk/src/polyfills.ts", 73 | "tsConfig": "apps/tuskdesk/tsconfig.spec.json", 74 | "karmaConfig": "apps/tuskdesk/karma.conf.js", 75 | "styles": [ 76 | "apps/tuskdesk/src/styles.css" 77 | ], 78 | "scripts": [], 79 | "assets": [ 80 | "apps/tuskdesk/src/favicon.ico", 81 | "apps/tuskdesk/src/assets" 82 | ] 83 | } 84 | }, 85 | "lint": { 86 | "builder": "@angular-devkit/build-angular:tslint", 87 | "options": { 88 | "tsConfig": [ 89 | "apps/tuskdesk/tsconfig.app.json", 90 | "apps/tuskdesk/tsconfig.spec.json" 91 | ], 92 | "exclude": [ 93 | "**/node_modules/**" 94 | ] 95 | } 96 | } 97 | } 98 | }, 99 | "tuskdesk-e2e": { 100 | "root": "apps/tuskdesk-e2e/", 101 | "projectType": "application", 102 | "architect": { 103 | "e2e": { 104 | "builder": "@angular-devkit/build-angular:protractor", 105 | "options": { 106 | "protractorConfig": "apps/tuskdesk-e2e/protractor.conf.js", 107 | "devServerTarget": "tuskdesk:serve" 108 | }, 109 | "configurations": { 110 | "production": { 111 | "devServerTarget": "tuskdesk:serve:production" 112 | } 113 | } 114 | }, 115 | "lint": { 116 | "builder": "@angular-devkit/build-angular:tslint", 117 | "options": { 118 | "tsConfig": "apps/tuskdesk-e2e/tsconfig.e2e.json", 119 | "exclude": [ 120 | "**/node_modules/**" 121 | ] 122 | } 123 | } 124 | } 125 | }, 126 | "tuskdesk-admin": { 127 | "root": "apps/tuskdesk-admin/", 128 | "sourceRoot": "apps/tuskdesk-admin/src", 129 | "projectType": "application", 130 | "prefix": "myorg", 131 | "schematics": {}, 132 | "architect": { 133 | "build": { 134 | "builder": "@angular-devkit/build-angular:browser", 135 | "options": { 136 | "outputPath": "dist/apps/tuskdesk-admin", 137 | "index": "apps/tuskdesk-admin/src/index.html", 138 | "main": "apps/tuskdesk-admin/src/main.ts", 139 | "polyfills": "apps/tuskdesk-admin/src/polyfills.ts", 140 | "tsConfig": "apps/tuskdesk-admin/tsconfig.app.json", 141 | "assets": [ 142 | "apps/tuskdesk-admin/src/favicon.ico", 143 | "apps/tuskdesk-admin/src/assets" 144 | ], 145 | "styles": [ 146 | "apps/tuskdesk-admin/src/styles.css" 147 | ], 148 | "scripts": [] 149 | }, 150 | "configurations": { 151 | "production": { 152 | "fileReplacements": [ 153 | { 154 | "replace": "apps/tuskdesk-admin/src/environments/environment.ts", 155 | "with": "apps/tuskdesk-admin/src/environments/environment.prod.ts" 156 | } 157 | ], 158 | "optimization": true, 159 | "outputHashing": "all", 160 | "sourceMap": false, 161 | "extractCss": true, 162 | "namedChunks": false, 163 | "aot": true, 164 | "extractLicenses": true, 165 | "vendorChunk": false, 166 | "buildOptimizer": true 167 | } 168 | } 169 | }, 170 | "serve": { 171 | "builder": "@angular-devkit/build-angular:dev-server", 172 | "options": { 173 | "browserTarget": "tuskdesk-admin:build" 174 | }, 175 | "configurations": { 176 | "production": { 177 | "browserTarget": "tuskdesk-admin:build:production" 178 | } 179 | } 180 | }, 181 | "extract-i18n": { 182 | "builder": "@angular-devkit/build-angular:extract-i18n", 183 | "options": { 184 | "browserTarget": "tuskdesk-admin:build" 185 | } 186 | }, 187 | "test": { 188 | "builder": "@angular-devkit/build-angular:karma", 189 | "options": { 190 | "main": "apps/tuskdesk-admin/src/test.ts", 191 | "polyfills": "apps/tuskdesk-admin/src/polyfills.ts", 192 | "tsConfig": "apps/tuskdesk-admin/tsconfig.spec.json", 193 | "karmaConfig": "apps/tuskdesk-admin/karma.conf.js", 194 | "styles": [ 195 | "apps/tuskdesk-admin/src/styles.css" 196 | ], 197 | "scripts": [], 198 | "assets": [ 199 | "apps/tuskdesk-admin/src/favicon.ico", 200 | "apps/tuskdesk-admin/src/assets" 201 | ] 202 | } 203 | }, 204 | "lint": { 205 | "builder": "@angular-devkit/build-angular:tslint", 206 | "options": { 207 | "tsConfig": [ 208 | "apps/tuskdesk-admin/tsconfig.app.json", 209 | "apps/tuskdesk-admin/tsconfig.spec.json" 210 | ], 211 | "exclude": [ 212 | "**/node_modules/**" 213 | ] 214 | } 215 | } 216 | } 217 | }, 218 | "tuskdesk-admin-e2e": { 219 | "root": "apps/tuskdesk-admin-e2e/", 220 | "projectType": "application", 221 | "architect": { 222 | "e2e": { 223 | "builder": "@angular-devkit/build-angular:protractor", 224 | "options": { 225 | "protractorConfig": "apps/tuskdesk-admin-e2e/protractor.conf.js", 226 | "devServerTarget": "tuskdesk-admin:serve" 227 | }, 228 | "configurations": { 229 | "production": { 230 | "devServerTarget": "tuskdesk-admin:serve:production" 231 | } 232 | } 233 | }, 234 | "lint": { 235 | "builder": "@angular-devkit/build-angular:tslint", 236 | "options": { 237 | "tsConfig": "apps/tuskdesk-admin-e2e/tsconfig.e2e.json", 238 | "exclude": [ 239 | "**/node_modules/**" 240 | ] 241 | } 242 | } 243 | } 244 | }, 245 | "ui-shell": { 246 | "root": "libs/ui-shell", 247 | "sourceRoot": "libs/ui-shell/src", 248 | "projectType": "library", 249 | "prefix": "myorg", 250 | "architect": { 251 | "test": { 252 | "builder": "@angular-devkit/build-angular:karma", 253 | "options": { 254 | "main": "libs/ui-shell/src/test.ts", 255 | "tsConfig": "libs/ui-shell/tsconfig.spec.json", 256 | "karmaConfig": "libs/ui-shell/karma.conf.js" 257 | } 258 | }, 259 | "lint": { 260 | "builder": "@angular-devkit/build-angular:tslint", 261 | "options": { 262 | "tsConfig": [ 263 | "libs/ui-shell/tsconfig.lib.json", 264 | "libs/ui-shell/tsconfig.spec.json" 265 | ], 266 | "exclude": [ 267 | "**/node_modules/**" 268 | ] 269 | } 270 | } 271 | } 272 | }, 273 | "api": { 274 | "root": "apps/api", 275 | "sourceRoot": "apps/api/src", 276 | "projectType": "application", 277 | "prefix": "api", 278 | "schematics": {}, 279 | "architect": { 280 | "build": { 281 | "builder": "@nrwl/builders:node-build", 282 | "options": { 283 | "outputPath": "dist/apps/api", 284 | "main": "apps/api/src/main.ts", 285 | "tsConfig": "apps/api/tsconfig.app.json" 286 | }, 287 | "configurations": { 288 | "production": { 289 | "optimization": true, 290 | "extractLicenses": true, 291 | "fileReplacements": [ 292 | { 293 | "replace": "apps/api/src/environments/environment.ts", 294 | "with": "apps/api/src/environments/environment.prod.ts" 295 | } 296 | ] 297 | } 298 | } 299 | }, 300 | "serve": { 301 | "builder": "@nrwl/builders:node-execute", 302 | "options": { 303 | "buildTarget": "api:build" 304 | } 305 | }, 306 | "lint": { 307 | "builder": "@angular-devkit/build-angular:tslint", 308 | "options": { 309 | "tsConfig": [ 310 | "apps/api/tsconfig.app.json", 311 | "apps/api/tsconfig.spec.json" 312 | ], 313 | "exclude": [ 314 | "**/node_modules/**" 315 | ] 316 | } 317 | }, 318 | "test": { 319 | "builder": "@nrwl/builders:jest", 320 | "options": { 321 | "jestConfig": "apps/api/jest.config.js", 322 | "tsConfig": "apps/api/tsconfig.spec.json" 323 | } 324 | } 325 | } 326 | }, 327 | "data": { 328 | "root": "libs/data", 329 | "sourceRoot": "libs/data/src", 330 | "projectType": "library", 331 | "prefix": "myorg", 332 | "architect": { 333 | "test": { 334 | "builder": "@angular-devkit/build-angular:karma", 335 | "options": { 336 | "main": "libs/data/src/test.ts", 337 | "tsConfig": "libs/data/tsconfig.spec.json", 338 | "karmaConfig": "libs/data/karma.conf.js" 339 | } 340 | }, 341 | "lint": { 342 | "builder": "@angular-devkit/build-angular:tslint", 343 | "options": { 344 | "tsConfig": [ 345 | "libs/data/tsconfig.lib.json", 346 | "libs/data/tsconfig.spec.json" 347 | ], 348 | "exclude": [ 349 | "**/node_modules/**" 350 | ] 351 | } 352 | } 353 | } 354 | } 355 | }, 356 | "cli": { 357 | "warnings": { 358 | "typescriptMismatch": false, 359 | "versionMismatch": false 360 | }, 361 | "defaultCollection": "@nrwl/schematics" 362 | }, 363 | "defaultProject": "tuskdesk" 364 | } 365 | -------------------------------------------------------------------------------- /apps/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /apps/api/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'api', 3 | preset: '../../jest.config.js', 4 | coverageDirectory: '../../coverage/apps/api' 5 | }; 6 | -------------------------------------------------------------------------------- /apps/api/src/app/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/example-nx-fullstack/e0f72317cccaa0baede884db3a08bd9b38a9837e/apps/api/src/app/.gitkeep -------------------------------------------------------------------------------- /apps/api/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/example-nx-fullstack/e0f72317cccaa0baede884db3a08bd9b38a9837e/apps/api/src/assets/.gitkeep -------------------------------------------------------------------------------- /apps/api/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /apps/api/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | -------------------------------------------------------------------------------- /apps/api/src/main.ts: -------------------------------------------------------------------------------- 1 | import * as express from 'express'; 2 | import {Ticket} from "@myorg/data"; 3 | 4 | const app = express(); 5 | 6 | const tickets: Ticket[] = [ 7 | { 8 | id: 1, 9 | title: 'Login page is broken' 10 | }, 11 | { 12 | id: 2, 13 | title: 'Everything is broken!!!' 14 | } 15 | ]; 16 | 17 | app.get('/api/tickets', (req, res) => { 18 | res.send(JSON.stringify(tickets)); 19 | }); 20 | 21 | const port = 3333; 22 | app.listen(port, (err) => { 23 | if (err) { 24 | console.error(err); 25 | } 26 | console.log(`Listening at http://localhost:${port}`); 27 | }); 28 | -------------------------------------------------------------------------------- /apps/api/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc/apps/api", 5 | "types": [] 6 | }, 7 | "exclude": ["**/*.spec.ts"], 8 | "include": ["**/*.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /apps/api/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc/apps/api", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | 9 | "include": ["**/*.spec.ts", "**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /apps/api/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": {} 4 | } 5 | -------------------------------------------------------------------------------- /apps/tuskdesk-admin-e2e/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 | './src/**/*.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: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /apps/tuskdesk-admin-e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-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 tuskdesk-admin!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /apps/tuskdesk-admin-e2e/src/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('myorg-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /apps/tuskdesk-admin-e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc/apps/tuskdesk-admin-e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /apps/tuskdesk-admin/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /apps/tuskdesk-admin/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 | const { join } = require('path'); 5 | const getBaseKarmaConfig = require('../../karma.conf'); 6 | 7 | module.exports = function(config) { 8 | const baseConfig = getBaseKarmaConfig(); 9 | config.set({ 10 | ...baseConfig, 11 | coverageIstanbulReporter: { 12 | ...baseConfig.coverageIstanbulReporter, 13 | dir: join(__dirname, '../../coverage/apps/tuskdesk-admin') 14 | } 15 | }); 16 | }; 17 | -------------------------------------------------------------------------------- /apps/tuskdesk-admin/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/example-nx-fullstack/e0f72317cccaa0baede884db3a08bd9b38a9837e/apps/tuskdesk-admin/src/app/app.component.css -------------------------------------------------------------------------------- /apps/tuskdesk-admin/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /apps/tuskdesk-admin/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | import {UiShellModule} from "@myorg/ui-shell"; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(async(() => { 7 | TestBed.configureTestingModule({ 8 | declarations: [AppComponent], 9 | imports: [UiShellModule] 10 | }).compileComponents(); 11 | })); 12 | 13 | it('should create the app', () => { 14 | const fixture = TestBed.createComponent(AppComponent); 15 | const app = fixture.debugElement.componentInstance; 16 | expect(app).toBeTruthy(); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /apps/tuskdesk-admin/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'myorg-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'tuskdesk-admin'; 10 | } 11 | -------------------------------------------------------------------------------- /apps/tuskdesk-admin/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppComponent } from './app.component'; 5 | import { NxModule } from '@nrwl/nx'; 6 | import { UiShellModule } from '@myorg/ui-shell'; 7 | 8 | @NgModule({ 9 | declarations: [AppComponent], 10 | imports: [BrowserModule, NxModule.forRoot(), UiShellModule], 11 | providers: [], 12 | bootstrap: [AppComponent] 13 | }) 14 | export class AppModule {} 15 | -------------------------------------------------------------------------------- /apps/tuskdesk-admin/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/example-nx-fullstack/e0f72317cccaa0baede884db3a08bd9b38a9837e/apps/tuskdesk-admin/src/assets/.gitkeep -------------------------------------------------------------------------------- /apps/tuskdesk-admin/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /apps/tuskdesk-admin/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /apps/tuskdesk-admin/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/example-nx-fullstack/e0f72317cccaa0baede884db3a08bd9b38a9837e/apps/tuskdesk-admin/src/favicon.ico -------------------------------------------------------------------------------- /apps/tuskdesk-admin/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | TuskdeskAdmin 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /apps/tuskdesk-admin/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() 12 | .bootstrapModule(AppModule) 13 | .catch(err => console.error(err)); 14 | -------------------------------------------------------------------------------- /apps/tuskdesk-admin/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 | /** Evergreen browsers require these. **/ 44 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. 45 | import 'core-js/es7/reflect'; 46 | 47 | /** 48 | * Web Animations `@angular/platform-browser/animations` 49 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 50 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 51 | **/ 52 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 53 | 54 | /** 55 | * By default, zone.js will patch all possible macroTask and DomEvents 56 | * user can disable parts of macroTask/DomEvents patch by setting following flags 57 | */ 58 | 59 | // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 60 | // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 61 | // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 62 | 63 | /* 64 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 65 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 66 | */ 67 | // (window as any).__Zone_enable_cross_context_check = true; 68 | 69 | /*************************************************************************************************** 70 | * Zone JS is required by default for Angular itself. 71 | */ 72 | import 'zone.js/dist/zone'; // Included with Angular CLI. 73 | 74 | /*************************************************************************************************** 75 | * APPLICATION IMPORTS 76 | */ 77 | -------------------------------------------------------------------------------- /apps/tuskdesk-admin/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /apps/tuskdesk-admin/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/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /apps/tuskdesk-admin/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc/apps/tuskdesk-admin", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ], 11 | "include": [ 12 | "**/*.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /apps/tuskdesk-admin/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc/apps/tuskdesk-admin", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /apps/tuskdesk-admin/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "myorg", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "myorg", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /apps/tuskdesk-e2e/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 | './src/**/*.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: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /apps/tuskdesk-e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-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 tuskdesk!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /apps/tuskdesk-e2e/src/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('myorg-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /apps/tuskdesk-e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc/apps/tuskdesk-e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /apps/tuskdesk/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /apps/tuskdesk/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 | const { join } = require('path'); 5 | const getBaseKarmaConfig = require('../../karma.conf'); 6 | 7 | module.exports = function(config) { 8 | const baseConfig = getBaseKarmaConfig(); 9 | config.set({ 10 | ...baseConfig, 11 | coverageIstanbulReporter: { 12 | ...baseConfig.coverageIstanbulReporter, 13 | dir: join(__dirname, '../../coverage/apps/tuskdesk') 14 | } 15 | }); 16 | }; 17 | -------------------------------------------------------------------------------- /apps/tuskdesk/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/example-nx-fullstack/e0f72317cccaa0baede884db3a08bd9b38a9837e/apps/tuskdesk/src/app/app.component.css -------------------------------------------------------------------------------- /apps/tuskdesk/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | -------------------------------------------------------------------------------- /apps/tuskdesk/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | import {UiShellModule} from "@myorg/ui-shell"; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(async(() => { 7 | TestBed.configureTestingModule({ 8 | declarations: [AppComponent], 9 | imports: [UiShellModule] 10 | }).compileComponents(); 11 | })); 12 | }); 13 | -------------------------------------------------------------------------------- /apps/tuskdesk/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import {HttpClient} from "@angular/common/http"; 3 | import {Ticket} from "@myorg/data"; 4 | 5 | @Component({ 6 | selector: 'myorg-root', 7 | templateUrl: './app.component.html', 8 | styleUrls: ['./app.component.css'] 9 | }) 10 | export class AppComponent { 11 | tickets = this.http.get('/api/tickets'); 12 | 13 | constructor(private http: HttpClient) { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /apps/tuskdesk/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppComponent } from './app.component'; 5 | import { NxModule } from '@nrwl/nx'; 6 | import { UiShellModule } from '@myorg/ui-shell'; 7 | import { HttpClientModule } from '@angular/common/http'; 8 | 9 | @NgModule({ 10 | declarations: [AppComponent], 11 | imports: [BrowserModule, NxModule.forRoot(), UiShellModule, HttpClientModule], 12 | providers: [], 13 | bootstrap: [AppComponent] 14 | }) 15 | export class AppModule {} 16 | -------------------------------------------------------------------------------- /apps/tuskdesk/src/app/shell.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'myorg-shell', 5 | template: ` 6 |

Tuskdesk app!

7 |
8 |
Learn more about Tuskdesk
9 |
Learn more about MyOrg
10 | Copyright stuff is in here as well. 11 |
12 | `, 13 | styles: [] 14 | }) 15 | export class ShellComponent {} 16 | -------------------------------------------------------------------------------- /apps/tuskdesk/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/example-nx-fullstack/e0f72317cccaa0baede884db3a08bd9b38a9837e/apps/tuskdesk/src/assets/.gitkeep -------------------------------------------------------------------------------- /apps/tuskdesk/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /apps/tuskdesk/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /apps/tuskdesk/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/example-nx-fullstack/e0f72317cccaa0baede884db3a08bd9b38a9837e/apps/tuskdesk/src/favicon.ico -------------------------------------------------------------------------------- /apps/tuskdesk/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Tuskdesk 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /apps/tuskdesk/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() 12 | .bootstrapModule(AppModule) 13 | .catch(err => console.error(err)); 14 | -------------------------------------------------------------------------------- /apps/tuskdesk/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 | /** Evergreen browsers require these. **/ 44 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. 45 | import 'core-js/es7/reflect'; 46 | 47 | /** 48 | * Web Animations `@angular/platform-browser/animations` 49 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 50 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 51 | **/ 52 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 53 | 54 | /** 55 | * By default, zone.js will patch all possible macroTask and DomEvents 56 | * user can disable parts of macroTask/DomEvents patch by setting following flags 57 | */ 58 | 59 | // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 60 | // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 61 | // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 62 | 63 | /* 64 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 65 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 66 | */ 67 | // (window as any).__Zone_enable_cross_context_check = true; 68 | 69 | /*************************************************************************************************** 70 | * Zone JS is required by default for Angular itself. 71 | */ 72 | import 'zone.js/dist/zone'; // Included with Angular CLI. 73 | 74 | /*************************************************************************************************** 75 | * APPLICATION IMPORTS 76 | */ 77 | -------------------------------------------------------------------------------- /apps/tuskdesk/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /apps/tuskdesk/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/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /apps/tuskdesk/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc/apps/tuskdesk", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ], 11 | "include": [ 12 | "**/*.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /apps/tuskdesk/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc/apps/tuskdesk", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /apps/tuskdesk/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "myorg", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "myorg", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'], 3 | transform: { 4 | '^.+\\.(ts|js|html)$': 'jest-preset-angular/preprocessor.js' 5 | }, 6 | resolver: '@nrwl/builders/plugins/jest/resolver', 7 | moduleFileExtensions: ['ts', 'js', 'html'], 8 | collectCoverage: true, 9 | coverageReporters: ['html'] 10 | }; 11 | -------------------------------------------------------------------------------- /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 | const { join } = require('path'); 5 | const { constants } = require('karma'); 6 | 7 | module.exports = () => { 8 | return { 9 | basePath: '', 10 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 11 | plugins: [ 12 | require('karma-jasmine'), 13 | require('karma-chrome-launcher'), 14 | require('karma-jasmine-html-reporter'), 15 | require('karma-coverage-istanbul-reporter'), 16 | require('@angular-devkit/build-angular/plugins/karma') 17 | ], 18 | client: { 19 | clearContext: false // leave Jasmine Spec Runner output visible in browser 20 | }, 21 | coverageIstanbulReporter: { 22 | dir: join(__dirname, '../../coverage'), 23 | reports: ['html', 'lcovonly'], 24 | fixWebpackSourcePaths: true 25 | }, 26 | reporters: ['progress', 'kjhtml'], 27 | port: 9876, 28 | colors: true, 29 | logLevel: constants.LOG_INFO, 30 | autoWatch: false, 31 | browsers: ['Chrome'], 32 | singleRun: true 33 | }; 34 | }; 35 | -------------------------------------------------------------------------------- /libs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/example-nx-fullstack/e0f72317cccaa0baede884db3a08bd9b38a9837e/libs/.gitkeep -------------------------------------------------------------------------------- /libs/data/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 | const { join } = require('path'); 5 | const getBaseKarmaConfig = require('../../karma.conf'); 6 | 7 | module.exports = function(config) { 8 | const baseConfig = getBaseKarmaConfig(); 9 | config.set({ 10 | ...baseConfig, 11 | coverageIstanbulReporter: { 12 | ...baseConfig.coverageIstanbulReporter, 13 | dir: join(__dirname, '../../coverage/libs/data') 14 | } 15 | }); 16 | }; 17 | -------------------------------------------------------------------------------- /libs/data/src/index.ts: -------------------------------------------------------------------------------- 1 | export interface Ticket { 2 | id: number; 3 | title: string; 4 | } 5 | -------------------------------------------------------------------------------- /libs/data/src/lib/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/example-nx-fullstack/e0f72317cccaa0baede884db3a08bd9b38a9837e/libs/data/src/lib/.gitkeep -------------------------------------------------------------------------------- /libs/data/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'core-js/es7/reflect'; 4 | import 'zone.js/dist/zone'; 5 | import 'zone.js/dist/zone-testing'; 6 | import { getTestBed } from '@angular/core/testing'; 7 | import { 8 | BrowserDynamicTestingModule, 9 | platformBrowserDynamicTesting 10 | } from '@angular/platform-browser-dynamic/testing'; 11 | 12 | declare const require: any; 13 | 14 | // First, initialize the Angular testing environment. 15 | getTestBed().initTestEnvironment( 16 | BrowserDynamicTestingModule, 17 | platformBrowserDynamicTesting() 18 | ); 19 | // Then we find all the tests. 20 | const context = require.context('./', true, /\.spec\.ts$/); 21 | // And load the modules. 22 | context.keys().map(context); 23 | -------------------------------------------------------------------------------- /libs/data/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc/libs/data", 5 | "target": "es2015", 6 | "module": "es2015", 7 | "moduleResolution": "node", 8 | "declaration": true, 9 | "sourceMap": true, 10 | "inlineSources": true, 11 | "emitDecoratorMetadata": true, 12 | "experimentalDecorators": true, 13 | "importHelpers": true, 14 | "types": [], 15 | "lib": [ 16 | "dom", 17 | "es2015" 18 | ] 19 | }, 20 | "angularCompilerOptions": { 21 | "annotateForClosureCompiler": true, 22 | "skipTemplateCodegen": true, 23 | "strictMetadataEmit": true, 24 | "fullTemplateTypeCheck": true, 25 | "strictInjectionParameters": true, 26 | "enableResourceInlining": true 27 | }, 28 | "exclude": [ 29 | "src/test.ts", 30 | "**/*.spec.ts" 31 | ] 32 | } 33 | -------------------------------------------------------------------------------- /libs/data/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc/libs/data", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts" 12 | ], 13 | "include": [ 14 | "**/*.spec.ts", 15 | "**/*.d.ts" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /libs/data/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "myorg", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "myorg", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /libs/ui-shell/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 | const { join } = require('path'); 5 | const getBaseKarmaConfig = require('../../karma.conf'); 6 | 7 | module.exports = function(config) { 8 | const baseConfig = getBaseKarmaConfig(); 9 | config.set({ 10 | ...baseConfig, 11 | coverageIstanbulReporter: { 12 | ...baseConfig.coverageIstanbulReporter, 13 | dir: join(__dirname, '../../coverage/libs/ui-shell') 14 | } 15 | }); 16 | }; 17 | -------------------------------------------------------------------------------- /libs/ui-shell/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/ui-shell.module'; 2 | -------------------------------------------------------------------------------- /libs/ui-shell/src/lib/shell.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'myorg-shell', 5 | template: ` 6 |

{{ title }}

7 |
8 |
Learn more about Tuskdesk
9 |
Learn more about MyOrg
10 | Copyright stuff is in here as well. 11 |
12 | `, 13 | styles: [] 14 | }) 15 | export class ShellComponent { 16 | @Input() title: string; 17 | } 18 | -------------------------------------------------------------------------------- /libs/ui-shell/src/lib/ui-shell.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, TestBed } from '@angular/core/testing'; 2 | import { UiShellModule } from './ui-shell.module'; 3 | 4 | describe('UiShellModule', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({ 7 | imports: [UiShellModule] 8 | }).compileComponents(); 9 | })); 10 | 11 | it('should create', () => { 12 | expect(UiShellModule).toBeDefined(); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /libs/ui-shell/src/lib/ui-shell.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import {ShellComponent} from "./shell.component"; 4 | 5 | @NgModule({ 6 | imports: [CommonModule], 7 | declarations: [ShellComponent], 8 | exports: [ShellComponent] 9 | }) 10 | export class UiShellModule {} 11 | -------------------------------------------------------------------------------- /libs/ui-shell/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'core-js/es7/reflect'; 4 | import 'zone.js/dist/zone'; 5 | import 'zone.js/dist/zone-testing'; 6 | import { getTestBed } from '@angular/core/testing'; 7 | import { 8 | BrowserDynamicTestingModule, 9 | platformBrowserDynamicTesting 10 | } from '@angular/platform-browser-dynamic/testing'; 11 | 12 | declare const require: any; 13 | 14 | // First, initialize the Angular testing environment. 15 | getTestBed().initTestEnvironment( 16 | BrowserDynamicTestingModule, 17 | platformBrowserDynamicTesting() 18 | ); 19 | // Then we find all the tests. 20 | const context = require.context('./', true, /\.spec\.ts$/); 21 | // And load the modules. 22 | context.keys().map(context); 23 | -------------------------------------------------------------------------------- /libs/ui-shell/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc/libs/ui-shell", 5 | "target": "es2015", 6 | "module": "es2015", 7 | "moduleResolution": "node", 8 | "declaration": true, 9 | "sourceMap": true, 10 | "inlineSources": true, 11 | "emitDecoratorMetadata": true, 12 | "experimentalDecorators": true, 13 | "importHelpers": true, 14 | "types": [], 15 | "lib": [ 16 | "dom", 17 | "es2015" 18 | ] 19 | }, 20 | "angularCompilerOptions": { 21 | "annotateForClosureCompiler": true, 22 | "skipTemplateCodegen": true, 23 | "strictMetadataEmit": true, 24 | "fullTemplateTypeCheck": true, 25 | "strictInjectionParameters": true, 26 | "enableResourceInlining": true 27 | }, 28 | "exclude": [ 29 | "src/test.ts", 30 | "**/*.spec.ts" 31 | ] 32 | } 33 | -------------------------------------------------------------------------------- /libs/ui-shell/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc/libs/ui-shell", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts" 12 | ], 13 | "include": [ 14 | "**/*.spec.ts", 15 | "**/*.d.ts" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /libs/ui-shell/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "myorg", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "myorg", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /nx.json: -------------------------------------------------------------------------------- 1 | { 2 | "npmScope": "myorg", 3 | "implicitDependencies": { 4 | "angular.json": "*", 5 | "package.json": "*", 6 | "tsconfig.json": "*", 7 | "tslint.json": "*", 8 | "nx.json": "*" 9 | }, 10 | "projects": { 11 | "tuskdesk": { 12 | "tags": [] 13 | }, 14 | "tuskdesk-e2e": { 15 | "tags": [] 16 | }, 17 | "tuskdesk-admin": { 18 | "tags": [] 19 | }, 20 | "tuskdesk-admin-e2e": { 21 | "tags": [] 22 | }, 23 | "ui-shell": { 24 | "tags": [] 25 | }, 26 | "api": { 27 | "tags": [] 28 | }, 29 | "data": { 30 | "tags": [] 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "myorg", 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": "./node_modules/.bin/nx lint && ng lint", 11 | "e2e": "ng e2e", 12 | "affected:apps": "./node_modules/.bin/nx affected:apps", 13 | "affected:libs": "./node_modules/.bin/nx affected:libs", 14 | "affected:build": "./node_modules/.bin/nx affected:build", 15 | "affected:e2e": "./node_modules/.bin/nx affected:e2e", 16 | "affected:test": "./node_modules/.bin/nx affected:test", 17 | "affected:lint": "./node_modules/.bin/nx affected:lint", 18 | "affected:dep-graph": "./node_modules/.bin/nx affected:dep-graph", 19 | "format": "./node_modules/.bin/nx format:write", 20 | "format:write": "./node_modules/.bin/nx format:write", 21 | "format:check": "./node_modules/.bin/nx format:check", 22 | "update": "ng update @nrwl/schematics", 23 | "update:check": "ng update", 24 | "workspace-schematic": "./node_modules/.bin/nx workspace-schematic", 25 | "dep-graph": "./node_modules/.bin/nx dep-graph", 26 | "help": "./node_modules/.bin/nx help" 27 | }, 28 | "private": true, 29 | "dependencies": { 30 | "@angular/animations": "^6.1.0", 31 | "@angular/common": "^6.1.0", 32 | "@angular/compiler": "^6.1.0", 33 | "@angular/core": "^6.1.0", 34 | "@angular/forms": "^6.1.0", 35 | "@angular/platform-browser": "^6.1.0", 36 | "@angular/platform-browser-dynamic": "^6.1.0", 37 | "@angular/router": "^6.1.0", 38 | "core-js": "^2.5.4", 39 | "rxjs": "^6.0.0", 40 | "zone.js": "^0.8.26", 41 | "@nrwl/nx": "6.4.0", 42 | "@ngrx/effects": "6.1.0", 43 | "@ngrx/router-store": "6.1.0", 44 | "@ngrx/store": "6.1.0", 45 | "express": "4.16.3" 46 | }, 47 | "devDependencies": { 48 | "@angular/cli": "6.2.4", 49 | "@angular/compiler-cli": "^6.1.0", 50 | "@angular/language-service": "^6.1.0", 51 | "@angular-devkit/build-angular": "~0.8.0", 52 | "@ngrx/store-devtools": "6.1.0", 53 | "ngrx-store-freeze": "0.2.4", 54 | "@nrwl/schematics": "6.4.0", 55 | "jasmine-marbles": "0.3.1", 56 | "@types/jasmine": "~2.8.6", 57 | "@types/jasminewd2": "~2.0.3", 58 | "@types/node": "~8.9.4", 59 | "codelyzer": "~4.2.1", 60 | "jasmine-core": "~2.99.1", 61 | "jasmine-spec-reporter": "~4.2.1", 62 | "karma": "~3.0.0", 63 | "karma-chrome-launcher": "~2.2.0", 64 | "karma-coverage-istanbul-reporter": "~2.0.1", 65 | "karma-jasmine": "~1.1.0", 66 | "karma-jasmine-html-reporter": "^0.2.2", 67 | "protractor": "~5.4.0", 68 | "ts-node": "~7.0.0", 69 | "tslint": "~5.11.0", 70 | "typescript": "~2.9.2", 71 | "prettier": "1.13.7", 72 | "@nrwl/builders": "6.4.0", 73 | "jest": "^23.0.0", 74 | "@types/jest": "^23.0.0", 75 | "jest-preset-angular": "6.0.1", 76 | "@types/express": "4.16.0" 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api": { 3 | "target": "http://localhost:3333", 4 | "secure": false 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /tools/schematics/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/example-nx-fullstack/e0f72317cccaa0baede884db3a08bd9b38a9837e/tools/schematics/.gitkeep -------------------------------------------------------------------------------- /tools/tsconfig.tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../dist/out-tsc/tools", 5 | "rootDir": ".", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | }, 13 | "include": [ 14 | "**/*.ts" 15 | ] 16 | } -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "sourceMap": true, 5 | "declaration": false, 6 | "moduleResolution": "node", 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "target": "es5", 10 | "typeRoots": [ 11 | "node_modules/@types" 12 | ], 13 | "lib": [ 14 | "es2017", 15 | "dom" 16 | ], 17 | "baseUrl": ".", 18 | "paths": { 19 | "@myorg/ui-shell": [ 20 | "libs/ui-shell/src/index.ts" 21 | ], 22 | "@myorg/data": [ 23 | "libs/data/src/index.ts" 24 | ] 25 | } 26 | }, 27 | "exclude": [ 28 | "node_modules", 29 | "tmp" 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer", 4 | "node_modules/@nrwl/schematics/src/tslint" 5 | ], 6 | "rules": { 7 | "arrow-return-shorthand": true, 8 | "callable-types": true, 9 | "class-name": true, 10 | "deprecation": { 11 | "severity": "warn" 12 | }, 13 | "forin": true, 14 | "import-blacklist": [ 15 | true, 16 | "rxjs/Rx" 17 | ], 18 | "interface-over-type-literal": true, 19 | "member-access": false, 20 | "member-ordering": [ 21 | true, 22 | { 23 | "order": [ 24 | "static-field", 25 | "instance-field", 26 | "static-method", 27 | "instance-method" 28 | ] 29 | } 30 | ], 31 | "no-arg": true, 32 | "no-bitwise": true, 33 | "no-console": [ 34 | true, 35 | "debug", 36 | "info", 37 | "time", 38 | "timeEnd", 39 | "trace" 40 | ], 41 | "no-construct": true, 42 | "no-debugger": true, 43 | "no-duplicate-super": true, 44 | "no-empty": false, 45 | "no-empty-interface": true, 46 | "no-eval": true, 47 | "no-inferrable-types": [ 48 | true, 49 | "ignore-params" 50 | ], 51 | "no-misused-new": true, 52 | "no-non-null-assertion": true, 53 | "no-shadowed-variable": true, 54 | "no-string-literal": false, 55 | "no-string-throw": true, 56 | "no-switch-case-fall-through": true, 57 | "no-unnecessary-initializer": true, 58 | "no-unused-expression": true, 59 | "no-use-before-declare": true, 60 | "no-var-keyword": true, 61 | "object-literal-sort-keys": false, 62 | "prefer-const": true, 63 | "radix": true, 64 | "triple-equals": [ 65 | true, 66 | "allow-null-check" 67 | ], 68 | "unified-signatures": true, 69 | "variable-name": false, 70 | "directive-selector": [ 71 | true, 72 | "attribute", 73 | "app", 74 | "camelCase" 75 | ], 76 | "component-selector": [ 77 | true, 78 | "element", 79 | "app", 80 | "kebab-case" 81 | ], 82 | "no-output-on-prefix": true, 83 | "use-input-property-decorator": true, 84 | "use-output-property-decorator": true, 85 | "use-host-property-decorator": true, 86 | "no-input-rename": true, 87 | "no-output-rename": true, 88 | "use-life-cycle-interface": true, 89 | "use-pipe-transform-interface": true, 90 | "component-class-suffix": true, 91 | "directive-class-suffix": true, 92 | 93 | "nx-enforce-module-boundaries": [ 94 | true, 95 | { 96 | "allow": [], 97 | "depConstraints": [ 98 | { "sourceTag": "*", "onlyDependOnLibsWithTags": ["*"] } 99 | ] 100 | } 101 | ] 102 | } 103 | } 104 | --------------------------------------------------------------------------------