Skip to content

Commit

Permalink
add one isntall command to rule them all and uninstall/ nuke deps com…
Browse files Browse the repository at this point in the history
…mands #2772
  • Loading branch information
Josh Pollock committed Oct 23, 2018
1 parent f4c9da9 commit 4d3cdd0
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 81 deletions.
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ Requires: git, npm, Grunt.
- `git clone [email protected]:CalderaWP/Caldera-Forms.git`
- Switch directory
- `cd Caldera-Forms.git`
- npm install
- `npm i`
- If you are using your own local development environment:
- `npm i && composer install`
- If you are wish to use the provided local development environment
- `composer dev:install`


### Build For Release
To create a build to ship to WordPress.org:
`npm run package`
Expand Down Expand Up @@ -75,21 +79,13 @@ The local server is [http://localhost:8228](http://localhost:8228)


#### Install Test Environment
* Make sure all dependencies are installed:
- `composer update && npm update`
* Install local development environment
- `composer wp:install
- Runs installer. Make sure Docker is running. May take awhile.
- `composer wp:activate`
- Activates Caldera Forms and Gutenberg and sets permalinks.
* Install local development environment, dependencies and setup test forms
- `composer dev:install`
- May take awhile.
* Go to [http://localhost:8228](http://localhost:8228) and make sure you have a WordPress site and can login.
- Username: admin
- password: password

* Install the tests forms and pages for them.
- `composer wp:test:setup`
- Adds forms needed for e2e tests and one page for each form. Useful for manual QA as well.

### Test Structures
* PHP tests go in /tests and are run using phpunit
- Integration tests, which require WordPress, are in tests. These used to be all the tests we have.
Expand All @@ -103,6 +99,8 @@ The local server is [http://localhost:8228](http://localhost:8228)

#### Commands
##### Composer
* `composer dev:install` - Installs dependencies, Docker-based test environment and sets up test forms.
* `composer dev:destroy` - Deletes dependencies and the Docker-based test environment.
* `composer wp:install` - Installs Docker-based test environment.
* `composer wp:start` - Starts Docker-based test environment.
* `composer wp:activate` - Activate plugins in Docker-based environment.
Expand All @@ -111,6 +109,7 @@ The local server is [http://localhost:8228](http://localhost:8228)
* `composer wp:destroy` - Removes (including the database) the test environment and destroys containers.
* `composer test:setup` - Adds test forms and puts them on pages.
* `composer test:delete` - Delete test forms and pages the are on.
* `composer nuke` - Deletes dependencies, including lock files -- NPM and Composer.

##### Composer
* `npm test` - Run JavaScript test watcher
Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
"mockery/mockery": ">=0.9 <2"
},
"scripts" : {
"dev:install": "composer install && npm install && composer wp:install && composer wp:activate && composer test:setup",
"dev:destroy": "composer nuke && composer wp:destroy",
"nuke": "rm package-lock.json && rm composer.lock && rm yarn.lock && rm -rf node_modules/ && rm -rf vendor",
"wp:install": "bash ./bin/install-docker.sh && composer wp:config",
"wp:activate": "bash ./bin/activate-plugin.sh",
"test:setup": "bash ./bin/setup-test-forms.sh",
Expand Down
106 changes: 53 additions & 53 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit734406fe75b0a330f41f48930525b165::getLoader();
return ComposerAutoloaderInitb2d56b84f94cc35345b1871b7d51f461::getLoader();
2 changes: 1 addition & 1 deletion vendor/composer/ClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ private function findFileWithExtension($class, $ext)
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath.'\\';
$search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
Expand Down
14 changes: 7 additions & 7 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit734406fe75b0a330f41f48930525b165
class ComposerAutoloaderInitb2d56b84f94cc35345b1871b7d51f461
{
private static $loader;

Expand All @@ -19,15 +19,15 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInit734406fe75b0a330f41f48930525b165', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitb2d56b84f94cc35345b1871b7d51f461', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit734406fe75b0a330f41f48930525b165', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitb2d56b84f94cc35345b1871b7d51f461', 'loadClassLoader'));

$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';

call_user_func(\Composer\Autoload\ComposerStaticInit734406fe75b0a330f41f48930525b165::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitb2d56b84f94cc35345b1871b7d51f461::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
Expand All @@ -48,19 +48,19 @@ public static function getLoader()
$loader->register(true);

if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit734406fe75b0a330f41f48930525b165::$files;
$includeFiles = Composer\Autoload\ComposerStaticInitb2d56b84f94cc35345b1871b7d51f461::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire734406fe75b0a330f41f48930525b165($fileIdentifier, $file);
composerRequireb2d56b84f94cc35345b1871b7d51f461($fileIdentifier, $file);
}

return $loader;
}
}

function composerRequire734406fe75b0a330f41f48930525b165($fileIdentifier, $file)
function composerRequireb2d56b84f94cc35345b1871b7d51f461($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
Expand Down
Loading

0 comments on commit 4d3cdd0

Please sign in to comment.