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

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

Open
asynts opened this issue Jan 30, 2020 · 16 comments
Open

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

asynts opened this issue Jan 30, 2020 · 16 comments

Comments

@asynts
Copy link
Contributor

asynts commented Jan 30, 2020

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.

@ranolfi
Copy link
Member

ranolfi commented Jan 30, 2020

Yes!

@luap42
Copy link
Member

luap42 commented Jan 30, 2020

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

@ranolfi
Copy link
Member

ranolfi commented Jan 30, 2020

Latest tagged version or master?

(how bleeding edge is master?) @luap42

@asynts
Copy link
Contributor Author

asynts commented Jan 30, 2020

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.)

@luap42
Copy link
Member

luap42 commented Jan 30, 2020

@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.

@asynts
Copy link
Contributor Author

asynts commented Jan 30, 2020

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.

@luap42
Copy link
Member

luap42 commented Jan 30, 2020

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

@ranolfi
Copy link
Member

ranolfi commented Jan 30, 2020

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.

@misha130
Copy link
Contributor

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.

@ranolfi
Copy link
Member

ranolfi commented Jan 30, 2020

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.

@misha130
Copy link
Contributor

misha130 commented Jan 30, 2020

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

@asynts
Copy link
Contributor Author

asynts commented Jan 30, 2020

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.

@ranolfi
Copy link
Member

ranolfi commented Jan 30, 2020

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

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

and...

@asynts
Copy link
Contributor Author

asynts commented Jan 31, 2020

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!

@ranolfi
Copy link
Member

ranolfi commented Feb 7, 2020

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)"
    

@asynts
Copy link
Contributor Author

asynts commented Mar 25, 2020

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants