Commit Graph

121 Commits

Author SHA1 Message Date
Ben Scott
a1a8aaa7d4 Unify Tophat and Playground servers
Tophatting is now done through the playground server instead of being a
separate thing. Examples are now hot reloadable - modifications to
README files and components will be reflected in your browser without
needing to save due to markdown files being imported via webpack loader.

This makes the examples part of the build pipeline instead of something
that gets serialised into the page. This makes individual pages smaller
at the expense of a larger bundle (which is shared amongst pages).
2018-11-22 18:51:35 -08:00
Ben Scott
7f89ff4c47 Add comment to not-obvious things in sass-build 2018-11-19 16:39:59 -08:00
Dustin Masters
61f66fa858 Fix path replacement in sass-build on Windows
glob will return paths separated by forward slashes. However, on Windows, paths use backslashes by default. On line 49, a simple string replace is done to strip the path off of `srcFile`. On Windows, srcDir will contain backslashes, but srcFile will contain forward slashes, so the replace will silently replace nothing. A crash then occurs later since sassFile contains a full path instead of just a filename.

The fix is to convert backslashes in srcDir into forward slashes to make the string replace work across both Windows and non-Windows platforms.
2018-11-16 16:27:56 -08:00
Ben Scott
b472c40111 Make shrink-ray look at the tophat output
This is better than playground, because it uses most components, while
the playground has just the Page component. This allows us to get a
better feel for the size of the project as a whole.
2018-11-07 18:17:52 -08:00
Ben Scott
df89cae1ee Run shrink-ray on the base playground
The Playground and the shrink-ray sample page were borderline identical.
This lets us remove the shrink-ray-build folder

Simplify playground's compiled asset locations slightly - now all build
assets go in /playground/build rather than some in build, .cache and
assets. This allows us to gitignore a single folder rather than 3.
2018-11-06 13:46:01 -08:00
Ben Scott
bf6676cfc1 Add eslint-comments plugin to indentify unused disable comments 2018-11-01 16:58:28 -07:00
Ben Scott
495956884c Autofix linting issues
Fixes issues relating to import order and useless path segments
2018-11-01 16:58:27 -07:00
Ben Scott
da9344e15b Manually fix several linting issues
Prior to this version of eslint-plugin-shopify some rules were
inadvertently disabled due to ordering of plugins causing prior plugins
to be disabled. This has now been fixed so we can see errors for things
that were problematic.
2018-11-01 16:58:15 -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
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
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
da3b708947 Temporarily disable failing states 2018-09-12 13:52:17 -07:00
amrocha
94e5c6b41d Disable contrast rule 2018-09-12 13:51:14 -07:00
amrocha
bab65e310d Improve error reporting 2018-09-12 13:32:15 -07:00
Tim Layton
7419083ffd Merge branch 'master' into open-development-merge-master 2018-09-09 17:43:23 -07: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
Gord Pearson
2718d2e6ca Revert polaris-from-src 2018-08-21 13:35:18 -04:00
amrocha
4843ed602e Also fail when an item in the shitlist is not found in the tests 2018-08-20 17:20:29 -07:00
amrocha
bb2044f9c5 Add script to run pa11y on components, add shitlist, make it run in CI 2018-08-20 17:20:29 -07:00
Tim Layton
b18fcb61cd Merge pull request #1839 from Shopify/open-development-remove-duplicate-readmes
[open development] Remove duplicate readmes declaration
2018-08-01 13:32:51 -07:00
Kaelig Deloumeau-Prigent
4abad93645 Use the npm registry for faster propagation (#1840) 2018-07-31 17:10:29 -07:00
Kaelig
b3102486b7 Use the npm registry for faster propagation 2018-07-31 16:56:22 -07:00
Kaelig
80d5d87212 Remove duplicate readmes declaration 2018-07-31 16:21:53 -07:00
Kaelig
73cc189ecf Merge branch 'master' of https://github.com/Shopify/polaris-react into open-development 2018-07-31 16:15:16 -07:00
Kaelig Deloumeau-Prigent
8d1a76f3f2 Deploy script: ensure all @shopify/* packages are pulled from the public registry (#1818)
* Deploy script: ensure all @shopify/* packages are pulled from the public registry

Fixes an issue where `@shopify/react-html` versions above 1.0.0 wouldn't be found when running `yarn upgrade ...`, because yarn would attempt to fetch available versions from the internal npm registry where this package also exists, but not with the correct versions.

* Use single quotes
2018-07-30 11:27:37 -07:00
Gord Pearson
c506bf0d2b esnext contains individual assets for better treeshaking 2018-07-30 12:27:30 -04:00
Tim Layton
bf6e2c5f20 Ensure all @shopify/* packages are pulled from the public registry 2018-07-28 16:43:51 -04:00
Tim Layton
93b17a79d5 add tests for readme version updating 2018-07-26 14:48:03 -04:00
Tim Layton
53920bae35 change readme-update-version script to use regex for finding prev version
- clean up commands
- remove version-bump, hook into version command
- fix linting errors
2018-07-26 14:48:02 -04:00
Tim Layton
f0a00b1d23 modified scripts
* modified build script
* removed public repo deploy script
* moved the styleguide PR script to its own file
* added script to update the version number in readmes
* add `yarn bump <version>` command
2018-07-26 14:48:02 -04:00
Andre Rocha
acc0b6e0b7 Remove pr_id (#1763) 2018-07-17 15:40:55 -07:00
Daniel Leroux
01b1bac445 adding new line to optimize script 2018-07-03 13:35:25 -04:00
Dominic McPhee
fd74241239 Revert #1595 2018-07-03 12:45:29 -04:00
Gord Pearson
7f055ffe7d esnext contains individual assets for better treeshaking 2018-06-26 00:57:52 -04:00
Kaelig
bdfc84754f Add Polaris version number back as a CSS Custom Property, and surface it in the JS as well
Fixes #1518

Requires a separate syntax (using `<%= %>`, like in Ruby templates)
because `{{}}` makes stylelint fail.

See issue kristerkari/stylelint-scss#252

Co-authored-by: Tim Layton <tim.layton@shopify.com>
2018-06-19 17:18:55 -07:00
Kaelig
db0a66a16e Change {{VERSION}} to {{POLARIS_VERSION}} for consistency with polaris-styleguide
Fixes https://github.com/Shopify/polaris-react/issues/1038
2018-06-19 17:08:43 -07:00
Kaelig Deloumeau-Prigent
f46d70c386 Add -rf flags to rm command in build script (#1532) 2018-06-08 16:34:46 -07:00
Kaelig Deloumeau-Prigent
8fcc093fdb Update TypeScript to v2.9 (#1500) 2018-06-07 16:19:21 -07:00
Kaelig
bbc162fd89 ' -> ’ 2018-05-30 18:27:03 -07:00
Kaelig
3bd4976c0b Publish prettier and eslint config files to the open source mirror 2018-05-30 14:40:40 -07:00
Kaelig Deloumeau-Prigent
a1e8d07240 Clean up v2 references (#1370)
* Remove reference to CHANGELOG_V2.md in build-consumer script

* Remove reference to polaris-v2.shopify.com in error

* Set v2 to its actual release date in the docs

* Update @shopify/polaris to v2.0.0 in examples

* Remove reference to CHANGELOG_v2.md in deploy script

* Remove temporary workaround to consider v2 prereleases as releases
2018-05-16 11:44:28 -07:00
Kaelig
e1bdafc45a Merge branch 'v2' 2018-05-07 16:57:13 -04:00
Kaelig
c669becdeb Consider v2.0.0-prerelease.x versions to be mergeable to master 2018-05-07 10:32:05 -04:00
Daniel Leroux
8b50c2248b remove global for sass build 2018-04-27 10:49:29 -04:00
Kaelig
a2a807f470 Merge branch 'master' of github.com:Shopify/polaris-react into v2 2018-04-19 15:36:08 -07:00
Andre Rocha
25ab3b2407 Tweak shrink-ray script, add shipit config, tweak bundle config (#1280) 2018-04-19 14:18:33 -07:00
Kaelig
f1c69d6b6d Merge branch 'master' of github.com:Shopify/polaris-react into v2 2018-04-19 12:28:29 -07:00