Skip to content

CO-1900_Use_a_package_manager_to_manage_front-end_libraries-resources #34

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 25 additions & 2 deletions app/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
"cakephp/cakephp": "^4.3",
"cakephp/migrations": "^3.2",
"cakephp/plugin-installer": "^1.3",
"components/jquery": "~3.6.0",
"doctrine/dbal": "^3.1",
"mobiledetect/mobiledetectlib": "^2.8"
"mobiledetect/mobiledetectlib": "^2.8",
"twbs/bootstrap": "^5.1"
},
"require-dev": {
"cakephp/bake": "^2.6",
Expand Down Expand Up @@ -39,7 +41,28 @@
}
},
"scripts": {
"post-install-cmd": "App\\Console\\Installer::postInstall",
"post-install-cmd": [
"App\\Console\\Installer::postInstall",

"php -r \"if(!is_dir('webroot/js/jquery/')) { mkdir('webroot/js/jquery/', 0755, true); }\"",
"php -r \"if(!is_dir('webroot/js/bootstrap/')) { mkdir('webroot/js/bootstrap/', 0755, true); }\"",

"php -r \"if(!is_dir('webroot/css/bootstrap/')) { mkdir('webroot/css/bootstrap/', 0755, true); }\"",

"php -r \"copy('vendor/components/jquery/jquery.min.js', 'webroot/js/jquery/jquery.min.js');\"",
"php -r \"copy('vendor/twbs/bootstrap/dist/js/bootstrap.bundle.min.js', 'webroot/js/bootstrap/bootstrap.bundle.min.js');\"",
"php -r \"copy('vendor/twbs/bootstrap/dist/css/bootstrap.min.css', 'webroot/css/bootstrap/bootstrap.min.css');\""
],
"post-update-cmd": [
"php -r \"if(!is_dir('webroot/js/jquery/')) { mkdir('webroot/js/jquery/', 0755, true); }\"",
"php -r \"if(!is_dir('webroot/js/bootstrap/')) { mkdir('webroot/js/bootstrap/', 0755, true); }\"",

"php -r \"if(!is_dir('webroot/css/bootstrap/')) { mkdir('webroot/css/bootstrap/', 0755, true); }\"",

"php -r \"copy('vendor/components/jquery/jquery.min.js', 'webroot/js/jquery/jquery.min.js');\"",
"php -r \"copy('vendor/twbs/bootstrap/dist/js/bootstrap.bundle.min.js', 'webroot/js/bootstrap/bootstrap.bundle.min.js');\"",
"php -r \"copy('vendor/twbs/bootstrap/dist/css/bootstrap.min.css', 'webroot/css/bootstrap/bootstrap.min.css');\""
],
"post-create-project-cmd": "App\\Console\\Installer::postInstall",
"check": [
"@test",
Expand Down
52 changes: 51 additions & 1 deletion app/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions app/templates/layout/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

<!-- Load CSS -->
<?= $this->Html->css([
'bootstrap/bootstrap-5.0.2.min',
'bootstrap/bootstrap.min',
'co-color',
'co-base',
'co-responsive'
Expand Down Expand Up @@ -168,8 +168,8 @@

<!-- Load Javascript -->
<?= $this->Html->script([
'jquery/jquery-3.6.0.min.js',
'bootstrap/bootstrap-5.0.2.bundle.min.js',
'jquery/jquery.min.js',
'bootstrap/bootstrap.bundle.min.js',
'js-cookie/js.cookie-2.1.3.min.js',
'jquery/noty/jquery.noty.js',
'jquery/noty/layouts/topCenter.js',
Expand Down
14 changes: 14 additions & 0 deletions app/vendor/components/jquery/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
jQuery Component
================

Shim [repository](https://github.com/components/jquery) for the [jQuery](http://jquery.com).

If you're looking for jquery-migrate: It got it's [own repository](https://github.com/components/jquery-migrate) since jQuery v3.0.0.

Package Managers
----------------

* [Bower](http://bower.io/): `jquery`
* [Component](https://github.com/component/component): `components/jquery`
* [Composer](http://packagist.org/packages/components/jquery): `components/jquery`
* [spm](http://spmjs.io/package/jquery): `jquery`
16 changes: 16 additions & 0 deletions app/vendor/components/jquery/bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "jquery",
"version": "3.5.1",
"description": "jQuery component",
"license": "MIT",
"keywords": [
"jquery",
"component"
],
"main": "jquery.js",
"ignore": [
"component.json",
"package.json",
"composer.json"
]
}
22 changes: 22 additions & 0 deletions app/vendor/components/jquery/component.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "jquery",
"repo": "components/jquery",
"version": "3.5.1",
"description": "jQuery component",
"license": "MIT",
"keywords": [
"jquery",
"component"
],
"main": "jquery.js",
"scripts": [
"jquery.js",
"jquery.min.js",
"jquery.slim.js",
"jquery.slim.min.js"
],
"files": [
"jquery.min.map",
"jquery.slim.min.map"
]
}
34 changes: 34 additions & 0 deletions app/vendor/components/jquery/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "components/jquery",
"description": "jQuery JavaScript Library",
"type": "component",
"homepage": "http://jquery.com",
"license": "MIT",
"support": {
"irc": "irc://irc.freenode.org/jquery",
"issues": "https://github.com/jquery/jquery/issues",
"forum": "http://forum.jquery.com",
"wiki": "http://docs.jquery.com/",
"source": "https://github.com/jquery/jquery"
},
"authors": [
{
"name": "JS Foundation and other contributors",
"url": "https://github.com/jquery/jquery/blob/master/AUTHORS.txt"
}
],
"extra": {
"component": {
"scripts": [
"jquery.js"
],
"files": [
"jquery.min.js",
"jquery.min.map",
"jquery.slim.js",
"jquery.slim.min.js",
"jquery.slim.min.map"
]
}
}
}
Loading