From 559f99a31e4e6e7a0873bf67c089cf814c33fd70 Mon Sep 17 00:00:00 2001 From: Alex Tkachev Date: Mon, 24 Jun 2024 18:18:29 +0400 Subject: [PATCH] feat(SLB-397): platform.sh integration --- .environment | 4 + .platform/applications.yaml | 156 ++++++++++++++++++ .platform/routes.yaml | 16 ++ .platform/services.yaml | 3 + apps/cms/.gitignore | 3 +- apps/cms/composer.json | 4 +- apps/cms/composer.lock | 48 +++++- .../drush/platformsh_generate_drush_yml.php | 82 +++++++++ apps/cms/package.json | 2 +- apps/cms/prep-composer.sh | 12 ++ apps/cms/prep-database.sh | 10 +- apps/cms/scaffold/settings.php.append.txt | 4 + apps/cms/scaffold/settings.platformsh.php | 134 +++++++++++++++ apps/cms/turbo.json | 5 +- apps/preview/package.json | 1 + apps/preview/server/index.ts | 9 +- apps/website/package.json | 3 +- apps/website/publisher.config.ts | 28 +++- apps/website/src/types/platformsh.d.ts | 6 + package.json | 3 + packages/drupal/gutenberg_blocks/package.json | 2 +- 21 files changed, 518 insertions(+), 17 deletions(-) create mode 100644 .environment create mode 100644 .platform/applications.yaml create mode 100644 .platform/routes.yaml create mode 100644 .platform/services.yaml create mode 100644 apps/cms/drush/platformsh_generate_drush_yml.php create mode 100755 apps/cms/prep-composer.sh create mode 100644 apps/cms/scaffold/settings.platformsh.php create mode 100644 apps/website/src/types/platformsh.d.ts diff --git a/.environment b/.environment new file mode 100644 index 000000000..e5518e807 --- /dev/null +++ b/.environment @@ -0,0 +1,4 @@ +# Platform.sh env vars. Used for all apps. +# The file is a script which is executed in Dash. + +export PREVIEW_URL=$(echo $PLATFORM_ROUTES | base64 --decode | jq -r 'to_entries[] | select (.value.id == "preview") | .key') diff --git a/.platform/applications.yaml b/.platform/applications.yaml new file mode 100644 index 000000000..4a8fe4041 --- /dev/null +++ b/.platform/applications.yaml @@ -0,0 +1,156 @@ +cms: + type: 'php:8.2' + + dependencies: + php: + composer/composer: '^2.1' + + runtime: + extensions: + - sodium + + relationships: + database: 'db:mysql' + + disk: 2048 + + mounts: + '/apps/cms/web/sites/default/files': + source: local + source_path: 'files' + '/.drush': + source: local + source_path: 'drush' + + variables: + env: + NVM_VERSION: v0.39.3 + NODE_VERSION: v18.20.2 + + build: + flavor: none + + hooks: + build: | + set -ex + + # Install NVM and switch to node version defined in env vars. Script from + # https://docs.platform.sh/languages/nodejs/node-version.html#use-nvm + set +x + unset NPM_CONFIG_PREFIX + export NVM_DIR="$PLATFORM_APP_DIR/.nvm" + if [ ! -d "$PLATFORM_CACHE_DIR/.nvm" ]; then + mkdir -p $PLATFORM_CACHE_DIR/.nvm + fi + ln -s $PLATFORM_CACHE_DIR/.nvm $NVM_DIR + if [ ! -d "$PLATFORM_CACHE_DIR/.nvm/versions/node/$NODE_VERSION" ]; then + export NVM_INSTALL_FILE="${PLATFORM_CACHE_DIR}/nvm_${NVM_VERSION}_install.sh" + if [ ! -f "$NVM_INSTALL_FILE" ]; then + wget -nc -O "$NVM_INSTALL_FILE" "https://raw.githubusercontent.com/nvm-sh/nvm/$NVM_VERSION/install.sh" + fi + bash $NVM_INSTALL_FILE + fi + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + nvm use "$NODE_VERSION" + set -x + + npm install -g pnpm@8.6.12 + pnpm config set store-dir $PLATFORM_CACHE_DIR/pnpm-store + pnpm i + pnpm turbo:prep:cms + + deploy: | + set -ex + cd apps/cms + php ./drush/platformsh_generate_drush_yml.php + cd web + ../vendor/bin/drush -y deploy + + web: + locations: + '/': + root: 'apps/cms/web' + expires: 5m + passthru: '/index.php' + # Deny access to all static files, except those specifically allowed below. + allow: false + rules: + '\.(avif|webp|jpe?g|png|gif|svgz?|css|js|map|ico|bmp|eot|woff2?|otf|ttf)$': + allow: true + '^/robots\.txt$': + allow: true + '^/sitemap\.xml$': + allow: true + # Deny direct access to configuration files. + '^/sites/sites\.php$': + scripts: false + '^/sites/[^/]+/settings.*?\.php$': + scripts: false + + '/sites/default/files': + allow: true + expires: 5m + passthru: '/index.php' + root: 'apps/cms/web/sites/default/files' + scripts: false + rules: + '^/sites/default/files/(css|js)': + expires: 2w + # Ensure that private files are not accessible. + '^/sites/default/files/private/.*': + allow: false + + crons: + drupal: + spec: '*/15 * * * *' + cmd: 'cd apps/cms/web && ../vendor/bin/drush cron' + +################################################################################ + +preview: + type: 'nodejs:18' + + # AXXX check + # relationships: + # cms: 'cms:http' + + disk: 1024 + + web: + commands: + start: cd apps/preview && pnpm start + + build: + flavor: none + + hooks: + build: | + set -ex + + npm install -g pnpm@8.6.12 + pnpm config set store-dir $PLATFORM_CACHE_DIR/pnpm-store + pnpm i + pnpm turbo:prep:preview + +################################################################################ + +#publisher: +# type: 'nodejs:18' +# +# disk: 1024 +# +# web: +# commands: +# start: cd apps/website && pnpm start +# +# build: +# flavor: none +# +# hooks: +# build: | +# set -ex +# +# npm install -g pnpm@8.6.12 +# pnpm config set store-dir $PLATFORM_CACHE_DIR/pnpm-store +# pnpm i +# pnpm turbo:prep:website diff --git a/.platform/routes.yaml b/.platform/routes.yaml new file mode 100644 index 000000000..e4e62cd45 --- /dev/null +++ b/.platform/routes.yaml @@ -0,0 +1,16 @@ +'https://cms.{default}/': + id: cms + type: upstream + upstream: 'cms:http' + cache: + enabled: true + cookies: ['/^SS?ESS/', '/^Drupal.visitor/'] + +'https://preview.{default}/': + id: preview + type: upstream + upstream: 'preview:http' +#'https://build.{default}/': +# id: publisher +# type: upstream +# upstream: 'publisher:http' diff --git a/.platform/services.yaml b/.platform/services.yaml new file mode 100644 index 000000000..59349f89b --- /dev/null +++ b/.platform/services.yaml @@ -0,0 +1,3 @@ +db: + type: mariadb:10.11 + disk: 2048 diff --git a/apps/cms/.gitignore b/apps/cms/.gitignore index 9f48ed0ec..4b8f42c52 100644 --- a/apps/cms/.gitignore +++ b/apps/cms/.gitignore @@ -13,7 +13,8 @@ !/web/themes/custom # Lagoon integrations -/drush +/drush/sites +/drush/Commands /.drush-lock-update # Silverback diff --git a/apps/cms/composer.json b/apps/cms/composer.json index 50427ad02..30a49d13a 100644 --- a/apps/cms/composer.json +++ b/apps/cms/composer.json @@ -75,7 +75,8 @@ "drupal/userprotect": "^1.2", "drupal/webform": "^6.1.5", "drush/drush": "^12.5", - "enyo/dropzone": "^5.7.1" + "enyo/dropzone": "^5.7.1", + "platformsh/config-reader": "^2.4" }, "conflict": { "drupal/drupal": "*" @@ -118,6 +119,7 @@ }, "[web-root]/sites/default/all.services.yml": "scaffold/all.services.yml", "[web-root]/sites/default/production.settings.php": "scaffold/production.settings.php", + "[web-root]/sites/default/settings.platformsh.php": "scaffold/settings.platformsh.php", "[web-root]/robots.txt": "scaffold/robots.txt" }, "allowed-packages": [ diff --git a/apps/cms/composer.lock b/apps/cms/composer.lock index 6aa58607b..761d4ce8b 100644 --- a/apps/cms/composer.lock +++ b/apps/cms/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f2375207790855cc777235f699c7c2b9", + "content-hash": "eeddb318a084b7dcf824f6a6244c2770", "packages": [ { "name": "amazeeio/drupal_integrations", @@ -6625,6 +6625,49 @@ }, "time": "2021-09-22T16:57:06+00:00" }, + { + "name": "platformsh/config-reader", + "version": "2.4.1", + "source": { + "type": "git", + "url": "https://github.com/platformsh/config-reader-php.git", + "reference": "dc08f50f5a40a767457668ad154116c8ea89cfc6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/platformsh/config-reader-php/zipball/dc08f50f5a40a767457668ad154116c8ea89cfc6", + "reference": "dc08f50f5a40a767457668ad154116c8ea89cfc6", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Platformsh\\ConfigReader\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Larry Garfield", + "email": "larry@platform.sh" + } + ], + "description": "Small helper to access Platform.sh environment variables", + "support": { + "issues": "https://github.com/platformsh/config-reader-php/issues", + "source": "https://github.com/platformsh/config-reader-php/tree/2.4.1" + }, + "time": "2023-09-14T17:07:00+00:00" + }, { "name": "psr/cache", "version": "3.0.0", @@ -15815,8 +15858,5 @@ "php": "^8.2 <8.3" }, "platform-dev": [], - "platform-overrides": { - "php": "8.2" - }, "plugin-api-version": "2.6.0" } diff --git a/apps/cms/drush/platformsh_generate_drush_yml.php b/apps/cms/drush/platformsh_generate_drush_yml.php new file mode 100644 index 000000000..f8f83b425 --- /dev/null +++ b/apps/cms/drush/platformsh_generate_drush_yml.php @@ -0,0 +1,82 @@ +inRuntime()) { + return; + } + + $routes = $platformsh->getUpstreamRoutes($platformsh->applicationName); + + // Sort URLs, with the primary route first, then by HTTPS before HTTP, then by length. + usort($routes, function (array $a, array $b) { + // false sorts before true, normally, so negate the comparison. + return + [!$a['primary'], strpos($a['url'], 'https://') !== 0, strlen($a['url'])] + <=> + [!$b['primary'], strpos($b['url'], 'https://') !== 0, strlen($b['url'])]; + }); + + // Return the url of the first one. + return reset($routes)['url'] ?: NULL; +} + +$appRoot = dirname(__DIR__); +$filename = $appRoot . '/../../.drush/drush.yml'; + +$siteUrl = _platformsh_drush_site_url(); + +if (empty($siteUrl)) { + echo "Failed to find a site URL\n"; + + if (file_exists($filename)) { + echo "The file exists but may be invalid: $filename\n"; + } + + exit(1); +} + +$siteUrlYamlEscaped = json_encode($siteUrl, JSON_UNESCAPED_SLASHES); +$scriptPath = __FILE__; + +$success = file_put_contents($filename, <</dev/null) && ([ -z "$PLATFORM_PROJECT" ] || [ "$PLATFORM_APPLICATION_NAME" = "cms" ]); then + composer install +else + echo 'Skipping composer install.' +fi diff --git a/apps/cms/prep-database.sh b/apps/cms/prep-database.sh index 242782f3c..65488569e 100755 --- a/apps/cms/prep-database.sh +++ b/apps/cms/prep-database.sh @@ -1,10 +1,12 @@ -if [ ! -z $LAGOON ]; then - # Do not touch database on Lagoon - exit 0 -fi +#!/bin/sh set -e +if [ ! -z "$LAGOON" ] || [ ! -z "$PLATFORM_PROJECT" ]; then + # Do not touch database on Lagoon or Platform.sh + exit 0 +fi + if ! test -f web/sites/default/files/.sqlite; then pnpm drupal-install pnpm export-webforms diff --git a/apps/cms/scaffold/settings.php.append.txt b/apps/cms/scaffold/settings.php.append.txt index 00575f853..eefda7a5c 100644 --- a/apps/cms/scaffold/settings.php.append.txt +++ b/apps/cms/scaffold/settings.php.append.txt @@ -65,3 +65,7 @@ if (getenv('LAGOON_ENVIRONMENT') !== 'prod') { // Disable key permissions check for Simple OAuth. // https://www.drupal.org/project/simple_oauth/issues/3021054 $settings['simple_oauth.key_permissions_check'] = FALSE; + +if (getenv('PLATFORM_PROJECT') && file_exists($app_root . '/' . $site_path . '/settings.platformsh.php')) { + include $app_root . '/' . $site_path . '/settings.platformsh.php'; +} diff --git a/apps/cms/scaffold/settings.platformsh.php b/apps/cms/scaffold/settings.platformsh.php new file mode 100644 index 000000000..b8e6b70d7 --- /dev/null +++ b/apps/cms/scaffold/settings.platformsh.php @@ -0,0 +1,134 @@ +hasRelationship('database')) { + $creds = $platformsh->credentials('database'); + $databases['default']['default'] = [ + 'driver' => $creds['scheme'], + 'database' => $creds['path'], + 'username' => $creds['username'], + 'password' => $creds['password'], + 'host' => $creds['host'], + 'port' => $creds['port'], + 'pdo' => [PDO::MYSQL_ATTR_COMPRESS => !empty($creds['query']['compression'])], + 'init_commands' => [ + 'isolation_level' => 'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED', + ], + ]; +} + +// Enable Redis caching. +if ($platformsh->hasRelationship('redis') && !InstallerKernel::installationAttempted() && extension_loaded('redis') && class_exists('Drupal\redis\ClientFactory')) { + $redis = $platformsh->credentials('redis'); + + // Set Redis as the default backend for any cache bin not otherwise specified. + $settings['cache']['default'] = 'cache.backend.redis'; + $settings['redis.connection']['host'] = $redis['host']; + $settings['redis.connection']['port'] = $redis['port']; + + // Apply changes to the container configuration to better leverage Redis. + // This includes using Redis for the lock and flood control systems, as well + // as the cache tag checksum. Alternatively, copy the contents of that file + // to your project-specific services.yml file, modify as appropriate, and + // remove this line. + $settings['container_yamls'][] = 'modules/contrib/redis/example.services.yml'; + + // Allow the services to work before the Redis module itself is enabled. + $settings['container_yamls'][] = 'modules/contrib/redis/redis.services.yml'; + + // Manually add the classloader path, this is required for the container cache bin definition below + // and allows to use it without the redis module being enabled. + $class_loader->addPsr4('Drupal\\redis\\', 'modules/contrib/redis/src'); + + // Use redis for container cache. + // The container cache is used to load the container definition itself, and + // thus any configuration stored in the container itself is not available + // yet. These lines force the container cache to use Redis rather than the + // default SQL cache. + $settings['bootstrap_container_definition'] = [ + 'parameters' => [], + 'services' => [ + 'redis.factory' => [ + 'class' => 'Drupal\redis\ClientFactory', + ], + 'cache.backend.redis' => [ + 'class' => 'Drupal\redis\Cache\CacheBackendFactory', + 'arguments' => ['@redis.factory', '@cache_tags_provider.container', '@serialization.phpserialize'], + ], + 'cache.container' => [ + 'class' => '\Drupal\redis\Cache\PhpRedis', + 'factory' => ['@cache.backend.redis', 'get'], + 'arguments' => ['container'], + ], + 'cache_tags_provider.container' => [ + 'class' => 'Drupal\redis\Cache\RedisCacheTagsChecksum', + 'arguments' => ['@redis.factory'], + ], + 'serialization.phpserialize' => [ + 'class' => 'Drupal\Component\Serialization\PhpSerialize', + ], + ], + ]; +} + +if ($platformsh->inRuntime()) { + // Set the deployment identifier, which is used by some Drupal cache systems. + $settings['deployment_identifier'] = $settings['deployment_identifier'] ?? $platformsh->treeId; +} + +// The 'trusted_hosts_pattern' setting allows an admin to restrict the Host header values +// that are considered trusted. If an attacker sends a request with a custom-crafted Host +// header then it can be an injection vector, depending on how the Host header is used. +// However, Platform.sh already replaces the Host header with the route that was used to reach +// Platform.sh, so it is guaranteed to be safe. The following line explicitly allows all +// Host headers, as the only possible Host header is already guaranteed safe. +$settings['trusted_host_patterns'] = ['.*']; + +// Import variables prefixed with 'drupalsettings:' into $settings +// and 'drupalconfig:' into $config. +foreach ($platformsh->variables() as $name => $value) { + $parts = explode(':', $name); + list($prefix, $key) = array_pad($parts, 3, null); + switch ($prefix) { + // Variables that begin with `drupalsettings` or `drupal` get mapped + // to the $settings array verbatim, even if the value is an array. + // For example, a variable named drupalsettings:example-setting' with + // value 'foo' becomes $settings['example-setting'] = 'foo'; + case 'drupalsettings': + case 'drupal': + $settings[$key] = $value; + break; + // Variables that begin with `drupalconfig` get mapped to the $config + // array. Deeply nested variable names, with colon delimiters, + // get mapped to deeply nested array elements. Array values + // get added to the end just like a scalar. Variables without + // both a config object name and property are skipped. + // Example: Variable `drupalconfig:conf_file:prop` with value `foo` becomes + // $config['conf_file']['prop'] = 'foo'; + // Example: Variable `drupalconfig:conf_file:prop:subprop` with value `foo` becomes + // $config['conf_file']['prop']['subprop'] = 'foo'; + // Example: Variable `drupalconfig:conf_file:prop:subprop` with value ['foo' => 'bar'] becomes + // $config['conf_file']['prop']['subprop']['foo'] = 'bar'; + // Example: Variable `drupalconfig:prop` is ignored. + case 'drupalconfig': + if (count($parts) > 2) { + $temp = &$config[$key]; + foreach (array_slice($parts, 2) as $n) { + $prev = &$temp; + $temp = &$temp[$n]; + } + $prev[$n] = $value; + } + break; + } +} diff --git a/apps/cms/turbo.json b/apps/cms/turbo.json index 36ad2b625..f1cf8cb57 100644 --- a/apps/cms/turbo.json +++ b/apps/cms/turbo.json @@ -20,7 +20,7 @@ "web/sites/default/files/**", "../../packages/ui/static/stories/webforms/**" ], - "env": ["CI", "LAGOON"] + "env": ["CI", "LAGOON", "PLATFORM_PROJECT"] }, "prep:composer": { "inputs": ["composer.json", "composer.lock", "scaffold/**", "patches/**"], @@ -32,7 +32,8 @@ "!web/modules/custom/**", "!web/themes/custom/**", "!web/sites/default/files/**" - ] + ], + "env": ["PLATFORM_PROJECT", "PLATFORM_APPLICATION_NAME"] }, "test:integration": { "dependsOn": [ diff --git a/apps/preview/package.json b/apps/preview/package.json index e5ec902c5..31fc1648d 100644 --- a/apps/preview/package.json +++ b/apps/preview/package.json @@ -16,6 +16,7 @@ "@custom/ui": "workspace:*", "express": "^4.19.2", "express-ws": "^5.0.2", + "platformsh-config": "^2.4.1", "react": "^18.2.0", "react-dom": "^18.2.0", "rxjs": "^7.8.1" diff --git a/apps/preview/server/index.ts b/apps/preview/server/index.ts index 333df04a0..1041e1467 100644 --- a/apps/preview/server/index.ts +++ b/apps/preview/server/index.ts @@ -1,7 +1,14 @@ import express from 'express'; import expressWs from 'express-ws'; +import platformsh from 'platformsh-config'; import { Subject } from 'rxjs'; +const platformshConfig = platformsh.config(); +const isPlatform = platformshConfig.isValidPlatform(); +if (platformshConfig.isValidPlatform() && !platformshConfig.inBuild()) { + process.env.DRUPAL_URL = platformshConfig.getRoute('cms').url; +} + const expressServer = express(); const expressWsInstance = expressWs(expressServer); const { app } = expressWsInstance; @@ -39,7 +46,7 @@ app.get('/__preview/*', (req, _, next) => { app.use(express.static('./dist')); const isLagoon = !!process.env.LAGOON; -const port = isLagoon ? 3000 : 8001; +const port = isLagoon ? 3000 : isPlatform ? platformshConfig.port : 8001; console.log(`Server is running on port ${port}`); app.listen({ port, host: '0.0.0.0' }); diff --git a/apps/website/package.json b/apps/website/package.json index 8ba4d3ae7..27dd63f3d 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -28,6 +28,7 @@ "image-size": "^1.1.1", "mime-types": "^2.1.35", "netlify-cli": "^17.21.1", + "platformsh-config": "^2.4.1", "react": "^18.2.0", "react-dom": "^18.2.0" }, @@ -43,7 +44,7 @@ "vitest": "^1.1.1" }, "scripts": { - "test:static": "tsc --noEmit && eslint '**/*.{ts,tsx,js,jsx}' --ignore-path='./.gitignore'", + "test:static": "tsc --noEmit && eslint '**/*.{ts,tsx,js,jsx}' --ignore-path='./.gitignore' --config ../../.eslintrc.json", "full-rebuild": "pnpm clean && pnpm build:gatsby", "start:drupal": "pnpm run --filter @custom/cms start", "build:drupal": "CLOUDINARY_CLOUDNAME=test pnpm start-test start:drupal 8888 build:gatsby", diff --git a/apps/website/publisher.config.ts b/apps/website/publisher.config.ts index 6c5d95797..9597531b7 100644 --- a/apps/website/publisher.config.ts +++ b/apps/website/publisher.config.ts @@ -1,10 +1,14 @@ import { defineConfig } from '@amazeelabs/publisher'; +import platformsh from 'platformsh-config'; + +const platformshConfig = platformsh.config(); +const isPlatform = platformshConfig.isValidPlatform(); const isNetlifyEnabled = !!process.env.NETLIFY_SITE_ID && !!process.env.NETLIFY_AUTH_TOKEN; const isLagoon = !!process.env.LAGOON; -export default defineConfig({ +const defaultConfig = defineConfig({ commands: { build: { command: isNetlifyEnabled @@ -52,3 +56,25 @@ export default defineConfig({ } : undefined, }); + +const temporaryPlatformConfig = defineConfig({ + commands: { + build: { + command: + 'echo "Starting fake build" && sleep 5 && echo "Fake build done"', + outputTimeout: 1000 * 60 * 10, + }, + clean: 'pnpm clean', + serve: { + command: 'exit 0', + readyPattern: 'Server now ready', + readyTimeout: 1000 * 60, + port: 7999, + }, + deploy: 'echo "Fake deployment done"', + }, + databaseUrl: '/tmp/publisher.sqlite', + publisherPort: platformshConfig.port, +}); + +export default isPlatform ? temporaryPlatformConfig : defaultConfig; diff --git a/apps/website/src/types/platformsh.d.ts b/apps/website/src/types/platformsh.d.ts new file mode 100644 index 000000000..2d71437e8 --- /dev/null +++ b/apps/website/src/types/platformsh.d.ts @@ -0,0 +1,6 @@ +declare module 'platformsh-config' { + export const config: () => { + isValidPlatform: () => boolean; + get port(): number; + }; +} diff --git a/package.json b/package.json index c86941856..baf3f2d9a 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,9 @@ "turbo:test:quick": "pnpm turbo:local && pnpm tb test:unit --no-daemon --go-fallback --output-logs=new-only", "turbo:prep": "pnpm turbo:local && pnpm tb prep --no-daemon --go-fallback --output-logs=new-only", "turbo:prep:force": "rm -f apps/cms/web/sites/default/files/.sqlite && pnpm tb prep --no-daemon --go-fallback --force", + "turbo:prep:cms": "pnpm turbo prep --filter @custom/cms --no-daemon --go-fallback --output-logs=new-only", + "turbo:prep:preview": "pnpm turbo prep --filter @custom/preview --no-daemon --go-fallback --output-logs=new-only", + "turbo:prep:website": "pnpm turbo prep --filter @custom/website --no-daemon --go-fallback --output-logs=new-only", "gutenberg:generate": "pnpm run --filter \"@custom/gutenberg_blocks\" gutenberg:generate" }, "private": true, diff --git a/packages/drupal/gutenberg_blocks/package.json b/packages/drupal/gutenberg_blocks/package.json index e5a3cc019..a75f88fff 100644 --- a/packages/drupal/gutenberg_blocks/package.json +++ b/packages/drupal/gutenberg_blocks/package.json @@ -5,7 +5,7 @@ "scripts": { "dev": "vite build --watch", "prep": "vite build", - "test:static": "tsc --noEmit && eslint \"**/*.{ts,tsx,js,jsx}\" --ignore-path=\"./.eslintignore\"", + "test:static": "tsc --noEmit && eslint \"**/*.{ts,tsx,js,jsx}\" --ignore-path=\"./.eslintignore\" --config ../../../.eslintrc.json", "test:fix": "tsc --noEmit && eslint \"**/*.{ts,tsx,js,jsx}\" --ignore-path=\"./.eslintignore\" --fix", "gutenberg:generate": "node ./scripts/generate-gutenberg-block.js" },