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

✨ improve: dashboard #2329

Merged
merged 15 commits into from
Jun 22, 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
24 changes: 7 additions & 17 deletions config/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"allowJs": true,
"allowJs": false,
"allowUnreachableCode": false,
"composite": true,
"declaration": true,
Expand All @@ -12,7 +12,7 @@
"importHelpers": true,
"incremental": true,
"jsx": "react-jsx",
"lib": ["ES2021", "DOM", "DOM.Iterable"],
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"module": "NodeNext",
"moduleDetection": "force",
"moduleResolution": "NodeNext",
Expand Down Expand Up @@ -73,26 +73,16 @@
{"path": "../sources/@roots/bud-wordpress-manifests/tsconfig.json"},
{"path": "../sources/@roots/bud-wordpress-theme-json/tsconfig.json"},
{"path": "../sources/@roots/container/tsconfig.json"},
{
"path": "../sources/@roots/critical-css-webpack-plugin/tsconfig.json"
},
{"path": "../sources/@roots/critical-css-webpack-plugin/tsconfig.json"},
{"path": "../sources/@roots/dependencies/tsconfig.json"},
{"path": "../sources/@roots/entrypoints-webpack-plugin/tsconfig.json"},
{"path": "../sources/@roots/filesystem/tsconfig.json"},
{
"path": "../sources/@roots/merged-manifest-webpack-plugin/tsconfig.json"
},
{"path": "../sources/@roots/merged-manifest-webpack-plugin/tsconfig.json"},
{"path": "../sources/@roots/sage/tsconfig.json"},
{
"path": "../sources/@roots/wordpress-dependencies-webpack-plugin/tsconfig.json"
},
{
"path": "../sources/@roots/wordpress-externals-webpack-plugin/tsconfig.json"
},
{"path": "../sources/@roots/wordpress-dependencies-webpack-plugin/tsconfig.json"},
{"path": "../sources/@roots/wordpress-externals-webpack-plugin/tsconfig.json"},
{"path": "../sources/@roots/wordpress-hmr/tsconfig.json"},
{
"path": "../sources/@roots/wordpress-theme-json-webpack-plugin/tsconfig.json"
},
{"path": "../sources/@roots/wordpress-theme-json-webpack-plugin/tsconfig.json"},
{"path": "../sources/create-bud-app/tsconfig.json"}
]
}
3 changes: 0 additions & 3 deletions examples/babel/.env

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = async app => {
app.entry('app', ['app.js', 'app.css']).splitChunks(app.isProduction)
export default async bud => {
bud.entry('app', ['app.js', 'app.css']).splitChunks(bud.isProduction)

app.babel
bud.babel
.setPresets({
'@babel/preset-env': require.resolve('@babel/preset-env'),
})
Expand Down
5 changes: 1 addition & 4 deletions examples/babel/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
{
"name": "@examples/babel",
"private": true,
"packageManager": "npm@8.19.2",
"engines": {
"node": "18.12.1"
},
"browserslist": [
"extends @roots/browserslist-config"
],
"type": "module",
"devDependencies": {
"@roots/bud": "latest",
"@roots/bud-babel": "latest",
Expand Down
5 changes: 1 addition & 4 deletions examples/basic/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"name": "@examples/basic",
"private": true,
"engines": {
"node": "18.12.1"
},
"browserslist": [
"extends @roots/browserslist-config"
],
"type": "module",
"devDependencies": {
"@roots/browserslist-config": "latest",
"@roots/bud": "latest"
}
}
3 changes: 1 addition & 2 deletions examples/config-json/bud.config.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
entry: ['app', ['app.js']],
runtime: [true],
assets: [['src/**/*.html']],
babel: {
setPluginOptions: [
"@babel/plugin-transform-runtime",
'@babel/plugin-transform-runtime',
{helpers: false, regenerator: false},
],
},
Expand Down
5 changes: 1 addition & 4 deletions examples/config-json/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
{
"name": "@examples/config-json",
"private": true,
"packageManager": "npm@8.19.2",
"engines": {
"node": "18.12.1"
},
"browserslist": [
"extends @roots/browserslist-config"
],
"type": "module",
"devDependencies": {
"@roots/bud": "latest",
"@roots/bud-babel": "latest"
Expand Down
1 change: 0 additions & 1 deletion examples/config-yml/bud.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ webpackConfig: >

# or dynamic values
log:
- 'example:'
- => 2 + 2
- => `equals ${2 + 2}`

Expand Down
4 changes: 0 additions & 4 deletions examples/config-yml/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
"name": "@examples/config-yml",
"private": true,
"packageManager": "npm@8.19.2",
"engines": {
"node": "18.12.1"
},
"browserslist": [
"extends @roots/browserslist-config"
],
Expand Down
3 changes: 0 additions & 3 deletions examples/critical-css/.env

This file was deleted.

5 changes: 0 additions & 5 deletions examples/critical-css/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
{
"name": "@examples/critical-css",
"private": true,
"packageManager": "npm@8.19.2",
"engines": {
"node": "18.12.1"
},
"browserslist": [
"extends @roots/browserslist-config"
],
"devDependencies": {
"@roots/browserslist-config": "latest",
"@roots/bud": "latest",
"@roots/bud-criticalcss": "latest",
"@roots/bud-postcss": "latest",
Expand Down
3 changes: 0 additions & 3 deletions examples/emotion/.env

This file was deleted.

1 change: 0 additions & 1 deletion examples/emotion/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "@examples/emotion",
"private": true,
"packageManager": "npm@8.19.2",
"browserslist": [
"extends @roots/browserslist-config"
],
Expand Down
3 changes: 0 additions & 3 deletions examples/esbuild/.env

This file was deleted.

5 changes: 0 additions & 5 deletions examples/esbuild/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
{
"name": "@examples/esbuild",
"private": true,
"packageManager": "npm@8.19.2",
"engines": {
"node": "18.12.1"
},
"browserslist": [
"extends @roots/browserslist-config"
],
"devDependencies": {
"@roots/browserslist-config": "latest",
"@roots/bud": "latest",
"@roots/bud-esbuild": "latest"
}
Expand Down
23 changes: 0 additions & 23 deletions examples/multi-compiler/bud.config.cjs

This file was deleted.

27 changes: 27 additions & 0 deletions examples/multi-compiler/bud.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import type {Bud} from '@roots/bud'

/**
* Configuration which runs two instances of bud.
*
* Each can be uniquely configured.
* ```
*/
export default async ({make, path, ...app}: Bud) => {
await Promise.all([
/**
* Make `theme` workspace in `./theme` and setup entrypoints
* Files will be output to `./theme/dist`
*/
make({label: 'theme', basedir: path('theme')}, async theme =>
theme.entry('theme', ['theme.js', 'theme.css']),
),

/**
* Make plugin workspace in `./plugin` and setup entrypoints
* Files will be output to `./plugin/dist`
*/
make({label: 'plugin', basedir: path('plugin')}, async plugin =>
plugin.entry('plugin', ['plugin.js', 'plugin.css']),
),
])
}
9 changes: 2 additions & 7 deletions examples/multi-compiler/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
{
"name": "@examples/multi",
"private": true,
"packageManager": "npm@8.19.2",
"engines": {
"node": "18.12.1"
},
"type": "module",
"browserslist": [
"extends @roots/browserslist-config"
],
"devDependencies": {
"@roots/browserslist-config": "latest",
"@roots/bud": "latest",
"@roots/bud-babel": "latest"
"@roots/bud": "latest"
}
}
20 changes: 10 additions & 10 deletions examples/multi-compiler/plugin/src/plugin.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const features = ['fancy', 'ecma']
const features = ["fancy", "ecma"];

features.map(feat => {
console.log(feat)
})
await Promise.all(
features.map(async (feat) => {
const { testString } = await import(`./test-module.js`);
console.log(`${feat}: ${testString}`);
})
);

/**
* Accept module updates
*
* @see https://webpack.js.org/api/hot-module-replacement
*/
import.meta.webpackHot?.accept(console.error)
if (import.meta.webpackHot) {
import.meta.webpackHot.accept(console.error);
}
1 change: 1 addition & 0 deletions examples/multi-compiler/plugin/src/test-module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const testString = `test`;
17 changes: 7 additions & 10 deletions examples/multi-compiler/theme/src/theme.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
const features = ['fancy', 'ecma']
const features = ["fancy", "ecma"];

features.map(feat => {
console.log(feat)
})
features.map((feat) => {
console.log(feat);
});

/**
* Accept module updates
*
* @see https://webpack.js.org/api/hot-module-replacement
*/
import.meta.webpackHot?.accept(console.error)
if (import.meta.webpackHot) {
import.meta.webpackHot.accept(console.error);
}
5 changes: 0 additions & 5 deletions examples/react/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
{
"name": "@examples/react",
"private": true,
"packageManager": "npm@8.19.2",
"type": "module",
"engines": {
"node": "18.12.1",
"npm": "8.19.2"
},
"browserslist": [
"extends @roots/browserslist-config"
],
Expand Down
1 change: 0 additions & 1 deletion examples/typescript/bud.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Bud} from '@roots/bud'
import '@roots/bud-typescript'

export default async (bud: Bud) => {
bud.entry({app: ['app']}).html()
Expand Down
6 changes: 0 additions & 6 deletions examples/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
"name": "@examples/typescript",
"private": true,
"packageManager": "npm@8.19.2",
"engines": {
"node": "18.12.1"
},
"browserslist": [
"extends @roots/browserslist-config"
],
Expand All @@ -13,11 +9,9 @@
"build": "yarn ts-bud build"
},
"devDependencies": {
"@roots/browserslist-config": "latest",
"@roots/bud": "latest",
"@roots/bud-babel": "latest",
"@roots/bud-typescript": "latest",
"@types/webpack-env": "latest",
"ts-node": "10.9.1"
}
}
9 changes: 3 additions & 6 deletions examples/typescript/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/* eslint-disable no-console */
const foo: string = 'black'
const el: HTMLBodyElement = document.querySelector('body')
if (el) el.style.backgroundColor = `black`

document.querySelector('body').style.backgroundColor = foo

// @ts-ignore
import.meta.webpackHot?.accept(console.error)
if (import.meta.webpackHot) import.meta.webpackHot.accept(console.error)
4 changes: 2 additions & 2 deletions examples/typescript/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"module": "esnext",
"target": "esnext",
"paths": {
"@src/*": ["./src/*"]
"@src": ["./src"]
},
"types": ["@roots/bud", "@roots/bud-typescript"]
"types": ["@roots/bud", "@roots/bud-typescript", "webpack/module"]
},
"include": ["./src", "./types"],
"exclude": ["./dist"]
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,8 @@
"node": "18.12.1",
"yarn": "1.22.19",
"npm": "8.19.2"
},
"devDependencies": {
"ink-testing-library": "3.0.0"
}
}
4 changes: 2 additions & 2 deletions sources/@repo/test-kit/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type {Bud} from '@roots/bud-framework'
import type * as Options from '@roots/bud-framework/options'
import type {Context} from '@roots/bud-framework/context'

import {path} from '@repo/constants'
import {factory} from '@roots/bud/factory'

const makeTestBud = async (
overrides: Partial<Options.Context> = {},
overrides: Partial<Context> = {},
): Promise<Bud> => {
const bud = await factory({
basedir: overrides.basedir ?? path(`tests`, `util`, `project`),
Expand Down
Loading