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.
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
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
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%)
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)
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.
* 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
* 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
* 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.
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`.