-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* [#3] Add prettier and .editorconfig * [#3] Run `prettier . --write` * [#3] Install & configure eslint * [#3] Install PHP ECS and run fix * [#3] Install and configure PHPStan * [#3] Install Husky - npm install --save-dev husky - npx husky init Add DDEV configs to ensure Husky is connected to the user & DDEV's Git processes * [#3] Install & configure lint-staged This runs our linters & formatters on just the files that have changed. * [#3] eslint disallow console.log * [#3] Remove npm run prepare from ddev. Apparently `prepare` runs after each npm install. https://typicode.github.io/husky/how-to.html#manual-setup * [#3] PR Feedback
- Loading branch information
1 parent
2e733b5
commit 06e90d3
Showing
25 changed files
with
1,948 additions
and
648 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# http://EditorConfig.org | ||
|
||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.csv] | ||
insert_final_newline = false | ||
|
||
[*.{php,py}] | ||
indent_size = 4 | ||
|
||
# https://www.markdownguide.org/basic-syntax/#line-breaks | ||
[*.md] | ||
trim_trailing_whitespace = false |
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 |
---|---|---|
|
@@ -4,4 +4,5 @@ | |
.DS_Store | ||
node_modules | ||
/web/dist | ||
/.vite | ||
/.vite | ||
php-cs-fixer.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ddev exec npx lint-staged |
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,9 @@ | ||
node_modules | ||
.vscode | ||
composer.lock | ||
composer.json | ||
vendor | ||
config/project | ||
storage | ||
web | ||
package-lock.json |
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,6 @@ | ||
{ | ||
"semi": false, | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"trailingComma": "all" | ||
} |
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,20 +1,22 @@ | ||
# Architecture | ||
|
||
## Goals | ||
|
||
- As simple as possible | ||
- Easy to contribute | ||
- Easy to contribute | ||
- Use PHP/Composer as much as possible for setup scripts | ||
- Easy to test changes | ||
- Make it easy to `ddev start` this repo and test your plugin and build tool changes. | ||
- It should feel like you're working on a typical Craft project | ||
- Make it easy to `ddev start` this repo and test your plugin and build tool changes. | ||
- It should feel like you're working on a typical Craft project | ||
- Cross-platform (Mac, Windows, Linux) | ||
- We can achieve this by using PHP/Composer and running scripts from within Docker containers. | ||
- We can achieve this by using PHP/Composer and running scripts from within Docker containers. | ||
|
||
## Overview | ||
|
||
This starter is a Composer "project" that can be installed using `composer create-project`. | ||
|
||
composer.json has a `post-create-project-cmd` [script](https://getcomposer.org/doc/articles/scripts.md) that will run after the project is created. | ||
|
||
We use this hook to start the installation process (modify and delete files, edit config, etc). | ||
|
||
Some aspects of the installation are single line bash scripts. However, more complex actions are handled by PHP files in the [install-scripts](/install-scripts) directory | ||
Some aspects of the installation are single line bash scripts. However, more complex actions are handled by PHP files in the [install-scripts](/install-scripts) directory |
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,39 +1,44 @@ | ||
# Getting Started | ||
|
||
This repo is a Composer "project" intended for use with the `composer create-project` command. | ||
|
||
Our starter uses DDEV for local development. Install it before doing any of the following steps. | ||
Our starter uses DDEV for local development. Install it before doing any of the following steps. | ||
|
||
## Create Project | ||
|
||
1. [Install DDEV](https://ddev.readthedocs.io/en/stable/users/install/ddev-installation/) | ||
2. Choose a folder for your project and move into it: | ||
```shell | ||
cd /path/to/web/projects | ||
mkdir my-project | ||
cd my-project | ||
``` | ||
```shell | ||
cd /path/to/web/projects | ||
mkdir my-project | ||
cd my-project | ||
``` | ||
3. Create The Project | ||
If you already have PHP and Composer running on your host machine (your computer, not Docker container or DDEV instance), you can run the following command | ||
```shell | ||
composer create-project viget/craft-site-starter=^5.0.0 ./ --ignore-platform-reqs | ||
``` | ||
|
||
If you'd rather not set up PHP, you can create the project with a desposable Docker image ([Thanks nystudio107](https://nystudio107.com/blog/dock-life-using-docker-for-all-the-things)). | ||
```shell | ||
docker run --rm -it -v "$PWD":/app -v ${COMPOSER_HOME:-$HOME/.composer}:/tmp composer create-project viget/craft-site-starter=^5.0.0 ./ --ignore-platform-reqs | ||
``` | ||
If you already have PHP and Composer running on your host machine (your computer, not Docker container or DDEV instance), you can run the following command | ||
|
||
```shell | ||
composer create-project viget/craft-site-starter=^5.0.0 ./ --ignore-platform-reqs | ||
``` | ||
|
||
If you'd rather not set up PHP, you can create the project with a desposable Docker image ([Thanks nystudio107](https://nystudio107.com/blog/dock-life-using-docker-for-all-the-things)). | ||
|
||
```shell | ||
docker run --rm -it -v "$PWD":/app -v ${COMPOSER_HOME:-$HOME/.composer}:/tmp composer create-project viget/craft-site-starter=^5.0.0 ./ --ignore-platform-reqs | ||
``` | ||
|
||
4. Start DDEV & Install Craft | ||
```shell | ||
ddev start | ||
ddev craft install | ||
``` | ||
```shell | ||
ddev start | ||
ddev craft install | ||
``` | ||
5. Run `ddev launch` to open the project in your browser | ||
|
||
# Contribute to this starter | ||
|
||
## Local Dev | ||
|
||
Ideally, you should be able to clone this repo and make modifications to plugin & build tool configs with minimal fuss. | ||
|
||
Run `ddev start` and make edits in a feature branch. | ||
|
||
See [ARCHITECTURE.md](ARCHITECTURE.md) for details on technical goals & decisions. | ||
See [ARCHITECTURE.md](ARCHITECTURE.md) for details on technical goals & decisions. |
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.