Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🩹 fix(@roots/bud-react): allow overriding react version #1974

Merged
merged 15 commits into from
Jan 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bud",
"dockerComposeFile": ["../docker-compose.yml"],
"dockerComposeFile": ["../.docker/docker-compose.yml"],
"extensions": [
"arcanis.vscode-zipfs",
"dbaeumer.vscode-eslint",
Expand Down
23 changes: 23 additions & 0 deletions .docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: '3.8'

services:
bud:
container_name: bud
build:
context: ../
dockerfile: ./bud.dockerfile
networks:
- node-network
working_dir: /srv/bud
user: root
command: sh ./bud/up.sh
volumes:
- ../:/srv/bud

networks:
node-network:
driver: bridge

volumes:
bud:
driver: local
2 changes: 1 addition & 1 deletion config/eslint.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ module.exports = {
[`n/no-path-concat`]: ERROR,
[`n/shebang`]: OFF,
[`react/prop-types`]: OFF,
[`react/react-in-jsx-scope`]: ERROR,
[`react/react-in-jsx-scope`]: OFF,
[`react-hooks/rules-of-hooks`]: ERROR,
[`react-hooks/exhaustive-deps`]: WARN,
[`simple-import-sort/imports`]: ERROR,
Expand Down
8 changes: 8 additions & 0 deletions config/syncpack.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,13 @@ module.exports = {
dependencies: [`@types/react`, `react`, `react-dom`],
packages: [`@roots/bud-dashboard`, `@roots/bud`],
},
{
dependencies: [`**`],
packages: [`@roots/bud-support`],
},
{
dependencies: [`**`],
packages: [`issue-*`],
},
],
}
5 changes: 0 additions & 5 deletions config/vitest.setup.js

This file was deleted.

1 change: 0 additions & 1 deletion config/vitest.unit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ export default {
`tests/unit/*.test.ts`,
`tests/reproductions/*.test.ts`,
],
setupFiles: [`config/vitest.setup.js`],
},
}
55 changes: 55 additions & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
- name: Kelly Mears
email: developers@tinypixel.dev
login: kellymears
avatar: https://avatars.githubusercontent.com/u/397606?v=4
contributions: 742
- name: QWp6t
email: QWp6t@users.noreply.github.com
login: QWp6t
avatar: https://avatars.githubusercontent.com/u/2104321?v=4
contributions: 28
- name: Ben Word
email: ben@benword.com
login: retlehs
avatar: https://avatars.githubusercontent.com/u/115911?v=4
contributions: 14
- name: Scott Walkinshaw
email: scott.walkinshaw@gmail.com
login: swalkinshaw
avatar: https://avatars.githubusercontent.com/u/295605?v=4
contributions: 12
- name: Joshua Fredrickson
email: joshua@orangepineapple.com
login: joshuafredrickson
avatar: https://avatars.githubusercontent.com/u/3533660?v=4
contributions: 6
- name: Jam Risser
email: jam@codejam.ninja
login: clayrisser
avatar: https://avatars.githubusercontent.com/u/6234038?v=4
contributions: 1
- name: David Beentjes
email: 75703724+unlocdavid@users.noreply.github.com
login: unlocdavid
avatar: https://avatars.githubusercontent.com/u/75703724?v=4
contributions: 1
- name: Alex Danylyschyn
email: alex@dyyy.dev
login: alexdanylyschyn
avatar: https://avatars.githubusercontent.com/u/13107995?v=4
contributions: 1
- name: Ben
email: ben@alwaysblank.dev
login: alwaysblank
avatar: https://avatars.githubusercontent.com/u/23412884?v=4
contributions: 1
- name: Rob Record
email: rob@robrecord.com
login: robrecord
avatar: https://avatars.githubusercontent.com/u/38916?v=4
contributions: 1
- name: Spencer Merritt
email: speakincode6@gmail.com
login: SpeakInCode
avatar: https://avatars.githubusercontent.com/u/6510555?v=4
contributions: 1
37 changes: 22 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
"yarn": "1.22.19",
"npm": "8.19.2"
},
"bud": {
"extensions": {
"discovery": false
}
},
"workspaces": {
"packages": [
"sources/@roots/*",
Expand All @@ -31,35 +36,37 @@
"@repo/constants": "workspace:sources/@repo/constants",
"@repo/logger": "workspace:sources/@repo/logger",
"@repo/test-kit": "workspace:sources/@repo/test-kit",
"@roots/bud": "workspace:sources/@roots/bud",
"@roots/bud-support": "workspace:sources/@roots/bud-support",
"@skypack/package-check": "0.2.2",
"@types/express": "4.17.14",
"@types/eslint": "8.4.10",
"@types/express": "4.17.15",
"@types/fs-extra": "9.0.13",
"@types/node": "16.18.6",
"@typescript-eslint/eslint-plugin": "5.45.1",
"@typescript-eslint/parser": "5.45.1",
"@vitest/coverage-istanbul": "0.25.8",
"@vitest/ui": "0.26.2",
"eslint": "8.29.0",
"@types/lodash": "4.14.191",
"@types/node": "16.18.11",
"@types/prettier": "2.7.2",
"@typescript-eslint/eslint-plugin": "5.47.1",
"@typescript-eslint/parser": "5.47.1",
"@vitest/coverage-istanbul": "0.26.3",
"@vitest/ui": "0.26.3",
"eslint": "8.31.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-n": "15.6.0",
"eslint-plugin-react": "7.31.11",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-simple-import-sort": "8.0.0",
"execa": "6.1.0",
"fs-extra": "10.1.0",
"import-meta-resolve": "2.2.0",
"lodash": "4.17.21",
"playwright": "1.28.1",
"prettier": "2.8.0",
"playwright": "1.29.1",
"prettier": "2.8.1",
"syncpack": "8.4.11",
"ts-node": "10.9.1",
"tslib": "2.4.1",
"typescript": "4.9.3",
"vitest": "0.25.4",
"typescript": "4.9.4",
"vite": "4.0.3",
"vitest": "0.26.3",
"webpack": "5.75.0"
},
"devDependencies": {
"@types/lodash": "^4.14.191",
"eslint-plugin-n": "15.6.0"
}
}
7 changes: 5 additions & 2 deletions sources/@repo/compile-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@
"@repo/logger": "workspace:sources/@repo/logger",
"@types/fs-extra": "9.0.13",
"@types/lodash-es": "4.17.6",
"@types/node": "16.18.6",
"@types/node": "16.18.11",
"@vercel/ncc": "0.36.0",
"download-package-tarball": "1.0.7",
"fs-extra": "10.1.0",
"get-package-json-from-registry": "2.2.2",
"lodash-es": "4.17.21",
"npm-package-arg": "10.1.0",
"registry-info": "1.0.0",
"vitest": "0.25.4"
"vitest": "0.26.3"
},
"devDependencies": {
"@types/npm-package-arg": "6.1.1"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {join} from 'node:path'

import {paths} from '@repo/constants'
import {error, log} from '@repo/logger'
import downloadTarball from 'download-package-tarball'
import getPackage from 'get-package-json-from-registry'
Expand All @@ -12,7 +13,7 @@ export const vendor = async ({pkgArgument, dirArgument}) => {
dist: {tarball},
} = pkg

const dir = join(process.cwd(), dirArgument)
const dir = join(paths.sources, dirArgument)

try {
log(`downloading ${pkgArgument} to ${dir}`)
Expand Down
4 changes: 2 additions & 2 deletions sources/@repo/constants/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
}
},
"devDependencies": {
"@types/node": "16.18.6",
"vitest": "0.25.4"
"@types/node": "16.18.11",
"vitest": "0.26.3"
},
"volta": {
"extends": "../../../package.json"
Expand Down
2 changes: 1 addition & 1 deletion sources/@repo/docs/content/extensions/bud-entrypoints.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {Install} from '@site/src/docs/Install'

<Install packages="@roots/bud-entrypoints" />

## Example output
## entrypoints.json

Assets are broken down by entrypoint and then filetype.

Expand Down
35 changes: 35 additions & 0 deletions sources/@repo/docs/content/extensions/bud-wordpress-manifests.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: '@roots/bud-wordpress-manifests'
description: 'Include wordpress dependencies in entrypoints.json'
sidebar_label: '@roots/bud-wordpress-manifests'
---

import {Install} from '@site/src/docs/Install'

Installs the following extensions:

- [@roots/bud-entrypoints](bud-entrypoints.mdx)
- [@roots/bud-wordpress-dependencies](https://github.com/roots/bud/tree/main/sources/@roots/bud-wordpress-dependencies)
- [@roots/bud-wordpress-externals](https://github.com/roots/bud/tree/main/sources/@roots/bud-wordpress-externals)

## Installation

<Install packages="@roots/bud-wordpress-manifests" />

## Usage

After installation you'll find any wordpress dependencies utilized in an entrypoint incorporated into `entrypoints.json` under a new `dependencies` key.

Example:

```json title="entrypoints.json"
{
"entrypoint-a": {
"js": ["runtime.js", "entrypoint-a.js"],
"css": ["entrypoint-a.css"],
"dependencies": ["jquery", "lodash", "wp-i18n"]
}
}
```

You can use this information to load wordpress dependencies in [wp_enqueue_scripts](https://developer.wordpress.org/reference/hooks/wp_enqueue_scripts/) or [admin_enqueue_scripts](https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/).
2 changes: 0 additions & 2 deletions sources/@repo/docs/content/extensions/sage/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import IncludedExtensions from '@site/../../@roots/sage/docs/02-included-extensi

The [Sage docs](https://docs.roots.io/sage/10.x/compiling-assets) cover everything in more detail than can be found here.

The documentation here is focused largely on installation of compatible themes.

## Included extensions

<IncludedExtensions />
12 changes: 5 additions & 7 deletions sources/@repo/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,22 @@
"@repo/constants": "workspace:sources/@repo/constants",
"@svgr/webpack": "6.5.1",
"@tsconfig/docusaurus": "1.0.6",
"@types/node": "16.18.6",
"@types/file-loader": "5.0.1",
"@types/node": "16.18.11",
"@types/react": "17.0.52",
"@types/react-dom": "17.0.18",
"@types/react-helmet": "6.1.6",
"@types/react-reconciler": "0.28.0",
"@types/react-router-dom": "5.3.3",
"file-loader": "6.2.0",
"netlify-cli": "12.2.8",
"netlify-cli": "12.5.0",
"raw-loader": "4.0.2",
"ts-node": "10.9.1",
"typescript": "4.9.3",
"typescript": "4.9.4",
"url-loader": "4.1.1",
"webpack": "5.75.0"
},
"dependencies": {
"@docusaurus/theme-classic": "2.2.0",
"@docusaurus/theme-common": "2.2.0",
"axios": "1.2.1",
"axios": "1.2.2",
"clsx": "1.2.1",
"docusaurus-lunr-search": "2.3.2",
"react": "17.0.2",
Expand Down
3 changes: 2 additions & 1 deletion sources/@repo/docs/src/components/testimonial/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export default function Testimony({
<div className="avatar__intro">
<div className={styles.tweet}>
<div>
<strong>{name}</strong>{` `}
<strong>{name}</strong>
{` `}
<span className={styles.tweetMeta}>@{handle}</span>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion sources/@repo/docs/static/casts/build.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions sources/@repo/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@
},
"dependencies": {
"@repo/constants": "workspace:sources/@repo/constants",
"@types/node": "16.18.6",
"@types/node": "16.18.11",
"signale": "1.4.0",
"vitest": "0.25.4"
"vitest": "0.26.3"
},
"volta": {
"extends": "../../../package.json"
},
"devDependencies": {
"@types/signale": "1.4.4"
}
}
Loading