Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
45fdbd4
chore(deps): bump @mdx-js dependency to v2
hasparus Aug 5, 2022
e095f9d
feat(mdx): introduce useThemedStylesWithMdx instead of MDXProvider
hasparus Aug 5, 2022
dedd49a
feat(theme-provider): stop depending on @theme-ui/mdx
hasparus Aug 7, 2022
8bcf74d
feat(theme-ui): remove reexports from @theme-ui/mdx
hasparus Aug 7, 2022
5b67351
wip(mdx): make mdx test run in mjs
hasparus Aug 7, 2022
a2c97d0
refactor(mdx): split code into multiple files
hasparus Aug 9, 2022
b2c1b1c
refactor(mdx): stop exporting wrapComponentsWithThemeStyles
hasparus Aug 9, 2022
16067b8
feat(mdx): rename components export to defaultMdxComponents
hasparus Aug 9, 2022
b129213
fix(docs): update docs to match new @theme-ui/mdx API
hasparus Aug 9, 2022
b44a213
chore(test): use automatic runtime in jest-preprocess.js
hasparus Aug 9, 2022
3320ffd
test(mdx): rework @theme-ui mdx tests, move integration tests and uni…
hasparus Aug 9, 2022
2cfa6d7
chore(mdx): explicity alias MDX v2 dev deps
hasparus Aug 9, 2022
f4788ec
refactor(mdx): add a jsdoc comment to themed function
hasparus Aug 9, 2022
593f42a
docs(mdx): update readme
hasparus Aug 9, 2022
624eb7c
chore(prism): autoformat
hasparus Aug 9, 2022
dd48909
chore(sidenav): lower MDX dependency to v1
hasparus Aug 9, 2022
d054596
wip(docs): start importing Themed from @theme-ui/mdx
hasparus Aug 9, 2022
9c390b7
chore(gatsby-plugin-theme-ui): remove @ts-check because MDX v1 and MD…
hasparus Aug 9, 2022
1ebcb7a
chore(gatsby-theme-style-guide): import Themed from @theme-ui/mdx
hasparus Aug 9, 2022
a588ef0
chore(ts): add skipLibCheck: true because @types/react-color deps are…
hasparus Aug 9, 2022
501325f
chore(deps): update yarn.lock
hasparus Aug 9, 2022
753d6b8
chore(eslint): disable jsx-pascal-case rule for now
hasparus Aug 9, 2022
3fd69e6
chore(ci): use Node 18 on GitHub Actions
hasparus Aug 9, 2022
9885ef1
chore(docs): add missing @mdx-js/mdx dependency to the docs package
beerose Aug 9, 2022
38269bd
chore(docs): import Themed from @theme-ui/mdx
beerose Aug 9, 2022
3c8d848
chore(gatsby-theme-style-guide): import Themed from @theme-ui/mdx
beerose Aug 9, 2022
6078dbf
chore(style-guide): import Themed from @theme-ui/mdx in the README.md…
beerose Aug 9, 2022
ee64f37
chore(prism): add @theme-ui/mdx to peer dependencies
beerose Aug 9, 2022
b4b835c
chore(examples): import Themed from @theme-ui/mdx and add it to peer …
beerose Aug 9, 2022
3ca2687
chore(gatsby-theme-style-guide): add @theme-ui/mdx to dependecies
beerose Aug 9, 2022
9fc6ac9
chore(gatsby-plugin-theme-ui): add @theme-ui/mdx to peer dependecies
beerose Aug 9, 2022
e1205b4
chore(docs): add @theme-ui/mdx to dependencies
beerose Aug 9, 2022
ef60f60
Merge pull request #2289 from beerose/opt-in-mdx-docs
hasparus Aug 10, 2022
49443e0
chore(sidenav): fix type errors
hasparus Aug 11, 2022
2cd3462
chore(gatsby-plugin-theme-ui): make tests work
hasparus Aug 11, 2022
3a54f91
chore(custom-properties): make tests work
hasparus Aug 11, 2022
bf6f0f1
chore(theme-ui): remove tests related to mdx from the umbrella package
hasparus Aug 11, 2022
37876e5
docs: new color scheme dark -- previous had bad contrats in code snip…
hasparus Aug 11, 2022
ad75610
fix(prism): fix specificity problem in punctuation and comments
hasparus Aug 11, 2022
2c1a420
chore(gatsby-plugin-theme-ui): remove unused import
hasparus Aug 11, 2022
e89f3b5
docs: write migration notes for v0.15
hasparus Aug 11, 2022
111027e
docs(mdx): write better docs for @theme-ui/mdx
hasparus Aug 11, 2022
404a7ad
chore(docs): try to handle trailing slashes better to get rid of dupl…
hasparus Aug 11, 2022
4dc030b
chore(mdx): add @types/mdx to peerDependencies
hasparus Aug 11, 2022
e261376
feat(theme-ui): remove IntrinsicSxElements type
hasparus Aug 11, 2022
53270c1
Add peerDependency on @theme-ui/css to gatsby-plugin-theme-ui
hasparus Aug 11, 2022
43b508c
chore(docs): add @babel/helper-string-parser to make docs build
hasparus Aug 11, 2022
08ea652
docs(components): update box.mdx for better contrast
hasparus Aug 11, 2022
1e50846
Update snapshots
hasparus Aug 11, 2022
398f486
chore: bump deps
hasparus Aug 11, 2022
d3baceb
chore(test): use v8 coverage provider to handle mjs
hasparus Aug 11, 2022
0921ad1
Merge branch 'develop' into opt-in-mdx
hasparus Aug 12, 2022
ab199c5
Merge branch 'develop' into opt-in-mdx
hasparus Aug 15, 2022
40437f4
Merge branch 'develop' into opt-in-mdx
hasparus Aug 15, 2022
26f4866
chore(examples): remove create-react-app example
hasparus Aug 18, 2022
35b16cd
chore(examples): remove custom-pragma example
hasparus Aug 18, 2022
0b1ac70
chore(deps): remove Lerna
hasparus Aug 18, 2022
05ddf0a
chore(examples): remove dark-mode example, as it does not work
hasparus Aug 18, 2022
ae521ed
feat(core): move parse-props package content to @theme-ui/core
hasparus Aug 18, 2022
0170cae
chore: remove lerna.json
hasparus Aug 18, 2022
1fa5159
chore: add @mdx-js/* packages to nohoist
hasparus Aug 18, 2022
4ef36b8
chore: bump version to unpublished 0.15.0-rc.1 to fix workspaces install
hasparus Aug 18, 2022
0deef03
docs(examples): make the Gatsby example work with MDX v2
hasparus Aug 18, 2022
1e607dc
wip: use PNPM because we need workspace: protocol for tests
hasparus Aug 27, 2022
f7807d9
chore: update devDependencies to run pnpm install almost without errors
hasparus Aug 27, 2022
c2aadf9
chore(examples): make typography.js example work again (now with TS)
hasparus Aug 27, 2022
1e8f0e4
wip: solve more dependency warnings
hasparus Aug 29, 2022
acb5191
chore(deps): add a pnpm hook to ensure @emotion/react is installed ju…
hasparus Aug 29, 2022
1b2d488
chore(deps): eliminate duplicate Emotion versions popping up because …
hasparus Aug 29, 2022
f8c7349
docs: stop mentioning @mdx-js/react@1 in the installation docs
hasparus Aug 29, 2022
e319b24
chore(tests): add missing dev deps to pass typecheck on tests
hasparus Aug 29, 2022
3f84d43
chore(deps): add missing dev deps to pass typecheck
hasparus Aug 29, 2022
c6d176c
chore(pnpm): remove mentions of yarn
hasparus Aug 30, 2022
0e3572a
chore(eslint): fix lint errors
hasparus Aug 30, 2022
e854ff2
docs: mention you can now use Theme UI with MDX 2
hasparus Aug 30, 2022
e20f263
chore: add --no-frozen-lockfile to try to get CI to pass
hasparus Aug 30, 2022
3327c85
chore: add peerDependencyRules to package.json
hasparus Aug 30, 2022
437d974
chore(theme-ui): explicitly annotate BaseStyles component
hasparus Aug 30, 2022
7c3bc63
chore(ci): bump Node in Codesandbox CI
hasparus Aug 30, 2022
f01ced7
chore(test): make tests work after adopting pnpm
hasparus Aug 30, 2022
eecb97f
test: update snapshots
hasparus Aug 30, 2022
e9285a3
chore(gatsby-plugin-theme-ui): add a dev dependency to make tests pass
hasparus Aug 30, 2022
21f1aca
chore(codesandbox): use Node 16 again
hasparus Aug 30, 2022
397cef5
chore(codesandbox): add installCommand
hasparus Aug 30, 2022
31297b3
Use typecheck-built-files script to test published develop release
hasparus Aug 31, 2022
93a65b0
chore: try using install-command with cypress-io/github-action
hasparus Aug 31, 2022
703775d
docs: reduce indentation in migration notes
hasparus Aug 31, 2022
2fb274a
docs: reorder sidebar to move MDX-related docs together
hasparus Aug 31, 2022
847343a
chore: try using install: false with cypress-io/github-action
hasparus Aug 31, 2022
6b6008c
Merge branch 'develop' into opt-in-mdx
hasparus Sep 1, 2022
d28e67e
chore(e2e): remove nested gitignores
hasparus Sep 1, 2022
c5a8f35
ci(cypress): use wait-on in the run command
hasparus Sep 1, 2022
c410ad9
docs: update mdx related docs
hasparus Sep 1, 2022
30328e3
docs: move Themed page in docs sidebar closer to MDX pages
hasparus Sep 1, 2022
0782785
Fix typo
lachlanjc Sep 7, 2022
6389148
feat(mdx): remove Themed component
Sep 10, 2022
cd66918
Merge branch 'develop' into opt-in-mdx
hasparus Sep 10, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"installCommand": "codesandbox-ci:install",
"buildCommand": "build",
"packages": ["packages/theme-ui", "packages/core"],
"sandboxes": ["/examples/next", "/examples/gatsby-plugin"],
Expand Down
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ module.exports = {
// TypeScript checks this
'no-undef': 'off',
'no-lone-blocks': 'off',

'react/jsx-pascal-case': 'off', // needs a fix in @theme-ui/mdx
},
overrides: [
{
Expand Down
3 changes: 0 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ updates:
- dependency-name: reakit
versions:
- 1.3.6
- dependency-name: lerna
versions:
- 4.0.0
- dependency-name: prism-react-renderer
versions:
- 1.2.0
Expand Down
51 changes: 28 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,32 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
- uses: pnpm/action-setup@v2
with:
node-version: 14.x
version: 7

- uses: bahmutov/npm-install@v1
- uses: actions/setup-node@v2
with:
# By default, bahmutov/npm-install uses --frozen-lockfile
install-command:
yarn --ignore-optional --pure-lockfile --non-interactive
node-version: 18.x
cache: 'pnpm'

- name: Install
run: pnpm install --no-optional --no-frozen-lockfile

- name: Run linter
run: yarn lint --quiet
run: pnpm lint --quiet

- name: Run tests and collect coverage
run: yarn test --coverage
run: pnpm test:coverage

- name: Typecheck
run: yarn typecheck
run: pnpm typecheck

- name: Build
run: yarn build

- name: Typecheck built files
run: |
cd scripts/typecheck-built-files
yarn
yarn start
run: pnpm build

- name: Run Codechecks
run: yarn codechecks
run: pnpm codechecks
env:
CC_SECRET: ${{ secrets.CC_SECRET }}
if: ${{ env.CC_SECRET != '' }}
Expand Down Expand Up @@ -80,14 +76,17 @@ jobs:
- name: Prepare repository
run: git fetch --unshallow --tags

- uses: actions/setup-node@v2
- uses: pnpm/action-setup@v2
with:
node-version: 14.x
version: 7

- uses: bahmutov/npm-install@v1
- uses: actions/setup-node@v2
with:
install-command:
yarn --ignore-optional --pure-lockfile --non-interactive
node-version: 18.x
cache: 'pnpm'

- name: Install
run: pnpm install --no-optional --no-frozen-lockfile

- name: Queue in release turnstile
id: turnstyle
Expand All @@ -104,4 +103,10 @@ jobs:
GITHUB_TOKEN: ${{ secrets.AUTO_RELEASE_GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn release
run: pnpm release

- name: Check published prerelease
if: github.ref == 'refs/heads/develop'
run: |
cd scripts/typecheck-built-files
pnpm start
23 changes: 13 additions & 10 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,29 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
- uses: pnpm/action-setup@v2
with:
node-version: 14.x
version: 7

- uses: bahmutov/npm-install@v1
- uses: actions/setup-node@v2
with:
install-command: yarn --pure-lockfile --non-interactive
node-version: 18.x
cache: 'pnpm'

- name: Install
run: pnpm install --no-frozen-lockfile

- run: yarn build # build preconstruct libs
- run: yarn build:docs
- run: pnpm build:docs

- uses: cypress-io/github-action@v4
- uses: cypress-io/github-action@v4.2.0
with:
record: true
parallel: true
working-directory: packages/e2e
command: yarn record
start: yarn serve-docs
wait-on: 'http://localhost:9000'
command: pnpm record
start: pnpm serve-docs
tag: ${{ github.event_name }}
install: false
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
Expand Down
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.cache
public
package-lock.json
node_modules
dist
coverage
Expand All @@ -11,8 +10,5 @@ coverage
.envrc
.envrc.ps1
.publish-log.txt
.yarn-error.log
yarn-error.log

yarn.lock
.vercel
/examples/**/yarn.lock
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
auto-install-peers=true
public-hoist-pattern[]='*eslint*'
public-hoist-pattern[]='*prettier*'
public-hoist-pattern[]='@emotion/react'
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
42 changes: 42 additions & 0 deletions .pnpmfile.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
const PACKAGES_WITH_ENFORCED_SINGLE_VERSION = ['@emotion/react']

/**
* @author remorses
* @see https://github.com/pnpm/pnpm/issues/2713#issuecomment-1141000426
*/
function afterAllResolved(lockfile, context) {
context.log('Checking duplicate packages...')

const packagesKeys = Object.keys(lockfile.packages)
const found = {}
for (let p of packagesKeys) {
for (let x of PACKAGES_WITH_ENFORCED_SINGLE_VERSION) {
if (p.startsWith(`/${x}/`)) {
if (found[x]) {
found[x] += 1
} else {
found[x] = 1
}
}
}
}

let msg = ''

for (let p in found) {
const count = found[p]
if (count > 1) {
msg += `${p} found ${count} times\n`
}
}

if (msg) console.warn('\n\n\n🔥\n', '🔥', msg, '\n🔥\n\n\n')

return lockfile
}

module.exports = {
hooks: {
afterAllResolved,
},
}
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
public
package-lock.json
yarn.lock
pnpm-lock.yaml
node_modules
dist
coverage
Expand Down
61 changes: 61 additions & 0 deletions MIGRATING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,66 @@
# Migration Guides

## v0.15

**MDX is now opt-in.**

_If your project is not using MDX or importing `Themed`, you shouldn't need to
change anything._

If you are using MDX, this change enables you to use Theme UI together with
[MDX v2](https://mdxjs.com/blog/v2/).

- `MDXProvider` is no longer included in Theme UI `ThemeProvider`, and has been
removed in favour of an `useThemedStylesWithMdx` hook.

**Migration:** Use `useThemedStylesWithMdx` together with `MDXProvider` and
`useMDXComponents` from `@mdx-js/react`.

```tsx
import {
MDXProvider,
useMDXComponents,
Components as MDXComponents,
MergeComponents as MergeMDXComponents,
} from '@mdx-js/react'
import { useThemedStylesWithMdx } from '@theme-ui/mdx'
import { ThemeProvider, Theme } from 'theme-ui'

interface MyProviderProps {
theme: Theme
components?: MDXComponents | MergeMDXComponents
children: React.ReactNode
}
function MyProvider({ theme, components, children }: MyProviderProps) {
const componentsWithStyles = useThemedStylesWithMdx(
useMDXComponents(components)
)

return (
<ThemeProvider theme={theme}>
<MDXProvider components={componentsWithStyles}>{children}</MDXProvider>
</ThemeProvider>
)
}
```

- `Themed` components dict and other exports from `@theme-ui/mdx` are no longer
reexported from `theme-ui`.

**Migration:** Import it from `@theme-ui/mdx` instead.

```diff
- import { Themed } from 'theme-ui'
+ import { Themed } from '@theme-ui/mdx'
```

**`Themed` object is no longer a component**

_Previously, it was an alias for `Themed.div`._

- **Migration:** Whenever you're using `<Themed />`, use `<Themed.div />`
instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the changes to the example projects, seems like we're supporting MDX v2 as well, so let's mention that here since it's important news, & link to https://mdxjs.com/blog/v2/ so people know what's new/what's involved if they want to take on upgrading that too

## v0.14

- `theme-ui`, `@theme-ui/components` and `@theme-ui/mdx` packages no longer
Expand Down
1 change: 0 additions & 1 deletion examples/create-react-app/.env

This file was deleted.

23 changes: 0 additions & 23 deletions examples/create-react-app/.gitignore

This file was deleted.

68 changes: 0 additions & 68 deletions examples/create-react-app/README.md

This file was deleted.

Loading