Skip to content
This repository has been archived by the owner on Jul 17, 2020. It is now read-only.

Don't include the co-design sources directly. #46

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,7 @@ _Pvt_Extensions

# FAKE - F# Make
.fake/

# Addendum
node_modules/
package-lock.json
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"repository": {
"type": "git",
"url": "https://github.com/codidact/core"
},
"license": "AGPL-3.0-only",
"dependencies": {
"@codidact/co-design": "0.4.0"
}
}
43 changes: 25 additions & 18 deletions src/WebUI/WebUI.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>Codidact.WebUI</RootNamespace>
Copy link
Member

@DoctaJonez DoctaJonez Jan 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand this is larger than the scope of this pull request, but the naming here doesn't follow the recommended pattern of Company.Technology.*. In this case it should be Codidact.Web.UI.

This should be addressed in the coding standards when they get published and ratified. We should fix this as early on in the project as possible, as addressing it later will be more difficult.

I assume there are more problematic namespaces elsewhere in the project.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should fix this as early on in the project as possible, as addressing it later will be more difficult.

I agree, we should address this very quickly. It might already be difficult because we have a few large pull requests.

I'll look for some other locations and create an issue about it.

Copy link
Contributor Author

@asynts asynts Jan 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DoctaJonez I was going through the sources and must say, I am conflicted about whether this is a good idea or not.

Your explicit suggestion doesn't really fit the schema either, because Web isn't really a technology that we develop. I'd say we are creating an QA product, thus Codidact.QA.WebServer would be correct, or something of the sort.

If this schema were applied rigorously it could look like this:

Codidact.QA.WebServer
Codidact.QA.Application
Codidact.QA.Domain
Codidact.QA.Infrastructure
Codidact.QA.AuthServer

This looks better than before but only marginally. Unless there is another big plus that I missed, this doesn't seem to be worth the trouble. (I also renamed WebUI to WebServer and Auth to AuthServer.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your explicit suggestion doesn't really fit the schema either, because Web isn't really a technology that we develop. I'd say we are creating an QA product, thus Codidact.QA.WebServer would be correct, or something of the sort.

WebServer is the wrong word because its not a server for the web. WebUI refers to it being a presentation layer, as in displays stuff in the web.

Also the other projects will be sharing the infrastructure, domain and application projects so when we have an API for instance it will access these projects. So you can't really relate these projects to only QA.

I like this answer personally: https://stackoverflow.com/a/3929357/2490286

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you consider e.g. Infrastructure a project standing on its own? I am confused now.

If we were to add say a blog at codidact.com/blog that is completely independent from the question/answer thing, would these projects have the same infrastructure?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you consider e.g. Infrastructure a project standing on its own? I am confused now.

If we were to add say a blog at codidact.com/blog that is completely independent from the question/answer thing, would these projects have the same infrastructure?

Actually giving it a lot of though these past 10 minutes I agree maybe we should add .QA after the Codidact since if we add a solution like blogging it will want to have its own infrastructure and domain.

Copy link
Contributor Author

@asynts asynts Jan 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to choose a different name though, there was some discussion somewhere about other types of posts, not just questions. I can't think of an umbrella term for it.

Addendum. On the other hand the landing page says "The Open Source Q&A Platform."

Copy link
Member

@DoctaJonez DoctaJonez Feb 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some good thoughts here.

I agree we need to choose an appropriate product name, which would leave the namespace as Codidact.ProductName.*

I had the same thoughts about Codidact.Web.* but for other reasons. Codidact.Web is a valid namespace that we might want to use at some point. Whenever we make utilities or extensions for various Microsoft namespaces, the convention is to mirror Microsoft's namespace, but using our own organisation name. So we may end up with libraries along the lines of:

  • Codidact.Web
  • Codidact.AspNet.WebApi
  • Codidact.Net.Http

I'm not saying we'd definitely need to implement these, just that it would be an appropriate convention, and we don't want to muddle these kinds of libraries with application specific code.

These theoretical libraries could also be exposed as public nuget packages if we feel there's anything useful in there that's worth making available for general consumption.

<AssemblyName>Codidact.WebUI</AssemblyName>
</PropertyGroup>

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>Codidact.WebUI</RootNamespace>
<AssemblyName>Codidact.WebUI</AssemblyName>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Application\Application.csproj" />
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Application\Application.csproj" />
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj" />
</ItemGroup>

<ItemGroup>
<CodesignCssFiles Include="../../node_modules/@codidact/co-design/dist/*" />
<CodesignAssets Include="../../node_modules/@codidact/co-design/assets/**" />
</ItemGroup>

<Target Name="Install co-design" BeforeTargets="Build">
<Exec Command="npm install" />
<Copy SourceFiles="@(CodesignCssFiles)" DestinationFolder="wwwroot/lib/co-design/css" />
<Copy SourceFiles="@(CodesignAssets)" DestinationFolder="wwwroot/lib/co-design/assets/%(RecursiveDir)" />
</Target>
</Project>
1 change: 1 addition & 0 deletions src/WebUI/wwwroot/lib/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
co-design/

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion src/WebUI/wwwroot/lib/co-design/css/codidact.css

This file was deleted.

1 change: 0 additions & 1 deletion src/WebUI/wwwroot/lib/co-design/css/codidact.css.map

This file was deleted.