tomfulton / grunt-umbraco-package Goto Github PK
View Code? Open in Web Editor NEWA grunt task to automate the creation of installable Umbraco packages from your files.
License: MIT License
A grunt task to automate the creation of installable Umbraco packages from your files.
License: MIT License
..\\
=> ../
?
In the latest versions of Umbraco, I think when the new packager was implemented in developer section, the package.xml has a iconUrl, which is used when uploading a local package (.zip) in Umbraco backoffice.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<umbPackage>
<files />
<info>
<package>
<name>Test</name>
<version>1.0.0</version>
<iconUrl />
<license url="http://opensource.org/licenses/MIT">MIT License</license>
<url>http://our.umbraco.org</url>
<requirements type="strict">
<major>7</major>
<minor>5</minor>
<patch>9</patch>
</requirements>
</package>
<author>
<name>Bjarne Fyrstenborg</name>
<website>www.bjarnefyrstenborg.dk</website>
</author>
<readme><![CDATA[]]></readme>
</info>
<DocumentTypes />
<Templates />
<Stylesheets />
<Macros />
<DictionaryItems />
<Languages />
<DataTypes />
</umbPackage>
It seems it is not possible via the options object to specify the requirements (minimum Umbraco version). It just set requirements to 0.0.0
grunt-umbraco-package/tasks/umbraco_package.js
Lines 117 to 121 in d1dc982
When creating a package from Umbraco backoffice it set the requirements (default to Umbraco version in which the package is created).
<requirements type="strict">
<major>7</major>
<minor>5</minor>
<patch>9</patch>
</requirements>
It would be great to add an object to handle this from json config, e.g.
{
"name": "Switcher",
"description": "Switcher for Umbraco 7",
"directory": "Switcher",
"version": "1.0.3",
"requirements": {
"major": 7,
"minor": 5,
"patch": 0
},
"url": "https://github.com/bjarnef/Switcher",
"author": "Bjarne Fyrstenborg",
"authorUrl": "https://github.com/bjarnef",
"license": "MIT",
"licenseUrl": "http://opensource.org/licenses/MIT",
"readme": "Switcher is a simple property editor that works as an alternative to the core true/false datatype. It can be used for different kinds of true/false values e.g. on/off, active/deactive or enabled/disabled and gives a more visual feedback to the content editor. Furthermore it is great for content editors, who edit content from tablets, where the switch-button is touch friendly."
}
How to reproduce.
Reason: orgPath is empty for files at the root:
`
<file>
<guid>myfile.html</guid>
<orgPath></orgPath>
<orgName>myfile.html</orgName>
</file>
`
Fix: Files added at the root need a slash:
`
<file>
<guid>myfile.html</guid>
<orgPath>/</orgPath>
<orgName>myfile.html</orgName>
</file>
`
The specific error is this:
2017-07-03 10:54:42,824 [P6248/D2/T34] ERROR umbraco.cms.businesslogic.packager.Installer - Error importing file E:\Temp\UmbracoCms.7.6.3\App_Data\97508966-55a6-4fbd-ba69-35d4df4ef3dd.umb
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at umbraco.cms.businesslogic.packager.Installer.GetFileName(String path, String fileName)
at umbraco.cms.businesslogic.packager.Installer.LoadConfig(String tempDir)
at umbraco.cms.businesslogic.packager.Installer.Import(String inputFile, Boolean deleteFile)
2017-07-03 10:54:42,824 [P6248/D2/T34] ERROR Umbraco.Web.WebApi.Filters.FileUploadCleanupFilterAttribute - Could not acquire actionExecutedContext.Response.Content
System.NullReferenceException: Object reference not set to an instance of an object.
at Umbraco.Web.WebApi.Filters.FileUploadCleanupFilterAttribute.OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
Hi Tom,
Great initiative creating this package :D
I'm not sure whether I have done something wrong, but I've tried following the instructions from the readme file.
My main problem is that when referencing my package.xml file, it seems to be copied 1:1 to the ZIP file, and the <files />
element in the XML remains empty, even though the files of my package are added to the ZIP file. Values like the name and version specified in the Grunt config aren't added to the manifest either.
I also experience a few other issues:
Since I couldn't get this to work, I've created a new Grunt task roughly based on this one. Should I create a pull request with my changes, or just create a new, similar package?
My task will take the same configuration as yours - except the manifest
option - and then automatically generate the entire manifest. This however doesn't take extra resources like document types, templates and similar into consideration, but that could be added as well.
I have a few files that get corrupted by adm-zip. From what I understand the only npm package to reliably zip all files is node-archiver. Any chance this can be switched out?
One one of my projects, I recently added a package action that gives the user installing the package permission to see the section added by that package: rhythmagency/formulate@ae20953
I was thinking of using grunt-umbraco-package to create the Umbraco package so I don't have to do it manually every time I create a release. However, I didn't see any documentation that indicated it was possible to add package actions with this tool, so I'll have to go the manual route for now.
Would be awesome if you added support for package actions to be included.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.