Commit Graph

79 Commits

Author SHA1 Message Date
Ben Scott
10b28002de Updating to typescript 3.2.4
The last release of typescript-eslint-parser is 22.0.0 which only
supports up to TS 3.2.x. We're stuck on this because
eslint-plugin-shopify still uses typescript-eslint-parser and has not
yet moved onto its replacement package @typescript-eslint/parser - which
supports TS 3.2.x and above.

Somehow among all this we now get false positives for violations of the
import/named rule. It's fine to disable that as TS will shout at us if
we reference an unknown import anyway.
2019-05-03 11:20:39 +02:00
Andre Rocha
3ded8c2598 Add support for SVGR and remove custom SVG loader (#1042)
* Accept a React Component instead of a React Element in Icon.tsx
* Add deprecation warnings in Icon
* Spinner component now renders in an img tag
2019-03-06 16:06:00 -08:00
Ben Scott
bb9cbba87b Remove custom svg transformer for tests
Use the default one provided by sewing-kit. We're about to change how
icons get loaded so there's no point having a transformer that mimics
the old way.

The only reason why we needed it was for some Spinner tests, which can
be expressed in a different way
2019-02-20 15:27:12 -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
1811ebebb4 Run rollup once, to generate both cjs and es-modules bundles
Previously we ran rollup for twice, but as the only thing that differs
is the output format that's not needed.

This reduces the build time by ~5.5 seconds (~15%)
2019-01-21 15:27:13 -08:00
Ben Scott
e4bed6871d Improve ordering of the CSS build
Create polaris.css based upon the order tha the scss files are
referenced in the built js file
2019-01-15 15:57:41 -08:00
Ben Scott
e4a3b32cd1 Make build of styles.css reproducible
Sort css fragments by their containing file name before concatenating
them into style.css. This ensures that the same order is retained on
every build.

Previously the order was based on whatever fragment's PostCSS transform
completed first (which was basically a coin flip)
2019-01-14 14:36:12 -08:00
Ben Scott
45f9d9afec Bump babel-preset-shopify to fix envName not being honored 2019-01-09 18:31:58 -08:00
Ben Scott
f10f228253 Update to Rollup to v1 and update related plugins 2019-01-09 17:01:14 -08:00
Ben Scott
7c184fc8bc Bump postcss and related plugins and add browserslist
We can't extend from @shopify/browserslist-config because apps using
sewing-kit versions <0.68.0 use a version of PostCSS that uses a version
of browserslist that doesn't support the extend syntax.
2019-01-09 14:35:10 -08:00
Ben Scott
4c560932e0 Remove all usages of babel-node
That extra transpile step means an extra dependency but doesn't add
any value
2019-01-08 15:58:13 -08: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
97e3b38c3a Remove jest-environment-jsdom-global
It was needed for a case where we needed to reconfigure the jsdom
environment, that is no longer needed.
2018-10-23 11:21:40 -07: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
Ben Scott
d7beaef31f Bring back our own svg transform 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
Koen Vendrik
990a02aef4 adds tests to Header & cleans up Page (#2399)
* cleans up page and adds tests to header

* fixes scss var

* fixes context binding

* resets playground

* cleans up type export

* adds tests for ActionGroups in Header

* fixes build issues
2018-10-17 15:48:22 -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
Andrew Musgrave
5b8ce1e06a Merge branch 'master' into master-to-beta-2110 2018-10-03 13:30:46 -04:00
Solona Armstrong
c07f089251 Merge pull request #2176 from Shopify/spinner-tests
[Spinner] Add test
2018-10-03 10:14:56 -07:00
Koen Vendrik
10d5070f8b cleans up imports (#2331)
* cleans up imports

* minor import fix for Option

* fixes linting
2018-10-01 14:35:11 -04:00
Andrew Musgrave
cde5fc4628 Add d.ts to jest coverage ignore 2018-09-28 11:13:51 -04:00
Solona Armstrong
353c5bcf37 Add spinner test 2018-09-27 08:19:48 -07:00
Gord Pearson
8c664b2bfe esnext contains individual assets for better treeshaking 2018-09-13 09:46:14 -04: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
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
Daniel Leroux
bf0e6fff97 Merge branch 'src-build-beta' into master 2018-08-22 17:01:20 -07:00
Gord Pearson
2718d2e6ca Revert polaris-from-src 2018-08-21 13:35:18 -04: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
Andrew Musgrave
b39e26fe42 Add test coverage 2018-08-09 12:55:32 -04:00
Gord Pearson
c506bf0d2b esnext contains individual assets for better treeshaking 2018-07-30 12:27:30 -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
Chloe Rice
e5b618fcc1 test coverage added for embedded app action transformer 2018-06-11 16:20:48 -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
Dominic McPhee
6af1286acc Merge branch 'master' of github.com:Shopify/polaris-react into v2
# Conflicts:
#	package.json
#	src/components/Button/Button.tsx
#	src/components/Card/Section.tsx
#	src/components/ColorPicker/ColorPicker.tsx
#	src/components/DatePicker/DatePicker.tsx
#	src/components/Icon/Icon.tsx
#	src/components/Link/Link.tsx
#	src/components/Popover/Popover.tsx
#	src/components/Popover/PopoverOverlay.tsx
#	src/components/ResourceList/Item.tsx
#	src/components/ResourceList/ResourceList.tsx
#	src/components/ResourceList/tests/ResourceList.test.tsx
#	src/components/Tabs/Tabs.tsx
#	src/components/Tabs/tests/Tabs.test.tsx
#	src/components/TextField/TextField.tsx
#	src/components/TextField/tests/TextField.test.tsx
#	src/components/Tooltip/Tooltip.tsx
#	src/components/UnstyledLink/UnstyledLink.tsx
#	src/components/UnstyledLink/tests/UnstyledLink.test.tsx
#	src/components/index.ts
#	src/types.ts
2018-03-21 16:53:19 -04:00
Dimitris Psaropoulos
00468fb34e v1 with Prettier (#1171)
* Adds Prettier to Polaris
2018-03-21 16:38:01 -04:00
harbify
5a7c758bab Provider Component (#1095)
* Provider Component

* Adds json to the build

* Removes subcription / Adds a withProvider HoC

* Adds support for array i18n input
2018-03-05 14:27:11 -05:00
Dominic McPhee
6049980ea3 Fix generated classnames for nested components 2018-01-19 13:49:04 -05:00
Kaelig
6922a2ac4c Fix linting errors 2018-01-12 15:47:39 -08:00
michelle.chen@shopify.com
cbde53f8d0 add type definition and utilities to use testID 2018-01-09 10:28:47 -05:00
Dominic McPhee
1ba817bd85 Update dependencies and fix tslint errors 2017-10-31 08:28:50 -04:00
Dominic McPhee
b6557ab1d8 Upgrade to React 16
Fix usage of node on elements

Upgrade dependencies

Loosen peer dependency

Fix linting errors

Fix object formatting

Fix version ranges

Fix messenger payload reducer

Updating yarn lock

Adding types for react-transition-group

Adding changelog entry
2017-10-19 17:32:12 -04:00
Chris Sauvé
fc35eafc1a Add optimized server build (#582)
* Add optimized server build

* Fix test

* Comments on what each bundle does

* Fix test
2017-09-06 12:01:14 -04:00
Gord Pearson
01bef4c317 Consumers shouldn't need TypeScript to build Polaris
Reason:
Previously, the only option for a consumer to treeshake Polaris was to add a TypeScript dependency.  This is bad because it:
  - Forces all consumers to update TypeScript in lockstep with Polaris
  - Causes type errors if a consumer doesn't peg their `@types` to specific versions (especially React)
  - Forces JS projects to install an unneeded dependency
  - Increases build times

Solution:
Create an `esnext` dir with:
  - JSX tranlated; no other babel transorms applied
  - Minified CSS

Note: this PR doesn't touch the build segment; I'm doing just enough to make this testable in `sewing-kit`/`rails_sewing_kit_example`.
2017-07-28 16:03:36 -04:00
Chris Sauvé
b4bff8f927 Form control improvements (#391)
* Make tests less annoying

* Add ID as second parameter

* Label cleanup

* Consistent ID naming

* Hopefully fix CI

* Need to include it for circle dug
2017-06-14 15:01:17 -04:00
Chris Sauvé
906fd66d74 Update dependencies (#352)
* Update dependencies

* More dependency updates

* Fix lints

* Fix test config
2017-05-31 12:52:40 -04:00
Ismail Syed
8c70f97676 Update typescript, tslint, tslint-config-shopify 📦 (#316)
* Update typescript tslint tslint-config-shopify 📦

* Lint code

* Automated --fix

* Turn off some rules and extend them

* Fix jsx-no-bind issue

* Simplify pattern in tslint script

* Attempt to fix failing CI test on UnstyledLink

* Regenerate yarn.lock

* Revert UnstyledLink.tsx

* Fix attempt from typscript 2.3 update
2017-05-08 17:41:23 -04:00