commit
9d08ac8ac3
|
@ -13,6 +13,9 @@ project.properties
|
|||
*.sublime-workspace
|
||||
.sublimelinterrc
|
||||
|
||||
# Eslint Cache
|
||||
.eslintcache
|
||||
|
||||
# Environment files
|
||||
wp-cli.local.yml
|
||||
yarn-error.log
|
||||
|
|
37
nx.json
37
nx.json
|
@ -1,20 +1,17 @@
|
|||
{
|
||||
"npmScope": "woocommerce",
|
||||
"affected": {
|
||||
"defaultBase": "trunk"
|
||||
},
|
||||
"implicitDependencies": {
|
||||
"package.json": {
|
||||
"dependencies": "*",
|
||||
"devDependencies": "*"
|
||||
},
|
||||
".eslintrc.json": "*"
|
||||
},
|
||||
"extends": "@nrwl/workspace/presets/npm.json",
|
||||
"npmScope": "woocommerce-monorepo",
|
||||
"tasksRunnerOptions": {
|
||||
"default": {
|
||||
"runner": "@nrwl/workspace/tasks-runners/default",
|
||||
"options": {
|
||||
"cacheableOperations": ["build", "lint", "test", "e2e"]
|
||||
"cacheableOperations": [
|
||||
"build",
|
||||
"test",
|
||||
"lint",
|
||||
"package",
|
||||
"prepare"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -24,7 +21,21 @@
|
|||
"target": "build",
|
||||
"projects": "dependencies"
|
||||
}
|
||||
],
|
||||
"prepare": [
|
||||
{
|
||||
"target": "prepare",
|
||||
"projects": "dependencies"
|
||||
}
|
||||
],
|
||||
"package": [
|
||||
{
|
||||
"target": "package",
|
||||
"projects": "dependencies"
|
||||
}
|
||||
]
|
||||
},
|
||||
"projects": {}
|
||||
"affected": {
|
||||
"defaultBase": "trunk"
|
||||
}
|
||||
}
|
||||
|
|
80
package.json
80
package.json
|
@ -1,39 +1,45 @@
|
|||
{
|
||||
"name": "woocommerce-monorepo",
|
||||
"title": "WooCommerce Monorepo",
|
||||
"description": "Monorepo for the WooCommerce ecosystem",
|
||||
"homepage": "https://woocommerce.com/",
|
||||
"private": true,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/woocommerce/woocommerce.git"
|
||||
},
|
||||
"author": "Automattic",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"bugs": {
|
||||
"url": "https://github.com/woocommerce/woocommerce/issues"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nrwl/tao": "12.10.0",
|
||||
"@nrwl/cli": "12.10.0",
|
||||
"@nrwl/workspace": "12.10.0",
|
||||
"@types/node": "14.14.33",
|
||||
"@woocommerce/eslint-plugin": "^1.2.0",
|
||||
"@wordpress/prettier-config": "^1.0.5",
|
||||
"chalk": "^4.1.2",
|
||||
"glob": "^7.2.0",
|
||||
"jest": "^27.0.6",
|
||||
"mkdirp": "^1.0.4",
|
||||
"node-stream-zip": "^1.13.6",
|
||||
"prettier": "npm:wp-prettier@2.2.1-beta-1",
|
||||
"request": "^2.88.2",
|
||||
"typescript": "4.2.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "7.12.9",
|
||||
"@wordpress/babel-plugin-import-jsx-pragma": "^3.1.0",
|
||||
"@wordpress/babel-preset-default": "^6.3.3",
|
||||
"lodash": "^4.17.21",
|
||||
"wp-textdomain": "1.0.1"
|
||||
}
|
||||
"name": "woocommerce-monorepo",
|
||||
"title": "WooCommerce Monorepo",
|
||||
"description": "Monorepo for the WooCommerce ecosystem",
|
||||
"homepage": "https://woocommerce.com/",
|
||||
"private": true,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/woocommerce/woocommerce.git"
|
||||
},
|
||||
"author": "Automattic",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"bugs": {
|
||||
"url": "https://github.com/woocommerce/woocommerce/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"preinstall": "npx only-allow pnpm"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@automattic/nx-composer": "^0.1.0",
|
||||
"@nrwl/cli": "latest",
|
||||
"@nrwl/linter": "^13.1.3",
|
||||
"@nrwl/tao": "latest",
|
||||
"@nrwl/web": "^13.1.3",
|
||||
"@nrwl/workspace": "latest",
|
||||
"@types/node": "14.14.33",
|
||||
"@woocommerce/eslint-plugin": "^1.2.0",
|
||||
"@wordpress/prettier-config": "^1.0.5",
|
||||
"chalk": "^4.1.2",
|
||||
"glob": "^7.2.0",
|
||||
"jest": "^27.0.6",
|
||||
"mkdirp": "^1.0.4",
|
||||
"node-stream-zip": "^1.13.6",
|
||||
"prettier": "npm:wp-prettier@2.2.1-beta-1",
|
||||
"request": "^2.88.2",
|
||||
"typescript": "4.2.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "7.12.9",
|
||||
"@wordpress/babel-plugin-import-jsx-pragma": "^3.1.0",
|
||||
"@wordpress/babel-preset-default": "^6.3.3",
|
||||
"lodash": "^4.17.21",
|
||||
"wp-textdomain": "1.0.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"root": "packages/js/api-core-tests/",
|
||||
"sourceRoot": "packages/js/api-core-tests",
|
||||
"projectType": "library",
|
||||
"targets": {
|
||||
"test": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "test"
|
||||
}
|
||||
},
|
||||
"test-hello": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "test:hello"
|
||||
}
|
||||
},
|
||||
"make-collection": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "make:collection"
|
||||
}
|
||||
},
|
||||
"test-api": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "test:api"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,12 +1,9 @@
|
|||
module.exports = {
|
||||
parser: '@typescript-eslint/parser',
|
||||
env: {
|
||||
'jest/globals': true
|
||||
'jest/globals': true,
|
||||
},
|
||||
ignorePatterns: [
|
||||
'dist/',
|
||||
'node_modules/'
|
||||
],
|
||||
ignorePatterns: [ 'dist/', 'node_modules/' ],
|
||||
rules: {
|
||||
'no-unused-vars': 'off',
|
||||
'no-dupe-class-members': 'off',
|
||||
|
@ -14,18 +11,11 @@ module.exports = {
|
|||
'no-useless-constructor': 'off',
|
||||
'@typescript-eslint/no-useless-constructor': 2,
|
||||
},
|
||||
plugins: [
|
||||
'@typescript-eslint'
|
||||
],
|
||||
extends: [
|
||||
'plugin:@wordpress/eslint-plugin/recommended-with-formatting'
|
||||
],
|
||||
plugins: [ '@typescript-eslint/eslint-plugin' ],
|
||||
extends: [ 'plugin:@wordpress/eslint-plugin/recommended-with-formatting' ],
|
||||
overrides: [
|
||||
{
|
||||
files: [
|
||||
'**/*.js',
|
||||
'**/*.ts'
|
||||
],
|
||||
files: [ '**/*.js', '**/*.ts' ],
|
||||
settings: {
|
||||
jsdoc: {
|
||||
mode: 'typescript',
|
||||
|
@ -33,13 +23,10 @@ module.exports = {
|
|||
},
|
||||
},
|
||||
{
|
||||
files: [
|
||||
'**/*.spec.ts',
|
||||
'**/*.test.ts'
|
||||
],
|
||||
files: [ '**/*.spec.ts', '**/*.test.ts' ],
|
||||
rules: {
|
||||
'no-console': 'off',
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -43,6 +43,9 @@
|
|||
"@types/jest": "25.2.1",
|
||||
"@types/moxios": "^0.4.9",
|
||||
"@types/node": "13.13.5",
|
||||
"@typescript-eslint/eslint-plugin": "^5.3.0",
|
||||
"@typescript-eslint/parser": "^5.3.0",
|
||||
"eslint": "^8.1.0",
|
||||
"jest": "^25.1.0",
|
||||
"jest-mock-extended": "^1.0.10",
|
||||
"moxios": "0.4.0",
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
"root": "packages/js/api/",
|
||||
"sourceRoot": "packages/js/api/src",
|
||||
"projectType": "library",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "build"
|
||||
}
|
||||
},
|
||||
"clean": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "clean"
|
||||
}
|
||||
},
|
||||
"compile": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "compile"
|
||||
}
|
||||
},
|
||||
"prepare": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "prepare"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "lint"
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "test"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"root": "packages/js/e2e-core-tests/",
|
||||
"sourceRoot": "packages/js/e2e-core-tests",
|
||||
"projectType": "library"
|
||||
}
|
|
@ -2,7 +2,11 @@
|
|||
|
||||
echo "Initializing WooCommerce E2E"
|
||||
|
||||
wp plugin activate woocommerce
|
||||
# This is a workaround to accommodate different directory names.
|
||||
wp plugin activate --all
|
||||
wp plugin deactivate akismet
|
||||
wp plugin deactivate hello
|
||||
|
||||
wp theme install twentynineteen --activate
|
||||
wp user create customer customer@woocommercecoree2etestsuite.com \
|
||||
--user_pass=password \
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
"@babel/polyfill": "7.12.1",
|
||||
"@babel/preset-env": "7.12.7",
|
||||
"@wordpress/eslint-plugin": "7.3.0",
|
||||
"eslint": "^8.1.0",
|
||||
"ndb": "^1.1.5",
|
||||
"semver": "^7.3.2"
|
||||
},
|
||||
|
@ -58,7 +59,8 @@
|
|||
"docker:ssh": "docker exec -it $(node utils/get-app-name.js)_wordpress-www /bin/bash",
|
||||
"test:e2e": "bash ./bin/wait-for-build.sh && ./bin/e2e-test-integration.js",
|
||||
"test:e2e-debug": "bash ./bin/wait-for-build.sh && ./bin/e2e-test-integration.js --dev --debug",
|
||||
"test:e2e-dev": "bash ./bin/wait-for-build.sh && ./bin/e2e-test-integration.js --dev"
|
||||
"test:e2e-dev": "bash ./bin/wait-for-build.sh && ./bin/e2e-test-integration.js --dev",
|
||||
"lint": "eslint src"
|
||||
},
|
||||
"bin": {
|
||||
"wc-e2e": "bin/wc-e2e.sh"
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
{
|
||||
"root": "packages/js/e2e-environment/",
|
||||
"sourceRoot": "packages/js/e2e-environment/src",
|
||||
"projectType": "library",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "build"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "lint"
|
||||
}
|
||||
},
|
||||
"clean": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "clean"
|
||||
}
|
||||
},
|
||||
"compile": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "compile"
|
||||
}
|
||||
},
|
||||
"prepare": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "prepare"
|
||||
}
|
||||
},
|
||||
"docker-up": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "docker:up"
|
||||
}
|
||||
},
|
||||
"docker-down": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "docker:down"
|
||||
}
|
||||
},
|
||||
"docker-clear-all": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "docker:clear-all"
|
||||
}
|
||||
},
|
||||
"docker-ssh": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "docker:ssh"
|
||||
}
|
||||
},
|
||||
"test-e2e": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "test:e2e"
|
||||
}
|
||||
},
|
||||
"test-e2e-debug": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "test:e2e-debug"
|
||||
}
|
||||
},
|
||||
"test-e2e-dev": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "test:e2e-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
module.exports = {
|
||||
parser: '@typescript-eslint/parser',
|
||||
env: {
|
||||
'jest/globals': true,
|
||||
},
|
||||
ignorePatterns: [ 'dist/', 'node_modules/' ],
|
||||
rules: {
|
||||
'no-unused-vars': 'off',
|
||||
'no-dupe-class-members': 'off',
|
||||
|
||||
'no-useless-constructor': 'off',
|
||||
'@typescript-eslint/no-useless-constructor': 2,
|
||||
},
|
||||
plugins: [ '@typescript-eslint/eslint-plugin' ],
|
||||
extends: [ 'plugin:@wordpress/eslint-plugin/recommended-with-formatting' ],
|
||||
overrides: [
|
||||
{
|
||||
files: [ '**/*.js', '**/*.ts' ],
|
||||
settings: {
|
||||
jsdoc: {
|
||||
mode: 'typescript',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
files: [ '**/*.spec.ts', '**/*.test.ts' ],
|
||||
rules: {
|
||||
'no-console': 'off',
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
|
@ -17,6 +17,11 @@
|
|||
"faker": "^5.1.0",
|
||||
"fishery": "^1.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^5.3.0",
|
||||
"@typescript-eslint/parser": "^5.3.0",
|
||||
"eslint": "^8.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@woocommerce/api": "^0.2.0"
|
||||
},
|
||||
|
@ -27,6 +32,7 @@
|
|||
"clean": "rm -rf ./build ./build-module",
|
||||
"compile": "node ./../bin/build.js",
|
||||
"build": "pnpm run clean && pnpm run compile",
|
||||
"prepare": "pnpm run build"
|
||||
"prepare": "pnpm run build",
|
||||
"lint": "eslint src"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"root": "packages/js/e2e-utils/",
|
||||
"sourceRoot": "packages/js/e2e-utils/src",
|
||||
"projectType": "library",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "build"
|
||||
}
|
||||
},
|
||||
"clean": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "clean"
|
||||
}
|
||||
},
|
||||
"compile": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "compile"
|
||||
}
|
||||
},
|
||||
"prepare": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "prepare"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "lint"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -14,6 +14,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"check:subset-installed": "pnpm list --depth 1 install-subset > /dev/null 2>&1",
|
||||
"preinstall": "npx only-allow pnpm",
|
||||
"install:subset-only": "pnpm install --no-package-lock --no-save install-subset",
|
||||
"install:no-e2e": "pnpm run check:subset-installed --silent || pnpm run install:subset-only && pnpx install-subset i no-e2e",
|
||||
"build": "./bin/build-zip.sh",
|
||||
|
|
|
@ -0,0 +1,115 @@
|
|||
{
|
||||
"root": "plugins/woocommerce/",
|
||||
"sourceRoot": "plugins/woocommerce",
|
||||
"projectType": "application",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "build"
|
||||
}
|
||||
},
|
||||
"build-core": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "build:core"
|
||||
}
|
||||
},
|
||||
"build-zip": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "build:zip"
|
||||
}
|
||||
},
|
||||
"build-watch": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "build-watch"
|
||||
}
|
||||
},
|
||||
"build-assets": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "build:assets"
|
||||
}
|
||||
},
|
||||
"lint-js": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "lint:js"
|
||||
}
|
||||
},
|
||||
"docker-up": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "docker:up"
|
||||
}
|
||||
},
|
||||
"docker-down": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "docker:down"
|
||||
}
|
||||
},
|
||||
"docker-ssh": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "docker:ssh"
|
||||
}
|
||||
},
|
||||
"test-api": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "test:api"
|
||||
}
|
||||
},
|
||||
"test-e2e": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "test:e2e"
|
||||
}
|
||||
},
|
||||
"test-e2e-debug": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "test:e2e-debug"
|
||||
}
|
||||
},
|
||||
"test-e2e-dev": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "test:e2e-dev"
|
||||
}
|
||||
},
|
||||
"test-unit": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "test:unit"
|
||||
}
|
||||
},
|
||||
"makepot": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "makepot"
|
||||
}
|
||||
},
|
||||
"packages-fix-text-domain": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "packages:fix:textdomain"
|
||||
}
|
||||
},
|
||||
"git-update-hooks": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "git:update-hooks"
|
||||
}
|
||||
},
|
||||
"make-collection": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "make:collection"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,7 +2,11 @@
|
|||
|
||||
echo "Initializing WooCommerce E2E"
|
||||
|
||||
wp plugin activate woocommerce
|
||||
# This is a workaround to accommodate different directory names.
|
||||
wp plugin activate --all
|
||||
wp plugin deactivate akismet
|
||||
wp plugin deactivate hello
|
||||
|
||||
wp theme install twentynineteen --activate
|
||||
wp user create customer customer@woocommercecoree2etestsuite.com \
|
||||
--user_pass=password \
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"references": [
|
||||
{ "path": "tests/e2e/api" }
|
||||
{ "path": "../../packages/js/api" }
|
||||
],
|
||||
"files": []
|
||||
}
|
||||
|
|
4167
pnpm-lock.yaml
4167
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
@ -3,9 +3,9 @@
|
|||
"projects": {
|
||||
"@woocommerce/api": "packages/js/api",
|
||||
"@woocommerce/api-core-tests": "packages/js/api-core-tests",
|
||||
"@woocommerce/e2e-core-tests": "packages/js/core-tests",
|
||||
"@woocommerce/e2e-core-tests": "packages/js/e2e-core-tests",
|
||||
"@woocommerce/e2e-environment": "packages/js/e2e-environment",
|
||||
"@woocommerce/e2e-utils": "packages/js/utils",
|
||||
"@woocommerce/e2e-utils": "packages/js/e2e-utils",
|
||||
"woocommerce": "plugins/woocommerce"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue