| @@ -1,6 +1,6 @@ | |||||
| # MatsenTool | # MatsenTool | ||||
| This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.0.6. | |||||
| This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.0.7. | |||||
| ## Development server | ## Development server | ||||
| @@ -37,15 +37,10 @@ | |||||
| "src/assets" | "src/assets" | ||||
| ], | ], | ||||
| "styles": [ | "styles": [ | ||||
| "@angular/material/prebuilt-themes/pink-bluegrey.css", | |||||
| "@angular/material/prebuilt-themes/indigo-pink.css", | |||||
| "src/styles.scss" | "src/styles.scss" | ||||
| ], | ], | ||||
| "scripts": [], | |||||
| "server": "src/main.server.ts", | |||||
| "prerender": true, | |||||
| "ssr": { | |||||
| "entry": "server.ts" | |||||
| } | |||||
| "scripts": [] | |||||
| }, | }, | ||||
| "configurations": { | "configurations": { | ||||
| "production": { | "production": { | ||||
| @@ -103,7 +98,7 @@ | |||||
| "src/assets" | "src/assets" | ||||
| ], | ], | ||||
| "styles": [ | "styles": [ | ||||
| "@angular/material/prebuilt-themes/pink-bluegrey.css", | |||||
| "@angular/material/prebuilt-themes/indigo-pink.css", | |||||
| "src/styles.scss" | "src/styles.scss" | ||||
| ], | ], | ||||
| "scripts": [] | "scripts": [] | ||||
| @@ -1,49 +0,0 @@ | |||||
| openapi: 3.0.0 | |||||
| info: | |||||
| title: JSON Placeholder OpenAPI | |||||
| description: Example spec of the well known JSON Placeholder website | |||||
| version: 0.1.9 | |||||
| servers: | |||||
| - url: https://jsonplaceholder.typicode.com | |||||
| paths: | |||||
| /posts: | |||||
| get: | |||||
| tags: ['posts'] | |||||
| summary: Returns a list of Posts. | |||||
| description: Optional extended description in CommonMark or HTML. | |||||
| operationId: GetPosts | |||||
| responses: | |||||
| '200': | |||||
| description: A JSON array of Posts | |||||
| content: | |||||
| application/json: | |||||
| schema: | |||||
| type: array | |||||
| items: | |||||
| $ref: '#/components/schemas/Post' | |||||
| components: | |||||
| schemas: | |||||
| Post: | |||||
| required: | |||||
| - id | |||||
| - userId | |||||
| - title | |||||
| - body | |||||
| type: object | |||||
| properties: | |||||
| id: | |||||
| type: number | |||||
| description: record id | |||||
| example: 1 | |||||
| userId: | |||||
| type: string | |||||
| description: unique user identifier | |||||
| example: 2 | |||||
| title: | |||||
| type: string | |||||
| description: title of this Post | |||||
| example: sunt aut facere repellat provident occaecati excepturi optio reprehenderit | |||||
| body: | |||||
| type: string | |||||
| description: description of this post | |||||
| example: quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto | |||||
| @@ -7,45 +7,38 @@ | |||||
| "build": "ng build", | "build": "ng build", | ||||
| "watch": "ng build --watch --configuration development", | "watch": "ng build --watch --configuration development", | ||||
| "test": "ng test", | "test": "ng test", | ||||
| "serve:ssr:matsen-tool": "node dist/matsen-tool/server/server.mjs", | |||||
| "generate:api": "openapi-generator-cli generate -i ./openapi.yaml -g typescript-angular -o src/app/core/api/v1 -p=removeOperationIdPrefix=true --additional-properties=supportsES6=true,typescriptThreePlus=true" | |||||
| "generate:api": "openapi-generator-cli generate -i ./openapi.yaml -g typescript-angular -o src/app/core/api/v1 -p=removeOperationIdPrefix=true" | |||||
| }, | }, | ||||
| "private": true, | "private": true, | ||||
| "dependencies": { | "dependencies": { | ||||
| "@angular/animations": "^17.0.0", | "@angular/animations": "^17.0.0", | ||||
| "@angular/cdk": "^17.0.3", | |||||
| "@angular/cdk": "^17.0.4", | |||||
| "@angular/common": "^17.0.0", | "@angular/common": "^17.0.0", | ||||
| "@angular/compiler": "^17.0.0", | "@angular/compiler": "^17.0.0", | ||||
| "@angular/core": "^17.0.0", | "@angular/core": "^17.0.0", | ||||
| "@angular/forms": "^17.0.0", | "@angular/forms": "^17.0.0", | ||||
| "@angular/material": "^17.0.3", | |||||
| "@angular/material": "^17.0.4", | |||||
| "@angular/platform-browser": "^17.0.0", | "@angular/platform-browser": "^17.0.0", | ||||
| "@angular/platform-browser-dynamic": "^17.0.0", | "@angular/platform-browser-dynamic": "^17.0.0", | ||||
| "@angular/platform-server": "^17.0.0", | |||||
| "@angular/router": "^17.0.0", | "@angular/router": "^17.0.0", | ||||
| "@angular/ssr": "^17.0.6", | |||||
| "@popperjs/core": "^2.11.8", | "@popperjs/core": "^2.11.8", | ||||
| "bootstrap": "^5.3.2", | "bootstrap": "^5.3.2", | ||||
| "express": "^4.18.2", | |||||
| "rxjs": "~7.8.0", | "rxjs": "~7.8.0", | ||||
| "tslib": "^2.3.0", | "tslib": "^2.3.0", | ||||
| "zone.js": "~0.14.2" | "zone.js": "~0.14.2" | ||||
| }, | }, | ||||
| "devDependencies": { | "devDependencies": { | ||||
| "@angular-devkit/build-angular": "^17.0.6", | |||||
| "@angular/cli": "^17.0.6", | |||||
| "@angular-devkit/build-angular": "^17.0.7", | |||||
| "@angular/cli": "^17.0.7", | |||||
| "@angular/compiler-cli": "^17.0.0", | "@angular/compiler-cli": "^17.0.0", | ||||
| "@openapitools/openapi-generator-cli": "^2.7.0", | "@openapitools/openapi-generator-cli": "^2.7.0", | ||||
| "@types/express": "^4.17.17", | |||||
| "@types/jasmine": "~5.1.0", | "@types/jasmine": "~5.1.0", | ||||
| "@types/node": "^18.18.0", | |||||
| "jasmine-core": "~5.1.0", | "jasmine-core": "~5.1.0", | ||||
| "karma": "~6.4.0", | "karma": "~6.4.0", | ||||
| "karma-chrome-launcher": "~3.2.0", | "karma-chrome-launcher": "~3.2.0", | ||||
| "karma-coverage": "~2.2.0", | "karma-coverage": "~2.2.0", | ||||
| "karma-jasmine": "~5.1.0", | "karma-jasmine": "~5.1.0", | ||||
| "karma-jasmine-html-reporter": "~2.1.0", | "karma-jasmine-html-reporter": "~2.1.0", | ||||
| "openapi-typescript": "^7.0.0-next.5", | |||||
| "typescript": "~5.2.2" | "typescript": "~5.2.2" | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,56 +0,0 @@ | |||||
| import { APP_BASE_HREF } from '@angular/common'; | |||||
| import { CommonEngine } from '@angular/ssr'; | |||||
| import express from 'express'; | |||||
| import { fileURLToPath } from 'node:url'; | |||||
| import { dirname, join, resolve } from 'node:path'; | |||||
| import AppServerModule from './src/main.server'; | |||||
| // The Express app is exported so that it can be used by serverless Functions. | |||||
| export function app(): express.Express { | |||||
| const server = express(); | |||||
| const serverDistFolder = dirname(fileURLToPath(import.meta.url)); | |||||
| const browserDistFolder = resolve(serverDistFolder, '../browser'); | |||||
| const indexHtml = join(serverDistFolder, 'index.server.html'); | |||||
| const commonEngine = new CommonEngine(); | |||||
| server.set('view engine', 'html'); | |||||
| server.set('views', browserDistFolder); | |||||
| // Example Express Rest API endpoints | |||||
| // server.get('/api/**', (req, res) => { }); | |||||
| // Serve static files from /browser | |||||
| server.get('*.*', express.static(browserDistFolder, { | |||||
| maxAge: '1y' | |||||
| })); | |||||
| // All regular routes use the Angular engine | |||||
| server.get('*', (req, res, next) => { | |||||
| const { protocol, originalUrl, baseUrl, headers } = req; | |||||
| commonEngine | |||||
| .render({ | |||||
| bootstrap: AppServerModule, | |||||
| documentFilePath: indexHtml, | |||||
| url: `${protocol}://${headers.host}${originalUrl}`, | |||||
| publicPath: browserDistFolder, | |||||
| providers: [{ provide: APP_BASE_HREF, useValue: baseUrl }], | |||||
| }) | |||||
| .then((html) => res.send(html)) | |||||
| .catch((err) => next(err)); | |||||
| }); | |||||
| return server; | |||||
| } | |||||
| function run(): void { | |||||
| const port = process.env['PORT'] || 4000; | |||||
| // Start up the Node server | |||||
| const server = app(); | |||||
| server.listen(port, () => { | |||||
| console.log(`Node Express server listening on http://localhost:${port}`); | |||||
| }); | |||||
| } | |||||
| run(); | |||||
| @@ -5,4 +5,4 @@ | |||||
| firstName?: string; | firstName?: string; | ||||
| lastName?: string; | lastName?: string; | ||||
| token?: string; | token?: string; | ||||
| } | |||||
| } | |||||
| @@ -15,9 +15,9 @@ import { ApiPostsGetCollection200ResponseHydraView } from './apiPostsGetCollecti | |||||
| export interface ApiPostsGetCollection200Response { | export interface ApiPostsGetCollection200Response { | ||||
| 'hydra:member': Array<PostJsonld>; | |||||
| 'hydra:totalItems'?: number; | |||||
| 'hydra:view'?: ApiPostsGetCollection200ResponseHydraView; | |||||
| 'hydra:search'?: ApiPostsGetCollection200ResponseHydraSearch; | |||||
| hydramember: Array<PostJsonld>; | |||||
| hydratotalItems?: number; | |||||
| hydraview?: ApiPostsGetCollection200ResponseHydraView; | |||||
| hydrasearch?: ApiPostsGetCollection200ResponseHydraSearch; | |||||
| } | } | ||||
| @@ -14,8 +14,8 @@ import { ApiPostsGetCollection200ResponseHydraSearchHydraMappingInner } from './ | |||||
| export interface ApiPostsGetCollection200ResponseHydraSearch { | export interface ApiPostsGetCollection200ResponseHydraSearch { | ||||
| type?: string; | type?: string; | ||||
| 'hydra:template'?: string; | |||||
| 'hydra:variableRepresentation'?: string; | |||||
| 'hydra:mapping'?: Array<ApiPostsGetCollection200ResponseHydraSearchHydraMappingInner>; | |||||
| hydratemplate?: string; | |||||
| hydravariableRepresentation?: string; | |||||
| hydramapping?: Array<ApiPostsGetCollection200ResponseHydraSearchHydraMappingInner>; | |||||
| } | } | ||||
| @@ -14,9 +14,9 @@ | |||||
| export interface ApiPostsGetCollection200ResponseHydraView { | export interface ApiPostsGetCollection200ResponseHydraView { | ||||
| id?: string; | id?: string; | ||||
| type?: string; | type?: string; | ||||
| 'hydra:first'?: string; | |||||
| 'hydra:last'?: string; | |||||
| 'hydra:previous'?: string; | |||||
| 'hydra:next'?: string; | |||||
| hydrafirst?: string; | |||||
| hydralast?: string; | |||||
| hydraprevious?: string; | |||||
| hydranext?: string; | |||||
| } | } | ||||
| @@ -15,9 +15,9 @@ import { ApiPostsGetCollection200ResponseHydraView } from './apiPostsGetCollecti | |||||
| export interface ApiUsersGetCollection200Response { | export interface ApiUsersGetCollection200Response { | ||||
| 'hydra:member': Array<UserJsonld>; | |||||
| 'hydra:totalItems'?: number; | |||||
| 'hydra:view'?: ApiPostsGetCollection200ResponseHydraView; | |||||
| 'hydra:search'?: ApiPostsGetCollection200ResponseHydraSearch; | |||||
| hydramember: Array<UserJsonld>; | |||||
| hydratotalItems?: number; | |||||
| hydraview?: ApiPostsGetCollection200ResponseHydraView; | |||||
| hydrasearch?: ApiPostsGetCollection200ResponseHydraSearch; | |||||
| } | } | ||||
| @@ -8,6 +8,7 @@ | |||||
| <link rel="icon" type="image/x-icon" href="favicon.ico"> | <link rel="icon" type="image/x-icon" href="favicon.ico"> | ||||
| <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet"> | <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet"> | ||||
| <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> | <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> | ||||
| <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous"> | |||||
| </head> | </head> | ||||
| <body class="mat-typography"> | <body class="mat-typography"> | ||||
| <app-root></app-root> | <app-root></app-root> | ||||
| @@ -1 +0,0 @@ | |||||
| export { AppServerModule as default } from './app/app.module.server'; | |||||
| @@ -3,14 +3,10 @@ | |||||
| "extends": "./tsconfig.json", | "extends": "./tsconfig.json", | ||||
| "compilerOptions": { | "compilerOptions": { | ||||
| "outDir": "./out-tsc/app", | "outDir": "./out-tsc/app", | ||||
| "types": [ | |||||
| "node" | |||||
| ] | |||||
| "types": [] | |||||
| }, | }, | ||||
| "files": [ | "files": [ | ||||
| "src/main.ts", | |||||
| "src/main.server.ts", | |||||
| "server.ts" | |||||
| "src/main.ts" | |||||
| ], | ], | ||||
| "include": [ | "include": [ | ||||
| "src/**/*.d.ts" | "src/**/*.d.ts" | ||||
| @@ -2,19 +2,17 @@ | |||||
| { | { | ||||
| "compileOnSave": false, | "compileOnSave": false, | ||||
| "compilerOptions": { | "compilerOptions": { | ||||
| "baseUrl": "./", | |||||
| "outDir": "./dist/out-tsc", | "outDir": "./dist/out-tsc", | ||||
| "forceConsistentCasingInFileNames": true, | "forceConsistentCasingInFileNames": true, | ||||
| "strict": true, | "strict": true, | ||||
| "noImplicitOverride": true, | "noImplicitOverride": true, | ||||
| "noPropertyAccessFromIndexSignature": false, | |||||
| "noPropertyAccessFromIndexSignature": true, | |||||
| "noImplicitReturns": true, | "noImplicitReturns": true, | ||||
| "noFallthroughCasesInSwitch": true, | "noFallthroughCasesInSwitch": true, | ||||
| "skipLibCheck": true, | "skipLibCheck": true, | ||||
| "esModuleInterop": true, | "esModuleInterop": true, | ||||
| "sourceMap": true, | "sourceMap": true, | ||||
| "declaration": false, | "declaration": false, | ||||
| "downlevelIteration": true, | |||||
| "experimentalDecorators": true, | "experimentalDecorators": true, | ||||
| "moduleResolution": "node", | "moduleResolution": "node", | ||||
| "importHelpers": true, | "importHelpers": true, | ||||
| @@ -26,8 +24,8 @@ | |||||
| "dom" | "dom" | ||||
| ], | ], | ||||
| "paths": { | "paths": { | ||||
| "@app/*": ["src/app/*"], | |||||
| "@environments/*": ["src/environments/*"] | |||||
| "@app/*": ["./src/app/*"], | |||||
| "@environments/*": ["./src/environments/*"] | |||||
| } | } | ||||
| }, | }, | ||||
| "angularCompilerOptions": { | "angularCompilerOptions": { | ||||
| @@ -1,6 +0,0 @@ | |||||
| { | |||||
| "name": "matsen-tool-fe", | |||||
| "lockfileVersion": 3, | |||||
| "requires": true, | |||||
| "packages": {} | |||||
| } | |||||