Skip to content

Commit 7e301c0

Browse files
committed
Add init mix's
1 parent 6a76361 commit 7e301c0

28 files changed

+659
-10
lines changed

apps.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
/each
3838

3939
`Writing to ${files.count()} files to ${id} ${gistId} ...`
40-
vfsGist(gistId, 'GITHUB_GIST_TOKEN'.envVariable()) | to => gist
40+
vfsGist(gistId, 'GISTLYN_TOKEN'.envVariable()) | to => gist
4141
gist.writeFiles(files)
4242
/each
4343
```

assets.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
/each
3030

3131
`Writing to ${files.count()} files to ${id} ${gistId} ...`
32-
vfsGist(gistId, 'GITHUB_GIST_TOKEN'.envVariable()) | to => gist
32+
vfsGist(gistId, 'GISTLYN_TOKEN'.envVariable()) | to => gist
3333
gist.writeFiles(files)
3434
/each
3535
```

auth.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
`Writing to ${textFiles.count()} files to id ${gistId} ...`
3434

35-
vfsGist(gistId, 'GITHUB_GIST_TOKEN'.envVariable()) | to => gist
35+
vfsGist(gistId, 'GISTLYN_TOKEN'.envVariable()) | to => gist
3636
gist.writeTextFiles(textFiles)
3737
else
3838
`Unknown id: ${id}`

config.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
/each
3232

3333
`Writing to ${files.count()} files to ${id} ${gistId} ...`
34-
vfsGist(gistId, 'GITHUB_GIST_TOKEN'.envVariable()) | to => gist
34+
vfsGist(gistId, 'GISTLYN_TOKEN'.envVariable()) | to => gist
3535
gist.writeFiles(files)
3636
/each
3737
```

db.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
`Writing to ${textFiles.count()} files to id ${gistId} ...`
3737

38-
vfsGist(gistId, 'GITHUB_GIST_TOKEN'.envVariable()) | to => gist
38+
vfsGist(gistId, 'GISTLYN_TOKEN'.envVariable()) | to => gist
3939
gist.writeTextFiles(textFiles)
4040
else
4141
`ERROR Unknown id: ${id}`

examples.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/each
2424

2525
`Writing to ${files.count()} files to ${id} ${gistId} ...`
26-
vfsGist(gistId, 'GITHUB_GIST_TOKEN'.envVariable()) | to => gist
26+
vfsGist(gistId, 'GISTLYN_TOKEN'.envVariable()) | to => gist
2727
gist.writeFiles(files)
2828
/each
2929
```

features.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
/each
2626

2727
`Writing to ${textFiles.count()} files to ${id} ${gistId} ...`
28-
vfsGist(gistId, 'GITHUB_GIST_TOKEN'.envVariable()) | to => gist
28+
vfsGist(gistId, 'GISTLYN_TOKEN'.envVariable()) | to => gist
2929
gist.writeTextFiles(textFiles)
3030
/each
3131
```

init.sc

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
* Update /init gists *
2+
* Usage: x run init.sc <id>? *
3+
4+
{{
5+
{
6+
init: '58030e271595520d87873c5df5e4c2eb',
7+
'init-lts': '95af30f3bce3f5044d91fa8706e5b958',
8+
'init-sharp-app': '5c9ee9031e53cd8f85bd0e14881ddaa8',
9+
}
10+
|> to => gistMap
11+
}}
12+
13+
var optional = []
14+
var ignore = []
15+
16+
var keys = ARGV.Length > 0 ? ARGV : gistMap.Keys
17+
18+
#each id in keys
19+
var gistId = gistMap[id]
20+
var files = {}
21+
var fs = vfsFileSystem(`init/${id}`)
22+
23+
fs.deleteDirectory('GPUCache') |> end
24+
fs.deleteDirectory('bin') |> end
25+
fs.deleteDirectory('obj') |> end
26+
27+
fs.deleteFile('cef.log') |> end
28+
29+
#each file in fs.allFiles()
30+
var key = file.VirtualPath.replace('/','\\')
31+
var key = optional.contains(key) ? `${key}?` : key
32+
#if !ignore.contains(key)
33+
files.putItem(key, file.fileContents()) |> end
34+
/if
35+
/each
36+
37+
`Writing to ${files.count()} files to ${id} ${gistId} ...`
38+
var gist = vfsGist(gistId, 'GISTLYN_TOKEN'.envVariable())
39+
gist.writeFiles(files)
40+
/each

init/init-lts/MyApp.csproj

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TypeScriptToolsVersion>2.8</TypeScriptToolsVersion>
6+
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<Folder Include="wwwroot\" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<Content Remove="appsettings.Development.json" />
15+
</ItemGroup>
16+
17+
<ItemGroup>
18+
<PackageReference Include="ServiceStack" Version="5.*" />
19+
</ItemGroup>
20+
21+
</Project>

init/init-lts/Program.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Threading.Tasks;
6+
using Microsoft.AspNetCore;
7+
using Microsoft.AspNetCore.Hosting;
8+
using Microsoft.Extensions.Configuration;
9+
using Microsoft.Extensions.Logging;
10+
using ServiceStack;
11+
12+
namespace MyApp
13+
{
14+
public class Program
15+
{
16+
public static void Main(string[] args)
17+
{
18+
BuildWebHost(args).Run();
19+
}
20+
21+
public static IWebHost BuildWebHost(string[] args) =>
22+
WebHost.CreateDefaultBuilder(args)
23+
.UseModularStartup<Startup>()
24+
.Build();
25+
}
26+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using ServiceStack;
3+
using MyApp.ServiceModel;
4+
5+
namespace MyApp.ServiceInterface
6+
{
7+
public class MyServices : Service
8+
{
9+
public object Any(Hello request)
10+
{
11+
return new HelloResponse { Result = $"Hello, {request.Name}!" };
12+
}
13+
}
14+
}

init/init-lts/ServiceModel/Hello.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using ServiceStack;
2+
3+
namespace MyApp.ServiceModel
4+
{
5+
[Route("/hello")]
6+
[Route("/hello/{Name}")]
7+
public class Hello : IReturn<HelloResponse>
8+
{
9+
public string Name { get; set; }
10+
}
11+
12+
public class HelloResponse
13+
{
14+
public string Result { get; set; }
15+
}
16+
}

init/init-lts/Startup.cs

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
using System.Collections.Generic;
2+
using System.Linq;
3+
using Microsoft.AspNetCore.Builder;
4+
using Microsoft.AspNetCore.Hosting;
5+
using Microsoft.Extensions.Hosting;
6+
using Microsoft.Extensions.DependencyInjection;
7+
using Microsoft.Extensions.Configuration;
8+
using Funq;
9+
using ServiceStack;
10+
using ServiceStack.Configuration;
11+
using MyApp.ServiceInterface;
12+
using ServiceStack.Script;
13+
using ServiceStack.Web;
14+
using System;
15+
using ServiceStack.Text;
16+
using ServiceStack.Logging;
17+
18+
namespace MyApp
19+
{
20+
public class Startup : ModularStartup
21+
{
22+
// This method gets called by the runtime. Use this method to add services to the container.
23+
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
24+
public new void ConfigureServices(IServiceCollection services)
25+
{
26+
}
27+
28+
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
29+
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
30+
{
31+
if (env.IsDevelopment())
32+
{
33+
app.UseDeveloperExceptionPage();
34+
}
35+
36+
app.UseServiceStack(new AppHost
37+
{
38+
AppSettings = new NetCoreAppSettings(Configuration)
39+
});
40+
}
41+
}
42+
43+
public class AppHost : AppHostBase
44+
{
45+
public AppHost() : base("My App", typeof(MyServices).Assembly) { }
46+
47+
// Configure your AppHost with the necessary configuration and dependencies your App needs
48+
public override void Configure(Container container)
49+
{
50+
SetConfig(new HostConfig
51+
{
52+
DefaultRedirectPath = "/metadata",
53+
UseSameSiteCookies = true,
54+
DebugMode = HostingEnvironment.IsDevelopment()
55+
});
56+
}
57+
}
58+
}

init/init-lts/appsettings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"Logging": {
3+
"IncludeScopes": false,
4+
"Debug": {
5+
"LogLevel": {
6+
"Default": "Warning"
7+
}
8+
},
9+
"Console": {
10+
"LogLevel": {
11+
"Default": "Warning"
12+
}
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)