From ee5a6b6c5cd0ddfb492e5e9660ed278425368d6d Mon Sep 17 00:00:00 2001 From: Mohan Raj Date: Sat, 2 Mar 2024 17:34:28 +0000 Subject: [PATCH 1/3] updates readme --- README.md | 15 +++++++++++---- package.json | 6 +++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a1508dd..b2be6d5 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,12 @@ WordPress Feature flags plugin allow developers to configure features in plugins/themes behind the feature flags on both the server (PHP) and client (JS/TS) side. +## Installation + +`composer require codeb/wp-feature-flags` + +Packagist: https://packagist.org/packages/codeb/wp-feature-flags + ## Hooks ### PHP filters @@ -89,10 +95,11 @@ CSS ### PHP - Run `./local` from your preferred CLI. Ensure you have Docker installed and running. -- The setup will automatically ssh into the container. -- To run unit tests `composer run test:unit` -- To run integrations tests `composer run test:integration` -- To run integrations tests as multisite `composer run test:multisite` + The WordPress unit and integration tests depends on `wp-env` setup. Ensure you run `yarn wp-env:coverage` before running the tests. + +- To run unit tests `yarn php:unit` +- To run integrations tests `yarn php:integration` +- To run integrations tests as multisite `yarn php:multisite` ### JS diff --git a/package.json b/package.json index 870faa0..328e7fd 100644 --- a/package.json +++ b/package.json @@ -60,5 +60,9 @@ "jest-environment-jsdom": "^29.7.0", "prettier": "^3.2.5" }, - "keywords": [] + "keywords": [ + "feature flags", + "wordpress", + "plugin" + ] } From af959b65e1ecb195e685a0a51935287dd7ae4943 Mon Sep 17 00:00:00 2001 From: Mohan Raj Date: Sat, 2 Mar 2024 17:36:46 +0000 Subject: [PATCH 2/3] version bump --- README.md | 3 +- package.json | 134 +++++++++++++++++++++++++-------------------------- plugin.php | 2 +- 3 files changed, 69 insertions(+), 70 deletions(-) diff --git a/README.md b/README.md index b2be6d5..623df23 100644 --- a/README.md +++ b/README.md @@ -94,8 +94,7 @@ CSS ### PHP -- Run `./local` from your preferred CLI. Ensure you have Docker installed and running. - The WordPress unit and integration tests depends on `wp-env` setup. Ensure you run `yarn wp-env:coverage` before running the tests. +The WordPress unit and integration tests depends on `wp-env` setup. Ensure you run `yarn wp-env:coverage` before running the tests. - To run unit tests `yarn php:unit` - To run integrations tests `yarn php:integration` diff --git a/package.json b/package.json index 328e7fd..f6a41d6 100644 --- a/package.json +++ b/package.json @@ -1,68 +1,68 @@ { - "name": "codeb-feature-flags", - "version": "0.3.1", - "description": "Allows developers to enable / disable features based on flags.", - "license": "ISC", - "author": "Mohan Raj ", - "scripts": { - "build": "wp-scripts build", - "lint:css": "wp-scripts lint-style", - "lint:css:fix": "npm run lint:css -- --fix", - "lint:js": "wp-scripts lint-js", - "lint:js:fix": "wp-scripts lint-js --fix", - "prepare": "husky", - "start": "wp-scripts start", - "test:e2e": "npx playwright test --reporter=list", - "test:js": "wp-scripts test-unit-js", - "test:watch": "wp-scripts test-unit-js --watch", - "version:major": "node ./scripts/version major", - "version:minor": "node ./scripts/version minor", - "version:patch": "node ./scripts/version patch", - "wp-env": "wp-env start", - "wp-env:coverage": "wp-env start --xdebug=coverage", - "php:unit": "wp-env run --env-cwd='wp-content/plugins/feature-flags' tests-wordpress composer test:unit", - "php:integration": "wp-env run tests-wordpress --env-cwd=wp-content/plugins/feature-flags composer test:integration", - "php:multisite": "wp-env run tests-wordpress --env-cwd=wp-content/plugins/feature-flags composer test:multisite" - }, - "dependencies": { - "@wordpress/api-fetch": "^6.48.0", - "@wordpress/components": "^27.0.0", - "@wordpress/data": "^9.22.0", - "@wordpress/dom-ready": "^3.52.0", - "@wordpress/hooks": "^3.52.0", - "@wordpress/i18n": "^4.52.0", - "@wordpress/notices": "^4.20.0", - "dotenv": "^16.4.5", - "react": "18.2.0", - "react-dom": "18.2.0", - "react-syntax-highlighter": "^15.5.0", - "react-test-renderer": "^18.2.0", - "ts-loader": "^9.5.1", - "typescript": "^5.3.3" - }, - "devDependencies": { - "@playwright/test": "^1.42.0", - "@testing-library/jest-dom": "^6.4.2", - "@testing-library/react": "14.2.1", - "@types/jest": "^29.5.12", - "@types/node": "^20.11.20", - "@types/react-syntax-highlighter": "^15.5.11", - "@types/wordpress__components": "^23.0.11", - "@wordpress/e2e-test-utils-playwright": "^0.20.0", - "@wordpress/env": "^9.4.0", - "@wordpress/eslint-plugin": "^17.9.0", - "@wordpress/scripts": "^27.3.0", - "eslint": "^8.57.0", - "eslint-import-resolver-alias": "^1.1.2", - "eslint-plugin-cypress": "^2.15.1", - "eslint-plugin-import": "^2.29.1", - "husky": "^9.0.11", - "jest-environment-jsdom": "^29.7.0", - "prettier": "^3.2.5" - }, - "keywords": [ - "feature flags", - "wordpress", - "plugin" - ] -} + "name": "codeb-feature-flags", + "version": "0.3.2", + "description": "Allows developers to enable / disable features based on flags.", + "license": "ISC", + "author": "Mohan Raj ", + "scripts": { + "build": "wp-scripts build", + "lint:css": "wp-scripts lint-style", + "lint:css:fix": "npm run lint:css -- --fix", + "lint:js": "wp-scripts lint-js", + "lint:js:fix": "wp-scripts lint-js --fix", + "prepare": "husky", + "start": "wp-scripts start", + "test:e2e": "npx playwright test --reporter=list", + "test:js": "wp-scripts test-unit-js", + "test:watch": "wp-scripts test-unit-js --watch", + "version:major": "node ./scripts/version major", + "version:minor": "node ./scripts/version minor", + "version:patch": "node ./scripts/version patch", + "wp-env": "wp-env start", + "wp-env:coverage": "wp-env start --xdebug=coverage", + "php:unit": "wp-env run --env-cwd='wp-content/plugins/feature-flags' tests-wordpress composer test:unit", + "php:integration": "wp-env run tests-wordpress --env-cwd=wp-content/plugins/feature-flags composer test:integration", + "php:multisite": "wp-env run tests-wordpress --env-cwd=wp-content/plugins/feature-flags composer test:multisite" + }, + "dependencies": { + "@wordpress/api-fetch": "^6.48.0", + "@wordpress/components": "^27.0.0", + "@wordpress/data": "^9.22.0", + "@wordpress/dom-ready": "^3.52.0", + "@wordpress/hooks": "^3.52.0", + "@wordpress/i18n": "^4.52.0", + "@wordpress/notices": "^4.20.0", + "dotenv": "^16.4.5", + "react": "18.2.0", + "react-dom": "18.2.0", + "react-syntax-highlighter": "^15.5.0", + "react-test-renderer": "^18.2.0", + "ts-loader": "^9.5.1", + "typescript": "^5.3.3" + }, + "devDependencies": { + "@playwright/test": "^1.42.0", + "@testing-library/jest-dom": "^6.4.2", + "@testing-library/react": "14.2.1", + "@types/jest": "^29.5.12", + "@types/node": "^20.11.20", + "@types/react-syntax-highlighter": "^15.5.11", + "@types/wordpress__components": "^23.0.11", + "@wordpress/e2e-test-utils-playwright": "^0.20.0", + "@wordpress/env": "^9.4.0", + "@wordpress/eslint-plugin": "^17.9.0", + "@wordpress/scripts": "^27.3.0", + "eslint": "^8.57.0", + "eslint-import-resolver-alias": "^1.1.2", + "eslint-plugin-cypress": "^2.15.1", + "eslint-plugin-import": "^2.29.1", + "husky": "^9.0.11", + "jest-environment-jsdom": "^29.7.0", + "prettier": "^3.2.5" + }, + "keywords": [ + "feature flags", + "wordpress", + "plugin" + ] +} \ No newline at end of file diff --git a/plugin.php b/plugin.php index 0beac5a..6b174a6 100644 --- a/plugin.php +++ b/plugin.php @@ -9,7 +9,7 @@ * Plugin Name: Feature Flags * Plugin URI: https://github.com/codebtech/wp-feature-flags * Description: Allows developers to enable / disable features based on flags. - * Version: 0.3.1 + * Version: 0.3.2 * Requires at least: 6.4 * Requires PHP: 8.1 * Author: Mohan Raj From 0cf8ef4c17aba643af386d1a0f9d75c98c5259e1 Mon Sep 17 00:00:00 2001 From: Mohan Raj Date: Sat, 2 Mar 2024 17:37:25 +0000 Subject: [PATCH 3/3] version bump --- package.json | 134 +++++++++++++++++++++++++-------------------------- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/package.json b/package.json index f6a41d6..d95b31b 100644 --- a/package.json +++ b/package.json @@ -1,68 +1,68 @@ { - "name": "codeb-feature-flags", - "version": "0.3.2", - "description": "Allows developers to enable / disable features based on flags.", - "license": "ISC", - "author": "Mohan Raj ", - "scripts": { - "build": "wp-scripts build", - "lint:css": "wp-scripts lint-style", - "lint:css:fix": "npm run lint:css -- --fix", - "lint:js": "wp-scripts lint-js", - "lint:js:fix": "wp-scripts lint-js --fix", - "prepare": "husky", - "start": "wp-scripts start", - "test:e2e": "npx playwright test --reporter=list", - "test:js": "wp-scripts test-unit-js", - "test:watch": "wp-scripts test-unit-js --watch", - "version:major": "node ./scripts/version major", - "version:minor": "node ./scripts/version minor", - "version:patch": "node ./scripts/version patch", - "wp-env": "wp-env start", - "wp-env:coverage": "wp-env start --xdebug=coverage", - "php:unit": "wp-env run --env-cwd='wp-content/plugins/feature-flags' tests-wordpress composer test:unit", - "php:integration": "wp-env run tests-wordpress --env-cwd=wp-content/plugins/feature-flags composer test:integration", - "php:multisite": "wp-env run tests-wordpress --env-cwd=wp-content/plugins/feature-flags composer test:multisite" - }, - "dependencies": { - "@wordpress/api-fetch": "^6.48.0", - "@wordpress/components": "^27.0.0", - "@wordpress/data": "^9.22.0", - "@wordpress/dom-ready": "^3.52.0", - "@wordpress/hooks": "^3.52.0", - "@wordpress/i18n": "^4.52.0", - "@wordpress/notices": "^4.20.0", - "dotenv": "^16.4.5", - "react": "18.2.0", - "react-dom": "18.2.0", - "react-syntax-highlighter": "^15.5.0", - "react-test-renderer": "^18.2.0", - "ts-loader": "^9.5.1", - "typescript": "^5.3.3" - }, - "devDependencies": { - "@playwright/test": "^1.42.0", - "@testing-library/jest-dom": "^6.4.2", - "@testing-library/react": "14.2.1", - "@types/jest": "^29.5.12", - "@types/node": "^20.11.20", - "@types/react-syntax-highlighter": "^15.5.11", - "@types/wordpress__components": "^23.0.11", - "@wordpress/e2e-test-utils-playwright": "^0.20.0", - "@wordpress/env": "^9.4.0", - "@wordpress/eslint-plugin": "^17.9.0", - "@wordpress/scripts": "^27.3.0", - "eslint": "^8.57.0", - "eslint-import-resolver-alias": "^1.1.2", - "eslint-plugin-cypress": "^2.15.1", - "eslint-plugin-import": "^2.29.1", - "husky": "^9.0.11", - "jest-environment-jsdom": "^29.7.0", - "prettier": "^3.2.5" - }, - "keywords": [ - "feature flags", - "wordpress", - "plugin" - ] -} \ No newline at end of file + "name": "codeb-feature-flags", + "version": "0.3.2", + "description": "Allows developers to enable / disable features based on flags.", + "license": "ISC", + "author": "Mohan Raj ", + "scripts": { + "build": "wp-scripts build", + "lint:css": "wp-scripts lint-style", + "lint:css:fix": "npm run lint:css -- --fix", + "lint:js": "wp-scripts lint-js", + "lint:js:fix": "wp-scripts lint-js --fix", + "prepare": "husky", + "start": "wp-scripts start", + "test:e2e": "npx playwright test --reporter=list", + "test:js": "wp-scripts test-unit-js", + "test:watch": "wp-scripts test-unit-js --watch", + "version:major": "node ./scripts/version major", + "version:minor": "node ./scripts/version minor", + "version:patch": "node ./scripts/version patch", + "wp-env": "wp-env start", + "wp-env:coverage": "wp-env start --xdebug=coverage", + "php:unit": "wp-env run --env-cwd='wp-content/plugins/feature-flags' tests-wordpress composer test:unit", + "php:integration": "wp-env run tests-wordpress --env-cwd=wp-content/plugins/feature-flags composer test:integration", + "php:multisite": "wp-env run tests-wordpress --env-cwd=wp-content/plugins/feature-flags composer test:multisite" + }, + "dependencies": { + "@wordpress/api-fetch": "^6.48.0", + "@wordpress/components": "^27.0.0", + "@wordpress/data": "^9.22.0", + "@wordpress/dom-ready": "^3.52.0", + "@wordpress/hooks": "^3.52.0", + "@wordpress/i18n": "^4.52.0", + "@wordpress/notices": "^4.20.0", + "dotenv": "^16.4.5", + "react": "18.2.0", + "react-dom": "18.2.0", + "react-syntax-highlighter": "^15.5.0", + "react-test-renderer": "^18.2.0", + "ts-loader": "^9.5.1", + "typescript": "^5.3.3" + }, + "devDependencies": { + "@playwright/test": "^1.42.0", + "@testing-library/jest-dom": "^6.4.2", + "@testing-library/react": "14.2.1", + "@types/jest": "^29.5.12", + "@types/node": "^20.11.20", + "@types/react-syntax-highlighter": "^15.5.11", + "@types/wordpress__components": "^23.0.11", + "@wordpress/e2e-test-utils-playwright": "^0.20.0", + "@wordpress/env": "^9.4.0", + "@wordpress/eslint-plugin": "^17.9.0", + "@wordpress/scripts": "^27.3.0", + "eslint": "^8.57.0", + "eslint-import-resolver-alias": "^1.1.2", + "eslint-plugin-cypress": "^2.15.1", + "eslint-plugin-import": "^2.29.1", + "husky": "^9.0.11", + "jest-environment-jsdom": "^29.7.0", + "prettier": "^3.2.5" + }, + "keywords": [ + "feature flags", + "wordpress", + "plugin" + ] +}