Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Analytics: introduce the empty package #37137

Merged
merged 3 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions projects/packages/google-analytics/.gitattributes
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions projects/packages/google-analytics/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vendor/
node_modules/
13 changes: 13 additions & 0 deletions projects/packages/google-analytics/.phan/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
/**
* This configuration will be read and overlaid on top of the
* default configuration. Command-line arguments will be applied
* after this file is read.
*
* @package automattic/jetpack-google-analytics
*/

// Require base config.
require __DIR__ . '/../../../../.phan/config.base.php';

return make_phan_config( dirname( __DIR__ ) );
24 changes: 24 additions & 0 deletions projects/packages/google-analytics/.phpcs.dir.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0"?>
<ruleset>

<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="jetpack-google-analytics" />
</property>
</properties>
</rule>
<rule ref="Jetpack.Functions.I18n">
<properties>
<property name="text_domain" value="jetpack-google-analytics" />
</properties>
</rule>

<rule ref="WordPress.Utils.I18nTextDomainFixer">
<properties>
<property name="old_text_domain" type="array" />
<property name="new_text_domain" value="jetpack-google-analytics" />
</properties>
</rule>

</ruleset>
7 changes: 7 additions & 0 deletions projects/packages/google-analytics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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).

24 changes: 24 additions & 0 deletions projects/packages/google-analytics/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# google-analytics

Set up Google Analytics without touching a line of code.

## How to install google-analytics

### 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

google-analytics is licensed under [GNU General Public License v2 (or later)](./LICENSE.txt)

Empty file.
4 changes: 4 additions & 0 deletions projects/packages/google-analytics/changelog/initial-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: added

Initial version.
56 changes: 56 additions & 0 deletions projects/packages/google-analytics/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"name": "automattic/jetpack-google-analytics",
"description": "Set up Google Analytics without touching a line of code.",
"type": "jetpack-library",
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.0"
},
"require-dev": {
"yoast/phpunit-polyfills": "1.1.0",
"automattic/jetpack-changelogger": "@dev"
},
"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"
],
"test-php": [
"@composer phpunit"
]
},
"repositories": [
{
"type": "path",
"url": "../../packages/*",
"options": {
"monorepo": true
}
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"autotagger": true,
"branch-alias": {
"dev-trunk": "0.1.x-dev"
},
"changelogger": {
"link-template": "https://github.com/Automattic/jetpack-google-analytics/compare/v${old}...v${new}"
},
"mirror-repo": "Automattic/jetpack-google-analytics",
"textdomain": "jetpack-google-analytics",
"version-constants": {
"::PACKAGE_VERSION": "src/class-google-analytics.php"
}
},
"suggest": {
"automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package."
}
}
25 changes: 25 additions & 0 deletions projects/packages/google-analytics/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"private": true,
"name": "@automattic/jetpack-google-analytics",
"version": "0.1.0-alpha",
"description": "Set up Google Analytics without touching a line of code.",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/google-analytics/#readme",
"bugs": {
"url": "https://github.com/Automattic/jetpack/labels/[Package] Google Analytics"
},
"repository": {
"type": "git",
"url": "https://github.com/Automattic/jetpack.git",
"directory": "projects/packages/google-analytics"
},
"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": {}
}
14 changes: 14 additions & 0 deletions projects/packages/google-analytics/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<phpunit bootstrap="tests/php/bootstrap.php" backupGlobals="false" colors="true" convertDeprecationsToExceptions="true">
<testsuites>
<testsuite name="main">
<directory prefix="test" suffix=".php">tests/php</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="false">
<!-- Better to only include "src" than to add "." and then exclude "tests", "vendor", and so on, as PHPUnit still scans the excluded directories. -->
<!-- Add additional lines for any files or directories outside of src/ that need coverage. -->
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</phpunit>
16 changes: 16 additions & 0 deletions projects/packages/google-analytics/src/class-google-analytics.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* Package description here
*
* @package automattic/jetpack-google-analytics
*/

namespace Automattic\Jetpack;

/**
* Class description.
*/
class Google_Analytics {

const PACKAGE_VERSION = '0.1.0-alpha';
}
4 changes: 4 additions & 0 deletions projects/packages/google-analytics/tests/.phpcs.dir.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0"?>
<ruleset>
<rule ref="Jetpack-Tests" />
</ruleset>
11 changes: 11 additions & 0 deletions projects/packages/google-analytics/tests/php/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
/**
* Bootstrap.
*
* @package automattic/
*/

/**
* Include the composer autoloader.
*/
require_once __DIR__ . '/../../vendor/autoload.php';
Loading