Commit Graph

28 Commits

Author SHA1 Message Date
Sam Seay b076a7b521
Fix linter issues and update Syncpack (#38523) 2023-05-31 11:45:10 +12:00
RJ d15f62241f
dev: added xstate inspector toggling (#38022)
* dev: added xstate inspector toggling

* dev: added eslint-plugin-xstate
2023-04-28 15:30:52 +08:00
Sam Seay 1834621d1a
Update the @woocommerce/eslint-plugin and fix bugs (#36988) 2023-03-02 11:36:38 +13:00
Chi-Hsuan Huang 99e6f61dc8 Update woocommerce-admin/.eslintrc.js 2022-03-29 16:08:07 +08:00
Chi-Hsuan Huang 86fc8b62e5 Switch to pnpm (https://github.com/woocommerce/woocommerce-admin/pull/8349)
* Add pnpm-workspace.yaml

* Add missing dependencies & replace file: with workspace:* in
package.json

* Replace "npm" with "pnpm"

* Replace "npx" with "pnpx"

* Remove package-lock.json

* Add pnpm setup action to github workflows

* Update webpack babel exclude path

* Upgrade woo e2e and fix e2e test command

Update e2e.yml

Use pnpm run e2e:docker-up in e2e.yml

* Remove unused docker-compose.yaml

* Replace lerna with pnpm commands

Update publish commands

* Exclude _locutus_shared_bc.js in babel.config.js

* Add .npmrc to set enable-pre-post-scripts=true by default

* Fix storybook babel config

Update babel.config.js

* Add changelog

* Update pnpm-lock.yaml

* Replace pnpx with pnpm exec

* Update pnpm-lock.yaml

* Remove js-tests/package-lock.json

* Fix @woocommerce/tracks -> workspace:*

* Update pnpm-lock.yaml

* Add @woocommerce/experimental to onboarding/package.json

* Add "@woocommerce/component" to onboarding/package.json

* Update pnpm-lock.yaml

* Use || instead of && for "test:watch"

Co-authored-by: RJ <27843274+rjchow@users.noreply.github.com>

* Fix packages/number "clean" command

* Add root: true to .eslintrc.js to enforce it to use the root config file

* Exclude packages/**/node_modules from babel transpiling

* Fix js-tests build config

Co-authored-by: RJ <27843274+rjchow@users.noreply.github.com>
2022-03-04 12:01:16 +08:00
Paul Sealock e41441f83e Add hook reference generator README and documentation (https://github.com/woocommerce/woocommerce-admin/pull/8004)
* Add hook reference README

* update hook reference

* better

* changelog

* add pr number

* remove example

* add desc

* add stats

* jsdoc REPORTS_FILTER

* Category configs

* configs

* data

* dashboard

* dashboard charts

* save

* save

* save

* done with filters

* Add scope to slotFill docs

* data

* add all slotfills

* data

* Fix error when scope is not present, and make use of typedef imports

* Move chart and filter jsdoc definitions to the reports index file

* Update hook reference data.json

* Make use of import for filter typedef and address some typos

Co-authored-by: Lourens Schep <lourensschep@gmail.com>
2022-02-11 10:38:38 -04:00
louwie17 3998f88597 Remove unpublished wc-admin-settings package and update getSetting usage (https://github.com/woocommerce/woocommerce-admin/pull/8057)
* Remove use of wc-admin-settings from packages

* Move getSetting to getAdminSetting and remove wc-admin-settings package

* Add changelog

* Update package.json and remove last use of wc-admin-settings
2022-01-06 08:53:30 -04:00
Jeff Stieler e7c479adf9 Add eslint rule to prevent missing createElement imports. (https://github.com/woocommerce/woocommerce-admin/pull/7424)
* Add eslint rule to prevent missing createElement imports.

* Ignore documentation files for rule.
2021-07-27 08:53:03 -06:00
Jeff Stieler 8e61f55017 Allow packages to be built in isolation. (https://github.com/woocommerce/woocommerce-admin/pull/7286)
* Use yarn instead of npm.

In prep for workspaces, since we're locked to npm < 7. See: https://github.com/woocommerce/woocommerce-admin/pull/7126#issue-661287749

* Initial workspace creation.

* Add initial tsc build to @woocommerce/number.

* Attempt to build experimental package.

* Try currency package.

* Define all packages as workspaces.

* Use tsconfig common to packages.

* Fix currency package build.

* Build csv-export with tsc.

* Try to build customer-effort-score with tsc.

* Fix JSX pragma.

* Build data package with tsc.

* Build date package with tsc.

* Build experimental package with tsc.

* Try to build explat package with tsc.

* Build navigation package with tsc.

* Build notices package with tsc.

* Build onboarding package with tsc.

* Build components package with tsc.

* Swap in package JS build into main script.

* Fix experimental package build.

* Try per-package css build with components.

* Try to run components package tests in isolation.

Broken on JSX in test files not being transformed.

* Move @woocommerce/wc-admin-settings into a package.

* Try to fix components package tests.

Fails because we aren't setting up the jest/jest-dom globals.

* Move JS test code to reusable (private) package.

* Enable incremental TS builds.

* Use workspaces to run JS tests.

* Use new jest configs for update snapshot scripts.

* Fix style builds.

* Fix package version in components.

* Fix client test debug and watch scripts.

* Update yarn lock.

* Update test-staged behavior.

* Try to fix storybook.

* Fix storybook.

* Update more npm commands to yarn.

* Add changelog.

* Fix lint errors.

* Update packages readme script references.

* Clean up unused gitignore match.

* Fix another npm command.

* Fix JS builds on watch.

* Fix start script.

* Fix start scripts for packages.

* Use tsc to build packages before tests

* yarn -> npm.

# Conflicts:
#	package-lock.json
#	package.json

* Fix linter error.

* Remove workspace definitions.

* Fix missing Fragment import.

* Fix package lock.

* Fix missing reference.

* Only build commonjs module for js-tests helper.

* Remove errant dependency from components.

* Remove noop scripts.

* Fix package JS build before testing.

* Revert noisy formatting changes.

* Fix precommit and test scripts.

* Fix minimum expected recommended extension count.

Japan test case breaks this.

* Revert babel config changes.

* chore(release): publish

 - @woocommerce/components@7.2.0
 - @woocommerce/csv-export@1.4.0
 - @woocommerce/currency@3.2.0
 - @woocommerce/customer-effort-score@1.1.0
 - @woocommerce/data@1.4.0
 - @woocommerce/date@3.1.0
 - @woocommerce/dependency-extraction-webpack-plugin@1.7.0
 - @woocommerce/eslint-plugin@1.3.0
 - @woocommerce/experimental@1.5.0
 - @woocommerce/explat@1.1.0
 - @woocommerce/js-tests@1.1.0
 - @woocommerce/navigation@6.1.0
 - @woocommerce/notices@3.1.0
 - @woocommerce/number@2.2.0
 - @woocommerce/onboarding@1.1.0
 - @woocommerce/tracks@1.1.0
 - @woocommerce/wc-admin-settings@1.1.0

* Add script for running 'start' in a package.

* Remove yarn from gitignore.

* Update package changelogs, prep versions for release.

* Try to fix E2E tests after main merge.

* Some cleanup.

* Add changelog.

Co-authored-by: Paul Sealock <psealock@gmail.com>
2021-07-14 16:38:57 -04:00
Paul Sealock 6ea9914ac0 Hook reference: Add SlotFill support (https://github.com/woocommerce/woocommerce-admin/pull/6833)
* add @slotFill to process

* add types

* committing data

* use filter instead of hook

* changelog

* add action type

* update paths to ignore builds and node_modules

* changelog

* Add action data type

Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>

Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
2021-07-09 11:01:43 +12:00
Joel Thiessen 9fda36439e Typescript conversion of DynamicForm Component (https://github.com/woocommerce/woocommerce-admin/pull/6981) 2021-05-18 12:46:21 -07:00
louwie17 be7dd2dd5e Add recommended payment methods (https://github.com/woocommerce/woocommerce-admin/pull/6760)
* Add initial payment recommendations code for the payments settings

* Added request data for the recommended payments

* Some styling updates and make sure it does not show when marketplace suggestions is disabled

* Update url

* Update comment in php class

* Add tests

* Fix lint errors

* Remove unnecessary type

* Fix lint error

* Fix broken test

* Convert plugin package to typescript

* Fix lint errors

* Add changelog

* Add support for locale-data

* Fix track name

* Fix up the tests

* Fix lint errors

* Address PR feedback

* Add tests for option hydration

* Make types more robust in plugins reducer

* Made use of SlotFill component instead of page registry and router

* Removed console log, and fixed types

* Add newer version of i18n to data package, for newer types

* Make the request to WooCommerce.com more restrictive

* Fix path of import

* Update PHP with suggested changes

* Remove SlotFill with applyFilters

* Update copy and PR feedback

* Update package lock

* Updated package lock

* Fix the package lock

* Added dot, and some minor styling changes

* Add test instructions
2021-04-20 14:17:19 -03:00
Paul Sealock b7360d0d55 Add typescript to Nav utils (https://github.com/woocommerce/woocommerce-admin/pull/6477)
* Add typescript to nav utils--no-verify

* save

* progress

* fixup category

* better

* getting closer

* grrr

* appease the type gods

* move types to start of page

* Fixup addHistoryListener

* Add typescript to nav utils--no-verify

* save

* progress

* fixup category

* better

* fix tsconfig

* changelog

* add babel jest typescript preset for tests

* fix rebase issue

* PR feedabck

* update package-lock

* eslint fix
2021-03-18 16:38:38 +13:00
louwie17 9b180db614 Add Typescript and page objects to E2E suite (https://github.com/woocommerce/woocommerce-admin/pull/6582)
* Initial playwright

* Updated e2e to use playwright and typescript

* Update set up environment and jest package

* Add changelog

* Add await to uncheck

* Fix formatting

* Revert jset back to ~24, as >25 runs slower, see facebook/jestwoocommerce/woocommerce-admin#9457

* Removed some unnecessary uses of waitForSelector

* Fix eslint issue

* Fix the e2e tests with latest updates

* Running most tests, with typescript now

* Fix any outstanding queries for the tests to work

* Update changelog

* Remove unnecessary jest version and unnecessary transform setting

* Fix test case broken after rebase

* Add fix to make e2e tests more robust

* Making sure dropdown value is correct

* Reove the wcpay condition for features number
2021-03-17 16:22:09 -03:00
Paul Sealock 7c61e2bff9 Hook Reference: Automate a reference resource (https://github.com/woocommerce/woocommerce-admin/pull/6454)
* read sample doc

* npm cli

* work with arrays

* Its happening

* better naming

* cleanup

* moar cleanup

* new line

* better

* save

* fixup rebase error

* package lock update

* node 12 usage

* add changelog

* fancy logs

* update package lock

* changelog in right place
2021-03-17 13:27:26 +13:00
louwie17 cb3c1e88e8 Add tilde (~) option for client root directory (https://github.com/woocommerce/woocommerce-admin/pull/6517)
* Add tilde option for client root directory

* Support tilde start as internal to fix lint issues

* Update baseUrl and paths so auto complete works correctly

* Add changelogs

* Add eslint support for webpack resolvers

Co-authored-by: Matt Sherman <matt@jam123.com>
2021-03-10 11:11:37 -04:00
Sam Seay 630f31ae9d Clean up unused deps and add TS to the build. (https://github.com/woocommerce/woocommerce-admin/pull/6441) 2021-03-01 16:01:22 +13:00
Darren Ethier 4210b6f0a8 Update @wordpress/eslint-plugin dependency to latest version. (https://github.com/woocommerce/woocommerce-admin/pull/5856)
* update @wordpress/eslint-plugin dependency to latest version

* local prettier config isn’t needed anymore because of fix in upstream package

* add jsdoc config to use typescript format for jsdocs

* update changelog

* update packages and include .prettierrc.js back in for code editor support of prettier

* add docs

* minor prettier fix in test file

* Convert all new eslint rules throwing errors to warnings temporarily to be handled in separate prs

* updated changelog

* fix package-lock.json

* prettier auto-fixes

* add prettier dependency at root

* sigh prettier is being finicky

* version bump

Co-authored-by: Paul Sealock <psealock@gmail.com>
2021-01-26 13:24:28 +13:00
Paul Sealock 2f650b74a0 Replace useFilters with wp's withFilters (https://github.com/woocommerce/woocommerce-admin/pull/4962)
* use wp withFilters

* changelog

* remove altogether

* other uses of withFilters

* Add deprecation warning to README
2020-08-21 11:14:55 +12:00
Sam Seay 4e06df996a Add the jest-environment tag to known tags for jsdoc to avoid lint errors. (https://github.com/woocommerce/woocommerce-admin/pull/5002) 2020-08-20 14:15:08 +12:00
Paul Sealock 23846221e6 jsDoc: Fix errors (https://github.com/woocommerce/woocommerce-admin/pull/4985)
* jsDoc errors, round 1

* round 2

* round 3

* voila

* root0 -> props
2020-08-18 09:36:24 +12:00
Paul Sealock c3d1e1eb61 Stock Report: Fix bad text domains (https://github.com/woocommerce/woocommerce-admin/pull/4980)
* Fix bad text domains

* fix currency bug
2020-08-14 08:25:08 +12:00
Paul Sealock c145783e0a Fix dependency declarations (https://github.com/woocommerce/woocommerce-admin/pull/4972)
* renmove WC comment block

* client routes

* more fixes

* moar search

* getting there

* by hand now

* david beating goliath

* mission accomplished

* client filepath

* save

* got it

* remove script

* fixes

* deal with package internal dep

* remove webpack alias

* fix webpack relative paths

* remove commented rule

* remove extra line

* remove unused modules entry
2020-08-13 14:05:22 +12:00
Darren Ethier dc5304823b Add @woocommerce/eslint-plugin (https://github.com/woocommerce/woocommerce-admin/pull/4714)
* add new woocommerce/eslint-plugin

* implement eslint-plugin (switch scripts to use wp-scripts etc)

* various linting fixes

* more lint fixes

* improve fix script

* more eslint fixes

* more eslint fixes

* temporary convert rules to warnings until they are all handled

* linting fixes

* update package-lock.json

* remove duplicates

* remove unnecessary `@wordpress/dependency-group` rule config

* add docs and adjust rules

* prettier fix

* fix merge artifact

* convert more rules to warnings

* change order to reflect importance

* install babel-preset-default

* remove unnecessary configuration for babel

* fix dependency group rule and test

* fix test

* handle collapsible whitespace

* add react testing library eslint plugin

* linter errors

* Add back in prettierrc

* package-lock update

* js lint fix with --fix

* disable whitespace in translation

* package-lock update

* make eslint actual dependency, not peer dependency

* pin eslint to v7

* I don't know why, but its working

* fix lint js

Co-authored-by: Paul Sealock <psealock@gmail.com>
2020-07-28 14:32:58 +12:00
Sam Seay a6ea004ee8 Rework the store details onboarding screen (https://github.com/woocommerce/woocommerce-admin/pull/4771)
Fixes woocommerce/woocommerce-admin#4566 **(and is dependent on the changes from woocommerce/woocommerce-admin#4759 )**

Changes:

* Use the new `Card` and `Flex` from `@wordpress/components`
* Add contextual tooltips
* Adjust existing styles to match [new designs](https://www.figma.com/file/JH9XMFUCOjfXdr3N09AHRD/On-boarding-iterations-June-'20)
2020-07-21 12:12:19 +12:00
Matt Sherman 9e9c261365 Add `jest-dom` eslint plugin (https://github.com/woocommerce/woocommerce-admin/pull/4327)
* Disable `jest-dom/prefer-enabled-disabled` rule for d3chart enzyme-based tests.
* Add `jest-dom` eslint plugin.
2020-05-11 10:17:26 -04:00
Paul Sealock b6f92021fe React Testing Library: add linter (https://github.com/woocommerce/woocommerce-admin/pull/4300) 2020-05-06 20:00:21 +12:00
Darren Ethier 33c5b41e3f Align WooCommerce javascript code standards/linting/styles with WordPress core. (https://github.com/woocommerce/woocommerce-admin/pull/3674)
* align code styles with the same configuration as Woo-Blocks

* initial pass of reformat-files

* applies manual fixes to various new linting errors surfaced by the configuration change.

* Fix state mutation in image-upload

* remove unused pre-commit-hook.js

* requestAnimationFrame -> window.requestAnimationFrame

* wc-api eslint changes

* eslint fixes on client/lib and client/settings

* client/header eslint changes

* fixes for client/dashboard part 1

* fixes client/dashboard part 2 of 2

* client/analytics part 1

* client/analytics continued

* client/analytics, last batch

* rename __mock__ directory

* pass in useEffect, useState from React component or function

* remove '+' from sprintf string argument

* use ref instead of findDOMNode

* reformat and repaply package.json changes

* install deps before running linter in Travis

* useGetCountryStateAutofill

* counryStateAutofill

* countryStateAutofill

Co-authored-by: Paul Sealock <psealock@gmail.com>
2020-02-14 15:23:21 +13:00