Skip to content

Commit 5a1d7a3

Browse files
committed
setup cleanup, adjust readme and other cleanups
1 parent d41cc92 commit 5a1d7a3

9 files changed

Lines changed: 255 additions & 160 deletions

File tree

README.md

Lines changed: 19 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,43 @@
1-
# CakePHP Application Skeleton
1+
# plugins.cakephp.org
22

3-
![Build Status](https://github.com/cakephp/app/actions/workflows/ci.yml/badge.svg?branch=5.x)
4-
[![PHPStan](https://img.shields.io/badge/PHPStan-level%208-brightgreen.svg?style=flat-square)](https://github.com/phpstan/phpstan)
3+
This repository contains the code responsible for https://plugins.cakephp.org
54

6-
An application skeleton for creating applications with [CakePHP](https://cakephp.org) 5.x. and [tailwind](https://tailwindcss.com)
5+
## Starting local development
76

8-
The framework source code can be found here: [cakephp/cakephp](https://github.com/cakephp/cakephp).
7+
You need [DDEV](https://docs.ddev.com/en/stable/) installed and configured on your machine.
98

10-
## Requierements
9+
After that start the app via `ddev start`
1110

12-
1. PHP >= 8.1
13-
2. NodeJS ^20.19.0 || >=22.12.0
14-
3. NPM >=8.0.0
15-
16-
## Installation
17-
18-
1. Download [Composer](https://getcomposer.org/doc/00-intro.md) or update `composer self-update`.
19-
2. Run `php composer.phar create-project --prefer-dist cakephp/app-tailwind [app_name]`.
20-
21-
If Composer is installed globally, run
11+
Next you need to apply migrations to create the database tables:
2212

2313
```bash
24-
composer create-project --prefer-dist cakephp/app-tailwind myapp
14+
ddev exec bin/cake migrations migrate
15+
ddev exec bin/cake migrations migrate -p Tags
2516
```
2617

27-
To use the latest commit:
18+
After that you can perform a fresh sync via
2819

2920
```bash
30-
composer create-project cakephp/app-tailwind tailwind -s dev
21+
ddev exec bin/cake sync_packages
3122
```
3223

33-
Next, install [tailwind](https://tailwindcss.com/docs) and [vite](https://vite.dev/guide/)
34-
with npm:
24+
With that you should now see what is currently on the production site.
3525

36-
```bash
37-
npm install
38-
```
26+
## Cleaning up tables
3927

40-
## Running a development server
41-
42-
You can run both a PHP development server, and tailwind with on-demand rebuilds using:
28+
If you want to clean up package data, you can run the following command:
4329

4430
```bash
45-
bin/cake devserver
31+
ddev exec bin/cake clean
4632
```
4733

48-
Then visit `http://localhost:8765` to see the welcome page. If you already have
49-
a webserver that supports PHP, you can run the tailwind compiler on its own
50-
with:
51-
52-
```bash
53-
npm run dev
54-
```
34+
## Start with a fresh DB
5535

56-
## Building for production
57-
58-
To build CSS assets for production, use:
36+
If you want to start with a fresh DB, you can run the following command:
5937

6038
```bash
61-
npm run build
39+
ddev exec -s db mysql -uroot -proot -e "DROP DATABASE IF EXISTS db; CREATE DATABASE db;"
6240
```
6341

64-
## Bake templates
65-
66-
This application skeleton contains a [bake
67-
templates](https://book.cakephp.org/bake/3/en/development.html#application-bake-templates)
68-
and helper templates that produce HTML using tailwind utility classes. You can
69-
and should adapt these templates to fit the needs of your application.
70-
71-
## Demo app
72-
73-
Check out the [5.x-demo branch](https://github.com/cakephp/app-tailwind/tree/5.x-demo), which contains demo migrations and a seeder.
74-
See the [README](https://github.com/cakephp/app-tailwind/blob/5.x-demo/README.md) on how to get it running.
75-
76-
## Update
77-
78-
Since this skeleton is a starting point for your application and various files
79-
would have been modified as per your needs, there isn't a way to provide
80-
automated upgrades, so you have to do any updates manually.
81-
82-
## Configuration
83-
84-
Read and edit the environment specific `config/app_local.php` and set up the
85-
`'Datasources'` and any other configuration relevant for your application.
86-
Other environment agnostic settings can be changed in `config/app.php`.
42+
> [!NOTE]
43+
> Don't forget to apply migrations again.

config/.env.ddev

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ export DATABASE_URL="mysql://db:db@db:3306/db"
3636
# Uncomment these to define logging configuration via environment variables.
3737
#export LOG_DEBUG_URL="file:///path/to/logs/?levels[]=notice&levels[]=info&levels[]=debug&file=debug"
3838
#export LOG_ERROR_URL="file:///path/to/logs/?levels[]=warning&levels[]=error&levels[]=critical&levels[]=alert&levels[]=emergency&file=error"
39+
export APP_FULL_BASE_URL="https://plugins.cakephp.org.ddev.site"
3940
export DEBUG_KIT_SAFE_TLD="site"
211 Bytes
Binary file not shown.

reset_db.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

resources/css/fonts.css

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/* cyrillic-ext */
2+
@font-face {
3+
font-family: 'Raleway';
4+
font-style: normal;
5+
font-weight: 400;
6+
src: url('../font/raleway-400-cyrillic-ext.woff2') format('woff2');
7+
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
8+
}
9+
/* cyrillic */
10+
@font-face {
11+
font-family: 'Raleway';
12+
font-style: normal;
13+
font-weight: 400;
14+
src: url('../font/raleway-400-cyrillic.woff2') format('woff2');
15+
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
16+
}
17+
/* vietnamese */
18+
@font-face {
19+
font-family: 'Raleway';
20+
font-style: normal;
21+
font-weight: 400;
22+
src: url('../font/raleway-400-vietnamese.woff2') format('woff2');
23+
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
24+
}
25+
/* latin-ext */
26+
@font-face {
27+
font-family: 'Raleway';
28+
font-style: normal;
29+
font-weight: 400;
30+
src: url('../font/raleway-400-latin-ext.woff2') format('woff2');
31+
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
32+
}
33+
/* latin */
34+
@font-face {
35+
font-family: 'Raleway';
36+
font-style: normal;
37+
font-weight: 400;
38+
src: url('../font/raleway-400-latin.woff2') format('woff2');
39+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
40+
}
41+
/* cyrillic-ext */
42+
@font-face {
43+
font-family: 'Raleway';
44+
font-style: normal;
45+
font-weight: 700;
46+
src: url('../font/raleway-700-cyrillic-ext.woff2') format('woff2');
47+
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
48+
}
49+
/* cyrillic */
50+
@font-face {
51+
font-family: 'Raleway';
52+
font-style: normal;
53+
font-weight: 700;
54+
src: url('../font/raleway-700-cyrillic.woff2') format('woff2');
55+
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
56+
}
57+
/* vietnamese */
58+
@font-face {
59+
font-family: 'Raleway';
60+
font-style: normal;
61+
font-weight: 700;
62+
src: url('../font/raleway-700-vietnamese.woff2') format('woff2');
63+
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
64+
}
65+
/* latin-ext */
66+
@font-face {
67+
font-family: 'Raleway';
68+
font-style: normal;
69+
font-weight: 700;
70+
src: url('../font/raleway-700-latin-ext.woff2') format('woff2');
71+
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
72+
}
73+
/* latin */
74+
@font-face {
75+
font-family: 'Raleway';
76+
font-style: normal;
77+
font-weight: 700;
78+
src: url('../font/raleway-700-latin.woff2') format('woff2');
79+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
80+
}
81+
82+
@font-face {
83+
font-family: 'cakefont';
84+
src: url('../font/cakedingbats-webfont.eot');
85+
src: url('../font/cakedingbats-webfont.eot?#iefix') format('embedded-opentype'),
86+
url('../font/cakedingbats-webfont.woff2') format('woff2'),
87+
url('../font/cakedingbats-webfont.woff') format('woff'),
88+
url('../font/cakedingbats-webfont.ttf') format('truetype'),
89+
url('../font/cakedingbats-webfont.svg#cake_dingbatsregular') format('svg');
90+
font-weight: normal;
91+
font-style: normal;
92+
}

resources/css/style.css

Lines changed: 1 addition & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,5 @@
11
@import "tailwindcss";
2-
3-
/* cyrillic-ext */
4-
@font-face {
5-
font-family: 'Raleway';
6-
font-style: normal;
7-
font-weight: 400;
8-
src: url('../font/raleway-400-cyrillic-ext.woff2') format('woff2');
9-
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
10-
}
11-
/* cyrillic */
12-
@font-face {
13-
font-family: 'Raleway';
14-
font-style: normal;
15-
font-weight: 400;
16-
src: url('../font/raleway-400-cyrillic.woff2') format('woff2');
17-
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
18-
}
19-
/* vietnamese */
20-
@font-face {
21-
font-family: 'Raleway';
22-
font-style: normal;
23-
font-weight: 400;
24-
src: url('../font/raleway-400-vietnamese.woff2') format('woff2');
25-
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
26-
}
27-
/* latin-ext */
28-
@font-face {
29-
font-family: 'Raleway';
30-
font-style: normal;
31-
font-weight: 400;
32-
src: url('../font/raleway-400-latin-ext.woff2') format('woff2');
33-
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
34-
}
35-
/* latin */
36-
@font-face {
37-
font-family: 'Raleway';
38-
font-style: normal;
39-
font-weight: 400;
40-
src: url('../font/raleway-400-latin.woff2') format('woff2');
41-
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
42-
}
43-
/* cyrillic-ext */
44-
@font-face {
45-
font-family: 'Raleway';
46-
font-style: normal;
47-
font-weight: 700;
48-
src: url('../font/raleway-700-cyrillic-ext.woff2') format('woff2');
49-
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
50-
}
51-
/* cyrillic */
52-
@font-face {
53-
font-family: 'Raleway';
54-
font-style: normal;
55-
font-weight: 700;
56-
src: url('../font/raleway-700-cyrillic.woff2') format('woff2');
57-
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
58-
}
59-
/* vietnamese */
60-
@font-face {
61-
font-family: 'Raleway';
62-
font-style: normal;
63-
font-weight: 700;
64-
src: url('../font/raleway-700-vietnamese.woff2') format('woff2');
65-
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
66-
}
67-
/* latin-ext */
68-
@font-face {
69-
font-family: 'Raleway';
70-
font-style: normal;
71-
font-weight: 700;
72-
src: url('../font/raleway-700-latin-ext.woff2') format('woff2');
73-
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
74-
}
75-
/* latin */
76-
@font-face {
77-
font-family: 'Raleway';
78-
font-style: normal;
79-
font-weight: 700;
80-
src: url('../font/raleway-700-latin.woff2') format('woff2');
81-
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
82-
}
2+
@import "fonts.css";
833

844
@theme {
855
--font-raleway: "Raleway", sans-serif;
@@ -88,18 +8,6 @@
888

899
/* Styling for default app homepage */
9010

91-
@font-face {
92-
font-family: 'cakefont';
93-
src: url('../font/cakedingbats-webfont.eot');
94-
src: url('../font/cakedingbats-webfont.eot?#iefix') format('embedded-opentype'),
95-
url('../font/cakedingbats-webfont.woff2') format('woff2'),
96-
url('../font/cakedingbats-webfont.woff') format('woff'),
97-
url('../font/cakedingbats-webfont.ttf') format('truetype'),
98-
url('../font/cakedingbats-webfont.svg#cake_dingbatsregular') format('svg');
99-
font-weight: normal;
100-
font-style: normal;
101-
}
102-
10311
.bullet:before {
10412
font-family: 'cakefont', sans-serif;
10513
font-size: 18px;

src/Command/CleanCommand.php

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
namespace App\Command;
5+
6+
use Cake\Command\Command;
7+
use Cake\Console\Arguments;
8+
use Cake\Console\ConsoleIo;
9+
10+
/**
11+
* Clean command.
12+
*/
13+
class CleanCommand extends Command
14+
{
15+
/**
16+
* The name of this command.
17+
*
18+
* @var string
19+
*/
20+
protected string $name = 'clean';
21+
22+
/**
23+
* Get the default command name.
24+
*
25+
* @return string
26+
*/
27+
public static function defaultName(): string
28+
{
29+
return 'clean';
30+
}
31+
32+
/**
33+
* Get the command description.
34+
*
35+
* @return string
36+
*/
37+
public static function getDescription(): string
38+
{
39+
return 'Truncate all packages from the database.';
40+
}
41+
42+
/**
43+
* Implement this method with your command's logic.
44+
*
45+
* @param \Cake\Console\Arguments $args The command arguments.
46+
* @param \Cake\Console\ConsoleIo $io The console io
47+
* @return int|null|void The exit code or null for success
48+
*/
49+
public function execute(Arguments $args, ConsoleIo $io)
50+
{
51+
$confirmation = $io->ask(
52+
'Are you sure you want to clean all packages data and related tags? This action cannot be undone. (yes/no)',
53+
);
54+
if (strtolower($confirmation) !== 'yes' && strtolower($confirmation) !== 'y') {
55+
$io->out('Aborting.');
56+
57+
return;
58+
}
59+
60+
$packagesTable = $this->fetchTable('Packages');
61+
$allPackages = $packagesTable->find()->all();
62+
63+
foreach ($allPackages as $package) {
64+
$packagesTable->delete($package);
65+
}
66+
}
67+
}

0 commit comments

Comments
 (0)