-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DEV-37: Use eslint to lint custom javascript #146
Changes from all commits
cb63310
871ac81
b22f08b
da5009c
ee72af2
fa889dd
a4f1310
4bb74e7
797638f
7fa63f0
ced6bd7
8914717
33f184e
98f18f0
8be8573
ffc899f
b14ca24
e7a2d23
2cb502b
ca06fcb
893b054
24d75fd
74b3e6e
19885d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
## Description: Run phing inside the shell with `ddev phing` | ||
|
||
vendor/bin/phing "$@" | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Add directories and files to ignore: https://eslint.org/docs/latest/use/configure/ignore#the-eslintignore-file |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"extends": [ | ||
"drupal" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We just use Drupal Core's rules and config for eslint. |
||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,36 +33,38 @@ Enter a short name for your project [example] : | |
|
||
1. Create a new project called "example" based on this template: | ||
|
||
``` | ||
composer create-project palantirnet/drupal-skeleton example dev-develop --no-interaction | ||
``` | ||
|
||
This skeleton is based on Drupal 10. If you would like to install and use Drupal 9 instead, run: | ||
``` | ||
composer create-project palantirnet/drupal-skeleton example dev-drupal9 --no-interaction | ||
``` | ||
|
||
2. Go into your new project directory and update the ddev configuration in `.ddev/config.yml`: | ||
``` | ||
composer create-project palantirnet/drupal-skeleton example dev-develop --no-interaction | ||
``` | ||
|
||
This skeleton is based on Drupal 10. If you would like to install and use Drupal 9 instead, run: | ||
Comment on lines
-36
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These changes are all just formatting to allow us to just use |
||
|
||
``` | ||
# Update to match your project name. Using "drupal-skeleton" would make the site | ||
# accessible at 'drupal-skeleton.ddev.site'. | ||
name: drupal-skeleton | ||
``` | ||
composer create-project palantirnet/drupal-skeleton example dev-drupal9 --no-interaction | ||
``` | ||
|
||
1. Go into your new project directory and update the ddev configuration in `.ddev/config.yml`: | ||
|
||
# Use 'docroot' for Acquia, or 'web' for Pantheon or Platform.sh. | ||
docroot: web | ||
``` | ||
``` | ||
# Update to match your project name. Using "drupal-skeleton" would make the site | ||
# accessible at 'drupal-skeleton.ddev.site'. | ||
name: drupal-skeleton | ||
|
||
3. From inside the ddev environment, run the script from `palantirnet/the-build` to set up the default Drupal variables and install Drupal: | ||
# Use 'docroot' for Acquia, or 'web' for Pantheon or Platform.sh. | ||
docroot: web | ||
``` | ||
|
||
1. From inside the ddev environment, run the script from `palantirnet/the-build` to set up the default Drupal variables and install Drupal: | ||
|
||
``` | ||
ddev start | ||
ddev ssh | ||
vendor/bin/the-build-installer | ||
``` | ||
``` | ||
ddev start | ||
ddev ssh | ||
vendor/bin/the-build-installer | ||
``` | ||
|
||
1. In your web browser, visit [http://example.ddev.site](http://example.ddev.site) | ||
|
||
5. In your web browser, visit [http://example.ddev.site](http://example.ddev.site) | ||
6. _Optional:_ While you are logged into the ddev environment, you can run Drush commands like `drush status`. | ||
1. _Optional:_ While you are logged into the ddev environment, you can run Drush commands like `drush status`. | ||
|
||
### Extra Credit | ||
|
||
|
@@ -122,6 +124,11 @@ Update the `composer.json`: | |
composer update --lock | ||
``` | ||
|
||
Update the `package.json`: | ||
|
||
* Change the `name` from `palantirnet--drupal-skeleton` to `palantirnet--PROJECTNAME` (see [package.json name requirements](https://docs.npmjs.com/cli/v8/configuring-npm/package-json#name)) | ||
* Update the `description` with a brief description of your project. | ||
|
||
### Configure your ddev development environment | ||
|
||
Go into your new project directory and update the ddev configuration in `.ddev/config.yml`. | ||
|
@@ -169,17 +176,17 @@ git push -u origin develop | |
If you're allergic to phing and Benadryl isn't helping, you can also remove the-build: | ||
|
||
1. `composer remove --dev palantirnet/the-build` | ||
2. `rm -r .the-build` | ||
3. `rm build.xml` | ||
4. This will remove drush, coder, and phpmd -- if you want those dependencies, you'll need to add them back to your project: | ||
1.`rm -r .the-build` | ||
1. `rm build.xml` | ||
1. This will remove drush, coder, and phpmd -- if you want those dependencies, you'll need to add them back to your project: | ||
|
||
``` | ||
composer require --dev drush/drush drupal/coder phpmd/phpmd | ||
``` | ||
|
||
5. Review your `web/sites/default/settings.*.php` files (the-build managed these for you) | ||
6. Install your build tooling of choice... or nothing at all... | ||
7. _Update your project's README_ | ||
1. Review your `web/sites/default/settings.*.php` files (the-build managed these for you) | ||
1. Install your build tooling of choice... or nothing at all... | ||
1. _Update your project's README_ | ||
|
||
See also: [Documentation on using the-build](https://github.com/palantirnet/the-build#using-the-build) | ||
|
||
|
@@ -214,24 +221,24 @@ In Drupal 8 development, all (or most) Drupal configuration should be exported a | |
* Set the admin email address (your development environment will trap all emails) | ||
* Turn the Cron interval down to "never" | ||
* Uninstall unnecessary modules (e.g. Search, History, Comment) | ||
2. Export your config: | ||
1. Export your config: | ||
|
||
``` | ||
drush cex -y | ||
``` | ||
``` | ||
drush cex -y | ||
``` | ||
|
||
3. You should have a ton of new `*.yml` files in `config/sites/default/`. Add them, and this config change, to git: | ||
1. You should have a ton of new `*.yml` files in `config/sites/default/`. Add them, and this config change, to git: | ||
|
||
``` | ||
git add config/ | ||
git ci -m "Initial Drupal configuration." | ||
git push | ||
``` | ||
5. Reinstall your site and verify that your config is ready to go: | ||
``` | ||
git add config/ | ||
git ci -m "Initial Drupal configuration." | ||
git push | ||
``` | ||
1. Reinstall your site and verify that your config is ready to go: | ||
|
||
``` | ||
vendor/bin/phing install | ||
``` | ||
``` | ||
vendor/bin/phing install | ||
``` | ||
|
||
## More information | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,10 @@ | |
{ | ||
"type": "composer", | ||
"url": "https://packages.drupal.org/8" | ||
}, | ||
{ | ||
"type": "git", | ||
"url": "https://github.com/palantirnet/the-build" | ||
Comment on lines
+16
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is temporary. After this PR is approved we should be able to remove. |
||
} | ||
], | ||
"require": { | ||
|
@@ -33,7 +37,7 @@ | |
"dmore/behat-chrome-extension": "^1.4", | ||
"drupal/core-dev": "^10", | ||
"drupal/drupal-extension": "^5@alpha", | ||
"palantirnet/the-build": "^4@beta" | ||
"palantirnet/the-build": "dev-dev-37-eslint" | ||
Comment on lines
-36
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is temporary. After this PR is approved we should be able to revert or update. |
||
}, | ||
"suggest": { | ||
"cweagans/composer-patches": "Try ^1.7. Apply patches to packages, especially Drupal.org contrib.", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "palantirnet--drupal-skeleton", | ||
"description": "A Drupal 8 project template.", | ||
"version": "0.0.0", | ||
"devDependencies": { | ||
"eslint": "8.39.0", | ||
"eslint-config-drupal": "5.0.2" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allows us to run
ddev phing ...