Skip to content

Commit 7634229

Browse files
authored
Docs folder standardization and other fixes (#78)
1 parent 3b0b750 commit 7634229

File tree

15 files changed

+180
-29
lines changed

15 files changed

+180
-29
lines changed

LICENSE.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
Copyright © 2008 by Yii Software (https://www.yiiframework.com/)
1+
Copyright © 2008 by Yii Software (<https://www.yiiframework.com/>)
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without
55
modification, are permitted provided that the following conditions
66
are met:
77

8-
* Redistributions of source code must retain the above copyright
8+
* Redistributions of source code must retain the above copyright
99
notice, this list of conditions and the following disclaimer.
10-
* Redistributions in binary form must reproduce the above copyright
10+
* Redistributions in binary form must reproduce the above copyright
1111
notice, this list of conditions and the following disclaimer in
1212
the documentation and/or other materials provided with the
1313
distribution.
14-
* Neither the name of Yii Software nor the names of its
14+
* Neither the name of Yii Software nor the names of its
1515
contributors may be used to endorse or promote products derived
1616
from this software without specific prior written permission.
1717

README.md

+29-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
This is a monorepo for Yii Development Panel and its SDK.
44

5-
65
## Architecture
76

87
The project follows monorepository patterns. The project consists of several packages:
@@ -21,7 +20,6 @@ The `toolbar` application. It is used to display the toolbar on the page.
2120

2221
The package is used to display the toolbar on the page. It can be used separately from the `yii-dev-panel` application.
2322

24-
2523
The `toolbar` application requires only `sdk` package.
2624

2725
### `@yiisoft/yii-dev-toolbar`
@@ -38,9 +36,9 @@ The `app` application requires both `sdk` and `toolbar` packages.
3836

3937
Example of remote components that may be used as a custom panel.
4038

41-
Read more about how to work with remote components [here](docs/shared_components.md).
39+
Read more about how to work with remote components [here](docs/guide/readme.md).
4240

43-
#### Dependency graph:
41+
#### Dependency graph
4442

4543
```mermaid
4644
flowchart LR
@@ -50,7 +48,31 @@ flowchart LR
5048
B[yii-dev-toolbar] --> C
5149
```
5250

53-
## Additional docs:
51+
## Documentation
52+
53+
- [Guide](docs/guide/README.md)
54+
- [Internals](docs/internals.md)
55+
56+
## Support
57+
58+
If you need help or have a question, the [Yii Forum](https://forum.yiiframework.com/c/yii-3-0/63) is a good place for that.
59+
You may also check out other [Yii Community Resources](https://www.yiiframework.com/community).
60+
61+
## Support the project
62+
63+
[![Open Collective](https://img.shields.io/badge/Open%20Collective-sponsor-7eadf1?logo=open%20collective&logoColor=7eadf1&labelColor=555555)](https://opencollective.com/yiisoft)
64+
65+
## Follow updates
66+
67+
[![Official website](https://img.shields.io/badge/Powered_by-Yii_Framework-green.svg?style=flat)](https://www.yiiframework.com/)
68+
[![Twitter](https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555?style=flat)](https://twitter.com/yiiframework)
69+
[![Telegram](https://img.shields.io/badge/telegram-join-1DA1F2?style=flat&logo=telegram)](https://t.me/yii3en)
70+
[![Facebook](https://img.shields.io/badge/facebook-join-1DA1F2?style=flat&logo=facebook&logoColor=ffffff)](https://www.facebook.com/groups/yiitalk)
71+
[![Slack](https://img.shields.io/badge/slack-join-1DA1F2?style=flat&logo=slack)](https://yiiframework.com/go/slack)
72+
73+
## License
74+
75+
The Yii Development Panel is free software. It is released under the terms of the BSD License.
76+
Please see [`LICENSE`](./LICENSE.md) for more information.
5477

55-
- [How to use Local registry (`verdaccio`)](docs/local_registry.md)
56-
- [How to work with remote components](docs/shared_components.md)
78+
Maintained by [Yii Software](https://www.yiiframework.com/).

docs/guide/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Yii Development Panel
2+
3+
- [English](en/README.md)
4+
- [Português - Brasil](pt-BR/README.md)
5+
- [Internals](../internals.md)

docs/guide/en/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Yii Development Panel
2+
3+
- [How to use Local registry (`verdaccio`)](local_registry.md)
4+
- [How to work with remote components](shared_components.md)

docs/local_registry.md docs/guide/en/local_registry.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ To be able to use the local registry, you need:
1111

1212
1. Run the local registry server
1313

14-
```bash
14+
```shell
1515
npx verdaccio
1616
```
1717

1818
That will output:
19+
1920
```text
2021
info --- config file - /Users/xepozz/.config/verdaccio/config.yaml
2122
info --- "crypt" algorithm is deprecated consider switch to "bcrypt". Read more: https://github.com/verdaccio/monorepo/pull/580
File renamed without changes.

docs/guide/pt-BR/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Yii Development Panel
2+
3+
- [How to use Local registry (`verdaccio`)](local_registry.md)
4+
- [How to work with remote components](shared_components.md)

docs/guide/pt-BR/local_registry.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# How to use Local registry (`verdaccio`)
2+
3+
## Purpose
4+
5+
- Test the publishing process locally.
6+
- Test the installation process locally.
7+
8+
## How to use
9+
10+
To be able to use the local registry, you need:
11+
12+
1. Run the local registry server
13+
14+
```shell
15+
npx verdaccio
16+
```
17+
18+
That will output:
19+
20+
```text
21+
info --- config file - /Users/xepozz/.config/verdaccio/config.yaml
22+
info --- "crypt" algorithm is deprecated consider switch to "bcrypt". Read more: https://github.com/verdaccio/monorepo/pull/580
23+
info --- plugin successfully loaded: verdaccio-htpasswd
24+
info --- plugin successfully loaded: verdaccio-audit
25+
warn --- http address - http://localhost:4873/ - verdaccio/5.23.2
26+
```
27+
28+
2. Add the local registry to your `~/.npmrc` file:
29+
30+
```text
31+
registry=http://localhost:4873/ <-- the url from the previous step
32+
```
33+
34+
3. Run `npm adduser` and done this step.
35+
4. Run `npm publish` in the root of the package you want to publish or use `npm publish -ws` to publish all packages in the monorepo.

docs/guide/pt-BR/shared_components.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# How to work with remote components
2+
3+
## About
4+
5+
Remote components are components that are located in a remote repository.
6+
They are not installed in the project, but are used as if they were provided from the backend.
7+
This feature allows you to create custom panels for the `yii-dev-panel` and render them as native components.
8+
9+
### How to test
10+
11+
First of all, you need to serve the `yii-dev-panel`.
12+
13+
Open a terminal and run:
14+
```sh
15+
cd packages/yii-dev-panel; npm start
16+
```
17+
It serves the yii-dev-panel project on `127.0.0.1:3000`.
18+
19+
Then you need to serve your own built remote components. As an example you may use `examples/remote-panel` project.
20+
Open a new terminal and run:
21+
```sh
22+
cd examples/remote-panel; npm run serve:dev
23+
```
24+
It serves an example project on `127.0.0.1:3002`.
25+
26+
Then open the file `packages/yii-dev-panel-sdk/src/Pages/Layout.tsx` and apply the following changes:
27+
```diff
28+
{name: 'Open API', link: '/open-api'},
29+
// Uncomment to debug shared components
30+
- // {name: 'Shared', link: '/shared'},
31+
+ {name: 'Shared', link: '/shared'},
32+
```
33+
34+
Now you can open `http://localhost:3000/shared` and see the remote component in action.
35+

docs/internals.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Internals
2+
3+
## Unit testing
4+
5+
The package is tested with [PHPUnit](https://phpunit.de/). To run tests:
6+
7+
```shell
8+
./vendor/bin/phpunit
9+
```
10+
11+
## Mutation testing
12+
13+
The package tests are checked with [Infection](https://infection.github.io/) mutation framework with
14+
[Infection Static Analysis Plugin](https://github.com/Roave/infection-static-analysis-plugin). To run it:
15+
16+
```shell
17+
./vendor/bin/roave-infection-static-analysis-plugin
18+
```
19+
20+
## Static analysis
21+
22+
The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis:
23+
24+
```shell
25+
./vendor/bin/psalm
26+
```
27+
28+
## Rector
29+
30+
Use [Rector](https://github.com/rectorphp/rector) to make codebase follow some specific rules or
31+
use either newest or any specific version of PHP:
32+
33+
```shell
34+
./vendor/bin/rector
35+
```
36+
37+
## Composer require checker
38+
39+
This package uses [composer-require-checker](https://github.com/maglnet/ComposerRequireChecker) to check if all dependencies are correctly defined in `composer.json`.
40+
41+
To run the checker, execute the following command:
42+
43+
```shell
44+
./vendor/bin/composer-require-checker
45+
```

examples/remote-panel/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ It is a simple example of how to use the remote panel.
66

77
1. Run the server
88

9-
```bash
9+
```shell
1010
npm start
1111
```
1212

1313
2. Open the browser and go to `http://localhost:3002`
1414

1515
> Port is 3002 because the yii-dev-panel is running on port 3000
16-
>
16+
>
1717
> You can change the port in the `package.json` file
1818
1919
3. You may use the remote panel to debug your application in the browser.
2020
4. When you are done, you need to build the application to prepare the production files.
2121

22-
```bash
22+
```shell
2323
npm run build
2424
```
2525

2626
5. All is you need is to add the `dist` folder your application assets to be served by the web server.
2727

28-
6. More about the remote panel on the backend, please visit [yii-debug]
28+
6. More about the remote panel on the backend, please visit [yii-debug]

packages/yii-dev-panel-sdk/LICENSE.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
Copyright © 2008 by Yii Software (https://www.yiiframework.com/)
1+
Copyright © 2008 by Yii Software (<https://www.yiiframework.com/>)
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without
55
modification, are permitted provided that the following conditions
66
are met:
77

8-
* Redistributions of source code must retain the above copyright
8+
* Redistributions of source code must retain the above copyright
99
notice, this list of conditions and the following disclaimer.
10-
* Redistributions in binary form must reproduce the above copyright
10+
* Redistributions in binary form must reproduce the above copyright
1111
notice, this list of conditions and the following disclaimer in
1212
the documentation and/or other materials provided with the
1313
distribution.
14-
* Neither the name of Yii Software nor the names of its
14+
* Neither the name of Yii Software nor the names of its
1515
contributors may be used to endorse or promote products derived
1616
from this software without specific prior written permission.
1717

packages/yii-dev-panel/LICENSE.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
Copyright © 2008 by Yii Software (https://www.yiiframework.com/)
1+
Copyright © 2008 by Yii Software (<https://www.yiiframework.com/>)
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without
55
modification, are permitted provided that the following conditions
66
are met:
77

8-
* Redistributions of source code must retain the above copyright
8+
* Redistributions of source code must retain the above copyright
99
notice, this list of conditions and the following disclaimer.
10-
* Redistributions in binary form must reproduce the above copyright
10+
* Redistributions in binary form must reproduce the above copyright
1111
notice, this list of conditions and the following disclaimer in
1212
the documentation and/or other materials provided with the
1313
distribution.
14-
* Neither the name of Yii Software nor the names of its
14+
* Neither the name of Yii Software nor the names of its
1515
contributors may be used to endorse or promote products derived
1616
from this software without specific prior written permission.
1717

packages/yii-dev-toolbar/LICENSE.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
Copyright © 2008 by Yii Software (https://www.yiiframework.com/)
1+
Copyright © 2008 by Yii Software (<https://www.yiiframework.com/>)
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without
55
modification, are permitted provided that the following conditions
66
are met:
77

8-
* Redistributions of source code must retain the above copyright
8+
* Redistributions of source code must retain the above copyright
99
notice, this list of conditions and the following disclaimer.
10-
* Redistributions in binary form must reproduce the above copyright
10+
* Redistributions in binary form must reproduce the above copyright
1111
notice, this list of conditions and the following disclaimer in
1212
the documentation and/or other materials provided with the
1313
distribution.
14-
* Neither the name of Yii Software nor the names of its
14+
* Neither the name of Yii Software nor the names of its
1515
contributors may be used to endorse or promote products derived
1616
from this software without specific prior written permission.
1717

packages/yii-dev-toolbar/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ npm i @yiisoft/yii-dev-toolbar
1414

1515
First you need to tell `npm` to use GitHub Packages registry for @yiisoft scope.
1616
Add `@yiisoft:registry=https://npm.pkg.github.com` to `.npmrc` file or run the following command:
17+
1718
```shell
1819
echo "\n@yiisoft:registry=https://npm.pkg.github.com" >> .npmrc
1920
```
@@ -33,4 +34,3 @@ Add the following code to the page to display the toolbar:
3334
<script src="https://yiisoft.github.io/yii-dev-panel/toolbar/bundle.js"></script>
3435
<link rel="stylesheet" href="https://yiisoft.github.io/yii-dev-panel/toolbar/bundle.css" />
3536
```
36-

0 commit comments

Comments
 (0)