From 87fa06ce13b783a0b2c80e56539e1c2488a3f7aa Mon Sep 17 00:00:00 2001 From: Ian Ramos <5714212+IanRamosC@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:37:39 -0300 Subject: [PATCH] ExPlat: introduce empty JS package (#37655) * ExPlay: introduce empty package * Fix tests * Remove mirror repo --- pnpm-lock.yaml | 9 +++++ projects/js-packages/explat/.gitattributes | 7 ++++ projects/js-packages/explat/.gitignore | 2 ++ projects/js-packages/explat/CHANGELOG.md | 7 ++++ projects/js-packages/explat/README.md | 24 ++++++++++++++ .../js-packages/explat/changelog/.gitkeep | 0 .../explat/changelog/initial-version | 4 +++ projects/js-packages/explat/composer.json | 31 +++++++++++++++++ projects/js-packages/explat/package.json | 33 +++++++++++++++++++ projects/js-packages/explat/src/index.ts | 2 ++ .../js-packages/explat/tests/index.test.js | 11 +++++++ projects/js-packages/explat/tsconfig.json | 9 +++++ 12 files changed, 139 insertions(+) create mode 100644 projects/js-packages/explat/.gitattributes create mode 100644 projects/js-packages/explat/.gitignore create mode 100644 projects/js-packages/explat/CHANGELOG.md create mode 100644 projects/js-packages/explat/README.md create mode 100644 projects/js-packages/explat/changelog/.gitkeep create mode 100644 projects/js-packages/explat/changelog/initial-version create mode 100644 projects/js-packages/explat/composer.json create mode 100644 projects/js-packages/explat/package.json create mode 100644 projects/js-packages/explat/src/index.ts create mode 100644 projects/js-packages/explat/tests/index.test.js create mode 100644 projects/js-packages/explat/tsconfig.json diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index baa8ac192250a..9f1cafa37158f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -551,6 +551,15 @@ importers: specifier: 29.7.0 version: 29.7.0 + projects/js-packages/explat: + devDependencies: + jest: + specifier: 29.7.0 + version: 29.7.0 + typescript: + specifier: 5.0.4 + version: 5.0.4 + projects/js-packages/i18n-check-webpack-plugin: dependencies: debug: diff --git a/projects/js-packages/explat/.gitattributes b/projects/js-packages/explat/.gitattributes new file mode 100644 index 0000000000000..7e44bd96454e9 --- /dev/null +++ b/projects/js-packages/explat/.gitattributes @@ -0,0 +1,7 @@ +# Files not needed to be distributed in the package. +.gitattributes export-ignore +node_modules export-ignore + +# Files to exclude from the mirror repo +/changelog/** production-exclude +/.eslintrc.cjs production-exclude diff --git a/projects/js-packages/explat/.gitignore b/projects/js-packages/explat/.gitignore new file mode 100644 index 0000000000000..140fd587d2d52 --- /dev/null +++ b/projects/js-packages/explat/.gitignore @@ -0,0 +1,2 @@ +vendor/ +node_modules/ diff --git a/projects/js-packages/explat/CHANGELOG.md b/projects/js-packages/explat/CHANGELOG.md new file mode 100644 index 0000000000000..721294abd00ad --- /dev/null +++ b/projects/js-packages/explat/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/js-packages/explat/README.md b/projects/js-packages/explat/README.md new file mode 100644 index 0000000000000..914201866ee66 --- /dev/null +++ b/projects/js-packages/explat/README.md @@ -0,0 +1,24 @@ +# explat + +JS package component and utils for A/B testing using ExPlat + +## How to install explat + +### 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 + +explat is licensed under [GNU General Public License v2 (or later)](./LICENSE.txt) + diff --git a/projects/js-packages/explat/changelog/.gitkeep b/projects/js-packages/explat/changelog/.gitkeep new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/projects/js-packages/explat/changelog/initial-version b/projects/js-packages/explat/changelog/initial-version new file mode 100644 index 0000000000000..fb1837c901e51 --- /dev/null +++ b/projects/js-packages/explat/changelog/initial-version @@ -0,0 +1,4 @@ +Significance: patch +Type: added + +Initial version. diff --git a/projects/js-packages/explat/composer.json b/projects/js-packages/explat/composer.json new file mode 100644 index 0000000000000..0940fb26caf24 --- /dev/null +++ b/projects/js-packages/explat/composer.json @@ -0,0 +1,31 @@ +{ + "name": "automattic/jetpack-explat", + "description": "JS package component and utils for A/B testing using ExPlat", + "type": "library", + "license": "GPL-2.0-or-later", + "require": {}, + "require-dev": { + "automattic/jetpack-changelogger": "@dev" + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "test-js": [ + "pnpm run test" + ] + }, + "repositories": [ + { + "type": "path", + "url": "../../packages/*", + "options": { + "monorepo": true + } + } + ], + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/projects/js-packages/explat/package.json b/projects/js-packages/explat/package.json new file mode 100644 index 0000000000000..262dda7bdb001 --- /dev/null +++ b/projects/js-packages/explat/package.json @@ -0,0 +1,33 @@ +{ + "private": true, + "name": "@automattic/jetpack-explat", + "version": "0.1.0-alpha", + "description": "JS package component and utils for A/B testing using ExPlat", + "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/explat/#readme", + "bugs": { + "url": "https://github.com/Automattic/jetpack/labels/[JS Package] Explat" + }, + "repository": { + "type": "git", + "url": "https://github.com/Automattic/jetpack.git", + "directory": "projects/js-packages/explat" + }, + "license": "GPL-2.0-or-later", + "author": "Automattic", + "scripts": { + "build": "pnpm run clean && pnpm exec tsc --pretty", + "clean": "rm -rf build/", + "test": "jest tests" + }, + "devDependencies": { + "jest": "29.7.0", + "typescript": "5.0.4" + }, + "exports": { + ".": { + "jetpack:src": "./src/index.ts", + "types": "./build/index.d.ts", + "default": "./build/index.js" + } + } +} diff --git a/projects/js-packages/explat/src/index.ts b/projects/js-packages/explat/src/index.ts new file mode 100644 index 0000000000000..9ad1e06860e5c --- /dev/null +++ b/projects/js-packages/explat/src/index.ts @@ -0,0 +1,2 @@ +// Put your code in this `src/` folder! +// Feel free to delete or rename this file. diff --git a/projects/js-packages/explat/tests/index.test.js b/projects/js-packages/explat/tests/index.test.js new file mode 100644 index 0000000000000..1a4a8047af233 --- /dev/null +++ b/projects/js-packages/explat/tests/index.test.js @@ -0,0 +1,11 @@ +// We recommend using `jest` for testing. If you're testing React code, we recommend `@testing-library/react` and related packages. +// Please match the versions used elsewhere in the monorepo. +// +// Please don't add new uses of `mocha`, `chai`, `sinon`, `enzyme`, and so on. We're trying to standardize on one testing framework. +// +// The default setup is to have files named like "name.test.js" (or .jsx, .ts, or .tsx) in this `tests/` directory. +// But you could instead put them in `src/`, or put files like "name.js" (or .jsx, .ts, or .tsx) in `test` or `__tests__` directories somewhere. + +describe( 'ExPlat', () => { + test.todo( 'Empty test' ); +} ); diff --git a/projects/js-packages/explat/tsconfig.json b/projects/js-packages/explat/tsconfig.json new file mode 100644 index 0000000000000..0e1116eec9836 --- /dev/null +++ b/projects/js-packages/explat/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "jetpack-js-tools/tsconfig.base.json", + "compilerOptions": { + "typeRoots": [ "./node_modules/@types/", "src/*" ], + "outDir": "./build/" + }, + // List all sources and source-containing subdirs. + "include": [ "./src" ] +}