Giter Club home page Giter Club logo

block-scaffolding-wp's People

Contributors

dependabot[bot] avatar derekherman avatar kasparsd avatar kienstra avatar miina avatar pierlon avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

block-scaffolding-wp's Issues

Cannot run npm install from container

If you run npm run docker -- npm install from the container then you will get an error when composer tries to run.

npm WARN lifecycle @xwp/[email protected]~postinstall: cannot run in wd @xwp/[email protected] composer install (wd=/var/www/html/wp-content/plugins/block-scaffolding-wp)

Basically, NPM tries to downgrade its privileges when it runs scripts. So you have to actually run it like so:

npm run docker -- npm install --unsafe-perm

Consider removing bundled Vagrant and Docker environments

The bundled Vagrant and Docker environments are a nice addition.

But there have been a few candidates that needed support with the environments. For example, one reported that they could not find the wp-content/ directory in the Vagrant environment.

Also, vagrant up failed for me with:

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

 setup

Stdout from the command:

Stderr from the command:

bash: line 4: setup: command not found

These issues might all have solutions.

But I think candidates could be distracted in setting up the environments. I've used this plugin in my own VVV environment fine.

Or instead of removing the bundled environment, maybe:

diff --git a/readme.md b/readme.md
index 154e632..411f1c9 100644
--- a/readme.md
+++ b/readme.md
@@ -19,12 +19,14 @@
 
           npm install
 
-3. Start a virtual testing environment using [Vagrant](https://www.vagrantup.com/) and [VirtualBox](https://www.virtualbox.org/):
+3. If you need a WordPress development environment, start one using [Vagrant](https://www.vagrantup.com/) and [VirtualBox](https://www.virtualbox.org/):
 
           vagrant up
 
        which will be available at [blockextend.local](http://blockextend.local) after provisioning (username: `admin`, password: `password`).
 
+       This is optional, and this plugin should still run in a typical WordPress development environment.
+
        Alternatively, run it on your local Docker host:

Possibly consider changing repo name so it also applies to back-end tasks

If you're open to considering changing the name of this repo, that could help it be more appropriate for back-end related tasks.

block-extend was perfect for the front-end task of extending a block. But it probably won't apply to back-end tasks, which probably won't involve extending a block.

It might involve creating a dynamic block. Of course, that's partly front-end as well ๐Ÿ˜„

Maybe:

  • block-scaffold
  • block-starter

Remove Dockerfile and Vagrantfile?

What do you think about removing the Dockerfile and Vagrantfile?

Most recent candidates have had problems with them.

They usually lose 1-2 days debugging them (though probably not working the whole day on them ๐Ÿ˜„ ).

The files might be fine. Environments are just hard to set up, and sometimes the candidates don't see errors when they fail.

My instructions for the project say the bundled environments are optional, but almost everyone tries to use the Dockerfile or Vagrantfile.

Most candidates probably have their own WP environment.

Sorry to keep opening issues to this repo, just thinking of how to speed up the trial projects.

Mismatched Node and NPM

The Node and NPM versions are not compatible for the Debian version used from the base image. The Dockerfile needs to be updated to install NPM differently so they are compatible. So installing via apt-get nodejs npm will not work correctly. Instead we can remove the npm and install using https://www.npmjs.com/install.sh.

FROM wordpress:php7.3-apache

# Development tooling dependencies
RUN apt-get update \
	&& apt-get install -y --no-install-recommends \
		bash less default-mysql-client git \
		nodejs curl \
		msmtp \
	&& rm -rf /var/lib/apt/lists/*

RUN curl https://www.npmjs.com/install.sh | sh \
	&& curl -s https://getcomposer.org/installer | php \
	&& mv composer.phar /usr/local/bin/composer

# Include our custom config for PHP and Xdebug.
COPY config/php/* /usr/local/etc/php/conf.d/

# Setup xdebug.
RUN pecl install xdebug; \
	docker-php-ext-enable xdebug;

Add Project Description

Add a project description to the readme that explains what the repository is currently and what it hopes to be when it grows up.

Use a single Docker image with all development dependencies

We're currently using the default WordPress docker image for running the WordPress environment and thecodingmachine/php:7.3-v3-fpm-node8 for things that require Composer and Node. Switching to a single container would simplify the commands and ensure parity between the environment running WordPress and the one running tests, etc.

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

Rate Limited

These updates are currently rate limited. Click on a checkbox below to force their creation now.

  • Update dependency dealerdirect/phpcodesniffer-composer-installer to v0.7.2
  • Update dependency composer/installers to v2

Other Branches

These updates are pending. To force PRs open, click the checkbox below.

  • Update dependency handlebars to 4.7.7 [SECURITY]
  • Update dependency ua-parser-js to 0.7.23 [SECURITY]

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

composer
composer.json
  • php >=7.2
  • composer/installers ^1.7
  • 10up/wp_mock 0.4.2
  • dealerdirect/phpcodesniffer-composer-installer 0.7.1
  • mockery/mockery 1.3.1
  • php-coveralls/php-coveralls 2.2.0
  • phpcompatibility/phpcompatibility-wp 2.1.0
  • phpunit/phpunit 8.5.2
  • wp-coding-standards/wpcs 2.3.0
  • wpsh/local 0.2.3
docker-compose
docker-compose.yml
  • mysql 5
  • mailhog/mailhog no version found
dockerfile
scripts/docker/wordpress/Dockerfile
  • wordpress php7.3-apache
npm
package.json
  • @wordpress/block-editor 3.6.0
  • @wordpress/eslint-plugin 3.4.1
  • @wordpress/scripts 7.0.1
  • npm-run-all 4.1.5
  • node >=10
  • npm >=6.9
nvm
.nvmrc
  • node lts/*

  • Check this box to trigger a request for Renovate to run again on this repository

Calling $plugin->asset_version() Outside the Admin Throws an Error

Because $plugin->asset_version() defaults to $plugin->version() (which pulls from $plugin->meta()), any usage of $plugin->asset_version() outside of the WordPress Admin will fail. This is caused by the usage of get_plugin_data() function (which is only available within the admin).

It makes sense to be able to reuse $plugin->asset_version() for non-admin scripts and styles; as such, one of these methods need to be extended to default to a version if no other versions are found.

In addition, the $plugin->meta() method needs to check for is_admin() or function_exists( 'get_plugin_data' ) before checking the plugin data.

Use /local instead of /scripts for tooling

Use /local as the canonical directory for storing everything that is not part of the actual plugin code such as tooling, Docker config, etc. We could end up with something like:

  • /local/scripts for all Composer/Node scripts used for scaffolding and deploys.
  • /local/public for mounting the root directory of the WordPress development environment.
  • /local/docker for containing any Docker overrides and customizations.

Decide on the PHP requirement logic

WordPress plugins hosted on WP.org should support PHP versions down to 5.6 while most of the enterprise projects can rely on PHP 7+ being present. We need to figure out how to account for both of these scenarios.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.