Skip to content

Commit

Permalink
Merge branch 'release/5.0.0'
Browse files Browse the repository at this point in the history
* 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
austintoddj committed Dec 5, 2019
2 parents 1f6044e + d923abf commit f7e2f12
Show file tree
Hide file tree
Showing 233 changed files with 7,167 additions and 10,982 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2
[{*.yml,yaml}]
indent_size = 2
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
*.css linguist-vendored
*.scss linguist-vendored
*.js linguist-vendored
*.blade.php linguist-language=PHP
changelog.md export-ignore
changelog.md export-ignore
149 changes: 149 additions & 0 deletions .github/CONTRIBUTING.md
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.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# These are supported funding model platforms

github: austintoddj
Binary file added .github/HEADER.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
composer.lock
npm-debug.log
yarn-error.log
.DS_Store
Thumbs.db
.DS_Store
.phpunit.result.cache
36 changes: 10 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sudo: false

cache:
directories:
- $HOME/.composer.cache
- $HOME/.composer/cache

notifications:
email: false
Expand All @@ -15,44 +15,28 @@ matrix:
fast_finish: true
include:
- php: 7.1
env: LARAVEL='5.6.*' TESTBENCH='3.6.*' DBAL='2.9.*' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.1
env: LARAVEL='5.6.*' TESTBENCH='3.6.*' DBAL='2.9.*' COMPOSER_FLAGS='--prefer-stable'
- php: 7.2
env: LARAVEL='5.6.*' TESTBENCH='3.6.*' DBAL='2.9.*' COMPOSER_FLAGS='--prefer-lowest'
env: LARAVEL='5.6.*' TESTBENCH='3.6.*' DBAL='2.9.*'
- php: 7.2
env: LARAVEL='5.6.*' TESTBENCH='3.6.*' DBAL='2.9.*' COMPOSER_FLAGS='--prefer-stable'
env: LARAVEL='5.6.*' TESTBENCH='3.6.*' DBAL='2.9.*'
- php: 7.1
env: LARAVEL='5.7.*' TESTBENCH='3.7.*' DBAL='2.9.*' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.1
env: LARAVEL='5.7.*' TESTBENCH='3.7.*' DBAL='2.9.*' COMPOSER_FLAGS='--prefer-stable'
- php: 7.2
env: LARAVEL='5.7.*' TESTBENCH='3.7.*' DBAL='2.9.*' COMPOSER_FLAGS='--prefer-lowest'
env: LARAVEL='5.7.*' TESTBENCH='3.7.*' DBAL='2.9.*'
- php: 7.2
env: LARAVEL='5.7.*' TESTBENCH='3.7.*' DBAL='2.9.*' COMPOSER_FLAGS='--prefer-stable'
env: LARAVEL='5.7.*' TESTBENCH='3.7.*' DBAL='2.9.*'
- php: 7.2
env: LARAVEL='5.8.*' TESTBENCH='3.8.*' DBAL='2.9.*' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.2
env: LARAVEL='5.8.*' TESTBENCH='3.8.*' DBAL='2.9.*' COMPOSER_FLAGS='--prefer-stable'
- php: 7.3
env: LARAVEL='5.8.*' TESTBENCH='3.8.*' DBAL='2.9.*' COMPOSER_FLAGS='--prefer-lowest'
env: LARAVEL='5.8.*' TESTBENCH='3.8.*' DBAL='2.9.*'
- php: 7.3
env: LARAVEL='5.8.*' TESTBENCH='3.8.*' DBAL='2.9.*' COMPOSER_FLAGS='--prefer-stable'
env: LARAVEL='5.8.*' TESTBENCH='3.8.*' DBAL='2.9.*'
- php: 7.2
env: LARAVEL='6.*' TESTBENCH='4.*' DBAL='2.9.*' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.2
env: LARAVEL='6.*' TESTBENCH='4.*' DBAL='2.9.*' COMPOSER_FLAGS='--prefer-stable'
- php: 7.3
env: LARAVEL='6.*' TESTBENCH='4.*' DBAL='2.9.*' COMPOSER_FLAGS='--prefer-lowest'
env: LARAVEL='6.*' TESTBENCH='4.*' DBAL='2.9.*'
- php: 7.3
env: LARAVEL='6.*' TESTBENCH='4.*' DBAL='2.9.*' COMPOSER_FLAGS='--prefer-stable'
env: LARAVEL='6.*' TESTBENCH='4.*' DBAL='2.9.*'

before_install:
- phpenv config-rm xdebug.ini || true
- travis_retry composer self-update
- travis_retry composer require --no-update --no-interaction "illuminate/support=${LARAVEL}" "orchestra/testbench=${TESTBENCH}" "doctrine/dbal=${DBAL}"

install:
- travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction --no-suggest
- travis_retry composer update --prefer-dist --no-interaction --no-suggest

script: vendor/bin/phpunit --verbose
18 changes: 18 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

## [Unreleased](https://github.com/cnvs/canvas/compare/master...develop)

## [5.0.0](https://github.com/cnvs/canvas/compare/v4.2.9...v5.0.0) (December 5, 2019)

## Changed
- Complete re-write of the package into a single page application
- Replaced the FontAwesome library with custom illustrated icons from [RefactoringUI](https://refactoringui.com)
- Comprehensive update to the color palette
- Updated the digest notifications config variable ([02055d1](https://github.com/cnvs/canvas/commit/02055d1291fce1cd5434a1a6551e2e24f13fe185))

## Added
- Added Vuex for state management ([de90dd8](https://github.com/cnvs/canvas/commit/de90dd8e512f223a0c59b39556c8a92667d70854))
- Added [NProgress](https://github.com/rstacruz/nprogress) on page loads
- Added an autosaving feature to the editor
- Added SEO data syncing ([#506](https://github.com/cnvs/canvas/issues/506))

## Fixed
- Updated version support in CI testing ([#513](https://github.com/cnvs/canvas/issues/513), [f702d8d](https://github.com/cnvs/canvas/commit/f702d8d2c5c5bad8512ae0458794d91fbcb338c8))
- Restricted access to content viewing/editing based on authorship [d9e25f4](https://github.com/cnvs/canvas/commit/d9e25f4df94e3302ee57d3b3617fda30cf5440a0)

## [4.2.9](https://github.com/cnvs/canvas/compare/v4.2.8...v4.2.9) (September 20, 2019)

## Fixed
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
"require": {
"php": ">=7.1",
"ext-json": "*",
"doctrine/dbal": "^2.6|^2.7|^2.8|^2.9",
"illuminate/support": "^5.6|^5.7|^5.8|^6.0"
"doctrine/dbal": "^2.6|^2.7|^2.8|^2.9|^2.10",
"illuminate/support": "^5.6|^5.7|^5.8|^6.0",
"spatie/laravel-blade-javascript": "^2.1|^2.2|^2.3|^2.4"
},
"require-dev": {
"mockery/mockery": "^1.1",
Expand Down
20 changes: 10 additions & 10 deletions config/canvas.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

/*
|--------------------------------------------------------------------------
| Canvas Path
| Base Route
|--------------------------------------------------------------------------
|
| This is the URI path where Canvas will be accessible from. You are free
| to change this path to anything you like. Note that updating the URI
| will affect the internal API paths that are not exposed to users.
| to change this path to anything you like. Note that the URI will not
| affect the paths of its internal API that aren't exposed to users.
|
*/

Expand All @@ -33,12 +33,12 @@

/*
|--------------------------------------------------------------------------
| Uploads Disk
| Storage
|--------------------------------------------------------------------------
|
| This is the storage disk Canvas will use to put file uploads, you may
| use any of the disks defined in the config/filesystems.php file and
| You may also configure the path where files are to be stored.
| you may also configure the path where files are to be stored.
|
*/

Expand All @@ -63,17 +63,17 @@

/*
|--------------------------------------------------------------------------
| Notifications
| Weekly Digest
|--------------------------------------------------------------------------
|
| This option enables Canvas to send e-mail notifications via the default
| mail driver. If enabled, a weekly summary will be sent to each user
| that has authored content providing them with unique analytics.
| mail driver on a weekly basis. All users that have published content
| will receive a total view count summary of the last seven days.
|
*/

'mail' => [
'enabled' => env('CANVAS_MAIL_ENABLED', false),
'digest' => [
'enabled' => env('CANVAS_DIGEST_ENABLED', false),
],

];
Loading

0 comments on commit f7e2f12

Please sign in to comment.