-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Assets Build Tool (Assets Manager) #17262
base: main
Are you sure you want to change the base?
Conversation
# Conflicts: # src/OrchardCore.Modules/OrchardCore.AdminDashboard/Assets.json # src/OrchardCore.Modules/OrchardCore.AdminMenu/Assets.json # src/OrchardCore.Modules/OrchardCore.AdminMenu/wwwroot/Scripts/admin-menu-icon-picker.js # src/OrchardCore.Modules/OrchardCore.Media/ResourceManifestOptionsConfiguration.cs # src/OrchardCore.Modules/OrchardCore.Resources/package.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/OrchardCore.Modules/OrchardCore.AdminDashboard/Assets2.json
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.AdminDashboard/Assets2.json
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.AdminMenu/package-lock.json
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Zoltán Lehóczky <[email protected]>
…MS/OrchardCore into skrypt/asset-build-tool
I meant Media Gallery refactor to Vue 3 and typescript. The goal here with this PR was to create a Build tool that would work for building the new Media Gallery in Orchard Core. And that I would be able to use with CI. I did not intent to start refactoring the entire javascript base code of Orchard Core for that matter. So, this is why I did it partially and pushing work on those remaining module for later on. |
I see, I didn't know you were referring to the Media module, OK. |
Adding fontawesome-iconpicker to OC.Resources
…MS/OrchardCore into skrypt/asset-build-tool
Move to .scripts folder for these projects and rename frontend to Bloom.
Was causing issues with Nuget restore and also was automatically executing npm install when cleaning solution and restoring dependencies. We should not use `npm install` but `yarn install` else this will create a package-lock.json file in each folders for nothing. The only thing we need is the main yarn.lock file from the root folder.
.scripts/bloom/package.json
Outdated
@@ -1,5 +1,5 @@ | |||
{ | |||
"name": "@orchardcore/frontend", | |||
"name": "@orchardcore/bloom", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to redo a "yarn" on the root folder to discover the new workspace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure that you have a build.config.mjs file standing at the root of your repository. That's necessary to configure the Assets Manager "watched" folders.
I did a "git clean -xdf" locally on the latest commit of this branch in Windows and could not repro. Else, something is blocking usage of .mjs files on the computer you used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not exactly the same though. Well I think I found the issue. But could not repro.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please pull latest and try again.
yarn build | ||
``` | ||
|
||
## Features |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All I'm really looking for is a simple, clear set of instructions for anybody who wants to contribute changes to existing projects' static assets. This is the overwhelming majority of cases when anybody interacts with Gulp, and will be the case for the new pipeline too. We need something for the diligent people to read before contributing, and something that we can link to for the others.
To be able to close this matter quicker, I took the liberty and added what I'm suggesting to the docs, please check.
src/OrchardCore.Modules/OrchardCore.AdminMenu/Assets/js/admin-menu.js
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Resources/ResourceManagementOptionsConfiguration.cs
Outdated
Show resolved
Hide resolved
.scripts/assets-manager/build.mjs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added docs about this too.
803 files changed 💣 it seems a massive PR :) |
Co-authored-by: Zoltán Lehóczky <[email protected]>
It is. I don't know how much time I spent on this. Hope to be done soon. |
Some extra work for me on Christmas holidays.🎅🏼
Assets Manager
Created by @jptissot
Based on Concurrently and Parcel but can also run Vite and Webpack too. This is a non-opiniated build tool which allows to be extended for any asset compiler/bundler that someone may require.
This build tool essentially uses
Concurrently
instead ofGulp
.Concurrently
, is a concurrent shell runner which allows to trigger any possible shell command. It allows to triggerParcel
,Vite
,Gulp
or any other command that we need for building assets. Everything is written as ES6 modules (.mjs files).Kind of needed for Vue 3 migration because it needs to use either
Vite
orParcel
to build as ES6 modules.Old assets are not compiled as ES6 modules so they don't need these bundlers. For that matter I kept the old gulpfile.js which will be now triggered by
Concurrently
.What needs to be done over time is to migrate these javascript files to ES6 modules (.mjs files or .ts files) so that we can compile them as modules. But that's a migration that will happen over time.
Features
yarn build
yarn build -n module-name
yarn watch -n module-name
.yarn build -g
yarn build -gr
yarn host -n module-name
.yarn clean
. Will also clean parcel-cache folder.yarn build -t tagname
Update
Finally, I'm keeping the old gulp pipeline because there is nothing wrong with it. Also, for backward compatibility with older modules that requires it. I'm using
GulpAssets.json
for the Gulp build tool and usingAssets.json
for the new one. This way, no need to migrate to the new build tool. I'm simply triggeringgulp rebuild
withConcurrently
in the new asset build tool. Because that's what it is essentially, a concurrent shell runner. This way, it is going to be a softer migration for those who already have modules that are built with the old gulp pipeline.Of course, this PR needs to be accepted by community first.
TODO
Modules to migrate:
@jptissot @deanmarcussen @aderderian
Fixes #14169. Related to #15740.