Code Monkey home page Code Monkey logo

saturn.template's People

Contributors

brase avatar cartermp avatar chrsteinert avatar dharmatech avatar draptik avatar jpollard-github avatar krzysztof-cieslak avatar mvsmal avatar rmunn avatar theimowski avatar tmpreston avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

saturn.template's Issues

error NU1108: Cycle detected - when building project created from the template

This one looks strange, like saturn would depend on itself...
Not sure if that's Paket related or not

  1. λ dotnet new Saturn --language F#
  2. λ build
...

Starting Target: Build (==> InstallDotNetCore)
dotnet "build" --configuration Release
Microsoft (R) Build Engine version 15.5.180.51428 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restoring packages for C:\Users\BRE44821\sandbox\saturn\src\saturn\saturn.fsproj...
  Restore completed in 24.13 ms for C:\Users\BRE44821\sandbox\saturn\src\saturn\saturn.fsproj.
  Restore completed in 35.44 ms for C:\Users\BRE44821\sandbox\saturn\src\saturn\saturn.fsproj.
C:\Users\BRE44821\sandbox\saturn\src\saturn\saturn.fsproj : error NU1108: Cycle detected.
C:\Users\BRE44821\sandbox\saturn\src\saturn\saturn.fsproj : error NU1108:   saturn -> Saturn (>= 0.4.3).
  Generating MSBuild file C:\Users\BRE44821\sandbox\saturn\src\saturn\obj\saturn.fsproj.nuget.g.props.
  Restore failed in 643.02 ms for C:\Users\BRE44821\sandbox\saturn\src\saturn\saturn.fsproj.

Build FAILED.

C:\Users\BRE44821\sandbox\saturn\src\saturn\saturn.fsproj : error NU1108: Cycle detected.
C:\Users\BRE44821\sandbox\saturn\src\saturn\saturn.fsproj : error NU1108:   saturn -> Saturn (>= 0.4.3).
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:01.52
Running build failed.
Error:
System.Exception: Build failed on "build" --configuration Release
   at [email protected](String message) in D:\code\fake\src\app\FakeLib\DotNetCLIHelper.fs:line 224
   at Fake.DotNetCli.Build(FSharpFunc`2 setBuildParams) in D:\code\fake\src\app\FakeLib\DotNetCLIHelper.fs:line 224
   at [email protected](Unit _arg3) in C:\Users\BRE44821\sandbox\saturn\build.fsx:line 23
   at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in D:\code\fake\src\app\FakeLib\TargetHelper.fs:line 626
λ dotnet --version
2.1.4
λ dotnet new Saturn --help
Usage: new [options]

Options:
  -h, --help          Displays help for this command.
  -l, --list          Lists templates containing the specified name. If no name is specified, lists all templates.
  -n, --name          The name for the output being created. If no name is specified, the name of the current directory is used.
  -o, --output        Location to place the generated output.
  -i, --install       Installs a source or a template pack.
  -u, --uninstall     Uninstalls a source or a template pack.
  --type              Filters templates based on available types. Predefined values are "project", "item" or "other".
  --force             Forces content to be generated even if it would change existing files.
  -lang, --language   Specifies the language of the template to create.


Saturn v0.4.1 (F#)
Author: Krzysztof Cieslak
    (No Parameters)

AppPath is generated with wrong name when project folder has dashes

If a project folder name has dashes, such as some-test-proj, when running the donet new, the build.fsx file has an appPath with a value "./src/some_test_proj".

I'm running on Windows 10, and the Saturn template v0.4.1

saturn-template

I'd be glad to help with the issue if you can point me in the right direction.

Update code generation to produce curried args instead of tupled

When the template is updated to use Saturn 0.6.0, the code generation will need to be updated to produce curried args instead of tupled args, matching SaturnFramework/Saturn@240a7f2. Otherwise trying to follow the "How to start in 60 seconds" guide will result in the following errors:

src/SaturnSample/Books/BooksController.fs(96,10): error FS0001: Type mismatch. Expecting a�    'HttpContext -> 'a -> Giraffe.Core.HttpFuncResult'    �but given a�    ''b * string -> System.Threading.Tasks.Task<HttpContext option>'    �The type 'HttpContext' does not match the type ''a * string' [src/SaturnSample/SaturnSample.fsproj]
src/SaturnSample/Books/BooksController.fs(98,10): error FS0001: Type mismatch. Expecting a�    'HttpContext -> 'a -> Giraffe.Core.HttpFuncResult'    �but given a�    ''b * string -> System.Threading.Tasks.Task<HttpContext option>'    �The type 'HttpContext' does not match the type ''a * string' [src/SaturnSample/SaturnSample.fsproj]
src/SaturnSample/Books/BooksController.fs(100,12): error FS0001: Type mismatch. Expecting a�    'HttpContext -> 'a -> Giraffe.Core.HttpFuncResult'    �but given a�    ''b * string -> System.Threading.Tasks.Task<HttpContext option>'    �The type 'HttpContext' does not match the type ''a * string' [src/SaturnSample/SaturnSample.fsproj]
src/SaturnSample/Books/BooksController.fs(101,12): error FS0001: Type mismatch. Expecting a�    'HttpContext -> 'a -> Giraffe.Core.HttpFuncResult'    �but given a�    ''b * string -> System.Threading.Tasks.Task<HttpContext option>'    �The type 'HttpContext' does not match the type ''a * string' [src/SaturnSample/SaturnSample.fsproj]

Using the template instructions in README are inaccurate

I am following the readme instructions on using the template. The steps to build and run don't work because there isn't a fake.sh script, but there is a build.sh. I do get an error when I create the project. See #18

    For build execute fake.sh build or .\fake.cmd build
    For running execute fake.sh build -t Run or .\fake.cmd build -t Run

My files list:

marnee@DESKTOP-R85TMON:/mnt/c/Users/marnee/Dropbox/interactive-workshop/src/test$ ll
total 304
drwxrwxrwx 1 marnee marnee   4096 Mar 30 09:40 ./
drwxrwxrwx 1 marnee marnee   4096 Mar 30 09:39 ../
-rwxrwxrwx 1 marnee marnee     44 Mar 30 09:39 .gitignore*
drwxrwxrwx 1 marnee marnee   4096 Mar 30 09:39 .paket/
drwxrwxrwx 1 marnee marnee   4096 Mar 30 09:39 .vs/
-rwxrwxrwx 1 marnee marnee    197 Mar 30 09:39 build.cmd*
-rwxrwxrwx 1 marnee marnee    995 Mar 30 09:39 build.fsx*
-rwxrwxrwx 1 marnee marnee    745 Mar 30 09:39 build.sh*
-rwxrwxrwx 1 marnee marnee     47 Mar 30 09:39 global.json*
-rwxrwxrwx 1 marnee marnee   3328 Mar 30 09:39 my-saturn-project.sln*
drwxrwxrwx 1 marnee marnee   4096 Mar 30 09:40 packages/
drwxrwxrwx 1 marnee marnee   4096 Mar 30 09:40 paket-files/
-rwxrwxrwx 1 marnee marnee    247 Mar 30 09:39 paket.dependencies*
-rwxrwxrwx 1 marnee marnee 298800 Mar 30 09:40 paket.lock*
drwxrwxrwx 1 marnee marnee   4096 Mar 30 09:39 src/

I am unable to get the migrations project to build

This is either a result of me not understanding a paket nuance, or it could be related to #25

The symptoms are the visual studio does not recognize the namespace SimpleMigrations and neither does dotnet build when run from within the migrations folder.

C:\repos\Saturn2\src\Migrations\Program.fs(4,6): error FS0039: The namespace or module 'SimpleMigrations' is not defined. [C:\repos\Saturn2\src\Migrations\Migrations.fsproj]
C:\repos\Saturn2\src\Migrations\Program.fs(5,16): error FS0039: The namespace 'Data' is not defined. [C:\repos\Saturn2\src\Migrations\Migrations.fsproj]
C:\repos\Saturn2\src\Migrations\Program.fs(6,6): error FS0039: The namespace or module 'SimpleMigrations' is not defined. [C:\repos\Saturn2\src\Migrations\Migrations.fsproj]
C:\repos\Saturn2\src\Migrations\Program.fs(7,6): error FS0039: The namespace or module 'SimpleMigrations' is not defined. [C:\repos\Saturn2\src\Migrations\Migrations.fsproj]
C:\repos\Saturn2\src\Migrations\Program.fs(13,18): error FS0039: The type 'SqliteConnection' is not defined. [C:\repos\Saturn2\src\Migrations\Migrations.fsproj]
C:\repos\Saturn2\src\Migrations\Program.fs(14,20): error FS0039: The value or constructor 'SqliteDatabaseProvider' is not defined. [C:\repos\Saturn2\src\Migrations\Migrations.fsproj]
C:\repos\Saturn2\src\Migrations\Program.fs(15,20): error FS0039: The value or constructor 'SimpleMigrator' is not defined. [C:\repos\Saturn2\src\Migrations\Migrations.fsproj]
C:\repos\Saturn2\src\Migrations\Program.fs(16,25): error FS0039: The value or constructor 'ConsoleRunner' is not defined. [C:\repos\Saturn2\src\Migrations\Migrations.fsproj]
C:\repos\Saturn2\src\Migrations\Program.fs(17,5): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. [C:\repos\Saturn2\src\Migrations\Migrations.fsproj]

I have tried removing Simple.Migrations then adding it again. Also tried clearing the paket cache. I haven't tried recreating the entire migrations project, but I don't think that should be required.

Fake says it's obsolete

install template
do dotnet new saturn -lang f# -n blabla
do .\build.cmd
observe a lot of messages from Fake like This runner is now obsolete with FAKE 5, please upgrade to the new .Net Core runner. See https://fake.build/fake-migrate-to-fake-5.html, build.fsx(7,38): warning FS0044: This construct is deprecated. Use Fake.IO instead (FAKE0001 - package: Fake.IO.FileSystem - member: Fake.IO.Path.getFullName)...

After uncommenting 'suggested' forward "/api" route, left with roadblock

I decided to spend an hour tonight to check out Saturn fully. I'm impressed with the work done so far!

In going through the "60 second guide," I've run into a point of confusion:

As of time of this issue, Step 9 tells me the following:

image

Which I take to mean "Uncomment the following line:"
image

Naturally, when I do such, the apiRouter is undefined, and I need to uncomment the above uncommented bits:

image

But when I do that, I see more sad red squigglies :(
Figuring out "how do I implement error_hander and someScopeOrController certainly goes against the '60 seconds' sales pitch, so the way I see it, this can be solved in one of 2 ways:

1- Remove step 9 from the guide, having the person onboarding interact/learn a bit less
2- Give more instructions as to what should go here.

I suspect that the former is the more obvious choice. Best to leave that sort of stuff for the slightly-longer demo :)

Support for SQL Server option in template

Hi,

Would you be OK with me contributing a PR to add SQL Server as an option to the template?
I was thinking to use a new parameter on the template that will default to SQLite, and be used in the template to control copying and renaming of sources, similar to how it is being done in SAFE-Template

...
      "modifiers": [
        {
          "condition": "(Server == \"suave\")",
          "exclude": [ "**/ServerGiraffe.fs" ],
          "rename": {
            "ServerSuave.fs": "Server.fs"
          }
        },
...

I would also be able to produce a corresponding PR for the dotnet-saturn repo to alter the GEN function.

Thanks

.NET Core 2.1

Let's update the template to use .NET Core 2.1, particularly 2.1.401? What do you think?

use_gzip middleware wrong order

Should not "use_gzip" function call be placed before "use_router Router.appRouter"?
As far as I see at this point it is not doing any compression.
I believe it should come after global error handler but before any other middleware.

see also dotnet/AspNetCore.Docs#2516

Update to use .NET version 5 by default

I was going through the Get Started guide for Saturn and noticed that the template uses .NET version 3.1 by default. Would it be better to update this to .NET version 5 at this point?

Template does not build with dotnet --version = 3.0.100

Hello, i followed the Using the template - guide and i got the following error when trying to build via fake build.

System.IO.FileLoadException: Could not load file or assembly 'System.Threading, Version=4.1.0.0, 
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition 
does not match the assembly reference. (Exception from HRESULT: 0x80131040) at 
System.Console.get_Out() at Program.main(String[] argv)

I checked my installed sdk versions (dotnet --info) and found that i have SDK 2.1.802 installed. This is the version that has LTS as listed here. At least as far as i understood.

Then i saw that 2.1.508 was referenced in the global.json file so i downloaded that version and tried to build, but it still failed.

In the end i changed the following files:

  • global.json -> "version": "3.0.100"
  • paket.dependencies -> framework: netcoreapp3.0
  • src/SaturnTemplate/SaturnTemplate.fsproj -> <TargetFramework>netcoreapp3.0</TargetFramework>

With these changes the fake build and fake build -t run command succed.

Now, i am missing a lot of knowledge so i don't know if this is a bug, an missing update or expected behavior and i just did everything wrong. 😅

Consider setting the CurrentDirectory in the template code

Often when an application is run under the ionide debugger, the System.Environment.CurrentDirectory is set to that of the debugging instance, which is somewhere inside the user home. This causes relative-path file lookups, like a bundled sqlite database for example, to fail. Should the template include code to set the System.Environment.CurrentDirectory to the location of the currently-executing assembly(System.Reflection.Assembly.GetExecutingAssembly().Location)? This was inspired by a troubleshooting session I had this morning with a Slack user in #web.

Template Request to support also EF core (ORM)

Could we have a Saturn template with EF core?

https://devblogs.microsoft.com/dotnet/announcing-entity-framework-core-6-0-preview-5-compiled-models/

many .net developers could re-use their pre existing knowledge and this would enlarge the adoption in the aspnet community context ?

EF also has support for many-2-many wheras in dapper this is somehow a bit more troublesome to achieve with "model" transparency (ORM vs micro-orm)

just wondering if that is possible

Unable to setup Saturn on MacOS

Whilst following the 'How to start in 60 seconds' guide, I hit a problem when it's time to run ./build.sh. I received the following error:

➜  SaturnSample ./build.sh
Executing Paket...
paket.lock file found, restoring packages...
./build.sh: line 24: mono: command not found

I have dotnet core installed so I attempted to remove the call to mono on line 24 to be simply be "$@" and ran ./build.sh once again. I then hit ./build.sh: line 24: .paket/paket.exe: cannot execute binary file.

I'm assuming MacOS as possibly Linux aren't currently supported. Are there plans to add support? If so, what would need to be done to allow Saturn's template to work cross platform?

Versions
MacOS - 10.14.3
dotnet - 2.2.100
zsh - 5.3

Update:

I just installed mono and things are working. Perhaps it's worth mentioning that mono is required alongside dotnet. As someone new to dotnet, I thought having dotnet installed would have sufficed. Perhaps this is now simply a documentation issue of required dependencies.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.