Giter VIP home page Giter VIP logo

alexskrypnyk / drupal_extension_scaffold Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 2.0 7.64 MB

Drupal extension template for development and testing in CI of your choice with mirroring to Drupal.org

Home Page: http://drupal-extension-scaffold.alexskrypnyk.com/

License: GNU General Public License v3.0

PHP 12.92% Shell 74.70% JavaScript 6.62% MDX 0.21% CSS 1.57% Makefile 3.97%
circleci circleci2 drupal simpletest template testing

drupal_extension_scaffold's Issues

Add GitHub Actions support

Add GitHub Actions support. Once this is implemented, this project would allow the user to choose which CI provider they would want to use.

  1. Use only scripts from .devtools, but feel free to modify them, if required.
  2. Use the same PHP versions matrix as for CircleCI
  3. Use the same Drupal versions matrix as for CircleCI
  4. Use the format and naming convention of a workflow and jobs from https://github.com/AlexSkrypnyk/scaffold/blob/main/.github/workflows/test-php.yml

See an existing CI implementation: https://github.com/drupal-composer/drupal-project/blob/10.x/.github/workflows/ci.yml

Add init script to make onboarding easier

We need to simplify the setup process as per https://github.com/AlexSkrypnyk/drupal_extension_scaffold?tab=readme-ov-file#setup

The questions themselves should be adjusted for this repo:

  1. namespace
  2. name
  3. machine_name
  4. type: module or theme
  5. ci_provider - GitHub Actions or CircleCI

Add publishing of the documentation site for the scaffold to GH pages

This is about providing the documentation for this scaffold repo, not the repo being scaffolded.

  1. Get docs app setup as in https://github.com/AlexSkrypnyk/scaffold into .scaffold/docs dir. Update paths as required.
  2. Add empty sections as Markdown files:
  • Introduction (use README.md as this is a first page)
  • Setup
  • Usage
  • FAQs
  1. Add GHA integration to publish to GH pages using the default GH domain.

Note: proper domain will be added in a separate ticket.

Add support for custom patches

something like

echo "  > Adding custom patches."
cat <<< "$(jq --indent 4 '.extra.patches = {"drupal/core": {"Builds failing on missing layout column plugin": "https://www.drupal.org/files/issues/2023-07-16/3204271-20-missing-layout-exception.patch"}}' "${BUILD_DIR}/composer.json")" > "${BUILD_DIR}/composer.json"

Make `build.sh` more readable

create local shorthand functions like below and update the rest of the script

drush() { "${BUILD_DIR}/vendor/bin/drush" -y "$@"; }

Add support for installing FE deps

If module provides FE deps - add support to install them.

if [ -f "build/web/modules/custom/${module}/package-lock.json" ]; then
  pushd "build/web/modules/custom/${module}/" > /dev/null || exit 1
  echo "  > Installing theme assets."
  [ -f ".nvm" ] && nvm use || true
  [ ! -d "node_modules" ] && npm ci || true
  popd > /dev/null || exit 1
fi

Add BATs tests for `ahoy` operations

Once #110 implemented, we want to have tests that execute the same activities as a developer would do locally.

We also want to make sure that lint and test failures are picked up by scripts, meaning that we want to have a test where we introduce a failure, running a tool (phpcs, phpstan etc.) and asserting that they have indeed failed.

See https://github.com/AlexSkrypnyk/scaffold/tree/main/tests/scaffold for an example on how to setup tests. (Note that the location in that repo for Scaffold's tests is not correct - the tests should be in .scaffold/tests dir, not tests/scaffold - there is a ticket to fix that in that repo).

Please note that you would need to install ahoy into container - see https://github.com/ahoy-cli/ahoy

Error when missing 'jq'

==> Install additional dev dependencies from module's composer.json
./.circleci/build.sh: line 36: jq: command not found

Installed jq, problem solved.

I don't understand the deployment process to sync with drupal.

Sorry, but I can't understand what to do in the step 2 in CircleCI, I need to create a new key?, if that was the case, what I need to put in hostname?.

In the step 3, where I can obtain the fingerprint?, in github?, sorry but I'm very confused, please give me a clue.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.


Warning

Renovate failed to look up the following dependencies: Failed to look up packagist package drupal/autologout.

Files affected: composer.json


This repository currently has no open or pending branches.

Detected dependencies

composer
composer.json
  • php >=8.2
  • drupal/autologout ^2
github-actions
.github/workflows/assign-author.yml
  • toshimaru/auto-author-assign v2.1.1
.github/workflows/deploy.yml
  • actions/checkout v4
  • shimataro/ssh-key-action v2
  • ubuntu 22.04
.github/workflows/draft-release-notes.yml
  • release-drafter/release-drafter v6
.github/workflows/scaffold-release.yml
  • actions/checkout v4
  • actions/setup-node v4
  • actions/configure-pages v5
  • actions/upload-pages-artifact v3
  • actions/deploy-pages v4
.github/workflows/scaffold-test.yml
  • actions/checkout v4
  • shivammathur/setup-php v2
  • luizm/action-sh-checker v0.8.0
  • actions/setup-node v4
  • actions/upload-artifact v4
  • codecov/codecov-action v4
  • actions/checkout v4
  • actions/checkout v4
  • actions/setup-node v4
  • nwtgck/actions-netlify v3.0
.github/workflows/test.yml
  • actions/checkout v4
  • actions/cache v4
  • shivammathur/setup-php v2
  • actions/upload-artifact v4
  • actions/upload-artifact v4
  • codecov/codecov-action v4
  • ubuntu 22.04
npm
.scaffold/docs/package.json
  • @docusaurus/core 3.4.0
  • @docusaurus/plugin-google-gtag ^3.1.1
  • @docusaurus/preset-classic 3.4.0
  • @docusaurus/theme-mermaid ^3.1.1
  • @easyops-cn/docusaurus-search-local ^0.44.0
  • @mdx-js/react ^3.0.0
  • clsx ^2.0.0
  • prism-react-renderer ^2.3.0
  • raw-loader ^4.0.2
  • react ^18.0.0
  • react-dom ^18.0.0
  • @docusaurus/module-type-aliases 3.4.0
  • @docusaurus/types 3.4.0
  • cspell ^8.6.1
  • node >=18.0
.scaffold/tests/package.json
  • bats-helpers ^1.2
package.json
  • is-positive ^3.1.0
  • npm >=8.0.0
  • node >=18.0.0

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

Add code quality checks configurations

The built artefact created in build directory has PHPCS and PHPStan added as a part of the build.

But there are no config files added for these tools AND there is no way to point the tools to use those configs (unless the tool can somehow discover the config automatically).

We need to do 4 things here:

  1. Update .circleci/build.sh part echo " > Installing other dev dependencies." to use:
php -d memory_limit=-1 "$(command -v composer)" --working-dir="${BUILD_DIR}" require --dev \
  dealerdirect/phpcodesniffer-composer-installer \
  phpspec/prophecy-phpunit:^2 \
  mglaman/phpstan-drupal:^1.2 \
  palantirnet/drupal-rector:^0.18 \
  friendsoftwig/twigcs:^6.2 
  1. Copy configs from https://github.com/drevops/drevops/tree/main for PHPC, PHPStan, Rector and TWIGCS and update them accordingly.
  2. Assess if we need to update .circleci/lint.sh with paths to configurations (based on the tool).
  3. Update README.md file with a newly added list of tools (TWIGCS).

Update repo configs from https://getscaffold.dev/

Download the latest code from Scaffold repo (actual code, not the release).

  • Update composer.json with the structure from Scaffold. Preserve the values of the existing fields, but order the fields as per Scaffold's composer.json. Add missing fields. Do not add scripts. This is an example file to use for the Drupal module itself. It is not meant to be used as a composer install. So just make sure that the order is correct.
  • Add Renovate config from Scaffold
  • Add/update all GitHub actions and configs to be per Scaffold. Note that the test GHA workflow should NOT be used.
  • Update readme to use the structure from Scaffold, including the generated logo (circle). Do not change the contents of the sections, just the structure.
  • Do not add PHPStan or PHPCS packages - these are added automatically when the site is built. We will need to add the config files, but this will be handled in the separate issue (#79).
  • Reformat composer.json to have indents and sorting as per the Scaffold.

Make sure that CI passes.

Similar task for reference: AlexSkrypnyk/shellvar#17

Add `make` support

  • Add support for make to be a command parity to ahoy.yml.
  • Add tests. May need to install make into container.

Only implement this after #126 is done

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.