Commit Graph

27 Commits

Author SHA1 Message Date
RJ f306cc2ba5 Enable Typescript checking on ./client folder (https://github.com/woocommerce/woocommerce-admin/pull/8372)
* Copied .tsconfig into ./client to enable ts checking

- Made sub-repos composite typescript packages where necessary

* Prevent tsc from transpiling ./client

 - we use webpack for transpiling so no need for this

* Added tsc resolution path for @automattic/explat-client

- Seems like there's a type export issue (?) with @automattic/explat-client and @automattic/explat-client-react-helpers
- adding the node_modules/@automattic/explat-client path in tsconfig seems to help TS resolve this using the source .ts files
- found answer here: https://github.com/microsoft/TypeScript/issues/42873
- should figure out what's actually wrong with the type exports and fix that there instead

* Removed mandatory checking from webpack

- removed this for now as it will block all development until all type inconsistencies are fixed
- for now, run the optional ts:check task either in console or vscode for highlighting type errors

* Added vscode tasks for typescript checking

* Patch @automattic/explat-client-react-helpers

- this changes the installed code in node_modules (post-installation) for @automattic/explat-client-react-helpers so that it exports the necessary type interfaces required by us
- attempted unsuccessfully to override type exports using declare module
- not too sure how to fix this internally by other means
- have to investigate what fixes to propose to @automattic/explat-client-react-helpers team

* changed tests in ./client to use ts-jest instead of babel-jest

- rewrote jest config to use ts-jest instead of babel-jest
- set ts errors to warnings instead so that tests don't fail on type errors
- created new tsconfig for ./packages/js-tests so that build and ts-check are separate, as js-tests need to be built for commonjs
2022-03-01 12:19:07 +08:00
RJ 087ce5aa61 Enable type definitions output for @woocommerce/components (https://github.com/woocommerce/woocommerce-admin/pull/8282)
* Output typedefs for @woocommerce/packages
2022-02-11 19:39:34 +08: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
Sam Seay 8f3c396cfd When publishing the docs on gh workflow the WP css was not imported (https://github.com/woocommerce/woocommerce-admin/pull/7102) 2021-06-02 16:39:34 +12:00
Sam Seay edc8a1bdc5 Publish storybook docs, remove react docgen based docs (https://github.com/woocommerce/woocommerce-admin/pull/7055) 2021-06-02 15:54:00 +12:00
louwie17 3ff1e1375e Update E2E config to support screenshots on test failure (https://github.com/woocommerce/woocommerce-admin/pull/6858)
* Add login page wait script for e2e tests

* Re-navigate to login page, if initial selector does not exist

* Add screenshot if login page did not render

* Add screenshot code, and screenshot artifacts to GH action

* Update screenshot logic for login

* Update artifact task

* Update upload artifact workflow

* Update jest config to make sure the screenshots work on test failures

* Remove old screenshot code

* Add screenshots to daily e2e tests as well incase of failure

* Add changelog
2021-04-26 13:41:38 -03:00
louwie17 b29cd9a6c0 Add support for php8 unit tests (locally and in GH actions) (https://github.com/woocommerce/woocommerce-admin/pull/6678)
* Partial local version to run php8 unit tests

* Remove the post install scripts

* Remove tab

* Make sure woocommerce version contains patch number

* Remove unnecessary script

* Update bin settings and unit test script

* Remove phpunit binary

* Updated how php unit is being run

* Add specific phpunit version for php8

* Update bin phpunit composer.json

* Final cleanup of scripts

* Fix potential test where image is an object

* Move setting image below save

* Add changelog

* Do not convert obj/array to string for email_actions

* Remove some uses of tabs

* Set WP and WC version to minimum php 8 supported

* Remove unnecessary composer install within tests
2021-04-07 14:28:03 -03:00
Moon 2cbf73b6a4 Add docker setup using WP-ENV (https://github.com/woocommerce/woocommerce-admin/pull/6448)
* Add docker setup using WP-ENV

* Add ALTERNATE_WP_CRON config to avoid cron issues

* Add changelog

* Update README

* Added HOWTOs section
2021-03-02 13:13:21 -08:00
Sam Seay 7e4a2a6dc8 Add a changelog lint check and auto-labelling to PRs (https://github.com/woocommerce/woocommerce-admin/pull/6414) 2021-02-24 14:47:06 +13:00
Paul Sealock 88d72c88cd Dependency Extraction Webpack Plugin: Add Woo Blocks packages (https://github.com/woocommerce/woocommerce-admin/pull/6228)
* Hard code package names and alias block-settings

* instructions

* update readme

* block to blocks

* plural blocks

* just wcSettings, not wc.wcSettings
2021-02-04 17:43:24 +13:00
Sam Seay fc030fb007 Migrate the devdocs examples to Storybook CSF stories (https://github.com/woocommerce/woocommerce-admin/pull/5271)
Fixes woocommerce/woocommerce-admin#5234
2020-10-15 14:55:55 +13:00
Paul Sealock 35de289fb5 New Package: DependencyExtractionWebpackPlugin (https://github.com/woocommerce/woocommerce-admin/pull/5198)
* create package

* dynamically make package list

* better readmne

* point to woo's not wp's for starter pack
2020-10-15 09:50:57 +13:00
Matt Sherman ae0ceaf900 Ignore *.swp files (https://github.com/woocommerce/woocommerce-admin/pull/4004) 2020-03-26 11:19:55 -04:00
Rua Haszard 8eda9cbd59 Add Storybook for documenting and testing components in isolation (https://github.com/woocommerce/woocommerce-admin/pull/3679)
* basic empty storybook setup

* borrow (copy paste) config (module.rules & aliases) from main webpack

* story for rating (styling not working)

* correctly style rating stars in storybook

* import webpack config for storybook instead of paste

* tweak rating story to show partial stars

* stylelint fixes

* pin storybook addons versions

* add knobs for rating & totalStars

* add knob for size + use defaultProps for knob defaults

* import all component styles into storybook preview:
- stories shouldn't import component styles directly, consistent with
how they are used
2020-02-24 15:25:25 +13:00
Justin Shreve 7fc70157c9 WC_Admin_Loader/PHP Refactor + Method to publish core ready features (https://github.com/woocommerce/woocommerce-admin/pull/1863)
* Try: Setup plugin to publish core library on npm

* Documentation clean up.

* Handle PR Feedback: Fix notices from happening in WC Core from API usage, fix sidebar dashboard ordering in menu, remove preload function check since we are supporting WP 5+, add a filter for preloading data and move usage to respective feature code, move features to a specific folder for bundiling, fix script translations.

* Fix code comment on analytics preload

* Continue refactoring code, and make it possible to launch 'embedded' features via the process as well.

* Fix note hook

* Fix note load order

* Address PR feedback: Fix class name, load leaderboard endpoint

* Remove example code prior to merge
2019-04-11 14:31:31 -04:00
Jeff Stieler bfe5a75e98 Update text domain. (https://github.com/woocommerce/woocommerce-admin/pull/1795)
* Translation call text domain change from “wc-admin” to “woocommerce-admin”.

* Fix .pot file generation.

* Fix errantly closed array item in /revenue/stats controller.

* Rename plugin zip, main file, and repo name to "woocommerce-admin".
2019-03-13 11:14:02 -06:00
Justin Shreve 0fe061b97d Add Feature Flags (https://github.com/woocommerce/woocommerce-admin/pull/1500)
* First pass at adding feature flags. Accessible over PHP and JS.

* Hook up dev config to test enviornments, hook up features to their flags.

* Cleanup some code and add documentation. Remove beta config.

* Handle PR Feedback: Add devdocs flag, remove categories flag, fix auto-generated PHP warning.

* Add todo for beta phase.

* Handle PR feedback: Simplify is_array check, update build command, simplify test mock, remove empty webpack line.
2019-02-12 15:02:02 -05:00
Kelly Dwan f62537fc17 Try: Add Lerna to split out utility packages (https://github.com/woocommerce/woocommerce-admin/pull/678)
* Add lerna & GB package-building script

* Move currency library to lerna module

* Update lerna config

* Add publish commands

* Add currency as an faux-external module

* Add separate command to build just core files

* Update dependency path

* Update build script to build all packages into `dist`

* Add packages to the jest test setup

* Move date library to packages

* Update imports to use @woocommerce/date

* Output wcSettings definition before any scripts are output

Fixes issues where wc-dates lib relies on settings object

* Add the build step into travis

* Update jest config to dynamically get package paths

* Update package postcss config to match wc-admin’s main config

* Add combined watch scripts for package+app, add a `clean` command to clean up old build files

* Ignore PHPCS error (leave todo message to fix)

* Concat files with a space, fix issue where all files join in one continuous string and fail the check
2018-10-30 14:57:48 -04:00
Jonathan Belcher f6940db59c Ignore VS Code configuration files (https://github.com/woocommerce/woocommerce-admin/pull/732) 2018-10-30 14:26:13 -04:00
Claudio Sanches c0eadbaabb Merge branch 'master' into feature/438 2018-09-27 12:39:57 -03:00
Claudio Sanches f8e62576a0 Inclcude composer dependencies 2018-09-21 14:06:16 -03:00
Peter Fabian 55dffc32ae Added /vendor/ to gitignore. 2018-09-21 15:34:26 +02:00
Paul Sealock 558d163f35 Sidebar: Add Tabs 2018-05-23 12:42:26 +12:00
Kelly Dwan ea2d3e8d5c Update build destinations for JS and CSS, including global library namespace 2018-05-07 11:10:42 -04:00
Kelly Dwan 05dacbe212 Add an admin page, build a simple component + filters 2018-04-19 16:40:32 -04:00
Kelly Dwan dbe06969fe Add build process 2018-04-17 19:50:28 -04:00
Kelly Dwan 555da60b01 Initial commit of plugin scaffold 2018-04-17 17:04:17 -04:00