webservco/component-common

Common dependencies for component projects.

v0.0.8 2024-06-22 14:29 UTC

This package is auto-updated.

Last update: 2024-12-09 20:24:09 UTC


README

Common dependencies for component projects.

Component workflow

Create project repository

  • public
  • do not check anything else (no README, etc, make sure repo will be empty initially).

Set up project name

COMPONENT_NAME='COMPONENT_NAME';

Run customization commands (clone component-skeleton)

cd ~/p/webservco-components && \
git clone git@github.com:webservco/component-skeleton.git $COMPONENT_NAME && \
cd $COMPONENT_NAME && \
git remote set-url origin git@github.com:webservco/$COMPONENT_NAME.git && \
rm -f src/WebServCo/.gitignore && git add src/WebServCo && git commit -m 'Init src' && \
printf '%s\n' "# webservco/$COMPONENT_NAME" '' 'A PHP component/library.' '' '---' > README.md && \
sed -i -e "s|\"name\" : \"webservco/component-skeleton\"|\"name\" : \"webservco/$COMPONENT_NAME\"|g" composer.json && \
git add README.md && \
git add composer.json && \
git commit -m 'Customize' && \
git push -u origin main && \
mkdir bin config public resources tests

Add code

Development

Only useful if can not provide environment on local, otherwise it is more complex to work in this way.

# Customize
DOCKER_IMAGE_TAG="webservco-component-${COMPONENT_NAME}";
DOCKER_CONTAINER_NAME="webservco-component-${COMPONENT_NAME}-container";

# Download Docker configuration
svn export --force https://github.com/webservco/component-common.git/trunk/.docker

# Build and run
docker build --tag ${DOCKER_IMAGE_TAG} -f .docker/config/php83-cli-copy/Dockerfile .
docker run -it --rm --name ${DOCKER_CONTAINER_NAME} ${DOCKER_IMAGE_TAG} /bin/bash -c "composer check:phpcs"

# Cleanup
docker image rm ${DOCKER_IMAGE_TAG}

Add dependencies

Publish tag

Publish on packagist

Update index

Index