Dotnet new templates: Fix placeholders and port in umbraco-extension template (#20956)
* reset placeholders and port number in umbraco-extension template * add readme instructions on how to test templates locally
This commit is contained in:
@@ -14,5 +14,5 @@ import type { ClientOptions as ClientOptions2 } from './types.gen';
|
||||
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
|
||||
|
||||
export const client = createClient(createConfig<ClientOptions2>({
|
||||
baseUrl: 'https://localhost:44394'
|
||||
baseUrl: 'https://localhost:44339'
|
||||
}));
|
||||
|
||||
@@ -18,7 +18,7 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
|
||||
meta?: Record<string, unknown>;
|
||||
};
|
||||
|
||||
export class WebsiteClientService {
|
||||
export class UmbracoExtensionService {
|
||||
public static ping<ThrowOnError extends boolean = false>(options?: Options<PingData, ThrowOnError>) {
|
||||
return (options?.client ?? client).get<PingResponses, PingErrors, ThrowOnError>({
|
||||
security: [
|
||||
@@ -27,7 +27,7 @@ export class WebsiteClientService {
|
||||
type: 'http'
|
||||
}
|
||||
],
|
||||
url: '/umbraco/websiteclient/api/v1/ping',
|
||||
url: '/umbraco/umbracoextension/api/v1/ping',
|
||||
...options
|
||||
});
|
||||
}
|
||||
@@ -40,7 +40,7 @@ export class WebsiteClientService {
|
||||
type: 'http'
|
||||
}
|
||||
],
|
||||
url: '/umbraco/websiteclient/api/v1/whatsMyName',
|
||||
url: '/umbraco/umbracoextension/api/v1/whatsMyName',
|
||||
...options
|
||||
});
|
||||
}
|
||||
@@ -53,7 +53,7 @@ export class WebsiteClientService {
|
||||
type: 'http'
|
||||
}
|
||||
],
|
||||
url: '/umbraco/websiteclient/api/v1/whatsTheTimeMrWolf',
|
||||
url: '/umbraco/umbracoextension/api/v1/whatsTheTimeMrWolf',
|
||||
...options
|
||||
});
|
||||
}
|
||||
@@ -66,7 +66,7 @@ export class WebsiteClientService {
|
||||
type: 'http'
|
||||
}
|
||||
],
|
||||
url: '/umbraco/websiteclient/api/v1/whoAmI',
|
||||
url: '/umbraco/umbracoextension/api/v1/whoAmI',
|
||||
...options
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: 'https://localhost:44394' | (string & {});
|
||||
baseUrl: 'https://localhost:44339' | (string & {});
|
||||
};
|
||||
|
||||
export type DocumentGranularPermissionModel = {
|
||||
@@ -159,7 +159,7 @@ export type PingData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
query?: never;
|
||||
url: '/umbraco/websiteclient/api/v1/ping';
|
||||
url: '/umbraco/umbracoextension/api/v1/ping';
|
||||
};
|
||||
|
||||
export type PingErrors = {
|
||||
@@ -182,7 +182,7 @@ export type WhatsMyNameData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
query?: never;
|
||||
url: '/umbraco/websiteclient/api/v1/whatsMyName';
|
||||
url: '/umbraco/umbracoextension/api/v1/whatsMyName';
|
||||
};
|
||||
|
||||
export type WhatsMyNameErrors = {
|
||||
@@ -205,7 +205,7 @@ export type WhatsTheTimeMrWolfData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
query?: never;
|
||||
url: '/umbraco/websiteclient/api/v1/whatsTheTimeMrWolf';
|
||||
url: '/umbraco/umbracoextension/api/v1/whatsTheTimeMrWolf';
|
||||
};
|
||||
|
||||
export type WhatsTheTimeMrWolfErrors = {
|
||||
@@ -228,7 +228,7 @@ export type WhoAmIData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
query?: never;
|
||||
url: '/umbraco/websiteclient/api/v1/whoAmI';
|
||||
url: '/umbraco/umbracoextension/api/v1/whoAmI';
|
||||
};
|
||||
|
||||
export type WhoAmIErrors = {
|
||||
|
||||
21
templates/readme.md
Normal file
21
templates/readme.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Contributing to the Umbraco Templates
|
||||
|
||||
If you're making changes to any of the templates in this folder, please note that installing them directly from this location to test will not work. You need to 'pack' the source into a nuget package (.nupkg) in a local folder, and install from there.
|
||||
|
||||
For example, using a folder location of `c:\nuget.local`:
|
||||
|
||||
```
|
||||
# Pack the templates to a local folder
|
||||
dotnet pack -o "c:\nuget.local"
|
||||
|
||||
# Add this folder as a local nuget source
|
||||
dotnet nuget add source "c:\nuget.local" --name "local nuget"
|
||||
|
||||
# Make sure you don't have the global templates installed
|
||||
dotnet new uninstall Umbraco.Templates
|
||||
|
||||
# Install your version of the templates, having checked/updated the name of the generated .nupkg file
|
||||
dotnet new install "c:\nuget.local\Umbraco.Templates.XXXX.nupkg"
|
||||
```
|
||||
|
||||
You can now test your template changes using the appropriate `dotnet new` command.
|
||||
Reference in New Issue
Block a user