109 Commits

Author SHA1 Message Date
Tim Layton
a275a1c61f move resource item to its own component
- remove filter control from docs and deprecate it
- update resource item with new content
- remove case study from resource list
- add children example to filters
- use inline label for resource list sort
2019-08-16 18:00:27 -07:00
Ben Scott
accb2f791a Use unpkg for CDN links for CSS files (#1960)
- Stop publishing css files to sdks.shopifycdn.com
- Update docs to use unpkg link for CCSS files
- Make it clear that we sugggest downloading these files and hosting
  them yourself rather than using unpkg directly
2019-08-15 15:15:58 -04:00
Ben Scott
864c64fdd9 Add minified styles to npm package (#1957)
In preparation for using unpkg as a CDN source
2019-08-13 16:30:47 -04:00
Ben Scott
3a6bde6bfb Styles build: combine all components into one file (#1912)
There is no value in having individual files per component in the styles
folder. It is unneeded overhead and people shouldn't be digging into
that folder trying to include a single component's styles in the first place.

Where styles/components.scss previously was a list imports to
per-component files, instead inline the contents of the per-component scss
into styles/components.scss. The listing of the contents is preserved so
the computed css out the other end will be idential.

At this point global.scss and components.scss both contain pure css.
They are only distributed as scss files for the sake of convinience,
ease of `@import`ing, and because sewing-kit expects these named scss files.
2019-08-02 08:34:24 -07:00
Ben Scott
6f53c714b0 Add empty implementation for window.scroll in test setup 2019-07-25 13:35:44 -07:00
Andrew Musgrave
0f530476fe Merge branch 'master' into july-22-master-to-v4 2019-07-22 11:14:55 -04:00
Ben Scott
6767a62e8e Ignore noisy deprecation warnings in tests (#1852)
AppBridge related deprecation warnings are super noisy and make test
output hard to scroll through. Silence them so they don't get in the
way.
2019-07-16 17:32:15 -07:00
Ben Scott
8667cf7976 Move custom matchers into tests directory (#1823)
Extend jest with all custom matchers in tests/matchers/index.ts instead
of once for every file
2019-07-15 16:55:54 -07:00
Ben Scott
0217a8a157 Prefix common partial files with an underscore 2019-07-09 16:14:48 -07:00
Andrew Musgrave
2568f472ab Merge branch 'master' into 080719-master-to-v4 2019-07-08 18:41:59 -04:00
Ben Scott
10f3ed51b3 Distribute compiled sass in the styles folder
This helps protect us against people overriding our variables / mixins /
functions and thus causing problematic output.

Do the sass build as part of the rollup styles plugin instead of a
separate step. This saves us having to generate a file in the rollup
plugin that we then pass on to a second step.

Merge src/styles/global into a single file, it's pretty small and it's
easier to deal with a single file
2019-07-02 18:43:52 -07:00
Andrew Musgrave
b62bef9f3f Removed mutation observer shim 2019-06-26 11:00:25 -04:00
Andrew Musgrave
0de35f7008 Merge branch 'master' into 19-07-24-master-to-v4 2019-06-24 14:07:52 -04:00
Ben Scott
f549c7fab2 Update sewing-kit
This will now warn on unsafe lifecycle hooks like componentWillReceiveProps
2019-06-19 12:32:55 -07:00
Andrew Musgrave
351bb6fe23 Remove componentWillReceiveProps 2019-06-18 13:38:02 -04:00
Andrew Musgrave
9e2fc156fb Merge pull request #1621 from Shopify/po-rm-cwrp
[v4][PositionedOverlay] Remove component will receive props
2019-06-14 12:55:58 -04:00
Andrew Musgrave
561b3fb353 Add react testing and custom matchers 2019-06-05 12:58:34 -04:00
Andrew Musgrave
bedf5ad39c Remove componentWillReceiveProps 2019-06-04 17:22:21 -04:00
Andrew Musgrave
72e8f70cd2 Merge branch 'master' into 19-05-21-master-to-v4 2019-05-21 14:22:54 -04:00
Andre Rocha
6df87a7cd7 Re-enable pa11y (#1456) 2019-05-13 10:08:06 -07:00
Andrew Musgrave
cce1d1c126 remove-testid-warning 2019-05-09 11:21:12 -04:00
Ben Scott
248306f3ea Manual linting fixes and fix hardcoded translations 2019-05-08 11:26:15 +02:00
Solona Armstrong
4b48dd08da Add no vague titles rules 2019-02-15 12:59:33 -08:00
Ben Scott
887acb950f Use import styles from notation when importing scss
The css-modules spec says to use this format, and we transform our
imports as part of the build to use this format so we should use this
style initially to save that indirection
2019-02-04 17:08:06 -08:00
Ben Scott
af6c4d6e95 Add shopify/jest eslint ruleset and apply autofixes 2018-11-01 15:59:00 -07:00
Ben Scott
9e5196a850 Tidy up some eslint ignore lines
* Stop ignoring /tests and /playground as plugins no longer crash on
  those files
* Remove folder-specific eslint files as they don't do anything
* Use `eslint-ignore no-console` at the top of scripts to avoid having
 to add it to every line
* Add an override targeting the playground to avoid needing to include
the eslint-disable in the file (and thus in the PR template)
2018-10-23 13:21:21 -07:00
Tim Layton
dfdefc0b37 Merge branch 'open-development' into beta-and-open-dev 2018-10-21 13:17:54 -07:00
Tim Layton
d999acbbb3 Merge branch 'src-build-beta' into beta-and-open-dev 2018-10-21 13:10:03 -07:00
Tim Layton
69912ed0a9 Merge branch 'master' into merge-master-10-21 2018-10-21 12:59:13 -07:00
Ben Scott
6e6036798c Fix potential failure in build test 2018-10-19 14:34:10 -07:00
Tim Layton
d76e95efdb ignore the cache for real 2018-10-19 14:29:37 -07:00
Dan Rosenthal
36e217239e fix build tests 2018-10-19 16:50:54 -04:00
Dan Rosenthal
58549a607a Merge branch 'master' of github.com:Shopify/polaris-react into master-into-src-build-beta-for-rc 2018-10-19 15:16:14 -04:00
Tim Layton
828898e596 Shopify App Bridge 🌉🎉 (#2450)
* add appBridge to polaris context

* implement app bridge for loading and update tests

* add tests

* use appBridge in toast

* update tests

* update prop with default value, set to dismissable, and unmount safely

* render page components with app bridge

* add callback support, move to private methods

* add lifecycle handlers

* bump app-bridge version and update isDismissible option

* generate redirect callbacks based on url

* add target type to actions, remove logic to infer target

* add tests

* dev up

* [Modal] App Bridge (#2320)

* stop exporting embedded modal and export normal modal with modal props instead

* get a working app bridge modal

* better type for size and pull title

* get all props working, needs refactor with page

* easdk action is already part of the complex action type

* move modal app bridge transforms into shared utility

* refactor page to use shared transformers

* rebase off beta/app-bridge, respond to feedback, and fix modal typing

* add tests

* refactor transforms

* add transformer tests, refactor transformer to use overload, and subsequent refactors of page and modal and their tests

* add test for modal not opening on mount

* respond to feedback

* [Resource picker] App bridge (#2443)

* upgrade resource picker to use app bridge

* refactor toast and loading based on app bridge version bump

* change close callback to cancel callback, fix subscribed select action

* tweak docs

* set defaults to keep them in sync with our docs, add  showVariants

* add tests

* fix tests

* not true is also known as false

* cast action as Action.ADMIN_PATH to avoid casting as any

* use enum instead of string for argument to subscribe

* The EASDK is dead, long live the Shopify App Bridge

* fix tests

* replace type cast with overload function

* safe guard against calls to set unless something has changed

* add tests for safe guards to set

* support the danger button

* document all the changes

* ignore tophat examples if hidePlayground is true

* burn handle warning from Modal

* use default toast duration in tests

* stop typing as any in overloaded transformer function

* add note about shopOrigin to not have https://

* update history example

* dynamically generate types for target and modal size

* update prop docs for shopOrigin

* no no no
2018-10-19 11:22:02 -07:00
Ben Scott
94488f415b Jest 22 uses a version of jsdom which supports requestanimationframe out the box 2018-10-18 16:02:19 -07:00
Ben Scott
379888e63b Additional poking
- don't run clean after build tests as its is pointless. a clean
already happens as part of the prebuild so we know we're coming from a
good place
- fix deprecation notice in ts-jest config
2018-10-18 16:02:19 -07:00
Ben Scott
263c8e0ad9 I can type meaningful comments 2018-10-18 16:02:19 -07:00
Ben Scott
501ecd251c Fix the build test by not nuking jest's cache while it is running 2018-10-18 16:02:19 -07:00
Ben Scott
60f0310374 WIP: Testing using sewing-kit
Use `yarn run sk test . --no-watch` to test
2018-10-18 16:02:19 -07:00
Daniel Leroux
fd0a2498f8 es-lint and search field issue 2018-10-12 10:56:07 -04:00
Daniel Leroux
8d60166836 Merge branch 'master' into src-build-beta-11 2018-10-11 15:03:41 -04:00
Koen Vendrik
e58af92c2d adds src as a module directory and makes it work with rollup (#2380)
* adds src as a module directory and makes it work with the rollup

* fixes types imports

* restricts imports to node_modules and /src

* fixes ts lint

* fixes config and types import
2018-10-10 14:23:13 -04:00
Tim Layton
9aebff99cd Merge branch 'master' into open-dev-merge-master 2018-10-06 00:10:16 -07:00
Dan Rosenthal
de58a8eed5 Merge branch 'master' of github.com:Shopify/polaris-react into master-into-src-build-beta-7 2018-09-19 09:26:28 -04:00
Gord Pearson
8c664b2bfe esnext contains individual assets for better treeshaking 2018-09-13 09:46:14 -04:00
amrocha
b0de38e184 Update tests to be compatible with new reporting format 2018-09-12 14:11:45 -07:00
Tim Layton
7419083ffd Merge branch 'master' into open-development-merge-master 2018-09-09 17:43:23 -07:00
Dan Rosenthal
537e59956e Merge branch 'master' of github.com:Shopify/polaris-react into master-into-src-build-beta 2018-08-27 12:12:27 -04:00
Andrew Musgrave
f4938f7d38 Rename theme context to polarisTheme 2018-08-24 10:37:19 -04:00
Kaelig Deloumeau-Prigent
a57d64b733 Widen reach of linting scripts and fix linting errors (#1970)
* Format various files

* Wider reaching lint/format

The autoformat tools should format the same files you should run into in
your editor. Previously we weren't catching js files, json files and any
ts files outside the src folder.

Update lint:js command to include the whole folder, not just src
Update format:prettier command to include json files.

Fix linting issues raised by checking more files.
2018-08-23 17:22:27 -07:00