Skip to content

Commit

Permalink
* Reshuffled to a shallower AssetBundle tree
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Jan 27, 2017
1 parent 6b246e5 commit 44b9186
Show file tree
Hide file tree
Showing 21 changed files with 40 additions and 48 deletions.
2 changes: 1 addition & 1 deletion app/templates/api_version_3_0/src/fields/_Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace <%= pluginVendorName %>\<%= pluginDirName %>\fields;

use <%= pluginVendorName %>\<%= pluginDirName%>\<%= pluginHandle %>;
use <%= pluginVendorName %>\<%= pluginDirName %>\web\assets\_components\fields\<%= fieldName[index] %>AssetBundle;
use <%= pluginVendorName %>\<%= pluginDirName %>\web\_components\fields\<%= fieldName[index] %>AssetBundle;

use Craft;
use craft\base\ElementInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

{% import "_includes/forms" as forms %}

{% do view.registerAssetBundle("<%= pluginVendorName %>\\<%= pluginDirName %>\\web\\assets\\<%= pluginHandle %>AssetBundle") %}
{% do view.registerAssetBundle("<%= pluginVendorName %>\\<%= pluginDirName %>\\web\\<%= pluginHandle %>AssetBundle") %}

{{ forms.textField({
label: 'Some Attribute',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

{% import "_includes/forms" as forms %}

{% do view.registerAssetBundle("<%= pluginVendorName %>\\<%= pluginDirName %>\\web\\assets\\<%= pluginHandle %>AssetBundle") %}
{% do view.registerAssetBundle("<%= pluginVendorName %>\\<%= pluginDirName %>\\web\\<%= pluginHandle %>AssetBundle") %}

{{ forms.textField({
label: 'Message',
Expand Down
2 changes: 1 addition & 1 deletion app/templates/api_version_3_0/src/templates/_settings.twig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

{% import "_includes/forms" as forms %}

{% do view.registerAssetBundle("<%= pluginVendorName %>\\<%= pluginDirName %>\\web\\assets\\<%= pluginHandle %>AssetBundle") %}
{% do view.registerAssetBundle("<%= pluginVendorName %>\\<%= pluginDirName %>\\web\\<%= pluginHandle %>AssetBundle") %}

{{ forms.textField({
label: 'Some Field',
Expand Down
2 changes: 1 addition & 1 deletion app/templates/api_version_3_0/src/utilities/_Utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace <%= pluginVendorName %>\<%= pluginDirName %>\utilities;

use <%= pluginVendorName %>\<%= pluginDirName%>\<%= pluginHandle %>;
use <%= pluginVendorName %>\<%= pluginDirName %>\web\assets\_components\utilities\<%= utilityName[index] %>AssetBundle;
use <%= pluginVendorName %>\<%= pluginDirName %>\web\_components\utilities\<%= utilityName[index] %>AssetBundle;

use Craft;
use craft\base\Utility;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @copyright <%= copyrightNotice %>
*/

namespace <%= pluginVendorName %>\<%= pluginDirName %>\web\assets;
namespace <%= pluginVendorName %>\<%= pluginDirName %>\web;

use <%= pluginVendorName %>\<%= pluginDirName%>\<%= pluginHandle %>;

Expand Down Expand Up @@ -61,7 +61,7 @@ public function init()
<% if ((typeof codeComments !== 'undefined') && (codeComments)) { -%>
// define the path that your publishable resources live
<% } -%>
$this->sourcePath = "@<%= pluginVendorName %>/<%= pluginDirName %>/web/assets/<%= pluginHandle %>";
$this->sourcePath = "@<%= pluginVendorName %>/<%= pluginDirName %>/web/resources";

<% if ((typeof codeComments !== 'undefined') && (codeComments)) { -%>
// define the dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @copyright <%= copyrightNotice %>
*/

namespace <%= pluginVendorName %>\<%= pluginDirName %>\web\assets\_components\fields;
namespace <%= pluginVendorName %>\<%= pluginDirName %>\web\_components\fields;

use <%= pluginVendorName %>\<%= pluginDirName%>\<%= pluginHandle %>;

Expand Down Expand Up @@ -61,7 +61,7 @@ public function init()
<% if ((typeof codeComments !== 'undefined') && (codeComments)) { -%>
// define the path that your publishable resources live
<% } -%>
$this->sourcePath = "@<%= pluginVendorName %>/<%= pluginDirName %>/web/assets/_components/fields/<%= fieldName[index] %>";
$this->sourcePath = "@<%= pluginVendorName %>/<%= pluginDirName %>/web/_components/fields/resources";

<% if ((typeof codeComments !== 'undefined') && (codeComments)) { -%>
// define the dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @copyright <%= copyrightNotice %>
*/

namespace <%= pluginVendorName %>\<%= pluginDirName %>\web\assets\_components\utilities;
namespace <%= pluginVendorName %>\<%= pluginDirName %>\web\_components\utilities;

use <%= pluginVendorName %>\<%= pluginDirName%>\<%= pluginHandle %>;

Expand Down Expand Up @@ -61,7 +61,7 @@ public function init()
<% if ((typeof codeComments !== 'undefined') && (codeComments)) { -%>
// define the path that your publishable resources live
<% } -%>
$this->sourcePath = "@<%= pluginVendorName %>/<%= pluginDirName %>/web/assets/_components/utilities/<%= utilityName[index] %>";
$this->sourcePath = "@<%= pluginVendorName %>/<%= pluginDirName %>/web/_components/utilities/resources";

<% if ((typeof codeComments !== 'undefined') && (codeComments)) { -%>
// define the dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @copyright <%= copyrightNotice %>
*/

namespace <%= pluginVendorName %>\<%= pluginDirName %>\web\assets\_components\widgets;
namespace <%= pluginVendorName %>\<%= pluginDirName %>\web\_components\widgets;

use <%= pluginVendorName %>\<%= pluginDirName%>\<%= pluginHandle %>;

Expand Down Expand Up @@ -61,7 +61,7 @@ public function init()
<% if ((typeof codeComments !== 'undefined') && (codeComments)) { -%>
// define the path that your publishable resources live
<% } -%>
$this->sourcePath = "@<%= pluginVendorName %>/<%= pluginDirName %>/web/assets/_components/widgets/<%= widgetName[index] %>";
$this->sourcePath = "@<%= pluginVendorName %>/<%= pluginDirName %>/web/_components/widgets/resources";

<% if ((typeof codeComments !== 'undefined') && (codeComments)) { -%>
// define the dependencies
Expand Down
2 changes: 1 addition & 1 deletion app/templates/api_version_3_0/src/widgets/_Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace <%= pluginVendorName %>\<%= pluginDirName %>\widgets;

use <%= pluginVendorName %>\<%= pluginDirName%>\<%= pluginHandle %>;
use <%= pluginVendorName %>\<%= pluginDirName %>\web\assets\_components\widgets\<%= widgetName[index] %>AssetBundle;
use <%= pluginVendorName %>\<%= pluginDirName %>\web\_components\widgets\<%= widgetName[index] %>AssetBundle;

use Craft;
use craft\base\Widget;
Expand Down
60 changes: 26 additions & 34 deletions app/templates/target_apis/api_version_3_0.json
Original file line number Diff line number Diff line change
Expand Up @@ -323,29 +323,27 @@
"prefix": false
},
{
"src": "src/web/assets/_components/fields/_AssetBundle.php",
"destDir": "src/web/assets/_components/fields/",
"src": "src/web/_components/fields/_AssetBundle.php",
"destDir": "src/web/_components/fields/",
"dest": "AssetBundle.php",
"requires": ["fieldtypes"],
"subPrefix": "fieldName",
"prefix": false
},
{
"src": "src/web/assets/_components/fields/resources/css/_field.css",
"destDir": "src/web/assets/_components/fields/",
"src": "src/web/_components/fields/resources/css/_field.css",
"destDir": "src/web/_components/fields/resources/css/",
"dest": ".css",
"requires": ["fieldtypes"],
"subPrefix": "fieldName",
"dirSubPrefix": "/css/",
"prefix": false
},
{
"src": "src/web/assets/_components/fields/resources/js/_field.js",
"destDir": "src/web/assets/_components/fields/",
"src": "src/web/_components/fields/resources/js/_field.js",
"destDir": "src/web/_components/fields/resources/js/",
"dest": ".js",
"requires": ["fieldtypes"],
"subPrefix": "fieldName",
"dirSubPrefix": "/js/",
"prefix": false
},
{
Expand Down Expand Up @@ -404,29 +402,27 @@
"prefix": false
},
{
"src": "src/web/assets/_components/utilities/_AssetBundle.php",
"destDir": "src/web/assets/_components/utilities/",
"src": "src/web/_components/utilities/_AssetBundle.php",
"destDir": "src/web/_components/utilities/",
"dest": "AssetBundle.php",
"requires": ["utilities"],
"subPrefix": "utilityName",
"prefix": false
},
{
"src": "src/web/assets/_components/utilities/resources/css/_utility.css",
"destDir": "src/web/assets/_components/utilities/",
"src": "src/web/_components/utilities/resources/css/_utility.css",
"destDir": "src/web/_components/utilities/resources/css/",
"dest": ".css",
"requires": ["utilities"],
"subPrefix": "utilityName",
"dirSubPrefix": "/css/",
"prefix": false
},
{
"src": "src/web/assets/_components/utilities/resources/js/_utility.js",
"destDir": "src/web/assets/_components/utilities/",
"src": "src/web/_components/utilities/resources/js/_utility.js",
"destDir": "src/web/_components/utilities/resources/js/",
"dest": ".js",
"requires": ["utilities"],
"subPrefix": "utilityName",
"dirSubPrefix": "/js/",
"prefix": false
},
{
Expand Down Expand Up @@ -454,29 +450,27 @@
"prefix": false
},
{
"src": "src/web/assets/_components/widgets/_AssetBundle.php",
"destDir": "src/web/assets/_components/widgets/",
"src": "src/web/_components/widgets/_AssetBundle.php",
"destDir": "src/web/_components/widgets/",
"dest": "AssetBundle.php",
"requires": ["widgets"],
"subPrefix": "widgetName",
"prefix": false
},
{
"src": "src/web/assets/_components/widgets/resources/css/_widget.css",
"destDir": "src/web/assets/_components/widgets/",
"src": "src/web/_components/widgets/resources/css/_widget.css",
"destDir": "src/web/_components/widgets/resources/css/",
"dest": ".css",
"requires": ["widgets"],
"subPrefix": "widgetName",
"dirSubPrefix": "/css/",
"prefix": false
},
{
"src": "src/web/assets/_components/widgets/resources/js/_widget.js",
"destDir": "src/web/assets/_components/widgets/",
"src": "src/web/_components/widgets/resources/js/_widget.js",
"destDir": "src/web/_components/widgets/resources/js/",
"dest": ".js",
"requires": ["widgets"],
"subPrefix": "widgetName",
"dirSubPrefix": "/js/",
"prefix": false
},
{
Expand Down Expand Up @@ -508,26 +502,24 @@
"prefix": true
},
{
"src": "src/web/assets/_AssetBundle.php",
"destDir": "src/web/assets/",
"src": "src/web/_AssetBundle.php",
"destDir": "src/web/",
"dest": "AssetBundle.php",
"requires": ["settings"],
"prefix": true
},
{
"src": "src/web/assets/resources/css/_style.css",
"destDir": "src/web/assets/",
"src": "src/web/resources/css/_style.css",
"destDir": "src/web/resources/css/",
"dest": ".css",
"requires": ["settings"],
"dirSubPrefix": "/css/",
"prefix": true
},
{
"src": "src/web/assets/resources/js/_script.js",
"destDir": "src/web/assets/",
"src": "src/web/resources/js/_script.js",
"destDir": "src/web/resources/js/",
"dest": ".js",
"requires": ["settings"],
"dirSubPrefix": "/js/",
"prefix": true
}
],
Expand All @@ -539,11 +531,11 @@
"src": "src/icon.svg"
},
{
"src": "src/web/assets/img/plugin.png",
"src": "src/web/resources/img/plugin.png",
"requires": ["settings"]
},
{
"src": "src/web/assets/img/plugin_logo.png"
"src": "src/web/resources/img/plugin_logo.png"
}
],
"END_INSTALL_COMMANDS": [
Expand Down

0 comments on commit 44b9186

Please sign in to comment.