LastCallMedia/Mannequin

Installation help

Closed this issue · 5 comments

I’m probably doing something wrong in installation, any help appreciated.
Steps to reproduce:

  1. I setup a fresh local Drupal 8.4.0 using composer, with folder structure:
    my_manaquin
    —vendor
    —web
    …etc.

  2. I ran composer require lastcall/mannequin-drupal from within my_mannequin

  3. I created a .mannequin.php file per this: https://mannequin.io/extensions/drupal/#usage and changed ->in(__DIR__.'/themes/mytheme') to ->in(__DIR__.'/themes/custom/myclassy’)

  4. I ran vendor/bin/mannequin start (from within my_manaquin) - it did not return anything.

I am stuck at this point: “From the /ui directory, run: yarn start.” I cannot find a /ui directory. I searched my project and found only this: /my_mannequin/vendor/lastcall/mannequin-core/Ui

Is that the correct /ui ?
Thanks,
Rick

PHP 7.1.1
Composer version 1.5.1

Hey Rick!
First things first, we had a couple of bugs with the install process that have been fixed recently. Can you run composer update lastcall/mannequin* to make sure you have the latest changes (1.0.3 as of right now).

Second, you don't need to run yarn just to use Mannequin, only if you're working on the tool itself. That's probably a little unclear, so I'll remove that from the README to avoid any confusion.

Last, when you say "it did not return anything", do you mean the command just ran and exited, or when you visited the URL in your browser, it didn't show you anything?

H Rob,

I did composer update lastcall/mannequin* and:
- Updating lastcall/mannequin-core (1.0.1 => 1.0.3): Downloading (100%)
- Installing lastcall/mannequin-core:ui (1.0.3): Downloading (100%)
- Updating lastcall/mannequin-twig (1.0.1 => 1.0.3): Downloading (100%)
- Updating lastcall/mannequin-drupal (1.0.1 => 1.0.3): Downloading (100%)
...so it did need updating.

OK understand on the no need to yarn start

When I run vendor/bin/mannequin start it simply comes back to my command prompt - maybe that is all it is supposed to do?

I think I am confused about "visited the URL in your browser" though. Does that mean the URL in this?

$config = MannequinConfig::create([
'ui' => new LocalDevelopmentUi('http://127.0.0.1:3000')
])

^ BTW I did not have this in my .mannequin.php I just added it. Then did vendor/bin/mannequin start again but cannot access http://127.0.0.1:3000

I'll some find you here or back in MA.

Thanks,

Rick

PS: this is my .mannequin.php file:

<?php

use LastCall\Mannequin\Core\MannequinConfig;
use LastCall\Mannequin\Drupal\DrupalExtension;
use Symfony\Component\Finder\Finder;

$drupalFinder = Finder::create()
  ->in(__DIR__.'/themes/custom/myclassy')
  ->files()
  ->name('*.twig');

$drupalExtension = new DrupalExtension([
  'finder' => $drupalFinder,
  'drupal_root' => __DIR__,
]);

$config = MannequinConfig::create([
  'ui' => new LocalDevelopmentUi('http://127.0.0.1:3000')
]);

return MannequinConfig::create()

Update: I realized this is probably correct for above:

'ui' => new LocalDevelopmentUi('http://mannequin:8888') < my local Drupal site

But also not sure where this is:

src/Core/bin/mannequin start *:8000

(e.g. where is src/Core)

Hey Rick,
You can drop the UI stuff entirely. That’s only used for developing on mannequin itself. Also, I think you are recreating the config at the end of the file there. The last line should be:

‘’’
return $config;
‘’’

Sorry for the poor formatting - please ignore the backticks.

I was able to get mannequin running by simply using the Last Call Scaffold. In that there was a .mannequin.php file that I compared with the one I had here, and the one here was wrong at the bottom, as you said.

My .mannequin.php here:

$config = MannequinConfig::create([
  'ui' => new LocalDevelopmentUi('http://mannequin:8888')
]);

return MannequinConfig::create()
  ->addExtension($drupalExtension);

The .mannequin.php from scaffold:

$config = MannequinConfig::create()
  ->addExtension($drupalExtension)
  ->setGlobalCss([
    'web/themes/custom/scaffold/dist/css/style.css',
  ])
  ->setGlobalJs([
    'web/core/assets/vendor/jquery/jquery.min.js',
    'web/core/misc/drupal.js',
    'web/themes/custom/scaffold/dist/js/libs.min.js',
    'web/themes/custom/scaffold/dist/js/theme.min.js',
  ]);

return $config;

This docs page should maybe be updated because it does not show the return $config; at the bottom: https://mannequin.io/extensions/drupal (the “Create or update your .mannequin.php file as follows:” section). Or maybe show a complete sample file of .mannequin.php.

OK all set, thanks!