-
-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* release/5.0.0: (283 commits) updated the changelog styled the action links fixed the provider path updated the changelog compiled assets compiled assets refactored the line chart to a simpler setup minor updates to the data setting updated the readme restricted edit access on the default template testing out the layout updated the readme Apply fixes from StyleCI (#577) personalized the user data updated branding and compiled assets compiled assets updates the readme logo and branding updates recompile assets wip ...
- Loading branch information
Showing
233 changed files
with
7,167 additions
and
10,982 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
# Contributing Guide | ||
|
||
Hi! I'm really excited that you are interested in contributing to Canvas. The following guide will help you get your environment set up to begin making changes. | ||
|
||
## Table of Contents | ||
|
||
- [OS Tools](#before-you-get-started) | ||
- [Development Setup](#development-setup) | ||
- [Git](#git) | ||
- [Database](#database) | ||
- [Authentication](#authentication) | ||
- [Directories](#directories) | ||
- [Installation](#installation) | ||
- [Developing](#developing) | ||
|
||
## Before you get started | ||
|
||
- Make sure the [Vue DevTools](https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd?hl=en) extension is installed in your Chrome browser | ||
- Add the following function from [Caleb Porzio](https://calebporzio.com/bash-alias-composer-link-use-local-folders-as-composer-dependancies/) to your `~/.bashrc`, `~/.bash_profile` or `~/.zshrc`: | ||
|
||
```bash | ||
composer-link() {composer config repositories.local '{"type": "path", "url": "'$1'"}' --file composer.json} | ||
``` | ||
|
||
## Development Setup | ||
|
||
### Git | ||
|
||
Fork the project on [https://github.com/cnvs/canvas](https://github.com/cnvs/canvas) to your own account. Then clone the fork with the following command: | ||
|
||
```bash | ||
git clone https://github.com/your-account/canvas.git | ||
``` | ||
|
||
In an adjacent directory from where you cloned the repo, create a new Laravel project with the following command: | ||
|
||
```bash | ||
composer create-project --prefer-dist laravel/laravel blog | ||
``` | ||
|
||
### Database | ||
|
||
The fastest way to get a database up and running is to issue the following command: | ||
|
||
```bash | ||
touch database/database.sqlite | ||
``` | ||
|
||
Now update your `.env` file to reflect the new database: | ||
|
||
```php | ||
DB_CONNECTION=sqlite | ||
``` | ||
|
||
### Authentication | ||
|
||
> Note: It's assumed we're developing on Laravel 6.* since that's the current LTS | ||
From your Laravel app, create the authentication system and run the following commands: | ||
|
||
```bash | ||
composer require laravel/ui | ||
|
||
php artisan ui vue --auth | ||
php artisan:migrate | ||
``` | ||
|
||
### Directories | ||
|
||
From your Laravel app, link the local version of Canvas using the `composer-link()` function: | ||
|
||
```bash | ||
composer-link ../canvas/ | ||
composer require cnvs/canvas @dev | ||
``` | ||
|
||
### Installation | ||
|
||
Now that the projects are linked, run the following installation steps: | ||
|
||
```bash | ||
php artisan canvas:install | ||
php artisan storage:link | ||
php artisan canvas:setup --data | ||
``` | ||
|
||
The view stats are a core component to the project, so it's best to have a large dataset in place when developing. Assuming you passed the `--data` option during the setup process above, you'll already have posts populating the database. In which case, you can add the following snippets to your Laravel app: | ||
|
||
```php | ||
// In the `run()` method of the `DatabaseSeeder` | ||
$this->call(CanvasViewsTableSeeder::class); | ||
|
||
// Create a new class named `CanvasViewsTableSeeder` and add this to the `run()` method: | ||
factory(View::class, 2500)->create(); | ||
|
||
// Create a new factory named `ViewFactory` and add this definition: | ||
$factory->define(\Canvas\View::class, function (\Faker\Generator $faker) { | ||
$referers = collect([ | ||
'https://google.com', | ||
'https://twitter.com', | ||
'https://facebook.com', | ||
'https://medium.com', | ||
'https://laravel-news.com', | ||
'https://reddit.com', | ||
'https://wordpress.com', | ||
'https://news.ycombinator.com', | ||
'https://hackernoon.com', | ||
'https://dev.to', | ||
'https://www.sitepoint.com', | ||
]); | ||
|
||
$user_agents = collect([ | ||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0', | ||
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', | ||
'Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Firefox/68.0', | ||
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.2 Safari/605.1.15', | ||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0', | ||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36', | ||
]); | ||
|
||
$timestamp = today()->subDays(rand(0, 30))->toDateTimeString(); | ||
|
||
return [ | ||
'post_id' => \Canvas\Post::all()->pluck('id')->random(), | ||
'ip' => $faker->ipv4, | ||
'agent' => $user_agents->random(), | ||
'referer' => $referers->random(), | ||
'created_at' => $timestamp, | ||
'updated_at' => $timestamp, | ||
]; | ||
}); | ||
``` | ||
|
||
You can now run `php artisan db:seed` and you will have a substantial amount of views for each post. | ||
|
||
### Developing | ||
|
||
Instead of making and compiling frontend changes in the package, then having to re-publish the assets in the Laravel app again and again, we can utilize a symlink: | ||
|
||
```bash | ||
# remove the existing assets from the Laravel app | ||
rm -rf public/vendor/canvas/* | ||
|
||
# go inside the empty directory and create a symlink | ||
cd public/vendor/canvas | ||
ln -s ../../../../canvas/public/* . | ||
``` | ||
|
||
Once you've made your changes, [create a pull request](https://github.com/cnvs/canvas/compare) from your fork to the `develop` branch of the project repository. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
# These are supported funding model platforms | ||
|
||
github: austintoddj |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,6 @@ | |
composer.lock | ||
npm-debug.log | ||
yarn-error.log | ||
.DS_Store | ||
Thumbs.db | ||
.DS_Store | ||
.phpunit.result.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.