diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 000000000..3bf923686 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,96 @@ +FROM php:8.2-apache + +# Install system dependencies +RUN apt-get update && apt-get install -y \ + git \ + curl \ + libpng-dev \ + libonig-dev \ + libxml2-dev \ + zip \ + unzip \ + zsh + +# Clear cache +RUN apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install PHP extensions +RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd + +# Install Composer +COPY --from=composer:latest /usr/bin/composer /usr/bin/composer + +# Install Node.js 18 +RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - +RUN apt-get install -y nodejs +RUN node --version + +# Install pnpm 8.6+ +RUN npm install -g pnpm@8.6.12 +RUN pnpm --version + +# Install SQLite +RUN apt-get update && apt-get install -y sqlite3 libsqlite3-dev + +# Install additional PHP extensions for Drupal +RUN docker-php-ext-install opcache +RUN pecl install apcu && docker-php-ext-enable apcu + +# Install and enable Xdebug +RUN pecl install xdebug && docker-php-ext-enable xdebug + +# Configure Xdebug for remote debugging +RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/xdebug.ini && \ + echo "xdebug.start_with_request=yes" >> /usr/local/etc/php/conf.d/xdebug.ini && \ + echo "xdebug.client_host=host.docker.internal" >> /usr/local/etc/php/conf.d/xdebug.ini && \ + echo "xdebug.client_port=9003" >> /usr/local/etc/php/conf.d/xdebug.ini && \ + echo "xdebug.log=/tmp/xdebug.log" >> /usr/local/etc/php/conf.d/xdebug.ini + +# Install Oh My Zsh +RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended && \ + # Set Zsh as the default shell + chsh -s /bin/zsh && \ + # Change ownership of the .oh-my-zsh directory + chmod -R 755 /root/.oh-my-zsh + +# Set up a basic .zshrc configuration +RUN cp /root/.oh-my-zsh/templates/zshrc.zsh-template /root/.zshrc && \ + sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="agnoster"/g' /root/.zshrc + + # RUN nvm use 18 +# RUN npm i -g pnpm@8.6.12 + +WORKDIR /workspaces/silverback-template/apps/cms +RUN apt-get update && apt-get install -y git qpdf imagemagick libicu-dev && \ + docker-php-ext-install intl && \ + docker-php-ext-enable intl +RUN composer config --global github-protocols https + +# Change document root for Apache +RUN sed -ri -e 's!/var/www/html!/var/www/html/web!g' /etc/apache2/sites-available/*.conf +RUN sed -ri -e 's!/var/www/!/var/www/html/web!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf + +# Install Helix editor +# RUN apt-get update && apt-get install -y software-properties-common && \ +# add-apt-repository ppa:maveonair/helix-editor && \ +# apt-get update && \ +# apt-get install -y helix + +# Install phpactor +RUN curl -Lo phpactor.phar https://github.com/phpactor/phpactor/releases/latest/download/phpactor.phar && \ + chmod a+x phpactor.phar && \ + mv phpactor.phar /usr/local/bin/phpactor + +# Install GitHub CLI +RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ + && apt update \ + && apt install gh -y + +ENV NETLIFY_URL=http://localhost:8000 +ENV DRUPAL_EXTERNAL_URL=http://localhost:8888 +ENV DRUPAL_INTERNAL_URL=http://127.0.0.1:8888 +ENV PUBLISHER_URL=http://localhost:8000 + +# Enable Apache modules +RUN a2enmod rewrite diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..fb78be150 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,34 @@ +{ + "name": "PHP 8.2 + SQLite 3 + Node 18 + pnpm 8.6+", + "dockerFile": "Dockerfile", + "forwardPorts": [8080], + "workspaceFolder": "/workspaces/silverback-template", + "postCreateCommand": { + "init": "cd /workspaces/silverback-template && pnpm i && cd /workspaces/silverback-template/tests/e2e && pnpm exec playwright install-deps && cd /workspaces/silverback-template && pnpm turbo:prep" + }, + "customizations": { + "vscode": { + "extensions": [ + "felixfbecker.php-debug", + "bmewburn.vscode-intelephense-client", + "esbenp.prettier-vscode", + "ZixuanChen.vitest-explorer", + "GraphQL.vscode-graphql", + "GraphQL.vscode-graphql-syntax", + "eamodio.gitlens", + "GitHub.vscode-pull-request-github", + "GitHub.copilot", + "dbaeumer.vscode-eslint", + "ms-azuretools.vscode-docker", + "ms-playwright.playwright", + "denoland.vscode-deno", + "bradlc.vscode-tailwindcss", + "felixfbecker.php-debug", + "humao.rest-client", + "DEVSENSE.phptools-vscode", + "GitHub.vscode-github-actions", + "Graphite.gti-vscode" + ] + } + } +} diff --git a/.devcontainer/xedbug.ini b/.devcontainer/xedbug.ini new file mode 100644 index 000000000..3f1eea0fd --- /dev/null +++ b/.devcontainer/xedbug.ini @@ -0,0 +1,5 @@ +zend_extension=xdebug.so +xdebug.mode = debug +xdebug.client_host = 127.0.0.1 +xdebug.client_port = 9003 +xdebug.start_with_request = trigger \ No newline at end of file diff --git a/apps/website/deno.lock b/apps/website/deno.lock new file mode 100644 index 000000000..a3d6c26a9 --- /dev/null +++ b/apps/website/deno.lock @@ -0,0 +1,121 @@ +{ + "version": "3", + "packages": { + "specifiers": { + "npm:@netlify/edge-functions@^2.3.1": "npm:@netlify/edge-functions@2.10.0" + }, + "npm": { + "@netlify/edge-functions@2.10.0": { + "integrity": "sha512-toDBus02KyXTeErqXh9mFjH5ocGwSDO8w9q1TkSincqExtm8TMITg3iXr4/SPKE17nKt+olsEuIry5hyM8OJBQ==", + "dependencies": {} + } + } + }, + "remote": { + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/account.ts": "2a728e5787f089e638732dd9a1bd782770d83d403b60bd6d35977045f77ecf70", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/blobs.ts": "d64d5749abee790b4c7adc9a51387670800d6632b7cd148d4fe8337bcb9d0064", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/bypass.ts": "225c35410fbe6f445f53d30e929f39a3547e8792d1147f5c016aa0068aba0b45", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/cache.ts": "b8cbe411e9cac6529a11bce57fa1693aea14c1c614d977e23641efba8976dc66", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/context.ts": "8f99269eeeeccf9b852e6089cc648c962a0ea20b2198b8b38b38e3b2ce2b9143", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/cookie.ts": "8b0baae708989ca183c6f3b4ab3d029e6abcbc2e43f93edeb0ff447b3bbc3a05", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/cookie_store.ts": "83e87d7f704589e257effa270e1abbd9ad0e362f8eeb596be60350a528bc3c1a", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/deno-fs.ts": "ccd0a9335de14e01d77e8937e2320c99a110f5f2a473b80126750e3884ef952a", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/edge_function.ts": "b8253e86aa83c67341f5cfedeba5049d77fbf84dcab7eceff7566b7728ae9b39", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/environment.ts": "c08728e19705bfa2a2f28e28875dd7759cbefdff8fcdd0050453def67286f354", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/feature_flags.ts": "c51489d2ed5c8e760724076502370daeaca8ad1fadb8daf8c876091dd0f8a3e4", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/function_chain.ts": "0c46635a9d80f2d9148adb80d71f404a30caaa6b4407b624b038d1801268ce28", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/geo.ts": "18499de9f6df128568f54ebc6435e37c010ad6a742daae1383ff4a6f997f9767", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/globals.ts": "38f9e0be6c2c78206bf14d2387d41964d38bbe81644b3668e203c6f6473408a7", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/handler.ts": "99212bcd38f57f1284ae6c50ba4b7c517d8bd6230a449def855fe6d47f19871d", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/headers.ts": "dd3c2a80bd3b1e9bd533ef123e0a5401bce90a65044eb3f4949fe8a19f36c398", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/index-combined.ts": "d3d3275ef36aff31e35a56da0db128b0f7403cecc4ca8c9af1e17cb78bfa5ae0", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/invocation_metadata.ts": "e16572a7bdfb504ec7e8b19fa010ae832c5de97cabcc80b3746b47c723d5d197", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/log/instrumented_log.ts": "a844ccdfe394448be89a540c74c1ddb3a03a11276114301a002ebdb08e24f136", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/log/logger.ts": "0f1caa06ee57a8ab4b56cd35403a93329f284981788f2d8bd86d8c76fafb6e93", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/path_parameters.ts": "8266dd6cbb4dbf859aa3536b1250b4daace8f00b2c82e7042006d8d0e448dd52", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/request.ts": "8f0d2aeee6514276a60bb3e3763d991c7ae7bf29cf6ec9b26a2dd8c12a5442d5", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/request_store.ts": "9270fb6d8fb25fb00af79a1406a52084f09d42aa5f8957377d8fecb1bc3b2f99", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/response.ts": "4e0d2537f810028ddbe91138b3526dae3f4c3fb30ff17673342ca971207c21b7", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/retry.ts": "f296ce40940395e9cceb45e7e6df2852cfdd04d560d63b66e0d448550b583f77", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/router.ts": "b787249ecbd87c01a661957302a251ecf6653f3c22d5eb3a6a167b8d07264fdc", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/server.ts": "6266587b87114e510ec9165117620b81e5a01bd24ab41753677e8c828536c5d7", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/site.ts": "c4ab1ea61feaafcebfcc08fb8f501084c92094c5dc4051be049786f403dec0e5", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/stage_2.ts": "a90258046f480d1e423c140d5cdbf305c860283e021d2bcf5eff36d5d6929114", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/util/errors.ts": "e844f57dbb383a04c76523f1b2e30d8b99f8f7afb843a4b936e8d4d2a8a2d990", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/util/execution_context.ts": "b07744eb142427731823df69cdb38a0dd63d7e0e0104a03012dd15a8a3ab8e4d", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/util/fetch.ts": "d701c18a1cbb1624a5f1673d3d1db6b50dee0d27ab6c2a7127bf2a0b8dfc412a", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/util/patch_globals.ts": "142ac9ed16a0389326b51305137006c4bccf10d873d534f3ebb28045fd8e646a", + "https://65f9b38dc160de0008d35515--edge.netlify.com/bootstrap/util/redirect.ts": "bf583fc1a8e018694d842e75aff10cac04c36d12dead39a17f77d440c0c039c2", + "https://deno.land/std@0.170.0/_util/asserts.ts": "d0844e9b62510f89ce1f9878b046f6a57bf88f208a10304aab50efcb48365272", + "https://deno.land/std@0.170.0/async/abortable.ts": "80b2ac399f142cc528f95a037a7d0e653296352d95c681e284533765961de409", + "https://deno.land/std@0.170.0/async/deadline.ts": "2c2deb53c7c28ca1dda7a3ad81e70508b1ebc25db52559de6b8636c9278fd41f", + "https://deno.land/std@0.170.0/async/debounce.ts": "60301ffb37e730cd2d6f9dadfd0ecb2a38857681bd7aaf6b0a106b06e5210a98", + "https://deno.land/std@0.170.0/async/deferred.ts": "77d3f84255c3627f1cc88699d8472b664d7635990d5358c4351623e098e917d6", + "https://deno.land/std@0.170.0/async/delay.ts": "5a9bfba8de38840308a7a33786a0155a7f6c1f7a859558ddcec5fe06e16daf57", + "https://deno.land/std@0.170.0/async/mod.ts": "7809ad4bb223e40f5fdc043e5c7ca04e0e25eed35c32c3c32e28697c553fa6d9", + "https://deno.land/std@0.170.0/async/mux_async_iterator.ts": "770a0ff26c59f8bbbda6b703a2235f04e379f73238e8d66a087edc68c2a2c35f", + "https://deno.land/std@0.170.0/async/pool.ts": "6854d8cd675a74c73391c82005cbbe4cc58183bddcd1fbbd7c2bcda42b61cf69", + "https://deno.land/std@0.170.0/async/retry.ts": "e8e5173623915bbc0ddc537698fa418cf875456c347eda1ed453528645b42e67", + "https://deno.land/std@0.170.0/async/tee.ts": "3a47cc4e9a940904fd4341f0224907e199121c80b831faa5ec2b054c6d2eff5e", + "https://deno.land/std@0.170.0/datetime/to_imf.ts": "bdb0704a986a9bb48fba220722b3d4681e4b8c9c162562ee545ef2eb90b6edcd", + "https://deno.land/std@0.170.0/encoding/base64.ts": "8605e018e49211efc767686f6f687827d7f5fd5217163e981d8d693105640d7a", + "https://deno.land/std@0.170.0/flags/mod.ts": "4f50ec6383c02684db35de38b3ffb2cd5b9fcfcc0b1147055d1980c49e82521c", + "https://deno.land/std@0.170.0/http/cookie.ts": "581464551b3d91739f699fbd6a429e6e8701ae252cf295efcda7379e8410d204", + "https://deno.land/std@0.170.0/http/http_status.ts": "ed24048cc0d06066c944da59b0301da3ae2f990564bb4ad79bb52a09cf8e9b30", + "https://deno.land/x/negotiator@1.0.1/mod.ts": "d8b28a0a7b2d75c944cebef8f87a58eeb344974d432fe0dea85e2d98e03daf24", + "https://deno.land/x/negotiator@1.0.1/src/charset.ts": "ca9e78c774c59fed90e31eed9901b6ac78348cbba1adbba71364abdf56dce7e0", + "https://deno.land/x/negotiator@1.0.1/src/encoding.ts": "bd3e980c10de08798192cd56f1913e0c9f9be2b56391d7b4213f448cc94a0140", + "https://deno.land/x/negotiator@1.0.1/src/language.ts": "bd822581a7621bbe8c3157d38b4f1ec5a35d75eb58bf6be927d477d929e689a2", + "https://deno.land/x/negotiator@1.0.1/src/media_type.ts": "bde7a0f6a276fdb3b72569832ca6050ce5bcacad9d493029239af768bd06149f", + "https://deno.land/x/negotiator@1.0.1/src/types.ts": "3f2a779b3432bd5e2942965f326d82962e7e9b7a72b30fd81aeb0128f898303d", + "https://edge.netlify.com/": "fd941d61d88673d5f28aab283fb86fcc50f08a3bc80ee5470498fcfa88c65cfb", + "https://edge.netlify.com/bootstrap/config.ts": "0aa0a225d978b89e0e62cbd853701605199e7a84095e55eeb70147faf1a24803", + "https://edge.netlify.com/bootstrap/context.ts": "f8392d0bfc4a345f0508157a9ed1a8b0ac832275e5ae6fe9301a8268fbfeb0b5", + "https://edge.netlify.com/bootstrap/cookie.ts": "8b0baae708989ca183c6f3b4ab3d029e6abcbc2e43f93edeb0ff447b3bbc3a05", + "https://edge.netlify.com/bootstrap/edge_function.ts": "b8253e86aa83c67341f5cfedeba5049d77fbf84dcab7eceff7566b7728ae9b39", + "https://edge.netlify.com/bootstrap/globals/types.ts": "a92107bafea2f88f9c7f787575732436abc40e45ccc062c76093096e7c34c84b", + "https://esm.sh/cache-control-parser@2.0.2": "593aa3a40c8885a7459d1125eb2096da3ec6c66b85620a1d3bcb035cd021233f", + "https://esm.sh/v135/cache-control-parser@2.0.2/denonext/cache-control-parser.mjs": "c2ad4a3f3b688914214d1facf9254617ac551c6a203a2353050c9882d26ab219", + "https://v1-7-0--edge-utils.netlify.app/logger/logger.ts": "5e27d74386449246cb2b0b7ac4e2e15bc60965e188fdde15bb5897e28ecb31fa", + "https://v1-7-0--edge-utils.netlify.app/logger/mod.ts": "669a5ec2dceede2926b0e1a7471c449a445f957c1deac559e07fb4c2af390ed1" + }, + "workspace": { + "packageJson": { + "dependencies": [ + "npm:@amazeelabs/bridge-gatsby@^1.2.7", + "npm:@amazeelabs/cloudinary-responsive-image@^1.6.15", + "npm:@amazeelabs/decap-cms-backend-token-auth@^1.2.1", + "npm:@amazeelabs/gatsby-plugin-operations@^1.1.3", + "npm:@amazeelabs/gatsby-plugin-static-dirs@^1.0.1", + "npm:@amazeelabs/gatsby-source-silverback@^1.14.0", + "npm:@amazeelabs/publisher@^2.4.32", + "npm:@amazeelabs/strangler-netlify@^1.1.9", + "npm:@amazeelabs/token-auth-middleware@^1.1.1", + "npm:@netlify/edge-functions@^2.3.1", + "npm:@netlify/functions@^2.6.0", + "npm:@testing-library/react@^14.1.2", + "npm:@types/react-dom@^18.3.0", + "npm:@types/react@^18.3.3", + "npm:@types/serve-static@^1.15.5", + "npm:gatsby-plugin-layout@^4.13.0", + "npm:gatsby-plugin-manifest@^5.13.0", + "npm:gatsby-plugin-netlify@^5.1.1", + "npm:gatsby-plugin-pnpm@^1.2.10", + "npm:gatsby-plugin-robots-txt@^1.8.0", + "npm:gatsby-plugin-sharp@^5.13.0", + "npm:gatsby-plugin-sitemap@^6.13.0", + "npm:gatsby-plugin-uninline-styles@^0.2.0", + "npm:gatsby-source-filesystem@^5.13.0", + "npm:gatsby@^5.13.1", + "npm:happy-dom@^12.10.3", + "npm:image-size@^1.1.1", + "npm:mime-types@^2.1.35", + "npm:netlify-cli@^17.21.1", + "npm:react-dom@^18.2.0", + "npm:react@^18.2.0", + "npm:start-server-and-test@^2.0.3", + "npm:vitest@^1.1.1" + ] + } + } +}