steeltoeoss / netcoretooltemplates Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
If actuator
dependency is specified, the following snippets should be generated in Startup::Configure
:
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
...
app.UseEndpoints(endpoints =>
{
...
endpoints.MapAllActuators();
});
...
HealthStartupFilter.InitializeAvailability(app.ApplicationServices)
...
}
The user will invoke the template option as such:
$ dotnet new steeltoe-webapi --messaging-rabbitmq
The generated project should resemble:
https://github.com/SteeltoeOSS/Samples/tree/rabbit-host/Messaging/src/RabbitMQWeb
Sample invocation:
$ dotnet new stwebapi --placeholder
Option should behave similarly to that in other templates.
Sample help output from dotnet new webapi -h
:
-f|--framework The target framework for the project.
net5.0 - Target net5.0
netcoreapp3.1 - Target netcoreapp3.1
Default: net5.0
This code should be removed from startup.cs if Steeltoe 3.1.0+ is used:
app.UseDiscoveryClient();
Using the option --management-endpoints
should configure dynamic logging in Program.cs
. Something like:
WebHost.CreateDefaultBuilder(args)
.ConfigureLogging((context, builder) => builder.AddDynamicConsole())
The user will invoke the template option as such:
$ dotnet new steeltoe-webapi --streams-rabbitmq
The generated project should resemble:
https://github.com/SteeltoeOSS/Samples/tree/main/Stream/Basic
Sample invocation:
$ dotnet new stwebapi --mysql-efcore
Sample invocation:
$ dotnet new stwebapi --random-value
Minimally, configure such that bin
and obj
directories are ignored by Git.
Sample invocation:
$ dotnew new stwebapi --cloud-eureka
E.g.,
$ dotnet new steeltoe-webapi --rabbitmq
would become
$ dotnet new steeltoe-webapi --connector-rabbitmq
Sample invocation:
$ dotnew new stwebapi --dockerfile
UseCloudHosting()
allows passing in a port to listen on - if Initializr were to randomly assign a port at generation time, multiple projects created with initializr would be unlikely to attempt to bind to the same port
Implement a test matrix with dimensions:
For example, a point in the matrix would test:
$ dotnet new stwebapi --framework netcoreapp3.1 --steeltoe 3.0.2 --dynamic-logging
To pass, a project should succeed in:
dotnet restore
dotnet build /p:TreatWarningsAsErrors=True
Explicitly spelling out steeltoe
helps to identify the context of the template
Sample invocation:
$ dotnew new stwebapi --postgresql
Sample invocation:
$ dotnew new stwebapi --postgresql-efcore
template can be used running: dotnet new stwebapi
.
Initial template will have no options and only generate a generic project. Subsequent feature requests will define template options.
As part of implementation, create initial unit test framework.
The Eureka dependency should add a reference to Steeltoe.Discovery.Eureka
, optionally in place of ClientCore
as the code currently in the template comes from ClientBase
which is a dependency of the Eureka package.
Sample invocation:
$ dotnew new stwebapi --amqp
AddRandomValueSource
should be called in program.cs when RandomValue has been added
Maybe it would be simpler if all config providers were added inside ConfigureAppConfiguration
since there isn't a HostBuilder extension for Random? just an idea, may or may not be a great one
3.1.0 has recently been released
Port the Mustache templates from https://github.com/SteeltoeOSS/InitializrConfig/ to this project.
The .NET new template name should be steeltoe
such that projects can be created using a form of:
$ dotnet new stwebapi ...
Sample invocation:
$ dotnew new stwebapi --sqlserver
When used in a Cloud Foundry environment, Connectors also need
.AddCloudFoundryConfiguration()
)Steeltoe.Connector.CloudFoundry
The description option should configure the content of the the Description tag in the generated .csproj.
Sample:
$ dotnew new steeltoe-webapi --description "My Project"
Should result in something like:
Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
...
<Description>My Project</Description>
...
Sample invocation:
$ dotnew new stwebapi --actuator
<PackageIconUrl>https://steeltoe.io/images/transparent.png</PackageIconUrl>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
Using the stock WeatherForecastController
from the webapi
template simplifies development and upkeep.
Sample invocation:
$ dotnet new stwebapi --cloud-hystrix
When launching a project from the initializer, it opens a browser at the location "/api/values"
When launching a project from the initializer, it opens a browser at the location "/weatherforecast"
When launching a project from the initializer, it opens a browser at the location "/api/values"
Create a project in the initializer using Steeltoe 3.1.0 and .NET 3.1
Launch the application and the browser will open at "localhost:PORT/api/values" instead of "localhost:PORT/weatherforecast"
Sample invocation
$ dotnew new stwebapi --azure-support
Spring example:
https://start.spring.io/#!type=maven-project&language=java&platformVersion=2.3.10.RELEASE&packaging=jar&jvmVersion=11&groupId=com.example&artifactId=demo&name=demo&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.demo&dependencies=azure-support
Create basic doc:
Create issue templates:
Command should look like:
$ dotnet new stwebapi --steeltoe|-s <version>
.UseCloudHosting isn't CF specific and should be available separately
Essentially this is simply adding a ide.host.json
file to .template.config/
.
IDEs use this file to "see" custom parameters.
Schema for this file:
http://json.schemastore.org/vs-2017.3.host
The description option should configure the content of the the Description tag in the generated .csproj.
Sample:
$ dotnew new steeltoe-webapi --description "My Project"
Should result in something like:
Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
...
<Description>My Project</Description>
...
Sample invocation:
$ dotnew new stwebapi --cloud-foundry-support
Sample invocation:
$ dotnew new stwebapi --data-redis
Sample invocation:
$ dotnet new stwebapi --cloud-config-client
Sample invocation:
$ dotnew new stwebapi --oauth
Set up a DevOps pipeline at https://dev.azure.com/SteeltoeOSS/Steeltoe/.
Visual Studio files should be ignored by Git. Adding to .gitignore improves the developer experience.
Sample invocation:
$ dotnet new stwebapi --dynamic-logger
Sample invocation:
$ dotnet new stwebapi --mysql
Spring example:
https://start.spring.io/#!type=maven-project&language=java&platformVersion=2.3.10.RELEASE&packaging=jar&jvmVersion=11&groupId=com.example&artifactId=demo&name=d
emo&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.demo&dependencies=mysql
Sample invocation:
$ dotnet new stwebapi --data-mongodb
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.