From d20732c63aee9d716d1b614d029ae744cf6cf3d4 Mon Sep 17 00:00:00 2001 From: dkmyta Date: Thu, 9 Jan 2025 05:33:04 -0800 Subject: [PATCH] Add account protection package --- .../account-protection/.gitattributes | 17 +++++ .../packages/account-protection/.gitignore | 2 + .../account-protection/.phan/baseline.php | 12 ++++ .../account-protection/.phan/config.php | 13 ++++ .../account-protection/.phpcs.dir.xml | 24 +++++++ .../packages/account-protection/CHANGELOG.md | 7 ++ .../packages/account-protection/README.md | 24 +++++++ .../account-protection/changelog/.gitkeep | 0 .../changelog/initial-version | 4 ++ .../packages/account-protection/composer.json | 67 +++++++++++++++++++ .../packages/account-protection/package.json | 25 +++++++ .../account-protection/phpunit.xml.dist | 14 ++++ .../src/class-account-protection.php | 16 +++++ .../account-protection/tests/.phpcs.dir.xml | 4 ++ .../tests/php/bootstrap.php | 11 +++ 15 files changed, 240 insertions(+) create mode 100644 projects/packages/account-protection/.gitattributes create mode 100644 projects/packages/account-protection/.gitignore create mode 100644 projects/packages/account-protection/.phan/baseline.php create mode 100644 projects/packages/account-protection/.phan/config.php create mode 100644 projects/packages/account-protection/.phpcs.dir.xml create mode 100644 projects/packages/account-protection/CHANGELOG.md create mode 100644 projects/packages/account-protection/README.md create mode 100644 projects/packages/account-protection/changelog/.gitkeep create mode 100644 projects/packages/account-protection/changelog/initial-version create mode 100644 projects/packages/account-protection/composer.json create mode 100644 projects/packages/account-protection/package.json create mode 100644 projects/packages/account-protection/phpunit.xml.dist create mode 100644 projects/packages/account-protection/src/class-account-protection.php create mode 100644 projects/packages/account-protection/tests/.phpcs.dir.xml create mode 100644 projects/packages/account-protection/tests/php/bootstrap.php diff --git a/projects/packages/account-protection/.gitattributes b/projects/packages/account-protection/.gitattributes new file mode 100644 index 0000000000000..b0b228d4ad6ad --- /dev/null +++ b/projects/packages/account-protection/.gitattributes @@ -0,0 +1,17 @@ +# Files not needed to be distributed in the package. +.gitattributes export-ignore +.github/ export-ignore +package.json export-ignore + +# Files to include in the mirror repo, but excluded via gitignore +# Remember to end all directories with `/**` to properly tag every file. +# /src/js/example.min.js production-include + +# Files to exclude from the mirror repo, but included in the monorepo. +# Remember to end all directories with `/**` to properly tag every file. +.gitignore production-exclude +changelog/** production-exclude +phpunit.xml.dist production-exclude +.phpcs.dir.xml production-exclude +tests/** production-exclude +.phpcsignore production-exclude diff --git a/projects/packages/account-protection/.gitignore b/projects/packages/account-protection/.gitignore new file mode 100644 index 0000000000000..140fd587d2d52 --- /dev/null +++ b/projects/packages/account-protection/.gitignore @@ -0,0 +1,2 @@ +vendor/ +node_modules/ diff --git a/projects/packages/account-protection/.phan/baseline.php b/projects/packages/account-protection/.phan/baseline.php new file mode 100644 index 0000000000000..c7aa9a4dd4f30 --- /dev/null +++ b/projects/packages/account-protection/.phan/baseline.php @@ -0,0 +1,12 @@ + [], + // 'directory_suppressions' => ['src/directory_name' => ['PhanIssueName1', 'PhanIssueName2']] can be manually added if needed. + // (directory_suppressions will currently be ignored by subsequent calls to --save-baseline, but may be preserved in future Phan releases) +]; diff --git a/projects/packages/account-protection/.phan/config.php b/projects/packages/account-protection/.phan/config.php new file mode 100644 index 0000000000000..be8aae4527f9d --- /dev/null +++ b/projects/packages/account-protection/.phan/config.php @@ -0,0 +1,13 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/projects/packages/account-protection/CHANGELOG.md b/projects/packages/account-protection/CHANGELOG.md new file mode 100644 index 0000000000000..721294abd00ad --- /dev/null +++ b/projects/packages/account-protection/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + diff --git a/projects/packages/account-protection/README.md b/projects/packages/account-protection/README.md new file mode 100644 index 0000000000000..990878492b5c2 --- /dev/null +++ b/projects/packages/account-protection/README.md @@ -0,0 +1,24 @@ +# account-protection + +Account protection + +## How to install account-protection + +### Installation From Git Repo + +## Contribute + +## Get Help + +## Using this package in your WordPress plugin + +If you plan on using this package in your WordPress plugin, we would recommend that you use [Jetpack Autoloader](https://packagist.org/packages/automattic/jetpack-autoloader) as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well. + +## Security + +Need to report a security vulnerability? Go to [https://automattic.com/security/](https://automattic.com/security/) or directly to our security bug bounty site [https://hackerone.com/automattic](https://hackerone.com/automattic). + +## License + +account-protection is licensed under [GNU General Public License v2 (or later)](./LICENSE.txt) + diff --git a/projects/packages/account-protection/changelog/.gitkeep b/projects/packages/account-protection/changelog/.gitkeep new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/projects/packages/account-protection/changelog/initial-version b/projects/packages/account-protection/changelog/initial-version new file mode 100644 index 0000000000000..fb1837c901e51 --- /dev/null +++ b/projects/packages/account-protection/changelog/initial-version @@ -0,0 +1,4 @@ +Significance: patch +Type: added + +Initial version. diff --git a/projects/packages/account-protection/composer.json b/projects/packages/account-protection/composer.json new file mode 100644 index 0000000000000..b6a0271497be0 --- /dev/null +++ b/projects/packages/account-protection/composer.json @@ -0,0 +1,67 @@ +{ + "name": "automattic/jetpack-account-protection", + "description": "Account protection", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=7.2" + }, + "require-dev": { + "yoast/phpunit-polyfills": "^1.1.1", + "automattic/jetpack-changelogger": "@dev", + "automattic/wordbless": "dev-master" + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "build-development": "echo 'Add your build step to composer.json, please!'", + "build-production": "echo 'Add your build step to composer.json, please!'", + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "test-coverage": [ + "php -dpcov.directory=. ./vendor/bin/phpunit --coverage-php \"$COVERAGE_DIR/php.cov\"" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "repositories": [ + { + "type": "path", + "url": "../../packages/*", + "options": { + "monorepo": true + } + } + ], + "minimum-stability": "dev", + "prefer-stable": true, + "config": { + "allow-plugins": { + "roots/wordpress-core-installer": true + } + }, + "extra": { + "autotagger": true, + "branch-alias": { + "dev-trunk": "0.1.x-dev" + }, + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-account-protection/compare/v${old}...v${new}" + }, + "mirror-repo": "Automattic/jetpack-account-protection", + "textdomain": "jetpack-account-protection", + "version-constants": { + "::PACKAGE_VERSION": "src/class-account-protection.php" + } + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + } +} diff --git a/projects/packages/account-protection/package.json b/projects/packages/account-protection/package.json new file mode 100644 index 0000000000000..ebf7470206c3c --- /dev/null +++ b/projects/packages/account-protection/package.json @@ -0,0 +1,25 @@ +{ + "private": true, + "name": "@automattic/jetpack-account-protection", + "version": "0.1.0-alpha", + "description": "Account protection", + "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/account-protection/#readme", + "bugs": { + "url": "https://github.com/Automattic/jetpack/labels/[Package] Account Protection" + }, + "repository": { + "type": "git", + "url": "https://github.com/Automattic/jetpack.git", + "directory": "projects/packages/account-protection" + }, + "license": "GPL-2.0-or-later", + "author": "Automattic", + "scripts": { + "build": "echo 'Not implemented.'", + "build-js": "echo 'Not implemented.'", + "build-production": "echo 'Not implemented.'", + "build-production-js": "echo 'Not implemented.'", + "clean": "true" + }, + "devDependencies": {} +} diff --git a/projects/packages/account-protection/phpunit.xml.dist b/projects/packages/account-protection/phpunit.xml.dist new file mode 100644 index 0000000000000..3223c32458db2 --- /dev/null +++ b/projects/packages/account-protection/phpunit.xml.dist @@ -0,0 +1,14 @@ + + + + tests/php + + + + + + + src + + + diff --git a/projects/packages/account-protection/src/class-account-protection.php b/projects/packages/account-protection/src/class-account-protection.php new file mode 100644 index 0000000000000..c895dc25a0216 --- /dev/null +++ b/projects/packages/account-protection/src/class-account-protection.php @@ -0,0 +1,16 @@ + + + + diff --git a/projects/packages/account-protection/tests/php/bootstrap.php b/projects/packages/account-protection/tests/php/bootstrap.php new file mode 100644 index 0000000000000..46763b04a2cdb --- /dev/null +++ b/projects/packages/account-protection/tests/php/bootstrap.php @@ -0,0 +1,11 @@ +