Hello all,
I am currently reworking the existing Umbraco Yeoman Generator aka yo umbraco, which is a command line tool for rapid scaffolding.
This generates AngularJS controller & view, along with the package.manifest file for Umbraco to pick up your new custom editor/s in the backoffice.
This also creates a GruntFile.js that you can use to concat all your JavaScript files, along with compiling Less to CSS and other tasks such as running Karma tests
Currently the grunt task relies on copying the main Umbraco JS files from your Umbraco website in order to run the tests, however I personally think it may be nicer to get these JS files from a front end package library be it NPM or Bower.
I am undecided on either at the moment, as NPM is more designed for NodeJS utility/scripts & Bower is probably a better fit for copying JS, CSS files and similar down but Bower is designed for these resources to be used in public facing websites and you will never reference these files in your own HTML files yourself, unlike a library such as jQuery which you may retrieve via Bower.
So my question is what is the best thing to do, as it would be good to have a nice workflow for this and to ensure you are testing your AngularJS editors against the expected version of Umbraco.
Hello all,
I have thought about this more and the best approach is for this to be available via Bower.
With the bower JSON file that they Umbraco HQ guys need to put in the repo we can use the GitIgnore formatting rules to ignore all the other files in the repo so we only download the JS files for testing from the repo.
Here is a very rough WIP bower.json file. I need to speak with someone at the Umbraco HQ, ideally Shannon or Per about what files from the repo need to be bower for the JS files to test against.
{
"name": "Umbraco",
"version": "7.2.0",
"homepage": "https://github.com/warrenbuckley/Umbraco-CMS",
"authors": [
{ "name": "Umbraco HQ", "homepage": "http://umbraco.com" }
],
"description": "The Javascript files of the Umbraco backoffice used to test against only. This is not for public consumption",
"main": [
"src/Umbraco.Web.Ui.Client/src/app.js",
"some-other-file.js"
],
"keywords": [
"Umbraco",
"Umbraco CMS",
"CMS"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"!src/Umbraco.Web.Ui.Client/src/**/*.js"
],
"private": true
}
OK got the ignore rules down after various testing on my machine.
I just need to get ahold of the Umbraco guys to figure out what JS files needed to be used/copied running tests against.
{
"name": "Umbraco",
"version": "7.2.0",
"homepage": "https://github.com/warrenbuckley/Umbraco-CMS",
"authors": [
{ "name": "Umbraco HQ", "homepage": "http://umbraco.com" }
],
"description": "The Javascript files of the Umbraco backoffice used to test against only. This is not for public consumption",
"main": [
"src/Umbraco.Web.UI.Client/src/app.js"
],
"keywords": [
"Umbraco",
"Umbraco CMS",
"CMS"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"/*",
"!/src",
"/src/*",
"/src/Umbraco.Web.UI.Client/src/*",
"!/src/Umbraco.Web.UI.Client/src/**/*.js"
],
"private": true
}
Umbraco JS Jasmine Tests
Hello all, I am currently reworking the existing Umbraco Yeoman Generator aka yo umbraco, which is a command line tool for rapid scaffolding.
This generates AngularJS controller & view, along with the package.manifest file for Umbraco to pick up your new custom editor/s in the backoffice.
This also creates a GruntFile.js that you can use to concat all your JavaScript files, along with compiling Less to CSS and other tasks such as running Karma tests
Currently the grunt task relies on copying the main Umbraco JS files from your Umbraco website in order to run the tests, however I personally think it may be nicer to get these JS files from a front end package library be it NPM or Bower.
I am undecided on either at the moment, as NPM is more designed for NodeJS utility/scripts & Bower is probably a better fit for copying JS, CSS files and similar down but Bower is designed for these resources to be used in public facing websites and you will never reference these files in your own HTML files yourself, unlike a library such as jQuery which you may retrieve via Bower.
So my question is what is the best thing to do, as it would be good to have a nice workflow for this and to ensure you are testing your AngularJS editors against the expected version of Umbraco.
So what is everyone thoughts?
Cheers,
Warren
Hello all,
I have thought about this more and the best approach is for this to be available via Bower.
With the bower JSON file that they Umbraco HQ guys need to put in the repo we can use the GitIgnore formatting rules to ignore all the other files in the repo so we only download the JS files for testing from the repo.
Here is a very rough WIP bower.json file. I need to speak with someone at the Umbraco HQ, ideally Shannon or Per about what files from the repo need to be bower for the JS files to test against.
OK got the ignore rules down after various testing on my machine.
I just need to get ahold of the Umbraco guys to figure out what JS files needed to be used/copied running tests against.
is working on a reply...