core icon indicating copy to clipboard operation
core copied to clipboard

Use submodule for Codesign, don't include the sources.

Open asynts opened this issue 5 years ago • 16 comments

Currently, a copy of the Codesign implementation sits in src/WebUI/wwwroot/lib/co-design. This should be a submodule, or maybe a ~~subtree~~ worktree?

I'm on it.

asynts avatar Jan 30 '20 10:01 asynts

Yes!

ranolfi avatar Jan 30 '20 10:01 ranolfi

Not sure, whether and how it can be done, but ideally you would always link/include the latest version.

luap42 avatar Jan 30 '20 11:01 luap42

Latest tagged version or master?

(how bleeding edge is master?) @luap42

ranolfi avatar Jan 30 '20 11:01 ranolfi

What I was thinking about was to setup a submodule somewhere, e.g. Dependencies/co-design and then have msbuild copy the files into wwwroot/lib/co-design before starting the application. I did something similar in this project.

The question is whether the dist folder is kept up-to-date or if the build script would have to run the SCSS compiler first. In that case #31 would be blocking this, because otherwise the install instructions and the project would get out of sync. (People would have to install a SCSS compiler.)

asynts avatar Jan 30 '20 12:01 asynts

@ranolfi master is equivalent to the most up-to-date released version and equivalent to the live website. Differences would only be if the app compiles at the exact moment between merging into master and tagging. Develop contains not-yet-live stuff.

luap42 avatar Jan 30 '20 12:01 luap42

I have this mostly completed in asynts/codidact-core:asynts/45/use-submodule-for-codesign, just need to test this (can't do this now). I'll create a pull request later.

asynts avatar Jan 30 '20 12:01 asynts

BTW Co-Design is now available on npm, which might simplify this a bit:

(Source code) https://unpkg.com/@codidact/[email protected]/dist/codidact.css

(Registry) https://www.npmjs.com/package/@codidact/co-design

luap42 avatar Jan 30 '20 14:01 luap42

Core is not using npm for anything else so far, right? Would you be able to make a NuGet package instead? That'd be the canonical way of managing dependencies for .NET projects and solutions.

ranolfi avatar Jan 30 '20 19:01 ranolfi

Core is not using npm for anything else so far, right? Would you be able to make a NuGet package instead? That'd be the canonical way of managing dependencies for .NET projects and solutions.

That would not be the canonical way of managing FRONTEND dependencies. NPM is advisable. Please don't do this.

misha130 avatar Jan 30 '20 19:01 misha130

I don't agree. Why adding yet another package management dependency to the build process... for this?

Bootstrap, jQuery, Modernizr and dozens of other "frontend" packages, including fonts, are available from NuGet and included by default in Microsoft's sample projects.

ranolfi avatar Jan 30 '20 19:01 ranolfi

I don't agree. Why adding yet another package management dependency to the build process... for this?

Bootstrap, jQuery, Modernizr and dozens of other "frontend" packages, including fonts, are available from NuGet and included by default in Microsoft's sample projects.

  1. The older sample projects use NuGet as the package manager. All the newer ones use npm. They even improved the support for it.
  2. If you want to include in the future, any extra package like a SCSS compiler or babel - it wont be in NuGet. In fact most of the things are not on NuGet
  3. Configuring Task runner with NuGet is a bit of trouble. All their current documentation suggests to use npm https://docs.microsoft.com/en-us/aspnet/core/client-side/using-grunt?view=aspnetcore-3.1

misha130 avatar Jan 30 '20 19:01 misha130

Core is not using npm for anything else so far, right? Would you be able to make a NuGet package instead? That'd be the canonical way of managing dependencies for .NET projects and solutions.

@ranolfi I was about to point out the same thing, then I found this:

https://stackoverflow.com/q/57038463/8746648

I couldn't find an official source for this, but it seems like NuGet isn't meant for this.

asynts avatar Jan 30 '20 19:01 asynts

Interesting, it seems I stand corrected. Thanks, fellows.

May I drop some additional references here for my future self?

  • https://stackoverflow.com/questions/49208056/how-to-use-npm-and-install-packages-inside-visual-studio-2017

and...

  • https://www.nuget.org/packages/Npm/ =)

ranolfi avatar Jan 30 '20 20:01 ranolfi

https://www.nuget.org/packages/Npm/

@ranolfi It would be really nice if it were possible to install npm with the NuGet package manager, however, that NuGet package you linked was last updated in 2015. It's too good to be true!

asynts avatar Jan 31 '20 08:01 asynts

I've put forward a request/suggestion for @luap42 to make the necessary adjustments to co-design so that annotated tags can be maintained from there in the form of dist/<version> (1), and pulled here as a subtree (2).

The relevant steps are:

  1. (from 'co-design')

    git checkout tags/v0.4.0
    git subtree split -b dist --prefix=dist
    git checkout dist
    git tag -a "dist/v0.4.0" -m "deliverables for v0.4.0 from 149073b7"
    git push --tags
    git branch -D dist
    
  2. (from 'core')

    git subtree add --prefix src/WebUI/wwwroot/deps/co-design [email protected]:codidact/co-design.git dist/v0.4.0 --squash -m "Add 'co-design' dependency as a git subtree (@tags/dist/v0.4.0)"
    

ranolfi avatar Feb 07 '20 07:02 ranolfi

https://github.com/codidact/authentication/pull/9#discussion_r398059024

asynts avatar Mar 25 '20 20:03 asynts