Rescaffolding

This commit is contained in:
Tara Wilson 2024-11-27 13:37:24 -05:00
parent 20d81a7313
commit ca1f2b95f4
42 changed files with 179 additions and 371 deletions

49
.gitignore vendored
View File

@ -1,4 +1,47 @@
.DS_Store .DS_Store
node_modules/* **/node_modules/*
bin/* **/bin/*
obj/* **/obj/*
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
# Compiled output
**/dist/*
**/tmp/*
**/out-tsc/*
**/bazel-out/*
# Node
**/node_modules/*
npm-debug.log
yarn-error.log
# IDEs and editors
**/.idea/*
**/.project/*
**/.classpath/*
**/.c9/*
*.launch
*/.settings/**
*.sublime-workspace
# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings
# System files
.DS_Store
Thumbs.db

View File

@ -1,41 +0,0 @@
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
builder.Services.AddOpenApi();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
}
app.UseHttpsRedirection();
var summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
app.MapGet("/weatherforecast", () =>
{
var forecast = Enumerable.Range(1, 5).Select(index =>
new WeatherForecast
(
DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
Random.Shared.Next(-20, 55),
summaries[Random.Shared.Next(summaries.Length)]
))
.ToArray();
return forecast;
})
.WithName("GetWeatherForecast");
app.Run();
record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary)
{
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
}

View File

@ -1,149 +0,0 @@
{
"version": 3,
"targets": {
"net9.0": {
"Microsoft.AspNetCore.OpenApi/9.0.0": {
"type": "package",
"dependencies": {
"Microsoft.OpenApi": "1.6.17"
},
"compile": {
"lib/net9.0/Microsoft.AspNetCore.OpenApi.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/net9.0/Microsoft.AspNetCore.OpenApi.dll": {
"related": ".xml"
}
},
"frameworkReferences": [
"Microsoft.AspNetCore.App"
]
},
"Microsoft.OpenApi/1.6.17": {
"type": "package",
"compile": {
"lib/netstandard2.0/Microsoft.OpenApi.dll": {
"related": ".pdb;.xml"
}
},
"runtime": {
"lib/netstandard2.0/Microsoft.OpenApi.dll": {
"related": ".pdb;.xml"
}
}
}
}
},
"libraries": {
"Microsoft.AspNetCore.OpenApi/9.0.0": {
"sha512": "FqUK5j1EOPNuFT7IafltZQ3cakqhSwVzH5ZW1MhZDe4pPXs9sJ2M5jom1Omsu+mwF2tNKKlRAzLRHQTZzbd+6Q==",
"type": "package",
"path": "microsoft.aspnetcore.openapi/9.0.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"PACKAGE.md",
"THIRD-PARTY-NOTICES.TXT",
"lib/net9.0/Microsoft.AspNetCore.OpenApi.dll",
"lib/net9.0/Microsoft.AspNetCore.OpenApi.xml",
"microsoft.aspnetcore.openapi.9.0.0.nupkg.sha512",
"microsoft.aspnetcore.openapi.nuspec"
]
},
"Microsoft.OpenApi/1.6.17": {
"sha512": "Le+kehlmrlQfuDFUt1zZ2dVwrhFQtKREdKBo+rexOwaCoYP0/qpgT9tLxCsZjsgR5Itk1UKPcbgO+FyaNid/bA==",
"type": "package",
"path": "microsoft.openapi/1.6.17",
"files": [
".nupkg.metadata",
".signature.p7s",
"README.md",
"lib/netstandard2.0/Microsoft.OpenApi.dll",
"lib/netstandard2.0/Microsoft.OpenApi.pdb",
"lib/netstandard2.0/Microsoft.OpenApi.xml",
"microsoft.openapi.1.6.17.nupkg.sha512",
"microsoft.openapi.nuspec"
]
}
},
"projectFileDependencyGroups": {
"net9.0": [
"Microsoft.AspNetCore.OpenApi >= 9.0.0"
]
},
"packageFolders": {
"/Users/tarawilson/.nuget/packages/": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "/Users/tarawilson/Code/ticket-system/source/ticket-api/ticket-api.csproj",
"projectName": "ticket-api",
"projectPath": "/Users/tarawilson/Code/ticket-system/source/ticket-api/ticket-api.csproj",
"packagesPath": "/Users/tarawilson/.nuget/packages/",
"outputPath": "/Users/tarawilson/Code/ticket-system/source/ticket-api/obj/",
"projectStyle": "PackageReference",
"configFilePaths": [
"/Users/tarawilson/.nuget/NuGet/NuGet.Config"
],
"originalTargetFrameworks": [
"net9.0"
],
"sources": {
"/opt/homebrew/Cellar/dotnet/9.0.0/libexec/library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net9.0": {
"targetAlias": "net9.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "all"
},
"SdkAnalysisLevel": "9.0.100"
},
"frameworks": {
"net9.0": {
"targetAlias": "net9.0",
"dependencies": {
"Microsoft.AspNetCore.OpenApi": {
"target": "Package",
"version": "[9.0.0, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.AspNetCore.App": {
"privateAssets": "none"
},
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "/opt/homebrew/Cellar/dotnet/9.0.0/libexec/sdk/9.0.100/PortableRuntimeIdentifierGraph.json"
}
}
}
}

View File

@ -1,11 +0,0 @@
{
"version": 2,
"dgSpecHash": "P7FXp9VfOMk=",
"success": true,
"projectFilePath": "/Users/tarawilson/Code/ticket-system/source/ticket-api/ticket-api.csproj",
"expectedPackageFiles": [
"/Users/tarawilson/.nuget/packages/microsoft.aspnetcore.openapi/9.0.0/microsoft.aspnetcore.openapi.9.0.0.nupkg.sha512",
"/Users/tarawilson/.nuget/packages/microsoft.openapi/1.6.17/microsoft.openapi.1.6.17.nupkg.sha512"
],
"logs": []
}

View File

@ -1,77 +0,0 @@
{
"format": 1,
"restore": {
"/Users/tarawilson/Code/ticket-system/source/ticket-api/ticket-api.csproj": {}
},
"projects": {
"/Users/tarawilson/Code/ticket-system/source/ticket-api/ticket-api.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "/Users/tarawilson/Code/ticket-system/source/ticket-api/ticket-api.csproj",
"projectName": "ticket-api",
"projectPath": "/Users/tarawilson/Code/ticket-system/source/ticket-api/ticket-api.csproj",
"packagesPath": "/Users/tarawilson/.nuget/packages/",
"outputPath": "/Users/tarawilson/Code/ticket-system/source/ticket-api/obj/",
"projectStyle": "PackageReference",
"configFilePaths": [
"/Users/tarawilson/.nuget/NuGet/NuGet.Config"
],
"originalTargetFrameworks": [
"net9.0"
],
"sources": {
"/opt/homebrew/Cellar/dotnet/9.0.0/libexec/library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net9.0": {
"targetAlias": "net9.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "all"
},
"SdkAnalysisLevel": "9.0.100"
},
"frameworks": {
"net9.0": {
"targetAlias": "net9.0",
"dependencies": {
"Microsoft.AspNetCore.OpenApi": {
"target": "Package",
"version": "[9.0.0, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.AspNetCore.App": {
"privateAssets": "none"
},
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "/opt/homebrew/Cellar/dotnet/9.0.0/libexec/sdk/9.0.100/PortableRuntimeIdentifierGraph.json"
}
}
}
}
}

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/Users/tarawilson/.nuget/packages/</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/Users/tarawilson/.nuget/packages/</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.12.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="/Users/tarawilson/.nuget/packages/" />
</ItemGroup>
</Project>

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

View File

@ -1,14 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>ticket_api</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0" />
</ItemGroup>
</Project>

View File

@ -1,6 +0,0 @@
@ticket_api_HostAddress = http://localhost:5118
GET {{ticket_api_HostAddress}}/weatherforecast/
Accept: application/json
###

View File

@ -1,42 +0,0 @@
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
# Compiled output
/dist
/tmp
/out-tsc
/bazel-out
# Node
/node_modules
npm-debug.log
yarn-error.log
# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings
# System files
.DS_Store
Thumbs.db

View File

@ -0,0 +1,32 @@
using Microsoft.AspNetCore.Mvc;
namespace api.Controllers;
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
private readonly ILogger<WeatherForecastController> _logger;
public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
}
[HttpGet]
public IEnumerable<WeatherForecast> Get()
{
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
})
.ToArray();
}
}

View File

@ -0,0 +1,17 @@
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
var app = builder.Build();
// Configure the HTTP request pipeline.
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
app.Run();

View File

@ -5,7 +5,7 @@
"commandName": "Project", "commandName": "Project",
"dotnetRunMessages": true, "dotnetRunMessages": true,
"launchBrowser": false, "launchBrowser": false,
"applicationUrl": "http://localhost:5118", "applicationUrl": "http://localhost:5168",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
} }
@ -14,7 +14,7 @@
"commandName": "Project", "commandName": "Project",
"dotnetRunMessages": true, "dotnetRunMessages": true,
"launchBrowser": false, "launchBrowser": false,
"applicationUrl": "https://localhost:7060;http://localhost:5118", "applicationUrl": "https://localhost:7252;http://localhost:5168",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
} }

View File

@ -0,0 +1,12 @@
namespace api;
public class WeatherForecast
{
public DateOnly Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
public string? Summary { get; set; }
}

View File

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,6 @@
@api_HostAddress = http://localhost:5168
GET {{api_HostAddress}}/weatherforecast/
Accept: application/json
###

View File

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "api", "api\api.csproj", "{B6356579-0415-44D3-859C-523EAEC62CAE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "models", "models\models.csproj", "{151732EB-34AB-4ADE-B795-18D53E81354F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "data", "data\data.csproj", "{BE208249-FBAF-43F9-AE23-916A480668D1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B6356579-0415-44D3-859C-523EAEC62CAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B6356579-0415-44D3-859C-523EAEC62CAE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B6356579-0415-44D3-859C-523EAEC62CAE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B6356579-0415-44D3-859C-523EAEC62CAE}.Release|Any CPU.Build.0 = Release|Any CPU
{151732EB-34AB-4ADE-B795-18D53E81354F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{151732EB-34AB-4ADE-B795-18D53E81354F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{151732EB-34AB-4ADE-B795-18D53E81354F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{151732EB-34AB-4ADE-B795-18D53E81354F}.Release|Any CPU.Build.0 = Release|Any CPU
{BE208249-FBAF-43F9-AE23-916A480668D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BE208249-FBAF-43F9-AE23-916A480668D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BE208249-FBAF-43F9-AE23-916A480668D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BE208249-FBAF-43F9-AE23-916A480668D1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

View File

@ -1,4 +1,4 @@
# TicketUi # TicketUI
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.0.2. This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.0.2.

View File

@ -3,7 +3,7 @@
"version": 1, "version": 1,
"newProjectRoot": "projects", "newProjectRoot": "projects",
"projects": { "projects": {
"ticket-ui": { "ticketUI": {
"projectType": "application", "projectType": "application",
"schematics": { "schematics": {
"@schematics/angular:component": { "@schematics/angular:component": {
@ -64,10 +64,10 @@
"builder": "@angular-devkit/build-angular:dev-server", "builder": "@angular-devkit/build-angular:dev-server",
"configurations": { "configurations": {
"production": { "production": {
"buildTarget": "ticket-ui:build:production" "buildTarget": "ticketUI:build:production"
}, },
"development": { "development": {
"buildTarget": "ticket-ui:build:development" "buildTarget": "ticketUI:build:development"
} }
}, },
"defaultConfiguration": "development" "defaultConfiguration": "development"

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -14,16 +14,16 @@ describe('AppComponent', () => {
expect(app).toBeTruthy(); expect(app).toBeTruthy();
}); });
it(`should have the 'ticket-ui' title`, () => { it(`should have the 'ticketUI' title`, () => {
const fixture = TestBed.createComponent(AppComponent); const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance; const app = fixture.componentInstance;
expect(app.title).toEqual('ticket-ui'); expect(app.title).toEqual('ticketUI');
}); });
it('should render title', () => { it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent); const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges(); fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement; const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, ticket-ui'); expect(compiled.querySelector('h1')?.textContent).toContain('Hello, ticketUI');
}); });
}); });

View File

@ -8,5 +8,5 @@ import { RouterOutlet } from '@angular/router';
styleUrl: './app.component.scss' styleUrl: './app.component.scss'
}) })
export class AppComponent { export class AppComponent {
title = 'ticket-ui'; title = 'ticketUI';
} }

View File

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>TicketUi</title> <title>TicketUI</title>
<base href="/"> <base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="icon" type="image/x-icon" href="favicon.ico">