From 4d477995405ae421b4897dc7ae7781c912422674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Tue, 14 May 2024 10:25:30 +0200 Subject: [PATCH 1/2] Introduce a new @wp-playground/common package to avoid circular dependencies --- .../node/src/test/php-process-manager.spec.ts | 2 +- .../node/src/test/php-request-handler.spec.ts | 2 +- .../blueprints/src/lib/compile.spec.ts | 2 +- .../src/lib/steps/activate-plugin.spec.ts | 2 +- .../src/lib/steps/activate-theme.spec.ts | 2 +- .../blueprints/src/lib/steps/cp.spec.ts | 2 +- .../lib/steps/define-wp-config-consts.spec.ts | 2 +- .../src/lib/steps/enable-multisite.spec.ts | 2 +- .../src/lib/steps/import-wxr.spec.ts | 2 +- .../src/lib/steps/install-plugin.spec.ts | 2 +- .../src/lib/steps/install-theme.spec.ts | 2 +- .../blueprints/src/lib/steps/login.spec.ts | 2 +- .../blueprints/src/lib/steps/mkdir.spec.ts | 2 +- .../blueprints/src/lib/steps/mv.spec.ts | 2 +- .../blueprints/src/lib/steps/rm.spec.ts | 2 +- .../src/lib/steps/site-data.spec.ts | 2 +- packages/playground/cli/src/cli.ts | 2 +- packages/playground/common/.eslintrc.json | 32 +++++++++++ packages/playground/common/README.md | 7 +++ packages/playground/common/package.json | 30 ++++++++++ packages/playground/common/project.json | 56 +++++++++++++++++++ packages/playground/common/src/index.ts | 1 + packages/playground/common/tsconfig.json | 23 ++++++++ packages/playground/common/tsconfig.lib.json | 10 ++++ packages/playground/common/tsconfig.spec.json | 27 +++++++++ packages/playground/common/vite.config.ts | 55 ++++++++++++++++++ packages/playground/sync/src/test/sql.spec.ts | 2 +- tsconfig.base.json | 3 + 28 files changed, 262 insertions(+), 18 deletions(-) create mode 100644 packages/playground/common/.eslintrc.json create mode 100644 packages/playground/common/README.md create mode 100644 packages/playground/common/package.json create mode 100644 packages/playground/common/project.json create mode 100644 packages/playground/common/src/index.ts create mode 100644 packages/playground/common/tsconfig.json create mode 100644 packages/playground/common/tsconfig.lib.json create mode 100644 packages/playground/common/tsconfig.spec.json create mode 100644 packages/playground/common/vite.config.ts diff --git a/packages/php-wasm/node/src/test/php-process-manager.spec.ts b/packages/php-wasm/node/src/test/php-process-manager.spec.ts index e401cac09e..a7d9d16c9f 100644 --- a/packages/php-wasm/node/src/test/php-process-manager.spec.ts +++ b/packages/php-wasm/node/src/test/php-process-manager.spec.ts @@ -1,4 +1,4 @@ -import { RecommendedPHPVersion } from '@wp-playground/wordpress'; +import { RecommendedPHPVersion } from '@wp-playground/common'; import { NodePHP } from '..'; import { PHPProcessManager } from '@php-wasm/universal'; diff --git a/packages/php-wasm/node/src/test/php-request-handler.spec.ts b/packages/php-wasm/node/src/test/php-request-handler.spec.ts index bf1926f9b9..13f16316af 100644 --- a/packages/php-wasm/node/src/test/php-request-handler.spec.ts +++ b/packages/php-wasm/node/src/test/php-request-handler.spec.ts @@ -1,4 +1,4 @@ -import { RecommendedPHPVersion } from '@wp-playground/wordpress'; +import { RecommendedPHPVersion } from '@wp-playground/common'; import { NodePHP } from '..'; import { PHPRequestHandler, SupportedPHPVersions } from '@php-wasm/universal'; import { createSpawnHandler } from '@php-wasm/util'; diff --git a/packages/playground/blueprints/src/lib/compile.spec.ts b/packages/playground/blueprints/src/lib/compile.spec.ts index 8d8299cd26..099d215df4 100644 --- a/packages/playground/blueprints/src/lib/compile.spec.ts +++ b/packages/playground/blueprints/src/lib/compile.spec.ts @@ -5,7 +5,7 @@ import { validateBlueprint, } from './compile'; import { defineWpConfigConsts } from './steps/define-wp-config-consts'; -import { RecommendedPHPVersion } from '@wp-playground/wordpress'; +import { RecommendedPHPVersion } from '@wp-playground/common'; import { PHPRequestHandler } from '@php-wasm/universal'; describe('Blueprints', () => { diff --git a/packages/playground/blueprints/src/lib/steps/activate-plugin.spec.ts b/packages/playground/blueprints/src/lib/steps/activate-plugin.spec.ts index 4c4f62c726..7fbf2ff4cc 100644 --- a/packages/playground/blueprints/src/lib/steps/activate-plugin.spec.ts +++ b/packages/playground/blueprints/src/lib/steps/activate-plugin.spec.ts @@ -1,5 +1,5 @@ import { NodePHP } from '@php-wasm/node'; -import { RecommendedPHPVersion } from '@wp-playground/wordpress'; +import { RecommendedPHPVersion } from '@wp-playground/common'; import { getWordPressModule } from '@wp-playground/wordpress-builds'; import { unzip } from './unzip'; import { activatePlugin } from './activate-plugin'; diff --git a/packages/playground/blueprints/src/lib/steps/activate-theme.spec.ts b/packages/playground/blueprints/src/lib/steps/activate-theme.spec.ts index 3777a453ce..5ce4f05110 100644 --- a/packages/playground/blueprints/src/lib/steps/activate-theme.spec.ts +++ b/packages/playground/blueprints/src/lib/steps/activate-theme.spec.ts @@ -1,5 +1,5 @@ import { NodePHP } from '@php-wasm/node'; -import { RecommendedPHPVersion } from '@wp-playground/wordpress'; +import { RecommendedPHPVersion } from '@wp-playground/common'; import { getWordPressModule } from '@wp-playground/wordpress-builds'; import { unzip } from './unzip'; import { activateTheme } from './activate-theme'; diff --git a/packages/playground/blueprints/src/lib/steps/cp.spec.ts b/packages/playground/blueprints/src/lib/steps/cp.spec.ts index 00c17c95b8..12120a487a 100644 --- a/packages/playground/blueprints/src/lib/steps/cp.spec.ts +++ b/packages/playground/blueprints/src/lib/steps/cp.spec.ts @@ -1,5 +1,5 @@ import { NodePHP } from '@php-wasm/node'; -import { RecommendedPHPVersion } from '@wp-playground/wordpress'; +import { RecommendedPHPVersion } from '@wp-playground/common'; import { cp } from './cp'; const docroot = '/php'; diff --git a/packages/playground/blueprints/src/lib/steps/define-wp-config-consts.spec.ts b/packages/playground/blueprints/src/lib/steps/define-wp-config-consts.spec.ts index ecf8cfcb8d..d95a7c3af7 100644 --- a/packages/playground/blueprints/src/lib/steps/define-wp-config-consts.spec.ts +++ b/packages/playground/blueprints/src/lib/steps/define-wp-config-consts.spec.ts @@ -1,6 +1,6 @@ import { NodePHP } from '@php-wasm/node'; import { rewriteDefineCalls, defineBeforeRun } from './define-wp-config-consts'; -import { RecommendedPHPVersion } from '@wp-playground/wordpress'; +import { RecommendedPHPVersion } from '@wp-playground/common'; describe('rewriteDefineCalls', () => { let php: NodePHP; diff --git a/packages/playground/blueprints/src/lib/steps/enable-multisite.spec.ts b/packages/playground/blueprints/src/lib/steps/enable-multisite.spec.ts index de393cfc7a..c2ed8e2c28 100644 --- a/packages/playground/blueprints/src/lib/steps/enable-multisite.spec.ts +++ b/packages/playground/blueprints/src/lib/steps/enable-multisite.spec.ts @@ -1,5 +1,5 @@ import { NodePHP } from '@php-wasm/node'; -import { RecommendedPHPVersion } from '@wp-playground/wordpress'; +import { RecommendedPHPVersion } from '@wp-playground/common'; import { getWordPressModule } from '@wp-playground/wordpress-builds'; import { unzip } from './unzip'; import { enableMultisite } from './enable-multisite'; diff --git a/packages/playground/blueprints/src/lib/steps/import-wxr.spec.ts b/packages/playground/blueprints/src/lib/steps/import-wxr.spec.ts index c6c44821d9..0d2e24ff6d 100644 --- a/packages/playground/blueprints/src/lib/steps/import-wxr.spec.ts +++ b/packages/playground/blueprints/src/lib/steps/import-wxr.spec.ts @@ -1,5 +1,5 @@ import { NodePHP } from '@php-wasm/node'; -import { RecommendedPHPVersion } from '@wp-playground/wordpress'; +import { RecommendedPHPVersion } from '@wp-playground/common'; import { getWordPressModule } from '@wp-playground/wordpress-builds'; import { importWxr } from './import-wxr'; import { readFile } from 'fs/promises'; diff --git a/packages/playground/blueprints/src/lib/steps/install-plugin.spec.ts b/packages/playground/blueprints/src/lib/steps/install-plugin.spec.ts index cc7ff73287..3025e5c9d5 100644 --- a/packages/playground/blueprints/src/lib/steps/install-plugin.spec.ts +++ b/packages/playground/blueprints/src/lib/steps/install-plugin.spec.ts @@ -1,5 +1,5 @@ import { NodePHP } from '@php-wasm/node'; -import { RecommendedPHPVersion } from '@wp-playground/wordpress'; +import { RecommendedPHPVersion } from '@wp-playground/common'; import { installPlugin } from './install-plugin'; import { phpVar } from '@php-wasm/util'; import { PHPRequestHandler } from '@php-wasm/universal'; diff --git a/packages/playground/blueprints/src/lib/steps/install-theme.spec.ts b/packages/playground/blueprints/src/lib/steps/install-theme.spec.ts index 774fa661ae..6e8c598742 100644 --- a/packages/playground/blueprints/src/lib/steps/install-theme.spec.ts +++ b/packages/playground/blueprints/src/lib/steps/install-theme.spec.ts @@ -1,5 +1,5 @@ import { NodePHP } from '@php-wasm/node'; -import { RecommendedPHPVersion } from '@wp-playground/wordpress'; +import { RecommendedPHPVersion } from '@wp-playground/common'; import { installTheme } from './install-theme'; import { PHPRequestHandler } from '@php-wasm/universal'; diff --git a/packages/playground/blueprints/src/lib/steps/login.spec.ts b/packages/playground/blueprints/src/lib/steps/login.spec.ts index e0827373e0..d4278d7a56 100644 --- a/packages/playground/blueprints/src/lib/steps/login.spec.ts +++ b/packages/playground/blueprints/src/lib/steps/login.spec.ts @@ -1,5 +1,5 @@ import { NodePHP } from '@php-wasm/node'; -import { RecommendedPHPVersion } from '@wp-playground/wordpress'; +import { RecommendedPHPVersion } from '@wp-playground/common'; import { getWordPressModule } from '@wp-playground/wordpress-builds'; import { login } from './login'; import { unzip } from './unzip'; diff --git a/packages/playground/blueprints/src/lib/steps/mkdir.spec.ts b/packages/playground/blueprints/src/lib/steps/mkdir.spec.ts index 39ae46b595..c6c4505e15 100644 --- a/packages/playground/blueprints/src/lib/steps/mkdir.spec.ts +++ b/packages/playground/blueprints/src/lib/steps/mkdir.spec.ts @@ -1,5 +1,5 @@ import { NodePHP } from '@php-wasm/node'; -import { RecommendedPHPVersion } from '@wp-playground/wordpress'; +import { RecommendedPHPVersion } from '@wp-playground/common'; import { mkdir } from './mkdir'; describe('Blueprint step mkdir', () => { diff --git a/packages/playground/blueprints/src/lib/steps/mv.spec.ts b/packages/playground/blueprints/src/lib/steps/mv.spec.ts index 277a149f00..bb08d18636 100644 --- a/packages/playground/blueprints/src/lib/steps/mv.spec.ts +++ b/packages/playground/blueprints/src/lib/steps/mv.spec.ts @@ -1,5 +1,5 @@ import { NodePHP } from '@php-wasm/node'; -import { RecommendedPHPVersion } from '@wp-playground/wordpress'; +import { RecommendedPHPVersion } from '@wp-playground/common'; import { mv } from './mv'; const docroot = '/php'; diff --git a/packages/playground/blueprints/src/lib/steps/rm.spec.ts b/packages/playground/blueprints/src/lib/steps/rm.spec.ts index f128ffbc0c..4da4a0d443 100644 --- a/packages/playground/blueprints/src/lib/steps/rm.spec.ts +++ b/packages/playground/blueprints/src/lib/steps/rm.spec.ts @@ -1,5 +1,5 @@ import { NodePHP } from '@php-wasm/node'; -import { RecommendedPHPVersion } from '@wp-playground/wordpress'; +import { RecommendedPHPVersion } from '@wp-playground/common'; import { rm } from './rm'; const docroot = '/php'; diff --git a/packages/playground/blueprints/src/lib/steps/site-data.spec.ts b/packages/playground/blueprints/src/lib/steps/site-data.spec.ts index d85a3ea17d..98aa9c769b 100644 --- a/packages/playground/blueprints/src/lib/steps/site-data.spec.ts +++ b/packages/playground/blueprints/src/lib/steps/site-data.spec.ts @@ -1,5 +1,5 @@ import { NodePHP } from '@php-wasm/node'; -import { RecommendedPHPVersion } from '@wp-playground/wordpress'; +import { RecommendedPHPVersion } from '@wp-playground/common'; import { getWordPressModule } from '@wp-playground/wordpress-builds'; import { setSiteOptions } from './site-data'; import { unzip } from './unzip'; diff --git a/packages/playground/cli/src/cli.ts b/packages/playground/cli/src/cli.ts index 768f52d630..9c69b302aa 100644 --- a/packages/playground/cli/src/cli.ts +++ b/packages/playground/cli/src/cli.ts @@ -21,7 +21,7 @@ import { import { NodePHP } from '@php-wasm/node'; import { isValidWordPressSlug } from './is-valid-wordpress-slug'; import { EmscriptenDownloadMonitor, ProgressTracker } from '@php-wasm/progress'; -import { RecommendedPHPVersion } from '@wp-playground/wordpress'; +import { RecommendedPHPVersion } from '@wp-playground/common'; export interface Mount { hostPath: string; diff --git a/packages/playground/common/.eslintrc.json b/packages/playground/common/.eslintrc.json new file mode 100644 index 0000000000..ee9ffa963c --- /dev/null +++ b/packages/playground/common/.eslintrc.json @@ -0,0 +1,32 @@ +{ + "extends": ["../../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.json"], + "parser": "jsonc-eslint-parser", + "rules": { + "@nx/dependency-checks": [ + "error", + { + "ignoredFiles": [ + "{projectRoot}/vite.config.{js,ts,mjs,mts}" + ] + } + ] + } + } + ] +} diff --git a/packages/playground/common/README.md b/packages/playground/common/README.md new file mode 100644 index 0000000000..4425ce7d43 --- /dev/null +++ b/packages/playground/common/README.md @@ -0,0 +1,7 @@ +# Playground common + +This package contains common code for the playground packages +that doesn't fit in any other package. For example, the +`RecommendedPHPVersion` is imported virtually everywhere +and including it in any other specific package would result +in a lot of circular dependencies. diff --git a/packages/playground/common/package.json b/packages/playground/common/package.json new file mode 100644 index 0000000000..9958c0636c --- /dev/null +++ b/packages/playground/common/package.json @@ -0,0 +1,30 @@ +{ + "name": "@wp-playground/common", + "version": "0.7.19", + "description": "Common exports and utilities for WordPress Playground", + "repository": { + "type": "git", + "url": "https://github.com/common/common-playground" + }, + "homepage": "https://developer.wordpress.org/playground", + "author": "The WordPress contributors", + "contributors": [ + { + "name": "Adam Zielinski", + "email": "adam@adamziel.com", + "url": "https://github.com/adamziel" + } + ], + "main": "./index.js", + "typings": "./index.d.ts", + "license": "GPL-2.0-or-later", + "type": "module", + "engines": { + "node": ">=18.18.0", + "npm": ">=8.11.0" + }, + "publishConfig": { + "access": "public", + "directory": "../../../dist/packages/playground/common" + } +} diff --git a/packages/playground/common/project.json b/packages/playground/common/project.json new file mode 100644 index 0000000000..f9d8c8a7d0 --- /dev/null +++ b/packages/playground/common/project.json @@ -0,0 +1,56 @@ +{ + "name": "playground-common", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages/playground/common/src", + "projectType": "library", + "targets": { + "build": { + "executor": "@nx/vite:build", + "outputs": ["{options.outputPath}"], + "defaultConfiguration": "production", + "options": { + "outputPath": "dist/packages/playground/common" + }, + "configurations": { + "development": { + "mode": "development" + }, + "production": { + "mode": "production" + } + }, + "dependsOn": ["^build"] + }, + "publish": { + "executor": "nx:run-commands", + "options": { + "command": "node tools/scripts/publish.mjs playground-common {args.ver} {args.tag}", + "parallel": false + }, + "dependsOn": ["build"] + }, + "test": { + "executor": "nx:noop", + "dependsOn": ["test:vite"] + }, + "test:vite": { + "executor": "@nx/vite:test", + "outputs": ["{workspaceRoot}/coverage/packages/playground/common"], + "options": { + "passWithNoTests": true, + "reportsDirectory": "../../../coverage/packages/playground/common" + } + }, + "lint": { + "executor": "@nx/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": [ + "packages/playground/common/**/*.ts", + "packages/playground/common/package.json" + ] + } + } + }, + "tags": [] +} diff --git a/packages/playground/common/src/index.ts b/packages/playground/common/src/index.ts new file mode 100644 index 0000000000..3df13fa675 --- /dev/null +++ b/packages/playground/common/src/index.ts @@ -0,0 +1 @@ +export const RecommendedPHPVersion = '8.0'; diff --git a/packages/playground/common/tsconfig.json b/packages/playground/common/tsconfig.json new file mode 100644 index 0000000000..ad80019880 --- /dev/null +++ b/packages/playground/common/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "module": "ES2022", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "types": ["vitest"] + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/packages/playground/common/tsconfig.lib.json b/packages/playground/common/tsconfig.lib.json new file mode 100644 index 0000000000..672b0253c9 --- /dev/null +++ b/packages/playground/common/tsconfig.lib.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "declaration": true, + "types": ["node", "vite/client"] + }, + "include": ["src/**/*.ts"], + "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] +} diff --git a/packages/playground/common/tsconfig.spec.json b/packages/playground/common/tsconfig.spec.json new file mode 100644 index 0000000000..7b667033a4 --- /dev/null +++ b/packages/playground/common/tsconfig.spec.json @@ -0,0 +1,27 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "types": [ + "vitest/globals", + "vitest/importMeta", + "vite/client", + "node", + "vitest" + ] + }, + "include": [ + "vite.config.ts", + "src/*.test.ts", + "src/*.spec.ts", + "src/**/*.test.ts", + "src/**/*.spec.ts", + "src/**/*.test.tsx", + "src/**/*.spec.tsx", + "src/**/*.test.js", + "src/**/*.spec.js", + "src/**/*.test.jsx", + "src/**/*.spec.jsx", + "src/**/*.d.ts" + ] +} diff --git a/packages/playground/common/vite.config.ts b/packages/playground/common/vite.config.ts new file mode 100644 index 0000000000..0ac4d9e9c1 --- /dev/null +++ b/packages/playground/common/vite.config.ts @@ -0,0 +1,55 @@ +/// +import { defineConfig } from 'vite'; +import dts from 'vite-plugin-dts'; +// eslint-disable-next-line @nx/enforce-module-boundaries +import { viteTsConfigPaths } from '../../vite-ts-config-paths'; + +const path = (filename: string) => new URL(filename, import.meta.url).pathname; +export default defineConfig({ + assetsInclude: ['**/*.wasm', '*.zip'], + cacheDir: '../../../node_modules/.vite/playground-common', + plugins: [ + viteTsConfigPaths({ + root: '../../../', + }), + dts({ + entryRoot: 'src', + tsconfigPath: path('tsconfig.lib.json'), + }), + ], + + build: { + target: 'esnext', + // Important: Vite does not extract static assets as separate files + // in the library mode. assetsInlineLimit: 0 only works + // in the app mode. + // @see https://github.com/vitejs/vite/issues/3295 + assetsInlineLimit: 0, + rollupOptions: { + input: path('src/index.ts'), + // These additional options are required to preserve + // all the exports from the entry point. Otherwise, + // vite only preserves the ones it considers to be used. + output: { + name: 'exportsFromEntryPoint', + // Ensure the main entry point always gets output as index.js + entryFileNames: (chunkInfo: any) => { + if (chunkInfo.name === 'index') { + return 'index.js'; + } + return '[name]-[hash].js'; + }, + }, + preserveEntrySignatures: 'strict', + }, + }, + + test: { + globals: true, + cache: { + dir: '../../../node_modules/.vitest', + }, + environment: 'node', + include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], + }, +}); diff --git a/packages/playground/sync/src/test/sql.spec.ts b/packages/playground/sync/src/test/sql.spec.ts index e763c3cd1e..d8e60305ce 100644 --- a/packages/playground/sync/src/test/sql.spec.ts +++ b/packages/playground/sync/src/test/sql.spec.ts @@ -5,7 +5,7 @@ import { journalSQLQueries, } from '../sql'; import { getWordPressModule } from '@wp-playground/wordpress-builds'; -import { RecommendedPHPVersion } from '@wp-playground/wordpress'; +import { RecommendedPHPVersion } from '@wp-playground/common'; import { unzip } from '@wp-playground/blueprints'; describe('Sync tests', () => { diff --git a/tsconfig.base.json b/tsconfig.base.json index 70a458dd4a..ce8300d301 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -46,6 +46,9 @@ "@wp-playground/client": [ "packages/playground/client/src/index.ts" ], + "@wp-playground/common": [ + "packages/playground/common/src/index.ts" + ], "@wp-playground/nx-extensions": [ "packages/nx-extensions/src/index.ts" ], From edde403e8c07cb2a4cf0df5b18a44f6dc216b7e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Tue, 14 May 2024 10:34:17 +0200 Subject: [PATCH 2/2] Add design notes to README and index.ts --- packages/playground/common/README.md | 7 +++++++ packages/playground/common/src/index.ts | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/packages/playground/common/README.md b/packages/playground/common/README.md index 4425ce7d43..a7894fc85a 100644 --- a/packages/playground/common/README.md +++ b/packages/playground/common/README.md @@ -5,3 +5,10 @@ that doesn't fit in any other package. For example, the `RecommendedPHPVersion` is imported virtually everywhere and including it in any other specific package would result in a lot of circular dependencies. + +Avoid adding new code to this package. @wp-playground/common should remain +as lean as possible. It only exists to avoid circular dependencies. Let's not +use it as a default place to add code that doesn't seem to fit +anywhere else. If there's no good place for your code, perhaps +it needs to be restructured? Or maybe there's a need for a new package? +Let's always consider these questions before adding new code here. diff --git a/packages/playground/common/src/index.ts b/packages/playground/common/src/index.ts index 3df13fa675..c146e4b3d2 100644 --- a/packages/playground/common/src/index.ts +++ b/packages/playground/common/src/index.ts @@ -1 +1,12 @@ +/** + * Avoid adding new code here. @wp-playground/common should remain + * as lean as possible. + * + * This package exists to avoid circular dependencies. Let's not + * use it as a default place to add code that doesn't seem to fit + * anywhere else. If there's no good place for your code, perhaps + * it needs to be restructured? Or maybe there's a need for a new package? + * Let's always consider these questions before adding new code here. + */ + export const RecommendedPHPVersion = '8.0';